@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 +0 -1
- package/lib/Docs.json.js +0 -1
- package/lib/IntermediaryNumber.d.ts +9 -8
- package/lib/IntermediaryNumber.js +9 -7
- package/lib/IntermediaryNumberTypes.js +0 -1
- package/lib/NumberStrings.js +0 -1
- package/lib/Numbers.js +0 -1
- package/package.json +6 -6
- package/eslint.config.mjs +0 -20
package/index.js
CHANGED
package/lib/Docs.json.js
CHANGED
|
@@ -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[]):
|
|
57
|
-
min(first: math_types, ...remaining: 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[]):
|
|
97
|
-
min(first: math_types, ...remaining: 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[]):
|
|
137
|
-
min(first: math_types, ...remaining: 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[]):
|
|
189
|
-
min(first: math_types, ...remaining: 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
|
-
|
|
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
|
|
653
|
+
this.#parse();
|
|
657
654
|
this.internal.valid = true;
|
|
658
655
|
}
|
|
659
|
-
catch
|
|
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
|
package/lib/NumberStrings.js
CHANGED
package/lib/Numbers.js
CHANGED
package/package.json
CHANGED
|
@@ -11,21 +11,21 @@
|
|
|
11
11
|
"exports": "./index.js",
|
|
12
12
|
"types": "./index.d.ts",
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@
|
|
15
|
-
"@
|
|
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": "^
|
|
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": "^
|
|
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.
|
|
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
|
-
];
|