mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-02-04 14:00:49 +00:00
nhj
more
This commit is contained in:
21
unified-ai-platform/node_modules/@webassemblyjs/utf8/LICENSE
generated
vendored
Normal file
21
unified-ai-platform/node_modules/@webassemblyjs/utf8/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Sven Sauleau <sven@sauleau.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
67
unified-ai-platform/node_modules/@webassemblyjs/utf8/esm/decoder.js
generated
vendored
Normal file
67
unified-ai-platform/node_modules/@webassemblyjs/utf8/esm/decoder.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
function con(b) {
|
||||
if ((b & 0xc0) === 0x80) {
|
||||
return b & 0x3f;
|
||||
} else {
|
||||
throw new Error("invalid UTF-8 encoding");
|
||||
}
|
||||
}
|
||||
|
||||
function code(min, n) {
|
||||
if (n < min || 0xd800 <= n && n < 0xe000 || n >= 0x10000) {
|
||||
throw new Error("invalid UTF-8 encoding");
|
||||
} else {
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
export function decode(bytes) {
|
||||
return _decode(bytes).map(function (x) {
|
||||
return String.fromCharCode(x);
|
||||
}).join("");
|
||||
}
|
||||
|
||||
function _decode(bytes) {
|
||||
var result = [];
|
||||
|
||||
while (bytes.length > 0) {
|
||||
var b1 = bytes[0];
|
||||
|
||||
if (b1 < 0x80) {
|
||||
result.push(code(0x0, b1));
|
||||
bytes = bytes.slice(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (b1 < 0xc0) {
|
||||
throw new Error("invalid UTF-8 encoding");
|
||||
}
|
||||
|
||||
var b2 = bytes[1];
|
||||
|
||||
if (b1 < 0xe0) {
|
||||
result.push(code(0x80, ((b1 & 0x1f) << 6) + con(b2)));
|
||||
bytes = bytes.slice(2);
|
||||
continue;
|
||||
}
|
||||
|
||||
var b3 = bytes[2];
|
||||
|
||||
if (b1 < 0xf0) {
|
||||
result.push(code(0x800, ((b1 & 0x0f) << 12) + (con(b2) << 6) + con(b3)));
|
||||
bytes = bytes.slice(3);
|
||||
continue;
|
||||
}
|
||||
|
||||
var b4 = bytes[3];
|
||||
|
||||
if (b1 < 0xf8) {
|
||||
result.push(code(0x10000, (((b1 & 0x07) << 18) + con(b2) << 12) + (con(b3) << 6) + con(b4)));
|
||||
bytes = bytes.slice(4);
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new Error("invalid UTF-8 encoding");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
74
unified-ai-platform/node_modules/@webassemblyjs/utf8/lib/decoder.js
generated
vendored
Normal file
74
unified-ai-platform/node_modules/@webassemblyjs/utf8/lib/decoder.js
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.decode = decode;
|
||||
|
||||
function con(b) {
|
||||
if ((b & 0xc0) === 0x80) {
|
||||
return b & 0x3f;
|
||||
} else {
|
||||
throw new Error("invalid UTF-8 encoding");
|
||||
}
|
||||
}
|
||||
|
||||
function code(min, n) {
|
||||
if (n < min || 0xd800 <= n && n < 0xe000 || n >= 0x10000) {
|
||||
throw new Error("invalid UTF-8 encoding");
|
||||
} else {
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
function decode(bytes) {
|
||||
return _decode(bytes).map(function (x) {
|
||||
return String.fromCharCode(x);
|
||||
}).join("");
|
||||
}
|
||||
|
||||
function _decode(bytes) {
|
||||
var result = [];
|
||||
|
||||
while (bytes.length > 0) {
|
||||
var b1 = bytes[0];
|
||||
|
||||
if (b1 < 0x80) {
|
||||
result.push(code(0x0, b1));
|
||||
bytes = bytes.slice(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (b1 < 0xc0) {
|
||||
throw new Error("invalid UTF-8 encoding");
|
||||
}
|
||||
|
||||
var b2 = bytes[1];
|
||||
|
||||
if (b1 < 0xe0) {
|
||||
result.push(code(0x80, ((b1 & 0x1f) << 6) + con(b2)));
|
||||
bytes = bytes.slice(2);
|
||||
continue;
|
||||
}
|
||||
|
||||
var b3 = bytes[2];
|
||||
|
||||
if (b1 < 0xf0) {
|
||||
result.push(code(0x800, ((b1 & 0x0f) << 12) + (con(b2) << 6) + con(b3)));
|
||||
bytes = bytes.slice(3);
|
||||
continue;
|
||||
}
|
||||
|
||||
var b4 = bytes[3];
|
||||
|
||||
if (b1 < 0xf8) {
|
||||
result.push(code(0x10000, (((b1 & 0x07) << 18) + con(b2) << 12) + (con(b3) << 6) + con(b4)));
|
||||
bytes = bytes.slice(4);
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new Error("invalid UTF-8 encoding");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user