UNPKG

@skhemata/skhemata-form

Version:

Skhemata Form Web Component. This web component can be used as base web component when working with forms and inputs.

20 lines 693 B
export default function assertString(input) { const isString = (typeof input === 'string' || input instanceof String); if (!isString) { let invalidType; if (input === null) { invalidType = 'null'; } else { invalidType = typeof input; if (invalidType === 'object' && input.constructor && input.constructor.hasOwnProperty('name')) { invalidType = input.constructor.name; } else { invalidType = `a ${invalidType}`; } } throw new TypeError(`Expected string but received ${invalidType}.`); } } //# sourceMappingURL=assertString.js.map