diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-11-04 23:59:44 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-11-04 23:59:44 +0000 |
| commit | c6c93acc32893d891adb39011674c02f3f04999e (patch) | |
| tree | c58a17d789301cbc59bef1e0e3730dd9dc9aae98 /backend/node_modules/uuid/dist/esm-node/stringify.js | |
| parent | 9125c0bc964e499b40ddfa3e87d0b474dc63f5db (diff) | |
gitignore some shit
Diffstat (limited to 'backend/node_modules/uuid/dist/esm-node/stringify.js')
| -rw-r--r-- | backend/node_modules/uuid/dist/esm-node/stringify.js | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/backend/node_modules/uuid/dist/esm-node/stringify.js b/backend/node_modules/uuid/dist/esm-node/stringify.js deleted file mode 100644 index a6e4c88..0000000 --- a/backend/node_modules/uuid/dist/esm-node/stringify.js +++ /dev/null @@ -1,33 +0,0 @@ -import validate from './validate.js'; -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ - -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).slice(1)); -} - -export function unsafeStringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; -} - -function stringify(arr, offset = 0) { - const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!validate(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -export default stringify;
\ No newline at end of file |
