@dxos/codec-protobuf 2.33.5-dev.b7c9d504 → 2.33.5-dev.b9f5bea6
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/src/buffer-patch.d.ts +1 -1
- package/dist/src/buffer-patch.d.ts.map +1 -1
- package/dist/src/buffer-patch.js +4 -6
- package/dist/src/buffer-patch.js.map +1 -1
- package/dist/src/codec.d.ts +2 -0
- package/dist/src/codec.d.ts.map +1 -1
- package/dist/src/codec.js +5 -3
- package/dist/src/codec.js.map +1 -1
- package/dist/src/mapping.d.ts +1 -5
- package/dist/src/mapping.d.ts.map +1 -1
- package/dist/src/mapping.js +3 -52
- package/dist/src/mapping.js.map +1 -1
- package/dist/src/precompiled-mapping/codegen.d.ts +59 -0
- package/dist/src/precompiled-mapping/codegen.d.ts.map +1 -0
- package/dist/src/precompiled-mapping/codegen.js +86 -0
- package/dist/src/precompiled-mapping/codegen.js.map +1 -0
- package/dist/src/precompiled-mapping/create-message-mapper.d.ts +5 -0
- package/dist/src/precompiled-mapping/create-message-mapper.d.ts.map +1 -0
- package/dist/src/precompiled-mapping/create-message-mapper.js +87 -0
- package/dist/src/precompiled-mapping/create-message-mapper.js.map +1 -0
- package/dist/src/schema.d.ts +1 -0
- package/dist/src/schema.d.ts.map +1 -1
- package/dist/src/schema.js +9 -2
- package/dist/src/schema.js.map +1 -1
- package/dist/src/service.js +1 -3
- package/dist/src/service.js.map +1 -1
- package/dist/src/stream.js +2 -2
- package/dist/src/stream.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/buffer-patch.ts +4 -6
- package/src/codec.ts +11 -4
- package/src/mapping.ts +2 -46
- package/src/precompiled-mapping/codegen.ts +91 -0
- package/src/precompiled-mapping/create-message-mapper.ts +61 -0
- package/src/schema.ts +7 -2
- package/src/service.ts +1 -3
- package/src/stream.ts +2 -2
|
@@ -3,7 +3,7 @@ import type { Codec } from './interface';
|
|
|
3
3
|
/**
|
|
4
4
|
* Protobuf codec returns instances of Uint8Arrays, but some storages expect to receive Buffers. This function patches the encode method to convert result into a Buffer.
|
|
5
5
|
*/
|
|
6
|
-
export declare
|
|
6
|
+
export declare const patchBufferCodec: (codec: Codec<any>) => {
|
|
7
7
|
encode: (x: any) => Buffer;
|
|
8
8
|
decode: (data: Uint8Array) => any;
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-patch.d.ts","sourceRoot":"","sources":["../../src/buffer-patch.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"buffer-patch.d.ts","sourceRoot":"","sources":["../../src/buffer-patch.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,GAAG,CAAC;gBACpC,GAAG;;CAEf,CAAC"}
|
package/dist/src/buffer-patch.js
CHANGED
|
@@ -7,11 +7,9 @@ exports.patchBufferCodec = void 0;
|
|
|
7
7
|
/**
|
|
8
8
|
* Protobuf codec returns instances of Uint8Arrays, but some storages expect to receive Buffers. This function patches the encode method to convert result into a Buffer.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
}
|
|
10
|
+
const patchBufferCodec = (codec) => ({
|
|
11
|
+
encode: (x) => Buffer.from(codec.encode(x)),
|
|
12
|
+
decode: codec.decode.bind(codec)
|
|
13
|
+
});
|
|
16
14
|
exports.patchBufferCodec = patchBufferCodec;
|
|
17
15
|
//# sourceMappingURL=buffer-patch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-patch.js","sourceRoot":"","sources":["../../src/buffer-patch.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAIF;;GAEG;
|
|
1
|
+
{"version":3,"file":"buffer-patch.js","sourceRoot":"","sources":["../../src/buffer-patch.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAIF;;GAEG;AACI,MAAM,gBAAgB,GAAG,CAAC,KAAiB,EAAE,EAAE,CAAC,CAAC;IACtD,MAAM,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAChD,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;CACjC,CAAC,CAAC;AAHU,QAAA,gBAAgB,oBAG1B"}
|
package/dist/src/codec.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare class ProtoCodec<T = any> implements Codec<T> {
|
|
|
7
7
|
private readonly _type;
|
|
8
8
|
private readonly _mapping;
|
|
9
9
|
private readonly _schema;
|
|
10
|
+
private readonly _encodeMapper;
|
|
11
|
+
private readonly _decodeMapper;
|
|
10
12
|
constructor(_type: protobufjs.Type, _mapping: BidirectionalMapingDescriptors, _schema: Schema<any>);
|
|
11
13
|
/**
|
|
12
14
|
* Underlying protobuf.js type descriptor.
|
package/dist/src/codec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/codec.ts"],"names":[],"mappings":"AAIA,OAAO,UAAU,EAAE,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,8BAA8B,
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/codec.ts"],"names":[],"mappings":"AAIA,OAAO,UAAU,EAAE,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,yBAAyB,EAAE,kBAMvC,CAAC;AAEF,qBAAa,UAAU,CAAC,CAAC,GAAG,GAAG,CAAE,YAAW,KAAK,CAAC,CAAC,CAAC;IAKhD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAGpB,KAAK,EAAE,UAAU,CAAC,IAAI,EACtB,QAAQ,EAAE,8BAA8B,EACxC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC;IAMvC;;OAEG;IACH,IAAI,SAAS,IAAK,UAAU,CAAC,IAAI,CAEhC;IAED,IAAI,oBAAoB,IAAK,8BAA8B,CAE1D;IAED;;OAEG;IACH,IAAI,MAAM,IAAK,MAAM,CAAC,GAAG,CAAC,CAEzB;IAED,MAAM,CAAE,KAAK,EAAE,CAAC,GAAG,UAAU;IAK7B,MAAM,CAAE,IAAI,EAAE,UAAU,GAAG,CAAC;IAK5B;;OAEG;IACH,OAAO,CAAE,MAAM,EAAE,GAAG;CAGrB"}
|
package/dist/src/codec.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
//
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ProtoCodec = exports.OBJECT_CONVERSION_OPTIONS = void 0;
|
|
7
|
-
const
|
|
7
|
+
const create_message_mapper_1 = require("./precompiled-mapping/create-message-mapper");
|
|
8
8
|
exports.OBJECT_CONVERSION_OPTIONS = {
|
|
9
9
|
// Represent long integers as strings.
|
|
10
10
|
longs: String,
|
|
@@ -16,6 +16,8 @@ class ProtoCodec {
|
|
|
16
16
|
this._type = _type;
|
|
17
17
|
this._mapping = _mapping;
|
|
18
18
|
this._schema = _schema;
|
|
19
|
+
this._encodeMapper = (0, create_message_mapper_1.createMessageMapper)(this._type, this._mapping.encode);
|
|
20
|
+
this._decodeMapper = (0, create_message_mapper_1.createMessageMapper)(this._type, this._mapping.decode);
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* Underlying protobuf.js type descriptor.
|
|
@@ -33,12 +35,12 @@ class ProtoCodec {
|
|
|
33
35
|
return this._schema;
|
|
34
36
|
}
|
|
35
37
|
encode(value) {
|
|
36
|
-
const sub =
|
|
38
|
+
const sub = this._encodeMapper(value, [this._schema]);
|
|
37
39
|
return this._type.encode(sub).finish();
|
|
38
40
|
}
|
|
39
41
|
decode(data) {
|
|
40
42
|
const obj = this._type.toObject(this._type.decode(data), exports.OBJECT_CONVERSION_OPTIONS);
|
|
41
|
-
return
|
|
43
|
+
return this._decodeMapper(obj, [this._schema]);
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
46
|
* Dynamically add new definitions to this codec. Mutates the underlying schema.
|
package/dist/src/codec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../src/codec.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../src/codec.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAMF,uFAA0F;AAG7E,QAAA,yBAAyB,GAAuB;IAC3D,sCAAsC;IACtC,KAAK,EAAE,MAAM;IAEb,6DAA6D;IAC7D,MAAM,EAAE,IAAI;CACb,CAAC;AAEF,MAAa,UAAU;IAIrB,YACmB,KAAsB,EACtB,QAAwC,EACxC,OAAoB;QAFpB,UAAK,GAAL,KAAK,CAAiB;QACtB,aAAQ,GAAR,QAAQ,CAAgC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
3
2
|
export declare type MapingDescriptors = Partial<Record<string, (value: any, ...extraArgs: any) => any>>;
|
|
4
3
|
export interface BidirectionalMapingDescriptors {
|
|
5
4
|
encode: MapingDescriptors;
|
|
6
5
|
decode: MapingDescriptors;
|
|
7
6
|
}
|
|
8
|
-
export declare
|
|
9
|
-
export declare function mapMessage(type: protobufjs.Type, substitutions: MapingDescriptors, obj: any, extraArgs: any[]): any;
|
|
10
|
-
export declare function mapField(field: protobufjs.Field, substitutions: MapingDescriptors, value: any, extraArgs: any[]): any;
|
|
11
|
-
export declare function mapScalarField(field: protobufjs.Field, substitutions: MapingDescriptors, value: any, extraArgs: any[]): any;
|
|
7
|
+
export declare const createMappingDescriptors: (substitutions: Substitutions) => BidirectionalMapingDescriptors;
|
|
12
8
|
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../src/mapping.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../src/mapping.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,oBAAY,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC,CAAA;AAE/F,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,eAAO,MAAM,wBAAwB,kBAAmB,aAAa,KAAG,8BAWvE,CAAC"}
|
package/dist/src/mapping.js
CHANGED
|
@@ -2,14 +2,9 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Copyright 2020 DXOS.org
|
|
4
4
|
//
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
const
|
|
11
|
-
const protobufjs_1 = __importDefault(require("protobufjs"));
|
|
12
|
-
function createMappingDescriptors(substitutions) {
|
|
6
|
+
exports.createMappingDescriptors = void 0;
|
|
7
|
+
const createMappingDescriptors = (substitutions) => {
|
|
13
8
|
const encode = {};
|
|
14
9
|
const decode = {};
|
|
15
10
|
for (const type of Object.keys(substitutions)) {
|
|
@@ -20,50 +15,6 @@ function createMappingDescriptors(substitutions) {
|
|
|
20
15
|
encode,
|
|
21
16
|
decode
|
|
22
17
|
};
|
|
23
|
-
}
|
|
18
|
+
};
|
|
24
19
|
exports.createMappingDescriptors = createMappingDescriptors;
|
|
25
|
-
function mapMessage(type, substitutions, obj, extraArgs) {
|
|
26
|
-
const res = {};
|
|
27
|
-
for (const field of type.fieldsArray) {
|
|
28
|
-
if (!(field.name in obj)) {
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
res[field.name] = mapField(field, substitutions, obj[field.name], extraArgs);
|
|
32
|
-
}
|
|
33
|
-
return res;
|
|
34
|
-
}
|
|
35
|
-
exports.mapMessage = mapMessage;
|
|
36
|
-
function mapField(field, substitutions, value, extraArgs) {
|
|
37
|
-
if (!field.required && (value === null || value === undefined)) {
|
|
38
|
-
return value;
|
|
39
|
-
}
|
|
40
|
-
else if (field.repeated) {
|
|
41
|
-
return value.map((value) => mapScalarField(field, substitutions, value, extraArgs));
|
|
42
|
-
}
|
|
43
|
-
else if (field.map) {
|
|
44
|
-
(0, assert_1.default)(field instanceof protobufjs_1.default.MapField);
|
|
45
|
-
return Object.fromEntries(Object.entries(value)
|
|
46
|
-
.map(([key, value]) => [key, mapScalarField(field, substitutions, value, extraArgs)]));
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
return mapScalarField(field, substitutions, value, extraArgs);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.mapField = mapField;
|
|
53
|
-
function mapScalarField(field, substitutions, value, extraArgs) {
|
|
54
|
-
if (!field.resolved) {
|
|
55
|
-
field.resolve();
|
|
56
|
-
}
|
|
57
|
-
const substitution = field.resolvedType && substitutions[field.resolvedType.fullName.slice(1)];
|
|
58
|
-
if (substitution) {
|
|
59
|
-
return substitution(value, ...extraArgs); // TODO(unknown): Handle recursive substitutions.
|
|
60
|
-
}
|
|
61
|
-
else if (field.resolvedType && field.resolvedType instanceof protobufjs_1.default.Type) {
|
|
62
|
-
return mapMessage(field.resolvedType, substitutions, value, extraArgs);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return value;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.mapScalarField = mapScalarField;
|
|
69
20
|
//# sourceMappingURL=mapping.js.map
|
package/dist/src/mapping.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../../src/mapping.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE
|
|
1
|
+
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../../src/mapping.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAWK,MAAM,wBAAwB,GAAG,CAAC,aAA4B,EAAkC,EAAE;IACvG,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;QAC7C,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;KAC3C;IACD,OAAO;QACL,MAAM;QACN,MAAM;KACP,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,wBAAwB,4BAWnC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
declare const Ref: unique symbol;
|
|
2
|
+
interface Ref {
|
|
3
|
+
[Ref]: true;
|
|
4
|
+
value: any;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Pass a JS value by reference rather then parsing it as code.
|
|
8
|
+
*
|
|
9
|
+
* Usage example:
|
|
10
|
+
*
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const double = x => x * 2;;
|
|
13
|
+
* codegen('add', ['a', 'b'], c => {
|
|
14
|
+
* c`const c = a + b;`;
|
|
15
|
+
* c`return ${ref(double)}(c)`;
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* would generate a function:
|
|
20
|
+
*
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const double = x => x * 2;;
|
|
23
|
+
* function add(a, b) {
|
|
24
|
+
* const c = a + b;
|
|
25
|
+
* return double(c);
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const ref: (value: any) => Ref;
|
|
30
|
+
/**
|
|
31
|
+
* DSL for runtime code generation.
|
|
32
|
+
*
|
|
33
|
+
* Example:
|
|
34
|
+
*
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const multiplier = 5;
|
|
37
|
+
* codegen('add', ['a', 'b'], c => {
|
|
38
|
+
* c`const c = a + b;`;
|
|
39
|
+
* c`return c * ${multiplier};`;
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* would generate a function:
|
|
44
|
+
*
|
|
45
|
+
* ```typescript
|
|
46
|
+
* function add(a, b) {
|
|
47
|
+
* const c = a + b;
|
|
48
|
+
* return c * 5;
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @param name Function name. Will appear in stack traces.
|
|
53
|
+
* @param args Names of function arguments.
|
|
54
|
+
* @param gen Closure that builds the function source.
|
|
55
|
+
* @param ctx Optional record with context variables that will appear in function's scope.
|
|
56
|
+
*/
|
|
57
|
+
export declare const codegen: (name: string, args: string[], gen: (c: (parts: TemplateStringsArray, ...args: any[]) => void) => void, ctx?: Record<string, any>) => (...args: any[]) => any;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=codegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../../src/precompiled-mapping/codegen.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,GAAG,eAAgB,CAAC;AAE1B,UAAU,GAAG;IACX,CAAC,GAAG,CAAC,EAAE,IAAI,CAAA;IACX,KAAK,EAAE,GAAG,CAAA;CACX;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,GAAG,UAAW,GAAG,KAAG,GAG/B,CAAC;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,OAAO,SAAU,MAAM,QAAQ,MAAM,EAAE,mBAAmB,oBAAoB,WAAW,GAAG,EAAE,KAAK,IAAI,KAAK,IAAI,QAAO,OAAO,MAAM,EAAE,GAAG,CAAC,eAAkB,GAAG,EAAE,KAAK,GAsBlL,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.codegen = exports.ref = void 0;
|
|
7
|
+
const Ref = Symbol('Ref');
|
|
8
|
+
/**
|
|
9
|
+
* Pass a JS value by reference rather then parsing it as code.
|
|
10
|
+
*
|
|
11
|
+
* Usage example:
|
|
12
|
+
*
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const double = x => x * 2;;
|
|
15
|
+
* codegen('add', ['a', 'b'], c => {
|
|
16
|
+
* c`const c = a + b;`;
|
|
17
|
+
* c`return ${ref(double)}(c)`;
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* would generate a function:
|
|
22
|
+
*
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const double = x => x * 2;;
|
|
25
|
+
* function add(a, b) {
|
|
26
|
+
* const c = a + b;
|
|
27
|
+
* return double(c);
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
const ref = (value) => ({
|
|
32
|
+
[Ref]: true,
|
|
33
|
+
value
|
|
34
|
+
});
|
|
35
|
+
exports.ref = ref;
|
|
36
|
+
const isRef = (value) => value[Ref] === true;
|
|
37
|
+
/**
|
|
38
|
+
* DSL for runtime code generation.
|
|
39
|
+
*
|
|
40
|
+
* Example:
|
|
41
|
+
*
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const multiplier = 5;
|
|
44
|
+
* codegen('add', ['a', 'b'], c => {
|
|
45
|
+
* c`const c = a + b;`;
|
|
46
|
+
* c`return c * ${multiplier};`;
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* would generate a function:
|
|
51
|
+
*
|
|
52
|
+
* ```typescript
|
|
53
|
+
* function add(a, b) {
|
|
54
|
+
* const c = a + b;
|
|
55
|
+
* return c * 5;
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @param name Function name. Will appear in stack traces.
|
|
60
|
+
* @param args Names of function arguments.
|
|
61
|
+
* @param gen Closure that builds the function source.
|
|
62
|
+
* @param ctx Optional record with context variables that will appear in function's scope.
|
|
63
|
+
*/
|
|
64
|
+
const codegen = (name, args, gen, ctx = {}) => {
|
|
65
|
+
const newCtx = { ...ctx };
|
|
66
|
+
let nextAnnon = 1;
|
|
67
|
+
let buf = '';
|
|
68
|
+
gen((parts, ...args) => {
|
|
69
|
+
const preprocessArg = (arg) => {
|
|
70
|
+
if (isRef(arg)) {
|
|
71
|
+
const name = `anon${nextAnnon++}`;
|
|
72
|
+
newCtx[name] = arg.value;
|
|
73
|
+
return name;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return arg;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
buf += parts.map((s, i) => s + (i < args.length ? preprocessArg(args[i]) : '')).join('') + '\n';
|
|
80
|
+
});
|
|
81
|
+
const code = `return function ${name}(${args.join(', ')}) {\n${buf}\n}`;
|
|
82
|
+
// eslint-disable-next-line no-new-func
|
|
83
|
+
return Function(...Object.keys(newCtx), code)(...Object.values(newCtx));
|
|
84
|
+
};
|
|
85
|
+
exports.codegen = codegen;
|
|
86
|
+
//# sourceMappingURL=codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../../src/precompiled-mapping/codegen.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAO1B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACI,MAAM,GAAG,GAAG,CAAC,KAAU,EAAO,EAAE,CAAC,CAAC;IACvC,CAAC,GAAG,CAAC,EAAE,IAAI;IACX,KAAK;CACN,CAAC,CAAC;AAHU,QAAA,GAAG,OAGb;AAEH,MAAM,KAAK,GAAG,CAAC,KAAU,EAAgB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,IAAc,EAAE,GAAuE,EAAE,MAA2B,EAAE,EAA2B,EAAE;IACvL,MAAM,MAAM,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAC1B,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE;QACrB,MAAM,aAAa,GAAG,CAAC,GAAQ,EAAE,EAAE;YACjC,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE;gBACd,MAAM,IAAI,GAAG,OAAO,SAAS,EAAE,EAAE,CAAC;gBAClC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC;gBACzB,OAAO,IAAI,CAAC;aACb;iBAAM;gBACL,OAAO,GAAG,CAAC;aACZ;QACH,CAAC,CAAC;QACF,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAClG,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,mBAAmB,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IAExE,uCAAuC;IACvC,OAAO,QAAQ,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC;AAtBW,QAAA,OAAO,WAsBlB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as pb from 'protobufjs';
|
|
2
|
+
import { MapingDescriptors } from '../mapping';
|
|
3
|
+
export declare type Mapper = (obj: any, extraArgs: any[]) => any;
|
|
4
|
+
export declare const createMessageMapper: (type: pb.Type, substitutions: MapingDescriptors) => Mapper;
|
|
5
|
+
//# sourceMappingURL=create-message-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-message-mapper.d.ts","sourceRoot":"","sources":["../../../src/precompiled-mapping/create-message-mapper.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,oBAAY,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAEzD,eAAO,MAAM,mBAAmB,SAAU,GAAG,IAAI,iBAAiB,iBAAiB,KAAG,MAAgE,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
8
|
+
}) : (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
o[k2] = m[k];
|
|
11
|
+
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.createMessageMapper = void 0;
|
|
29
|
+
const assert_1 = __importDefault(require("assert"));
|
|
30
|
+
const pb = __importStar(require("protobufjs"));
|
|
31
|
+
const codegen_1 = require("./codegen");
|
|
32
|
+
const createMessageMapper = (type, substitutions) => createMessageMapperCached(type, substitutions, {}).map;
|
|
33
|
+
exports.createMessageMapper = createMessageMapper;
|
|
34
|
+
const createMessageMapperCached = (type, substitutions, cache) => {
|
|
35
|
+
if (!cache[type.fullName]) {
|
|
36
|
+
// Indirection to allow for recursive message types.
|
|
37
|
+
cache[type.fullName] = {};
|
|
38
|
+
cache[type.fullName].map = (0, codegen_1.codegen)(`${type.name}$map`, ['obj', 'extraArgs'], c => {
|
|
39
|
+
c `const res = {};`;
|
|
40
|
+
for (const field of type.fieldsArray) {
|
|
41
|
+
c `if(obj.${field.name} !== undefined && obj.${field.name} !== null) {`;
|
|
42
|
+
{
|
|
43
|
+
const genMapScalar = (value) => {
|
|
44
|
+
field.resolve();
|
|
45
|
+
const substitution = field.resolvedType && substitutions[field.resolvedType.fullName.slice(1)];
|
|
46
|
+
if (substitution) {
|
|
47
|
+
c `${(0, codegen_1.ref)(substitution)}(${value}, ...extraArgs)`;
|
|
48
|
+
}
|
|
49
|
+
else if (field.resolvedType && field.resolvedType instanceof pb.Type) {
|
|
50
|
+
const mapper = createMessageMapperCached(field.resolvedType, substitutions, cache);
|
|
51
|
+
c `${(0, codegen_1.ref)(mapper)}.map(${value}, extraArgs)`;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
c `${value}`;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
// TODO(dmaretskyi): Support maps.
|
|
58
|
+
if (field.repeated) {
|
|
59
|
+
c `res.${field.name} = obj.${field.name}.map(item => `;
|
|
60
|
+
genMapScalar('item');
|
|
61
|
+
c `);`;
|
|
62
|
+
}
|
|
63
|
+
else if (field.map) {
|
|
64
|
+
(0, assert_1.default)(field instanceof pb.MapField);
|
|
65
|
+
c `res.${field.name} = {};`;
|
|
66
|
+
c `for(const key of Object.keys(obj.${field.name})) {`;
|
|
67
|
+
{
|
|
68
|
+
c `res.${field.name}[key] = `;
|
|
69
|
+
genMapScalar(`obj.${field.name}[key]`);
|
|
70
|
+
c `;`;
|
|
71
|
+
}
|
|
72
|
+
c `}`;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
c `res.${field.name} = `;
|
|
76
|
+
genMapScalar(`obj.${field.name}`);
|
|
77
|
+
c `;`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
c `}`;
|
|
81
|
+
}
|
|
82
|
+
c `return res;`;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return cache[type.fullName];
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=create-message-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-message-mapper.js","sourceRoot":"","sources":["../../../src/precompiled-mapping/create-message-mapper.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,oDAA4B;AAC5B,+CAAiC;AAGjC,uCAAyC;AAIlC,MAAM,mBAAmB,GAAG,CAAC,IAAa,EAAE,aAAgC,EAAU,EAAE,CAAC,yBAAyB,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;AAA1I,QAAA,mBAAmB,uBAAuH;AAEvJ,MAAM,yBAAyB,GAAG,CAAC,IAAa,EAAE,aAAgC,EAAE,KAAsC,EAAE,EAAE;IAC5H,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;QACzB,oDAAoD;QACpD,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAS,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAA,iBAAO,EAAC,GAAG,IAAI,CAAC,IAAI,MAAM,EA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rC,CAAC,CAAA,OAAO,KAAK,CAAC,IAAI,QAAQ,CAAC;wBAC3B,CAAC,CAAA,oCAAoC,KAAK,CAAC,IAAI,MAAM,CAAC;wBAAC;4BACrD,CAAC,CAAA,OAAO,KAAK,CAAC,IAAI,UAAU,CAAC;4BAC7B,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC;4BACvC,CAAC,CAAA,GAAG,CAAC;yBACN;wBAAC,CAAC,CAAA,GAAG,CAAC;qBACR;yBAAM;wBACL,CAAC,CAAA,OAAO,KAAK,CAAC,IAAI,KAAK,CAAC;wBACxB,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;wBAClC,CAAC,CAAA,GAAG,CAAC;qBACN;iBACF;gBAAC,CAAC,CAAA,GAAG,CAAC;aACR;YACD,CAAC,CAAA,aAAa,CAAC;QACjB,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC,CAAC"}
|
package/dist/src/schema.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare class Schema<T, S = {}> {
|
|
|
6
6
|
private _typesRoot;
|
|
7
7
|
static fromJson<T extends Record<string, any>, S extends Record<string, any> = {}>(schema: any, substitutions?: Substitutions): Schema<T, S>;
|
|
8
8
|
private readonly _mapping;
|
|
9
|
+
private readonly _codecCache;
|
|
9
10
|
constructor(_typesRoot: protobufjs.Root, substitutions: Substitutions);
|
|
10
11
|
getCodecForType<K extends keyof T & string>(typeName: K): ProtoCodec<T[K]>;
|
|
11
12
|
tryGetCodecForType(typeName: string): ProtoCodec;
|
package/dist/src/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/schema.ts"],"names":[],"mappings":"AAKA,OAAO,UAAoB,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS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,OAAO,CAAE,MAAM,EAAE,GAAG;CAMrB"}
|
package/dist/src/schema.js
CHANGED
|
@@ -34,6 +34,7 @@ const service_1 = require("./service");
|
|
|
34
34
|
class Schema {
|
|
35
35
|
constructor(_typesRoot, substitutions) {
|
|
36
36
|
this._typesRoot = _typesRoot;
|
|
37
|
+
this._codecCache = {};
|
|
37
38
|
this._mapping = (0, mapping_1.createMappingDescriptors)(substitutions);
|
|
38
39
|
}
|
|
39
40
|
static fromJson(schema, substitutions = {}) {
|
|
@@ -41,18 +42,24 @@ class Schema {
|
|
|
41
42
|
return new Schema(root, substitutions);
|
|
42
43
|
}
|
|
43
44
|
getCodecForType(typeName) {
|
|
45
|
+
var _a;
|
|
46
|
+
var _b, _c;
|
|
44
47
|
if (typeof typeName !== 'string') {
|
|
45
48
|
throw new TypeError('Expected `typeName` argument to be a string');
|
|
46
49
|
}
|
|
47
50
|
const type = this._typesRoot.lookupType(typeName);
|
|
48
|
-
|
|
51
|
+
(_a = (_b = this._codecCache)[_c = type.fullName]) !== null && _a !== void 0 ? _a : (_b[_c] = new codec_1.ProtoCodec(type, this._mapping, this));
|
|
52
|
+
return this._codecCache[type.fullName];
|
|
49
53
|
}
|
|
50
54
|
tryGetCodecForType(typeName) {
|
|
55
|
+
var _a;
|
|
56
|
+
var _b, _c;
|
|
51
57
|
if (typeof typeName !== 'string') {
|
|
52
58
|
throw new TypeError('Expected `typeName` argument to be a string');
|
|
53
59
|
}
|
|
54
60
|
const type = this._typesRoot.lookupType(typeName);
|
|
55
|
-
|
|
61
|
+
(_a = (_b = this._codecCache)[_c = type.fullName]) !== null && _a !== void 0 ? _a : (_b[_c] = new codec_1.ProtoCodec(type, this._mapping, this));
|
|
62
|
+
return this._codecCache[type.fullName];
|
|
56
63
|
}
|
|
57
64
|
getService(name) {
|
|
58
65
|
if (typeof name !== 'string') {
|
package/dist/src/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","s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AEzC,CAAC;IAED,kBAAkB,CAAE,QAAgB;;;QAClC,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;YAChC,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAC;SACpE;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAClD,YAAA,IAAI,CAAC,WAAW,OAAC,IAAI,CAAC,QAAQ,8CAAM,IAAI,kBAAU,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAC;QAC9E,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,UAAU,CAA8B,IAAO;QAC7C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,MAAM,IAAI,SAAS,CAAC,yCAAyC,CAAC,CAAC;SAChE;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACpD,OAAO,IAAI,2BAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,OAAO,CAAE,MAAW;QAClB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YAClB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;SAC1D;QACD,IAAI,CAAC,UAAU,GAAG,iBAAI,CAAC,QAAQ,CAAC,IAAA,sBAAK,EAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3E,CAAC;CACF;AArDD,wBAqDC"}
|
package/dist/src/service.js
CHANGED
|
@@ -115,7 +115,5 @@ class ServiceHandler {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
exports.ServiceHandler = ServiceHandler;
|
|
118
|
-
|
|
119
|
-
return name[0].toLocaleLowerCase() + name.substring(1);
|
|
120
|
-
}
|
|
118
|
+
const mapRpcMethodName = (name) => name[0].toLocaleLowerCase() + name.substring(1);
|
|
121
119
|
//# sourceMappingURL=service.js.map
|
package/dist/src/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/service.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAI5B,qCAAkC;AAYlC,MAAa,iBAAiB;IAC5B,YACmB,QAAoB,EACpB,OAAoB;QADpB,aAAQ,GAAR,QAAQ,CAAY;QACpB,YAAO,GAAP,OAAO,CAAa;IACpC,CAAC;IAEJ,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,YAAY,CAAE,OAAuB;QACnC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAgB,CAAC;IAC1E,CAAC;IAED,YAAY,CAAE,QAAW;QACvB,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACnE,CAAC;CACF;AAjBD,8CAiBC;AAED,MAAa,OAAO;IAClB,YACE,OAAuB,EACvB,OAAmB,EACnB,MAAmB;QAEnB,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE;YACzC,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,IAAA,gBAAM,EAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;YACnC,IAAA,gBAAM,EAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;YACpC,IAAA,gBAAM,EAAC,CAAC,MAAM,CAAC,aAAa,EAAE,2CAA2C,CAAC,CAAC;YAE3E,6CAA6C;YAC7C,MAAM,YAAY,GAAG,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YACpF,MAAM,aAAa,G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M,CAAC,IAAI,CAAC;gBACjC,QAAQ,EAAE,MAAM,CAAC,oBAAqB,CAAC,QAAQ;aAChD,CAAC,EAAE,KAAK,CAAC,CAAC;YACX,OAAO,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,cAAc,CAAE,UAAkB;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACjD,IAAA,gBAAM,EAAC,CAAC,CAAC,MAAM,EAAE,qBAAqB,UAAU,EAAE,CAAC,CAAC;QAEpD,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,IAAA,gBAAM,EAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACnC,IAAA,gBAAM,EAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;QAEpC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC1F,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAE5F,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;IACjD,CAAC;CACF;AA7DD,wCA6DC;AAED,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/src/stream.js
CHANGED
|
@@ -133,9 +133,9 @@ exports.Stream = Stream;
|
|
|
133
133
|
*
|
|
134
134
|
* NOTE: Copied from @dxos/debug to avoid circular dependency.
|
|
135
135
|
*/
|
|
136
|
-
|
|
136
|
+
const throwUnhandledRejection = (error) => {
|
|
137
137
|
setTimeout(() => {
|
|
138
138
|
throw error;
|
|
139
139
|
});
|
|
140
|
-
}
|
|
140
|
+
};
|
|
141
141
|
//# sourceMappingURL=stream.js.map
|
package/dist/src/stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/stream.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAC5B,kDAA0B;AAE1B,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,4BAA4B,CAAC,CAAC;AAWhD;;;;;;GAMG;AACH,MAAa,MAAM;IAoCjB,YAAa,QAAqB;QAT1B,cAAS,GAAG,KAAK,CAAC;QAI1B;;WAEG;QACK,YAAO,GAAe,EAAE,CAAC;QAG/B,MAAM,SAAS,GAAG,QAAQ,CAAC;YACzB,IAAI,EAAE,GAAG,CAAC,EAAE;gBACV,IAAI,IAAI,CAAC,SAAS,EAAE;oBAClB,GAAG,CAAC,qCAAqC,CAAC,CAAC;oBAC3C,OAAO;iBACR;gBAED,IAAI,IAAI,CAAC,eAAe,EAAE;oBACxB,IAAI;wBACF,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;qBAC3B;oBAAC,OAAO,KAAU,EAAE;wBACnB,0BAA0B;wBAC1B,uBAAuB,CAAC,KAAK,CAAC,CAAC;qBAChC;iBACF;qBAAM;oBACL,IAAA,gBAAM,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iBACxB;YACH,CAAC;YACD,KAAK,EAAE,GAAG,CAAC,EAAE;;gBACX,IAAI,IAAI,CAAC,SAAS,EAAE;oBAClB,OAAO;iBACR;gBAED,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;gBACtB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;gBACvB,MAAA,IAAI,CAAC,QAAQ,+CAAb,IAAI,CAAa,CAAC;gBAClB,IAAI;oBAC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C,CAAC;QAEhC,2BAA2B;QAC3B,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC5B,CAAC;CACF;AAvHD,wBAuHC;AAED;;;;;;;;GAQG;AACH,MAAM,uBAAuB,GAAG,CAAC,KAAY,EAAE,EAAE;IAC/C,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es5.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.esnext.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../src/interface.ts","../src/buffer-patch.ts","../../../../common/temp/node_modules/.pnpm/protobufjs@6.11.2/node_modules/protobufjs/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+assert@1.5.6/node_modules/@types/assert/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/common.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/array.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/collection.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/date.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/function.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/lang.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/math.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/number.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/object.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/seq.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/string.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/util.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash.merge@4.6.6/node_modules/@types/lodash.merge/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+ms@0.7.31/node_modules/@types/ms/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+debug@4.1.7/node_modules/@types/debug/index.d.ts","../src/stream.ts","../src/service.ts","../src/schema.ts","../src/common.ts","../src/mapping.ts","../src/codec.ts","../src/substitutions/any.ts","../src/substitutions/timestamp.ts","../src/substitutions/index.ts","../src/index.ts","../src/stream.test.ts","../test/codec.test.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/cleanupSemantic.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/types.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/diffLines.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/printDiffs.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@26.6.2/node_modules/pretty-format/build/types.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@26.6.2/node_modules/pretty-format/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+jest@26.0.24/node_modules/@types/jest/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert/strict.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/async_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/buffer.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/child_process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/cluster.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/console.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/constants.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/crypto.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dgram.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/diagnostics_channel.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/domain.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http2.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/https.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/inspector.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/module.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/net.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/os.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/path.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/perf_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/punycode.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/querystring.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/readline.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/repl.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/consumers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/web.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/string_decoder.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tls.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/trace_events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tty.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/url.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/util.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/v8.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/vm.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/wasi.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/worker_threads.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/zlib.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.global.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"e8c9f4e445a489991ca1a4232667de3ac36b07ba75ea335971fbeacf2d26fe67","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"a7dc1e65746fd3c5a1a614c6d4885aa855c6695f5c479fb1337d822ff9126f30","390943640d3f96650780f09b94cf04f5190468636246fe87514464d833008b85","1558c642e03689d42843e7b047b9c20e77ee09ab388ff854484db5dcfbed11da","d6c62c91eebdb76cde2ad0dfa3cf90134aad879c463ad7d8642e326e0bb57968","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d70c026dd2eeaa974f430ea229230a1897fdb897dc74659deebe2afd4feeb08f","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","ca59fe42b81228a317812e95a2e72ccc8c7f1911b5f0c2a032adf41a0161ec5d","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"a25713e4a4769ba11d2a1bc317250334968b0a892d3342d285a0e238c537af09","6a9c5127096b35264eb7cd21b2417bfc1d42cceca9ba4ce2bb0c3410b7816042","78828b06c0d3b586954015e9ebde5480b009e166c71244763bda328ec0920f41","715700031df76af9346132031195d9f5cea0fe9f2df294803d412b14c0f3c18a","1c6a7ca884c5e76a5d505464c3a5a90c6fe9edf814d6d935c862e168a6f497bb","d47db7cb1e686be3f2250b3c8543f136d1c2050e23f38eec58b41ea36c6ed9b4","50a03e1dfd866e66df0f2df297980cbe01c0a1ab1e493f738239aa692c4e4281","3b08506cfebbf8f592e61fdeb340c49adb8f0ffe408eb1d4330274642b25e35c","248cba0df9c9eaca69affb8bd9677e6978133bb10319ccc3a10a101b8508db65","5e7ba893c0a6c95073f04a68277fa6bef10c55b627987c2c960cbd372c7de4d8","4fd918dcbecb5f01d79f627dd135b9bcea7bb38845b05f87b95217a653038e12","8358d99f5f3a081e35897572d87d36152d119008906363ed851512d4adb3450c","befa12d7d76804d20992f94304fa7bf9c5b1d52c1dc81cff32fc55fa5598f043","b22bd2b9883af60e2c18cc3220f3274b3037ac0b786cc74b746bca2bcee2747e","2b3a38aef0306688160014f1fc5e084bec92af2a78e1fb3792381d921362def0","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","561eca7a381b96d6ccac6e4061e6d2ae53f5bc44203f3fd9f5b26864c32ae6e9","62ea38627e3ebab429f7616812a9394d327c2bc271003dfba985de9b4137369f","b4439890c168d646357928431100daac5cbdee1d345a34e6bf6eca9f3abe22bc","5d72971a459517c44c1379dab9ed248e87a61ba0a1e0f25c9d67e1e640cd9a09","02d734976af36f4273d930bea88b3e62adf6b078cf120c1c63d49aa8d8427c5c",{"version":"516a426e3960379f310107635b8f3a7e8c307c6c665080b128039d9299ec4087","affectsGlobalScope":true},"0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"aeeee3998c5a730f8689f04038d41cf4245c9edbf6ef29a698e45b36e399b8ed","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","e3b886bacdd1fbf1f72e654596c80a55c7bc1d10bdf464aaf52f45ecd243862f","c665d5c50c2573aefd98f0ffb12c5583e333ed94294ce6f144a4163a8c84f09b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"8a215750db3e2073511e07c9e293c8c40d6109e5c7368845e060bcc12adbae6f","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","945a841f9a591197154c85386bc5a1467d42d325104bb36db51bc566bbb240be","10c39ce1df102994b47d4bc0c71aa9a6aea76f4651a5ec51914431f50bc883a1",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","3fa48484c65913004d5abb5c0f917b61ea4684f32d05bb28c1ecfa5f05a9ed12","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"33eee034727baf564056b4ea719075c23d3b4767d0b5f9c6933b81f3d77774d2","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4",{"version":"dd9ea469d1bfaf589c6a196275d35cb1aa14014707c2c46d920c7b921e8f5bca","affectsGlobalScope":true},"badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1503a452a67127e5c2da794d1c7c44344d5038373aae16c9b03ac964db159edd"],"options":{"composite":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":1,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":5},"fileIdsList":[[128],[63,128],[81,83,128],[61,128],[49,51,52,53,54,55,56,57,58,59,60,61,128],[49,50,52,53,54,55,56,57,58,59,60,61,128],[50,51,52,53,54,55,56,57,58,59,60,61,128],[49,50,51,53,54,55,56,57,58,59,60,61,128],[49,50,51,52,54,55,56,57,58,59,60,61,128],[49,50,51,52,53,55,56,57,58,59,60,61,128],[49,50,51,52,53,54,56,57,58,59,60,61,128],[49,50,51,52,53,54,55,57,58,59,60,61,128],[49,50,51,52,53,54,55,56,58,59,60,61,128],[49,50,51,52,53,54,55,56,57,59,60,61,128],[49,50,51,52,53,54,55,56,57,58,60,61,128],[49,50,51,52,53,54,55,56,57,58,59,61,128],[49,50,51,52,53,54,55,56,57,58,59,60,128],[85,128],[88,128],[89,94,128],[90,100,101,108,117,127,128],[90,91,100,108,128],[92,128],[93,94,101,109,128],[94,117,124,128],[95,97,100,108,128],[96,128],[97,98,128],[99,100,128],[100,128],[100,101,102,117,127,128],[100,101,102,117,128],[103,108,117,127,128],[100,101,103,104,108,117,124,127,128],[103,105,117,124,127,128],[85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134],[100,106,128],[107,127,128],[97,100,108,117,128],[109,128],[110,128],[88,111,128],[112,126,128,132],[113,128],[114,128],[100,115,128],[115,116,128,130],[100,117,118,119,128],[117,119,128],[117,118,128],[120,128],[121,128],[100,122,123,128],[122,123,128],[94,108,124,128],[125,128],[108,126,128],[89,103,114,127,128],[94,128],[117,128,129],[128,130],[128,131],[89,94,100,102,111,117,127,128,130,132],[117,128,133],[77,78,128],[77,78,79,80,128],[82,128],[45,128],[45,47,67,69,128],[67,128],[45,46,65,66,67,68,70,73,128],[47,68,85,128],[47,62,66,68,69,70,128],[47,65,67,85,128],[65,128],[64,85,128],[71,72,128],[47,67,74,110,128]],"referencedMap":[[48,1],[64,2],[84,3],[62,4],[50,5],[51,6],[49,7],[52,8],[53,9],[54,10],[55,11],[56,12],[57,13],[58,14],[59,15],[60,16],[61,17],[63,1],[85,18],[86,18],[88,19],[89,20],[90,21],[91,22],[92,23],[93,24],[94,25],[95,26],[96,27],[97,28],[98,28],[99,29],[100,30],[101,31],[102,32],[87,1],[134,1],[103,33],[104,34],[105,35],[135,36],[106,37],[107,38],[108,39],[109,40],[110,41],[111,42],[112,43],[113,44],[114,45],[115,46],[116,47],[117,48],[119,49],[118,50],[120,51],[121,52],[122,53],[123,54],[124,55],[125,56],[126,57],[127,58],[128,59],[129,60],[130,61],[131,62],[132,63],[133,64],[77,1],[79,65],[81,66],[80,65],[78,1],[83,67],[82,1],[47,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[31,1],[32,1],[33,1],[34,1],[7,1],[39,1],[35,1],[36,1],[37,1],[38,1],[8,1],[43,1],[40,1],[41,1],[42,1],[1,1],[9,1],[44,1],[46,68],[70,69],[68,70],[74,71],[45,1],[69,72],[67,73],[66,74],[75,75],[65,76],[71,70],[73,77],[72,1],[76,78]],"exportedModulesMap":[[48,1],[64,2],[84,3],[62,4],[50,5],[51,6],[49,7],[52,8],[53,9],[54,10],[55,11],[56,12],[57,13],[58,14],[59,15],[60,16],[61,17],[63,1],[85,18],[86,18],[88,19],[89,20],[90,21],[91,22],[92,23],[93,24],[94,25],[95,26],[96,27],[97,28],[98,28],[99,29],[100,30],[101,31],[102,32],[87,1],[134,1],[103,33],[104,34],[105,35],[135,36],[106,37],[107,38],[108,39],[109,40],[110,41],[111,42],[112,43],[113,44],[114,45],[115,46],[116,47],[117,48],[119,49],[118,50],[120,51],[121,52],[122,53],[123,54],[124,55],[125,56],[126,57],[127,58],[128,59],[129,60],[130,61],[131,62],[132,63],[133,64],[77,1],[79,65],[81,66],[80,65],[78,1],[83,67],[82,1],[47,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[31,1],[32,1],[33,1],[34,1],[7,1],[39,1],[35,1],[36,1],[37,1],[38,1],[8,1],[43,1],[40,1],[41,1],[42,1],[1,1],[9,1],[44,1],[46,68],[70,69],[68,70],[74,71],[45,1],[69,72],[67,73],[66,74],[75,75],[65,76],[71,70],[73,77],[72,1],[76,78]],"semanticDiagnosticsPerFile":[48,64,84,62,50,51,49,52,53,54,55,56,57,58,59,60,61,63,85,86,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,87,134,103,104,105,135,106,107,108,109,110,111,112,113,114,115,116,117,119,118,120,121,122,123,124,125,126,127,128,129,130,131,132,133,77,79,81,80,78,83,82,47,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,31,32,33,34,7,39,35,36,37,38,8,43,40,41,42,1,9,44,46,70,68,74,45,69,67,66,75,65,71,73,72,76]},"version":"4.5.3"}
|
|
1
|
+
{"program":{"fileNames":["../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es5.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.esnext.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.5.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../src/interface.ts","../src/buffer-patch.ts","../../../../common/temp/node_modules/.pnpm/protobufjs@6.11.2/node_modules/protobufjs/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/common.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/array.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/collection.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/date.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/function.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/lang.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/math.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/number.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/object.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/seq.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/string.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/common/util.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash@4.14.181/node_modules/@types/lodash/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+lodash.merge@4.6.6/node_modules/@types/lodash.merge/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+assert@1.5.6/node_modules/@types/assert/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+ms@0.7.31/node_modules/@types/ms/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+debug@4.1.7/node_modules/@types/debug/index.d.ts","../src/stream.ts","../src/service.ts","../src/schema.ts","../src/common.ts","../src/mapping.ts","../src/precompiled-mapping/codegen.ts","../src/precompiled-mapping/create-message-mapper.ts","../src/codec.ts","../src/substitutions/any.ts","../src/substitutions/timestamp.ts","../src/substitutions/index.ts","../src/index.ts","../src/stream.test.ts","../test/codec.test.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/cleanupSemantic.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/types.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/diffLines.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/printDiffs.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@26.6.2/node_modules/pretty-format/build/types.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@26.6.2/node_modules/pretty-format/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+jest@26.0.24/node_modules/@types/jest/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert/strict.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/async_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/buffer.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/child_process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/cluster.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/console.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/constants.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/crypto.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dgram.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/diagnostics_channel.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/domain.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http2.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/https.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/inspector.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/module.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/net.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/os.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/path.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/perf_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/punycode.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/querystring.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/readline.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/repl.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/consumers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/web.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/string_decoder.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tls.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/trace_events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tty.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/url.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/util.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/v8.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/vm.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/wasi.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/worker_threads.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/zlib.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.global.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"e8c9f4e445a489991ca1a4232667de3ac36b07ba75ea335971fbeacf2d26fe67","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"a7dc1e65746fd3c5a1a614c6d4885aa855c6695f5c479fb1337d822ff9126f30","3544c5849dddb53d57a286bfab55556747202f44a5ba9436240e9c9d91c047de","1558c642e03689d42843e7b047b9c20e77ee09ab388ff854484db5dcfbed11da","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d70c026dd2eeaa974f430ea229230a1897fdb897dc74659deebe2afd4feeb08f","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","ca59fe42b81228a317812e95a2e72ccc8c7f1911b5f0c2a032adf41a0161ec5d","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"a25713e4a4769ba11d2a1bc317250334968b0a892d3342d285a0e238c537af09","d6c62c91eebdb76cde2ad0dfa3cf90134aad879c463ad7d8642e326e0bb57968","6a9c5127096b35264eb7cd21b2417bfc1d42cceca9ba4ce2bb0c3410b7816042","78828b06c0d3b586954015e9ebde5480b009e166c71244763bda328ec0920f41","a9a55e85be968ca078f25d2ef8295f865badf81a2424498c28e09e1b13e21b14","c11f7196445696e4314a0ba09bba02c3a0196260247075f018300f002f09e32a","1ef17a24d34e36d9d74622157a916a74baf667c8fdeac3092803cf70aa291958","50a03e1dfd866e66df0f2df297980cbe01c0a1ab1e493f738239aa692c4e4281","be455aaca17c3320da84dc262be04cc8bc5d98c1371ca7cd32e33f6eeb1cb2cf","04cd6c9a08038a866c4a1e11079ec0da88a36895ca6d6e638744c223d9f7b1dc","24e0ae0a0f97feadea9301c5310eaa3c4011549ce268305a213d4273b8eaa2b5","cb2f258d54f387be2fa3b4bb71f53fc7c325ef94c204a6bc8763fbfa0150c86c","5e7ba893c0a6c95073f04a68277fa6bef10c55b627987c2c960cbd372c7de4d8","4fd918dcbecb5f01d79f627dd135b9bcea7bb38845b05f87b95217a653038e12","8358d99f5f3a081e35897572d87d36152d119008906363ed851512d4adb3450c","befa12d7d76804d20992f94304fa7bf9c5b1d52c1dc81cff32fc55fa5598f043","b22bd2b9883af60e2c18cc3220f3274b3037ac0b786cc74b746bca2bcee2747e","2b3a38aef0306688160014f1fc5e084bec92af2a78e1fb3792381d921362def0","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","561eca7a381b96d6ccac6e4061e6d2ae53f5bc44203f3fd9f5b26864c32ae6e9","62ea38627e3ebab429f7616812a9394d327c2bc271003dfba985de9b4137369f","b4439890c168d646357928431100daac5cbdee1d345a34e6bf6eca9f3abe22bc","5d72971a459517c44c1379dab9ed248e87a61ba0a1e0f25c9d67e1e640cd9a09","02d734976af36f4273d930bea88b3e62adf6b078cf120c1c63d49aa8d8427c5c",{"version":"516a426e3960379f310107635b8f3a7e8c307c6c665080b128039d9299ec4087","affectsGlobalScope":true},"0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"aeeee3998c5a730f8689f04038d41cf4245c9edbf6ef29a698e45b36e399b8ed","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","e3b886bacdd1fbf1f72e654596c80a55c7bc1d10bdf464aaf52f45ecd243862f","c665d5c50c2573aefd98f0ffb12c5583e333ed94294ce6f144a4163a8c84f09b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"8a215750db3e2073511e07c9e293c8c40d6109e5c7368845e060bcc12adbae6f","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","945a841f9a591197154c85386bc5a1467d42d325104bb36db51bc566bbb240be","10c39ce1df102994b47d4bc0c71aa9a6aea76f4651a5ec51914431f50bc883a1",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","3fa48484c65913004d5abb5c0f917b61ea4684f32d05bb28c1ecfa5f05a9ed12","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"33eee034727baf564056b4ea719075c23d3b4767d0b5f9c6933b81f3d77774d2","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4",{"version":"dd9ea469d1bfaf589c6a196275d35cb1aa14014707c2c46d920c7b921e8f5bca","affectsGlobalScope":true},"badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1503a452a67127e5c2da794d1c7c44344d5038373aae16c9b03ac964db159edd"],"options":{"composite":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":1,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":5},"fileIdsList":[[130],[63,130],[83,85,130],[60,130],[48,50,51,52,53,54,55,56,57,58,59,60,130],[48,49,51,52,53,54,55,56,57,58,59,60,130],[49,50,51,52,53,54,55,56,57,58,59,60,130],[48,49,50,52,53,54,55,56,57,58,59,60,130],[48,49,50,51,53,54,55,56,57,58,59,60,130],[48,49,50,51,52,54,55,56,57,58,59,60,130],[48,49,50,51,52,53,55,56,57,58,59,60,130],[48,49,50,51,52,53,54,56,57,58,59,60,130],[48,49,50,51,52,53,54,55,57,58,59,60,130],[48,49,50,51,52,53,54,55,56,58,59,60,130],[48,49,50,51,52,53,54,55,56,57,59,60,130],[48,49,50,51,52,53,54,55,56,57,58,60,130],[48,49,50,51,52,53,54,55,56,57,58,59,130],[87,130],[90,130],[91,96,130],[92,102,103,110,119,129,130],[92,93,102,110,130],[94,130],[95,96,103,111,130],[96,119,126,130],[97,99,102,110,130],[98,130],[99,100,130],[101,102,130],[102,130],[102,103,104,119,129,130],[102,103,104,119,130],[105,110,119,129,130],[102,103,105,106,110,119,126,129,130],[105,107,119,126,129,130],[87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136],[102,108,130],[109,129,130],[99,102,110,119,130],[111,130],[112,130],[90,113,130],[114,128,130,134],[115,130],[116,130],[102,117,130],[117,118,130,132],[102,119,120,121,130],[119,121,130],[119,120,130],[122,130],[123,130],[102,124,125,130],[124,125,130],[96,110,126,130],[127,130],[110,128,130],[91,105,116,129,130],[96,130],[119,130,131],[130,132],[130,133],[91,96,102,104,113,119,129,130,132,134],[119,130,135],[79,80,130],[79,80,81,82,130],[84,130],[45,130],[45,47,67,69,71,130],[67,130],[45,46,65,66,67,68,72,75,130],[68,130],[47,69,70,87,130],[47,61,66,68,69,72,130],[47,65,67,87,130],[65,130],[64,87,130],[73,74,130],[47,67,76,112,130]],"referencedMap":[[62,1],[64,2],[86,3],[61,4],[49,5],[50,6],[48,7],[51,8],[52,9],[53,10],[54,11],[55,12],[56,13],[57,14],[58,15],[59,16],[60,17],[63,1],[87,18],[88,18],[90,19],[91,20],[92,21],[93,22],[94,23],[95,24],[96,25],[97,26],[98,27],[99,28],[100,28],[101,29],[102,30],[103,31],[104,32],[89,1],[136,1],[105,33],[106,34],[107,35],[137,36],[108,37],[109,38],[110,39],[111,40],[112,41],[113,42],[114,43],[115,44],[116,45],[117,46],[118,47],[119,48],[121,49],[120,50],[122,51],[123,52],[124,53],[125,54],[126,55],[127,56],[128,57],[129,58],[130,59],[131,60],[132,61],[133,62],[134,63],[135,64],[79,1],[81,65],[83,66],[82,65],[80,1],[85,67],[84,1],[47,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[31,1],[32,1],[33,1],[34,1],[7,1],[39,1],[35,1],[36,1],[37,1],[38,1],[8,1],[43,1],[40,1],[41,1],[42,1],[1,1],[9,1],[44,1],[46,68],[72,69],[68,70],[76,71],[45,1],[69,72],[70,1],[71,73],[67,74],[66,75],[77,76],[65,77],[73,70],[75,78],[74,1],[78,79]],"exportedModulesMap":[[62,1],[64,2],[86,3],[61,4],[49,5],[50,6],[48,7],[51,8],[52,9],[53,10],[54,11],[55,12],[56,13],[57,14],[58,15],[59,16],[60,17],[63,1],[87,18],[88,18],[90,19],[91,20],[92,21],[93,22],[94,23],[95,24],[96,25],[97,26],[98,27],[99,28],[100,28],[101,29],[102,30],[103,31],[104,32],[89,1],[136,1],[105,33],[106,34],[107,35],[137,36],[108,37],[109,38],[110,39],[111,40],[112,41],[113,42],[114,43],[115,44],[116,45],[117,46],[118,47],[119,48],[121,49],[120,50],[122,51],[123,52],[124,53],[125,54],[126,55],[127,56],[128,57],[129,58],[130,59],[131,60],[132,61],[133,62],[134,63],[135,64],[79,1],[81,65],[83,66],[82,65],[80,1],[85,67],[84,1],[47,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[31,1],[32,1],[33,1],[34,1],[7,1],[39,1],[35,1],[36,1],[37,1],[38,1],[8,1],[43,1],[40,1],[41,1],[42,1],[1,1],[9,1],[44,1],[46,68],[72,69],[68,70],[76,71],[45,1],[69,72],[70,1],[71,73],[67,74],[66,75],[77,76],[65,77],[73,70],[75,78],[74,1],[78,79]],"semanticDiagnosticsPerFile":[62,64,86,61,49,50,48,51,52,53,54,55,56,57,58,59,60,63,87,88,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,89,136,105,106,107,137,108,109,110,111,112,113,114,115,116,117,118,119,121,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135,79,81,83,82,80,85,84,47,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,31,32,33,34,7,39,35,36,37,38,8,43,40,41,42,1,9,44,46,72,68,76,45,69,70,71,67,66,77,65,73,75,74,78]},"version":"4.5.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/codec-protobuf",
|
|
3
|
-
"version": "2.33.5-dev.
|
|
3
|
+
"version": "2.33.5-dev.b9f5bea6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "DXOS.org",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"protobufjs": "^6.9.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@dxos/eslint-plugin": "~1.0.
|
|
30
|
+
"@dxos/eslint-plugin": "~1.0.33",
|
|
31
31
|
"@types/assert": "^1.5.4",
|
|
32
32
|
"@types/debug": "^4.1.7",
|
|
33
33
|
"@types/jest": "^26.0.7",
|
package/src/buffer-patch.ts
CHANGED
|
@@ -7,9 +7,7 @@ import type { Codec } from './interface';
|
|
|
7
7
|
/**
|
|
8
8
|
* Protobuf codec returns instances of Uint8Arrays, but some storages expect to receive Buffers. This function patches the encode method to convert result into a Buffer.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
}
|
|
10
|
+
export const patchBufferCodec = (codec: Codec<any>) => ({
|
|
11
|
+
encode: (x: any) => Buffer.from(codec.encode(x)),
|
|
12
|
+
decode: codec.decode.bind(codec)
|
|
13
|
+
});
|
package/src/codec.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import protobufjs, { IConversionOptions } from 'protobufjs';
|
|
6
6
|
|
|
7
7
|
import { Codec } from './interface';
|
|
8
|
-
import { BidirectionalMapingDescriptors
|
|
8
|
+
import { BidirectionalMapingDescriptors } from './mapping';
|
|
9
|
+
import { createMessageMapper, Mapper } from './precompiled-mapping/create-message-mapper';
|
|
9
10
|
import type { Schema } from './schema';
|
|
10
11
|
|
|
11
12
|
export const OBJECT_CONVERSION_OPTIONS: IConversionOptions = {
|
|
@@ -17,11 +18,17 @@ export const OBJECT_CONVERSION_OPTIONS: IConversionOptions = {
|
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export class ProtoCodec<T = any> implements Codec<T> {
|
|
21
|
+
private readonly _encodeMapper: Mapper;
|
|
22
|
+
private readonly _decodeMapper: Mapper;
|
|
23
|
+
|
|
20
24
|
constructor (
|
|
21
25
|
private readonly _type: protobufjs.Type,
|
|
22
26
|
private readonly _mapping: BidirectionalMapingDescriptors,
|
|
23
27
|
private readonly _schema: Schema<any>
|
|
24
|
-
) {
|
|
28
|
+
) {
|
|
29
|
+
this._encodeMapper = createMessageMapper(this._type, this._mapping.encode);
|
|
30
|
+
this._decodeMapper = createMessageMapper(this._type, this._mapping.decode);
|
|
31
|
+
}
|
|
25
32
|
|
|
26
33
|
/**
|
|
27
34
|
* Underlying protobuf.js type descriptor.
|
|
@@ -42,13 +49,13 @@ export class ProtoCodec<T = any> implements Codec<T> {
|
|
|
42
49
|
}
|
|
43
50
|
|
|
44
51
|
encode (value: T): Uint8Array {
|
|
45
|
-
const sub =
|
|
52
|
+
const sub = this._encodeMapper(value, [this._schema]);
|
|
46
53
|
return this._type.encode(sub).finish();
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
decode (data: Uint8Array): T {
|
|
50
57
|
const obj = this._type.toObject(this._type.decode(data), OBJECT_CONVERSION_OPTIONS);
|
|
51
|
-
return
|
|
58
|
+
return this._decodeMapper(obj, [this._schema]);
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
/**
|
package/src/mapping.ts
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
// Copyright 2020 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import assert from 'assert';
|
|
6
|
-
import protobufjs from 'protobufjs';
|
|
7
|
-
|
|
8
5
|
import { Substitutions } from './common';
|
|
9
6
|
|
|
10
7
|
export type MapingDescriptors = Partial<Record<string, (value: any, ...extraArgs: any) => any>>
|
|
@@ -14,7 +11,7 @@ export interface BidirectionalMapingDescriptors {
|
|
|
14
11
|
decode: MapingDescriptors,
|
|
15
12
|
}
|
|
16
13
|
|
|
17
|
-
export
|
|
14
|
+
export const createMappingDescriptors = (substitutions: Substitutions): BidirectionalMapingDescriptors => {
|
|
18
15
|
const encode: MapingDescriptors = {};
|
|
19
16
|
const decode: MapingDescriptors = {};
|
|
20
17
|
for (const type of Object.keys(substitutions)) {
|
|
@@ -25,45 +22,4 @@ export function createMappingDescriptors (substitutions: Substitutions): Bidirec
|
|
|
25
22
|
encode,
|
|
26
23
|
decode
|
|
27
24
|
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function mapMessage (type: protobufjs.Type, substitutions: MapingDescriptors, obj: any, extraArgs: any[]) {
|
|
31
|
-
const res: any = {};
|
|
32
|
-
for (const field of type.fieldsArray) {
|
|
33
|
-
if (!(field.name in obj)) {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
res[field.name] = mapField(field, substitutions, obj[field.name], extraArgs);
|
|
37
|
-
}
|
|
38
|
-
return res;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function mapField (field: protobufjs.Field, substitutions: MapingDescriptors, value: any, extraArgs: any[]) {
|
|
42
|
-
if (!field.required && (value === null || value === undefined)) {
|
|
43
|
-
return value;
|
|
44
|
-
} else if (field.repeated) {
|
|
45
|
-
return value.map((value: any) => mapScalarField(field, substitutions, value, extraArgs));
|
|
46
|
-
} else if (field.map) {
|
|
47
|
-
assert(field instanceof protobufjs.MapField);
|
|
48
|
-
return Object.fromEntries(
|
|
49
|
-
Object.entries(value)
|
|
50
|
-
.map(([key, value]) => [key, mapScalarField(field, substitutions, value, extraArgs)])
|
|
51
|
-
);
|
|
52
|
-
} else {
|
|
53
|
-
return mapScalarField(field, substitutions, value, extraArgs);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function mapScalarField (field: protobufjs.Field, substitutions: MapingDescriptors, value: any, extraArgs: any[]) {
|
|
58
|
-
if (!field.resolved) {
|
|
59
|
-
field.resolve();
|
|
60
|
-
}
|
|
61
|
-
const substitution = field.resolvedType && substitutions[field.resolvedType.fullName.slice(1)];
|
|
62
|
-
if (substitution) {
|
|
63
|
-
return substitution(value, ...extraArgs); // TODO(unknown): Handle recursive substitutions.
|
|
64
|
-
} else if (field.resolvedType && field.resolvedType instanceof protobufjs.Type) {
|
|
65
|
-
return mapMessage(field.resolvedType, substitutions, value, extraArgs);
|
|
66
|
-
} else {
|
|
67
|
-
return value;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
const Ref = Symbol('Ref');
|
|
6
|
+
|
|
7
|
+
interface Ref {
|
|
8
|
+
[Ref]: true
|
|
9
|
+
value: any
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Pass a JS value by reference rather then parsing it as code.
|
|
14
|
+
*
|
|
15
|
+
* Usage example:
|
|
16
|
+
*
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const double = x => x * 2;;
|
|
19
|
+
* codegen('add', ['a', 'b'], c => {
|
|
20
|
+
* c`const c = a + b;`;
|
|
21
|
+
* c`return ${ref(double)}(c)`;
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* would generate a function:
|
|
26
|
+
*
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const double = x => x * 2;;
|
|
29
|
+
* function add(a, b) {
|
|
30
|
+
* const c = a + b;
|
|
31
|
+
* return double(c);
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export const ref = (value: any): Ref => ({
|
|
36
|
+
[Ref]: true,
|
|
37
|
+
value
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const isRef = (value: any): value is Ref => value[Ref] === true;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* DSL for runtime code generation.
|
|
44
|
+
*
|
|
45
|
+
* Example:
|
|
46
|
+
*
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const multiplier = 5;
|
|
49
|
+
* codegen('add', ['a', 'b'], c => {
|
|
50
|
+
* c`const c = a + b;`;
|
|
51
|
+
* c`return c * ${multiplier};`;
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* would generate a function:
|
|
56
|
+
*
|
|
57
|
+
* ```typescript
|
|
58
|
+
* function add(a, b) {
|
|
59
|
+
* const c = a + b;
|
|
60
|
+
* return c * 5;
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @param name Function name. Will appear in stack traces.
|
|
65
|
+
* @param args Names of function arguments.
|
|
66
|
+
* @param gen Closure that builds the function source.
|
|
67
|
+
* @param ctx Optional record with context variables that will appear in function's scope.
|
|
68
|
+
*/
|
|
69
|
+
export const codegen = (name: string, args: string[], gen: (c: (parts: TemplateStringsArray, ...args: any[]) => void) => void, ctx: Record<string, any> = {}): (...args: any[]) => any => {
|
|
70
|
+
const newCtx = { ...ctx };
|
|
71
|
+
let nextAnnon = 1;
|
|
72
|
+
|
|
73
|
+
let buf = '';
|
|
74
|
+
gen((parts, ...args) => {
|
|
75
|
+
const preprocessArg = (arg: any) => {
|
|
76
|
+
if (isRef(arg)) {
|
|
77
|
+
const name = `anon${nextAnnon++}`;
|
|
78
|
+
newCtx[name] = arg.value;
|
|
79
|
+
return name;
|
|
80
|
+
} else {
|
|
81
|
+
return arg;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
buf += parts.map((s, i) => s + (i < args.length ? preprocessArg(args[i]) : '')).join('') + '\n';
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const code = `return function ${name}(${args.join(', ')}) {\n${buf}\n}`;
|
|
88
|
+
|
|
89
|
+
// eslint-disable-next-line no-new-func
|
|
90
|
+
return Function(...Object.keys(newCtx), code)(...Object.values(newCtx));
|
|
91
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import assert from 'assert';
|
|
6
|
+
import * as pb from 'protobufjs';
|
|
7
|
+
|
|
8
|
+
import { MapingDescriptors } from '../mapping';
|
|
9
|
+
import { codegen, ref } from './codegen';
|
|
10
|
+
|
|
11
|
+
export type Mapper = (obj: any, extraArgs: any[]) => any;
|
|
12
|
+
|
|
13
|
+
export const createMessageMapper = (type: pb.Type, substitutions: MapingDescriptors): Mapper => createMessageMapperCached(type, substitutions, {}).map;
|
|
14
|
+
|
|
15
|
+
const createMessageMapperCached = (type: pb.Type, substitutions: MapingDescriptors, cache: Record<string, { map: Mapper }>) => {
|
|
16
|
+
if (!cache[type.fullName]) {
|
|
17
|
+
// Indirection to allow for recursive message types.
|
|
18
|
+
cache[type.fullName] = {} as any;
|
|
19
|
+
cache[type.fullName].map = codegen(`${type.name}$map`, ['obj', 'extraArgs'], c => {
|
|
20
|
+
c`const res = {};`;
|
|
21
|
+
for (const field of type.fieldsArray) {
|
|
22
|
+
c`if(obj.${field.name} !== undefined && obj.${field.name} !== null) {`; {
|
|
23
|
+
const genMapScalar = (value: string) => {
|
|
24
|
+
field.resolve();
|
|
25
|
+
const substitution = field.resolvedType && substitutions[field.resolvedType.fullName.slice(1)];
|
|
26
|
+
if (substitution) {
|
|
27
|
+
c`${ref(substitution)}(${value}, ...extraArgs)`;
|
|
28
|
+
} else if (field.resolvedType && field.resolvedType instanceof pb.Type) {
|
|
29
|
+
const mapper = createMessageMapperCached(field.resolvedType, substitutions, cache);
|
|
30
|
+
c`${ref(mapper)}.map(${value}, extraArgs)`;
|
|
31
|
+
} else {
|
|
32
|
+
c`${value}`;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// TODO(dmaretskyi): Support maps.
|
|
37
|
+
if (field.repeated) {
|
|
38
|
+
c`res.${field.name} = obj.${field.name}.map(item => `;
|
|
39
|
+
genMapScalar('item');
|
|
40
|
+
c`);`;
|
|
41
|
+
} else if (field.map) {
|
|
42
|
+
assert(field instanceof pb.MapField);
|
|
43
|
+
c`res.${field.name} = {};`;
|
|
44
|
+
c`for(const key of Object.keys(obj.${field.name})) {`; {
|
|
45
|
+
c`res.${field.name}[key] = `;
|
|
46
|
+
genMapScalar(`obj.${field.name}[key]`);
|
|
47
|
+
c`;`;
|
|
48
|
+
} c`}`;
|
|
49
|
+
} else {
|
|
50
|
+
c`res.${field.name} = `;
|
|
51
|
+
genMapScalar(`obj.${field.name}`);
|
|
52
|
+
c`;`;
|
|
53
|
+
}
|
|
54
|
+
} c`}`;
|
|
55
|
+
}
|
|
56
|
+
c`return res;`;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return cache[type.fullName];
|
|
61
|
+
};
|
package/src/schema.ts
CHANGED
|
@@ -18,6 +18,8 @@ export class Schema<T, S = {}> {
|
|
|
18
18
|
|
|
19
19
|
private readonly _mapping: BidirectionalMapingDescriptors;
|
|
20
20
|
|
|
21
|
+
private readonly _codecCache: Record<string, ProtoCodec> = {}
|
|
22
|
+
|
|
21
23
|
constructor (
|
|
22
24
|
private _typesRoot: protobufjs.Root,
|
|
23
25
|
substitutions: Substitutions
|
|
@@ -30,7 +32,9 @@ export class Schema<T, S = {}> {
|
|
|
30
32
|
throw new TypeError('Expected `typeName` argument to be a string');
|
|
31
33
|
}
|
|
32
34
|
const type = this._typesRoot.lookupType(typeName);
|
|
33
|
-
|
|
35
|
+
this._codecCache[type.fullName] ??= new ProtoCodec(type, this._mapping, this);
|
|
36
|
+
return this._codecCache[type.fullName];
|
|
37
|
+
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
tryGetCodecForType (typeName: string): ProtoCodec {
|
|
@@ -38,7 +42,8 @@ export class Schema<T, S = {}> {
|
|
|
38
42
|
throw new TypeError('Expected `typeName` argument to be a string');
|
|
39
43
|
}
|
|
40
44
|
const type = this._typesRoot.lookupType(typeName);
|
|
41
|
-
|
|
45
|
+
this._codecCache[type.fullName] ??= new ProtoCodec(type, this._mapping, this);
|
|
46
|
+
return this._codecCache[type.fullName];
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
getService<K extends keyof S & string> (name: K): ServiceDescriptor<S[K]> {
|
package/src/service.ts
CHANGED
|
@@ -147,6 +147,4 @@ export class ServiceHandler<S = {}> implements ServiceBackend {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
return name[0].toLocaleLowerCase() + name.substring(1);
|
|
152
|
-
}
|
|
150
|
+
const mapRpcMethodName = (name: string) => name[0].toLocaleLowerCase() + name.substring(1);
|
package/src/stream.ts
CHANGED
|
@@ -153,8 +153,8 @@ export class Stream<T> {
|
|
|
153
153
|
*
|
|
154
154
|
* NOTE: Copied from @dxos/debug to avoid circular dependency.
|
|
155
155
|
*/
|
|
156
|
-
|
|
156
|
+
const throwUnhandledRejection = (error: Error) => {
|
|
157
157
|
setTimeout(() => {
|
|
158
158
|
throw error;
|
|
159
159
|
});
|
|
160
|
-
}
|
|
160
|
+
};
|