chore: remove unused option validators

pull/16361/head
Rich Harris 2 months ago
parent 3f3cf9ff36
commit 1b8d10bc2a

@ -241,19 +241,6 @@ function validator(fallback, fn) {
};
}
/**
* @param {number} fallback
* @returns {Validator}
*/
function number(fallback) {
return validator(fallback, (input, keypath) => {
if (typeof input !== 'number') {
throw_error(`${keypath} should be a number, if specified`);
}
return input;
});
}
/**
* @param {string | undefined} fallback
* @param {boolean} allow_empty
@ -273,20 +260,6 @@ function string(fallback, allow_empty = true) {
});
}
/**
* @param {string[]} fallback
* @returns {Validator}
*/
function string_array(fallback) {
return validator(fallback, (input, keypath) => {
if (input && !Array.isArray(input)) {
throw_error(`${keypath} should be a string array, if specified`);
}
return input;
});
}
/**
* @param {boolean | undefined} fallback
* @returns {Validator}

Loading…
Cancel
Save