@utiliread/primitives 1.0.0-48 → 1.0.0-50
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/.parcel-cache/05bceb1debb074ab +0 -0
- package/.parcel-cache/98c3d22f150231c4 +0 -0
- package/.parcel-cache/a94329c46f41e756 +0 -0
- package/.parcel-cache/b72f446afb579f45 +0 -0
- package/.parcel-cache/d9963624c0099aed.txt +12308 -0
- package/.parcel-cache/data.mdb +0 -0
- package/.parcel-cache/lock.mdb +0 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +288 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +275 -0
- package/dist/index.mjs.map +1 -0
- package/karma.config.js +10 -13
- package/package.json +40 -36
- package/src/index.ts +7 -7
- package/src/number-formatter.spec.ts +2 -2
- package/src/precision-number.spec.ts +28 -0
- package/src/precision-number.ts +4 -1
- package/tsconfig.json +12 -14
- package/tsconfig.test.json +7 -0
- package/dist/cjs/aggregate-id.js +0 -3
- package/dist/cjs/aggregate-id.js.map +0 -1
- package/dist/cjs/consumption-type-id.js +0 -3
- package/dist/cjs/consumption-type-id.js.map +0 -1
- package/dist/cjs/index.js +0 -22
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/measure-id.js +0 -3
- package/dist/cjs/measure-id.js.map +0 -1
- package/dist/cjs/number-formatter.js +0 -81
- package/dist/cjs/number-formatter.js.map +0 -1
- package/dist/cjs/number-formatter.spec.js +0 -96
- package/dist/cjs/number-formatter.spec.js.map +0 -1
- package/dist/cjs/optional.js +0 -3
- package/dist/cjs/optional.js.map +0 -1
- package/dist/cjs/precision-number.js +0 -34
- package/dist/cjs/precision-number.js.map +0 -1
- package/dist/cjs/register-convention.js +0 -61
- package/dist/cjs/register-convention.js.map +0 -1
- package/dist/cjs/register-convention.spec.js +0 -39
- package/dist/cjs/register-convention.spec.js.map +0 -1
- package/dist/cjs/register-definition.js +0 -3
- package/dist/cjs/register-definition.js.map +0 -1
- package/dist/cjs/register-id.js +0 -3
- package/dist/cjs/register-id.js.map +0 -1
- package/dist/cjs/register-library.js +0 -58
- package/dist/cjs/register-library.js.map +0 -1
- package/dist/cjs/register-library.spec.js +0 -37
- package/dist/cjs/register-library.spec.js.map +0 -1
- package/dist/cjs/register-pack.js +0 -3
- package/dist/cjs/register-pack.js.map +0 -1
- package/dist/cjs/register-utils.js +0 -8
- package/dist/cjs/register-utils.js.map +0 -1
- package/dist/cjs/repository.js +0 -26
- package/dist/cjs/repository.js.map +0 -1
- package/dist/cjs/repository.spec.js +0 -21
- package/dist/cjs/repository.spec.js.map +0 -1
- package/dist/cjs/step.js +0 -42
- package/dist/cjs/step.js.map +0 -1
- package/dist/cjs/step.spec.js +0 -29
- package/dist/cjs/step.spec.js.map +0 -1
- package/dist/cjs/time-or-rule.js +0 -19
- package/dist/cjs/time-or-rule.js.map +0 -1
- package/dist/cjs/unit-id.js +0 -14
- package/dist/cjs/unit-id.js.map +0 -1
- package/dist/esm/aggregate-id.d.ts +0 -1
- package/dist/esm/aggregate-id.js +0 -2
- package/dist/esm/aggregate-id.js.map +0 -1
- package/dist/esm/consumption-type-id.d.ts +0 -1
- package/dist/esm/consumption-type-id.js +0 -2
- package/dist/esm/consumption-type-id.js.map +0 -1
- package/dist/esm/index.d.ts +0 -16
- package/dist/esm/index.js +0 -10
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/measure-id.d.ts +0 -1
- package/dist/esm/measure-id.js +0 -2
- package/dist/esm/measure-id.js.map +0 -1
- package/dist/esm/number-formatter.d.ts +0 -17
- package/dist/esm/number-formatter.js +0 -78
- package/dist/esm/number-formatter.js.map +0 -1
- package/dist/esm/number-formatter.spec.d.ts +0 -1
- package/dist/esm/number-formatter.spec.js +0 -94
- package/dist/esm/number-formatter.spec.js.map +0 -1
- package/dist/esm/optional.d.ts +0 -1
- package/dist/esm/optional.js +0 -2
- package/dist/esm/optional.js.map +0 -1
- package/dist/esm/precision-number.d.ts +0 -11
- package/dist/esm/precision-number.js +0 -31
- package/dist/esm/precision-number.js.map +0 -1
- package/dist/esm/register-convention.d.ts +0 -14
- package/dist/esm/register-convention.js +0 -57
- package/dist/esm/register-convention.js.map +0 -1
- package/dist/esm/register-convention.spec.d.ts +0 -1
- package/dist/esm/register-convention.spec.js +0 -37
- package/dist/esm/register-convention.spec.js.map +0 -1
- package/dist/esm/register-definition.d.ts +0 -13
- package/dist/esm/register-definition.js +0 -2
- package/dist/esm/register-definition.js.map +0 -1
- package/dist/esm/register-id.d.ts +0 -1
- package/dist/esm/register-id.js +0 -2
- package/dist/esm/register-id.js.map +0 -1
- package/dist/esm/register-library.d.ts +0 -15
- package/dist/esm/register-library.js +0 -55
- package/dist/esm/register-library.js.map +0 -1
- package/dist/esm/register-library.spec.d.ts +0 -1
- package/dist/esm/register-library.spec.js +0 -35
- package/dist/esm/register-library.spec.js.map +0 -1
- package/dist/esm/register-pack.d.ts +0 -4
- package/dist/esm/register-pack.js +0 -2
- package/dist/esm/register-pack.js.map +0 -1
- package/dist/esm/register-utils.d.ts +0 -3
- package/dist/esm/register-utils.js +0 -4
- package/dist/esm/register-utils.js.map +0 -1
- package/dist/esm/repository.d.ts +0 -9
- package/dist/esm/repository.js +0 -22
- package/dist/esm/repository.js.map +0 -1
- package/dist/esm/repository.spec.d.ts +0 -1
- package/dist/esm/repository.spec.js +0 -19
- package/dist/esm/repository.spec.js.map +0 -1
- package/dist/esm/step.d.ts +0 -15
- package/dist/esm/step.js +0 -39
- package/dist/esm/step.js.map +0 -1
- package/dist/esm/step.spec.d.ts +0 -1
- package/dist/esm/step.spec.js +0 -27
- package/dist/esm/step.spec.js.map +0 -1
- package/dist/esm/time-or-rule.d.ts +0 -7
- package/dist/esm/time-or-rule.js +0 -16
- package/dist/esm/time-or-rule.js.map +0 -1
- package/dist/esm/unit-id.d.ts +0 -2
- package/dist/esm/unit-id.js +0 -11
- package/dist/esm/unit-id.js.map +0 -1
- package/tsconfig.cjs.json +0 -9
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import {Duration as $hgUW1$Duration} from "luxon";
|
|
2
|
+
|
|
3
|
+
class $2bc946b609f83430$var$Library {
|
|
4
|
+
definitions = {};
|
|
5
|
+
add(...definitions) {
|
|
6
|
+
for (const definition of definitions){
|
|
7
|
+
if ($2bc946b609f83430$var$isDefinition(definition)) this.tryAdd(definition);
|
|
8
|
+
else for (const definitionInPack of Object.values(definition))this.tryAdd(definitionInPack);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
tryAdd(definition) {
|
|
12
|
+
if (!this.definitions[definition.id]) {
|
|
13
|
+
this.definitions[definition.id] = definition;
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
has(id) {
|
|
19
|
+
return !!this.definitions[id];
|
|
20
|
+
}
|
|
21
|
+
tryGet(id) {
|
|
22
|
+
return this.definitions[id];
|
|
23
|
+
}
|
|
24
|
+
get(id) {
|
|
25
|
+
const definition = this.definitions[id];
|
|
26
|
+
if (!definition) throw new Error(`Defintion was not loaded for register ${id}`);
|
|
27
|
+
return definition;
|
|
28
|
+
}
|
|
29
|
+
all() {
|
|
30
|
+
return Object.values(this.definitions).map((x)=>x
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
reset() {
|
|
34
|
+
this.definitions = {};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function $2bc946b609f83430$var$isDefinition(definitionOrPack) {
|
|
38
|
+
return !!(definitionOrPack.id && definitionOrPack.aggregate && definitionOrPack.units);
|
|
39
|
+
}
|
|
40
|
+
const $2bc946b609f83430$export$472902705794cfbb = new $2bc946b609f83430$var$Library();
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
const $a27da276f4185ebf$export$18a249acfd29a1c5 = 0.1.toString()[1];
|
|
44
|
+
const $a27da276f4185ebf$export$c146a453a9d3226d = 0.1.toLocaleString()[1];
|
|
45
|
+
class $a27da276f4185ebf$var$Formatter {
|
|
46
|
+
toPrecision(value, precision) {
|
|
47
|
+
if (value === 0) // (0).toPrecision(1) == "0"
|
|
48
|
+
// (0).toPrecision(2) == "0.0"
|
|
49
|
+
// (0).toPrecision(3) == "0.00"
|
|
50
|
+
// However, we want:
|
|
51
|
+
// Formatter.toPrecision(0, 0) == "0"
|
|
52
|
+
// Formatter.toPrecision(0, 1) == "0.0"
|
|
53
|
+
// Formatter.toPrecision(0, 2) == "0.00"
|
|
54
|
+
return value.toPrecision(precision + 1);
|
|
55
|
+
const absValue = Math.abs(value);
|
|
56
|
+
if (absValue < 1) return value.toPrecision(precision);
|
|
57
|
+
const noOfIntegerDigits = Math.round(absValue).toString().length;
|
|
58
|
+
return precision >= noOfIntegerDigits ? value.toFixed(precision - noOfIntegerDigits) : value.toPrecision(precision);
|
|
59
|
+
}
|
|
60
|
+
toLocalePrecision(value, precision) {
|
|
61
|
+
return this.toPrecision(value, precision).replace($a27da276f4185ebf$export$18a249acfd29a1c5, $a27da276f4185ebf$export$c146a453a9d3226d);
|
|
62
|
+
}
|
|
63
|
+
toFixed(value, precision) {
|
|
64
|
+
const parts = this.getParts(value, precision);
|
|
65
|
+
if (parts.noOfCoefficientDecimals < parts.exponent) {
|
|
66
|
+
const number = parts.invariantCoefficientString.replace($a27da276f4185ebf$export$18a249acfd29a1c5, "");
|
|
67
|
+
const zeros = parts.exponent - parts.noOfCoefficientDecimals;
|
|
68
|
+
return `${number}${"0".repeat(zeros)}`;
|
|
69
|
+
} else return parts.invariantPrecisionString;
|
|
70
|
+
}
|
|
71
|
+
toLocaleFixed(value, precision) {
|
|
72
|
+
return this.toFixed(value, precision).replace($a27da276f4185ebf$export$18a249acfd29a1c5, $a27da276f4185ebf$export$c146a453a9d3226d);
|
|
73
|
+
}
|
|
74
|
+
getParts(value, precision) {
|
|
75
|
+
const precisionString = this.toPrecision(value, precision);
|
|
76
|
+
if (precisionString.indexOf("e") >= 0) {
|
|
77
|
+
const match = /(.*)e([\+-]\d+)$/.exec(precisionString);
|
|
78
|
+
const coefficientString = match[1];
|
|
79
|
+
const exponent = parseInt(match[2]);
|
|
80
|
+
const decimalSeparatorIndex = coefficientString.indexOf($a27da276f4185ebf$export$18a249acfd29a1c5);
|
|
81
|
+
const noOfCoefficientDecimals = decimalSeparatorIndex >= 0 ? coefficientString.length - decimalSeparatorIndex - 1 : 0;
|
|
82
|
+
return {
|
|
83
|
+
invariantPrecisionString: precisionString,
|
|
84
|
+
invariantCoefficientString: coefficientString,
|
|
85
|
+
exponent: exponent,
|
|
86
|
+
noOfCoefficientDecimals: noOfCoefficientDecimals
|
|
87
|
+
};
|
|
88
|
+
} else {
|
|
89
|
+
const decimalSeparatorIndex = precisionString.indexOf($a27da276f4185ebf$export$18a249acfd29a1c5);
|
|
90
|
+
const noOfCoefficientDecimals = decimalSeparatorIndex >= 0 ? precisionString.length - decimalSeparatorIndex - 1 : 0;
|
|
91
|
+
return {
|
|
92
|
+
invariantPrecisionString: precisionString,
|
|
93
|
+
invariantCoefficientString: precisionString,
|
|
94
|
+
exponent: 0,
|
|
95
|
+
noOfCoefficientDecimals: noOfCoefficientDecimals
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const $a27da276f4185ebf$export$cc77c4ff7e8673c5 = new $a27da276f4185ebf$var$Formatter();
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
function $c2861bc7f0e1f73a$export$61f06221716a39a5(register) {
|
|
104
|
+
return typeof register === "string" ? register : register.id;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
const $e341043498f0791b$export$9d2f36f54a76c3c0 = {
|
|
109
|
+
instant: "",
|
|
110
|
+
diff: "diff",
|
|
111
|
+
min: "min",
|
|
112
|
+
max: "max",
|
|
113
|
+
avg: "avg",
|
|
114
|
+
sum: "sum",
|
|
115
|
+
cnt: "cnt",
|
|
116
|
+
ssq: "ssq"
|
|
117
|
+
};
|
|
118
|
+
class $e341043498f0791b$var$Convention {
|
|
119
|
+
getAggregate(register) {
|
|
120
|
+
const registerId = $c2861bc7f0e1f73a$export$61f06221716a39a5(register);
|
|
121
|
+
// Brute force all prefixes - if none of them, then it must be instant.
|
|
122
|
+
for (const aggregateString of Object.keys($e341043498f0791b$export$9d2f36f54a76c3c0)){
|
|
123
|
+
const aggregate = aggregateString;
|
|
124
|
+
const prefix = $e341043498f0791b$export$9d2f36f54a76c3c0[aggregate];
|
|
125
|
+
if (prefix.length && $e341043498f0791b$export$ea93bfe3a74b70f3(registerId, prefix)) // Not instant - it was any of the others.
|
|
126
|
+
return aggregate;
|
|
127
|
+
}
|
|
128
|
+
return "instant";
|
|
129
|
+
}
|
|
130
|
+
toInstant(register) {
|
|
131
|
+
const registerId = $c2861bc7f0e1f73a$export$61f06221716a39a5(register);
|
|
132
|
+
for (const prefix of Object.values($e341043498f0791b$export$9d2f36f54a76c3c0))if (prefix.length && $e341043498f0791b$export$ea93bfe3a74b70f3(registerId, prefix)) {
|
|
133
|
+
const tail = registerId.substr(prefix.length);
|
|
134
|
+
return tail[0].toLowerCase() + tail.substr(1);
|
|
135
|
+
}
|
|
136
|
+
return registerId;
|
|
137
|
+
}
|
|
138
|
+
toAggregate(register, aggregate) {
|
|
139
|
+
const instantRegisterId = this.toInstant(register);
|
|
140
|
+
if (aggregate === "instant") return instantRegisterId;
|
|
141
|
+
const prefix = $e341043498f0791b$export$9d2f36f54a76c3c0[aggregate];
|
|
142
|
+
return prefix + instantRegisterId[0].toUpperCase() + instantRegisterId.substr(1);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function $e341043498f0791b$export$ea93bfe3a74b70f3(registerId, prefix) {
|
|
146
|
+
return registerId.startsWith(prefix) && $e341043498f0791b$var$isUppercase(registerId[prefix.length]);
|
|
147
|
+
}
|
|
148
|
+
function $e341043498f0791b$var$isUppercase(input) {
|
|
149
|
+
return input.toUpperCase() === input;
|
|
150
|
+
}
|
|
151
|
+
const $e341043498f0791b$export$8cc0a4f27499ddb4 = new $e341043498f0791b$var$Convention();
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
let $3742b95f8d2fe1ca$export$7ed5ca4f8b987938;
|
|
156
|
+
(function($3742b95f8d2fe1ca$export$7ed5ca4f8b987938) {
|
|
157
|
+
$3742b95f8d2fe1ca$export$7ed5ca4f8b987938[$3742b95f8d2fe1ca$export$7ed5ca4f8b987938["Monday"] = 1] = "Monday";
|
|
158
|
+
$3742b95f8d2fe1ca$export$7ed5ca4f8b987938[$3742b95f8d2fe1ca$export$7ed5ca4f8b987938["Tuesday"] = 2] = "Tuesday";
|
|
159
|
+
$3742b95f8d2fe1ca$export$7ed5ca4f8b987938[$3742b95f8d2fe1ca$export$7ed5ca4f8b987938["Wednesday"] = 3] = "Wednesday";
|
|
160
|
+
$3742b95f8d2fe1ca$export$7ed5ca4f8b987938[$3742b95f8d2fe1ca$export$7ed5ca4f8b987938["Thursday"] = 4] = "Thursday";
|
|
161
|
+
$3742b95f8d2fe1ca$export$7ed5ca4f8b987938[$3742b95f8d2fe1ca$export$7ed5ca4f8b987938["Friday"] = 5] = "Friday";
|
|
162
|
+
$3742b95f8d2fe1ca$export$7ed5ca4f8b987938[$3742b95f8d2fe1ca$export$7ed5ca4f8b987938["Saturday"] = 6] = "Saturday";
|
|
163
|
+
$3742b95f8d2fe1ca$export$7ed5ca4f8b987938[$3742b95f8d2fe1ca$export$7ed5ca4f8b987938["Sunday"] = 7] = "Sunday";
|
|
164
|
+
})($3742b95f8d2fe1ca$export$7ed5ca4f8b987938 || ($3742b95f8d2fe1ca$export$7ed5ca4f8b987938 = {}));
|
|
165
|
+
let $3742b95f8d2fe1ca$export$fd55ce593607084a;
|
|
166
|
+
(function($3742b95f8d2fe1ca$export$fd55ce593607084a) {
|
|
167
|
+
function startOf(dateTime, step, firstDayOfWeek) {
|
|
168
|
+
if (step === "week") {
|
|
169
|
+
const value = dateTime.startOf("day").set({
|
|
170
|
+
weekday: firstDayOfWeek ?? $3742b95f8d2fe1ca$export$7ed5ca4f8b987938.Monday
|
|
171
|
+
});
|
|
172
|
+
return value > dateTime ? value.minus({
|
|
173
|
+
days: 7
|
|
174
|
+
}) : value;
|
|
175
|
+
} else return dateTime.startOf(step);
|
|
176
|
+
}
|
|
177
|
+
$3742b95f8d2fe1ca$export$fd55ce593607084a.startOf = startOf;
|
|
178
|
+
function asDuration(step, amount = 1) {
|
|
179
|
+
switch(step){
|
|
180
|
+
case "hour":
|
|
181
|
+
return $hgUW1$Duration.fromObject({
|
|
182
|
+
hours: amount
|
|
183
|
+
});
|
|
184
|
+
case "day":
|
|
185
|
+
return $hgUW1$Duration.fromObject({
|
|
186
|
+
days: amount
|
|
187
|
+
});
|
|
188
|
+
case "week":
|
|
189
|
+
return $hgUW1$Duration.fromObject({
|
|
190
|
+
days: 7 * amount
|
|
191
|
+
});
|
|
192
|
+
case "month":
|
|
193
|
+
return $hgUW1$Duration.fromObject({
|
|
194
|
+
months: amount
|
|
195
|
+
});
|
|
196
|
+
case "year":
|
|
197
|
+
return $hgUW1$Duration.fromObject({
|
|
198
|
+
years: amount
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
$3742b95f8d2fe1ca$export$fd55ce593607084a.asDuration = asDuration;
|
|
203
|
+
})($3742b95f8d2fe1ca$export$fd55ce593607084a || ($3742b95f8d2fe1ca$export$fd55ce593607084a = {}));
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
let $a9d41af0df0fca9e$export$35b5ee117d2b7df0;
|
|
207
|
+
(function($a9d41af0df0fca9e$export$35b5ee117d2b7df0) {
|
|
208
|
+
function isTime(input) {
|
|
209
|
+
return typeof input !== "string";
|
|
210
|
+
}
|
|
211
|
+
$a9d41af0df0fca9e$export$35b5ee117d2b7df0.isTime = isTime;
|
|
212
|
+
function isRule(input) {
|
|
213
|
+
return typeof input === "string";
|
|
214
|
+
}
|
|
215
|
+
$a9d41af0df0fca9e$export$35b5ee117d2b7df0.isRule = isRule;
|
|
216
|
+
function asJSON(input) {
|
|
217
|
+
return isRule(input) ? input : input.toJSON();
|
|
218
|
+
}
|
|
219
|
+
$a9d41af0df0fca9e$export$35b5ee117d2b7df0.asJSON = asJSON;
|
|
220
|
+
})($a9d41af0df0fca9e$export$35b5ee117d2b7df0 || ($a9d41af0df0fca9e$export$35b5ee117d2b7df0 = {}));
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
class $47133f938ce44539$export$60b023dc4cb7008e {
|
|
226
|
+
constructor(value, precision){
|
|
227
|
+
this.value = value;
|
|
228
|
+
this.precision = precision;
|
|
229
|
+
}
|
|
230
|
+
static parse(input) {
|
|
231
|
+
let normalized = input.trim().replace(",", ".").replace($a27da276f4185ebf$export$c146a453a9d3226d, $a27da276f4185ebf$export$18a249acfd29a1c5);
|
|
232
|
+
if (normalized.endsWith($a27da276f4185ebf$export$18a249acfd29a1c5)) normalized += "0";
|
|
233
|
+
const precision = normalized.replace(".", "").replace("+", "").replace("-", "").length;
|
|
234
|
+
return new $47133f938ce44539$export$60b023dc4cb7008e(parseFloat(normalized), precision);
|
|
235
|
+
}
|
|
236
|
+
toString() {
|
|
237
|
+
return this.value.toString();
|
|
238
|
+
}
|
|
239
|
+
toFixed() {
|
|
240
|
+
return $a27da276f4185ebf$export$cc77c4ff7e8673c5.toFixed(this.value, this.precision);
|
|
241
|
+
}
|
|
242
|
+
toPrecision() {
|
|
243
|
+
return $a27da276f4185ebf$export$cc77c4ff7e8673c5.toPrecision(this.value, this.precision);
|
|
244
|
+
}
|
|
245
|
+
toLocaleFixed() {
|
|
246
|
+
return $a27da276f4185ebf$export$cc77c4ff7e8673c5.toLocaleFixed(this.value, this.precision);
|
|
247
|
+
}
|
|
248
|
+
toLocalePrecision() {
|
|
249
|
+
return $a27da276f4185ebf$export$cc77c4ff7e8673c5.toLocalePrecision(this.value, this.precision);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
function $f5b26f75dc394ede$export$b340a19a1bcc0afd(repoOrTeam, name) {
|
|
255
|
+
if (name) return `${repoOrTeam}/${name}`;
|
|
256
|
+
else if (repoOrTeam.indexOf("/") > 0) return repoOrTeam;
|
|
257
|
+
else throw new TypeError("Invalid repository format");
|
|
258
|
+
}
|
|
259
|
+
(function($f5b26f75dc394ede$export$b340a19a1bcc0afd) {
|
|
260
|
+
function split(repo) {
|
|
261
|
+
const parts = repo.split("/");
|
|
262
|
+
return {
|
|
263
|
+
team: parts[0],
|
|
264
|
+
name: parts[1]
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
$f5b26f75dc394ede$export$b340a19a1bcc0afd.split = split;
|
|
268
|
+
})($f5b26f75dc394ede$export$b340a19a1bcc0afd || ($f5b26f75dc394ede$export$b340a19a1bcc0afd = {}));
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
export {$3742b95f8d2fe1ca$export$7ed5ca4f8b987938 as DayOfWeek, $a27da276f4185ebf$export$cc77c4ff7e8673c5 as NumberFormatter, $47133f938ce44539$export$60b023dc4cb7008e as PrecisionNumber, $e341043498f0791b$export$8cc0a4f27499ddb4 as RegisterConvention, $2bc946b609f83430$export$472902705794cfbb as RegisterLibrary, $f5b26f75dc394ede$export$b340a19a1bcc0afd as Repository, $3742b95f8d2fe1ca$export$fd55ce593607084a as Step, $a9d41af0df0fca9e$export$35b5ee117d2b7df0 as TimeOrRule, $a27da276f4185ebf$export$18a249acfd29a1c5 as invariantDecimalSeparator, $a27da276f4185ebf$export$c146a453a9d3226d as localeDecimalSeparator};
|
|
275
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;ACIA,MAAM,6BAAO;IACT,AAAQ,WAAW,GAAwD,EAAE,CAAC;IAC9E,AAAO,GAAG,CAAC,GAAG,WAAW,AAAuC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CAAC,CAAC;YACd,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;SACjB,CAAC;KACL;8CANe,KAAK,GAAL,KAAK;GADR,yCAAU,KAAV,yCAAU;;","sources":["src/index.ts","src/register-library.ts","src/number-formatter.ts","src/register-convention.ts","src/register-utils.ts","src/step.ts","src/time-or-rule.ts","src/precision-number.ts","src/repository.ts"],"sourcesContent":["import type { ConsumptionTypeId } from \"./consumption-type-id\";\nimport type { RegisterId } from \"./register-id\";\nimport type { UnitId } from \"./unit-id\";\nimport { RegisterLibrary } from \"./register-library\";\nimport type { RegisterDefinition } from \"./register-definition\";\nimport { NumberFormatter, invariantDecimalSeparator, localeDecimalSeparator } from \"./number-formatter\";\nimport { RegisterConvention } from \"./register-convention\";\nimport type { AggregateId } from \"./aggregate-id\";\nimport type { MeasureId } from \"./measure-id\";\nimport { Step, DayOfWeek } from \"./step\";\nimport { TimeOrRule } from \"./time-or-rule\";\nimport { PrecisionNumber } from \"./precision-number\";\nimport \"./repository\"; // We need this to get the Repository namespace exported\nimport { Repository } from \"./repository\";\nimport type { Optional } from \"./optional\";\n\nexport {\n AggregateId,\n ConsumptionTypeId,\n DayOfWeek,\n MeasureId,\n NumberFormatter,\n PrecisionNumber,\n RegisterConvention,\n RegisterDefinition,\n RegisterId,\n RegisterLibrary,\n Repository,\n Step,\n TimeOrRule,\n UnitId,\n invariantDecimalSeparator,\n localeDecimalSeparator,\n Optional,\n};\n","import { RegisterDefinition } from \"./register-definition\";\nimport { RegisterId } from \"./register-id\";\nimport { RegisterPack } from \"./register-pack\";\n\nclass Library {\n private definitions: Partial<{ [id in RegisterId]: RegisterDefinition }> = {};\n public add(...definitions: (RegisterDefinition | RegisterPack)[]) {\n for (const definition of definitions) {\n if (isDefinition(definition)) {\n this.tryAdd(definition);\n }\n else {\n for (const definitionInPack of Object.values(definition)) {\n this.tryAdd(definitionInPack);\n }\n }\n }\n }\n\n private tryAdd(definition: RegisterDefinition) {\n if (!this.definitions[definition.id]) {\n this.definitions[definition.id] = definition;\n return true;\n }\n return false;\n }\n\n public has(id: RegisterId) {\n return !!this.definitions[id];\n }\n\n public tryGet(id: RegisterId) {\n return this.definitions[id];\n }\n\n public get(id: RegisterId) {\n const definition = this.definitions[id];\n if (!definition) {\n throw new Error(`Defintion was not loaded for register ${id}`);\n }\n return definition;\n }\n\n public all() {\n return Object.values(this.definitions).map(x => x!);\n }\n\n public reset() {\n this.definitions = {};\n }\n}\n\nfunction isDefinition(definitionOrPack: RegisterDefinition | RegisterPack): definitionOrPack is RegisterDefinition {\n return !!(definitionOrPack.id && definitionOrPack.aggregate && definitionOrPack.units);\n}\n\nexport const RegisterLibrary = new Library();\r\n","export const invariantDecimalSeparator = (0.1).toString()[1];\nexport const localeDecimalSeparator = (0.1).toLocaleString()[1];\n\nexport interface Parts {\n invariantPrecisionString: string;\n invariantCoefficientString: string;\n exponent: number;\n noOfCoefficientDecimals: number;\n}\n\nclass Formatter {\n public toPrecision(value: number, precision: number) {\n if (value === 0) {\n // (0).toPrecision(1) == \"0\"\n // (0).toPrecision(2) == \"0.0\"\n // (0).toPrecision(3) == \"0.00\"\n // However, we want:\n // Formatter.toPrecision(0, 0) == \"0\"\n // Formatter.toPrecision(0, 1) == \"0.0\"\n // Formatter.toPrecision(0, 2) == \"0.00\"\n return value.toPrecision(precision + 1);\n }\n const absValue = Math.abs(value);\n if (absValue < 1) {\n return value.toPrecision(precision);\n }\n\n const noOfIntegerDigits = Math.round(absValue).toString().length;\n return precision >= noOfIntegerDigits\n ? value.toFixed(precision - noOfIntegerDigits)\n : value.toPrecision(precision);\n }\n\n public toLocalePrecision(value: number, precision: number) {\n return this.toPrecision(value, precision)\n .replace(invariantDecimalSeparator, localeDecimalSeparator);\n }\n\n public toFixed(value: number, precision: number) {\n const parts = this.getParts(value, precision);\n if (parts.noOfCoefficientDecimals < parts.exponent) {\n const number = parts.invariantCoefficientString.replace(invariantDecimalSeparator, \"\");\n const zeros = parts.exponent - parts.noOfCoefficientDecimals;\n return `${number}${\"0\".repeat(zeros)}`;\n }\n else {\n return parts.invariantPrecisionString;\n }\n }\n\n public toLocaleFixed(value: number, precision: number) {\n return this.toFixed(value, precision)\n .replace(invariantDecimalSeparator, localeDecimalSeparator);\n }\n\n public getParts(value: number, precision: number): Parts {\n const precisionString = this.toPrecision(value, precision);\n if (precisionString.indexOf(\"e\") >= 0) {\n const match = /(.*)e([\\+-]\\d+)$/.exec(precisionString)!;\n const coefficientString = match[1];\n const exponent = parseInt(match[2]);\n const decimalSeparatorIndex = coefficientString.indexOf(invariantDecimalSeparator);\n const noOfCoefficientDecimals = decimalSeparatorIndex >= 0\n ? coefficientString.length - decimalSeparatorIndex - 1\n : 0;\n return {\n invariantPrecisionString: precisionString,\n invariantCoefficientString: coefficientString,\n exponent,\n noOfCoefficientDecimals,\n };\n }\n else {\n const decimalSeparatorIndex = precisionString.indexOf(invariantDecimalSeparator);\n const noOfCoefficientDecimals = decimalSeparatorIndex >= 0\n ? precisionString.length - decimalSeparatorIndex - 1\n : 0;\n return {\n invariantPrecisionString: precisionString,\n invariantCoefficientString: precisionString,\n exponent: 0,\n noOfCoefficientDecimals,\n };\n }\n }\n}\n\nexport const NumberFormatter = new Formatter();\n","import { RegisterDefinition } from \".\";\nimport { AggregateId } from \"./aggregate-id\";\nimport { RegisterId } from \"./register-id\";\nimport { getRegisterId } from \"./register-utils\";\n\nexport const aggregatePrefixes: { [aggregateId in AggregateId]: string } = {\n instant: \"\",\n diff: \"diff\",\n min: \"min\",\n max: \"max\",\n avg: \"avg\",\n sum: \"sum\",\n cnt: \"cnt\",\n ssq: \"ssq\",\n};\n\nclass Convention {\n public getAggregate(register: RegisterId | RegisterDefinition) {\n const registerId = getRegisterId(register);\n // Brute force all prefixes - if none of them, then it must be instant.\n for (const aggregateString of Object.keys(aggregatePrefixes)) {\n const aggregate = <AggregateId>aggregateString;\n const prefix = aggregatePrefixes[aggregate];\n if (prefix.length && isPrefix(registerId, prefix)) {\n // Not instant - it was any of the others.\n return aggregate;\n }\n }\n return \"instant\";\n }\n\n toInstant(register: RegisterId | RegisterDefinition) {\n const registerId = getRegisterId(register);\n for (const prefix of Object.values(aggregatePrefixes)) {\n if (prefix.length && isPrefix(registerId, prefix)) {\n const tail = registerId.substr(prefix.length);\n return <RegisterId>(tail[0].toLowerCase() + tail.substr(1));\n }\n }\n return registerId;\n }\n\n toAggregate(register: RegisterId | RegisterDefinition, aggregate: AggregateId) {\n const instantRegisterId = this.toInstant(register);\n if (aggregate === \"instant\") {\n return instantRegisterId;\n }\n const prefix = aggregatePrefixes[aggregate];\n return <RegisterId>(prefix + instantRegisterId[0].toUpperCase() + instantRegisterId.substr(1));\n }\n}\n\nexport function isPrefix(registerId: RegisterId, prefix: string) {\n return registerId.startsWith(prefix) && isUppercase(registerId[prefix.length]);\n}\n\nfunction isUppercase(input: string) {\n return input.toUpperCase() === input;\n}\n\nexport const RegisterConvention = new Convention();\r\n","import { RegisterDefinition } from \"./register-definition\";\nimport { RegisterId } from \"./register-id\";\n\nexport function getRegisterId(register: RegisterId | RegisterDefinition) {\n return typeof register === \"string\" ? register : register.id;\n}\r\n","import { DateTime, Duration } from \"luxon\";\n\nexport type Step = \"hour\" | \"day\" | \"week\" | \"month\" | \"year\";\n\nexport enum DayOfWeek {\n Monday = 1,\n Tuesday = 2,\n Wednesday = 3,\n Thursday = 4,\n Friday = 5,\n Saturday = 6,\n Sunday = 7,\n};\n\nexport namespace Step {\n export function startOf(dateTime: DateTime, step: Step, firstDayOfWeek?: DayOfWeek) {\n if (step === \"week\") {\n const value = dateTime.startOf(\"day\").set({ weekday: firstDayOfWeek ?? DayOfWeek.Monday });\n return value > dateTime\n ? value.minus({ days: 7 })\n : value;\n }\n else {\n return dateTime.startOf(step);\n }\n }\n \n export function asDuration(step: Step, amount = 1): Duration {\n switch (step) {\n case \"hour\": return Duration.fromObject({ hours: amount });\n case \"day\": return Duration.fromObject({ days: amount });\n case \"week\": return Duration.fromObject({ days: 7 * amount });\n case \"month\": return Duration.fromObject({ months: amount });\n case \"year\": return Duration.fromObject({ years: amount });\n }\n }\n}\r\n","import { DateTime } from \"luxon\";\n\nexport type TimeOrRule = Date | DateTime | string;\n\nexport namespace TimeOrRule {\n export function isTime(input: TimeOrRule): input is Date | DateTime {\n return typeof input !== \"string\";\n }\n\n export function isRule(input: TimeOrRule): input is string {\n return typeof input === \"string\";\n }\n \n export function asJSON(input: TimeOrRule) {\n return isRule(input) ? input : input.toJSON();\n }\n}\r\n","import { invariantDecimalSeparator } from \".\";\nimport { localeDecimalSeparator, NumberFormatter } from \"./number-formatter\";\n\nexport class PrecisionNumber {\n constructor(public value: number, public precision: number) {\n }\n\n static parse(input: string) {\n let normalized = input.trim().replace(\",\", \".\").replace(localeDecimalSeparator, invariantDecimalSeparator);\n if (normalized.endsWith(invariantDecimalSeparator)) {\n normalized += \"0\";\n }\n const precision = normalized.replace(\".\", \"\").replace(\"+\", \"\").replace(\"-\", \"\").length;\n return new PrecisionNumber(parseFloat(normalized), precision);\n }\n\n toString() {\n return this.value.toString();\n }\n\n toFixed() {\n return NumberFormatter.toFixed(this.value, this.precision);\n }\n\n toPrecision() {\n return NumberFormatter.toPrecision(this.value, this.precision);\n }\n\n toLocaleFixed() {\n return NumberFormatter.toLocaleFixed(this.value, this.precision);\n }\n\n toLocalePrecision() {\n return NumberFormatter.toLocalePrecision(this.value, this.precision);\n }\n}\n","// This is clearly not correct but it provides some amazing type safety\r\nexport type Repository = \"some/repo\";\r\n\r\nexport function Repository(repo: string): Repository;\r\nexport function Repository(team: string, name: string): Repository;\r\nexport function Repository(repoOrTeam: string, name?: string): Repository {\r\n if (name) {\r\n return <Repository>`${repoOrTeam}/${name}`;\r\n } else if (repoOrTeam.indexOf(\"/\") > 0) {\r\n return <Repository>repoOrTeam;\r\n } else {\r\n throw new TypeError(\"Invalid repository format\");\r\n }\r\n}\r\n\r\nexport namespace Repository {\r\n export function split(repo: Repository) {\r\n const parts = repo.split(\"/\");\r\n return {\r\n team: parts[0],\r\n name: parts[1],\r\n };\r\n }\r\n}\r\n"],"names":[],"version":3,"file":"index.mjs.map"}
|
package/karma.config.js
CHANGED
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
|
|
2
1
|
const tsconfig = require("./tsconfig.json");
|
|
3
2
|
|
|
4
3
|
module.exports = function (config) {
|
|
5
4
|
config.set({
|
|
6
5
|
frameworks: ["mocha", "chai", "karma-typescript"],
|
|
7
|
-
files: [
|
|
8
|
-
"src/**/*.ts"
|
|
9
|
-
],
|
|
6
|
+
files: ["src/**/*.ts"],
|
|
10
7
|
preprocessors: {
|
|
11
|
-
"src/**/*.ts": ["karma-typescript"]
|
|
8
|
+
"src/**/*.ts": ["karma-typescript"],
|
|
12
9
|
},
|
|
13
10
|
reporters: ["progress", "karma-typescript"],
|
|
14
11
|
browsers: ["ChromeHeadless", "ChromeDebugging", "Chrome"],
|
|
15
12
|
customLaunchers: {
|
|
16
13
|
ChromeDebugging: {
|
|
17
14
|
base: "Chrome",
|
|
18
|
-
flags: ["--remote-debugging-port=9222"]
|
|
19
|
-
}
|
|
15
|
+
flags: ["--remote-debugging-port=9222"],
|
|
16
|
+
},
|
|
20
17
|
},
|
|
21
18
|
karmaTypescriptConfig: {
|
|
22
19
|
bundlerOptions: {
|
|
23
20
|
entrypoints: /\.spec\.ts$/,
|
|
24
|
-
sourceMap: tsconfig.compilerOptions.sourceMap
|
|
21
|
+
sourceMap: tsconfig.compilerOptions.sourceMap,
|
|
25
22
|
},
|
|
26
23
|
coverageOptions: {
|
|
27
|
-
instrumentation: false
|
|
24
|
+
instrumentation: false,
|
|
28
25
|
},
|
|
29
|
-
tsconfig: "./tsconfig.
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
}
|
|
26
|
+
tsconfig: "./tsconfig.test.json",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
};
|
package/package.json
CHANGED
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@utiliread/primitives",
|
|
3
|
-
"version": "1.0.0-
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"@
|
|
21
|
-
"@types
|
|
22
|
-
"chai": "^4.
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"karma
|
|
27
|
-
"karma-
|
|
28
|
-
"
|
|
29
|
-
"mocha": "^
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@utiliread/primitives",
|
|
3
|
+
"version": "1.0.0-50",
|
|
4
|
+
"source": "src/index.ts",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "parcel build",
|
|
11
|
+
"test": "karma start --single-run --browsers ChromeHeadless karma.config.js",
|
|
12
|
+
"watch": "karma start --auto-watch --browsers ChromeDebugging karma.config.js",
|
|
13
|
+
"chrome": "karma start --auto-watch --browsers Chrome karma.config.js",
|
|
14
|
+
"clean": "rimraf dist"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@parcel/packager-ts": "^2.5.0",
|
|
21
|
+
"@parcel/transformer-typescript-types": "^2.5.0",
|
|
22
|
+
"@types/chai": "^4.2.18",
|
|
23
|
+
"@types/luxon": "^2.3.2",
|
|
24
|
+
"@types/mocha": "^9.0.0",
|
|
25
|
+
"chai": "^4.3.4",
|
|
26
|
+
"karma": "^6.3.2",
|
|
27
|
+
"karma-chai": "^0.1.0",
|
|
28
|
+
"karma-chrome-launcher": "^3.1.0",
|
|
29
|
+
"karma-mocha": "^2.0.1",
|
|
30
|
+
"karma-typescript": "^5.5.1",
|
|
31
|
+
"luxon": "^2.1.0",
|
|
32
|
+
"mocha": "^9.1.3",
|
|
33
|
+
"parcel": "^2.5.0",
|
|
34
|
+
"rimraf": "^3.0.2",
|
|
35
|
+
"typescript": "^4.1.5"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"luxon": "^2.1.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ConsumptionTypeId } from "./consumption-type-id";
|
|
2
|
-
import { RegisterId } from "./register-id";
|
|
3
|
-
import { UnitId } from "./unit-id";
|
|
1
|
+
import type { ConsumptionTypeId } from "./consumption-type-id";
|
|
2
|
+
import type { RegisterId } from "./register-id";
|
|
3
|
+
import type { UnitId } from "./unit-id";
|
|
4
4
|
import { RegisterLibrary } from "./register-library";
|
|
5
|
-
import { RegisterDefinition } from "./register-definition";
|
|
5
|
+
import type { RegisterDefinition } from "./register-definition";
|
|
6
6
|
import { NumberFormatter, invariantDecimalSeparator, localeDecimalSeparator } from "./number-formatter";
|
|
7
7
|
import { RegisterConvention } from "./register-convention";
|
|
8
|
-
import { AggregateId } from "./aggregate-id";
|
|
9
|
-
import { MeasureId } from "./measure-id";
|
|
8
|
+
import type { AggregateId } from "./aggregate-id";
|
|
9
|
+
import type { MeasureId } from "./measure-id";
|
|
10
10
|
import { Step, DayOfWeek } from "./step";
|
|
11
11
|
import { TimeOrRule } from "./time-or-rule";
|
|
12
12
|
import { PrecisionNumber } from "./precision-number";
|
|
13
13
|
import "./repository"; // We need this to get the Repository namespace exported
|
|
14
14
|
import { Repository } from "./repository";
|
|
15
|
-
import { Optional } from "./optional";
|
|
15
|
+
import type { Optional } from "./optional";
|
|
16
16
|
|
|
17
17
|
export {
|
|
18
18
|
AggregateId,
|
|
@@ -25,7 +25,7 @@ describe("toParts and toPrecision", () => {
|
|
|
25
25
|
[123456, 3, { invariantPrecisionString: "1.23e+5", invariantCoefficientString: "1.23", exponent: 5, noOfCoefficientDecimals: 2 }],
|
|
26
26
|
[Number.MAX_VALUE, 3, { invariantPrecisionString: "1.80e+308", invariantCoefficientString: "1.80", exponent: 308, noOfCoefficientDecimals: 2 }],
|
|
27
27
|
[123456, 15, { invariantPrecisionString: "123456.000000000", invariantCoefficientString: "123456.000000000", exponent: 0, noOfCoefficientDecimals: 9 }],
|
|
28
|
-
[0, 5, { invariantPrecisionString: "0.
|
|
28
|
+
[0, 5, { invariantPrecisionString: "0.00000", invariantCoefficientString: "0.00000", exponent: 0, noOfCoefficientDecimals: 5 }],
|
|
29
29
|
[0.000001, 1, { invariantPrecisionString: "0.000001", invariantCoefficientString: "0.000001", exponent: 0, noOfCoefficientDecimals: 6 }],
|
|
30
30
|
[0.000001, 10, { invariantPrecisionString: "0.000001000000000", invariantCoefficientString: "0.000001000000000", exponent: 0, noOfCoefficientDecimals: 15 }],
|
|
31
31
|
[0.0000001, 10, { invariantPrecisionString: "1.000000000e-7", invariantCoefficientString: "1.000000000", exponent: -7, noOfCoefficientDecimals: 9 }],
|
|
@@ -54,7 +54,7 @@ describe("toParts and toPrecision", () => {
|
|
|
54
54
|
|
|
55
55
|
for (const [value, precision, expectedParts] of data) {
|
|
56
56
|
expect(NumberFormatter.toPrecision(value, precision)).to.equal(expectedParts.invariantPrecisionString);
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
const localePrecisionString = expectedParts.invariantPrecisionString.replace(invariantDecimalSeparator, localeDecimalSeparator);
|
|
59
59
|
expect(NumberFormatter.toLocalePrecision(value, precision)).to.equal(localePrecisionString);
|
|
60
60
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import { PrecisionNumber } from "./precision-number";
|
|
3
|
+
|
|
4
|
+
describe("precision-number", () => {
|
|
5
|
+
it("should not parse ''", () => {
|
|
6
|
+
const number = PrecisionNumber.parse("");
|
|
7
|
+
expect(Number.isNaN(number.value)).to.equal(true);
|
|
8
|
+
expect(number.precision).to.equal(0);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("should parse '1'", () => {
|
|
12
|
+
const number = PrecisionNumber.parse("1");
|
|
13
|
+
expect(number.value).to.equal(1);
|
|
14
|
+
expect(number.precision).to.equal(1);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("should parse '1.'", () => {
|
|
18
|
+
const number = PrecisionNumber.parse("1.");
|
|
19
|
+
expect(number.value).to.equal(1);
|
|
20
|
+
expect(number.precision).to.equal(2);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("should parse '1.0'", () => {
|
|
24
|
+
const number = PrecisionNumber.parse("1.0");
|
|
25
|
+
expect(number.value).to.equal(1);
|
|
26
|
+
expect(number.precision).to.equal(2);
|
|
27
|
+
});
|
|
28
|
+
});
|
package/src/precision-number.ts
CHANGED
|
@@ -6,7 +6,10 @@ export class PrecisionNumber {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
static parse(input: string) {
|
|
9
|
-
|
|
9
|
+
let normalized = input.trim().replace(",", ".").replace(localeDecimalSeparator, invariantDecimalSeparator);
|
|
10
|
+
if (normalized.endsWith(invariantDecimalSeparator)) {
|
|
11
|
+
normalized += "0";
|
|
12
|
+
}
|
|
10
13
|
const precision = normalized.replace(".", "").replace("+", "").replace("-", "").length;
|
|
11
14
|
return new PrecisionNumber(parseFloat(normalized), precision);
|
|
12
15
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
}
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2018",
|
|
4
|
+
"moduleResolution": "Node",
|
|
5
|
+
"experimentalDecorators": true,
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"rootDirs": ["src"],
|
|
9
|
+
"lib": ["ES2018", "DOM"],
|
|
10
|
+
"types": ["mocha"]
|
|
11
|
+
},
|
|
12
|
+
"exclude": ["dist"]
|
|
13
|
+
}
|
package/dist/cjs/aggregate-id.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-id.js","sourceRoot":"","sources":["../../src/aggregate-id.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consumption-type-id.js","sourceRoot":"","sources":["../../src/consumption-type-id.ts"],"names":[],"mappings":""}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.localeDecimalSeparator = exports.invariantDecimalSeparator = exports.TimeOrRule = exports.Step = exports.Repository = exports.RegisterLibrary = exports.RegisterConvention = exports.PrecisionNumber = exports.NumberFormatter = exports.DayOfWeek = void 0;
|
|
4
|
-
var register_library_1 = require("./register-library");
|
|
5
|
-
Object.defineProperty(exports, "RegisterLibrary", { enumerable: true, get: function () { return register_library_1.RegisterLibrary; } });
|
|
6
|
-
var number_formatter_1 = require("./number-formatter");
|
|
7
|
-
Object.defineProperty(exports, "NumberFormatter", { enumerable: true, get: function () { return number_formatter_1.NumberFormatter; } });
|
|
8
|
-
Object.defineProperty(exports, "invariantDecimalSeparator", { enumerable: true, get: function () { return number_formatter_1.invariantDecimalSeparator; } });
|
|
9
|
-
Object.defineProperty(exports, "localeDecimalSeparator", { enumerable: true, get: function () { return number_formatter_1.localeDecimalSeparator; } });
|
|
10
|
-
var register_convention_1 = require("./register-convention");
|
|
11
|
-
Object.defineProperty(exports, "RegisterConvention", { enumerable: true, get: function () { return register_convention_1.RegisterConvention; } });
|
|
12
|
-
var step_1 = require("./step");
|
|
13
|
-
Object.defineProperty(exports, "Step", { enumerable: true, get: function () { return step_1.Step; } });
|
|
14
|
-
Object.defineProperty(exports, "DayOfWeek", { enumerable: true, get: function () { return step_1.DayOfWeek; } });
|
|
15
|
-
var time_or_rule_1 = require("./time-or-rule");
|
|
16
|
-
Object.defineProperty(exports, "TimeOrRule", { enumerable: true, get: function () { return time_or_rule_1.TimeOrRule; } });
|
|
17
|
-
var precision_number_1 = require("./precision-number");
|
|
18
|
-
Object.defineProperty(exports, "PrecisionNumber", { enumerable: true, get: function () { return precision_number_1.PrecisionNumber; } });
|
|
19
|
-
require("./repository"); // We need this to get the Repository namespace exported
|
|
20
|
-
var repository_1 = require("./repository");
|
|
21
|
-
Object.defineProperty(exports, "Repository", { enumerable: true, get: function () { return repository_1.Repository; } });
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAGA,uDAAqD;AAuBjD,gGAvBK,kCAAe,OAuBL;AArBnB,uDAAwG;AAgBpG,gGAhBK,kCAAe,OAgBL;AAUf,0GA1BsB,4CAAyB,OA0BtB;AACzB,uGA3BiD,yCAAsB,OA2BjD;AA1B1B,6DAA2D;AAiBvD,mGAjBK,wCAAkB,OAiBL;AAdtB,+BAAyC;AAmBrC,qFAnBK,WAAI,OAmBL;AATJ,0FAVW,gBAAS,OAUX;AATb,+CAA4C;AAmBxC,2FAnBK,yBAAU,OAmBL;AAlBd,uDAAqD;AAWjD,gGAXK,kCAAe,OAWL;AAVnB,wBAAsB,CAAC,wDAAwD;AAC/E,2CAA0C;AActC,2FAdK,uBAAU,OAcL"}
|
package/dist/cjs/measure-id.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"measure-id.js","sourceRoot":"","sources":["../../src/measure-id.ts"],"names":[],"mappings":""}
|