@stanterprise/protobuf 0.0.6 → 0.0.7
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/index.js +41 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -15
- package/dist/index.mjs.map +1 -1
- package/dist/lib/index.d.ts +9 -5
- package/dist/lib/index.d.ts.map +1 -1
- package/lib/index.ts +45 -5
- package/package.json +1 -1
package/lib/index.ts
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
// AUTO-COPIED FROM scripts/static-lib-index.ts
|
|
2
|
+
// DO NOT EDIT GENERATED lib/index.ts DIRECTLY
|
|
3
|
+
// scripts/static-lib-index.ts
|
|
4
|
+
// Source of truth for merged protobuf namespaces barrel (copied to lib/index.ts after generation)
|
|
5
|
+
// Update when adding new testsystem packages.
|
|
6
|
+
|
|
7
|
+
import * as googleTimestamp from '../lib/google/protobuf/timestamp';
|
|
8
|
+
import * as testsystemCommon from '../lib/testsystem/v1/common/common';
|
|
9
|
+
import * as testsystemEntities from '../lib/testsystem/v1/entities/entities';
|
|
10
|
+
import * as testsystemEvents from '../lib/testsystem/v1/events/events';
|
|
11
|
+
import * as testsystemObserver from '../lib/testsystem/v1/observer/observer';
|
|
12
|
+
|
|
13
|
+
type TestsystemNS = typeof testsystemCommon.testsystem &
|
|
14
|
+
typeof testsystemEntities.testsystem &
|
|
15
|
+
typeof testsystemEvents.testsystem &
|
|
16
|
+
typeof testsystemObserver.testsystem;
|
|
17
|
+
|
|
18
|
+
type PlainObject = Record<string, unknown>;
|
|
19
|
+
|
|
20
|
+
function isPlainObject(o: unknown): o is PlainObject {
|
|
21
|
+
return !!o && Object.prototype.toString.call(o) === '[object Object]';
|
|
22
|
+
}
|
|
23
|
+
function mergeNamespace<T extends PlainObject, S extends PlainObject>(target: T, source: S): T & S {
|
|
24
|
+
for (const k of Object.keys(source)) {
|
|
25
|
+
const key = k as keyof S & string;
|
|
26
|
+
const sv = source[key];
|
|
27
|
+
const tv = (target as PlainObject)[key];
|
|
28
|
+
if (isPlainObject(tv) && isPlainObject(sv))
|
|
29
|
+
mergeNamespace(tv as PlainObject, sv as PlainObject);
|
|
30
|
+
else (target as PlainObject)[key] = sv as unknown;
|
|
31
|
+
}
|
|
32
|
+
return target as T & S;
|
|
33
|
+
}
|
|
34
|
+
const testsystem: TestsystemNS = mergeNamespace(
|
|
35
|
+
mergeNamespace(
|
|
36
|
+
mergeNamespace(
|
|
37
|
+
mergeNamespace({}, testsystemCommon.testsystem as PlainObject),
|
|
38
|
+
testsystemEntities.testsystem as PlainObject
|
|
39
|
+
),
|
|
40
|
+
testsystemEvents.testsystem as PlainObject
|
|
41
|
+
),
|
|
42
|
+
testsystemObserver.testsystem as PlainObject
|
|
43
|
+
) as TestsystemNS;
|
|
44
|
+
export { testsystem };
|
|
45
|
+
export const google = googleTimestamp.google;
|