@sports-alliance/sports-lib 7.0.9 → 7.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  import { DataBare } from './data.bare';
2
- export declare abstract class DataArray extends DataBare {
3
- protected value: string[];
2
+ export declare abstract class DataArray extends DataBare<string[]> {
4
3
  constructor(value: string[]);
5
- getValue(): string[];
4
+ getValue(formatForDataType?: string): string[];
6
5
  isValueTypeValid(value: any): boolean;
7
6
  }
@@ -7,7 +7,7 @@ class DataArray extends data_bare_1.DataBare {
7
7
  super(value);
8
8
  this.value = value;
9
9
  }
10
- getValue() {
10
+ getValue(formatForDataType) {
11
11
  return this.value;
12
12
  }
13
13
  isValueTypeValid(value) {
@@ -1,4 +1,5 @@
1
1
  import { Data } from './data';
2
- export declare abstract class DataBare extends Data {
2
+ import { DataPositionInterface } from './data.position.interface';
3
+ export declare abstract class DataBare<T extends number | string | boolean | string[] | DataPositionInterface = number | string | boolean | string[] | DataPositionInterface> extends Data<T> {
3
4
  static unit: string;
4
5
  }
@@ -1,15 +1,15 @@
1
1
  import { DataInterface, UnitSystem } from './data.interface';
2
2
  import { DataJSONInterface } from './data.json.interface';
3
3
  import { DataPositionInterface } from './data.position.interface';
4
- export declare abstract class Data implements DataInterface {
4
+ export declare abstract class Data<T extends number | string | boolean | string[] | DataPositionInterface = number | string | boolean | string[] | DataPositionInterface> implements DataInterface {
5
5
  static type: string;
6
6
  static unit: string;
7
7
  static displayType?: string;
8
8
  static unitSystem: UnitSystem;
9
- protected value: number | string | boolean | string[] | DataPositionInterface;
10
- protected constructor(value: string | number | boolean | string[] | DataPositionInterface);
11
- setValue(value: string | number | boolean | string[] | DataPositionInterface): this;
12
- getValue(formatForDataType?: string): string | number | boolean | string[] | DataPositionInterface;
9
+ protected value: T;
10
+ protected constructor(value: T);
11
+ setValue(value: number | string | boolean | string[] | DataPositionInterface): this;
12
+ getValue(formatForDataType?: string): T;
13
13
  getDisplayValue(): number | string | string[];
14
14
  getType(): string;
15
15
  getUnit(): string;
@@ -1,6 +1,5 @@
1
1
  import { DataBare } from './data.bare';
2
- export declare abstract class DataNumber extends DataBare {
3
- protected value: number;
2
+ export declare abstract class DataNumber extends DataBare<number> {
4
3
  constructor(value: number);
5
4
  getValue(formatForDataType?: string): number;
6
5
  isValueTypeValid(value: any): boolean;
@@ -1,10 +1,9 @@
1
1
  import { DataBare } from './data.bare';
2
2
  import { DataPositionInterface } from './data.position.interface';
3
- export declare class DataPosition extends DataBare {
3
+ export declare class DataPosition extends DataBare<DataPositionInterface> {
4
4
  static type: string;
5
- protected value: DataPositionInterface;
6
5
  constructor(value: DataPositionInterface);
7
- getValue(): DataPositionInterface;
6
+ getValue(formatForDataType?: string): DataPositionInterface;
8
7
  getDisplayValue(): string;
9
8
  isValueTypeValid(value: any): boolean;
10
9
  }
@@ -8,7 +8,7 @@ class DataPosition extends data_bare_1.DataBare {
8
8
  super(value);
9
9
  this.value = value;
10
10
  }
11
- getValue() {
11
+ getValue(formatForDataType) {
12
12
  return this.value;
13
13
  }
14
14
  getDisplayValue() {
@@ -1,7 +1,6 @@
1
1
  import { DataBare } from './data.bare';
2
- export declare abstract class DataString extends DataBare {
3
- protected value: string;
2
+ export declare abstract class DataString extends DataBare<string> {
4
3
  constructor(value: string);
5
- getValue(): string;
4
+ getValue(formatForDataType?: string): string;
6
5
  isValueTypeValid(value: any): boolean;
7
6
  }
@@ -7,7 +7,7 @@ class DataString extends data_bare_1.DataBare {
7
7
  super(value);
8
8
  this.value = value;
9
9
  }
10
- getValue() {
10
+ getValue(formatForDataType) {
11
11
  return this.value;
12
12
  }
13
13
  isValueTypeValid(value) {
@@ -1,7 +1,6 @@
1
1
  import { DataBare } from './data.bare';
2
- export declare abstract class DataArray extends DataBare {
3
- protected value: string[];
2
+ export declare abstract class DataArray extends DataBare<string[]> {
4
3
  constructor(value: string[]);
5
- getValue(): string[];
4
+ getValue(formatForDataType?: string): string[];
6
5
  isValueTypeValid(value: any): boolean;
7
6
  }
@@ -1,4 +1,5 @@
1
1
  import { Data } from './data';
2
- export declare abstract class DataBare extends Data {
2
+ import { DataPositionInterface } from './data.position.interface';
3
+ export declare abstract class DataBare<T extends number | string | boolean | string[] | DataPositionInterface = number | string | boolean | string[] | DataPositionInterface> extends Data<T> {
3
4
  static unit: string;
4
5
  }
@@ -1,15 +1,15 @@
1
1
  import { DataInterface, UnitSystem } from './data.interface';
2
2
  import { DataJSONInterface } from './data.json.interface';
3
3
  import { DataPositionInterface } from './data.position.interface';
4
- export declare abstract class Data implements DataInterface {
4
+ export declare abstract class Data<T extends number | string | boolean | string[] | DataPositionInterface = number | string | boolean | string[] | DataPositionInterface> implements DataInterface {
5
5
  static type: string;
6
6
  static unit: string;
7
7
  static displayType?: string;
8
8
  static unitSystem: UnitSystem;
9
- protected value: number | string | boolean | string[] | DataPositionInterface;
10
- protected constructor(value: string | number | boolean | string[] | DataPositionInterface);
11
- setValue(value: string | number | boolean | string[] | DataPositionInterface): this;
12
- getValue(formatForDataType?: string): string | number | boolean | string[] | DataPositionInterface;
9
+ protected value: T;
10
+ protected constructor(value: T);
11
+ setValue(value: number | string | boolean | string[] | DataPositionInterface): this;
12
+ getValue(formatForDataType?: string): T;
13
13
  getDisplayValue(): number | string | string[];
14
14
  getType(): string;
15
15
  getUnit(): string;
@@ -1,6 +1,5 @@
1
1
  import { DataBare } from './data.bare';
2
- export declare abstract class DataNumber extends DataBare {
3
- protected value: number;
2
+ export declare abstract class DataNumber extends DataBare<number> {
4
3
  constructor(value: number);
5
4
  getValue(formatForDataType?: string): number;
6
5
  isValueTypeValid(value: any): boolean;
@@ -1,10 +1,9 @@
1
1
  import { DataBare } from './data.bare';
2
2
  import { DataPositionInterface } from './data.position.interface';
3
- export declare class DataPosition extends DataBare {
3
+ export declare class DataPosition extends DataBare<DataPositionInterface> {
4
4
  static type: string;
5
- protected value: DataPositionInterface;
6
5
  constructor(value: DataPositionInterface);
7
- getValue(): DataPositionInterface;
6
+ getValue(formatForDataType?: string): DataPositionInterface;
8
7
  getDisplayValue(): string;
9
8
  isValueTypeValid(value: any): boolean;
10
9
  }
@@ -1,7 +1,6 @@
1
1
  import { DataBare } from './data.bare';
2
- export declare abstract class DataString extends DataBare {
3
- protected value: string;
2
+ export declare abstract class DataString extends DataBare<string> {
4
3
  constructor(value: string);
5
- getValue(): string;
4
+ getValue(formatForDataType?: string): string;
6
5
  isValueTypeValid(value: any): boolean;
7
6
  }
package/lib/esm/index.js CHANGED
@@ -2758,7 +2758,7 @@ var DataString = class extends DataBare {
2758
2758
  super(value);
2759
2759
  this.value = value;
2760
2760
  }
2761
- getValue() {
2761
+ getValue(formatForDataType) {
2762
2762
  return this.value;
2763
2763
  }
2764
2764
  isValueTypeValid(value) {
@@ -2853,7 +2853,7 @@ var DataArray = class extends DataBare {
2853
2853
  super(value);
2854
2854
  this.value = value;
2855
2855
  }
2856
- getValue() {
2856
+ getValue(formatForDataType) {
2857
2857
  return this.value;
2858
2858
  }
2859
2859
  isValueTypeValid(value) {
@@ -3246,7 +3246,7 @@ var DataPosition = class extends DataBare {
3246
3246
  super(value);
3247
3247
  this.value = value;
3248
3248
  }
3249
- getValue() {
3249
+ getValue(formatForDataType) {
3250
3250
  return this.value;
3251
3251
  }
3252
3252
  getDisplayValue() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sports-alliance/sports-lib",
3
- "version": "7.0.9",
3
+ "version": "7.0.10",
4
4
  "description": "A Library to for importing / exporting and processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc",
5
5
  "keywords": [
6
6
  "gpx",
@@ -32,7 +32,7 @@
32
32
  }
33
33
  },
34
34
  "scripts": {
35
- "build": "npm run clean && tsc --emitDeclarationOnly --outDir lib/esm --project tsconfig.esm.json && tsc --project tsconfig.cjs.json && esbuild src/index.ts --bundle --format=esm --outfile=lib/esm/index.js --platform=node --external:fast-xml-parser --external:fit-file-parser --external:geolib --external:gpx-builder --external:kalmanjs --external:lowpassf --external:moving-median --external:xmldom --external:tslib --external:@garmin/fitsdk && echo '{\"type\": \"commonjs\"}' > lib/cjs/package.json && echo '{\"type\": \"module\"}' > lib/esm/package.json",
35
+ "build": "npm run clean && tsc --emitDeclarationOnly --outDir lib/esm --project tsconfig.esm.json && tsc --project tsconfig.cjs.json && esbuild src/index.ts --bundle --format=esm --outfile=lib/esm/index.js --platform=node --packages=external && echo '{\"type\": \"commonjs\"}' > lib/cjs/package.json && echo '{\"type\": \"module\"}' > lib/esm/package.json",
36
36
  "watch": "npm run build -- --watch",
37
37
  "clean": "rimraf ./lib/",
38
38
  "generate:docs": "npm run build && typedoc --out docs --target es6 --theme minimal --mode file src",
package/.editorconfig DELETED
@@ -1,14 +0,0 @@
1
- # Editor configuration, see http://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- charset = utf-8
6
- indent_style = space
7
- indent_size = 2
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
10
- max_line_length = 120
11
-
12
- [*.md]
13
- max_line_length = off
14
- trim_trailing_whitespace = false
package/.eslintignore DELETED
@@ -1,4 +0,0 @@
1
- # Generated data
2
- docs
3
- lib
4
- node_modules
package/.eslintrc.js DELETED
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- parser: '@typescript-eslint/parser',
4
- plugins: ['@typescript-eslint', 'prettier'],
5
- extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
6
- rules: {
7
- 'prettier/prettier': 'error'
8
- }
9
- };
package/.prettierignore DELETED
@@ -1,25 +0,0 @@
1
- # Generated data
2
- docs
3
- lib
4
- coverage
5
- node_modules
6
-
7
- # OS/IDE
8
- .vscode
9
- .idea
10
- .DS_Store
11
-
12
- # Others
13
- *.json
14
- *.md
15
- *.yml
16
- *.log
17
- .editorconfig
18
- .gitignore
19
- .prettierignore
20
- LICENSE
21
-
22
- # Lib specific
23
- *.gpx
24
- *.tcx
25
- *.fit
package/.prettierrc.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "printWidth": 120,
3
- "singleQuote": true,
4
- "useTabs": false,
5
- "tabWidth": 2,
6
- "semi": true,
7
- "trailingComma": "none",
8
- "bracketSpacing": true,
9
- "arrowParens": "avoid",
10
- "parser": "typescript",
11
- "endOfLine": "auto"
12
- }
@@ -1,76 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, sex characteristics, gender identity and expression,
9
- level of experience, education, socio-economic status, nationality, personal
10
- appearance, race, religion, or sexual identity and orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at jimmykane9@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
-
73
- [homepage]: https://www.contributor-covenant.org
74
-
75
- For answers to common questions about this code of conduct, see
76
- https://www.contributor-covenant.org/faq
package/jest.config.js DELETED
@@ -1,23 +0,0 @@
1
- module.exports = {
2
- transform: {
3
- '^.+\\.(ts|tsx)$': 'ts-jest',
4
- '^.+\\.(js|jsx)$': 'babel-jest'
5
- },
6
- transformIgnorePatterns: ['node_modules/(?!fit-file-parser|@garmin/fitsdk)'],
7
- testPathIgnorePatterns: ['<rootDir>/lib/', '<rootDir>/node_modules/'],
8
- moduleNameMapper: {
9
- '^node:buffer$': '<rootDir>/node_modules/buffer/index.js'
10
- },
11
- testTimeout: 960000, // Allow 480s for integrations tests
12
- testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
13
- moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
14
- // Since Jest 27 'node' env is the default and recommended one.
15
- // Switch to 'jsdom' to execute test in browser env (was previous behavior until Jest 26)
16
- testEnvironment: 'node',
17
- globals: {
18
- 'ts-jest': {
19
- babelConfig: true
20
- }
21
- },
22
- setupFilesAfterEnv: ['<rootDir>/jest.setup.ts']
23
- };
package/tsconfig.cjs.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "module": "commonjs",
5
- "outDir": "./lib/cjs",
6
- }
7
- }
package/tsconfig.esm.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "module": "es2020",
5
- "moduleResolution": "node",
6
- "outDir": "./lib/esm"
7
- }
8
- }
package/tsconfig.lib.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "exclude": [
4
- "lib",
5
- "src/specs/",
6
- "src/**/*.spec.ts"
7
- ]
8
- }