@naturalcycles/nodejs-lib 15.106.1 → 15.106.3

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.
@@ -634,7 +634,7 @@ type HasAllowExtraKeys<T> = T extends {
634
634
  type IsAny<T> = 0 extends 1 & T ? true : false;
635
635
  type IsAssignableRelaxed<A, B> = IsAny<RelaxIndexSignature<A>> extends true ? true : [RelaxIndexSignature<A>] extends [B] ? true : false;
636
636
  type ExactMatchBase<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => (T extends B ? 1 : 2) ? (<T>() => T extends B ? 1 : 2) extends <T>() => (T extends A ? 1 : 2) ? true : false : false;
637
- type ExactMatch<A, B> = HasAllowExtraKeys<B> extends true ? IsAssignableRelaxed<B, A> : ExactMatchBase<Expand<A>, Expand<B>> extends true ? true : ExactMatchBase<Expand<StripIndexSignatureDeep<A>>, Expand<StripIndexSignatureDeep<B>>>;
637
+ type ExactMatch<A, B> = HasAllowExtraKeys<B> extends true ? IsAssignableRelaxed<B, A> : ExactMatchBase<Expand<A>, Expand<B>> extends true ? true : ExactMatchBase<Expand<StripIndexSignatureDeep<A>>, Expand<StripIndexSignatureDeep<B>>> extends true ? true : ExactMatchBase<keyof Expand<A>, keyof Expand<B>> extends true ? [Expand<A>] extends [Expand<B>] ? [Expand<B>] extends [Expand<A>] ? true : false : false : false;
638
638
  type BuilderOutUnion<B extends readonly JSchema<any, any>[]> = {
639
639
  [K in keyof B]: B[K] extends JSchema<infer O, any> ? O : never;
640
640
  }[number];
@@ -47,6 +47,8 @@ export function mergeJsonSchemaObjects(schema1, schema2) {
47
47
  const s1 = schema1;
48
48
  const s2 = schema2;
49
49
  // Merge `properties`
50
+ // Not vulnerable to prototype pollution: writes to s1.properties (a nested object),
51
+ // where __proto__ assignment only changes that object's prototype, not Object.prototype.
50
52
  Object.entries(s2.properties).forEach(([k, v]) => {
51
53
  s1.properties[k] = v;
52
54
  });
@@ -600,6 +600,7 @@ const TIMEZONES_FROM_WIKI = [
600
600
  'WET',
601
601
  'Zulu',
602
602
  ];
603
+ // oxlint-disable-next-line no-restricted-globals
603
604
  const TIMEZONES_FROM_JS = Intl.supportedValuesOf('timeZone');
604
605
  /**
605
606
  * A complicated merge of timezones from the underlying Javascript engine
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
3
  "type": "module",
4
- "version": "15.106.1",
4
+ "version": "15.106.3",
5
5
  "dependencies": {
6
6
  "@naturalcycles/js-lib": "^15",
7
7
  "@standard-schema/spec": "^1",
@@ -2141,7 +2141,21 @@ type ExactMatch<A, B> =
2141
2141
  ? IsAssignableRelaxed<B, A>
2142
2142
  : ExactMatchBase<Expand<A>, Expand<B>> extends true
2143
2143
  ? true
2144
- : ExactMatchBase<Expand<StripIndexSignatureDeep<A>>, Expand<StripIndexSignatureDeep<B>>>
2144
+ : ExactMatchBase<
2145
+ Expand<StripIndexSignatureDeep<A>>,
2146
+ Expand<StripIndexSignatureDeep<B>>
2147
+ > extends true
2148
+ ? true
2149
+ : // Fallback for types that are structurally identical but have different internal
2150
+ // representations (e.g. enum values from T[keyof T] vs direct enum references).
2151
+ // Keys must match exactly; then check mutual structural assignability.
2152
+ ExactMatchBase<keyof Expand<A>, keyof Expand<B>> extends true
2153
+ ? [Expand<A>] extends [Expand<B>]
2154
+ ? [Expand<B>] extends [Expand<A>]
2155
+ ? true
2156
+ : false
2157
+ : false
2158
+ : false
2145
2159
 
2146
2160
  type BuilderOutUnion<B extends readonly JSchema<any, any>[]> = {
2147
2161
  [K in keyof B]: B[K] extends JSchema<infer O, any> ? O : never
@@ -55,6 +55,8 @@ export function mergeJsonSchemaObjects<T1 extends AnyObject, T2 extends AnyObjec
55
55
  const s2 = schema2 as any
56
56
 
57
57
  // Merge `properties`
58
+ // Not vulnerable to prototype pollution: writes to s1.properties (a nested object),
59
+ // where __proto__ assignment only changes that object's prototype, not Object.prototype.
58
60
  Object.entries(s2.properties).forEach(([k, v]) => {
59
61
  s1.properties[k] = v
60
62
  })
@@ -603,6 +603,7 @@ const TIMEZONES_FROM_WIKI = [
603
603
  'Zulu',
604
604
  ] as IANATimezone[]
605
605
 
606
+ // oxlint-disable-next-line no-restricted-globals
606
607
  const TIMEZONES_FROM_JS = Intl.supportedValuesOf('timeZone') as IANATimezone[]
607
608
 
608
609
  /**