This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type NullToOptional<K> = { | |
[key in keyof K as null extends K[key] ? key : never]?: Exclude<K[key], null> | |
} & { | |
[key in keyof K as null extends K[key] ? never: key]: K[key] | |
} | |
type OptionalToNullable<T> = { | |
[K in keyof T as undefined extends T[K] ? K : never]-?: T[K] | null; // Convert optional properties to mandatory nullable | |
} & { | |
[K in keyof T as undefined extends T[K] ? never : K]: T[K]; // Keep non-optional properties unchanged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type _Intersect = {a?:number} & {a:number|undefined}; | |
//state of exactOptionalPropertyTypes | |
type IsExactOptional = _Intersect["a"] extends Exclude<_Intersect["a"], undefined> ? true : false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
"we go on the page": function(browser){ | |
browser | |
.url("http://localhost:3000") | |
.waitForElementVisible("#stuff", 10000) | |
.assert.title("MyPage") | |
}, | |
"we fake the Date": function(browser){ | |
browser | |
.fakeDate(new Date(2001, 1, 1).getTime()) //DONE ! |