Skip to content
Myr

method-options.ts

This file

Path

test-d/method-options.ts

12 lines · 297 bytes · TypeScript

Last changed by

Support readonly inputs and explicit undefined in TypeScript optionsSindre Sorhusbefore adoption51b3177

History of this file

Take it

Support readonly inputs and explicit undefined in TypeScript optionsSindre Sorhusbefore adoption51b3177

lines 1–12why, one step back
1import ky, {type Options} from 'ky';
23const options: Options = {method: undefined};4void ky('https://example.com', options);5void ky.create({method: 'POST'}).extend({method: undefined});6void ky('https://example.com', {7 hooks: {8 init: [options => {9 options.method = undefined;10 }],11 },12});