@wix/sdk-runtime
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -16,6 +16,7 @@ import type { Simplify } from 'type-fest'; | ||
export declare function renameKeysFromRESTResponseToSDKResponse<T>(payload: T | undefined, ignorePaths?: string[]): RenameAllNestedKeys<T, typeof RESTResponseToSDKResponseRenameMap>; | ||
export type RenameAllNestedKeys<T, KeyMapper extends Record<string, string>> = Simplify<MapKeys<{ | ||
type NonTransformedTypes = ArrayBufferLike | Date | RegExp | string | number | boolean | null | undefined; | ||
export type RenameAllNestedKeys<T, KeyMapper extends Record<string, string>> = T extends NonTransformedTypes ? T : Simplify<MapKeys<{ | ||
[P in keyof T]: T extends T[P] ? T[P] : T[] extends T[P] ? T[P] : TransformedValue<T[P], KeyMapper>; | ||
}, KeyMapper>>; | ||
type TransformedValue<T, KeyMapper extends Record<string, string>> = T extends ArrayBufferLike ? T : T extends Date ? T : T extends RegExp ? T : T extends (infer E)[] ? TransformedArray<E, KeyMapper> : T extends object ? RenameAllNestedKeys<T, KeyMapper> : T; | ||
type TransformedValue<T, KeyMapper extends Record<string, string>> = T extends NonTransformedTypes ? T : T extends (infer E)[] ? TransformedArray<E, KeyMapper> : T extends object ? RenameAllNestedKeys<T, KeyMapper> : T; | ||
interface TransformedArray<T, KeyMapper extends Record<string, string>> extends Array<TransformedValue<T, KeyMapper>> { | ||
@@ -22,0 +23,0 @@ } |
@@ -16,6 +16,7 @@ import type { Simplify } from 'type-fest'; | ||
export declare function renameKeysFromRESTResponseToSDKResponse<T>(payload: T | undefined, ignorePaths?: string[]): RenameAllNestedKeys<T, typeof RESTResponseToSDKResponseRenameMap>; | ||
export type RenameAllNestedKeys<T, KeyMapper extends Record<string, string>> = Simplify<MapKeys<{ | ||
type NonTransformedTypes = ArrayBufferLike | Date | RegExp | string | number | boolean | null | undefined; | ||
export type RenameAllNestedKeys<T, KeyMapper extends Record<string, string>> = T extends NonTransformedTypes ? T : Simplify<MapKeys<{ | ||
[P in keyof T]: T extends T[P] ? T[P] : T[] extends T[P] ? T[P] : TransformedValue<T[P], KeyMapper>; | ||
}, KeyMapper>>; | ||
type TransformedValue<T, KeyMapper extends Record<string, string>> = T extends ArrayBufferLike ? T : T extends Date ? T : T extends RegExp ? T : T extends (infer E)[] ? TransformedArray<E, KeyMapper> : T extends object ? RenameAllNestedKeys<T, KeyMapper> : T; | ||
type TransformedValue<T, KeyMapper extends Record<string, string>> = T extends NonTransformedTypes ? T : T extends (infer E)[] ? TransformedArray<E, KeyMapper> : T extends object ? RenameAllNestedKeys<T, KeyMapper> : T; | ||
interface TransformedArray<T, KeyMapper extends Record<string, string>> extends Array<TransformedValue<T, KeyMapper>> { | ||
@@ -22,0 +23,0 @@ } |
{ | ||
"name": "@wix/sdk-runtime", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"license": "UNLICENSED", | ||
@@ -54,2 +54,3 @@ "sideEffects": false, | ||
"@types/is-ci": "^3.0.4", | ||
"@vitest/ui": "^1.1.3", | ||
"eslint": "^8.56.0", | ||
@@ -61,3 +62,3 @@ "eslint-config-sdk": "0.0.0", | ||
"typescript": "^5.3.3", | ||
"vitest": "^0.34.6", | ||
"vitest": "^1.1.3", | ||
"vitest-teamcity-reporter": "^0.2.2" | ||
@@ -83,3 +84,3 @@ }, | ||
}, | ||
"falconPackageHash": "ae543b3bddecb88afa248964e0bc9126ad3658cf0dc24c11261f2642" | ||
"falconPackageHash": "4065860b3b32a19242e9d7552a2dce5560b3abc84701818688dfc6fb" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
130836
3277
10