MCPcopy
hub / github.com/validatorjs/validator.js / assertString

Function assertString

src/lib/util/assertString.js:1–4  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

1export default function assertString(input) {
2 if (input === undefined || input === null) throw new TypeError(`Expected a string but received a ${input}`);
3 if (input.constructor.name !== 'String') throw new TypeError(`Expected a string but received a ${input.constructor.name}`);
4}

Callers 15

util.test.jsFile · 0.85
isPostalCodeFunction · 0.85
isTaxIDFunction · 0.85
isIdentityCard.jsFile · 0.85
isIdentityCardFunction · 0.85
isIPFunction · 0.85
isMD5Function · 0.85
isUppercaseFunction · 0.85
isISO31661Alpha2Function · 0.85
isDecimalFunction · 0.85
isLuhnNumberFunction · 0.85
isBase64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected