This commit is contained in:
lalBi94
2023-03-05 13:23:23 +01:00
commit 7bc56c09b5
14034 changed files with 1834369 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
language: node_js
sudo: false
before_install:
- "npm -g install npm"
node_js:
- "6"
- "8"
- "10"
- "lts/*"
- "node"

15
node_modules/node-gyp/node_modules/unique-slug/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,15 @@
The ISC License
Copyright npm, Inc
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@@ -0,0 +1,19 @@
unique-slug
===========
Generate a unique character string suitible for use in files and URLs.
```
var uniqueSlug = require('unique-slug')
var randomSlug = uniqueSlug()
var fileSlug = uniqueSlug('/etc/passwd')
```
### uniqueSlug(*str*) → String (8 chars)
If *str* is passed in then the return value will be its murmur hash in
hex.
If *str* is not passed in, it will be 4 randomly generated bytes
converted into 8 hexadecimal characters.

View File

@@ -0,0 +1,11 @@
'use strict'
var MurmurHash3 = require('imurmurhash')
module.exports = function (uniq) {
if (uniq) {
var hash = new MurmurHash3(uniq)
return ('00000000' + hash.result().toString(16)).substr(-8)
} else {
return (Math.random().toString(16) + '0000000').substr(2, 8)
}
}

View File

@@ -0,0 +1,23 @@
{
"name": "unique-slug",
"version": "2.0.2",
"description": "Generate a unique character string suitible for use in files and URLs.",
"main": "index.js",
"scripts": {
"test": "standard && tap --coverage test"
},
"keywords": [],
"author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org)",
"license": "ISC",
"devDependencies": {
"standard": "^12.0.1",
"tap": "^12.7.0"
},
"repository": {
"type": "git",
"url": "git://github.com/iarna/unique-slug.git"
},
"dependencies": {
"imurmurhash": "^0.1.4"
}
}

View File

@@ -0,0 +1,13 @@
'use strict'
var t = require('tap')
var uniqueSlug = require('../index.js')
t.plan(5)
var slugA = uniqueSlug()
t.is(slugA.length, 8, 'random slugs are 8 chars')
t.notEqual(slugA, uniqueSlug(), "two slugs aren't the same")
var base = '/path/to/thingy'
var slugB = uniqueSlug(base)
t.is(slugB.length, 8, 'string based slugs are 8 chars')
t.is(slugB, uniqueSlug(base), 'two string based slugs, from the same string are the same')
t.notEqual(slugB, uniqueSlug(slugA), 'two string based slongs, from diff strings are different')