adaptive-extender 0.9.7 → 0.9.8
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/CHANGELOG.md +1 -1
- package/dist/core/archivable.d.ts +19 -0
- package/dist/core/archivable.js +3 -0
- package/dist/core/archivable.js.map +1 -0
- package/dist/core/array.d.ts +0 -6
- package/dist/core/array.js +2 -7
- package/dist/core/array.js.map +1 -1
- package/dist/core/debug_types.d.ts +1 -0
- package/dist/core/debug_types.js +65 -0
- package/dist/core/debug_types.js.map +1 -0
- package/dist/core/index.d.ts +0 -2
- package/dist/core/index.js +0 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/repro_issue.d.ts +1 -0
- package/dist/core/repro_issue.js +55 -0
- package/dist/core/repro_issue.js.map +1 -0
- package/dist/node/environment.d.ts +0 -4
- package/dist/node/environment.js +0 -14
- package/dist/node/environment.js.map +1 -1
- package/package.json +1 -1
- package/dist/core/decorators.d.ts +0 -17
- package/dist/core/decorators.js +0 -174
- package/dist/core/decorators.js.map +0 -1
- package/dist/core/map.d.ts +0 -12
- package/dist/core/map.js +0 -9
- package/dist/core/map.js.map +0 -1
- package/dist/core/set.d.ts +0 -18
- package/dist/core/set.js +0 -19
- package/dist/core/set.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the interface for an archivable object's prototype.
|
|
3
|
+
* @template S The type of the notation returned by the export method.
|
|
4
|
+
*/
|
|
5
|
+
export interface ArchivablePrototype<S = any> {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new instance of the archivable object.
|
|
8
|
+
*/
|
|
9
|
+
new (...args: any): any;
|
|
10
|
+
/**
|
|
11
|
+
* Imports data from a source and returns a new instance.
|
|
12
|
+
* @throws {TypeError} If unable to import the source.
|
|
13
|
+
*/
|
|
14
|
+
import(source: any, name: string): InstanceType<this>;
|
|
15
|
+
/**
|
|
16
|
+
* Exports the state of an instance to a notation.
|
|
17
|
+
*/
|
|
18
|
+
export(source: InstanceType<this>): S;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archivable.js","sourceRoot":"","sources":["../../src/core/archivable.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC"}
|
package/dist/core/array.d.ts
CHANGED
|
@@ -53,11 +53,5 @@ declare global {
|
|
|
53
53
|
* @param $default The value used to fill when the array grows.
|
|
54
54
|
*/
|
|
55
55
|
resize(length: number, $default: T): T[];
|
|
56
|
-
/**
|
|
57
|
-
* Removes the first occurrence of the specified value from the array.
|
|
58
|
-
* @param value The value to remove.
|
|
59
|
-
* @returns `true` if the value was found and removed, otherwise `false`.
|
|
60
|
-
*/
|
|
61
|
-
remove(value: T): boolean;
|
|
62
56
|
}
|
|
63
57
|
}
|
package/dist/core/array.js
CHANGED
|
@@ -60,11 +60,6 @@ Array.prototype.resize = function (length, $default) {
|
|
|
60
60
|
this.length = length;
|
|
61
61
|
return this;
|
|
62
62
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (index < 0)
|
|
66
|
-
return false;
|
|
67
|
-
this.splice(index, 1);
|
|
68
|
-
return true;
|
|
69
|
-
};
|
|
63
|
+
//#endregion
|
|
64
|
+
Array.from;
|
|
70
65
|
//# sourceMappingURL=array.js.map
|
package/dist/core/array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../src/core/array.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,aAAa,CAAC;AACrB,OAAO,EAAmB,MAAM,cAAc,CAAC;AAE/C,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../src/core/array.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,aAAa,CAAC;AACrB,OAAO,EAAmB,MAAM,cAAc,CAAC;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OAAO,MAAM,GAAG,IAAI,CAAC,MAAM;QAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AACF,YAAY;AAEZ,KAAK,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { Model, Field } from "./portable";
|
|
36
|
+
// Mock types
|
|
37
|
+
class MyModel extends Model {
|
|
38
|
+
}
|
|
39
|
+
let TestClass = (() => {
|
|
40
|
+
let _classSuper = Model;
|
|
41
|
+
let _prop_decorators;
|
|
42
|
+
let _prop_initializers = [];
|
|
43
|
+
let _prop_extraInitializers = [];
|
|
44
|
+
let _date_decorators;
|
|
45
|
+
let _date_initializers = [];
|
|
46
|
+
let _date_extraInitializers = [];
|
|
47
|
+
return class TestClass extends _classSuper {
|
|
48
|
+
static {
|
|
49
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
50
|
+
_prop_decorators = [Field(MyType)];
|
|
51
|
+
_date_decorators = [Field(Date)];
|
|
52
|
+
__esDecorate(null, null, _prop_decorators, { kind: "field", name: "prop", static: false, private: false, access: { has: obj => "prop" in obj, get: obj => obj.prop, set: (obj, value) => { obj.prop = value; } }, metadata: _metadata }, _prop_initializers, _prop_extraInitializers);
|
|
53
|
+
__esDecorate(null, null, _date_decorators, { kind: "field", name: "date", static: false, private: false, access: { has: obj => "date" in obj, get: obj => obj.date, set: (obj, value) => { obj.date = value; } }, metadata: _metadata }, _date_initializers, _date_extraInitializers);
|
|
54
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
55
|
+
}
|
|
56
|
+
// Check if compilation fails or inference is weird
|
|
57
|
+
prop = __runInitializers(this, _prop_initializers, void 0);
|
|
58
|
+
date = (__runInitializers(this, _prop_extraInitializers), __runInitializers(this, _date_initializers, void 0));
|
|
59
|
+
constructor() {
|
|
60
|
+
super(...arguments);
|
|
61
|
+
__runInitializers(this, _date_extraInitializers);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
})();
|
|
65
|
+
//# sourceMappingURL=debug_types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug_types.js","sourceRoot":"","sources":["../../src/core/debug_types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAA4B,MAAM,YAAY,CAAC;AAEpE,aAAa;AACb,MAAM,OAAQ,SAAQ,KAAK;CAAG;IAIxB,SAAS;sBAAS,KAAK;;;;;;;iBAAvB,SAAU,SAAQ,WAAK;;;gCAExB,KAAK,CAAC,MAAM,CAAC;gCAGb,KAAK,CAAC,IAAI,CAAC;YAFZ,8JAAA,IAAI,6BAAJ,IAAI,mFAAW;YAGf,8JAAA,IAAI,6BAAJ,IAAI,mFAAQ;;;QALZ,mDAAmD;QAEnD,IAAI,uDAAW;QAGf,IAAI,2GAAQ"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -6,8 +6,6 @@ export * from "./boolean.js";
|
|
|
6
6
|
export * from "./date.js";
|
|
7
7
|
export * from "./math.js";
|
|
8
8
|
export * from "./array.js";
|
|
9
|
-
export * from "./set.js";
|
|
10
|
-
export * from "./map.js";
|
|
11
9
|
export * from "./object.js";
|
|
12
10
|
export * from "./reflect.js";
|
|
13
11
|
export * from "./portable.js";
|
package/dist/core/index.js
CHANGED
|
@@ -7,8 +7,6 @@ export * from "./boolean.js";
|
|
|
7
7
|
export * from "./date.js";
|
|
8
8
|
export * from "./math.js";
|
|
9
9
|
export * from "./array.js";
|
|
10
|
-
export * from "./set.js";
|
|
11
|
-
export * from "./map.js";
|
|
12
10
|
export * from "./object.js";
|
|
13
11
|
export * from "./reflect.js";
|
|
14
12
|
export * from "./portable.js";
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { Model, Field } from "./portable";
|
|
36
|
+
let TestDate = (() => {
|
|
37
|
+
let _classSuper = Model;
|
|
38
|
+
let _dateField_decorators;
|
|
39
|
+
let _dateField_initializers = [];
|
|
40
|
+
let _dateField_extraInitializers = [];
|
|
41
|
+
return class TestDate extends _classSuper {
|
|
42
|
+
static {
|
|
43
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
44
|
+
_dateField_decorators = [Field(Date)];
|
|
45
|
+
__esDecorate(null, null, _dateField_decorators, { kind: "field", name: "dateField", static: false, private: false, access: { has: obj => "dateField" in obj, get: obj => obj.dateField, set: (obj, value) => { obj.dateField = value; } }, metadata: _metadata }, _dateField_initializers, _dateField_extraInitializers);
|
|
46
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
47
|
+
}
|
|
48
|
+
dateField = __runInitializers(this, _dateField_initializers, void 0);
|
|
49
|
+
constructor() {
|
|
50
|
+
super(...arguments);
|
|
51
|
+
__runInitializers(this, _dateField_extraInitializers);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
55
|
+
//# sourceMappingURL=repro_issue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repro_issue.js","sourceRoot":"","sources":["../../src/core/repro_issue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;IAEpC,QAAQ;sBAAS,KAAK;;;;iBAAtB,QAAS,SAAQ,WAAK;;;qCACvB,KAAK,CAAC,IAAI,CAAC;YACZ,6KAAA,SAAS,6BAAT,SAAS,6FAAQ;;;QAAjB,SAAS,4DAAQ"}
|
package/dist/node/environment.js
CHANGED
|
@@ -33,19 +33,5 @@ export class Environment {
|
|
|
33
33
|
return text;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Writes a value to the environment variables.
|
|
38
|
-
*/
|
|
39
|
-
writeValue(key, value) {
|
|
40
|
-
const { env } = process;
|
|
41
|
-
let text;
|
|
42
|
-
try {
|
|
43
|
-
text = (typeof value === "string") ? value : JSON.stringify(value);
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
text = String(value);
|
|
47
|
-
}
|
|
48
|
-
env[key] = text;
|
|
49
|
-
}
|
|
50
36
|
}
|
|
51
37
|
//# sourceMappingURL=environment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/node/environment.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AAEvB,qBAAqB;AACrB;;GAEG;AACH,MAAM,OAAO,WAAW;IACvB;;OAEG;IACH,MAAM,KAAK,GAAG;QACb,OAAO,IAAI,WAAW,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,GAAW;QACnB,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,GAAW;QACpB,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;QACxB,MAAM,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,iCAAiC,CAAC,CAAC;QAC7F,IAAI,CAAC;YACJ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACR,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/node/environment.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AAEvB,qBAAqB;AACrB;;GAEG;AACH,MAAM,OAAO,WAAW;IACvB;;OAEG;IACH,MAAM,KAAK,GAAG;QACb,OAAO,IAAI,WAAW,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,GAAW;QACnB,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,GAAW;QACpB,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;QACxB,MAAM,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,iCAAiC,CAAC,CAAC;QAC7F,IAAI,CAAC;YACJ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACR,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Constructor, type PortableConstructor } from "./portable.js";
|
|
2
|
-
export interface PortableField<T> extends Constructor {
|
|
3
|
-
import(source: unknown, name: string): T;
|
|
4
|
-
export(source: T): unknown;
|
|
5
|
-
}
|
|
6
|
-
export interface DeferredCallback<T> {
|
|
7
|
-
(): T;
|
|
8
|
-
}
|
|
9
|
-
export declare function Scheme<T>(type: PortableField<T>, name?: string): (target: void, context: ClassFieldDecoratorContext<PortableModel, unknown>) => void;
|
|
10
|
-
export declare function PolymorphicBase<T extends typeof PortableModel>(resolver: DeferredCallback<PortableConstructor[]>): (target: T, context: ClassDecoratorContext) => T;
|
|
11
|
-
export declare function ArrayOf<T>(type: PortableField<T>): PortableField<T[]>;
|
|
12
|
-
export declare function Nullable<T>(type: PortableField<T>): PortableField<T | null>;
|
|
13
|
-
export declare function Optional<T>(type: PortableField<T>): PortableField<T | undefined>;
|
|
14
|
-
export declare abstract class PortableModel {
|
|
15
|
-
static import<T extends typeof PortableModel>(this: T, source: unknown, name: string): InstanceType<T>;
|
|
16
|
-
static export<T extends typeof PortableModel>(this: T, source: InstanceType<T>): unknown;
|
|
17
|
-
}
|
package/dist/core/decorators.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import {} from "./portable.js";
|
|
3
|
-
//#region Field descriptor
|
|
4
|
-
class FieldDescriptor {
|
|
5
|
-
#key;
|
|
6
|
-
#association;
|
|
7
|
-
#type;
|
|
8
|
-
constructor(key, association, type) {
|
|
9
|
-
this.#key = key;
|
|
10
|
-
this.#association = association;
|
|
11
|
-
this.#type = type;
|
|
12
|
-
}
|
|
13
|
-
get key() {
|
|
14
|
-
return this.#key;
|
|
15
|
-
}
|
|
16
|
-
get association() {
|
|
17
|
-
return this.#association;
|
|
18
|
-
}
|
|
19
|
-
get type() {
|
|
20
|
-
return this.#type;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
class DeferredResolver {
|
|
24
|
-
#resolver;
|
|
25
|
-
constructor(resolver) {
|
|
26
|
-
this.#resolver = resolver;
|
|
27
|
-
}
|
|
28
|
-
get value() {
|
|
29
|
-
return this.#resolver.call(this);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region Portability metadata
|
|
34
|
-
class PortabilityMetadata {
|
|
35
|
-
static #registry = new Map();
|
|
36
|
-
#model;
|
|
37
|
-
#fields = [];
|
|
38
|
-
#callback = null;
|
|
39
|
-
constructor(model) {
|
|
40
|
-
this.#model = model;
|
|
41
|
-
}
|
|
42
|
-
static register(model) {
|
|
43
|
-
const registry = PortabilityMetadata.#registry;
|
|
44
|
-
if (registry.has(model.name))
|
|
45
|
-
return; /** @todo Throw error */
|
|
46
|
-
const metadata = new PortabilityMetadata(model);
|
|
47
|
-
registry.set(model.name, metadata);
|
|
48
|
-
}
|
|
49
|
-
static read(model) {
|
|
50
|
-
const registry = PortabilityMetadata.#registry;
|
|
51
|
-
const record = registry.get(model.name);
|
|
52
|
-
const metadata = ReferenceError.suppress(record, "asdasdadsa"); /** @todo Write error */
|
|
53
|
-
return metadata;
|
|
54
|
-
}
|
|
55
|
-
get model() {
|
|
56
|
-
return this.#model;
|
|
57
|
-
}
|
|
58
|
-
get fields() {
|
|
59
|
-
return this.#fields;
|
|
60
|
-
}
|
|
61
|
-
get callback() {
|
|
62
|
-
return this.#callback;
|
|
63
|
-
}
|
|
64
|
-
set callback(value) {
|
|
65
|
-
this.#callback = value;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
//#endregion
|
|
69
|
-
export function Scheme(type, name) {
|
|
70
|
-
return function (target, context) {
|
|
71
|
-
const key = context.name;
|
|
72
|
-
if (typeof key === "symbol")
|
|
73
|
-
throw new TypeError(""); /** @todo Write error */
|
|
74
|
-
const association = name ?? key;
|
|
75
|
-
context.addInitializer(function () {
|
|
76
|
-
const Type = constructor(this); /** @todo Fix constructor */
|
|
77
|
-
const { fields } = PortabilityMetadata.read(Type);
|
|
78
|
-
fields.push(new FieldDescriptor(key, association, type));
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
export function PolymorphicBase(resolver) {
|
|
83
|
-
return function (target) {
|
|
84
|
-
const metadata = PortabilityMetadata.read(target);
|
|
85
|
-
metadata.callback = resolver;
|
|
86
|
-
return target;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
export function ArrayOf(type) {
|
|
90
|
-
return class {
|
|
91
|
-
static import(source, name) {
|
|
92
|
-
return Array.import(source, name).map((item, index) => type.import(item, `${name}[${index}]`));
|
|
93
|
-
}
|
|
94
|
-
static export(source) {
|
|
95
|
-
return source.map(item => type.export(item));
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
export function Nullable(type) {
|
|
100
|
-
return class {
|
|
101
|
-
static import(source, name) {
|
|
102
|
-
return Reflect.mapNull(source, source => type.import(source, name));
|
|
103
|
-
}
|
|
104
|
-
static export(source) {
|
|
105
|
-
return Reflect.mapNull(source, source => type.export(source));
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
export function Optional(type) {
|
|
110
|
-
return class {
|
|
111
|
-
static import(source, name) {
|
|
112
|
-
return Reflect.mapUndefined(source, source => type.import(source, name));
|
|
113
|
-
}
|
|
114
|
-
static export(source) {
|
|
115
|
-
return Reflect.mapUndefined(source, source => type.export(source));
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
export class PortableModel {
|
|
120
|
-
static {
|
|
121
|
-
PortabilityMetadata.register(this);
|
|
122
|
-
}
|
|
123
|
-
static import(source, name) {
|
|
124
|
-
const { callback, fields } = PortabilityMetadata.read(this);
|
|
125
|
-
if (callback !== null) {
|
|
126
|
-
const descendants = callback();
|
|
127
|
-
if (descendants.length > 1) {
|
|
128
|
-
const object = Object.import(source, name);
|
|
129
|
-
const typename = String.import(Reflect.get(object, "$type"), `${name}.$type`);
|
|
130
|
-
const subtype = descendants.find(subtype => subtype.name === typename);
|
|
131
|
-
if (subtype === undefined)
|
|
132
|
-
throw new TypeError(`Unknown polymorphic type '${typename}' for '${this.name}'`);
|
|
133
|
-
return subtype.import(source, name);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
const object = Object.import(source, name);
|
|
137
|
-
const instance = Reflect.construct(this, []);
|
|
138
|
-
let current = this;
|
|
139
|
-
while (current && current !== PortableModel) {
|
|
140
|
-
for (const { key, association, type } of fields) {
|
|
141
|
-
const rawValue = Reflect.get(object, association);
|
|
142
|
-
const importedValue = type.import(rawValue, `${name}.${association}`);
|
|
143
|
-
Reflect.set(instance, key, importedValue);
|
|
144
|
-
}
|
|
145
|
-
current = Object.getPrototypeOf(current);
|
|
146
|
-
}
|
|
147
|
-
return instance;
|
|
148
|
-
}
|
|
149
|
-
static export(source) {
|
|
150
|
-
const { callback, fields } = PortabilityMetadata.read(this);
|
|
151
|
-
if (callback !== null) {
|
|
152
|
-
const descendants = callback();
|
|
153
|
-
if (descendants.length > 1) {
|
|
154
|
-
const subtype = descendants.find(subtype => source instanceof subtype);
|
|
155
|
-
if (subtype === undefined)
|
|
156
|
-
throw new TypeError(`Unknown polymorphic type '${typename}' for '${this.name}'`);
|
|
157
|
-
return subtype.export(source);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
const result = Object();
|
|
161
|
-
Reflect.set(result, "$type", this.name);
|
|
162
|
-
let current = this;
|
|
163
|
-
while (current && current !== PortableModel) {
|
|
164
|
-
for (const { key, association, type } of fields) {
|
|
165
|
-
const value = Reflect.get(source, key);
|
|
166
|
-
const exportedValue = type.export(value);
|
|
167
|
-
Reflect.set(result, association, exportedValue);
|
|
168
|
-
}
|
|
169
|
-
current = Object.getPrototypeOf(current);
|
|
170
|
-
}
|
|
171
|
-
return result;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
//# sourceMappingURL=decorators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/core/decorators.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAA8C,MAAM,eAAe,CAAC;AAO3E,0BAA0B;AAC1B,MAAM,eAAe;IACpB,IAAI,CAAS;IACb,YAAY,CAAS;IACrB,KAAK,CAAqB;IAE1B,YAAY,GAAW,EAAE,WAAmB,EAAE,IAAwB;QACrE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC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EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,OAAO,OAAO,IAAI,OAAO,KAAK,aAAa,EAAE,CAAC;YAC7C,KAAK,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,MAAM,EAAE,CAAC;gBACjD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBACvC,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACzC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;YACjD,CAAC;YACD,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;CACD"}
|
package/dist/core/map.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
export interface Map<K, V> {
|
|
3
|
-
/**
|
|
4
|
-
* Adds the key/value pair only if the key is not already present.
|
|
5
|
-
* @param key The key to add.
|
|
6
|
-
* @param value The value to associate with the key.
|
|
7
|
-
* @returns `true` if the entry was added, otherwise `false`.
|
|
8
|
-
*/
|
|
9
|
-
add(key: K, value: V): boolean;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export {};
|
package/dist/core/map.js
DELETED
package/dist/core/map.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../src/core/map.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAcb,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,UAAiC,GAAM,EAAE,KAAQ;IACpE,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAChC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACrB,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,OAAO,EAAG,CAAC"}
|
package/dist/core/set.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
export interface Set<T> {
|
|
3
|
-
/**
|
|
4
|
-
* Toggles presence of an element in the set.
|
|
5
|
-
* @param value The value to toggle.
|
|
6
|
-
* @returns `true` if the value is present after the operation, otherwise `false`.
|
|
7
|
-
*/
|
|
8
|
-
toggle(value: T): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Toggles presence of an element in the set.
|
|
11
|
-
* @param value The value to toggle.
|
|
12
|
-
* @param force If true, ensures the value is present; if false, ensures it is absent.
|
|
13
|
-
* @returns `true` if the value is present after the operation, otherwise `false`.
|
|
14
|
-
*/
|
|
15
|
-
toggle(value: T, force: boolean): boolean;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export {};
|
package/dist/core/set.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Set.prototype.toggle = function (value, force) {
|
|
3
|
-
if (force === undefined) {
|
|
4
|
-
if (this.has(value)) {
|
|
5
|
-
this.delete(value);
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
this.add(value);
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
if (force) {
|
|
12
|
-
this.add(value);
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
this.delete(value);
|
|
16
|
-
return false;
|
|
17
|
-
};
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=set.js.map
|
package/dist/core/set.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../src/core/set.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAoBb,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,UAA2B,KAAQ,EAAE,KAAe;IAC1E,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACX,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,OAAO,EAAE,CAAC"}
|