skyltmax_config 4.0.0 → 4.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb210b3319ae9d0fcfc212868075e5f5eb80eb3850edfc4963bf43e19a794a23
4
- data.tar.gz: 7eb552eff6054ae1683a7ac8440f6d9dc562cb7dc00a5a575f418c2929e287c5
3
+ metadata.gz: da2f3f8ab3aea986a3fbaa3283bddcc1000eaa06ccd88b5dfc65e38d35a6a2c6
4
+ data.tar.gz: f7540ad04b6c664103af5fa28d502b921fc52001e2ff663ff3f76a1d80cacf94
5
5
  SHA512:
6
- metadata.gz: 873c6318ffd4341e1d574b09ced04ea744051830eb347108f805daaa670ab0f60e26b7d9047d416a9b2a1d23891f90abd61dcdc5efd733aaff08a71c6dd544a3
7
- data.tar.gz: 383de368f8148a7ea9d5378c36ff42d660f615c8d0bde7486cd4a0d8eb9da4107f3d56534e1e19797c483718ecc35880351f440de672da16abb7eb1df718fb2b
6
+ metadata.gz: 85423ebdd5775bb7fbc2f6c6615b0d465eec4d6fd7a04884bacbb7434a686b469dbaf857e74e99cda829b184cb6042441fa2e72eb5e717584b4c3161a9bea08d
7
+ data.tar.gz: a3fa9c943c1e28f64b479eb98106e3617f283e742013b493af475290e6af4fb62768d8065fca453bc2165d8be4ddc15934133ebb3cc5d47cbdfb1693b9250d06
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ### Unreleased
4
4
 
5
+ ### [4.0.1] - 2026-11-11
6
+
7
+ - fix: `.filter(Boolean)` narrows arrays of objects again. 4.0.0 vendored ts-reset 0.7.0's `filter` override verbatim,
8
+ and its `NonFalsy<NoInfer<S>>` return type left any array with object members un-narrowed (`(Obj | null)[]` stayed
9
+ `NoInfer<Obj | null>[]`), rejected correct `.filter(Boolean)` arguments, and broke generic `(U | null)[]`. The
10
+ vendored override now returns `NoInfer<NonFalsy<S>>[]`, which narrows every element type and keeps the inline argument
11
+ check 4.0.0 added. Hovers show `NoInfer<Obj>[]`; it is assignable to `Obj[]`.
12
+
5
13
  ### [4.0.0] - 2026-11-11
6
14
 
7
15
  Upgrade guide: [docs/migrations/4.0.0.md](docs/migrations/4.0.0.md).
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- skyltmax_config (4.0.0)
4
+ skyltmax_config (4.0.1)
5
5
  rubocop (>= 1.84.2, < 2)
6
6
  rubocop-performance (>= 1.26.0, < 2)
7
7
  rubocop-rails (>= 2.33.0, < 3)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SkyltmaxConfig
4
- VERSION = "4.0.0"
4
+ VERSION = "4.0.1"
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signmax/config",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
data/tests/reset.types.ts CHANGED
@@ -34,10 +34,33 @@ export type Checks = [
34
34
  Expect<Equal<typeof _cloned, HTMLDivElement>>,
35
35
  ]
36
36
 
37
- // filter-boolean inline as an argument still checks the elements (ts-reset#233; 0.6.1 let this compile)
37
+ // filter-boolean on object element types. Upstream 0.7.0's `NonFalsy<NoInfer<S>>` left all of these un-narrowed (4.0.0
38
+ // shipped that); the vendored `NoInfer<NonFalsy<S>>` must keep them assignable. Assignability, not Equal: the result
39
+ // reads `NoInfer<Obj>[]`, which is what consumers' code sees anyway.
40
+ type Obj = { id: string }
41
+ declare const objects: (Obj | null)[]
42
+ declare const mixed: (Obj | string | null | 0 | "")[]
43
+ declare const readonlyObjects: readonly (Obj | undefined)[]
44
+ export const _objects: Obj[] = objects.filter(Boolean)
45
+ export const _mixed: (Obj | string)[] = mixed.filter(Boolean)
46
+ export const _readonlyObjects: Obj[] = readonlyObjects.filter(Boolean)
47
+ export const _chained: string[] = objects.filter(Boolean).map(o => o.id)
48
+ export function _generic<U>(xs: (U | null | undefined)[]): U[] {
49
+ return xs.filter(Boolean)
50
+ }
51
+ declare function takeFirst<U>(xs: U[]): U
52
+ export const _inferred: Obj = takeFirst(objects.filter(Boolean))
53
+
54
+ // filter-boolean inline as an argument still checks the elements (ts-reset#233; 0.6.1 let this compile) …
38
55
  declare function pet(animals: readonly { type: string; name: string }[]): void
