Comparing version 1.0.1 to 1.0.2
@@ -9,15 +9,19 @@ export declare function unpartialRecursively<T extends Record<string, any>>(base: T, partial: Record<string, any> | undefined): T; | ||
*/ | ||
export declare function unpartial<T, R extends Partial<T> = Partial<T>>(base: T, partial: R | undefined | null): T; | ||
export declare function unpartial<T extends Record<any, any>, R extends Record<any, any> = Partial<T>>(base: T, partial: R | undefined | null): { | ||
[k in keyof T | keyof R]: R[k] & T[k]; | ||
}; | ||
/** | ||
* Unpartial a partial type with two base values. | ||
* This is useful when you are extending value from another package or code. | ||
* That means you have a `superBase` value from the original code, | ||
* That means you have a `parent` value from the original code, | ||
* a `base` value where you add additional defaults or override existing one, | ||
* and `partial` value from input. | ||
* @type R Type of `base`. This type will be used as the return type. | ||
* @param superBase The default value from the original code. | ||
* @param parent The default value from the original code. | ||
* @param base The extended default value of your code. | ||
* @param partial The input value. | ||
*/ | ||
export declare function unpartial<T, R = Partial<T> & Record<string, any>, S extends Partial<R> = Partial<R>>(superBase: T, base: R | undefined | null, partial: (S & Partial<T>) | undefined | null): R; | ||
export declare function unpartial<T extends Record<any, any>, R extends Record<any, any> = Partial<T>, S extends Record<any, any> = Partial<T & R>>(parent: T, base: R | undefined | null, partial: S | undefined | null): { | ||
[k in keyof T | keyof R | keyof S]: S[k] & R[k] & T[k]; | ||
}; | ||
//# sourceMappingURL=unpartial.d.ts.map |
@@ -9,15 +9,19 @@ export declare function unpartialRecursively<T extends Record<string, any>>(base: T, partial: Record<string, any> | undefined): T; | ||
*/ | ||
export declare function unpartial<T, R extends Partial<T> = Partial<T>>(base: T, partial: R | undefined | null): T; | ||
export declare function unpartial<T extends Record<any, any>, R extends Record<any, any> = Partial<T>>(base: T, partial: R | undefined | null): { | ||
[k in keyof T | keyof R]: R[k] & T[k]; | ||
}; | ||
/** | ||
* Unpartial a partial type with two base values. | ||
* This is useful when you are extending value from another package or code. | ||
* That means you have a `superBase` value from the original code, | ||
* That means you have a `parent` value from the original code, | ||
* a `base` value where you add additional defaults or override existing one, | ||
* and `partial` value from input. | ||
* @type R Type of `base`. This type will be used as the return type. | ||
* @param superBase The default value from the original code. | ||
* @param parent The default value from the original code. | ||
* @param base The extended default value of your code. | ||
* @param partial The input value. | ||
*/ | ||
export declare function unpartial<T, R = Partial<T> & Record<string, any>, S extends Partial<R> = Partial<R>>(superBase: T, base: R | undefined | null, partial: (S & Partial<T>) | undefined | null): R; | ||
export declare function unpartial<T extends Record<any, any>, R extends Record<any, any> = Partial<T>, S extends Record<any, any> = Partial<T & R>>(parent: T, base: R | undefined | null, partial: S | undefined | null): { | ||
[k in keyof T | keyof R | keyof S]: S[k] & R[k] & T[k]; | ||
}; | ||
//# sourceMappingURL=unpartial.d.ts.map |
{ | ||
"name": "unpartial", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Unpartial a partialed object", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/unional/unpartial", |
@@ -72,7 +72,7 @@ # unpartial | ||
# after fork and clone | ||
yarn | ||
pnpm install | ||
# begin making changes | ||
git checkout -b <branch> | ||
yarn watch | ||
pnpm watch | ||
@@ -79,0 +79,0 @@ # after making change(s) |
@@ -21,20 +21,22 @@ import { requiredDeep } from './required.js' | ||
*/ | ||
export function unpartial<T, | ||
R extends Partial<T> = Partial<T> | ||
>(base: T, partial: R | undefined | null): T | ||
export function unpartial< | ||
T extends Record<any, any>, | ||
R extends Record<any, any> = Partial<T> | ||
>(base: T, partial: R | undefined | null): { [k in keyof T | keyof R]: R[k] & T[k] } | ||
/** | ||
* Unpartial a partial type with two base values. | ||
* This is useful when you are extending value from another package or code. | ||
* That means you have a `superBase` value from the original code, | ||
* That means you have a `parent` value from the original code, | ||
* a `base` value where you add additional defaults or override existing one, | ||
* and `partial` value from input. | ||
* @type R Type of `base`. This type will be used as the return type. | ||
* @param superBase The default value from the original code. | ||
* @param parent The default value from the original code. | ||
* @param base The extended default value of your code. | ||
* @param partial The input value. | ||
*/ | ||
export function unpartial<T, | ||
R = Partial<T> & Record<string, any>, | ||
S extends Partial<R> = Partial<R> | ||
>(superBase: T, base: R | undefined | null, partial: (S & Partial<T>) | undefined | null): R | ||
export function unpartial< | ||
T extends Record<any, any>, | ||
R extends Record<any, any> = Partial<T>, | ||
S extends Record<any, any> = Partial<T & R> | ||
>(parent: T, base: R | undefined | null, partial: S | undefined | null): { [k in keyof T | keyof R | keyof S]: S[k] & R[k] & T[k] } | ||
export function unpartial(s1: any, s2: any, s3?: any) { | ||
@@ -41,0 +43,0 @@ // defensive check for JS |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
33782
348