chore: remove unused option validators (#16361)

pull/16347/head
Rich Harris 2 months ago committed by GitHub
parent 3f3cf9ff36
commit df5801c5fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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