├── .all-contributorsrc ├── .eslintrc.json ├── .gitignore ├── .npmignore ├── .prettierrc.yaml ├── .travis.yml ├── CHANGE_HISTORY.md ├── LICENSE ├── README.md ├── assets ├── uuid-mongodb-logo.png ├── uuid-mongodb-lr-logo.png └── uuid-mongodb.png ├── examples ├── ex1-mongodb.js ├── ex2-mongoose.js ├── ex3-mongoose.js ├── ex4-mongoose.js ├── package-lock.json └── package.json ├── lib ├── index.d.ts └── index.js ├── package-lock.json ├── package.json └── test └── uuid-mongodb_spec.js /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "cdimascio", 10 | "name": "Carmine DiMascio", 11 | "avatar_url": "https://avatars1.githubusercontent.com/u/4706618?v=4", 12 | "profile": "https://github.com/cdimascio", 13 | "contributions": [ 14 | "infra", 15 | "docs", 16 | "code" 17 | ] 18 | }, 19 | { 20 | "login": "Benjamin-Dobell", 21 | "name": "Benjamin Dobell", 22 | "avatar_url": "https://avatars1.githubusercontent.com/u/482276?v=4", 23 | "profile": "https://glassechidna.com.au", 24 | "contributions": [ 25 | "code" 26 | ] 27 | }, 28 | { 29 | "login": "bytenik", 30 | "name": "David Pfeffer", 31 | "avatar_url": "https://avatars0.githubusercontent.com/u/441347?v=4", 32 | "profile": "https://github.com/bytenik", 33 | "contributions": [ 34 | "code" 35 | ] 36 | } 37 | ], 38 | "contributorsPerLine": 7, 39 | "projectName": "uuid-mongodb", 40 | "projectOwner": "cdimascio", 41 | "repoType": "github", 42 | "repoHost": "https://github.com" 43 | } 44 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["eslint:recommended", "plugin:prettier/recommended"], 3 | 4 | "env": { 5 | "node": true, 6 | "es6": true 7 | }, 8 | "overrides": [ 9 | { 10 | "files": [ 11 | "**/*spec.js" 12 | ], 13 | "env": { 14 | "mocha": true 15 | } 16 | } 17 | ], 18 | "rules": { 19 | "prettier/prettier": "error" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /examples 2 | /assets 3 | .vscode 4 | /test -------------------------------------------------------------------------------- /.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | trailingComma: 'es5' 2 | tabWidth: 2 3 | semi: true 4 | singleQuote: true 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | language: node_js 3 | node_js: 4 | - '10' 5 | - '12' 6 | install: 7 | - npm install 8 | script: 9 | - npm run lint 10 | - npm test 11 | -------------------------------------------------------------------------------- /CHANGE_HISTORY.md: -------------------------------------------------------------------------------- 1 | ## (2024-09-23) 2 | 3 | * upgrades uuid ([bff772f](https://github.com/cdimascio/uuid-mongodb/commit/bff772f)) 4 | * v2.5.5 ([413b449](https://github.com/cdimascio/uuid-mongodb/commit/413b449)) 5 | * fix: upgrade mongodb from 6.0.0 to 6.3.0 ([eb9c84c](https://github.com/cdimascio/uuid-mongodb/commit/eb9c84c)) 6 | 7 | 8 | 9 | ## (2024-09-23) 10 | 11 | * v2.5.5 ([413b449](https://github.com/cdimascio/uuid-mongodb/commit/413b449)) 12 | * fix: upgrade mongodb from 6.0.0 to 6.3.0 ([eb9c84c](https://github.com/cdimascio/uuid-mongodb/commit/eb9c84c)) 13 | 14 | 15 | 16 | ## (2024-09-23) 17 | 18 | * v2.5.5 ([413b449](https://github.com/cdimascio/uuid-mongodb/commit/413b449)) 19 | * fix: upgrade mongodb from 6.0.0 to 6.3.0 ([eb9c84c](https://github.com/cdimascio/uuid-mongodb/commit/eb9c84c)) 20 | 21 | 22 | 23 | ## 2.5.5 (2024-01-28) 24 | 25 | * Add support for mongodb@6.x ([9859389](https://github.com/cdimascio/uuid-mongodb/commit/9859389)) 26 | * Update package.json ([3c6cd6a](https://github.com/cdimascio/uuid-mongodb/commit/3c6cd6a)) 27 | * v2.5.5 ([398a1b3](https://github.com/cdimascio/uuid-mongodb/commit/398a1b3)) 28 | * fix: upgrade uuid from 9.0.0 to 9.0.1 ([f24ed75](https://github.com/cdimascio/uuid-mongodb/commit/f24ed75)) 29 | * chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 ([fc8652e](https://github.com/cdimascio/uuid-mongodb/commit/fc8652e)) 30 | * chore(deps): bump mongodb from 4.16.0 to 4.17.0 in /examples ([f5b8998](https://github.com/cdimascio/uuid-mongodb/commit/f5b8998)) 31 | * chore(deps): bump mongoose from 6.0.13 to 6.11.3 in /examples ([f6810df](https://github.com/cdimascio/uuid-mongodb/commit/f6810df)) 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Carmine DiMascio 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # uuid-mongodb 2 | ![](https://travis-ci.org/cdimascio/uuid-mongodb.svg?branch=master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a42f61ffc97b4bcbbca184ab838092c8)](https://www.codacy.com/app/cdimascio/uuid-mongodb?utm_source=github.com&utm_medium=referral&utm_content=cdimascio/uuid-mongodb&utm_campaign=Badge_Grade) ![](https://img.shields.io/npm/v/uuid-mongodb.svg) ![](https://img.shields.io/npm/dm/uuid-mongodb.svg) [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors) 3 | ![](https://img.shields.io/badge/license-MIT-blue.svg) 4 | 5 | Generates and parses [BSON UUIDs](https://docs.mongodb.com/manual/reference/method/UUID/) for use with MongoDB. BSON UUIDs provide better performance than their string counterparts. 6 | 7 |

8 | 9 |

10 | 11 | Inspired by [@srcagency's](https://github.com/srcagency) [mongo-uuid](https://github.com/srcagency/mongo-uuid) 12 | 13 | ## Install 14 | 15 | ```shell 16 | npm install uuid-mongodb 17 | ``` 18 | 19 | ## Usage 20 | 21 | ```javascript 22 | const MUUID = require('uuid-mongodb'); 23 | 24 | // Create a v1 binary UUID 25 | const mUUID1 = MUUID.v1(); 26 | 27 | // Create a v4 binary UUID 28 | const mUUID4 = MUUID.v4(); 29 | 30 | // Print a string representation of a binary UUID 31 | mUUID1.toString() 32 | 33 | // Create a binary UUID from a valid uuid string 34 | const mUUID2 = MUUID.from('393967e0-8de1-11e8-9eb6-529269fb1459') 35 | 36 | // Create a binary UUID from a MongoDb Binary 37 | // This is useful to get MUUIDs helpful toString() method 38 | const mUUID3 = MUUID.from(/** MongoDb Binary of SUBTYPE_UUID */) 39 | ``` 40 | 41 | ## Formatting 42 | 43 | UUIDs may be formatted using the following options: 44 | 45 | Format | Description | Example 46 | -- | -- | -- 47 | N | 32 digits | `00000000000000000000000000000000` 48 | D | 32 digits separated by hyphens | `00000000-0000-0000-0000-000000000000` 49 | B | 32 digits separated by hyphens, enclosed in braces | `{00000000-0000-0000-0000-000000000000}` 50 | P | 32 digits separated by hyphens, enclosed in parentheses | `(00000000-0000-0000-0000-000000000000)` 51 | 52 | **example:** 53 | ```javascript 54 | const mUUID4 = MUUID.v4(); 55 | mUUID1.toString(); // equivalent to `D` separated by hyphens 56 | mUUID1.toString('P'); // enclosed in parens, separated by hypens 57 | mUUID1.toString('B'); // enclosed in braces, separated by hyphens 58 | mUUID1.toString('N'); // 32 digits 59 | ``` 60 | 61 | ## Modes 62 | 63 | uuid-mongodb offers two modes: 64 | 65 | - **canonical** (default) - A string format that emphasizes type preservation at the expense of readability and interoperability. 66 | - **relaxed** - A string format that emphasizes readability and interoperability at the expense of type preservation. 67 | 68 | The mode is set **globally** as such: 69 | 70 | ```javascript 71 | const mUUID = MUUID.mode('relaxed'); // use relaxed mode 72 | ``` 73 | 74 | Mode _**only**_ impacts how `JSON.stringify(...)` represents a UUID: 75 | 76 | e.g. `JSON.stringy(mUUID.v1())` outputs the following: 77 | 78 | ```javascript 79 | "DEol4JenEeqVKusA+dzMMA==" // when in 'canonical' mode 80 | "1ac34980-97a7-11ea-8bab-b5327b548666" // when in 'relaxed' mode 81 | ``` 82 | 83 | ## Examples 84 | 85 | **Query using binary UUIDs** 86 | 87 | ```javascript 88 | const uuid = MUUID.from('393967e0-8de1-11e8-9eb6-529269fb1459'); 89 | return collection.then(c => 90 | c.findOne({ 91 | _id: uuid, 92 | }) 93 | ); 94 | ``` 95 | 96 | **Work with binary UUIDs returned in query results** 97 | 98 | ```javascript 99 | return collection 100 | .then(c => c.findOne({ _id: uuid })) 101 | .then(doc => { 102 | const uuid = MUUID.from(doc._id).toString(); 103 | // do stuff 104 | }); 105 | ``` 106 | 107 | ## Examples (with source code) 108 | 109 | #### Native Node MongoDB Driver example 110 | 111 | - [examples/ex1-mongodb.js](examples/ex1-mongodb.js) 112 | 113 | **snippet:** 114 | 115 | ```javascript 116 | const insertResult = await collection.insertOne({ 117 | _id: MUUID.v1(), 118 | name: 'carmine', 119 | }); 120 | ``` 121 | 122 | #### Mongoose example 123 | 124 | - [examples/ex2-mongoose.js](examples/ex2-mongoose.js) 125 | 126 | **snippet:** 127 | 128 | ```javascript 129 | const kittySchema = new mongoose.Schema({ 130 | _id: { 131 | type: 'object', 132 | value: { type: 'Buffer' }, 133 | default: () => MUUID.v1(), 134 | }, 135 | title: String, 136 | }); 137 | ``` 138 | 139 | - [examples/ex3-mongoose.js](examples/ex3-mongoose.js) 140 | 141 | **snippet:** 142 | 143 | ```javascript 144 | // Define a simple schema 145 | const kittySchema = new mongoose.Schema({ 146 | _id: { 147 | type: 'object', 148 | value: { type: 'Buffer' }, 149 | default: () => MUUID.v1(), 150 | }, 151 | title: String, 152 | }); 153 | 154 | // no need for auto getter for _id will add a virtual later 155 | kittySchema.set('id', false); 156 | 157 | // virtual getter for custom _id 158 | kittySchema 159 | .virtual('id') 160 | .get(function() { 161 | return MUUID.from(this._id).toString(); 162 | }) 163 | .set(function(val) { 164 | this._id = MUUID.from(val); 165 | }); 166 | ``` 167 | 168 | - [examples/ex4-mongoose.js](examples/ex4-mongoose.js) 169 | 170 | ```javascript 171 | const uuid = MUUID.v4(); 172 | 173 | // save record and wait for it to commit 174 | await new Data({ uuid }).save(); 175 | 176 | // retrieve the record 177 | const result = await Data.findOne({ uuid }); 178 | ``` 179 | 180 | ## Notes 181 | 182 | Currently supports [UUID v1 and v4](https://www.ietf.org/rfc/rfc4122.txt) 183 | 184 | ## Contributors 185 | 186 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 187 | 188 | 189 | 190 | 191 | 192 |
Carmine DiMascio
Carmine DiMascio

💻
Benjamin Dobell
Benjamin Dobell

💻
David Pfeffer
David Pfeffer

💻
193 | 194 | 195 | 196 | 197 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! 198 | 199 | ## License 200 | 201 | [MIT](./LICENSE) 202 | 203 | Buy Me A Coffee 204 | -------------------------------------------------------------------------------- /assets/uuid-mongodb-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdimascio/uuid-mongodb/6ea1b81e68fe37ef76f3fcb1daf610db5053dda4/assets/uuid-mongodb-logo.png -------------------------------------------------------------------------------- /assets/uuid-mongodb-lr-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdimascio/uuid-mongodb/6ea1b81e68fe37ef76f3fcb1daf610db5053dda4/assets/uuid-mongodb-lr-logo.png -------------------------------------------------------------------------------- /assets/uuid-mongodb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdimascio/uuid-mongodb/6ea1b81e68fe37ef76f3fcb1daf610db5053dda4/assets/uuid-mongodb.png -------------------------------------------------------------------------------- /examples/ex1-mongodb.js: -------------------------------------------------------------------------------- 1 | const MongoClient = require('mongodb').MongoClient; 2 | const MUUID = require('../lib'); 3 | const assert = require('assert'); 4 | 5 | // Connection URL 6 | const url = 'mongodb://localhost:27017'; 7 | const dbName = 'myproject'; 8 | const collectionName = 'mycollection'; 9 | 10 | // Use connect method to connect to the server 11 | MongoClient.connect(url, { useNewUrlParser: true }, async (err, client) => { 12 | try { 13 | assert.equal(null, err); 14 | 15 | const db = client.db(dbName); 16 | const collection = await db.createCollection(collectionName); 17 | 18 | // ***** 19 | // 1. insert a record with a v1 uuid 20 | const insertResult = await collection.insertOne({ 21 | _id: MUUID.v1(), 22 | name: 'carmine', 23 | }); 24 | 25 | // retrieve the newly inserted document's UUID 26 | // and print it as a human readable string 27 | const insertedId = MUUID.from(insertResult.insertedId).toString(); 28 | console.log(`insertOne with id ${insertedId} succeeded`); 29 | 30 | // ***** 31 | // 2. fetch a document by UUID 32 | const findResult = await collection.findOne({ 33 | _id: insertResult.insertedId, 34 | }); 35 | 36 | // print the UUID of the document as a human readable string 37 | const foundId = MUUID.from(findResult._id).toString(); 38 | console.log(`findOne with id ${foundId} succeeded`); 39 | } finally { 40 | client.close(); 41 | } 42 | }); 43 | -------------------------------------------------------------------------------- /examples/ex2-mongoose.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const MUUID = require('../lib'); 3 | 4 | // Setup and connect 5 | mongoose.connect('mongodb://localhost/my_mongoose', { 6 | useNewUrlParser: true, 7 | useUnifiedTopology: true, 8 | }); 9 | 10 | const db = mongoose.connection 11 | .on('error', () => console.error('connection error:')) 12 | .once('open', () => {}); 13 | 14 | // 1. Define a simple schema 15 | const kittySchema = new mongoose.Schema({ 16 | _id: { 17 | type: 'object', 18 | value: { type: 'Buffer' }, 19 | default: () => MUUID.v1(), 20 | }, 21 | title: String, 22 | }); 23 | 24 | const Kitten = mongoose.model('Kitten', kittySchema); 25 | 26 | // 2. Create new kitten with UUID _id 27 | var silence = new Kitten({ 28 | // _id: MUUID.v1(), 29 | title: 'Silence', 30 | }); 31 | 32 | // 3. Save the new kitten to the database 33 | silence 34 | .save() 35 | // 4. Fetch the new kitten from the database 36 | .then(kitten => { 37 | console.log('inserted kitten with id', MUUID.from(kitten._id).toString()); 38 | return Kitten.findOne({ _id: kitten._id }); 39 | }) 40 | .then(kitten => 41 | console.log('found kitten with id', MUUID.from(kitten._id).toString()) 42 | ) 43 | .catch(e => console.error(e)) 44 | .finally(() => db.close()); 45 | -------------------------------------------------------------------------------- /examples/ex3-mongoose.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const MUUID = require('../lib'); 3 | 4 | const log = (...a) => console.log(...a); 5 | // Setup and connect 6 | mongoose.connect('mongodb://localhost/my_mongoose', { 7 | useNewUrlParser: true, 8 | useUnifiedTopology: true, 9 | }); 10 | 11 | const db = mongoose.connection 12 | .on('error', () => console.error('connection error:')) 13 | .once('open', () => {}); 14 | 15 | // 1. Define a simple schema 16 | const kittySchema = new mongoose.Schema({ 17 | _id: { 18 | type: 'object', 19 | value: { type: 'Buffer' }, 20 | default: () => MUUID.v1(), 21 | }, 22 | title: String, 23 | }); 24 | 25 | // no need for auto getter for _id will add a virtual later 26 | kittySchema.set('id', false); 27 | 28 | // virtual getter for custom _id 29 | kittySchema 30 | .virtual('id') 31 | .get(function() { 32 | return MUUID.from(this._id).toString(); 33 | }) 34 | .set(function(val) { 35 | this._id = MUUID.from(val); 36 | }); 37 | 38 | const Kitten = mongoose.model('Kitten', kittySchema); 39 | 40 | // 2. Create new kitten 41 | var silence = new Kitten({ 42 | title: 'Silence', 43 | }); 44 | 45 | // 3. Save the new kitten to the database 46 | silence 47 | .save() 48 | .then(kitten => { 49 | log('inserted kitten with id', kitten.id); 50 | return kitten._id; 51 | }) 52 | .then(_id => Kitten.findOne({ _id })) 53 | .then(kitten => log('found kitten with id', kitten.id)) 54 | .catch(e => log(e)) 55 | .finally(() => db.close()); 56 | -------------------------------------------------------------------------------- /examples/ex4-mongoose.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const MUUID = require('../lib'); 3 | 4 | // Setup and connect 5 | mongoose.connect('mongodb://localhost/my_mongoose', { 6 | useNewUrlParser: true, 7 | useUnifiedTopology: true, 8 | }); 9 | 10 | // Monitor connection 11 | const db = mongoose.connection 12 | .on('error', () => console.error('connection error:')) 13 | .once('open', () => {}); 14 | 15 | // Main program 16 | async function main() { 17 | // Create mongoose schema 18 | const dataSchema = new mongoose.Schema({ 19 | uuid: { 20 | type: 'object', 21 | value: { type: 'Buffer' }, 22 | default: () => MUUID.v4(), 23 | 24 | required: true, 25 | unique: true, 26 | index: true, 27 | }, 28 | }); 29 | // Create the model 30 | const Data = mongoose.model('Data', dataSchema); 31 | 32 | // Create a record and fetch it by its uuid 33 | try { 34 | // create a v4 uuid (this simply wraps the fantastic uuid library) 35 | const uuid = MUUID.v4(); 36 | 37 | // save record and wait for it to commit 38 | await new Data({ uuid }).save(); 39 | 40 | // retrieve the record 41 | const result = await Data.findOne({ uuid }); 42 | 43 | // output the result 44 | console.log(result); 45 | } catch (e) { 46 | console.error(e); 47 | } finally { 48 | db.close(); 49 | } 50 | } 51 | 52 | main(); 53 | -------------------------------------------------------------------------------- /examples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "MIT", 11 | "dependencies": { 12 | "mongodb": "^4.2.0", 13 | "mongoose": "^6.0.13" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Binary } from "mongodb"; 2 | 3 | export type UUIDFormat = 'N' | 'D' | 'B' | 'P'; 4 | export interface MUUID extends Binary { 5 | /** 6 | * Converts the uuid into its canonical representation. 7 | * @param format The type of canonical representation. 8 | * "N" for 32 digits, e.g. 00000000000000000000000000000000; 9 | * "D" for 32 digits separated by hyphens (default), e.g. 00000000-0000-0000-0000-000000000000; 10 | * "B" for 32 digits separated by hyphens, enclosed in braces, e.g. {00000000-0000-0000-0000-000000000000}; or 11 | * "P" for 32 digits separated by hyphens, enclosed in parentheses, e.g. (00000000-0000-0000-0000-000000000000) 12 | */ 13 | toString(format?: 'utf8' | 'utf-8' | 'base64' | 'hex'): string; 14 | toString(format?: UUIDFormat): string; 15 | } 16 | export type Mode = { 17 | v1: () => MUUID, 18 | v4: () => MUUID, 19 | from: (uuid: string | Binary) => MUUID, 20 | mode: Mode 21 | } 22 | 23 | export const v1: () => MUUID; 24 | export const v4: () => MUUID; 25 | export const from: (uuid: string | Binary) => MUUID; 26 | export const mode: (mode: 'canonical'| 'relaxed') => Mode; 27 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * Copyright (c) 2018-2024 Carmine M DiMascio 4 | */ 5 | const { Binary } = require('mongodb'); 6 | const { v1: uuidv1 } = require('uuid'); 7 | const { v4: uuidv4 } = require('uuid'); 8 | 9 | const Err = { 10 | InvalidUUID: new Error('Invalid UUID.'), 11 | UnexpectedUUIDType: new Error( 12 | 'Unexpected UUID type. UUID must be a string or a MongoDB Binary (SUBTYPE_UUID).' 13 | ), 14 | UnsupportedUUIDVersion: new Error('Unsupported uuid version.'), 15 | InvalidHexString: new Error('Invalid hex string.'), 16 | InvalidMode: new Error("Invalid Mode. Expected 'canonical' or 'relaxed'."), 17 | }; 18 | let mode = 'canonical'; 19 | module.exports = { 20 | mode(m) { 21 | if (!['canonical', 'relaxed'].includes(m)) throw Err.InvalidMode; 22 | mode = m; 23 | return this; 24 | }, 25 | v1() { 26 | return generateUUID(null, 1); 27 | }, 28 | 29 | v4() { 30 | return generateUUID(null, 4); 31 | }, 32 | 33 | from(uuid) { 34 | if (typeof uuid === 'string') { 35 | return generateUUID(uuid); 36 | } else if ( 37 | (uuid instanceof Binary || uuid._bsontype === 'Binary') && 38 | uuid.sub_type === Binary.SUBTYPE_UUID 39 | ) { 40 | if (uuid.length() !== 16) throw Err.InvalidUUID; 41 | return apply( 42 | new Binary(uuid.read(0, uuid.length()), Binary.SUBTYPE_UUID) 43 | ); 44 | } else { 45 | throw Err.UnexpectedUUIDType; 46 | } 47 | }, 48 | }; 49 | 50 | function generateUUID(uuid, v = 1) { 51 | if (v <= 0 || v > 4 || v === 2 || v === 3) throw Err.UnsupportedUUIDVersion; 52 | 53 | let uuidv = uuidv1; 54 | if (v === 4) uuidv = uuidv4; 55 | 56 | if (uuid) { 57 | if (!validateUuid(uuid)) throw Err.InvalidUUID; 58 | const normalized = normalize(uuid); 59 | if (!normalized) throw Err.InvalidHexString; 60 | return apply( 61 | new Binary(Buffer.from(normalized, 'hex'), Binary.SUBTYPE_UUID) 62 | ); 63 | } else { 64 | const uuid = uuidv(null, Buffer.alloc(16)); 65 | return apply(new Binary(uuid, Binary.SUBTYPE_UUID)); 66 | } 67 | } 68 | 69 | function validateUuid(string) { 70 | return !!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.exec( 71 | string 72 | ); 73 | } 74 | 75 | function normalize(string) { 76 | if (typeof string !== 'string') return false; 77 | 78 | const stripped = string.replace(/-/g, '').toLowerCase(); 79 | 80 | if (!stripped.match(/^[a-f0-9]{32}$/)) return false; 81 | return stripped; 82 | } 83 | 84 | function stringify(buffer, delimiter) { 85 | return [ 86 | buffer.toString('hex', 0, 4), 87 | buffer.toString('hex', 4, 6), 88 | buffer.toString('hex', 6, 8), 89 | buffer.toString('hex', 8, 10), 90 | buffer.toString('hex', 10, 16), 91 | ].join(delimiter); 92 | } 93 | 94 | function apply(mu) { 95 | // add to string method 96 | // formatting parameter (optional) follows the behavior of Microsoft's UUID string function: https://docs.microsoft.com/en-us/dotnet/api/system.guid.tostring 97 | mu.toString = function (format) { 98 | let delimiter = '-'; 99 | let prefix = ''; 100 | let suffix = ''; 101 | if (format === 'N') delimiter = ''; 102 | if (format === 'B') { 103 | prefix = '{'; 104 | suffix = '}'; 105 | } 106 | if (format === 'P') { 107 | prefix = '('; 108 | suffix = ')'; 109 | } 110 | 111 | return prefix + stringify(this.buffer, delimiter) + suffix; 112 | }.bind(mu); 113 | 114 | if (mode === 'relaxed') { 115 | mu.toJSON = mu.toString; 116 | } 117 | return mu; 118 | } 119 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "uuid-mongodb", 3 | "version": "2.6.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "uuid-mongodb", 9 | "version": "2.6.0", 10 | "license": "MIT", 11 | "dependencies": { 12 | "uuid": "^10.0.0" 13 | }, 14 | "devDependencies": { 15 | "eslint": "8.38.0", 16 | "eslint-config-prettier": "^8.8.0", 17 | "eslint-plugin-prettier": "^4.2.1", 18 | "mocha": "^10.2.0", 19 | "mongodb": "^6.9.0", 20 | "prettier": "^3.3.3" 21 | } 22 | }, 23 | "node_modules/@eslint-community/eslint-utils": { 24 | "version": "4.4.0", 25 | "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", 26 | "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", 27 | "dev": true, 28 | "dependencies": { 29 | "eslint-visitor-keys": "^3.3.0" 30 | }, 31 | "engines": { 32 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 33 | }, 34 | "peerDependencies": { 35 | "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" 36 | } 37 | }, 38 | "node_modules/@eslint-community/regexpp": { 39 | "version": "4.5.0", 40 | "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.0.tgz", 41 | "integrity": "sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ==", 42 | "dev": true, 43 | "engines": { 44 | "node": "^12.0.0 || ^14.0.0 || >=16.0.0" 45 | } 46 | }, 47 | "node_modules/@eslint/eslintrc": { 48 | "version": "2.0.2", 49 | "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.2.tgz", 50 | "integrity": "sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ==", 51 | "dev": true, 52 | "dependencies": { 53 | "ajv": "^6.12.4", 54 | "debug": "^4.3.2", 55 | "espree": "^9.5.1", 56 | "globals": "^13.19.0", 57 | "ignore": "^5.2.0", 58 | "import-fresh": "^3.2.1", 59 | "js-yaml": "^4.1.0", 60 | "minimatch": "^3.1.2", 61 | "strip-json-comments": "^3.1.1" 62 | }, 63 | "engines": { 64 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 65 | }, 66 | "funding": { 67 | "url": "https://opencollective.com/eslint" 68 | } 69 | }, 70 | "node_modules/@eslint/js": { 71 | "version": "8.38.0", 72 | "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.38.0.tgz", 73 | "integrity": "sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g==", 74 | "dev": true, 75 | "engines": { 76 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 77 | } 78 | }, 79 | "node_modules/@humanwhocodes/config-array": { 80 | "version": "0.11.8", 81 | "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", 82 | "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", 83 | "dev": true, 84 | "dependencies": { 85 | "@humanwhocodes/object-schema": "^1.2.1", 86 | "debug": "^4.1.1", 87 | "minimatch": "^3.0.5" 88 | }, 89 | "engines": { 90 | "node": ">=10.10.0" 91 | } 92 | }, 93 | "node_modules/@humanwhocodes/module-importer": { 94 | "version": "1.0.1", 95 | "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", 96 | "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", 97 | "dev": true, 98 | "engines": { 99 | "node": ">=12.22" 100 | }, 101 | "funding": { 102 | "type": "github", 103 | "url": "https://github.com/sponsors/nzakas" 104 | } 105 | }, 106 | "node_modules/@humanwhocodes/object-schema": { 107 | "version": "1.2.1", 108 | "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", 109 | "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", 110 | "dev": true 111 | }, 112 | "node_modules/@mongodb-js/saslprep": { 113 | "version": "1.1.9", 114 | "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz", 115 | "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==", 116 | "dev": true, 117 | "dependencies": { 118 | "sparse-bitfield": "^3.0.3" 119 | } 120 | }, 121 | "node_modules/@nodelib/fs.scandir": { 122 | "version": "2.1.5", 123 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", 124 | "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", 125 | "dev": true, 126 | "dependencies": { 127 | "@nodelib/fs.stat": "2.0.5", 128 | "run-parallel": "^1.1.9" 129 | }, 130 | "engines": { 131 | "node": ">= 8" 132 | } 133 | }, 134 | "node_modules/@nodelib/fs.stat": { 135 | "version": "2.0.5", 136 | "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", 137 | "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", 138 | "dev": true, 139 | "engines": { 140 | "node": ">= 8" 141 | } 142 | }, 143 | "node_modules/@nodelib/fs.walk": { 144 | "version": "1.2.8", 145 | "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", 146 | "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", 147 | "dev": true, 148 | "dependencies": { 149 | "@nodelib/fs.scandir": "2.1.5", 150 | "fastq": "^1.6.0" 151 | }, 152 | "engines": { 153 | "node": ">= 8" 154 | } 155 | }, 156 | "node_modules/@types/webidl-conversions": { 157 | "version": "7.0.3", 158 | "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", 159 | "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", 160 | "dev": true 161 | }, 162 | "node_modules/@types/whatwg-url": { 163 | "version": "11.0.5", 164 | "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", 165 | "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", 166 | "dev": true, 167 | "dependencies": { 168 | "@types/webidl-conversions": "*" 169 | } 170 | }, 171 | "node_modules/acorn": { 172 | "version": "8.8.2", 173 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", 174 | "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", 175 | "dev": true, 176 | "bin": { 177 | "acorn": "bin/acorn" 178 | }, 179 | "engines": { 180 | "node": ">=0.4.0" 181 | } 182 | }, 183 | "node_modules/acorn-jsx": { 184 | "version": "5.3.2", 185 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", 186 | "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", 187 | "dev": true, 188 | "peerDependencies": { 189 | "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" 190 | } 191 | }, 192 | "node_modules/ajv": { 193 | "version": "6.12.6", 194 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", 195 | "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", 196 | "dev": true, 197 | "dependencies": { 198 | "fast-deep-equal": "^3.1.1", 199 | "fast-json-stable-stringify": "^2.0.0", 200 | "json-schema-traverse": "^0.4.1", 201 | "uri-js": "^4.2.2" 202 | }, 203 | "funding": { 204 | "type": "github", 205 | "url": "https://github.com/sponsors/epoberezkin" 206 | } 207 | }, 208 | "node_modules/ansi-colors": { 209 | "version": "4.1.1", 210 | "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", 211 | "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", 212 | "dev": true, 213 | "engines": { 214 | "node": ">=6" 215 | } 216 | }, 217 | "node_modules/ansi-regex": { 218 | "version": "5.0.1", 219 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 220 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 221 | "dev": true, 222 | "engines": { 223 | "node": ">=8" 224 | } 225 | }, 226 | "node_modules/ansi-styles": { 227 | "version": "4.3.0", 228 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 229 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 230 | "dev": true, 231 | "dependencies": { 232 | "color-convert": "^2.0.1" 233 | }, 234 | "engines": { 235 | "node": ">=8" 236 | }, 237 | "funding": { 238 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 239 | } 240 | }, 241 | "node_modules/anymatch": { 242 | "version": "3.1.2", 243 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", 244 | "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", 245 | "dev": true, 246 | "dependencies": { 247 | "normalize-path": "^3.0.0", 248 | "picomatch": "^2.0.4" 249 | }, 250 | "engines": { 251 | "node": ">= 8" 252 | } 253 | }, 254 | "node_modules/argparse": { 255 | "version": "2.0.1", 256 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 257 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", 258 | "dev": true 259 | }, 260 | "node_modules/balanced-match": { 261 | "version": "1.0.0", 262 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 263 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 264 | "dev": true 265 | }, 266 | "node_modules/binary-extensions": { 267 | "version": "2.2.0", 268 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 269 | "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", 270 | "dev": true, 271 | "engines": { 272 | "node": ">=8" 273 | } 274 | }, 275 | "node_modules/brace-expansion": { 276 | "version": "1.1.11", 277 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 278 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 279 | "dev": true, 280 | "dependencies": { 281 | "balanced-match": "^1.0.0", 282 | "concat-map": "0.0.1" 283 | } 284 | }, 285 | "node_modules/braces": { 286 | "version": "3.0.3", 287 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", 288 | "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", 289 | "dev": true, 290 | "dependencies": { 291 | "fill-range": "^7.1.1" 292 | }, 293 | "engines": { 294 | "node": ">=8" 295 | } 296 | }, 297 | "node_modules/browser-stdout": { 298 | "version": "1.3.1", 299 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", 300 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", 301 | "dev": true 302 | }, 303 | "node_modules/bson": { 304 | "version": "6.8.0", 305 | "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz", 306 | "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==", 307 | "dev": true, 308 | "engines": { 309 | "node": ">=16.20.1" 310 | } 311 | }, 312 | "node_modules/callsites": { 313 | "version": "3.1.0", 314 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", 315 | "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", 316 | "dev": true, 317 | "engines": { 318 | "node": ">=6" 319 | } 320 | }, 321 | "node_modules/camelcase": { 322 | "version": "6.3.0", 323 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", 324 | "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", 325 | "dev": true, 326 | "engines": { 327 | "node": ">=10" 328 | }, 329 | "funding": { 330 | "url": "https://github.com/sponsors/sindresorhus" 331 | } 332 | }, 333 | "node_modules/chalk": { 334 | "version": "4.1.0", 335 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", 336 | "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", 337 | "dev": true, 338 | "dependencies": { 339 | "ansi-styles": "^4.1.0", 340 | "supports-color": "^7.1.0" 341 | }, 342 | "engines": { 343 | "node": ">=10" 344 | }, 345 | "funding": { 346 | "url": "https://github.com/chalk/chalk?sponsor=1" 347 | } 348 | }, 349 | "node_modules/chalk/node_modules/ansi-styles": { 350 | "version": "4.3.0", 351 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 352 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 353 | "dev": true, 354 | "dependencies": { 355 | "color-convert": "^2.0.1" 356 | }, 357 | "engines": { 358 | "node": ">=8" 359 | }, 360 | "funding": { 361 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 362 | } 363 | }, 364 | "node_modules/chalk/node_modules/color-convert": { 365 | "version": "2.0.1", 366 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 367 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 368 | "dev": true, 369 | "dependencies": { 370 | "color-name": "~1.1.4" 371 | }, 372 | "engines": { 373 | "node": ">=7.0.0" 374 | } 375 | }, 376 | "node_modules/chalk/node_modules/color-name": { 377 | "version": "1.1.4", 378 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 379 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 380 | "dev": true 381 | }, 382 | "node_modules/chalk/node_modules/has-flag": { 383 | "version": "4.0.0", 384 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 385 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 386 | "dev": true, 387 | "engines": { 388 | "node": ">=8" 389 | } 390 | }, 391 | "node_modules/chalk/node_modules/supports-color": { 392 | "version": "7.2.0", 393 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 394 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 395 | "dev": true, 396 | "dependencies": { 397 | "has-flag": "^4.0.0" 398 | }, 399 | "engines": { 400 | "node": ">=8" 401 | } 402 | }, 403 | "node_modules/chokidar": { 404 | "version": "3.5.3", 405 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", 406 | "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", 407 | "dev": true, 408 | "funding": [ 409 | { 410 | "type": "individual", 411 | "url": "https://paulmillr.com/funding/" 412 | } 413 | ], 414 | "dependencies": { 415 | "anymatch": "~3.1.2", 416 | "braces": "~3.0.2", 417 | "glob-parent": "~5.1.2", 418 | "is-binary-path": "~2.1.0", 419 | "is-glob": "~4.0.1", 420 | "normalize-path": "~3.0.0", 421 | "readdirp": "~3.6.0" 422 | }, 423 | "engines": { 424 | "node": ">= 8.10.0" 425 | }, 426 | "optionalDependencies": { 427 | "fsevents": "~2.3.2" 428 | } 429 | }, 430 | "node_modules/chokidar/node_modules/glob-parent": { 431 | "version": "5.1.2", 432 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 433 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 434 | "dev": true, 435 | "dependencies": { 436 | "is-glob": "^4.0.1" 437 | }, 438 | "engines": { 439 | "node": ">= 6" 440 | } 441 | }, 442 | "node_modules/cliui": { 443 | "version": "7.0.4", 444 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", 445 | "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", 446 | "dev": true, 447 | "dependencies": { 448 | "string-width": "^4.2.0", 449 | "strip-ansi": "^6.0.0", 450 | "wrap-ansi": "^7.0.0" 451 | } 452 | }, 453 | "node_modules/color-convert": { 454 | "version": "2.0.1", 455 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 456 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 457 | "dev": true, 458 | "dependencies": { 459 | "color-name": "~1.1.4" 460 | }, 461 | "engines": { 462 | "node": ">=7.0.0" 463 | } 464 | }, 465 | "node_modules/color-name": { 466 | "version": "1.1.4", 467 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 468 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 469 | "dev": true 470 | }, 471 | "node_modules/concat-map": { 472 | "version": "0.0.1", 473 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 474 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 475 | "dev": true 476 | }, 477 | "node_modules/cross-spawn": { 478 | "version": "7.0.3", 479 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", 480 | "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", 481 | "dev": true, 482 | "dependencies": { 483 | "path-key": "^3.1.0", 484 | "shebang-command": "^2.0.0", 485 | "which": "^2.0.1" 486 | }, 487 | "engines": { 488 | "node": ">= 8" 489 | } 490 | }, 491 | "node_modules/debug": { 492 | "version": "4.3.4", 493 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 494 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 495 | "dev": true, 496 | "dependencies": { 497 | "ms": "2.1.2" 498 | }, 499 | "engines": { 500 | "node": ">=6.0" 501 | }, 502 | "peerDependenciesMeta": { 503 | "supports-color": { 504 | "optional": true 505 | } 506 | } 507 | }, 508 | "node_modules/decamelize": { 509 | "version": "4.0.0", 510 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", 511 | "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", 512 | "dev": true, 513 | "engines": { 514 | "node": ">=10" 515 | }, 516 | "funding": { 517 | "url": "https://github.com/sponsors/sindresorhus" 518 | } 519 | }, 520 | "node_modules/deep-is": { 521 | "version": "0.1.4", 522 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", 523 | "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", 524 | "dev": true 525 | }, 526 | "node_modules/diff": { 527 | "version": "5.0.0", 528 | "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", 529 | "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", 530 | "dev": true, 531 | "engines": { 532 | "node": ">=0.3.1" 533 | } 534 | }, 535 | "node_modules/doctrine": { 536 | "version": "3.0.0", 537 | "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", 538 | "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", 539 | "dev": true, 540 | "dependencies": { 541 | "esutils": "^2.0.2" 542 | }, 543 | "engines": { 544 | "node": ">=6.0.0" 545 | } 546 | }, 547 | "node_modules/emoji-regex": { 548 | "version": "8.0.0", 549 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 550 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 551 | "dev": true 552 | }, 553 | "node_modules/escalade": { 554 | "version": "3.1.1", 555 | "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", 556 | "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", 557 | "dev": true, 558 | "engines": { 559 | "node": ">=6" 560 | } 561 | }, 562 | "node_modules/escape-string-regexp": { 563 | "version": "4.0.0", 564 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", 565 | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", 566 | "dev": true, 567 | "engines": { 568 | "node": ">=10" 569 | }, 570 | "funding": { 571 | "url": "https://github.com/sponsors/sindresorhus" 572 | } 573 | }, 574 | "node_modules/eslint": { 575 | "version": "8.38.0", 576 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.38.0.tgz", 577 | "integrity": "sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg==", 578 | "dev": true, 579 | "dependencies": { 580 | "@eslint-community/eslint-utils": "^4.2.0", 581 | "@eslint-community/regexpp": "^4.4.0", 582 | "@eslint/eslintrc": "^2.0.2", 583 | "@eslint/js": "8.38.0", 584 | "@humanwhocodes/config-array": "^0.11.8", 585 | "@humanwhocodes/module-importer": "^1.0.1", 586 | "@nodelib/fs.walk": "^1.2.8", 587 | "ajv": "^6.10.0", 588 | "chalk": "^4.0.0", 589 | "cross-spawn": "^7.0.2", 590 | "debug": "^4.3.2", 591 | "doctrine": "^3.0.0", 592 | "escape-string-regexp": "^4.0.0", 593 | "eslint-scope": "^7.1.1", 594 | "eslint-visitor-keys": "^3.4.0", 595 | "espree": "^9.5.1", 596 | "esquery": "^1.4.2", 597 | "esutils": "^2.0.2", 598 | "fast-deep-equal": "^3.1.3", 599 | "file-entry-cache": "^6.0.1", 600 | "find-up": "^5.0.0", 601 | "glob-parent": "^6.0.2", 602 | "globals": "^13.19.0", 603 | "grapheme-splitter": "^1.0.4", 604 | "ignore": "^5.2.0", 605 | "import-fresh": "^3.0.0", 606 | "imurmurhash": "^0.1.4", 607 | "is-glob": "^4.0.0", 608 | "is-path-inside": "^3.0.3", 609 | "js-sdsl": "^4.1.4", 610 | "js-yaml": "^4.1.0", 611 | "json-stable-stringify-without-jsonify": "^1.0.1", 612 | "levn": "^0.4.1", 613 | "lodash.merge": "^4.6.2", 614 | "minimatch": "^3.1.2", 615 | "natural-compare": "^1.4.0", 616 | "optionator": "^0.9.1", 617 | "strip-ansi": "^6.0.1", 618 | "strip-json-comments": "^3.1.0", 619 | "text-table": "^0.2.0" 620 | }, 621 | "bin": { 622 | "eslint": "bin/eslint.js" 623 | }, 624 | "engines": { 625 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 626 | }, 627 | "funding": { 628 | "url": "https://opencollective.com/eslint" 629 | } 630 | }, 631 | "node_modules/eslint-config-prettier": { 632 | "version": "8.8.0", 633 | "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", 634 | "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", 635 | "dev": true, 636 | "bin": { 637 | "eslint-config-prettier": "bin/cli.js" 638 | }, 639 | "peerDependencies": { 640 | "eslint": ">=7.0.0" 641 | } 642 | }, 643 | "node_modules/eslint-plugin-prettier": { 644 | "version": "4.2.1", 645 | "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", 646 | "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", 647 | "dev": true, 648 | "dependencies": { 649 | "prettier-linter-helpers": "^1.0.0" 650 | }, 651 | "engines": { 652 | "node": ">=12.0.0" 653 | }, 654 | "peerDependencies": { 655 | "eslint": ">=7.28.0", 656 | "prettier": ">=2.0.0" 657 | }, 658 | "peerDependenciesMeta": { 659 | "eslint-config-prettier": { 660 | "optional": true 661 | } 662 | } 663 | }, 664 | "node_modules/eslint-scope": { 665 | "version": "7.2.0", 666 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", 667 | "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", 668 | "dev": true, 669 | "dependencies": { 670 | "esrecurse": "^4.3.0", 671 | "estraverse": "^5.2.0" 672 | }, 673 | "engines": { 674 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 675 | }, 676 | "funding": { 677 | "url": "https://opencollective.com/eslint" 678 | } 679 | }, 680 | "node_modules/eslint-visitor-keys": { 681 | "version": "3.4.0", 682 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz", 683 | "integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==", 684 | "dev": true, 685 | "engines": { 686 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 687 | }, 688 | "funding": { 689 | "url": "https://opencollective.com/eslint" 690 | } 691 | }, 692 | "node_modules/espree": { 693 | "version": "9.5.1", 694 | "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.1.tgz", 695 | "integrity": "sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg==", 696 | "dev": true, 697 | "dependencies": { 698 | "acorn": "^8.8.0", 699 | "acorn-jsx": "^5.3.2", 700 | "eslint-visitor-keys": "^3.4.0" 701 | }, 702 | "engines": { 703 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 704 | }, 705 | "funding": { 706 | "url": "https://opencollective.com/eslint" 707 | } 708 | }, 709 | "node_modules/esquery": { 710 | "version": "1.5.0", 711 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", 712 | "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", 713 | "dev": true, 714 | "dependencies": { 715 | "estraverse": "^5.1.0" 716 | }, 717 | "engines": { 718 | "node": ">=0.10" 719 | } 720 | }, 721 | "node_modules/esrecurse": { 722 | "version": "4.3.0", 723 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", 724 | "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", 725 | "dev": true, 726 | "dependencies": { 727 | "estraverse": "^5.2.0" 728 | }, 729 | "engines": { 730 | "node": ">=4.0" 731 | } 732 | }, 733 | "node_modules/estraverse": { 734 | "version": "5.3.0", 735 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", 736 | "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", 737 | "dev": true, 738 | "engines": { 739 | "node": ">=4.0" 740 | } 741 | }, 742 | "node_modules/esutils": { 743 | "version": "2.0.3", 744 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 745 | "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 746 | "dev": true, 747 | "engines": { 748 | "node": ">=0.10.0" 749 | } 750 | }, 751 | "node_modules/fast-deep-equal": { 752 | "version": "3.1.3", 753 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", 754 | "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", 755 | "dev": true 756 | }, 757 | "node_modules/fast-diff": { 758 | "version": "1.2.0", 759 | "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", 760 | "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", 761 | "dev": true 762 | }, 763 | "node_modules/fast-json-stable-stringify": { 764 | "version": "2.1.0", 765 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 766 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", 767 | "dev": true 768 | }, 769 | "node_modules/fast-levenshtein": { 770 | "version": "2.0.6", 771 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 772 | "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", 773 | "dev": true 774 | }, 775 | "node_modules/fastq": { 776 | "version": "1.15.0", 777 | "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", 778 | "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", 779 | "dev": true, 780 | "dependencies": { 781 | "reusify": "^1.0.4" 782 | } 783 | }, 784 | "node_modules/file-entry-cache": { 785 | "version": "6.0.1", 786 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", 787 | "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", 788 | "dev": true, 789 | "dependencies": { 790 | "flat-cache": "^3.0.4" 791 | }, 792 | "engines": { 793 | "node": "^10.12.0 || >=12.0.0" 794 | } 795 | }, 796 | "node_modules/fill-range": { 797 | "version": "7.1.1", 798 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", 799 | "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", 800 | "dev": true, 801 | "dependencies": { 802 | "to-regex-range": "^5.0.1" 803 | }, 804 | "engines": { 805 | "node": ">=8" 806 | } 807 | }, 808 | "node_modules/find-up": { 809 | "version": "5.0.0", 810 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", 811 | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", 812 | "dev": true, 813 | "dependencies": { 814 | "locate-path": "^6.0.0", 815 | "path-exists": "^4.0.0" 816 | }, 817 | "engines": { 818 | "node": ">=10" 819 | }, 820 | "funding": { 821 | "url": "https://github.com/sponsors/sindresorhus" 822 | } 823 | }, 824 | "node_modules/flat": { 825 | "version": "5.0.2", 826 | "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", 827 | "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", 828 | "dev": true, 829 | "bin": { 830 | "flat": "cli.js" 831 | } 832 | }, 833 | "node_modules/flat-cache": { 834 | "version": "3.0.4", 835 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", 836 | "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", 837 | "dev": true, 838 | "dependencies": { 839 | "flatted": "^3.1.0", 840 | "rimraf": "^3.0.2" 841 | }, 842 | "engines": { 843 | "node": "^10.12.0 || >=12.0.0" 844 | } 845 | }, 846 | "node_modules/flatted": { 847 | "version": "3.2.7", 848 | "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", 849 | "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", 850 | "dev": true 851 | }, 852 | "node_modules/fs.realpath": { 853 | "version": "1.0.0", 854 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 855 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 856 | "dev": true 857 | }, 858 | "node_modules/fsevents": { 859 | "version": "2.3.2", 860 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 861 | "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 862 | "dev": true, 863 | "hasInstallScript": true, 864 | "optional": true, 865 | "os": [ 866 | "darwin" 867 | ], 868 | "engines": { 869 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 870 | } 871 | }, 872 | "node_modules/get-caller-file": { 873 | "version": "2.0.5", 874 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 875 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", 876 | "dev": true, 877 | "engines": { 878 | "node": "6.* || 8.* || >= 10.*" 879 | } 880 | }, 881 | "node_modules/glob": { 882 | "version": "7.2.3", 883 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", 884 | "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", 885 | "dev": true, 886 | "dependencies": { 887 | "fs.realpath": "^1.0.0", 888 | "inflight": "^1.0.4", 889 | "inherits": "2", 890 | "minimatch": "^3.1.1", 891 | "once": "^1.3.0", 892 | "path-is-absolute": "^1.0.0" 893 | }, 894 | "engines": { 895 | "node": "*" 896 | }, 897 | "funding": { 898 | "url": "https://github.com/sponsors/isaacs" 899 | } 900 | }, 901 | "node_modules/glob-parent": { 902 | "version": "6.0.2", 903 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", 904 | "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", 905 | "dev": true, 906 | "dependencies": { 907 | "is-glob": "^4.0.3" 908 | }, 909 | "engines": { 910 | "node": ">=10.13.0" 911 | } 912 | }, 913 | "node_modules/globals": { 914 | "version": "13.20.0", 915 | "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", 916 | "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", 917 | "dev": true, 918 | "dependencies": { 919 | "type-fest": "^0.20.2" 920 | }, 921 | "engines": { 922 | "node": ">=8" 923 | }, 924 | "funding": { 925 | "url": "https://github.com/sponsors/sindresorhus" 926 | } 927 | }, 928 | "node_modules/grapheme-splitter": { 929 | "version": "1.0.4", 930 | "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", 931 | "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", 932 | "dev": true 933 | }, 934 | "node_modules/has-flag": { 935 | "version": "4.0.0", 936 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 937 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 938 | "dev": true, 939 | "engines": { 940 | "node": ">=8" 941 | } 942 | }, 943 | "node_modules/he": { 944 | "version": "1.2.0", 945 | "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", 946 | "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", 947 | "dev": true, 948 | "bin": { 949 | "he": "bin/he" 950 | } 951 | }, 952 | "node_modules/ignore": { 953 | "version": "5.2.4", 954 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", 955 | "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", 956 | "dev": true, 957 | "engines": { 958 | "node": ">= 4" 959 | } 960 | }, 961 | "node_modules/import-fresh": { 962 | "version": "3.3.0", 963 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", 964 | "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", 965 | "dev": true, 966 | "dependencies": { 967 | "parent-module": "^1.0.0", 968 | "resolve-from": "^4.0.0" 969 | }, 970 | "engines": { 971 | "node": ">=6" 972 | }, 973 | "funding": { 974 | "url": "https://github.com/sponsors/sindresorhus" 975 | } 976 | }, 977 | "node_modules/imurmurhash": { 978 | "version": "0.1.4", 979 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 980 | "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", 981 | "dev": true, 982 | "engines": { 983 | "node": ">=0.8.19" 984 | } 985 | }, 986 | "node_modules/inflight": { 987 | "version": "1.0.6", 988 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 989 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 990 | "dev": true, 991 | "dependencies": { 992 | "once": "^1.3.0", 993 | "wrappy": "1" 994 | } 995 | }, 996 | "node_modules/inherits": { 997 | "version": "2.0.4", 998 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 999 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 1000 | "dev": true 1001 | }, 1002 | "node_modules/is-binary-path": { 1003 | "version": "2.1.0", 1004 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 1005 | "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 1006 | "dev": true, 1007 | "dependencies": { 1008 | "binary-extensions": "^2.0.0" 1009 | }, 1010 | "engines": { 1011 | "node": ">=8" 1012 | } 1013 | }, 1014 | "node_modules/is-extglob": { 1015 | "version": "2.1.1", 1016 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 1017 | "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", 1018 | "dev": true, 1019 | "engines": { 1020 | "node": ">=0.10.0" 1021 | } 1022 | }, 1023 | "node_modules/is-fullwidth-code-point": { 1024 | "version": "3.0.0", 1025 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 1026 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", 1027 | "dev": true, 1028 | "engines": { 1029 | "node": ">=8" 1030 | } 1031 | }, 1032 | "node_modules/is-glob": { 1033 | "version": "4.0.3", 1034 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 1035 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 1036 | "dev": true, 1037 | "dependencies": { 1038 | "is-extglob": "^2.1.1" 1039 | }, 1040 | "engines": { 1041 | "node": ">=0.10.0" 1042 | } 1043 | }, 1044 | "node_modules/is-number": { 1045 | "version": "7.0.0", 1046 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 1047 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 1048 | "dev": true, 1049 | "engines": { 1050 | "node": ">=0.12.0" 1051 | } 1052 | }, 1053 | "node_modules/is-path-inside": { 1054 | "version": "3.0.3", 1055 | "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", 1056 | "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", 1057 | "dev": true, 1058 | "engines": { 1059 | "node": ">=8" 1060 | } 1061 | }, 1062 | "node_modules/is-plain-obj": { 1063 | "version": "2.1.0", 1064 | "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", 1065 | "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", 1066 | "dev": true, 1067 | "engines": { 1068 | "node": ">=8" 1069 | } 1070 | }, 1071 | "node_modules/is-unicode-supported": { 1072 | "version": "0.1.0", 1073 | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", 1074 | "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", 1075 | "dev": true, 1076 | "engines": { 1077 | "node": ">=10" 1078 | }, 1079 | "funding": { 1080 | "url": "https://github.com/sponsors/sindresorhus" 1081 | } 1082 | }, 1083 | "node_modules/isexe": { 1084 | "version": "2.0.0", 1085 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 1086 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 1087 | "dev": true 1088 | }, 1089 | "node_modules/js-sdsl": { 1090 | "version": "4.4.0", 1091 | "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", 1092 | "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", 1093 | "dev": true, 1094 | "funding": { 1095 | "type": "opencollective", 1096 | "url": "https://opencollective.com/js-sdsl" 1097 | } 1098 | }, 1099 | "node_modules/js-yaml": { 1100 | "version": "4.1.0", 1101 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 1102 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 1103 | "dev": true, 1104 | "dependencies": { 1105 | "argparse": "^2.0.1" 1106 | }, 1107 | "bin": { 1108 | "js-yaml": "bin/js-yaml.js" 1109 | } 1110 | }, 1111 | "node_modules/json-schema-traverse": { 1112 | "version": "0.4.1", 1113 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 1114 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 1115 | "dev": true 1116 | }, 1117 | "node_modules/json-stable-stringify-without-jsonify": { 1118 | "version": "1.0.1", 1119 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 1120 | "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", 1121 | "dev": true 1122 | }, 1123 | "node_modules/levn": { 1124 | "version": "0.4.1", 1125 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", 1126 | "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", 1127 | "dev": true, 1128 | "dependencies": { 1129 | "prelude-ls": "^1.2.1", 1130 | "type-check": "~0.4.0" 1131 | }, 1132 | "engines": { 1133 | "node": ">= 0.8.0" 1134 | } 1135 | }, 1136 | "node_modules/locate-path": { 1137 | "version": "6.0.0", 1138 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", 1139 | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", 1140 | "dev": true, 1141 | "dependencies": { 1142 | "p-locate": "^5.0.0" 1143 | }, 1144 | "engines": { 1145 | "node": ">=10" 1146 | }, 1147 | "funding": { 1148 | "url": "https://github.com/sponsors/sindresorhus" 1149 | } 1150 | }, 1151 | "node_modules/lodash.merge": { 1152 | "version": "4.6.2", 1153 | "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", 1154 | "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", 1155 | "dev": true 1156 | }, 1157 | "node_modules/log-symbols": { 1158 | "version": "4.1.0", 1159 | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", 1160 | "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", 1161 | "dev": true, 1162 | "dependencies": { 1163 | "chalk": "^4.1.0", 1164 | "is-unicode-supported": "^0.1.0" 1165 | }, 1166 | "engines": { 1167 | "node": ">=10" 1168 | }, 1169 | "funding": { 1170 | "url": "https://github.com/sponsors/sindresorhus" 1171 | } 1172 | }, 1173 | "node_modules/memory-pager": { 1174 | "version": "1.5.0", 1175 | "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", 1176 | "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", 1177 | "dev": true 1178 | }, 1179 | "node_modules/minimatch": { 1180 | "version": "3.1.2", 1181 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 1182 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 1183 | "dev": true, 1184 | "dependencies": { 1185 | "brace-expansion": "^1.1.7" 1186 | }, 1187 | "engines": { 1188 | "node": "*" 1189 | } 1190 | }, 1191 | "node_modules/mocha": { 1192 | "version": "10.2.0", 1193 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", 1194 | "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", 1195 | "dev": true, 1196 | "dependencies": { 1197 | "ansi-colors": "4.1.1", 1198 | "browser-stdout": "1.3.1", 1199 | "chokidar": "3.5.3", 1200 | "debug": "4.3.4", 1201 | "diff": "5.0.0", 1202 | "escape-string-regexp": "4.0.0", 1203 | "find-up": "5.0.0", 1204 | "glob": "7.2.0", 1205 | "he": "1.2.0", 1206 | "js-yaml": "4.1.0", 1207 | "log-symbols": "4.1.0", 1208 | "minimatch": "5.0.1", 1209 | "ms": "2.1.3", 1210 | "nanoid": "3.3.3", 1211 | "serialize-javascript": "6.0.0", 1212 | "strip-json-comments": "3.1.1", 1213 | "supports-color": "8.1.1", 1214 | "workerpool": "6.2.1", 1215 | "yargs": "16.2.0", 1216 | "yargs-parser": "20.2.4", 1217 | "yargs-unparser": "2.0.0" 1218 | }, 1219 | "bin": { 1220 | "_mocha": "bin/_mocha", 1221 | "mocha": "bin/mocha.js" 1222 | }, 1223 | "engines": { 1224 | "node": ">= 14.0.0" 1225 | }, 1226 | "funding": { 1227 | "type": "opencollective", 1228 | "url": "https://opencollective.com/mochajs" 1229 | } 1230 | }, 1231 | "node_modules/mocha/node_modules/glob": { 1232 | "version": "7.2.0", 1233 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", 1234 | "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", 1235 | "dev": true, 1236 | "dependencies": { 1237 | "fs.realpath": "^1.0.0", 1238 | "inflight": "^1.0.4", 1239 | "inherits": "2", 1240 | "minimatch": "^3.0.4", 1241 | "once": "^1.3.0", 1242 | "path-is-absolute": "^1.0.0" 1243 | }, 1244 | "engines": { 1245 | "node": "*" 1246 | }, 1247 | "funding": { 1248 | "url": "https://github.com/sponsors/isaacs" 1249 | } 1250 | }, 1251 | "node_modules/mocha/node_modules/glob/node_modules/minimatch": { 1252 | "version": "3.1.2", 1253 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 1254 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 1255 | "dev": true, 1256 | "dependencies": { 1257 | "brace-expansion": "^1.1.7" 1258 | }, 1259 | "engines": { 1260 | "node": "*" 1261 | } 1262 | }, 1263 | "node_modules/mocha/node_modules/minimatch": { 1264 | "version": "5.0.1", 1265 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", 1266 | "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", 1267 | "dev": true, 1268 | "dependencies": { 1269 | "brace-expansion": "^2.0.1" 1270 | }, 1271 | "engines": { 1272 | "node": ">=10" 1273 | } 1274 | }, 1275 | "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { 1276 | "version": "2.0.1", 1277 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 1278 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 1279 | "dev": true, 1280 | "dependencies": { 1281 | "balanced-match": "^1.0.0" 1282 | } 1283 | }, 1284 | "node_modules/mocha/node_modules/ms": { 1285 | "version": "2.1.3", 1286 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 1287 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 1288 | "dev": true 1289 | }, 1290 | "node_modules/mongodb": { 1291 | "version": "6.9.0", 1292 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.9.0.tgz", 1293 | "integrity": "sha512-UMopBVx1LmEUbW/QE0Hw18u583PEDVQmUmVzzBRH0o/xtE9DBRA5ZYLOjpLIa03i8FXjzvQECJcqoMvCXftTUA==", 1294 | "dev": true, 1295 | "dependencies": { 1296 | "@mongodb-js/saslprep": "^1.1.5", 1297 | "bson": "^6.7.0", 1298 | "mongodb-connection-string-url": "^3.0.0" 1299 | }, 1300 | "engines": { 1301 | "node": ">=16.20.1" 1302 | }, 1303 | "peerDependencies": { 1304 | "@aws-sdk/credential-providers": "^3.188.0", 1305 | "@mongodb-js/zstd": "^1.1.0", 1306 | "gcp-metadata": "^5.2.0", 1307 | "kerberos": "^2.0.1", 1308 | "mongodb-client-encryption": ">=6.0.0 <7", 1309 | "snappy": "^7.2.2", 1310 | "socks": "^2.7.1" 1311 | }, 1312 | "peerDependenciesMeta": { 1313 | "@aws-sdk/credential-providers": { 1314 | "optional": true 1315 | }, 1316 | "@mongodb-js/zstd": { 1317 | "optional": true 1318 | }, 1319 | "gcp-metadata": { 1320 | "optional": true 1321 | }, 1322 | "kerberos": { 1323 | "optional": true 1324 | }, 1325 | "mongodb-client-encryption": { 1326 | "optional": true 1327 | }, 1328 | "snappy": { 1329 | "optional": true 1330 | }, 1331 | "socks": { 1332 | "optional": true 1333 | } 1334 | } 1335 | }, 1336 | "node_modules/mongodb-connection-string-url": { 1337 | "version": "3.0.1", 1338 | "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", 1339 | "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", 1340 | "dev": true, 1341 | "dependencies": { 1342 | "@types/whatwg-url": "^11.0.2", 1343 | "whatwg-url": "^13.0.0" 1344 | } 1345 | }, 1346 | "node_modules/ms": { 1347 | "version": "2.1.2", 1348 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 1349 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 1350 | "dev": true 1351 | }, 1352 | "node_modules/nanoid": { 1353 | "version": "3.3.3", 1354 | "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", 1355 | "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", 1356 | "dev": true, 1357 | "bin": { 1358 | "nanoid": "bin/nanoid.cjs" 1359 | }, 1360 | "engines": { 1361 | "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" 1362 | } 1363 | }, 1364 | "node_modules/natural-compare": { 1365 | "version": "1.4.0", 1366 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 1367 | "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", 1368 | "dev": true 1369 | }, 1370 | "node_modules/normalize-path": { 1371 | "version": "3.0.0", 1372 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 1373 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", 1374 | "dev": true, 1375 | "engines": { 1376 | "node": ">=0.10.0" 1377 | } 1378 | }, 1379 | "node_modules/once": { 1380 | "version": "1.4.0", 1381 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1382 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1383 | "dev": true, 1384 | "dependencies": { 1385 | "wrappy": "1" 1386 | } 1387 | }, 1388 | "node_modules/optionator": { 1389 | "version": "0.9.1", 1390 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", 1391 | "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", 1392 | "dev": true, 1393 | "dependencies": { 1394 | "deep-is": "^0.1.3", 1395 | "fast-levenshtein": "^2.0.6", 1396 | "levn": "^0.4.1", 1397 | "prelude-ls": "^1.2.1", 1398 | "type-check": "^0.4.0", 1399 | "word-wrap": "^1.2.3" 1400 | }, 1401 | "engines": { 1402 | "node": ">= 0.8.0" 1403 | } 1404 | }, 1405 | "node_modules/p-limit": { 1406 | "version": "3.1.0", 1407 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", 1408 | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", 1409 | "dev": true, 1410 | "dependencies": { 1411 | "yocto-queue": "^0.1.0" 1412 | }, 1413 | "engines": { 1414 | "node": ">=10" 1415 | }, 1416 | "funding": { 1417 | "url": "https://github.com/sponsors/sindresorhus" 1418 | } 1419 | }, 1420 | "node_modules/p-locate": { 1421 | "version": "5.0.0", 1422 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", 1423 | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", 1424 | "dev": true, 1425 | "dependencies": { 1426 | "p-limit": "^3.0.2" 1427 | }, 1428 | "engines": { 1429 | "node": ">=10" 1430 | }, 1431 | "funding": { 1432 | "url": "https://github.com/sponsors/sindresorhus" 1433 | } 1434 | }, 1435 | "node_modules/parent-module": { 1436 | "version": "1.0.1", 1437 | "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", 1438 | "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", 1439 | "dev": true, 1440 | "dependencies": { 1441 | "callsites": "^3.0.0" 1442 | }, 1443 | "engines": { 1444 | "node": ">=6" 1445 | } 1446 | }, 1447 | "node_modules/path-exists": { 1448 | "version": "4.0.0", 1449 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 1450 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 1451 | "dev": true, 1452 | "engines": { 1453 | "node": ">=8" 1454 | } 1455 | }, 1456 | "node_modules/path-is-absolute": { 1457 | "version": "1.0.1", 1458 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1459 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 1460 | "dev": true, 1461 | "engines": { 1462 | "node": ">=0.10.0" 1463 | } 1464 | }, 1465 | "node_modules/path-key": { 1466 | "version": "3.1.1", 1467 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 1468 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 1469 | "dev": true, 1470 | "engines": { 1471 | "node": ">=8" 1472 | } 1473 | }, 1474 | "node_modules/picomatch": { 1475 | "version": "2.3.1", 1476 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 1477 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 1478 | "dev": true, 1479 | "engines": { 1480 | "node": ">=8.6" 1481 | }, 1482 | "funding": { 1483 | "url": "https://github.com/sponsors/jonschlinkert" 1484 | } 1485 | }, 1486 | "node_modules/prelude-ls": { 1487 | "version": "1.2.1", 1488 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", 1489 | "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", 1490 | "dev": true, 1491 | "engines": { 1492 | "node": ">= 0.8.0" 1493 | } 1494 | }, 1495 | "node_modules/prettier": { 1496 | "version": "3.3.3", 1497 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", 1498 | "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", 1499 | "dev": true, 1500 | "bin": { 1501 | "prettier": "bin/prettier.cjs" 1502 | }, 1503 | "engines": { 1504 | "node": ">=14" 1505 | }, 1506 | "funding": { 1507 | "url": "https://github.com/prettier/prettier?sponsor=1" 1508 | } 1509 | }, 1510 | "node_modules/prettier-linter-helpers": { 1511 | "version": "1.0.0", 1512 | "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", 1513 | "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", 1514 | "dev": true, 1515 | "dependencies": { 1516 | "fast-diff": "^1.1.2" 1517 | }, 1518 | "engines": { 1519 | "node": ">=6.0.0" 1520 | } 1521 | }, 1522 | "node_modules/punycode": { 1523 | "version": "2.3.0", 1524 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", 1525 | "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", 1526 | "dev": true, 1527 | "engines": { 1528 | "node": ">=6" 1529 | } 1530 | }, 1531 | "node_modules/queue-microtask": { 1532 | "version": "1.2.3", 1533 | "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", 1534 | "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", 1535 | "dev": true, 1536 | "funding": [ 1537 | { 1538 | "type": "github", 1539 | "url": "https://github.com/sponsors/feross" 1540 | }, 1541 | { 1542 | "type": "patreon", 1543 | "url": "https://www.patreon.com/feross" 1544 | }, 1545 | { 1546 | "type": "consulting", 1547 | "url": "https://feross.org/support" 1548 | } 1549 | ] 1550 | }, 1551 | "node_modules/randombytes": { 1552 | "version": "2.1.0", 1553 | "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", 1554 | "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", 1555 | "dev": true, 1556 | "dependencies": { 1557 | "safe-buffer": "^5.1.0" 1558 | } 1559 | }, 1560 | "node_modules/readdirp": { 1561 | "version": "3.6.0", 1562 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 1563 | "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 1564 | "dev": true, 1565 | "dependencies": { 1566 | "picomatch": "^2.2.1" 1567 | }, 1568 | "engines": { 1569 | "node": ">=8.10.0" 1570 | } 1571 | }, 1572 | "node_modules/require-directory": { 1573 | "version": "2.1.1", 1574 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 1575 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", 1576 | "dev": true, 1577 | "engines": { 1578 | "node": ">=0.10.0" 1579 | } 1580 | }, 1581 | "node_modules/resolve-from": { 1582 | "version": "4.0.0", 1583 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", 1584 | "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", 1585 | "dev": true, 1586 | "engines": { 1587 | "node": ">=4" 1588 | } 1589 | }, 1590 | "node_modules/reusify": { 1591 | "version": "1.0.4", 1592 | "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", 1593 | "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", 1594 | "dev": true, 1595 | "engines": { 1596 | "iojs": ">=1.0.0", 1597 | "node": ">=0.10.0" 1598 | } 1599 | }, 1600 | "node_modules/rimraf": { 1601 | "version": "3.0.2", 1602 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 1603 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 1604 | "dev": true, 1605 | "dependencies": { 1606 | "glob": "^7.1.3" 1607 | }, 1608 | "bin": { 1609 | "rimraf": "bin.js" 1610 | }, 1611 | "funding": { 1612 | "url": "https://github.com/sponsors/isaacs" 1613 | } 1614 | }, 1615 | "node_modules/run-parallel": { 1616 | "version": "1.2.0", 1617 | "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", 1618 | "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", 1619 | "dev": true, 1620 | "funding": [ 1621 | { 1622 | "type": "github", 1623 | "url": "https://github.com/sponsors/feross" 1624 | }, 1625 | { 1626 | "type": "patreon", 1627 | "url": "https://www.patreon.com/feross" 1628 | }, 1629 | { 1630 | "type": "consulting", 1631 | "url": "https://feross.org/support" 1632 | } 1633 | ], 1634 | "dependencies": { 1635 | "queue-microtask": "^1.2.2" 1636 | } 1637 | }, 1638 | "node_modules/safe-buffer": { 1639 | "version": "5.2.1", 1640 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 1641 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 1642 | "dev": true, 1643 | "funding": [ 1644 | { 1645 | "type": "github", 1646 | "url": "https://github.com/sponsors/feross" 1647 | }, 1648 | { 1649 | "type": "patreon", 1650 | "url": "https://www.patreon.com/feross" 1651 | }, 1652 | { 1653 | "type": "consulting", 1654 | "url": "https://feross.org/support" 1655 | } 1656 | ] 1657 | }, 1658 | "node_modules/serialize-javascript": { 1659 | "version": "6.0.0", 1660 | "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", 1661 | "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", 1662 | "dev": true, 1663 | "dependencies": { 1664 | "randombytes": "^2.1.0" 1665 | } 1666 | }, 1667 | "node_modules/shebang-command": { 1668 | "version": "2.0.0", 1669 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 1670 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 1671 | "dev": true, 1672 | "dependencies": { 1673 | "shebang-regex": "^3.0.0" 1674 | }, 1675 | "engines": { 1676 | "node": ">=8" 1677 | } 1678 | }, 1679 | "node_modules/shebang-regex": { 1680 | "version": "3.0.0", 1681 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 1682 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 1683 | "dev": true, 1684 | "engines": { 1685 | "node": ">=8" 1686 | } 1687 | }, 1688 | "node_modules/sparse-bitfield": { 1689 | "version": "3.0.3", 1690 | "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", 1691 | "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", 1692 | "dev": true, 1693 | "dependencies": { 1694 | "memory-pager": "^1.0.2" 1695 | } 1696 | }, 1697 | "node_modules/string-width": { 1698 | "version": "4.2.3", 1699 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 1700 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 1701 | "dev": true, 1702 | "dependencies": { 1703 | "emoji-regex": "^8.0.0", 1704 | "is-fullwidth-code-point": "^3.0.0", 1705 | "strip-ansi": "^6.0.1" 1706 | }, 1707 | "engines": { 1708 | "node": ">=8" 1709 | } 1710 | }, 1711 | "node_modules/strip-ansi": { 1712 | "version": "6.0.1", 1713 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 1714 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 1715 | "dev": true, 1716 | "dependencies": { 1717 | "ansi-regex": "^5.0.1" 1718 | }, 1719 | "engines": { 1720 | "node": ">=8" 1721 | } 1722 | }, 1723 | "node_modules/strip-json-comments": { 1724 | "version": "3.1.1", 1725 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", 1726 | "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", 1727 | "dev": true, 1728 | "engines": { 1729 | "node": ">=8" 1730 | }, 1731 | "funding": { 1732 | "url": "https://github.com/sponsors/sindresorhus" 1733 | } 1734 | }, 1735 | "node_modules/supports-color": { 1736 | "version": "8.1.1", 1737 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", 1738 | "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", 1739 | "dev": true, 1740 | "dependencies": { 1741 | "has-flag": "^4.0.0" 1742 | }, 1743 | "engines": { 1744 | "node": ">=10" 1745 | }, 1746 | "funding": { 1747 | "url": "https://github.com/chalk/supports-color?sponsor=1" 1748 | } 1749 | }, 1750 | "node_modules/text-table": { 1751 | "version": "0.2.0", 1752 | "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", 1753 | "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", 1754 | "dev": true 1755 | }, 1756 | "node_modules/to-regex-range": { 1757 | "version": "5.0.1", 1758 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 1759 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 1760 | "dev": true, 1761 | "dependencies": { 1762 | "is-number": "^7.0.0" 1763 | }, 1764 | "engines": { 1765 | "node": ">=8.0" 1766 | } 1767 | }, 1768 | "node_modules/tr46": { 1769 | "version": "4.1.1", 1770 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", 1771 | "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", 1772 | "dev": true, 1773 | "dependencies": { 1774 | "punycode": "^2.3.0" 1775 | }, 1776 | "engines": { 1777 | "node": ">=14" 1778 | } 1779 | }, 1780 | "node_modules/type-check": { 1781 | "version": "0.4.0", 1782 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", 1783 | "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", 1784 | "dev": true, 1785 | "dependencies": { 1786 | "prelude-ls": "^1.2.1" 1787 | }, 1788 | "engines": { 1789 | "node": ">= 0.8.0" 1790 | } 1791 | }, 1792 | "node_modules/type-fest": { 1793 | "version": "0.20.2", 1794 | "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", 1795 | "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", 1796 | "dev": true, 1797 | "engines": { 1798 | "node": ">=10" 1799 | }, 1800 | "funding": { 1801 | "url": "https://github.com/sponsors/sindresorhus" 1802 | } 1803 | }, 1804 | "node_modules/uri-js": { 1805 | "version": "4.4.1", 1806 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", 1807 | "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", 1808 | "dev": true, 1809 | "dependencies": { 1810 | "punycode": "^2.1.0" 1811 | } 1812 | }, 1813 | "node_modules/uuid": { 1814 | "version": "10.0.0", 1815 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", 1816 | "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", 1817 | "funding": [ 1818 | "https://github.com/sponsors/broofa", 1819 | "https://github.com/sponsors/ctavan" 1820 | ], 1821 | "bin": { 1822 | "uuid": "dist/bin/uuid" 1823 | } 1824 | }, 1825 | "node_modules/webidl-conversions": { 1826 | "version": "7.0.0", 1827 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", 1828 | "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", 1829 | "dev": true, 1830 | "engines": { 1831 | "node": ">=12" 1832 | } 1833 | }, 1834 | "node_modules/whatwg-url": { 1835 | "version": "13.0.0", 1836 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", 1837 | "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", 1838 | "dev": true, 1839 | "dependencies": { 1840 | "tr46": "^4.1.1", 1841 | "webidl-conversions": "^7.0.0" 1842 | }, 1843 | "engines": { 1844 | "node": ">=16" 1845 | } 1846 | }, 1847 | "node_modules/which": { 1848 | "version": "2.0.2", 1849 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 1850 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 1851 | "dev": true, 1852 | "dependencies": { 1853 | "isexe": "^2.0.0" 1854 | }, 1855 | "bin": { 1856 | "node-which": "bin/node-which" 1857 | }, 1858 | "engines": { 1859 | "node": ">= 8" 1860 | } 1861 | }, 1862 | "node_modules/word-wrap": { 1863 | "version": "1.2.4", 1864 | "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", 1865 | "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", 1866 | "dev": true, 1867 | "engines": { 1868 | "node": ">=0.10.0" 1869 | } 1870 | }, 1871 | "node_modules/workerpool": { 1872 | "version": "6.2.1", 1873 | "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", 1874 | "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", 1875 | "dev": true 1876 | }, 1877 | "node_modules/wrap-ansi": { 1878 | "version": "7.0.0", 1879 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 1880 | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 1881 | "dev": true, 1882 | "dependencies": { 1883 | "ansi-styles": "^4.0.0", 1884 | "string-width": "^4.1.0", 1885 | "strip-ansi": "^6.0.0" 1886 | }, 1887 | "engines": { 1888 | "node": ">=10" 1889 | }, 1890 | "funding": { 1891 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 1892 | } 1893 | }, 1894 | "node_modules/wrappy": { 1895 | "version": "1.0.2", 1896 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1897 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 1898 | "dev": true 1899 | }, 1900 | "node_modules/y18n": { 1901 | "version": "5.0.8", 1902 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", 1903 | "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", 1904 | "dev": true, 1905 | "engines": { 1906 | "node": ">=10" 1907 | } 1908 | }, 1909 | "node_modules/yargs": { 1910 | "version": "16.2.0", 1911 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", 1912 | "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", 1913 | "dev": true, 1914 | "dependencies": { 1915 | "cliui": "^7.0.2", 1916 | "escalade": "^3.1.1", 1917 | "get-caller-file": "^2.0.5", 1918 | "require-directory": "^2.1.1", 1919 | "string-width": "^4.2.0", 1920 | "y18n": "^5.0.5", 1921 | "yargs-parser": "^20.2.2" 1922 | }, 1923 | "engines": { 1924 | "node": ">=10" 1925 | } 1926 | }, 1927 | "node_modules/yargs-parser": { 1928 | "version": "20.2.4", 1929 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", 1930 | "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", 1931 | "dev": true, 1932 | "engines": { 1933 | "node": ">=10" 1934 | } 1935 | }, 1936 | "node_modules/yargs-unparser": { 1937 | "version": "2.0.0", 1938 | "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", 1939 | "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", 1940 | "dev": true, 1941 | "dependencies": { 1942 | "camelcase": "^6.0.0", 1943 | "decamelize": "^4.0.0", 1944 | "flat": "^5.0.2", 1945 | "is-plain-obj": "^2.1.0" 1946 | }, 1947 | "engines": { 1948 | "node": ">=10" 1949 | } 1950 | }, 1951 | "node_modules/yocto-queue": { 1952 | "version": "0.1.0", 1953 | "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", 1954 | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", 1955 | "dev": true, 1956 | "engines": { 1957 | "node": ">=10" 1958 | }, 1959 | "funding": { 1960 | "url": "https://github.com/sponsors/sindresorhus" 1961 | } 1962 | } 1963 | } 1964 | } 1965 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "uuid-mongodb", 3 | "version": "2.6.0", 4 | "description": "Generates and parses MongoDB BSON UUIDs. Plays nicely with others including the MongoDB native driver and Mongoose.", 5 | "main": "lib/index.js", 6 | "types": "./lib/index.d.ts", 7 | "scripts": { 8 | "test": "mocha test/**/*.js ", 9 | "lint": "eslint lib/**/*.js", 10 | "lint:fix": "eslint --fix lib/**/*.js" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/cdimascio/uuid-mongodb.git" 15 | }, 16 | "keywords": [ 17 | "uuid", 18 | "mongodb" 19 | ], 20 | "author": "Carmine DiMascio ", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/cdimascio/uuid-mongodb/issues" 24 | }, 25 | "homepage": "https://github.com/cdimascio/uuid-mongodb#readme", 26 | "devDependencies": { 27 | "eslint": "8.38.0", 28 | "eslint-config-prettier": "^8.8.0", 29 | "eslint-plugin-prettier": "^4.2.1", 30 | "mocha": "^10.2.0", 31 | "mongodb": "^6.9.0", 32 | "prettier": "^3.3.3" 33 | }, 34 | "dependencies": { 35 | "uuid": "^10.0.0" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test/uuid-mongodb_spec.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const { v1: uuidv1 } = require('uuid'); 3 | const { v4: uuidv4 } = require('uuid'); 4 | const { Binary } = require('mongodb'); 5 | const MUUID = require('../lib'); 6 | 7 | const hasHexUpperCase = (s) => !!/[A-F]/.exec(s); 8 | 9 | // accept and generate uuids according to spec - (see https://www.itu.int/rec/T-REC-X.667-201210-I/en) 10 | describe('MUUID', function () { 11 | describe('v1()', () => { 12 | it('should generate a valid v1 uuid', function () { 13 | const mUUID = MUUID.v1(); 14 | assert.equal(validate(mUUID.toString()), true); 15 | // ensure generated uuids are always lowercase 16 | // as per spec - (see https://www.itu.int/rec/T-REC-X.667-201210-I/en) 17 | assert.equal(hasHexUpperCase(mUUID.toString()), false); 18 | }); 19 | }); 20 | 21 | describe('v4()', () => { 22 | it('should generate a validate v4 uuid', function () { 23 | const mUUID = MUUID.v4(); 24 | assert.equal(validate(mUUID.toString()), true); 25 | // ensure generated uuids are always lowercase 26 | // as per spec - (see https://www.itu.int/rec/T-REC-X.667-201210-I/en) 27 | assert.equal(hasHexUpperCase(mUUID.toString()), false); 28 | }); 29 | }); 30 | 31 | describe('from(uuid)', () => { 32 | it('should convert uuid from string', () => { 33 | const mUUID = MUUID.from(uuidv4()); 34 | assert.equal(validate(mUUID.toString()), true); 35 | }); 36 | 37 | it("should accept uuid's with capital letters, but return with lowercase", () => { 38 | const mUUID = MUUID.from(uuidv4().toUpperCase()); 39 | assert.equal(hasHexUpperCase(mUUID.toString()), false); 40 | assert.equal(validate(mUUID.toString()), true); 41 | }); 42 | 43 | it('should convert uuid from string', () => { 44 | const mUUID = MUUID.from(uuidv4()); 45 | assert.equal(validate(mUUID.toString()), true); 46 | }); 47 | 48 | it('should throw when converting an invalid uuid', () => { 49 | assert.throws(() => MUUID.from('invalid-uuid'), /Invalid UUID\.$/); 50 | assert.throws( 51 | () => MUUID.from('802ac0f09b7311e89bb69baebe1aa0bf'), 52 | /Invalid UUID\.$/ 53 | ); 54 | }); 55 | 56 | it('should convert uuid from mongo BSON binary', () => { 57 | const mUUID = MUUID.from( 58 | new Binary(uuidv1(null, Buffer.alloc(16)), Binary.SUBTYPE_UUID) 59 | ); 60 | assert.equal(mUUID instanceof Binary, true); 61 | assert.equal(validate(mUUID.toString()), true); 62 | }); 63 | 64 | it('should throw when attempting to store 36 byte string representation as UUID', () => { 65 | const binary = new Binary(Buffer.from(uuidv1()), Binary.SUBTYPE_UUID); 66 | assert.throws(() => MUUID.from(binary), /Invalid UUID\.$/); 67 | }); 68 | 69 | it('should throw when converting an Binary non SUBTYPE_UUID', () => { 70 | const binary = new Binary( 71 | uuidv1(null, Buffer.alloc(16)), 72 | Binary.SUBTYPE_USER_DEFINED 73 | ); 74 | assert.throws( 75 | () => MUUID.from(binary), 76 | /Unexpected UUID type\. UUID must be a string or a MongoDB Binary \(SUBTYPE_UUID\)\.$/ 77 | ); 78 | }); 79 | }); 80 | 81 | describe('formatting', () => { 82 | it('should format with default (dashes)', function () { 83 | const mUUID = MUUID.v1(); 84 | assert.equal(validate(mUUID.toString()), true); 85 | // ensure generated uuids are always lowercase 86 | // as per spec - (see https://www.itu.int/rec/T-REC-X.667-201210-I/en) 87 | assert.equal(hasHexUpperCase(mUUID.toString()), false); 88 | }); 89 | it("should format with format 'D' (dashes)", function () { 90 | const mUUID = MUUID.v1(); 91 | const uuid = mUUID.toString('D'); 92 | assert.equal(validate(uuid, 'D'), true); 93 | assert.equal(hasHexUpperCase(mUUID.toString('D')), false); 94 | }); 95 | it("should format with format 'N' no delimiter", function () { 96 | const mUUID = MUUID.v1(); 97 | const uuid = mUUID.toString('N'); 98 | assert.equal(validate(uuid, 'N'), true); 99 | assert.equal(hasHexUpperCase(uuid), false); 100 | }); 101 | it("should format with format 'B' (curly braces)", function () { 102 | const mUUID = MUUID.v1(); 103 | const uuid = mUUID.toString('B'); 104 | assert.equal(validate(uuid, 'B'), true); 105 | assert.equal(hasHexUpperCase(uuid), false); 106 | }); 107 | it("should format with format 'P' (parens)", function () { 108 | const mUUID = MUUID.v1(); 109 | const uuid = mUUID.toString('P'); 110 | assert.equal(validate(uuid, 'P'), true); 111 | assert.equal(hasHexUpperCase(uuid), false); 112 | }); 113 | }); 114 | 115 | describe('modes', () => { 116 | it('relaxed mode should print friendly uuid in hex', function () { 117 | const mUUID = MUUID.mode('relaxed').v1(); 118 | assert.equal(isBase64(JSON.stringify(mUUID)), false); 119 | assert.equal(validate(mUUID.toString()), true); 120 | assert.equal(hasHexUpperCase(mUUID.toString()), false); 121 | }); 122 | it('canonical mode should print base64 uuid ', function () { 123 | const mUUID = MUUID.mode('canonical').v1(); 124 | const c = JSON.parse(JSON.stringify(mUUID)); 125 | assert.equal(isBase64(c), true); 126 | assert.equal(validate(mUUID.toString()), true); 127 | assert.equal(hasHexUpperCase(mUUID.toString()), false); 128 | }); 129 | }); 130 | }); 131 | 132 | function validate(uuid, format) { 133 | if (format === 'N') { 134 | return !!/^[0-9a-f]{8}[0-9a-f]{4}[0-9a-f]{4}[0-9a-f]{4}[0-9a-f]{12}$/.exec( 135 | uuid 136 | ); 137 | } else if (format === 'B') { 138 | return !!/^\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\}$/.exec( 139 | uuid 140 | ); 141 | } else if (format === 'P') { 142 | return !!/^\([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\)$/.exec( 143 | uuid 144 | ); 145 | } else { 146 | return !!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.exec( 147 | uuid 148 | ); 149 | } 150 | } 151 | 152 | function isBase64(s) { 153 | const bc = /[A-Za-z0-9+/=]/.test(s); 154 | const lc = /.*=$/.test(s); // make sure it ends with '=' 155 | return bc && lc; 156 | } 157 | --------------------------------------------------------------------------------