first commit

This commit is contained in:
Missdrop
2025-07-16 16:30:56 +00:00
commit 7ee33927cb
11326 changed files with 1230901 additions and 0 deletions

9
node_modules/cuid/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,9 @@
cuid is covered by The MIT License:
Copyright (c) 2012 Eric Elliott
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

205
node_modules/cuid/README.md generated vendored Normal file
View File

@@ -0,0 +1,205 @@
# cuid
[![Travis-CI](https://travis-ci.org/ericelliott/cuid.svg)](https://travis-ci.org/ericelliott/cuid)
Collision-resistant ids optimized for horizontal scaling and binary search lookup performance.
Currently available for Node, browsers, Ruby, .Net, Go, PHP and Elixir (see ports below -- more ports are welcome).
`cuid()` returns a short random string with some collision-busting measures. Safe to use as HTML element ID's, and unique server-side record lookups.
## Example
ESM:
```js
import cuid from 'cuid';
console.log( cuid() );
// cjld2cjxh0000qzrmn831i7rn
```
Node style:
```js
var cuid = require('cuid');
console.log( cuid() );
// cjld2cyuq0000t3rmniod1foy
```
## Installing
```
$ npm install --save cuid
```
### Broken down
** c - h72gsb32 - 0000 - udoc - l363eofy **
The groups, in order, are:
* 'c' - identifies this as a cuid, and allows you to use it in html entity ids.
* Timestamp
* Counter - a single process might generate the same random string. The weaker the pseudo-random source, the higher the probability. That problem gets worse as processors get faster. The counter will roll over if the value gets too big.
* Client fingerprint
* Random (using cryptographically secure libraries where available).
## Fingerprints
**In browsers**, the first chars are obtained from the user agent string (which is fairly unique), and the supported mimeTypes (which is also fairly unique, except for IE, which always returns 0).
That string is concatenated with a count of variables in the global scope (which is also fairly unique), and the result is trimmed to 4 chars.
**In node**, the first two chars are extracted from the process.pid. The next two chars are extracted from the hostname.
## Motivation
Modern web applications have different requirements than applications from just a few years ago. Our modern unique identifiers have a stricter list of requirements that cannot all be satisfied by any existing version of the GUID/UUID specifications:
### Horizontal scalability
Today's applications don't run on any single machine.
Applications might need to support online / offline capability, which means we need a way for clients on different hosts to generate ids that won't collide with ids generated by other hosts -- even if they're not connected to the network.
Most pseudo-random algorithms use time in ms as a random seed. Random IDs lack sufficient entropy when running in separate processes (such as cloned virtual machines or client browsers) to guarantee against collisions. Application developers report v4 UUID collisions causing problems in their applications when the ID generation is distributed between lots of machines such that lots of IDs are generated in the same millisecond.
Each new client exponentially increases the chance of collision in the same way that each new character in a random string exponentially reduces the chance of collision. Successful apps scale at hundreds or thousands of new clients per day, so fighting the lack of entropy by adding random characters is a losing strategy.
Because of the nature of this problem, it's possible to build an app from the ground up and scale it to a million users before this problem rears its head. By the time you notice the problem (when your peak hour use requires dozens of ids to be created per ms), if your db doesn't have unique constraints on the id because you thought your guids were safe, you're in a world of hurt. Your users start to see data that doesn't belong to them because the db just returns the first ID match it finds.
Alternatively, you've played it safe and you only let your database create ids. Writes only happen on a master database, and load is spread out over read replicas. But with this kind of strain, you have to start scaling your database writes horizontally, too, and suddenly your application starts to crawl (if the db is smart enough to guarantee unique ids between write hosts), or you start getting id collisions between different db hosts, so your write hosts don't agree about which ids represent which data.
### Performance
Because entities might need to be generated in high-performance loops, id generation should be fast. That means no waiting around for asynchronous entropy pool requests, or cross-process/cross-network communication. Performance slows to impracticality in the browser. All sources of entropy need to be fast enough for synchronous access.
Even worse, when the database is the only guarantee that ids are unique, that means that clients are forced to send incomplete records to the database, and wait for a network round-trip before they can use the ids in any algorithm. Forget about fast client performance. It simply isn't possible.
That situation has caused some clients to create ids that are only usable in a single client session (such as an in-memory counter). When the database returns the real id, the client has to do some juggling logic to swap out the id being used.
If client side ID generation were stronger, the chances of collision would be much smaller, and the client could send complete records to the db for insertion without waiting for a full round-trip request to finish before using the ID.
#### Monotonically increasing IDs
Cuids generated by the same process are monotonically increasing, when less than 10000 cuids are generated within the same millisecond. Generated by different processes, the cuids will still have an increasing value in time if the process clocks are synchronized.
Monotonically increasing IDs are suitable for use as [high-performance database primary keys](http://code.openark.org/blog/mysql/monotonic-functions-sql-and-mysql), because they can be binary searched. Pure pseudo-random variants don't meet this requirement.
#### Tiny
Somewhat related to performance, an algorithm to generate an ID should require a tiny implementation. This is especially important for thick-client JavaScript applications.
### Security
Client-visible ids often need to have sufficient random data that it becomes practically impossible to try to guess valid IDs based on an existing, known id. That makes simple sequential ids unusable in the context of client-side generated database keys.
#### Portability
Most stronger forms of the UUID / GUID algorithms require access to OS services that are not available in browsers, meaning that they are impossible to implement as specified.
# Features of cuids
## Scalable
Because of the timestamp and the counter, cuid is really good at generating unique IDs on one machine.
Because of the fingerprints, cuid is also good at preventing collisions between multiple clients.
## Fast
Because cuids can be safely generated synchronously, you can generate a lot of them quickly. Since it's unlikely that you'll get a collision, you don't have to wait for a round trip to the database just to insert a complete record in your database.
Because cuids are monotonically increasing, database primary key performance gets a significant boost.
Weighing in at less than 1k minified and compressed, the cuid source should be suitable for even the lightest-weight mobile clients, and will not have a significant impact on the download time of your app, particularly if you follow best practices and concatenate it with the rest of your code in order to avoid the latency hit of an extra file request.
## Secure
Cuids contain enough random data and moving parts as to make guessing another id based on an existing id practically impossible. It also opens up a way to detect for abuse attempts -- if a client requests large blocks of ids that don't exist, there's a good chance that the client is malicious, or trying to get at data that doesn't belong to it.
## Portable
The only part of a cuid that might be hard to replicate between different clients is the fingerprint. It's easy to override the fingerprint method in order to port to different clients. Cuid already works standalone in browsers, or as a node module, so you can use cuid where you need to use it.
The algorithm is also easy to reproduce in other languages. You are encouraged to port it to whatever language you see fit.
### Ports:
* JavaScript (Browsers & Node)
* [cuid for Ruby](https://github.com/iyshannon/cuid) - [Ian Shannon](https://github.com/iyshannon)
* [cuid for .Net](https://github.com/moonpyk/ncuid ) - [Clément Bourgeois](https://github.com/moonpyk)
* [cuid for Go](http://github.com/lucsky/cuid) - [Luc Heinrich](https://github.com/lucsky)
* [cuid for PHP](https://github.com/endyjasmi/cuid) - [Endy Jasmi](https://github.com/endyjasmi)
* [cuid for Elixir](https://github.com/duailibe/cuid) - [Lucas Duailibe](https://github.com/duailibe)
* [cuid for Haskell](https://github.com/crabmusket/hscuid) - [Daniel Buckmaster](https://github.com/crabmusket)
* [cuid for Python](https://github.com/necaris/cuid.py) - [Rami Chowdhury](https://github.com/necaris)
* [cuid for Clojure](https://github.com/hden/cuid) - [Hao-kang Den](https://github.com/hden)
* [cuid for Java](https://github.com/graphcool/cuid-java) - [Nilan Marktanner](https://github.com/marktani)
* [cuid for Lua](https://github.com/marcoonroad/cuid) - [Marco Aurélio](https://github.com/marcoonroad)
* [cuid for Perl](https://github.com/zakame/Data-Cuid) - [Zak B. Elep](https://github.com/zakame)
* [cuid for Perl 6](https://github.com/marcoonroad/perl6-cuid) - [Marco Aurélio](https://github.com/marcoonroad)
* [cuid for OCaml](https://github.com/marcoonroad/ocaml-cuid) - [Marco Aurélio](https://github.com/marcoonroad)
* [cuid for Swift](https://github.com/raphaelmansuy/cuid) - [Raphael Mansuy](https://github.com/raphaelmansuy)
* [cuid for Insomnia](https://github.com/n8io/insomnia-plugin-cuid) - [Nate Clark](https://github.com/n8io)
* [cuid for Rust](https://github.com/mplanchard/cuid-rust) - [Matthew Planchard](https://github.com/mplanchard)
* [cuid for Racket](https://github.com/theodesp/cuid) - [Theo Despoudis](https://github.com/theodesp)
# Short URLs
Need a smaller ID? `cuid.slug()` is for you. With 7 to 10 characters, `.slug()` is a great solution for short urls. Slugs may grow up to 10 characters as the internal counter increases. They're good for things like URL slug disambiguation (i.e., `example.com/some-post-title-<slug>`) but **absolutely not recommended for database unique IDs**. Stick to the full cuid for database keys.
Be aware, slugs:
* are less likely to be monotonically increasing. Stick to full cuids for database lookups, if possible.
* have less random data, less room for the counter, and less room for the fingerprint, which means that all of them are more likely to collide or be guessed, especially as CPU speeds increase.
Don't use them if guessing an existing ID would expose confidential information to malicious users. For example, if you're providing a service like Google Drive or DropBox, which hosts user's private files, favor `cuid()` over `.slug()`.
# Questions
### Is this a replacement for GUID / UUID?
No. Cuid is great for the use case it was designed for -- to generate ids for applications which need to be scalable past tens or hundreds of new entities per second across multiple id-generating hosts. In other words, if you're building a web or mobile app and want the assurance that your choice of id standards isn't going to slow you down, cuid is for you.
However, if you need to obscure the order of id generation, or if it's potentially problematic to know the precise time that an id was generated, you'll want to go with something different.
Cuids should not be considered cryptographically secure (but neither should most guid algorithms. Make sure yours is using a crypto library before you rely on it).
### Why don't you use sha1, md5, etc?
A sha1 implementation in JavaScript is about 300 lines by itself, uncompressed, and its use would provide little benefit. For contrast, the cuid source code weighs in at less than 100 lines of code, uncompressed. It also comes at considerable performance cost. Md5 has similar issues.
### Why are there no dashes?
Almost all web-technology identifiers allow numbers and letters (though some require you to begin with a letter -- hence the 'c' at the beginning of a cuid). However, dashes are not allowed in some identifier names. Removing dashes between groups allows the ids to be more portable. Also, identifier groupings should not be relied on in your application. Removing them should discourage application developers from trying to extract data from a cuid.
The cuid specification should not be considered an API contract. Code that relies on the groupings as laid out here should be considered brittle and not be used in production.
### [Submit a Question or Comment](https://github.com/ericelliott/cuid/issues/new?title=Question)
### Credit
Created by Eric Elliott, Author, ["Programming JavaScript Applications (O'Reilly)"](https://ericelliottjs.com/product/programming-javascript-applications-ebook/)
Thanks to [Tout](http://tout.com/) for support and production testing.

128
node_modules/cuid/dist/cuid.js generated vendored Normal file
View File

@@ -0,0 +1,128 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.cuid = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
/**
* cuid.js
* Collision-resistant UID generator for browsers and node.
* Sequential for fast db lookups and recency sorting.
* Safe for element IDs and server-side lookups.
*
* Extracted from CLCTR
*
* Copyright (c) Eric Elliott 2012
* MIT License
*/
var fingerprint = require('./lib/fingerprint.js');
var pad = require('./lib/pad.js');
var getRandomValue = require('./lib/getRandomValue.js');
var c = 0,
blockSize = 4,
base = 36,
discreteValues = Math.pow(base, blockSize);
function randomBlock () {
return pad((getRandomValue() *
discreteValues << 0)
.toString(base), blockSize);
}
function safeCounter () {
c = c < discreteValues ? c : 0;
c++; // this is not subliminal
return c - 1;
}
function cuid () {
// Starting with a lowercase letter makes
// it HTML element ID friendly.
var letter = 'c', // hard-coded allows for sequential access
// timestamp
// warning: this exposes the exact date and time
// that the uid was created.
timestamp = (new Date().getTime()).toString(base),
// Prevent same-machine collisions.
counter = pad(safeCounter().toString(base), blockSize),
// A few chars to generate distinct ids for different
// clients (so different computers are far less
// likely to generate the same id)
print = fingerprint(),
// Grab some more chars from Math.random()
random = randomBlock() + randomBlock();
return letter + timestamp + counter + print + random;
}
cuid.slug = function slug () {
var date = new Date().getTime().toString(36),
counter = safeCounter().toString(36).slice(-4),
print = fingerprint().slice(0, 1) +
fingerprint().slice(-1),
random = randomBlock().slice(-2);
return date.slice(-2) +
counter + print + random;
};
cuid.isCuid = function isCuid (stringToCheck) {
if (typeof stringToCheck !== 'string') return false;
if (stringToCheck.startsWith('c')) return true;
return false;
};
cuid.isSlug = function isSlug (stringToCheck) {
if (typeof stringToCheck !== 'string') return false;
var stringLength = stringToCheck.length;
if (stringLength >= 7 && stringLength <= 10) return true;
return false;
};
cuid.fingerprint = fingerprint;
module.exports = cuid;
},{"./lib/fingerprint.js":2,"./lib/getRandomValue.js":3,"./lib/pad.js":4}],2:[function(require,module,exports){
var pad = require('./pad.js');
var env = typeof window === 'object' ? window : self;
var globalCount = Object.keys(env).length;
var mimeTypesLength = navigator.mimeTypes ? navigator.mimeTypes.length : 0;
var clientId = pad((mimeTypesLength +
navigator.userAgent.length).toString(36) +
globalCount.toString(36), 4);
module.exports = function fingerprint () {
return clientId;
};
},{"./pad.js":4}],3:[function(require,module,exports){
var getRandomValue;
var crypto = typeof window !== 'undefined' &&
(window.crypto || window.msCrypto) ||
typeof self !== 'undefined' &&
self.crypto;
if (crypto) {
var lim = Math.pow(2, 32) - 1;
getRandomValue = function () {
return Math.abs(crypto.getRandomValues(new Uint32Array(1))[0] / lim);
};
} else {
getRandomValue = Math.random;
}
module.exports = getRandomValue;
},{}],4:[function(require,module,exports){
module.exports = function pad (num, size) {
var s = '000000000' + num;
return s.substr(s.length - size);
};
},{}]},{},[1])(1)
});

1
node_modules/cuid/dist/cuid.min.js generated vendored Normal file
View File

@@ -0,0 +1 @@
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).cuid=e()}}(function(){return function o(f,u,s){function a(n,e){if(!u[n]){if(!f[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(l)return l(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var i=u[n]={exports:{}};f[n][0].call(i.exports,function(e){return a(f[n][1][e]||e)},i,i.exports,o,f,u,s)}return u[n].exports}for(var l="function"==typeof require&&require,e=0;e<s.length;e++)a(s[e]);return a}({1:[function(e,n,t){var i=e("./lib/fingerprint.js"),r=e("./lib/pad.js"),o=e("./lib/getRandomValue.js"),f=0,u=4,s=36,a=Math.pow(s,u);function l(){return r((o()*a<<0).toString(s),u)}function d(){return f=f<a?f:0,++f-1}function p(){return"c"+(new Date).getTime().toString(s)+r(d().toString(s),u)+i()+(l()+l())}p.slug=function(){var e=(new Date).getTime().toString(36),n=d().toString(36).slice(-4),t=i().slice(0,1)+i().slice(-1),r=l().slice(-2);return e.slice(-2)+n+t+r},p.isCuid=function(e){return"string"==typeof e&&!!e.startsWith("c")},p.isSlug=function(e){if("string"!=typeof e)return!1;var n=e.length;return 7<=n&&n<=10},p.fingerprint=i,n.exports=p},{"./lib/fingerprint.js":2,"./lib/getRandomValue.js":3,"./lib/pad.js":4}],2:[function(e,n,t){var r=e("./pad.js"),i="object"==typeof window?window:self,o=Object.keys(i).length,f=r(((navigator.mimeTypes?navigator.mimeTypes.length:0)+navigator.userAgent.length).toString(36)+o.toString(36),4);n.exports=function(){return f}},{"./pad.js":4}],3:[function(e,n,t){var r,i="undefined"!=typeof window&&(window.crypto||window.msCrypto)||"undefined"!=typeof self&&self.crypto;if(i){var o=Math.pow(2,32)-1;r=function(){return Math.abs(i.getRandomValues(new Uint32Array(1))[0]/o)}}else r=Math.random;n.exports=r},{}],4:[function(e,n,t){n.exports=function(e,n){var t="000000000"+e;return t.substr(t.length-n)}},{}]},{},[1])(1)});

24
node_modules/cuid/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
/**
* Create a unique collision-resistant ID.
* Read more about cuid here - https://github.com/ericelliott/cuid
*/
declare const cuid: (() => string) & {
/**
* Create a shorter unique collision-resistant ID. Is 7 to 10 characters in length.
*/
slug: (() => string)
/**
* Check if string is a valid 'cuid'.
*
* @param cuid: string to check if it is a 'cuid'.
*/
isCuid: ((cuid: string) => boolean)
/**
* Check if string is a valid 'cuid' slug.
*
* @param slug: string to check if it is a 'cuid' slug.
*/
isSlug: ((slug: string) => boolean)
};
export = cuid;

84
node_modules/cuid/index.js generated vendored Normal file
View File

@@ -0,0 +1,84 @@
/**
* cuid.js
* Collision-resistant UID generator for browsers and node.
* Sequential for fast db lookups and recency sorting.
* Safe for element IDs and server-side lookups.
*
* Extracted from CLCTR
*
* Copyright (c) Eric Elliott 2012
* MIT License
*/
var fingerprint = require('./lib/fingerprint.js');
var pad = require('./lib/pad.js');
var getRandomValue = require('./lib/getRandomValue.js');
var c = 0,
blockSize = 4,
base = 36,
discreteValues = Math.pow(base, blockSize);
function randomBlock () {
return pad((getRandomValue() *
discreteValues << 0)
.toString(base), blockSize);
}
function safeCounter () {
c = c < discreteValues ? c : 0;
c++; // this is not subliminal
return c - 1;
}
function cuid () {
// Starting with a lowercase letter makes
// it HTML element ID friendly.
var letter = 'c', // hard-coded allows for sequential access
// timestamp
// warning: this exposes the exact date and time
// that the uid was created.
timestamp = (new Date().getTime()).toString(base),
// Prevent same-machine collisions.
counter = pad(safeCounter().toString(base), blockSize),
// A few chars to generate distinct ids for different
// clients (so different computers are far less
// likely to generate the same id)
print = fingerprint(),
// Grab some more chars from Math.random()
random = randomBlock() + randomBlock();
return letter + timestamp + counter + print + random;
}
cuid.slug = function slug () {
var date = new Date().getTime().toString(36),
counter = safeCounter().toString(36).slice(-4),
print = fingerprint().slice(0, 1) +
fingerprint().slice(-1),
random = randomBlock().slice(-2);
return date.slice(-2) +
counter + print + random;
};
cuid.isCuid = function isCuid (stringToCheck) {
if (typeof stringToCheck !== 'string') return false;
if (stringToCheck.startsWith('c')) return true;
return false;
};
cuid.isSlug = function isSlug (stringToCheck) {
if (typeof stringToCheck !== 'string') return false;
var stringLength = stringToCheck.length;
if (stringLength >= 7 && stringLength <= 10) return true;
return false;
};
cuid.fingerprint = fingerprint;
module.exports = cuid;

12
node_modules/cuid/lib/fingerprint.browser.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
var pad = require('./pad.js');
var env = typeof window === 'object' ? window : self;
var globalCount = Object.keys(env).length;
var mimeTypesLength = navigator.mimeTypes ? navigator.mimeTypes.length : 0;
var clientId = pad((mimeTypesLength +
navigator.userAgent.length).toString(36) +
globalCount.toString(36), 4);
module.exports = function fingerprint () {
return clientId;
};

18
node_modules/cuid/lib/fingerprint.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
var pad = require('./pad.js');
var os = require('os'),
padding = 2,
pid = pad(process.pid.toString(36), padding),
hostname = os.hostname(),
length = hostname.length,
hostId = pad(hostname
.split('')
.reduce(function (prev, char) {
return +prev + char.charCodeAt(0);
}, +length + 36)
.toString(36),
padding);
module.exports = function fingerprint () {
return pid + hostId;
};

8
node_modules/cuid/lib/fingerprint.react-native.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
var pad = require('./pad.js');
var globalCount = Object.keys(global);
var clientId = pad(globalCount.toString(36), 4);
module.exports = function fingerprint () {
return clientId;
};

18
node_modules/cuid/lib/getRandomValue.browser.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
var getRandomValue;
var crypto = typeof window !== 'undefined' &&
(window.crypto || window.msCrypto) ||
typeof self !== 'undefined' &&
self.crypto;
if (crypto) {
var lim = Math.pow(2, 32) - 1;
getRandomValue = function () {
return Math.abs(crypto.getRandomValues(new Uint32Array(1))[0] / lim);
};
} else {
getRandomValue = Math.random;
}
module.exports = getRandomValue;

9
node_modules/cuid/lib/getRandomValue.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
var crypto = require('crypto');
var lim = Math.pow(2, 32) - 1;
module.exports = function random () {
return Math.abs(crypto.randomBytes(4)
.readInt32BE() / lim);
};

2
node_modules/cuid/lib/getRandomValue.react-native.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
module.exports = Math.random;

4
node_modules/cuid/lib/pad.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
module.exports = function pad (num, size) {
var s = '000000000' + num;
return s.substr(s.length - size);
};

66
node_modules/cuid/package.json generated vendored Normal file
View File

@@ -0,0 +1,66 @@
{
"name": "cuid",
"description": "Collision-resistant ids optimized for horizontal scaling and performance. For node and browsers.",
"version": "2.1.8",
"author": {
"name": "Eric Elliott",
"url": "https://ericelliottjs.com"
},
"browser": {
"./lib/fingerprint.js": "./lib/fingerprint.browser.js",
"./lib/getRandomValue.js": "./lib/getRandomValue.browser.js"
},
"dependencies": {},
"devDependencies": {
"babel-polyfill": "6.26.0",
"babel-preset-env": "1.7.0",
"babel-register": "6.26.0",
"browserify": "16.5.0",
"eslint": "5.16.0",
"eslint-plugin-testcafe": "0.2.1",
"http-server": "^0.12.0",
"mkdirp": "0.5.1",
"riteway": "6.1.1",
"tape": "4.11.0",
"testcafe": "1.1.4",
"uglify-js": "3.7.2",
"updtr": "3.1.0",
"watchify": "3.11.1"
},
"files": [
"lib",
"dist",
"index.js",
"index.d.ts"
],
"jsdelivr": "dist/cuid.min.js",
"keywords": [
"guid",
"id",
"uid",
"unique id",
"uuid"
],
"license": "MIT",
"main": "index.js",
"react-native": {
"./lib/fingerprint.js": "./lib/fingerprint.react-native.js",
"./lib/getRandomValue.js": "./lib/getRandomValue.react-native.js"
},
"repository": {
"type": "git",
"url": "https://github.com/ericelliott/cuid.git"
},
"scripts": {
"build": "mkdirp dist && browserify index.js -s cuid -o dist/cuid.js && uglifyjs dist/cuid.js -c -m -o dist/cuid.min.js",
"lint": "eslint index.js lib test",
"prepare": "npm run build",
"test": "npm run -s lint && npm run -s test:server && npm run -s test:random && npm run -s test:browser && npm run -s test:worker",
"test:browser": "testcafe chrome ./test/browser.js",
"test:worker": "browserify ./test/worker/worker.js -s cuid -o ./test/worker/worker.bundled.js && testcafe chrome ./test/worker.js --app \"http-server ./test/worker -s\"",
"test:server": "tape -r babel-register -r babel-polyfill test/server.js",
"test:random": "node -r babel-register -r babel-polyfill test/getRandomValue.test.js",
"update": "updtr"
},
"unpkg": "dist/cuid.min.js"
}