summaryrefslogtreecommitdiff
path: root/node_modules/is-utf8/is-utf8.js
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
commit726b81b19251674e149ccfbb1abacbd837fc6db0 (patch)
treefbdbb227dc01357eb76e8222d76185bc124c5ca6 /node_modules/is-utf8/is-utf8.js
parent34f0890e175698940d49238097579f44e4d78c89 (diff)
downloadFlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.gz
FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.zst
Removed files that should not have been included in git
Diffstat (limited to 'node_modules/is-utf8/is-utf8.js')
-rw-r--r--node_modules/is-utf8/is-utf8.js76
1 files changed, 0 insertions, 76 deletions
diff --git a/node_modules/is-utf8/is-utf8.js b/node_modules/is-utf8/is-utf8.js
deleted file mode 100644
index 8a5f15d..0000000
--- a/node_modules/is-utf8/is-utf8.js
+++ /dev/null
@@ -1,76 +0,0 @@
-
-exports = module.exports = function(bytes)
-{
- var i = 0;
- while(i < bytes.length)
- {
- if( (// ASCII
- bytes[i] == 0x09 ||
- bytes[i] == 0x0A ||
- bytes[i] == 0x0D ||
- (0x20 <= bytes[i] && bytes[i] <= 0x7E)
- )
- ) {
- i += 1;
- continue;
- }
-
- if( (// non-overlong 2-byte
- (0xC2 <= bytes[i] && bytes[i] <= 0xDF) &&
- (0x80 <= bytes[i+1] && bytes[i+1] <= 0xBF)
- )
- ) {
- i += 2;
- continue;
- }
-
- if( (// excluding overlongs
- bytes[i] == 0xE0 &&
- (0xA0 <= bytes[i + 1] && bytes[i + 1] <= 0xBF) &&
- (0x80 <= bytes[i + 2] && bytes[i + 2] <= 0xBF)
- ) ||
- (// straight 3-byte
- ((0xE1 <= bytes[i] && bytes[i] <= 0xEC) ||
- bytes[i] == 0xEE ||
- bytes[i] == 0xEF) &&
- (0x80 <= bytes[i + 1] && bytes[i+1] <= 0xBF) &&
- (0x80 <= bytes[i+2] && bytes[i+2] <= 0xBF)
- ) ||
- (// excluding surrogates
- bytes[i] == 0xED &&
- (0x80 <= bytes[i+1] && bytes[i+1] <= 0x9F) &&
- (0x80 <= bytes[i+2] && bytes[i+2] <= 0xBF)
- )
- ) {
- i += 3;
- continue;
- }
-
- if( (// planes 1-3
- bytes[i] == 0xF0 &&
- (0x90 <= bytes[i + 1] && bytes[i + 1] <= 0xBF) &&
- (0x80 <= bytes[i + 2] && bytes[i + 2] <= 0xBF) &&
- (0x80 <= bytes[i + 3] && bytes[i + 3] <= 0xBF)
- ) ||
- (// planes 4-15
- (0xF1 <= bytes[i] && bytes[i] <= 0xF3) &&
- (0x80 <= bytes[i + 1] && bytes[i + 1] <= 0xBF) &&
- (0x80 <= bytes[i + 2] && bytes[i + 2] <= 0xBF) &&
- (0x80 <= bytes[i + 3] && bytes[i + 3] <= 0xBF)
- ) ||
- (// plane 16
- bytes[i] == 0xF4 &&
- (0x80 <= bytes[i + 1] && bytes[i + 1] <= 0x8F) &&
- (0x80 <= bytes[i + 2] && bytes[i + 2] <= 0xBF) &&
- (0x80 <= bytes[i + 3] && bytes[i + 3] <= 0xBF)
- )
- ) {
- i += 4;
- continue;
- }
-
- return false;
- }
-
- return true;
-}