unicode-to-plain-text
Version:
Convert fancy Unicode text to plain ASCII with smart language preservation
13 lines (12 loc) • 520 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateInput = void 0;
const validateInput = (text) => {
if (typeof text !== 'string') {
const receivedType = text === null ? 'null' : typeof text;
const receivedValue = text === undefined ? 'undefined' : text === null ? 'null' : JSON.stringify(text);
throw new TypeError(`Expected string, got ${receivedType}. Received: ${receivedValue}`);
}
return text;
};
exports.validateInput = validateInput;