type-fest#Except TypeScript Examples
The following examples show how to use
type-fest#Except.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Cookie.ts From ZenTS with MIT License | 6 votes |
public set(
key: string,
value: JsonValue,
options?: Except<CookieOptions, 'enable' | 'strategy'>,
): void {
this.modifiedKeys.add(key)
this.data.set(key, {
value,
options: this.getCookieOptions(options),
})
}
Example #2
Source File: Cookie.ts From ZenTS with MIT License | 6 votes |
private getCookieOptions(options?: Except<CookieOptions, 'enable' | 'strategy'>): CookieOptions {
let cookieOptions = {}
if (typeof options !== 'undefined') {
if (config.web?.cookie?.strategy === 'merge') {
cookieOptions = Object.assign({}, config.web?.cookie, options)
} else {
cookieOptions = options
}
} else if (config.web?.cookie) {
cookieOptions = config.web?.cookie
}
return cookieOptions
}