(options: DefaultOptions)
| 50 | * //=> Sun Aug 31 2014 00:00:00 |
| 51 | */ |
| 52 | export function setDefaultOptions(options: DefaultOptions): void { |
| 53 | const result: DefaultOptions = {}; |
| 54 | const defaultOptions = getDefaultOptions(); |
| 55 | |
| 56 | for (const property in defaultOptions) { |
| 57 | if (Object.prototype.hasOwnProperty.call(defaultOptions, property)) { |
| 58 | // [TODO] I challenge you to fix the type |
| 59 | (result as any)[property] = |
| 60 | defaultOptions[property as keyof DefaultOptions]; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | for (const property in options) { |
| 65 | if (Object.prototype.hasOwnProperty.call(options, property)) { |
| 66 | if (options[property as keyof DefaultOptions] === undefined) { |
| 67 | // [TODO] I challenge you to fix the type |
| 68 | delete (result as any)[property]; |
| 69 | } else { |
| 70 | // [TODO] I challenge you to fix the type |
| 71 | (result as any)[property] = options[property as keyof DefaultOptions]; |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | setInternalDefaultOptions(result); |
| 77 | } |
no test coverage detected