@utiliread/primitives 1.0.0-73 → 1.0.0-76
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/locales/da/aggregates.json +7 -7
- package/locales/da/consumption-types.json +6 -6
- package/locales/da/measures.json +15 -15
- package/locales/da/registers.json +362 -221
- package/locales/da/units.json +92 -92
- package/locales/en/aggregates.json +7 -7
- package/locales/en/consumption-types.json +6 -6
- package/locales/en/measures.json +15 -15
- package/locales/en/registers.json +371 -221
- package/locales/en/units.json +92 -92
- package/package.json +7 -11
- package/src/aggregate-id.ts +8 -8
- package/src/consumption-type-id.ts +7 -7
- package/src/index.ts +39 -35
- package/src/measure-id.ts +14 -14
- package/src/number-formatter.spec.ts +509 -65
- package/src/number-formatter.ts +43 -20
- package/src/optional.ts +1 -1
- package/src/precision-number.spec.ts +28 -28
- package/src/precision-number.ts +44 -36
- package/src/register-convention.spec.ts +14 -5
- package/src/register-convention.ts +14 -5
- package/src/register-definition.ts +23 -23
- package/src/register-id.ts +266 -327
- package/src/register-library.spec.ts +5 -5
- package/src/register-library.ts +13 -7
- package/src/register-pack.ts +1 -1
- package/src/register-utils.ts +1 -1
- package/src/repository.spec.ts +20 -20
- package/src/repository.ts +24 -24
- package/src/step.spec.ts +13 -6
- package/src/step.ts +45 -37
- package/src/time-or-rule.ts +17 -17
- package/src/unit-id.ts +98 -119
- package/tsconfig.json +1 -0
- package/web-test-runner.config.mjs +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 -82
- package/dist/cjs/number-formatter.js.map +0 -1
- package/dist/cjs/number-formatter.spec.js +0 -98
- 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 -36
- package/dist/cjs/precision-number.js.map +0 -1
- package/dist/cjs/precision-number.spec.js +0 -27
- package/dist/cjs/precision-number.spec.js.map +0 -1
- package/dist/cjs/register-convention.js +0 -56
- 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 -51
- 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 -41
- 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 -79
- 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 -96
- 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 -32
- package/dist/esm/precision-number.js.map +0 -1
- package/dist/esm/precision-number.spec.d.ts +0 -1
- package/dist/esm/precision-number.spec.js +0 -25
- package/dist/esm/precision-number.spec.js.map +0 -1
- package/dist/esm/register-convention.d.ts +0 -14
- package/dist/esm/register-convention.js +0 -52
- 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 -48
- 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 -38
- 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/karma.config.js +0 -32
package/src/register-library.ts
CHANGED
|
@@ -3,13 +3,13 @@ import { RegisterId } from "./register-id";
|
|
|
3
3
|
import { RegisterPack } from "./register-pack";
|
|
4
4
|
|
|
5
5
|
class Library {
|
|
6
|
-
private definitions: Partial<{ [id in RegisterId]: RegisterDefinition }> =
|
|
6
|
+
private definitions: Partial<{ [id in RegisterId]: RegisterDefinition }> =
|
|
7
|
+
{};
|
|
7
8
|
public add(...definitions: (RegisterDefinition | RegisterPack)[]) {
|
|
8
9
|
for (const definition of definitions) {
|
|
9
10
|
if (isDefinition(definition)) {
|
|
10
11
|
this.tryAdd(definition);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
12
|
+
} else {
|
|
13
13
|
for (const definitionInPack of Object.values(definition)) {
|
|
14
14
|
this.tryAdd(definitionInPack);
|
|
15
15
|
}
|
|
@@ -42,7 +42,7 @@ class Library {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
public all() {
|
|
45
|
-
return Object.values(this.definitions).map(x => x!);
|
|
45
|
+
return Object.values(this.definitions).map((x) => x!);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
public reset() {
|
|
@@ -50,8 +50,14 @@ class Library {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
function isDefinition(
|
|
54
|
-
|
|
53
|
+
function isDefinition(
|
|
54
|
+
definitionOrPack: RegisterDefinition | RegisterPack,
|
|
55
|
+
): definitionOrPack is RegisterDefinition {
|
|
56
|
+
return !!(
|
|
57
|
+
definitionOrPack.id &&
|
|
58
|
+
definitionOrPack.aggregate &&
|
|
59
|
+
definitionOrPack.units
|
|
60
|
+
);
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
export const RegisterLibrary = new Library();
|
|
63
|
+
export const RegisterLibrary = new Library();
|
package/src/register-pack.ts
CHANGED
package/src/register-utils.ts
CHANGED
package/src/repository.spec.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
describe("ctor", () => {
|
|
5
|
-
it("creates", () => {
|
|
6
|
-
expect(Repository("gpkv", "gjoel")).to.equal("gpkv/gjoel");
|
|
7
|
-
expect(Repository("gpkv/gjoel")).to.equal("gpkv/gjoel");
|
|
8
|
-
});
|
|
9
|
-
it("throws if wrong format", () => {
|
|
10
|
-
expect(() => Repository("invalid")).to.throw();
|
|
11
|
-
})
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
describe("split", () => {
|
|
15
|
-
it("splits into correct parts", () => {
|
|
16
|
-
const { team, name } = Repository.split(Repository("gpkv", "gjoel"));
|
|
17
|
-
expect(team).to.equal("gpkv");
|
|
18
|
-
expect(name).to.equal("gjoel");
|
|
19
|
-
});
|
|
20
|
-
});
|
|
1
|
+
import { Repository } from "./repository";
|
|
2
|
+
import { expect } from "@esm-bundle/chai";
|
|
3
|
+
|
|
4
|
+
describe("ctor", () => {
|
|
5
|
+
it("creates", () => {
|
|
6
|
+
expect(Repository("gpkv", "gjoel")).to.equal("gpkv/gjoel");
|
|
7
|
+
expect(Repository("gpkv/gjoel")).to.equal("gpkv/gjoel");
|
|
8
|
+
});
|
|
9
|
+
it("throws if wrong format", () => {
|
|
10
|
+
expect(() => Repository("invalid")).to.throw();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
describe("split", () => {
|
|
15
|
+
it("splits into correct parts", () => {
|
|
16
|
+
const { team, name } = Repository.split(Repository("gpkv", "gjoel"));
|
|
17
|
+
expect(team).to.equal("gpkv");
|
|
18
|
+
expect(name).to.equal("gjoel");
|
|
19
|
+
});
|
|
20
|
+
});
|
package/src/repository.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
// This is clearly not correct but it provides some amazing type safety
|
|
2
|
-
export type Repository = "some/repo";
|
|
3
|
-
|
|
4
|
-
export function Repository(repo: string): Repository;
|
|
5
|
-
export function Repository(team: string, name: string): Repository;
|
|
6
|
-
export function Repository(repoOrTeam: string, name?: string): Repository {
|
|
7
|
-
if (name) {
|
|
8
|
-
return <Repository>`${repoOrTeam}/${name}`;
|
|
9
|
-
} else if (repoOrTeam.indexOf("/") > 0) {
|
|
10
|
-
return <Repository>repoOrTeam;
|
|
11
|
-
} else {
|
|
12
|
-
throw new TypeError("Invalid repository format");
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export namespace Repository {
|
|
17
|
-
export function split(repo: Repository) {
|
|
18
|
-
const parts = repo.split("/");
|
|
19
|
-
return {
|
|
20
|
-
team: parts[0],
|
|
21
|
-
name: parts[1],
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
// This is clearly not correct but it provides some amazing type safety
|
|
2
|
+
export type Repository = "some/repo";
|
|
3
|
+
|
|
4
|
+
export function Repository(repo: string): Repository;
|
|
5
|
+
export function Repository(team: string, name: string): Repository;
|
|
6
|
+
export function Repository(repoOrTeam: string, name?: string): Repository {
|
|
7
|
+
if (name) {
|
|
8
|
+
return <Repository>`${repoOrTeam}/${name}`;
|
|
9
|
+
} else if (repoOrTeam.indexOf("/") > 0) {
|
|
10
|
+
return <Repository>repoOrTeam;
|
|
11
|
+
} else {
|
|
12
|
+
throw new TypeError("Invalid repository format");
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export namespace Repository {
|
|
17
|
+
export function split(repo: Repository) {
|
|
18
|
+
const parts = repo.split("/");
|
|
19
|
+
return {
|
|
20
|
+
team: parts[0],
|
|
21
|
+
name: parts[1],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
package/src/step.spec.ts
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { DateTime } from "luxon";
|
|
3
1
|
import { DayOfWeek, Step } from "./step";
|
|
4
2
|
|
|
3
|
+
import { DateTime } from "luxon";
|
|
4
|
+
import { expect } from "@esm-bundle/chai";
|
|
5
|
+
|
|
5
6
|
describe("startOf", () => {
|
|
6
7
|
it("returns start of day", () => {
|
|
7
8
|
const dt = DateTime.fromISO("2020-01-11T05:00:00+01:00");
|
|
8
9
|
const result = Step.startOf(dt, "day");
|
|
9
|
-
expect(+result).to.equal(
|
|
10
|
+
expect(+result).to.equal(
|
|
11
|
+
+DateTime.fromISO("2020-01-11T00:00:00+01:00"),
|
|
12
|
+
);
|
|
10
13
|
});
|
|
11
14
|
|
|
12
15
|
it("returns previous monday from saturday", () => {
|
|
13
16
|
const dt = DateTime.fromISO("2020-01-11T05:00:00+01:00");
|
|
14
17
|
const result = Step.startOf(dt, "week", DayOfWeek.Monday);
|
|
15
|
-
expect(+result).to.equal(
|
|
18
|
+
expect(+result).to.equal(
|
|
19
|
+
+DateTime.fromISO("2020-01-06T00:00:00+01:00"),
|
|
20
|
+
);
|
|
16
21
|
});
|
|
17
22
|
|
|
18
23
|
it("returns same monday from monday with hour", () => {
|
|
19
24
|
const dt = DateTime.fromISO("2020-01-13T05:00:00+01:00");
|
|
20
25
|
const result = Step.startOf(dt, "week", DayOfWeek.Monday);
|
|
21
|
-
expect(+result).to.equal(
|
|
26
|
+
expect(+result).to.equal(
|
|
27
|
+
+DateTime.fromISO("2020-01-13T00:00:00+01:00"),
|
|
28
|
+
);
|
|
22
29
|
});
|
|
23
30
|
});
|
|
24
31
|
|
|
@@ -27,4 +34,4 @@ describe("asDuration", () => {
|
|
|
27
34
|
const duration = Step.asDuration("week");
|
|
28
35
|
expect(duration.days).to.equal(7);
|
|
29
36
|
});
|
|
30
|
-
});
|
|
37
|
+
});
|
package/src/step.ts
CHANGED
|
@@ -1,37 +1,45 @@
|
|
|
1
|
-
import { DateTime, Duration } from "luxon";
|
|
2
|
-
|
|
3
|
-
export type Step = "hour" | "day" | "week" | "month" | "year";
|
|
4
|
-
|
|
5
|
-
export enum DayOfWeek {
|
|
6
|
-
Monday = 1,
|
|
7
|
-
Tuesday = 2,
|
|
8
|
-
Wednesday = 3,
|
|
9
|
-
Thursday = 4,
|
|
10
|
-
Friday = 5,
|
|
11
|
-
Saturday = 6,
|
|
12
|
-
Sunday = 7,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export namespace Step {
|
|
16
|
-
export function startOf(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
case "
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import { DateTime, Duration } from "luxon";
|
|
2
|
+
|
|
3
|
+
export type Step = "hour" | "day" | "week" | "month" | "year";
|
|
4
|
+
|
|
5
|
+
export enum DayOfWeek {
|
|
6
|
+
Monday = 1,
|
|
7
|
+
Tuesday = 2,
|
|
8
|
+
Wednesday = 3,
|
|
9
|
+
Thursday = 4,
|
|
10
|
+
Friday = 5,
|
|
11
|
+
Saturday = 6,
|
|
12
|
+
Sunday = 7,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export namespace Step {
|
|
16
|
+
export function startOf(
|
|
17
|
+
dateTime: DateTime,
|
|
18
|
+
step: Step,
|
|
19
|
+
firstDayOfWeek?: DayOfWeek,
|
|
20
|
+
): DateTime {
|
|
21
|
+
if (step === "week") {
|
|
22
|
+
const value = dateTime
|
|
23
|
+
.startOf("day")
|
|
24
|
+
.set({ weekday: firstDayOfWeek ?? DayOfWeek.Monday });
|
|
25
|
+
return value > dateTime ? value.minus({ days: 7 }) : value;
|
|
26
|
+
} else {
|
|
27
|
+
return dateTime.startOf(step);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function asDuration(step: Step, amount = 1): Duration {
|
|
32
|
+
switch (step) {
|
|
33
|
+
case "hour":
|
|
34
|
+
return Duration.fromObject({ hours: amount });
|
|
35
|
+
case "day":
|
|
36
|
+
return Duration.fromObject({ days: amount });
|
|
37
|
+
case "week":
|
|
38
|
+
return Duration.fromObject({ days: 7 * amount });
|
|
39
|
+
case "month":
|
|
40
|
+
return Duration.fromObject({ months: amount });
|
|
41
|
+
case "year":
|
|
42
|
+
return Duration.fromObject({ years: amount });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/time-or-rule.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { DateTime } from "luxon";
|
|
2
|
-
|
|
3
|
-
export type TimeOrRule = Date | DateTime | string;
|
|
4
|
-
|
|
5
|
-
export namespace TimeOrRule {
|
|
6
|
-
export function isTime(input: TimeOrRule): input is Date | DateTime {
|
|
7
|
-
return typeof input !== "string";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function isRule(input: TimeOrRule): input is string {
|
|
11
|
-
return typeof input === "string";
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function asJSON(input: TimeOrRule) {
|
|
15
|
-
return isRule(input) ? input : input.toJSON();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
import { DateTime } from "luxon";
|
|
2
|
+
|
|
3
|
+
export type TimeOrRule = Date | DateTime | string;
|
|
4
|
+
|
|
5
|
+
export namespace TimeOrRule {
|
|
6
|
+
export function isTime(input: TimeOrRule): input is Date | DateTime {
|
|
7
|
+
return typeof input !== "string";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function isRule(input: TimeOrRule): input is string {
|
|
11
|
+
return typeof input === "string";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function asJSON(input: TimeOrRule) {
|
|
15
|
+
return isRule(input) ? input : input.toJSON();
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/unit-id.ts
CHANGED
|
@@ -1,123 +1,102 @@
|
|
|
1
1
|
export type UnitId =
|
|
2
|
-
"unitless"
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
"celcius" |
|
|
101
|
-
"kelvin" |
|
|
102
|
-
"fahrenheit" |
|
|
103
|
-
|
|
104
|
-
"bar" |
|
|
105
|
-
"bar2" |
|
|
106
|
-
"pascal" |
|
|
107
|
-
"pascal2" |
|
|
108
|
-
|
|
109
|
-
"var" |
|
|
110
|
-
"kiloVar" |
|
|
111
|
-
"megaVar" |
|
|
112
|
-
|
|
113
|
-
"varHour" |
|
|
114
|
-
"kiloVarHour" |
|
|
115
|
-
"megaVarHour" |
|
|
116
|
-
|
|
117
|
-
"percentage" |
|
|
118
|
-
|
|
119
|
-
"literCelcius" |
|
|
120
|
-
"cubicMeterCelcius";
|
|
2
|
+
| "unitless"
|
|
3
|
+
| "milliWattHour"
|
|
4
|
+
| "wattHour"
|
|
5
|
+
| "kiloWattHour"
|
|
6
|
+
| "megaWattHour"
|
|
7
|
+
| "gigaWattHour"
|
|
8
|
+
| "calorie"
|
|
9
|
+
| "kiloCalorie"
|
|
10
|
+
| "megaCalorie"
|
|
11
|
+
| "joule"
|
|
12
|
+
| "kiloJoule"
|
|
13
|
+
| "megaJoule"
|
|
14
|
+
| "gigaJoule"
|
|
15
|
+
| "liter"
|
|
16
|
+
| "cubicMeter"
|
|
17
|
+
| "fluidOunce"
|
|
18
|
+
| "gallon"
|
|
19
|
+
| "gram"
|
|
20
|
+
| "kiloGram"
|
|
21
|
+
| "tonne"
|
|
22
|
+
| "ounce"
|
|
23
|
+
| "pound"
|
|
24
|
+
| "ton"
|
|
25
|
+
| "second"
|
|
26
|
+
| "minute"
|
|
27
|
+
| "hour"
|
|
28
|
+
| "day"
|
|
29
|
+
| "week"
|
|
30
|
+
| "month"
|
|
31
|
+
| "year"
|
|
32
|
+
| "milliWatt"
|
|
33
|
+
| "milliWatt2"
|
|
34
|
+
| "watt"
|
|
35
|
+
| "watt2"
|
|
36
|
+
| "kiloWatt"
|
|
37
|
+
| "kiloWatt2"
|
|
38
|
+
| "megaWatt"
|
|
39
|
+
| "megaWatt2"
|
|
40
|
+
| "gigaWatt"
|
|
41
|
+
| "gigaWatt2"
|
|
42
|
+
| "joulesPerSecond"
|
|
43
|
+
| "joulesPerSecond2"
|
|
44
|
+
| "joulesPerMinute"
|
|
45
|
+
| "joulesPerMinute2"
|
|
46
|
+
| "joulesPerHour"
|
|
47
|
+
| "joulesPerHour2"
|
|
48
|
+
| "litersPerSecond"
|
|
49
|
+
| "litersPerSecond2"
|
|
50
|
+
| "litersPerMinute"
|
|
51
|
+
| "litersPerMinute2"
|
|
52
|
+
| "litersPerHour"
|
|
53
|
+
| "litersPerHour2"
|
|
54
|
+
| "cubicMetersPerSecond"
|
|
55
|
+
| "cubicMetersPerSecond2"
|
|
56
|
+
| "cubicMetersPerMinute"
|
|
57
|
+
| "cubicMetersPerMinute2"
|
|
58
|
+
| "cubicMetersPerHour"
|
|
59
|
+
| "cubicMetersPerHour2"
|
|
60
|
+
| "fluidOuncesPerSecond"
|
|
61
|
+
| "fluidOuncesPerSecond2"
|
|
62
|
+
| "fluidOuncesPerMinute"
|
|
63
|
+
| "fluidOuncesPerMinute2"
|
|
64
|
+
| "fluidOuncesPerHour"
|
|
65
|
+
| "fluidOuncesPerHour2"
|
|
66
|
+
| "gallonsPerSecond"
|
|
67
|
+
| "gallonsPerSecond2"
|
|
68
|
+
| "gallonsPerMinute"
|
|
69
|
+
| "gallonsPerMinute2"
|
|
70
|
+
| "gallonsPerHour"
|
|
71
|
+
| "gallonsPerHour2"
|
|
72
|
+
| "gramsPerSecond"
|
|
73
|
+
| "gramsPerSecond2"
|
|
74
|
+
| "gramsPerMinute"
|
|
75
|
+
| "gramsPerMinute2"
|
|
76
|
+
| "gramsPerHour"
|
|
77
|
+
| "gramsPerHour2"
|
|
78
|
+
| "kiloGramsPerSecond"
|
|
79
|
+
| "kiloGramsPerSecond2"
|
|
80
|
+
| "kiloGramsPerMinute"
|
|
81
|
+
| "kiloGramsPerMinute2"
|
|
82
|
+
| "kiloGramsPerHour"
|
|
83
|
+
| "kiloGramsPerHour2"
|
|
84
|
+
| "celcius"
|
|
85
|
+
| "kelvin"
|
|
86
|
+
| "fahrenheit"
|
|
87
|
+
| "bar"
|
|
88
|
+
| "bar2"
|
|
89
|
+
| "pascal"
|
|
90
|
+
| "pascal2"
|
|
91
|
+
| "var"
|
|
92
|
+
| "kiloVar"
|
|
93
|
+
| "megaVar"
|
|
94
|
+
| "varHour"
|
|
95
|
+
| "kiloVarHour"
|
|
96
|
+
| "megaVarHour"
|
|
97
|
+
| "percentage"
|
|
98
|
+
| "literCelcius"
|
|
99
|
+
| "cubicMeterCelcius";
|
|
121
100
|
|
|
122
101
|
export const energyUnits: UnitId[] = [
|
|
123
102
|
"milliWattHour",
|
package/tsconfig.json
CHANGED
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
|
-
const register_library_1 = require("./register-library");
|
|
5
|
-
Object.defineProperty(exports, "RegisterLibrary", { enumerable: true, get: function () { return register_library_1.RegisterLibrary; } });
|
|
6
|
-
const 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
|
-
const register_convention_1 = require("./register-convention");
|
|
11
|
-
Object.defineProperty(exports, "RegisterConvention", { enumerable: true, get: function () { return register_convention_1.RegisterConvention; } });
|
|
12
|
-
const 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
|
-
const time_or_rule_1 = require("./time-or-rule");
|
|
16
|
-
Object.defineProperty(exports, "TimeOrRule", { enumerable: true, get: function () { return time_or_rule_1.TimeOrRule; } });
|
|
17
|
-
const 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
|
-
const 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,yDAAqD;AAuBjD,gGAvBK,kCAAe,OAuBL;AArBnB,yDAAwG;AAgBpG,gGAhBK,kCAAe,OAgBL;AAUf,0GA1BsB,4CAAyB,OA0BtB;AACzB,uGA3BiD,yCAAsB,OA2BjD;AA1B1B,+DAA2D;AAiBvD,mGAjBK,wCAAkB,OAiBL;AAdtB,iCAAyC;AAmBrC,qFAnBK,WAAI,OAmBL;AATJ,0FAVW,gBAAS,OAUX;AATb,iDAA4C;AAmBxC,2FAnBK,yBAAU,OAmBL;AAlBd,yDAAqD;AAWjD,gGAXK,kCAAe,OAWL;AAVnB,wBAAsB,CAAC,wDAAwD;AAC/E,6CAA0C;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":""}
|