assertString.js 355 B

1234567891011121314
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = assertString;
  6. function assertString(input) {
  7. var isString = typeof input === 'string' || input instanceof String;
  8. if (!isString) {
  9. throw new TypeError('This library (validator.js) validates strings only');
  10. }
  11. }
  12. module.exports = exports['default'];