@graphcommerce/next-ui 7.1.0-canary.37 → 7.1.0-canary.38
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/CHANGELOG.md +6 -0
- package/RenderType/filterNonNullableKeys.ts +11 -14
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 7.1.0-canary.38
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2048](https://github.com/graphcommerce-org/graphcommerce/pull/2048) [`695f40cf2`](https://github.com/graphcommerce-org/graphcommerce/commit/695f40cf220636d17f04bc9b0ce86c549c740386) - filterNonNullable keys simplified the types which caused unions to be collapsed ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
|
8
|
+
|
|
3
9
|
## 7.1.0-canary.37
|
|
4
10
|
|
|
5
11
|
## 7.1.0-canary.36
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import type { OptionalKeysOf
|
|
1
|
+
import type { OptionalKeysOf } from 'type-fest'
|
|
2
2
|
|
|
3
|
-
export type RequiredKeys<
|
|
4
|
-
T
|
|
5
|
-
Keys
|
|
6
|
-
>
|
|
7
|
-
Omit<T, Keys> & {
|
|
8
|
-
[K in Keys]: NonNullable<T[K]>
|
|
9
|
-
}
|
|
10
|
-
>
|
|
3
|
+
export type RequiredKeys<T extends Record<string, unknown>, Keys extends OptionalKeysOf<T>> = Omit<
|
|
4
|
+
T,
|
|
5
|
+
Keys
|
|
6
|
+
> & { [K in Keys]: NonNullable<T[K]> }
|
|
11
7
|
|
|
12
8
|
export function filterNonNullableKeys<
|
|
13
9
|
T extends Record<string, unknown>,
|
|
14
10
|
Keys extends OptionalKeysOf<T>,
|
|
15
|
-
>(
|
|
11
|
+
>(
|
|
12
|
+
items: (T | null | undefined)[] | null | undefined,
|
|
13
|
+
values: Keys[] = [],
|
|
14
|
+
): RequiredKeys<T, Keys>[] {
|
|
16
15
|
if (!items) return []
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
return items.filter(
|
|
19
18
|
(item) =>
|
|
20
19
|
item !== null &&
|
|
21
20
|
typeof item !== 'undefined' &&
|
|
22
21
|
values.every((v) => item?.[v] !== null && typeof item?.[v] !== 'undefined'),
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
return result as RequiredKeys<T, Keys>[]
|
|
22
|
+
) as RequiredKeys<T, Keys>[]
|
|
26
23
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "7.1.0-canary.
|
|
5
|
+
"version": "7.1.0-canary.38",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"@emotion/react": "^11.11.1",
|
|
19
19
|
"@emotion/server": "^11.11.0",
|
|
20
20
|
"@emotion/styled": "^11.11.0",
|
|
21
|
-
"@graphcommerce/framer-next-pages": "7.1.0-canary.
|
|
22
|
-
"@graphcommerce/framer-scroller": "7.1.0-canary.
|
|
23
|
-
"@graphcommerce/framer-utils": "7.1.0-canary.
|
|
24
|
-
"@graphcommerce/image": "7.1.0-canary.
|
|
21
|
+
"@graphcommerce/framer-next-pages": "7.1.0-canary.38",
|
|
22
|
+
"@graphcommerce/framer-scroller": "7.1.0-canary.38",
|
|
23
|
+
"@graphcommerce/framer-utils": "7.1.0-canary.38",
|
|
24
|
+
"@graphcommerce/image": "7.1.0-canary.38",
|
|
25
25
|
"cookie": "^0.5.0",
|
|
26
26
|
"react-is": "^18.2.0",
|
|
27
27
|
"schema-dts": "^1.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@graphcommerce/eslint-config-pwa": "7.1.0-canary.
|
|
31
|
-
"@graphcommerce/prettier-config-pwa": "7.1.0-canary.
|
|
32
|
-
"@graphcommerce/typescript-config-pwa": "7.1.0-canary.
|
|
30
|
+
"@graphcommerce/eslint-config-pwa": "7.1.0-canary.38",
|
|
31
|
+
"@graphcommerce/prettier-config-pwa": "7.1.0-canary.38",
|
|
32
|
+
"@graphcommerce/typescript-config-pwa": "7.1.0-canary.38",
|
|
33
33
|
"@types/cookie": "^0.5.2",
|
|
34
34
|
"@types/react-is": "^18.2.1",
|
|
35
35
|
"typescript": "5.2.2"
|