cuid
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -5,3 +5,3 @@ { | ||
"description": "Collision-resistant ids optimized for horizontal scaling and performance", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "uid", |
{ | ||
"name": "cuid", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Collision-resistant ids optimized for horizontal scaling and performance. For node and browsers.", | ||
"author": { | ||
"email": "eric@ericleads.com", | ||
"name": "Eric Elliott", | ||
"url": "http://ericleads.com" | ||
"url": "https://ericelliottjs.com" | ||
}, | ||
"main": "./build/server/cuid.js", | ||
"browserify": "./build/client/cuid.js", | ||
"browser": "./build/client/cuid.js", | ||
"keywords": [ | ||
"id", | ||
"guid", | ||
@@ -23,30 +23,32 @@ "uid", | ||
"license": "MIT", | ||
"directories": { | ||
"dist": "./dist", | ||
"lib": "./lib", | ||
"src": "./src", | ||
"test": "./test" | ||
}, | ||
"devDependencies": { | ||
"babel": "^5.6.14", | ||
"babel-eslint": "^3.1.20", | ||
"babel-loader": "^5.3.0", | ||
"blue-tape": "^0.1.9", | ||
"eslint": "^0.24.0", | ||
"babel": "5.6.14", | ||
"babel-eslint": "3.1.20", | ||
"babel-loader": "5.3.0", | ||
"ecstatic": "^0.8.0", | ||
"eslint": "0.24.0", | ||
"faucet": "0.0.1", | ||
"node-libs-browser": "^0.5.2", | ||
"rimraf": "^2.4.1", | ||
"saucelabs": "^0.1.1", | ||
"webpack": "^1.10.1" | ||
"node-libs-browser": "0.5.2", | ||
"rimraf": "2.4.1", | ||
"sauce-connect-launcher": "^0.12.0", | ||
"saucelabs": "0.1.1", | ||
"tape": "4.2.0", | ||
"wd": "^0.3.12", | ||
"webpack": "1.10.1", | ||
"zuul": "^3.3.0" | ||
}, | ||
"scripts": { | ||
"build": "NODE_ENV=production webpack && npm run build:min", | ||
"build:min": "NODE_ENV=production webpack -p", | ||
"clean": "rimraf build", | ||
"lint": "eslint source/**/*.js", | ||
"clean": "rimraf build && rimraf test/client/test-cuid.js", | ||
"prebuild": "npm run clean", | ||
"test": "npm run test:server", | ||
"test:client": "source bin/env.sh && babel-node test/client", | ||
"build": "npm run build:server && npm run build:client && npm run build:test", | ||
"build:server": "NODE_ENV=production WEBPACK_TARGET=server webpack", | ||
"build:client": "NODE_ENV=production WEBPACK_TARGET=client webpack -p", | ||
"build:test": "browserify ./test/client/index.js -s testcuid -t babelify --outfile test/client/test-cuid.js", | ||
"comment:build:test": "NODE_ENV=production WEBPACK_TARGET=test webpack -p", | ||
"lint": "eslint source test", | ||
"test": "npm run test:server && npm run test:client", | ||
"test:client": "zuul -- test/client/test-cuid", | ||
"test:server": "babel-node test/server", | ||
"validate": "npm run lint && npm run test", | ||
"prevalidate": "npm run clean", | ||
"validate": "npm run lint && npm run build && npm run test", | ||
"validate-dev": "npm run lint && npm run build && npm run test | faucet" | ||
@@ -53,0 +55,0 @@ }, |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
import createCuid from '../index.js'; | ||
@@ -7,2 +5,4 @@ const fingerprint = require('browser-fingerprint')(); | ||
const { cuid, slug } = createCuid(fingerprint); | ||
export { cuid, slug }; | ||
cuid.slug = slug; | ||
export default cuid; |
@@ -13,4 +13,2 @@ /** | ||
'use strict'; | ||
let c = 0; | ||
@@ -28,3 +26,3 @@ const blockSize = 4; | ||
const safeCounter = function () { | ||
c = (c < discreteValues) ? c : 0; | ||
c = c < discreteValues ? c : 0; | ||
return c++; | ||
@@ -31,0 +29,0 @@ }; |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
import createCuid from '../index.js'; | ||
@@ -7,2 +5,4 @@ const fingerprint = require('node-fingerprint')(); | ||
const { cuid, slug } = createCuid(fingerprint); | ||
export { cuid, slug }; | ||
cuid.slug = slug; | ||
export default cuid; |
@@ -1,6 +0,5 @@ | ||
'use strict'; | ||
import cuid from '../../source/server/index.js'; | ||
import test from 'tape'; | ||
const { slug } = cuid; | ||
import { cuid, slug } from '../../source/server/index.js'; | ||
import test from 'blue-tape'; | ||
const MAX = 1200000; | ||
@@ -7,0 +6,0 @@ |
@@ -1,6 +0,18 @@ | ||
module.exports = { | ||
entry: "./source/client/index.js", | ||
output: { | ||
path: 'build/client', | ||
filename: "cuid.js" | ||
var target = process.env.WEBPACK_TARGET; | ||
var config = { | ||
entry: {}, | ||
output: target === 'client' ? { | ||
library: 'cuid', | ||
libraryTarget: 'umd', | ||
path: 'build/', | ||
filename: target + '-cuid.js' | ||
} : target === 'test' ? { | ||
library: 'testCuid', | ||
libraryTarget: 'umd', | ||
path: 'test/client/', | ||
filename: target + '-cuid.js' | ||
} : { | ||
path: 'build/', | ||
filename: target + '-cuid.js' | ||
}, | ||
@@ -16,2 +28,8 @@ module: { | ||
} | ||
} | ||
}; | ||
config.entry = target === 'test' ? | ||
'./test/client/index.js' : | ||
'./source/' + target + '/index.js'; | ||
module.exports = config; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
343233
9204
14
21
13
7