@ddd-ts/shape 0.0.0-compute-timeout-on-process.7 → 0.0.0-compute-timeout-on-process.9
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/_.d.ts +35 -34
- package/dist/_.d.ts.map +1 -1
- package/dist/_.js +16 -15
- package/dist/_.mjs +36 -0
- package/dist/addons/microsecond-timestamp.d.ts +22 -25
- package/dist/addons/microsecond-timestamp.d.ts.map +1 -1
- package/dist/addons/microsecond-timestamp.js +2 -2
- package/dist/addons/microsecond-timestamp.mjs +61 -0
- package/dist/choice.d.ts +28 -26
- package/dist/choice.d.ts.map +1 -1
- package/dist/choice.js +3 -4
- package/dist/choice.mjs +44 -0
- package/dist/choice.spec.d.ts +2 -0
- package/dist/choice.spec.d.ts.map +1 -0
- package/dist/class.d.ts +16 -20
- package/dist/class.d.ts.map +1 -1
- package/dist/class.js +3 -4
- package/dist/class.mjs +30 -0
- package/dist/class.spec.d.ts +2 -0
- package/dist/class.spec.d.ts.map +1 -0
- package/dist/dict.d.ts +35 -30
- package/dist/dict.d.ts.map +1 -1
- package/dist/dict.js +5 -6
- package/dist/dict.mjs +41 -0
- package/dist/dict.spec.d.ts +2 -0
- package/dist/dict.spec.d.ts.map +1 -0
- package/dist/discriminated-union.d.ts +48 -37
- package/dist/discriminated-union.d.ts.map +1 -1
- package/dist/discriminated-union.js +6 -5
- package/dist/discriminated-union.mjs +64 -0
- package/dist/discriminated-union.spec.d.ts +2 -0
- package/dist/discriminated-union.spec.d.ts.map +1 -0
- package/dist/either.d.ts +71 -66
- package/dist/either.d.ts.map +1 -1
- package/dist/either.js +4 -5
- package/dist/either.mjs +51 -0
- package/dist/either.spec.d.ts +2 -0
- package/dist/either.spec.d.ts.map +1 -0
- package/dist/index.d.ts +14 -14
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -14
- package/dist/index.mjs +15 -0
- package/dist/literal.d.ts +12 -16
- package/dist/literal.d.ts.map +1 -1
- package/dist/literal.js +3 -4
- package/dist/literal.mjs +27 -0
- package/dist/literal.spec.d.ts +2 -0
- package/dist/literal.spec.d.ts.map +1 -0
- package/dist/mapping.d.ts +34 -25
- package/dist/mapping.d.ts.map +1 -1
- package/dist/mapping.js +7 -8
- package/dist/mapping.mjs +45 -0
- package/dist/mapping.spec.d.ts +2 -0
- package/dist/mapping.spec.d.ts.map +1 -0
- package/dist/multiple.d.ts +15 -18
- package/dist/multiple.d.ts.map +1 -1
- package/dist/multiple.js +4 -5
- package/dist/multiple.mjs +119 -0
- package/dist/multiple.spec.d.ts +2 -0
- package/dist/multiple.spec.d.ts.map +1 -0
- package/dist/nothing.d.ts +10 -14
- package/dist/nothing.d.ts.map +1 -1
- package/dist/nothing.js +3 -4
- package/dist/nothing.mjs +19 -0
- package/dist/nothing.spec.d.ts +2 -0
- package/dist/nothing.spec.d.ts.map +1 -0
- package/dist/optional.d.ts +19 -22
- package/dist/optional.d.ts.map +1 -1
- package/dist/optional.js +5 -6
- package/dist/optional.mjs +34 -0
- package/dist/optional.spec.d.ts +2 -0
- package/dist/optional.spec.d.ts.map +1 -0
- package/dist/primitive.d.ts +34 -17
- package/dist/primitive.d.ts.map +1 -1
- package/dist/primitive.js +3 -4
- package/dist/primitive.mjs +30 -0
- package/dist/primitive.spec.d.ts +2 -0
- package/dist/primitive.spec.d.ts.map +1 -0
- package/dist/test.d.ts +36 -0
- package/dist/test.d.ts.map +1 -0
- package/package.json +10 -5
- package/dist/_.js.map +0 -1
- package/dist/addons/microsecond-timestamp.js.map +0 -1
- package/dist/choice.js.map +0 -1
- package/dist/class.js.map +0 -1
- package/dist/dict.js.map +0 -1
- package/dist/discriminated-union.js.map +0 -1
- package/dist/either.js.map +0 -1
- package/dist/literal.js.map +0 -1
- package/dist/mapping.js.map +0 -1
- package/dist/multiple.js.map +0 -1
- package/dist/nothing.js.map +0 -1
- package/dist/optional.js.map +0 -1
- package/dist/primitive.js.map +0 -1
package/dist/_.d.ts
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Primitive, PrimitiveShorthand } from "./primitive
|
|
4
|
-
import { IMultiple, MultipleShorthand } from "./multiple
|
|
5
|
-
import { Nothing, NothingShorthand } from "./nothing
|
|
6
|
-
import { ILiteral, LiteralShorthand } from "./literal
|
|
7
|
-
|
|
8
|
-
//#region src/_.d.ts
|
|
9
|
-
declare abstract class Empty {}
|
|
10
|
-
interface Constructor<T = any, P extends any[] = any[]> {
|
|
11
|
-
new (...args: P): T;
|
|
1
|
+
import { type IClass, type ClassShorthand } from "./class";
|
|
2
|
+
import { type IDict, type DictShorthand } from "./dict";
|
|
3
|
+
import { Primitive, type PrimitiveShorthand } from "./primitive";
|
|
4
|
+
import { type IMultiple, type MultipleShorthand } from "./multiple";
|
|
5
|
+
import { Nothing, type NothingShorthand } from "./nothing";
|
|
6
|
+
import { type ILiteral, type LiteralShorthand } from "./literal";
|
|
7
|
+
export declare abstract class Empty {
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
$shape: string;
|
|
16
|
-
$inline: any;
|
|
17
|
-
$serialize(value: any): any;
|
|
18
|
-
$deserialize(value: any): any;
|
|
9
|
+
export interface Constructor<T = any, P extends any[] = any[]> {
|
|
10
|
+
new (...args: P): T;
|
|
19
11
|
}
|
|
20
|
-
type
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
export type AbstractConstructor<T = any, P extends any[] = any[]> = abstract new (...args: P) => T;
|
|
13
|
+
export interface Definition {
|
|
14
|
+
$shape: string;
|
|
15
|
+
$inline: any;
|
|
16
|
+
$serialize(value: any): any;
|
|
17
|
+
$deserialize(value: any): any;
|
|
18
|
+
}
|
|
19
|
+
export type MakeAbstract<T> = T extends new (...params: infer P) => infer R ? Omit<T, ""> & (abstract new (...params: P) => R) : never;
|
|
20
|
+
export type Concrete<T extends AbstractConstructor<any>> = T extends abstract new (...params: infer P) => infer R ? Omit<T, ""> & {
|
|
21
|
+
new (...params: P): R;
|
|
23
22
|
} : never;
|
|
24
|
-
type Shorthand = Definition | DictShorthand | PrimitiveShorthand | MultipleShorthand | NothingShorthand | ClassShorthand | LiteralShorthand;
|
|
25
|
-
type DefinitionOf<T extends Shorthand | Definition, B extends AbstractConstructor<{}> = typeof Empty> = T extends LiteralShorthand ? ILiteral<T, B> : T extends undefined ? ReturnType<typeof Nothing<B>> : T extends PrimitiveShorthand ? ReturnType<typeof Primitive<T, B>> : T extends MultipleShorthand ? IMultiple<T[0], B> : T extends ClassShorthand ? IClass<T, B> : T extends Definition ? T : T extends DictShorthand ? IDict<T, B> : never;
|
|
26
|
-
declare function Shape<const S extends Definition | Shorthand, B extends AbstractConstructor<{}> = typeof Empty>(shorthand: S, base?: B): DefinitionOf<S, B>;
|
|
27
|
-
type Expand<T> = T extends {
|
|
28
|
-
|
|
29
|
-
} ? T : T extends Date ? T : T extends Record<string, any> ? {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
export type Shorthand = Definition | DictShorthand | PrimitiveShorthand | MultipleShorthand | NothingShorthand | ClassShorthand | LiteralShorthand;
|
|
24
|
+
export type DefinitionOf<T extends Shorthand | Definition, B extends AbstractConstructor<{}> = typeof Empty> = T extends LiteralShorthand ? ILiteral<T, B> : T extends undefined ? ReturnType<typeof Nothing<B>> : T extends PrimitiveShorthand ? ReturnType<typeof Primitive<T, B>> : T extends MultipleShorthand ? IMultiple<T[0], B> : T extends ClassShorthand ? IClass<T, B> : T extends Definition ? T : T extends DictShorthand ? IDict<T, B> : never;
|
|
25
|
+
export declare function Shape<const S extends Definition | Shorthand, B extends AbstractConstructor<{}> = typeof Empty>(shorthand: S, base?: B): DefinitionOf<S, B>;
|
|
26
|
+
export type Expand<T> = T extends {
|
|
27
|
+
serialize(): any;
|
|
28
|
+
} ? T : T extends Date ? T : T extends Record<string, any> ? {
|
|
29
|
+
[key in keyof T]: Expand<T[key]>;
|
|
30
|
+
} : T;
|
|
31
|
+
export declare function forward<T extends AbstractConstructor<{
|
|
32
|
+
value: any;
|
|
33
|
+
}>, const Forward extends T extends AbstractConstructor<{
|
|
34
|
+
value: infer U;
|
|
35
|
+
}> ? (keyof U)[] : never>(base: T, forward: Forward): MakeAbstract<T & (new (...args: ConstructorParameters<T>) => InstanceType<T> & {
|
|
36
|
+
[K in Forward[number]]: InstanceType<T>["value"][K];
|
|
37
|
+
})>;
|
|
38
|
+
export type MergeClasses<B extends AbstractConstructor, Current extends AbstractConstructor> = abstract new (...args: ConstructorParameters<Current>) => InstanceType<B> & InstanceType<Current>;
|
|
38
39
|
//# sourceMappingURL=_.d.ts.map
|
package/dist/_.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_.d.ts","
|
|
1
|
+
{"version":3,"file":"_.d.ts","sourceRoot":"","sources":["../src/_.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAQ,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAW,KAAK,QAAQ,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE1E,8BAAsB,KAAK;CAAG;AAE9B,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,GAAG,EAAE,GAAG,GAAG,EAAE;IAC3D,KAAK,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;CAC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,CAAC,GACC,CAAC,KACC,GAAG,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAC9B,YAAY,CAAC,CAAC,CAAC,GAAG;KACpB,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CACpD,CAAC,CACL,CASA;AAED,MAAM,MAAM,YAAY,CACtB,CAAC,SAAS,mBAAmB,EAC7B,OAAO,SAAS,mBAAmB,IACjC,QAAQ,MACV,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,CAAC,KACpC,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/_.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const require_class = require('./class.js');
|
|
2
|
+
const require_dict = require('./dict.js');
|
|
3
|
+
const require_primitive = require('./primitive.js');
|
|
4
|
+
const require_multiple = require('./multiple.js');
|
|
5
|
+
const require_nothing = require('./nothing.js');
|
|
6
|
+
const require_literal = require('./literal.js');
|
|
7
7
|
|
|
8
8
|
//#region src/_.ts
|
|
9
9
|
var Empty = class {};
|
|
10
10
|
function Shape(shorthand, base = Empty) {
|
|
11
|
-
if (typeof shorthand === "string" || typeof shorthand === "number") return Literal(shorthand, base);
|
|
11
|
+
if (typeof shorthand === "string" || typeof shorthand === "number") return require_literal.Literal(shorthand, base);
|
|
12
12
|
if (shorthand && "$shape" in shorthand && "name" in shorthand && typeof shorthand.name === "string") {
|
|
13
13
|
if (shorthand.name.startsWith("$")) return shorthand;
|
|
14
|
-
return Class(shorthand, base);
|
|
14
|
+
return require_class.Class(shorthand, base);
|
|
15
15
|
}
|
|
16
|
-
if (shorthand === void 0) return Nothing(void 0, base);
|
|
16
|
+
if (shorthand === void 0) return require_nothing.Nothing(void 0, base);
|
|
17
17
|
if ([
|
|
18
18
|
String,
|
|
19
19
|
Number,
|
|
20
20
|
Date,
|
|
21
21
|
Boolean
|
|
22
|
-
].includes(shorthand)) return Primitive(shorthand, base);
|
|
23
|
-
if (shorthand && "prototype" in shorthand) return Class(shorthand, base);
|
|
24
|
-
if (Array.isArray(shorthand)) return Multiple(shorthand[0], base);
|
|
25
|
-
if (typeof shorthand === "object") return Dict(shorthand, base);
|
|
22
|
+
].includes(shorthand)) return require_primitive.Primitive(shorthand, base);
|
|
23
|
+
if (shorthand && "prototype" in shorthand) return require_class.Class(shorthand, base);
|
|
24
|
+
if (Array.isArray(shorthand)) return require_multiple.Multiple(shorthand[0], base);
|
|
25
|
+
if (typeof shorthand === "object") return require_dict.Dict(shorthand, base);
|
|
26
26
|
throw new Error(`Could not determine longhand from shorthand ${JSON.stringify(shorthand)}`);
|
|
27
27
|
}
|
|
28
28
|
function forward(base, forward) {
|
|
@@ -33,5 +33,6 @@ function forward(base, forward) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
//#endregion
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
exports.Empty = Empty;
|
|
37
|
+
exports.Shape = Shape;
|
|
38
|
+
exports.forward = forward;
|
package/dist/_.mjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Class } from "./class.mjs";
|
|
2
|
+
import { Dict } from "./dict.mjs";
|
|
3
|
+
import { Primitive } from "./primitive.mjs";
|
|
4
|
+
import { Multiple } from "./multiple.mjs";
|
|
5
|
+
import { Nothing } from "./nothing.mjs";
|
|
6
|
+
import { Literal } from "./literal.mjs";
|
|
7
|
+
|
|
8
|
+
//#region src/_.ts
|
|
9
|
+
var Empty = class {};
|
|
10
|
+
function Shape(shorthand, base = Empty) {
|
|
11
|
+
if (typeof shorthand === "string" || typeof shorthand === "number") return Literal(shorthand, base);
|
|
12
|
+
if (shorthand && "$shape" in shorthand && "name" in shorthand && typeof shorthand.name === "string") {
|
|
13
|
+
if (shorthand.name.startsWith("$")) return shorthand;
|
|
14
|
+
return Class(shorthand, base);
|
|
15
|
+
}
|
|
16
|
+
if (shorthand === void 0) return Nothing(void 0, base);
|
|
17
|
+
if ([
|
|
18
|
+
String,
|
|
19
|
+
Number,
|
|
20
|
+
Date,
|
|
21
|
+
Boolean
|
|
22
|
+
].includes(shorthand)) return Primitive(shorthand, base);
|
|
23
|
+
if (shorthand && "prototype" in shorthand) return Class(shorthand, base);
|
|
24
|
+
if (Array.isArray(shorthand)) return Multiple(shorthand[0], base);
|
|
25
|
+
if (typeof shorthand === "object") return Dict(shorthand, base);
|
|
26
|
+
throw new Error(`Could not determine longhand from shorthand ${JSON.stringify(shorthand)}`);
|
|
27
|
+
}
|
|
28
|
+
function forward(base, forward) {
|
|
29
|
+
for (const key of forward) Object.defineProperty(base.prototype, key, { get() {
|
|
30
|
+
return this.value[key].bind(this.value);
|
|
31
|
+
} });
|
|
32
|
+
return base;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { Empty, Shape, forward };
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
static sort(left: MicrosecondTimestamp, right: MicrosecondTimestamp): number;
|
|
1
|
+
export declare class MicrosecondTimestamp {
|
|
2
|
+
readonly micros: bigint;
|
|
3
|
+
static MILLISECOND: MicrosecondTimestamp;
|
|
4
|
+
static SECOND: MicrosecondTimestamp;
|
|
5
|
+
static MINUTE: MicrosecondTimestamp;
|
|
6
|
+
static HOUR: MicrosecondTimestamp;
|
|
7
|
+
static DAY: MicrosecondTimestamp;
|
|
8
|
+
static WEEK: MicrosecondTimestamp;
|
|
9
|
+
static MONTH: MicrosecondTimestamp;
|
|
10
|
+
constructor(micros: bigint);
|
|
11
|
+
isAfter(other: MicrosecondTimestamp): boolean;
|
|
12
|
+
equals(other: MicrosecondTimestamp): boolean;
|
|
13
|
+
isBefore(other: MicrosecondTimestamp): boolean;
|
|
14
|
+
add(micros: bigint | MicrosecondTimestamp): MicrosecondTimestamp;
|
|
15
|
+
sub(micros: bigint | MicrosecondTimestamp): MicrosecondTimestamp;
|
|
16
|
+
mult(factor: number): MicrosecondTimestamp;
|
|
17
|
+
static now(): MicrosecondTimestamp;
|
|
18
|
+
static fromNanoseconds(nanoseconds: bigint): MicrosecondTimestamp;
|
|
19
|
+
static fromMicroseconds(microseconds: bigint): MicrosecondTimestamp;
|
|
20
|
+
static deserialize(serialized: Date | MicrosecondTimestamp | bigint): MicrosecondTimestamp;
|
|
21
|
+
serialize(): Date;
|
|
22
|
+
static sort(left: MicrosecondTimestamp, right: MicrosecondTimestamp): number;
|
|
24
23
|
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { MicrosecondTimestamp };
|
|
27
24
|
//# sourceMappingURL=microsecond-timestamp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microsecond-timestamp.d.ts","
|
|
1
|
+
{"version":3,"file":"microsecond-timestamp.d.ts","sourceRoot":"","sources":["../../src/addons/microsecond-timestamp.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAoB;IASnB,QAAQ,CAAC,MAAM,EAAE,MAAM;IARnC,MAAM,CAAC,WAAW,uBAA2C;IAC7D,MAAM,CAAC,MAAM,uBAA+B;IAC5C,MAAM,CAAC,MAAM,uBAAwB;IACrC,MAAM,CAAC,IAAI,uBAAwB;IACnC,MAAM,CAAC,GAAG,uBAAsB;IAChC,MAAM,CAAC,IAAI,uBAAoB;IAC/B,MAAM,CAAC,KAAK,uBAAqB;gBAEZ,MAAM,EAAE,MAAM;IAEnC,OAAO,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAI7C,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAI5C,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAI9C,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,GAAG,oBAAoB;IAMhE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,GAAG,oBAAoB;IAMhE,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB;IAI1C,MAAM,CAAC,GAAG,IAAI,oBAAoB;IAIlC,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,oBAAoB;IAIjE,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,oBAAoB;IAInE,MAAM,CAAC,WAAW,CAChB,UAAU,EAAE,IAAI,GAAG,oBAAoB,GAAG,MAAM,GAC/C,oBAAoB;IAmBvB,SAAS;IAMT,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,oBAAoB,GAAG,MAAM;CAS7E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
//#region src/addons/microsecond-timestamp.ts
|
|
2
3
|
var MicrosecondTimestamp = class MicrosecondTimestamp {
|
|
3
4
|
static MILLISECOND = new MicrosecondTimestamp(BigInt(1e3));
|
|
@@ -58,5 +59,4 @@ var MicrosecondTimestamp = class MicrosecondTimestamp {
|
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
//#endregion
|
|
61
|
-
|
|
62
|
-
//# sourceMappingURL=microsecond-timestamp.js.map
|
|
62
|
+
exports.MicrosecondTimestamp = MicrosecondTimestamp;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//#region src/addons/microsecond-timestamp.ts
|
|
2
|
+
var MicrosecondTimestamp = class MicrosecondTimestamp {
|
|
3
|
+
static MILLISECOND = new MicrosecondTimestamp(BigInt(1e3));
|
|
4
|
+
static SECOND = this.MILLISECOND.mult(1e3);
|
|
5
|
+
static MINUTE = this.SECOND.mult(60);
|
|
6
|
+
static HOUR = this.MINUTE.mult(60);
|
|
7
|
+
static DAY = this.HOUR.mult(24);
|
|
8
|
+
static WEEK = this.DAY.mult(7);
|
|
9
|
+
static MONTH = this.DAY.mult(30);
|
|
10
|
+
constructor(micros) {
|
|
11
|
+
this.micros = micros;
|
|
12
|
+
}
|
|
13
|
+
isAfter(other) {
|
|
14
|
+
return this.micros > other.micros;
|
|
15
|
+
}
|
|
16
|
+
equals(other) {
|
|
17
|
+
return this.micros === other.micros;
|
|
18
|
+
}
|
|
19
|
+
isBefore(other) {
|
|
20
|
+
return this.micros < other.micros;
|
|
21
|
+
}
|
|
22
|
+
add(micros) {
|
|
23
|
+
const value = micros instanceof MicrosecondTimestamp ? micros.micros : micros;
|
|
24
|
+
return new MicrosecondTimestamp(this.micros + value);
|
|
25
|
+
}
|
|
26
|
+
sub(micros) {
|
|
27
|
+
const value = micros instanceof MicrosecondTimestamp ? micros.micros : micros;
|
|
28
|
+
return new MicrosecondTimestamp(this.micros - value);
|
|
29
|
+
}
|
|
30
|
+
mult(factor) {
|
|
31
|
+
return new MicrosecondTimestamp(this.micros * BigInt(factor));
|
|
32
|
+
}
|
|
33
|
+
static now() {
|
|
34
|
+
return new MicrosecondTimestamp(BigInt(Date.now()) * BigInt(1e3));
|
|
35
|
+
}
|
|
36
|
+
static fromNanoseconds(nanoseconds) {
|
|
37
|
+
return new MicrosecondTimestamp(nanoseconds / BigInt(1e3));
|
|
38
|
+
}
|
|
39
|
+
static fromMicroseconds(microseconds) {
|
|
40
|
+
return new MicrosecondTimestamp(microseconds);
|
|
41
|
+
}
|
|
42
|
+
static deserialize(serialized) {
|
|
43
|
+
if (serialized instanceof MicrosecondTimestamp) return serialized;
|
|
44
|
+
if (typeof serialized === "bigint") return new MicrosecondTimestamp(serialized);
|
|
45
|
+
if ("microseconds" in serialized && typeof serialized.microseconds === "bigint") return new MicrosecondTimestamp(serialized.microseconds);
|
|
46
|
+
return new MicrosecondTimestamp(BigInt(serialized.getTime()) * BigInt(1e3));
|
|
47
|
+
}
|
|
48
|
+
serialize() {
|
|
49
|
+
const date = new Date(Number(this.micros / BigInt(1e3)));
|
|
50
|
+
date.microseconds = this.micros;
|
|
51
|
+
return date;
|
|
52
|
+
}
|
|
53
|
+
static sort(left, right) {
|
|
54
|
+
if (left.isAfter(right)) return 1;
|
|
55
|
+
if (left.isBefore(right)) return -1;
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { MicrosecondTimestamp };
|
package/dist/choice.d.ts
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { AbstractConstructor,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} & {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { type AbstractConstructor, Empty, type Constructor } from "./_";
|
|
2
|
+
export type ChoiceMatcher<S extends string[]> = {
|
|
3
|
+
[key in S[number]]: () => any;
|
|
4
|
+
} | ({
|
|
5
|
+
_: () => any;
|
|
6
|
+
} & {
|
|
7
|
+
[key in S[number]]?: () => any;
|
|
8
|
+
});
|
|
9
|
+
export type ChoiceMatcherResult<M extends ChoiceMatcher<any>> = M[keyof M] extends () => infer R ? R : never;
|
|
10
|
+
export declare const Choice: <const S extends string[], B extends AbstractConstructor<{}> = typeof Empty>(config: S, base?: B) => IChoice<S, B>;
|
|
11
|
+
export type IChoice<S extends string[], B extends AbstractConstructor<{}> = typeof Empty> = Omit<B, ""> & {
|
|
12
|
+
$shape: "choice";
|
|
13
|
+
$of: S;
|
|
14
|
+
values: S;
|
|
15
|
+
deserialize<T extends Constructor>(this: T, value: S[number]): InstanceType<T>;
|
|
16
|
+
$deserialize<T>(this: T, value: S[number]): S[number];
|
|
17
|
+
$serialize<T>(this: T, value: S[number]): S[number];
|
|
18
|
+
$inline: S[number];
|
|
17
19
|
} & (abstract new (value: S[number]) => InstanceType<B> & {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}) & {
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
value: S[number];
|
|
21
|
+
is<TH, T extends S[number]>(this: TH, value: T): this is Omit<TH, "serialize" | "value"> & {
|
|
22
|
+
value: T;
|
|
23
|
+
serialize(): T;
|
|
24
|
+
};
|
|
25
|
+
match<M extends ChoiceMatcher<S>>(matcher: M): ChoiceMatcherResult<M>;
|
|
26
|
+
serialize(): S[number];
|
|
27
|
+
}) & {
|
|
28
|
+
[K in S[number]]: <T extends Constructor>(this: T) => InstanceType<T>;
|
|
29
|
+
};
|
|
28
30
|
//# sourceMappingURL=choice.d.ts.map
|
package/dist/choice.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice.d.ts","
|
|
1
|
+
{"version":3,"file":"choice.d.ts","sourceRoot":"","sources":["../src/choice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,EAAe,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAErF,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,IACxC;KACG,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG;CAC9B,GACD,CAAC;IACC,CAAC,EAAE,MAAM,GAAG,CAAC;CACd,GAAG;KACD,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG;CAC/B,CAAC,CAAC;AAEP,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,IAC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,IAAI,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG;QAC3C,KAAK,EAAE,CAAC,CAAC;QACT,SAAS,IAAI,CAAC,CAAC;KAChB,CAAC;IACF,KAAK,CAAC,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACtE,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC,GAAG;KACF,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC;CACtE,CAAC"}
|
package/dist/choice.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const require__ = require('./_.js');
|
|
2
2
|
|
|
3
3
|
//#region src/choice.ts
|
|
4
|
-
const Choice = (config, base = Empty) => {
|
|
4
|
+
const Choice = (config, base = require__.Empty) => {
|
|
5
5
|
class $Choice extends base {
|
|
6
6
|
static $shape = "choice";
|
|
7
7
|
static $of = config;
|
|
@@ -41,5 +41,4 @@ const Choice = (config, base = Empty) => {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
|
-
|
|
45
|
-
//# sourceMappingURL=choice.js.map
|
|
44
|
+
exports.Choice = Choice;
|
package/dist/choice.mjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Empty } from "./_.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/choice.ts
|
|
4
|
+
const Choice = (config, base = Empty) => {
|
|
5
|
+
class $Choice extends base {
|
|
6
|
+
static $shape = "choice";
|
|
7
|
+
static $of = config;
|
|
8
|
+
static values = config;
|
|
9
|
+
constructor(value) {
|
|
10
|
+
super();
|
|
11
|
+
this.value = value;
|
|
12
|
+
}
|
|
13
|
+
is(value) {
|
|
14
|
+
return this.value === value;
|
|
15
|
+
}
|
|
16
|
+
match(matcher) {
|
|
17
|
+
const handler = matcher[this.value];
|
|
18
|
+
if (handler) return handler();
|
|
19
|
+
return matcher._();
|
|
20
|
+
}
|
|
21
|
+
serialize() {
|
|
22
|
+
return this.value;
|
|
23
|
+
}
|
|
24
|
+
static deserialize(value) {
|
|
25
|
+
return new this(value);
|
|
26
|
+
}
|
|
27
|
+
static $deserialize(value) {
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
static $serialize(value) {
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
static $inline;
|
|
34
|
+
static {
|
|
35
|
+
for (const choice of config) this[choice] = function() {
|
|
36
|
+
return new this(choice);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return $Choice;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Choice };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choice.spec.d.ts","sourceRoot":"","sources":["../src/choice.spec.ts"],"names":[],"mappings":""}
|
package/dist/class.d.ts
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import { AbstractConstructor,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type ClassShorthand = Constructor<{
|
|
5
|
-
serialize(): any;
|
|
1
|
+
import { type AbstractConstructor, Empty, type Constructor, type Expand } from "./_";
|
|
2
|
+
export type ClassShorthand = Constructor<{
|
|
3
|
+
serialize(): any;
|
|
6
4
|
}> & {
|
|
7
|
-
|
|
5
|
+
deserialize(value: any): any;
|
|
8
6
|
};
|
|
9
|
-
declare const Class: <S extends Constructor<{
|
|
10
|
-
|
|
7
|
+
export declare const Class: <S extends Constructor<{
|
|
8
|
+
serialize(): any;
|
|
11
9
|
}> & {
|
|
12
|
-
|
|
10
|
+
deserialize(value: any): any;
|
|
13
11
|
}, B extends AbstractConstructor<any> = typeof Empty>(of: S, base?: typeof Empty) => IClass<S, B>;
|
|
14
|
-
type IClass<S extends ClassShorthand, B extends AbstractConstructor<any> = typeof Empty> = (abstract new (value: InstanceType<B>) => {
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export type IClass<S extends ClassShorthand, B extends AbstractConstructor<any> = typeof Empty> = (abstract new (value: InstanceType<B>) => {
|
|
13
|
+
value: InstanceType<B>;
|
|
14
|
+
serialize<T>(this: T): Expand<ReturnType<InstanceType<S>["serialize"]>>;
|
|
17
15
|
}) & {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
$shape: "class";
|
|
17
|
+
$of: S;
|
|
18
|
+
deserialize<T extends Constructor<any>>(this: T, value: Expand<Parameters<S["deserialize"]>[0]>): InstanceType<T>;
|
|
19
|
+
$deserialize(value: Parameters<S["deserialize"]>[0]): InstanceType<S>;
|
|
20
|
+
$serialize<T>(this: T, value: InstanceType<S>): ReturnType<InstanceType<S>["serialize"]>;
|
|
21
|
+
$inline: InstanceType<S>;
|
|
24
22
|
};
|
|
25
|
-
//#endregion
|
|
26
|
-
export { Class, ClassShorthand, IClass };
|
|
27
23
|
//# sourceMappingURL=class.d.ts.map
|
package/dist/class.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.d.ts","
|
|
1
|
+
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../src/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,KAAK,CAAC;AAErF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;IAAE,SAAS,IAAI,GAAG,CAAA;CAAE,CAAC,GAAG;IAC/D,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,KAAK,GAChB,CAAC,SAAS,WAAW,CAAC;IAAE,SAAS,IAAI,GAAG,CAAA;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
|
|
|
1
|
-
|
|
1
|
+
const require__ = require('./_.js');
|
|
2
2
|
|
|
3
3
|
//#region src/class.ts
|
|
4
|
-
const Class = (of, base = Empty) => {
|
|
4
|
+
const Class = (of, base = require__.Empty) => {
|
|
5
5
|
class $Class extends base {
|
|
6
6
|
static $shape = "class";
|
|
7
7
|
static $of = of;
|
|
@@ -27,5 +27,4 @@ const Class = (of, base = Empty) => {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=class.js.map
|
|
30
|
+
exports.Class = Class;
|
package/dist/class.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Empty } from "./_.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/class.ts
|
|
4
|
+
const Class = (of, base = Empty) => {
|
|
5
|
+
class $Class extends base {
|
|
6
|
+
static $shape = "class";
|
|
7
|
+
static $of = of;
|
|
8
|
+
constructor(value) {
|
|
9
|
+
super();
|
|
10
|
+
this.value = value;
|
|
11
|
+
}
|
|
12
|
+
static deserialize(value) {
|
|
13
|
+
return new this(of.deserialize(value));
|
|
14
|
+
}
|
|
15
|
+
serialize() {
|
|
16
|
+
return this.value.serialize();
|
|
17
|
+
}
|
|
18
|
+
static $deserialize(value) {
|
|
19
|
+
return of.deserialize(value);
|
|
20
|
+
}
|
|
21
|
+
static $serialize(value) {
|
|
22
|
+
return value.serialize();
|
|
23
|
+
}
|
|
24
|
+
static $inline;
|
|
25
|
+
}
|
|
26
|
+
return $Class;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Class };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class.spec.d.ts","sourceRoot":"","sources":["../src/class.spec.ts"],"names":[],"mappings":""}
|