39
56
  // @ts-expect-error — `{ type: "dog" }` is missing `name`
40
57
  pet([{ type: "cat", name: "Fluffy" }, { type: "dog" }].filter(Boolean))
58
+ // … and still accepts a correct one (4.0.0 rejected this)
59
+ pet([{ type: "cat", name: "Fluffy" }, null].filter(Boolean))
60
+
61
+ // filter with a normal predicate on a union of arrays still falls through to the built-in overload
62
+ declare const unionOfArrays: string[] | number[]
63
+ void unionOfArrays.filter(x => typeof x === "string")
41
64
 
42
65
  // array-includes: a widened value is accepted without a cast
43
66
  literals.includes(widened)
data/ts-reset.d.ts CHANGED
@@ -7,6 +7,9 @@
7
7
  // - `promise-catch`, which 0.7.0 itself drops from `recommended`: its extra overload makes `.catch()`/`.then()` on a
8
8
  // `Promise<A> | Promise<B>` union a hard TS2349 error (ts-reset#209).
9
9
  //
10
+ // One deliberate deviation from upstream: `filter-boolean` returns `NoInfer<NonFalsy<S>>[]` instead of 0.7.0's
11
+ // `NonFalsy<NoInfer<S>>[]` — see the comment on that section.
12
+ //
10
13
  // Must stay a global script (no top-level import/export): every declaration here merges into a lib interface.
11
14
  // docs/upgrades/INTERACTIONS.md §11 has the provenance and the way back to the package.
12
15
  //
@@ -52,15 +55,21 @@ interface Body {
52
55
  }
53
56
 
54
57
  // --- filter-boolean: `.filter(Boolean)` removes falsy members from the element type ---
55
- // NoInfer<S> prevents contextual typing from flowing backward through S when .filter(Boolean) is used inline as a
56
- // function argument, which would silently skip structural checks on array elements (ts-reset#233). The <S extends T>
57
- // generic keeps overload resolution correct so non-Boolean predicates on union arrays fall through to the built-in.
58
+ // NoInfer stops contextual typing from flowing backward into S when .filter(Boolean) is used inline as a function
59
+ // argument, which would silently skip structural checks on array elements (ts-reset#233). The <S extends T> generic
60
+ // keeps overload resolution correct so non-Boolean predicates on union arrays fall through to the built-in.
61
+ //
62
+ // DEVIATION from upstream 0.7.0, which returns `TSReset.NonFalsy<NoInfer<S>>[]`: TS keeps the NoInfer wrapper on object
63
+ // types, so NonFalsy never distributes over it — `(Obj | null)[]` stayed `NoInfer<Obj | null>[]`, and correct inline
64
+ // calls and generic `(U | null)[]` were rejected (only primitive unions narrowed). Wrapping the whole result keeps the
65
+ // #233 inference block and lets NonFalsy resolve; the only visible difference is hovers reading `NoInfer<Obj>[]`.
66
+ // tests/reset.types.ts covers both. Upstream has no issue filed for this as of 2026-11-11.
58
67
  interface Array<T> {
59
- filter<S extends T>(predicate: BooleanConstructor, thisArg?: any): TSReset.NonFalsy<NoInfer<S>>[]
68
+ filter<S extends T>(predicate: BooleanConstructor, thisArg?: any): NoInfer<TSReset.NonFalsy<S>>[]
60
69
  }
61
70
 
62
71
  interface ReadonlyArray<T> {
63
- filter<S extends T>(predicate: BooleanConstructor, thisArg?: any): TSReset.NonFalsy<NoInfer<S>>[]
72
+ filter<S extends T>(predicate: BooleanConstructor, thisArg?: any): NoInfer<TSReset.NonFalsy<S>>[]
64
73
  }
65
74
 
66
75
  // --- is-array: `Array.isArray` narrows to unknown[] instead of any[] ---
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skyltmax_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Signmax AB