minishouyin/node_modules/validator/es/lib/util/assertString.js

4 lines
296 B
JavaScript
Raw Normal View History

2025-11-12 11:35:57 +08:00
export default function assertString(input) {
if (input === undefined || input === null) throw new TypeError("Expected a string but received a ".concat(input));
if (input.constructor.name !== 'String') throw new TypeError("Expected a string but received a ".concat(input.constructor.name));
}