@utiliread/primitives 1.0.0-70 → 1.0.0-72
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/dist/cjs/aggregate-id.js +2 -2
- package/dist/cjs/consumption-type-id.js +2 -2
- package/dist/cjs/index.js +21 -21
- package/dist/cjs/measure-id.js +2 -2
- package/dist/cjs/number-formatter.js +81 -81
- package/dist/cjs/number-formatter.spec.js +97 -97
- package/dist/cjs/optional.js +2 -2
- package/dist/cjs/precision-number.js +35 -35
- package/dist/cjs/precision-number.spec.js +26 -26
- package/dist/cjs/register-convention.js +55 -55
- package/dist/cjs/register-convention.spec.js +38 -38
- package/dist/cjs/register-definition.js +2 -2
- package/dist/cjs/register-id.js +2 -2
- package/dist/cjs/register-library.js +50 -50
- package/dist/cjs/register-library.spec.js +36 -36
- package/dist/cjs/register-pack.js +2 -2
- package/dist/cjs/register-utils.js +7 -7
- package/dist/cjs/repository.js +25 -25
- package/dist/cjs/repository.js.map +1 -1
- package/dist/cjs/repository.spec.js +20 -20
- package/dist/cjs/step.js +40 -40
- package/dist/cjs/step.js.map +1 -1
- package/dist/cjs/step.spec.js +28 -28
- package/dist/cjs/time-or-rule.js +18 -18
- package/dist/cjs/time-or-rule.js.map +1 -1
- package/dist/cjs/unit-id.js +13 -13
- package/dist/esm/aggregate-id.d.ts +1 -1
- package/dist/esm/aggregate-id.js +1 -1
- package/dist/esm/consumption-type-id.d.ts +1 -1
- package/dist/esm/consumption-type-id.js +1 -1
- package/dist/esm/index.d.ts +16 -16
- package/dist/esm/index.js +9 -9
- package/dist/esm/measure-id.d.ts +1 -1
- package/dist/esm/measure-id.js +1 -1
- package/dist/esm/number-formatter.d.ts +17 -17
- package/dist/esm/number-formatter.js +78 -78
- package/dist/esm/number-formatter.spec.d.ts +1 -1
- package/dist/esm/number-formatter.spec.js +95 -95
- package/dist/esm/optional.d.ts +1 -1
- package/dist/esm/optional.js +1 -1
- package/dist/esm/precision-number.d.ts +11 -11
- package/dist/esm/precision-number.js +31 -31
- package/dist/esm/precision-number.spec.d.ts +1 -1
- package/dist/esm/precision-number.spec.js +24 -24
- package/dist/esm/register-convention.d.ts +14 -14
- package/dist/esm/register-convention.js +51 -51
- package/dist/esm/register-convention.spec.d.ts +1 -1
- package/dist/esm/register-convention.spec.js +36 -36
- package/dist/esm/register-definition.d.ts +13 -13
- package/dist/esm/register-definition.js +1 -1
- package/dist/esm/register-id.d.ts +1 -1
- package/dist/esm/register-id.js +1 -1
- package/dist/esm/register-library.d.ts +15 -15
- package/dist/esm/register-library.js +47 -47
- package/dist/esm/register-library.spec.d.ts +1 -1
- package/dist/esm/register-library.spec.js +34 -34
- package/dist/esm/register-pack.d.ts +4 -4
- package/dist/esm/register-pack.js +1 -1
- package/dist/esm/register-utils.d.ts +3 -3
- package/dist/esm/register-utils.js +3 -3
- package/dist/esm/repository.d.ts +9 -9
- package/dist/esm/repository.js +21 -21
- package/dist/esm/repository.spec.d.ts +1 -1
- package/dist/esm/repository.spec.js +18 -18
- package/dist/esm/step.d.ts +15 -15
- package/dist/esm/step.js +37 -37
- package/dist/esm/step.spec.d.ts +1 -1
- package/dist/esm/step.spec.js +26 -26
- package/dist/esm/time-or-rule.d.ts +7 -7
- package/dist/esm/time-or-rule.js +15 -15
- package/dist/esm/unit-id.d.ts +2 -2
- package/dist/esm/unit-id.js +10 -10
- package/locales/da/registers.json +2 -1
- package/locales/en/registers.json +2 -1
- package/package.json +3 -3
- package/src/register-id.ts +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RegisterDefinition } from "./register-definition";
|
|
2
|
-
export interface RegisterPack {
|
|
3
|
-
[key: string]: RegisterDefinition;
|
|
4
|
-
}
|
|
1
|
+
import { RegisterDefinition } from "./register-definition";
|
|
2
|
+
export interface RegisterPack {
|
|
3
|
+
[key: string]: RegisterDefinition;
|
|
4
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=register-pack.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RegisterDefinition } from "./register-definition";
|
|
2
|
-
import { RegisterId } from "./register-id";
|
|
3
|
-
export declare function getRegisterId(register: RegisterId | RegisterDefinition): RegisterId;
|
|
1
|
+
import { RegisterDefinition } from "./register-definition";
|
|
2
|
+
import { RegisterId } from "./register-id";
|
|
3
|
+
export declare function getRegisterId(register: RegisterId | RegisterDefinition): RegisterId;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function getRegisterId(register) {
|
|
2
|
-
return typeof register === "string" ? register : register.id;
|
|
3
|
-
}
|
|
1
|
+
export function getRegisterId(register) {
|
|
2
|
+
return typeof register === "string" ? register : register.id;
|
|
3
|
+
}
|
|
4
4
|
//# sourceMappingURL=register-utils.js.map
|
package/dist/esm/repository.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type Repository = "some/repo";
|
|
2
|
-
export declare function Repository(repo: string): Repository;
|
|
3
|
-
export declare function Repository(team: string, name: string): Repository;
|
|
4
|
-
export declare namespace Repository {
|
|
5
|
-
function split(repo: Repository): {
|
|
6
|
-
team: string;
|
|
7
|
-
name: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
1
|
+
export type Repository = "some/repo";
|
|
2
|
+
export declare function Repository(repo: string): Repository;
|
|
3
|
+
export declare function Repository(team: string, name: string): Repository;
|
|
4
|
+
export declare namespace Repository {
|
|
5
|
+
function split(repo: Repository): {
|
|
6
|
+
team: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
package/dist/esm/repository.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export function Repository(repoOrTeam, name) {
|
|
2
|
-
if (name) {
|
|
3
|
-
return `${repoOrTeam}/${name}`;
|
|
4
|
-
}
|
|
5
|
-
else if (repoOrTeam.indexOf("/") > 0) {
|
|
6
|
-
return repoOrTeam;
|
|
7
|
-
}
|
|
8
|
-
else {
|
|
9
|
-
throw new TypeError("Invalid repository format");
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
(function (Repository) {
|
|
13
|
-
function split(repo) {
|
|
14
|
-
const parts = repo.split("/");
|
|
15
|
-
return {
|
|
16
|
-
team: parts[0],
|
|
17
|
-
name: parts[1],
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
Repository.split = split;
|
|
21
|
-
})(Repository || (Repository = {}));
|
|
1
|
+
export function Repository(repoOrTeam, name) {
|
|
2
|
+
if (name) {
|
|
3
|
+
return `${repoOrTeam}/${name}`;
|
|
4
|
+
}
|
|
5
|
+
else if (repoOrTeam.indexOf("/") > 0) {
|
|
6
|
+
return repoOrTeam;
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
throw new TypeError("Invalid repository format");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
(function (Repository) {
|
|
13
|
+
function split(repo) {
|
|
14
|
+
const parts = repo.split("/");
|
|
15
|
+
return {
|
|
16
|
+
team: parts[0],
|
|
17
|
+
name: parts[1],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
Repository.split = split;
|
|
21
|
+
})(Repository || (Repository = {}));
|
|
22
22
|
//# sourceMappingURL=repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { Repository } from "./repository";
|
|
3
|
-
describe("ctor", () => {
|
|
4
|
-
it("creates", () => {
|
|
5
|
-
expect(Repository("gpkv", "gjoel")).to.equal("gpkv/gjoel");
|
|
6
|
-
expect(Repository("gpkv/gjoel")).to.equal("gpkv/gjoel");
|
|
7
|
-
});
|
|
8
|
-
it("throws if wrong format", () => {
|
|
9
|
-
expect(() => Repository("invalid")).to.throw();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
describe("split", () => {
|
|
13
|
-
it("splits into correct parts", () => {
|
|
14
|
-
const { team, name } = Repository.split(Repository("gpkv", "gjoel"));
|
|
15
|
-
expect(team).to.equal("gpkv");
|
|
16
|
-
expect(name).to.equal("gjoel");
|
|
17
|
-
});
|
|
18
|
-
});
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import { Repository } from "./repository";
|
|
3
|
+
describe("ctor", () => {
|
|
4
|
+
it("creates", () => {
|
|
5
|
+
expect(Repository("gpkv", "gjoel")).to.equal("gpkv/gjoel");
|
|
6
|
+
expect(Repository("gpkv/gjoel")).to.equal("gpkv/gjoel");
|
|
7
|
+
});
|
|
8
|
+
it("throws if wrong format", () => {
|
|
9
|
+
expect(() => Repository("invalid")).to.throw();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
describe("split", () => {
|
|
13
|
+
it("splits into correct parts", () => {
|
|
14
|
+
const { team, name } = Repository.split(Repository("gpkv", "gjoel"));
|
|
15
|
+
expect(team).to.equal("gpkv");
|
|
16
|
+
expect(name).to.equal("gjoel");
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
19
|
//# sourceMappingURL=repository.spec.js.map
|
package/dist/esm/step.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { DateTime, Duration } from "luxon";
|
|
2
|
-
export type Step = "hour" | "day" | "week" | "month" | "year";
|
|
3
|
-
export declare enum DayOfWeek {
|
|
4
|
-
Monday = 1,
|
|
5
|
-
Tuesday = 2,
|
|
6
|
-
Wednesday = 3,
|
|
7
|
-
Thursday = 4,
|
|
8
|
-
Friday = 5,
|
|
9
|
-
Saturday = 6,
|
|
10
|
-
Sunday = 7
|
|
11
|
-
}
|
|
12
|
-
export declare namespace Step {
|
|
13
|
-
function startOf(dateTime: DateTime, step: Step, firstDayOfWeek?: DayOfWeek): DateTime;
|
|
14
|
-
function asDuration(step: Step, amount?: number): Duration;
|
|
15
|
-
}
|
|
1
|
+
import { DateTime, Duration } from "luxon";
|
|
2
|
+
export type Step = "hour" | "day" | "week" | "month" | "year";
|
|
3
|
+
export declare enum DayOfWeek {
|
|
4
|
+
Monday = 1,
|
|
5
|
+
Tuesday = 2,
|
|
6
|
+
Wednesday = 3,
|
|
7
|
+
Thursday = 4,
|
|
8
|
+
Friday = 5,
|
|
9
|
+
Saturday = 6,
|
|
10
|
+
Sunday = 7
|
|
11
|
+
}
|
|
12
|
+
export declare namespace Step {
|
|
13
|
+
function startOf(dateTime: DateTime, step: Step, firstDayOfWeek?: DayOfWeek): DateTime;
|
|
14
|
+
function asDuration(step: Step, amount?: number): Duration;
|
|
15
|
+
}
|
package/dist/esm/step.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { Duration } from "luxon";
|
|
2
|
-
export var DayOfWeek;
|
|
3
|
-
(function (DayOfWeek) {
|
|
4
|
-
DayOfWeek[DayOfWeek["Monday"] = 1] = "Monday";
|
|
5
|
-
DayOfWeek[DayOfWeek["Tuesday"] = 2] = "Tuesday";
|
|
6
|
-
DayOfWeek[DayOfWeek["Wednesday"] = 3] = "Wednesday";
|
|
7
|
-
DayOfWeek[DayOfWeek["Thursday"] = 4] = "Thursday";
|
|
8
|
-
DayOfWeek[DayOfWeek["Friday"] = 5] = "Friday";
|
|
9
|
-
DayOfWeek[DayOfWeek["Saturday"] = 6] = "Saturday";
|
|
10
|
-
DayOfWeek[DayOfWeek["Sunday"] = 7] = "Sunday";
|
|
11
|
-
})(DayOfWeek || (DayOfWeek = {}));
|
|
12
|
-
;
|
|
13
|
-
export var Step;
|
|
14
|
-
(function (Step) {
|
|
15
|
-
function startOf(dateTime, step, firstDayOfWeek) {
|
|
16
|
-
if (step === "week") {
|
|
17
|
-
const value = dateTime.startOf("day").set({ weekday: firstDayOfWeek !== null && firstDayOfWeek !== void 0 ? firstDayOfWeek : DayOfWeek.Monday });
|
|
18
|
-
return value > dateTime
|
|
19
|
-
? value.minus({ days: 7 })
|
|
20
|
-
: value;
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
return dateTime.startOf(step);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
Step.startOf = startOf;
|
|
27
|
-
function asDuration(step, amount = 1) {
|
|
28
|
-
switch (step) {
|
|
29
|
-
case "hour": return Duration.fromObject({ hours: amount });
|
|
30
|
-
case "day": return Duration.fromObject({ days: amount });
|
|
31
|
-
case "week": return Duration.fromObject({ days: 7 * amount });
|
|
32
|
-
case "month": return Duration.fromObject({ months: amount });
|
|
33
|
-
case "year": return Duration.fromObject({ years: amount });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
Step.asDuration = asDuration;
|
|
37
|
-
})(Step || (Step = {}));
|
|
1
|
+
import { Duration } from "luxon";
|
|
2
|
+
export var DayOfWeek;
|
|
3
|
+
(function (DayOfWeek) {
|
|
4
|
+
DayOfWeek[DayOfWeek["Monday"] = 1] = "Monday";
|
|
5
|
+
DayOfWeek[DayOfWeek["Tuesday"] = 2] = "Tuesday";
|
|
6
|
+
DayOfWeek[DayOfWeek["Wednesday"] = 3] = "Wednesday";
|
|
7
|
+
DayOfWeek[DayOfWeek["Thursday"] = 4] = "Thursday";
|
|
8
|
+
DayOfWeek[DayOfWeek["Friday"] = 5] = "Friday";
|
|
9
|
+
DayOfWeek[DayOfWeek["Saturday"] = 6] = "Saturday";
|
|
10
|
+
DayOfWeek[DayOfWeek["Sunday"] = 7] = "Sunday";
|
|
11
|
+
})(DayOfWeek || (DayOfWeek = {}));
|
|
12
|
+
;
|
|
13
|
+
export var Step;
|
|
14
|
+
(function (Step) {
|
|
15
|
+
function startOf(dateTime, step, firstDayOfWeek) {
|
|
16
|
+
if (step === "week") {
|
|
17
|
+
const value = dateTime.startOf("day").set({ weekday: firstDayOfWeek !== null && firstDayOfWeek !== void 0 ? firstDayOfWeek : DayOfWeek.Monday });
|
|
18
|
+
return value > dateTime
|
|
19
|
+
? value.minus({ days: 7 })
|
|
20
|
+
: value;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return dateTime.startOf(step);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
Step.startOf = startOf;
|
|
27
|
+
function asDuration(step, amount = 1) {
|
|
28
|
+
switch (step) {
|
|
29
|
+
case "hour": return Duration.fromObject({ hours: amount });
|
|
30
|
+
case "day": return Duration.fromObject({ days: amount });
|
|
31
|
+
case "week": return Duration.fromObject({ days: 7 * amount });
|
|
32
|
+
case "month": return Duration.fromObject({ months: amount });
|
|
33
|
+
case "year": return Duration.fromObject({ years: amount });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
Step.asDuration = asDuration;
|
|
37
|
+
})(Step || (Step = {}));
|
|
38
38
|
//# sourceMappingURL=step.js.map
|
package/dist/esm/step.spec.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/esm/step.spec.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { DateTime } from "luxon";
|
|
3
|
-
import { DayOfWeek, Step } from "./step";
|
|
4
|
-
describe("startOf", () => {
|
|
5
|
-
it("returns start of day", () => {
|
|
6
|
-
const dt = DateTime.fromISO("2020-01-11T05:00:00+01:00");
|
|
7
|
-
const result = Step.startOf(dt, "day");
|
|
8
|
-
expect(+result).to.equal(+DateTime.fromISO("2020-01-11T00:00:00+01:00"));
|
|
9
|
-
});
|
|
10
|
-
it("returns previous monday from saturday", () => {
|
|
11
|
-
const dt = DateTime.fromISO("2020-01-11T05:00:00+01:00");
|
|
12
|
-
const result = Step.startOf(dt, "week", DayOfWeek.Monday);
|
|
13
|
-
expect(+result).to.equal(+DateTime.fromISO("2020-01-06T00:00:00+01:00"));
|
|
14
|
-
});
|
|
15
|
-
it("returns same monday from monday with hour", () => {
|
|
16
|
-
const dt = DateTime.fromISO("2020-01-13T05:00:00+01:00");
|
|
17
|
-
const result = Step.startOf(dt, "week", DayOfWeek.Monday);
|
|
18
|
-
expect(+result).to.equal(+DateTime.fromISO("2020-01-13T00:00:00+01:00"));
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
describe("asDuration", () => {
|
|
22
|
-
it("should return equivalent duration", () => {
|
|
23
|
-
const duration = Step.asDuration("week");
|
|
24
|
-
expect(duration.days).to.equal(7);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import { DateTime } from "luxon";
|
|
3
|
+
import { DayOfWeek, Step } from "./step";
|
|
4
|
+
describe("startOf", () => {
|
|
5
|
+
it("returns start of day", () => {
|
|
6
|
+
const dt = DateTime.fromISO("2020-01-11T05:00:00+01:00");
|
|
7
|
+
const result = Step.startOf(dt, "day");
|
|
8
|
+
expect(+result).to.equal(+DateTime.fromISO("2020-01-11T00:00:00+01:00"));
|
|
9
|
+
});
|
|
10
|
+
it("returns previous monday from saturday", () => {
|
|
11
|
+
const dt = DateTime.fromISO("2020-01-11T05:00:00+01:00");
|
|
12
|
+
const result = Step.startOf(dt, "week", DayOfWeek.Monday);
|
|
13
|
+
expect(+result).to.equal(+DateTime.fromISO("2020-01-06T00:00:00+01:00"));
|
|
14
|
+
});
|
|
15
|
+
it("returns same monday from monday with hour", () => {
|
|
16
|
+
const dt = DateTime.fromISO("2020-01-13T05:00:00+01:00");
|
|
17
|
+
const result = Step.startOf(dt, "week", DayOfWeek.Monday);
|
|
18
|
+
expect(+result).to.equal(+DateTime.fromISO("2020-01-13T00:00:00+01:00"));
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe("asDuration", () => {
|
|
22
|
+
it("should return equivalent duration", () => {
|
|
23
|
+
const duration = Step.asDuration("week");
|
|
24
|
+
expect(duration.days).to.equal(7);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
27
|
//# sourceMappingURL=step.spec.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DateTime } from "luxon";
|
|
2
|
-
export type TimeOrRule = Date | DateTime | string;
|
|
3
|
-
export declare namespace TimeOrRule {
|
|
4
|
-
function isTime(input: TimeOrRule): input is Date | DateTime;
|
|
5
|
-
function isRule(input: TimeOrRule): input is string;
|
|
6
|
-
function asJSON(input: TimeOrRule): string;
|
|
7
|
-
}
|
|
1
|
+
import { DateTime } from "luxon";
|
|
2
|
+
export type TimeOrRule = Date | DateTime | string;
|
|
3
|
+
export declare namespace TimeOrRule {
|
|
4
|
+
function isTime(input: TimeOrRule): input is Date | DateTime;
|
|
5
|
+
function isRule(input: TimeOrRule): input is string;
|
|
6
|
+
function asJSON(input: TimeOrRule): string | null;
|
|
7
|
+
}
|
package/dist/esm/time-or-rule.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export var TimeOrRule;
|
|
2
|
-
(function (TimeOrRule) {
|
|
3
|
-
function isTime(input) {
|
|
4
|
-
return typeof input !== "string";
|
|
5
|
-
}
|
|
6
|
-
TimeOrRule.isTime = isTime;
|
|
7
|
-
function isRule(input) {
|
|
8
|
-
return typeof input === "string";
|
|
9
|
-
}
|
|
10
|
-
TimeOrRule.isRule = isRule;
|
|
11
|
-
function asJSON(input) {
|
|
12
|
-
return isRule(input) ? input : input.toJSON();
|
|
13
|
-
}
|
|
14
|
-
TimeOrRule.asJSON = asJSON;
|
|
15
|
-
})(TimeOrRule || (TimeOrRule = {}));
|
|
1
|
+
export var TimeOrRule;
|
|
2
|
+
(function (TimeOrRule) {
|
|
3
|
+
function isTime(input) {
|
|
4
|
+
return typeof input !== "string";
|
|
5
|
+
}
|
|
6
|
+
TimeOrRule.isTime = isTime;
|
|
7
|
+
function isRule(input) {
|
|
8
|
+
return typeof input === "string";
|
|
9
|
+
}
|
|
10
|
+
TimeOrRule.isRule = isRule;
|
|
11
|
+
function asJSON(input) {
|
|
12
|
+
return isRule(input) ? input : input.toJSON();
|
|
13
|
+
}
|
|
14
|
+
TimeOrRule.asJSON = asJSON;
|
|
15
|
+
})(TimeOrRule || (TimeOrRule = {}));
|
|
16
16
|
//# sourceMappingURL=time-or-rule.js.map
|
package/dist/esm/unit-id.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type UnitId = "unitless" | "milliWattHour" | "wattHour" | "kiloWattHour" | "megaWattHour" | "gigaWattHour" | "calorie" | "kiloCalorie" | "megaCalorie" | "joule" | "kiloJoule" | "megaJoule" | "gigaJoule" | "liter" | "cubicMeter" | "fluidOunce" | "gallon" | "gram" | "kiloGram" | "tonne" | "ounce" | "pound" | "ton" | "second" | "minute" | "hour" | "day" | "week" | "month" | "year" | "milliWatt" | "milliWatt2" | "watt" | "watt2" | "kiloWatt" | "kiloWatt2" | "megaWatt" | "megaWatt2" | "gigaWatt" | "gigaWatt2" | "joulesPerSecond" | "joulesPerSecond2" | "joulesPerMinute" | "joulesPerMinute2" | "joulesPerHour" | "joulesPerHour2" | "litersPerSecond" | "litersPerSecond2" | "litersPerMinute" | "litersPerMinute2" | "litersPerHour" | "litersPerHour2" | "cubicMetersPerSecond" | "cubicMetersPerSecond2" | "cubicMetersPerMinute" | "cubicMetersPerMinute2" | "cubicMetersPerHour" | "cubicMetersPerHour2" | "fluidOuncesPerSecond" | "fluidOuncesPerSecond2" | "fluidOuncesPerMinute" | "fluidOuncesPerMinute2" | "fluidOuncesPerHour" | "fluidOuncesPerHour2" | "gallonsPerSecond" | "gallonsPerSecond2" | "gallonsPerMinute" | "gallonsPerMinute2" | "gallonsPerHour" | "gallonsPerHour2" | "gramsPerSecond" | "gramsPerSecond2" | "gramsPerMinute" | "gramsPerMinute2" | "gramsPerHour" | "gramsPerHour2" | "kiloGramsPerSecond" | "kiloGramsPerSecond2" | "kiloGramsPerMinute" | "kiloGramsPerMinute2" | "kiloGramsPerHour" | "kiloGramsPerHour2" | "celcius" | "kelvin" | "fahrenheit" | "bar" | "bar2" | "pascal" | "pascal2" | "var" | "kiloVar" | "megaVar" | "varHour" | "kiloVarHour" | "megaVarHour" | "percentage" | "literCelcius" | "cubicMeterCelcius";
|
|
2
|
-
export declare const energyUnits: UnitId[];
|
|
1
|
+
export type UnitId = "unitless" | "milliWattHour" | "wattHour" | "kiloWattHour" | "megaWattHour" | "gigaWattHour" | "calorie" | "kiloCalorie" | "megaCalorie" | "joule" | "kiloJoule" | "megaJoule" | "gigaJoule" | "liter" | "cubicMeter" | "fluidOunce" | "gallon" | "gram" | "kiloGram" | "tonne" | "ounce" | "pound" | "ton" | "second" | "minute" | "hour" | "day" | "week" | "month" | "year" | "milliWatt" | "milliWatt2" | "watt" | "watt2" | "kiloWatt" | "kiloWatt2" | "megaWatt" | "megaWatt2" | "gigaWatt" | "gigaWatt2" | "joulesPerSecond" | "joulesPerSecond2" | "joulesPerMinute" | "joulesPerMinute2" | "joulesPerHour" | "joulesPerHour2" | "litersPerSecond" | "litersPerSecond2" | "litersPerMinute" | "litersPerMinute2" | "litersPerHour" | "litersPerHour2" | "cubicMetersPerSecond" | "cubicMetersPerSecond2" | "cubicMetersPerMinute" | "cubicMetersPerMinute2" | "cubicMetersPerHour" | "cubicMetersPerHour2" | "fluidOuncesPerSecond" | "fluidOuncesPerSecond2" | "fluidOuncesPerMinute" | "fluidOuncesPerMinute2" | "fluidOuncesPerHour" | "fluidOuncesPerHour2" | "gallonsPerSecond" | "gallonsPerSecond2" | "gallonsPerMinute" | "gallonsPerMinute2" | "gallonsPerHour" | "gallonsPerHour2" | "gramsPerSecond" | "gramsPerSecond2" | "gramsPerMinute" | "gramsPerMinute2" | "gramsPerHour" | "gramsPerHour2" | "kiloGramsPerSecond" | "kiloGramsPerSecond2" | "kiloGramsPerMinute" | "kiloGramsPerMinute2" | "kiloGramsPerHour" | "kiloGramsPerHour2" | "celcius" | "kelvin" | "fahrenheit" | "bar" | "bar2" | "pascal" | "pascal2" | "var" | "kiloVar" | "megaVar" | "varHour" | "kiloVarHour" | "megaVarHour" | "percentage" | "literCelcius" | "cubicMeterCelcius";
|
|
2
|
+
export declare const energyUnits: UnitId[];
|
package/dist/esm/unit-id.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export const energyUnits = [
|
|
2
|
-
"milliWattHour",
|
|
3
|
-
"wattHour",
|
|
4
|
-
"kiloWattHour",
|
|
5
|
-
"megaWattHour",
|
|
6
|
-
"gigaWattHour",
|
|
7
|
-
"calorie",
|
|
8
|
-
"kiloCalorie",
|
|
9
|
-
"megaCalorie",
|
|
10
|
-
];
|
|
1
|
+
export const energyUnits = [
|
|
2
|
+
"milliWattHour",
|
|
3
|
+
"wattHour",
|
|
4
|
+
"kiloWattHour",
|
|
5
|
+
"megaWattHour",
|
|
6
|
+
"gigaWattHour",
|
|
7
|
+
"calorie",
|
|
8
|
+
"kiloCalorie",
|
|
9
|
+
"megaCalorie",
|
|
10
|
+
];
|
|
11
11
|
//# sourceMappingURL=unit-id.js.map
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
"kamdaDeviceAddresses": ["Enhedsadresser", "Enhedsadresser (Kamstrup DA)"],
|
|
196
196
|
"msisdnDeviceAddresses": ["Telefonnumre", "Telefonnumre"],
|
|
197
197
|
"deviceRegisters": ["Enhedsregistre", "Enhedsregistre"],
|
|
198
|
-
"
|
|
198
|
+
"place": ["Forbrugssted", "Forbrugssted"],
|
|
199
199
|
|
|
200
200
|
"mBusFormatStringSignature": ["MBus Signatur", "MBus Signatur"],
|
|
201
201
|
"deviceSoftwareVersion": ["Programversion", "Programversion"],
|
|
@@ -208,6 +208,7 @@
|
|
|
208
208
|
"kamstrupModuleType": ["Kamstrup Modultype", "Kamstrup Modultype"],
|
|
209
209
|
|
|
210
210
|
"diehlInfocodeType1": ["Diehl Infokode (type 1)", "Diehl Infokode (type 1)"],
|
|
211
|
+
"diehlInfocodeType2": ["Diehl Infokode (type 2)", "Diehl Infokode (type 2)"],
|
|
211
212
|
"diehlInfocode": ["Diehl Infokode", "Diehl Infokode"],
|
|
212
213
|
|
|
213
214
|
"landisGyrMBusStatusType1": ["Landis+Gyr M-Bus Status (type 1)", "Landis+Gyr M-Bus Status (type 1)"],
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
"kamdaDeviceAddresses": ["Enhedsadresser", "Enhedsadresser (Kamstrup DA)"],
|
|
196
196
|
"msisdnDeviceAddresses": ["Phone numbers", "Phone numbers"],
|
|
197
197
|
"deviceRegisters": ["Device registers", "Device registers"],
|
|
198
|
-
"
|
|
198
|
+
"place": ["Place", "Place"],
|
|
199
199
|
|
|
200
200
|
"mBusFormatStringSignature": ["MBus Signature", "MBus Signature"],
|
|
201
201
|
"deviceSoftwareVersion": ["Version", "Device Software Version"],
|
|
@@ -208,6 +208,7 @@
|
|
|
208
208
|
"kamstrupModuleType": ["Kamstrup module type", "Kamstrup module type"],
|
|
209
209
|
|
|
210
210
|
"diehlInfocodeType1": ["Diehl Infocode (type 1)", "Diehl Infocode (type 1)"],
|
|
211
|
+
"diehlInfocodeType2": ["Diehl Infocode (type 2)", "Diehl Infocode (type 2)"],
|
|
211
212
|
"diehlInfocode": ["Diehl Infocode", "Diehl Infocode"],
|
|
212
213
|
|
|
213
214
|
"landisGyrMBusStatusType1": ["Landis+Gyr M-Bus Status (type 1)", "Landis+Gyr M-Bus Status (type 1)"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utiliread/primitives",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-72",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"karma-typescript": "^5.5.1",
|
|
28
28
|
"luxon": "^3.0.4",
|
|
29
29
|
"mocha": "^10.0.0",
|
|
30
|
-
"rimraf": "^
|
|
31
|
-
"typescript": "^
|
|
30
|
+
"rimraf": "^5.0.1",
|
|
31
|
+
"typescript": "^5.1.6"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"luxon": "^2.1.0 || ^3.0.0"
|
package/src/register-id.ts
CHANGED
|
@@ -278,7 +278,7 @@ export type RegisterId =
|
|
|
278
278
|
|
|
279
279
|
"deviceRegisters" |
|
|
280
280
|
|
|
281
|
-
"
|
|
281
|
+
"place" |
|
|
282
282
|
|
|
283
283
|
"mBusFormatStringSignature" |
|
|
284
284
|
"deviceSoftwareVersion" |
|
|
@@ -291,6 +291,7 @@ export type RegisterId =
|
|
|
291
291
|
"kamstrupModuleType" |
|
|
292
292
|
|
|
293
293
|
"diehlInfocodeType1" |
|
|
294
|
+
"diehlInfocodeType2" |
|
|
294
295
|
"diehlInfocode" |
|
|
295
296
|
|
|
296
297
|
"landisGyrMBusStatusType1" |
|