Comparing version 2.5.2 to 2.5.3
@@ -35,2 +35,8 @@ /** | ||
/** | ||
* UnboxDeepRequired | ||
* Unbox type wraped with DeepRequired | ||
*/ | ||
type UnboxDeepRequired<T> = T extends DeepRequired<infer R> ? R : T; | ||
/** | ||
* Traverses properties on objects and arrays. If an intermediate property is | ||
@@ -71,3 +77,3 @@ * either null or undefined, it is instead returned. The purpose of this method | ||
accessor: (prop: NonNullable<DeepRequired<T1>>) => T2, | ||
): T2 | null | undefined; | ||
): UnboxDeepRequired<T2> | null | undefined; | ||
export default idx; |
@@ -78,1 +78,10 @@ import idx from './idx'; | ||
let b: boolean | undefined | null = idx(withMethods, _ => _.genrric(true)); | ||
let foo = idx(withMethods, _ => _.foo); | ||
// foo should be { bar?(): number } | ||
let fooTest1: typeof foo = {}; | ||
let fooTest2: typeof foo = { | ||
bar(): number { | ||
return 1; | ||
}, | ||
}; |
{ | ||
"name": "idx", | ||
"version": "2.5.2", | ||
"version": "2.5.3", | ||
"description": "Utility function for traversing properties on objects and arrays.", | ||
@@ -24,3 +24,3 @@ "main": "lib/idx.js", | ||
"babel-preset-env": "^1.1.11", | ||
"flow-bin": "^0.73.0", | ||
"flow-bin": "^0.92.1", | ||
"jest": "^19.0.2" | ||
@@ -31,3 +31,4 @@ }, | ||
"rootDir": "src" | ||
} | ||
}, | ||
"gitHead": "44866f559394971e7a4b354df4ac6166ac2e756d" | ||
} |
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
10429
227