@signpostmarv/intermediary-number 0.5.0 → 0.5.2

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.
package/index.js CHANGED
@@ -2,4 +2,3 @@ export * from './lib/IntermediaryNumber';
2
2
  export * from './lib/IntermediaryNumberTypes';
3
3
  export * from './lib/Numbers';
4
4
  export * from './lib/NumberStrings';
5
- //# sourceMappingURL=index.js.map
package/lib/Docs.json.js CHANGED
@@ -4,4 +4,3 @@ export class NotAnAmountString extends Error {
4
4
  export function is_string(maybe) {
5
5
  return 'string' === typeof maybe;
6
6
  }
7
- //# sourceMappingURL=Docs.json.js.map
@@ -53,8 +53,8 @@ interface CanDoMath<ResultType extends CanDoMath_result_types = CanDoMath_result
53
53
  plus(value: math_types): ResultType;
54
54
  times(value: math_types): ResultType;
55
55
  abs(): (operand_types);
56
- max(first: math_types, ...remaining: math_types[]): math_types;
57
- min(first: math_types, ...remaining: math_types[]): math_types;
56
+ max(first: math_types, ...remaining: math_types[]): operand_types;
57
+ min(first: math_types, ...remaining: math_types[]): operand_types;
58
58
  }
59
59
  interface CanResolveMath<T extends CanDoMath_result_types = CanDoMath_result_types> extends CanDoMath<T, string> {
60
60
  resolve(): IntermediaryNumber;
@@ -93,8 +93,8 @@ export declare class IntermediaryNumber implements CanDoMathWithDispose {
93
93
  isLessThan(value: math_types): boolean;
94
94
  isOne(): boolean;
95
95
  isZero(): boolean;
96
- max(first: math_types, ...remaining: math_types[]): math_types;
97
- min(first: math_types, ...remaining: math_types[]): math_types;
96
+ max(first: math_types, ...remaining: math_types[]): operand_types;
97
+ min(first: math_types, ...remaining: math_types[]): operand_types;
98
98
  minus(value: math_types): operand_types;
99
99
  modulo(value: math_types): operand_types;
100
100
  plus(value: math_types): operand_types;
@@ -133,8 +133,8 @@ export declare class IntermediaryCalculation implements CanResolveMathWithDispos
133
133
  isLessThan(value: math_types): boolean;
134
134
  isOne(): boolean;
135
135
  isZero(): boolean;
136
- max(first: math_types, ...remaining: math_types[]): math_types;
137
- min(first: math_types, ...remaining: math_types[]): math_types;
136
+ max(first: math_types, ...remaining: math_types[]): operand_types;
137
+ min(first: math_types, ...remaining: math_types[]): operand_types;
138
138
  minus(value: math_types): operand_types;
139
139
  modulo(value: math_types): operand_types;
140
140
  plus(value: math_types): operand_types;
@@ -169,6 +169,7 @@ export declare class TokenScanParseError extends Error {
169
169
  constructor(message: string, scan: TokenScan_parsing_value, state: TokenScan_tokenizer, current?: TokenSpan<TokenSpan_types>);
170
170
  }
171
171
  export declare class TokenScan implements CanResolveMathWithDispose {
172
+ #private;
172
173
  private readonly internal;
173
174
  readonly value: string | [TokenScan, operation_types, math_types];
174
175
  private constructor();
@@ -185,8 +186,8 @@ export declare class TokenScan implements CanResolveMathWithDispose {
185
186
  isLessThan(value: math_types): boolean;
186
187
  isOne(): boolean;
187
188
  isZero(): boolean;
188
- max(first: math_types, ...remaining: math_types[]): math_types;
189
- min(first: math_types, ...remaining: math_types[]): math_types;
189
+ max(first: math_types, ...remaining: math_types[]): operand_types;
190
+ min(first: math_types, ...remaining: math_types[]): operand_types;
190
191
  minus(value: math_types): TokenScan;
191
192
  modulo(value: math_types): TokenScan;
192
193
  plus(value: math_types): TokenScan;
@@ -633,10 +633,7 @@ export class TokenScan {
633
633
  this.value = value;
634
634
  }
635
635
  get parsed() {
636
- if (undefined === this.internal.parsed) {
637
- this.internal.parsed = TokenScan.parse_scan(this);
638
- }
639
- return this.internal.parsed;
636
+ return this.#parse();
640
637
  }
641
638
  get resolve_type() {
642
639
  return this.parsed.resolve_type;
@@ -653,15 +650,21 @@ export class TokenScan {
653
650
  get valid() {
654
651
  if (undefined === this.internal.valid) {
655
652
  try {
656
- this.parsed;
653
+ this.#parse();
657
654
  this.internal.valid = true;
658
655
  }
659
- catch (err) {
656
+ catch {
660
657
  this.internal.valid = false;
661
658
  }
662
659
  }
663
660
  return this.internal.valid;
664
661
  }
662
+ #parse() {
663
+ if (undefined === this.internal.parsed) {
664
+ this.internal.parsed = TokenScan.parse_scan(this);
665
+ }
666
+ return this.internal.parsed;
667
+ }
665
668
  abs() {
666
669
  return this.parsed.abs();
667
670
  }
@@ -1012,4 +1015,3 @@ export class TokenScan {
1012
1015
  }
1013
1016
  }
1014
1017
  //#endregion
1015
- //# sourceMappingURL=IntermediaryNumber.js.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=IntermediaryNumberTypes.js.map
@@ -51,4 +51,3 @@ export class NumberStrings {
51
51
  }
52
52
  }
53
53
  }
54
- //# sourceMappingURL=NumberStrings.js.map
package/lib/Numbers.js CHANGED
@@ -47,4 +47,3 @@ export class Numbers {
47
47
  return result;
48
48
  }
49
49
  }
50
- //# sourceMappingURL=Numbers.js.map
package/package.json CHANGED
@@ -11,21 +11,21 @@
11
11
  "exports": "./index.js",
12
12
  "types": "./index.d.ts",
13
13
  "devDependencies": {
14
- "@signpostmarv/eslint-config": "^0.1.0",
15
- "@types/eslint": "^8.56.10",
14
+ "@satisfactory-dev/custom-assert": "^0.2.3",
15
+ "@signpostmarv/eslint-config": "^0.2.0",
16
+ "@types/eslint": "^9.6.0",
16
17
  "@types/node": "^20.14.2",
17
18
  "c8": "^10.1.2",
18
- "eslint": "^8.57.0",
19
+ "eslint": "^9.9.1",
19
20
  "glob": "^10.4.1",
20
21
  "prettier": "^3.3.2",
21
22
  "ts-node": "^10.9.2",
22
23
  "typescript": "~5.5.2",
23
- "typescript-eslint": "^7.13.0"
24
+ "typescript-eslint": "^8.2.0"
24
25
  },
25
26
  "dependencies": {
26
- "@satisfactory-dev/custom-assert": "^0.2.2",
27
27
  "bignumber.js": "^9.1.2",
28
28
  "fraction.js": "^4.3.7"
29
29
  },
30
- "version": "0.5.0"
30
+ "version": "0.5.2"
31
31
  }
package/eslint.config.mjs DELETED
@@ -1,20 +0,0 @@
1
- import config from '@signpostmarv/eslint-config';
2
- import parser from '@typescript-eslint/parser';
3
-
4
- export default [
5
- {
6
- languageOptions: {
7
- parser,
8
- parserOptions: {
9
- project: ['./tsconfig.eslint.json'],
10
- },
11
- },
12
- },
13
- ...config,
14
- {
15
- ignores: [
16
- '**/*.js',
17
- '**/*.d.ts',
18
- ]
19
- }
20
- ];