function isAscii(str: string, isExtended = false) {
    const maxCharLength = isExtended ? 255 : 127;
    for (let i = 0, strLen = str.length; i < strLen; ++i) {
        if (str.charCodeAt(i) > maxCharLength) return false;
    }
    return true;
}

export { isAscii };
