@gobing-ai/ts-utils 0.4.27 → 0.4.30

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.
@@ -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
@@ -4,6 +4,7 @@ export * from './const';
4
4
  export * from './cursor';
5
5
  export * from './date';
6
6
  export * from './errors';
7
+ export * from './event-severity';
7
8
  export * from './object';
8
9
  export * from './origin';
9
10
  export * from './output';
@@ -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
@@ -4,6 +4,7 @@ export * from './const.js';
4
4
  export * from './cursor.js';
5
5
  export * from './date.js';
6
6
  export * from './errors.js';
7
+ export * from './event-severity.js';
7
8
  export * from './object.js';
8
9
  export * from './origin.js';
9
10
  export * from './output.js';
@@ -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,CAetF"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobing-ai/ts-utils",
3
- "version": "0.4.27",
3
+ "version": "0.4.30",
4
4
  "description": "Zero-dependency TypeScript utilities for dates, cursors, errors, output, origins, roles, and API responses.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -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
@@ -4,6 +4,7 @@ export * from './const';
4
4
  export * from './cursor';
5
5
  export * from './date';
6
6
  export * from './errors';
7
+ export * from './event-severity';
7
8
  export * from './object';
8
9
  export * from './origin';
9
10
  export * from './output';
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] = {};