assertString.js 469 B

123456789101112
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = assertString;
  6. function assertString(input) {
  7. if (input === undefined || input === null) throw new TypeError("Expected a string but received a ".concat(input));
  8. if (input.constructor.name !== 'String') throw new TypeError("Expected a string but received a ".concat(input.constructor.name));
  9. }
  10. module.exports = exports.default;
  11. module.exports.default = exports.default;