@gobing-ai/ts-utils 0.4.28 → 0.4.31
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/event-severity.d.ts +7 -0
- package/dist/event-severity.d.ts.map +1 -0
- package/dist/event-severity.js +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +7 -0
- package/package.json +1 -1
- package/src/event-severity.ts +7 -0
- package/src/index.ts +1 -0
- package/src/object.ts +6 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Observability severity stamped by the event producer at emit time. */
|
|
2
|
+
export type EventSeverity = 'info' | 'warning' | 'error';
|
|
3
|
+
/** Mixin for lifecycle event details that carry producer-owned severity. */
|
|
4
|
+
export interface WithEventSeverity {
|
|
5
|
+
severity: EventSeverity;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=event-severity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-severity.d.ts","sourceRoot":"","sources":["../src/event-severity.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzD,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,aAAa,CAAC;CAC3B"}
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/object.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE9E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWnH;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,SAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAW7F;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE9E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWnH;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,SAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAW7F;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqBtF"}
|
package/dist/object.js
CHANGED
|
@@ -53,6 +53,13 @@ export function deFlattenKeys(entries) {
|
|
|
53
53
|
const result = {};
|
|
54
54
|
for (const [key, rawValue] of Object.entries(entries)) {
|
|
55
55
|
const parts = key.split('.');
|
|
56
|
+
// Prototype-pollution guard: navigating `current['__proto__']` resolves to
|
|
57
|
+
// `Object.prototype` (isPlainObject true), so a later assign would land on the global
|
|
58
|
+
// prototype; `constructor`/`prototype` segments let hostile input pivot through
|
|
59
|
+
// `Function.prototype`. Skipping (symmetric with deepMerge) makes deflate of hostile
|
|
60
|
+
// input a no-op rather than a throw callers must catch.
|
|
61
|
+
if (parts.some((part) => part === '__proto__' || part === 'constructor' || part === 'prototype'))
|
|
62
|
+
continue;
|
|
56
63
|
let current = result;
|
|
57
64
|
for (const part of parts.slice(0, -1)) {
|
|
58
65
|
if (!isPlainObject(current[part]))
|
package/package.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Observability severity stamped by the event producer at emit time. */
|
|
2
|
+
export type EventSeverity = 'info' | 'warning' | 'error';
|
|
3
|
+
|
|
4
|
+
/** Mixin for lifecycle event details that carry producer-owned severity. */
|
|
5
|
+
export interface WithEventSeverity {
|
|
6
|
+
severity: EventSeverity;
|
|
7
|
+
}
|
package/src/index.ts
CHANGED
package/src/object.ts
CHANGED
|
@@ -53,6 +53,12 @@ export function deFlattenKeys(entries: Record<string, string>): Record<string, u
|
|
|
53
53
|
const result: Record<string, unknown> = {};
|
|
54
54
|
for (const [key, rawValue] of Object.entries(entries)) {
|
|
55
55
|
const parts = key.split('.');
|
|
56
|
+
// Prototype-pollution guard: navigating `current['__proto__']` resolves to
|
|
57
|
+
// `Object.prototype` (isPlainObject true), so a later assign would land on the global
|
|
58
|
+
// prototype; `constructor`/`prototype` segments let hostile input pivot through
|
|
59
|
+
// `Function.prototype`. Skipping (symmetric with deepMerge) makes deflate of hostile
|
|
60
|
+
// input a no-op rather than a throw callers must catch.
|
|
61
|
+
if (parts.some((part) => part === '__proto__' || part === 'constructor' || part === 'prototype')) continue;
|
|
56
62
|
let current = result;
|
|
57
63
|
for (const part of parts.slice(0, -1)) {
|
|
58
64
|
if (!isPlainObject(current[part])) current[part] = {};
|