assertString.js 296 B

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