summaryrefslogtreecommitdiffstats
path: root/node_modules/unique-slug
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
commite06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch)
tree55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/unique-slug
downloadwebsite_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip
api, login, auth
Diffstat (limited to 'node_modules/unique-slug')
-rw-r--r--node_modules/unique-slug/.travis.yml10
-rw-r--r--node_modules/unique-slug/LICENSE15
-rw-r--r--node_modules/unique-slug/README.md19
-rw-r--r--node_modules/unique-slug/index.js11
-rw-r--r--node_modules/unique-slug/package.json56
-rw-r--r--node_modules/unique-slug/test/index.js13
6 files changed, 124 insertions, 0 deletions
diff --git a/node_modules/unique-slug/.travis.yml b/node_modules/unique-slug/.travis.yml
new file mode 100644
index 0000000..5651fce
--- /dev/null
+++ b/node_modules/unique-slug/.travis.yml
@@ -0,0 +1,10 @@
+language: node_js
+sudo: false
+before_install:
+ - "npm -g install npm"
+node_js:
+ - "6"
+ - "8"
+ - "10"
+ - "lts/*"
+ - "node"
diff --git a/node_modules/unique-slug/LICENSE b/node_modules/unique-slug/LICENSE
new file mode 100644
index 0000000..7953647
--- /dev/null
+++ b/node_modules/unique-slug/LICENSE
@@ -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.
diff --git a/node_modules/unique-slug/README.md b/node_modules/unique-slug/README.md
new file mode 100644
index 0000000..87f92f1
--- /dev/null
+++ b/node_modules/unique-slug/README.md
@@ -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.
diff --git a/node_modules/unique-slug/index.js b/node_modules/unique-slug/index.js
new file mode 100644
index 0000000..fa4761a
--- /dev/null
+++ b/node_modules/unique-slug/index.js
@@ -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)
+ }
+}
diff --git a/node_modules/unique-slug/package.json b/node_modules/unique-slug/package.json
new file mode 100644
index 0000000..fca71ac
--- /dev/null
+++ b/node_modules/unique-slug/package.json
@@ -0,0 +1,56 @@
+{
+ "_from": "unique-slug@^2.0.0",
+ "_id": "unique-slug@2.0.2",
+ "_inBundle": false,
+ "_integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==",
+ "_location": "/unique-slug",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "unique-slug@^2.0.0",
+ "name": "unique-slug",
+ "escapedName": "unique-slug",
+ "rawSpec": "^2.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^2.0.0"
+ },
+ "_requiredBy": [
+ "/unique-filename"
+ ],
+ "_resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz",
+ "_shasum": "baabce91083fc64e945b0f3ad613e264f7cd4e6c",
+ "_spec": "unique-slug@^2.0.0",
+ "_where": "/home/pruss/Dev/3-minute-website/node_modules/unique-filename",
+ "author": {
+ "name": "Rebecca Turner",
+ "email": "me@re-becca.org",
+ "url": "http://re-becca.org"
+ },
+ "bugs": {
+ "url": "https://github.com/iarna/unique-slug/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "imurmurhash": "^0.1.4"
+ },
+ "deprecated": false,
+ "description": "Generate a unique character string suitible for use in files and URLs.",
+ "devDependencies": {
+ "standard": "^12.0.1",
+ "tap": "^12.7.0"
+ },
+ "homepage": "https://github.com/iarna/unique-slug#readme",
+ "keywords": [],
+ "license": "ISC",
+ "main": "index.js",
+ "name": "unique-slug",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/iarna/unique-slug.git"
+ },
+ "scripts": {
+ "test": "standard && tap --coverage test"
+ },
+ "version": "2.0.2"
+}
diff --git a/node_modules/unique-slug/test/index.js b/node_modules/unique-slug/test/index.js
new file mode 100644
index 0000000..0f4ccad
--- /dev/null
+++ b/node_modules/unique-slug/test/index.js
@@ -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')