Initial commit

This commit is contained in:
abrendan
2023-11-30 14:15:19 +00:00
commit e4599df811
5457 changed files with 500139 additions and 0 deletions

27
node_modules/dasherize/.jshintrc generated vendored Normal file
View File

@@ -0,0 +1,27 @@
{
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"globalstrict": true,
"trailing": true,
"smarttabs": true,
"white": true,
"node": true,
"globals": {
"_": false,
"angular": false,
"require": false,
"module": false
}
}

4
node_modules/dasherize/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,4 @@
language: node_js
node_js:
- "0.8"
- "0.10"

18
node_modules/dasherize/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,18 @@
This software is released under the MIT license:
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.

12
node_modules/dasherize/example/dash.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
'use strict';
var dasherize = require('../');
var obj = {
feeFieFoe: 'fum',
beepBoop: [
{ 'abcXyz': 'mno' },
{ 'fooBar': 'baz' }
]
};
var res = dasherize(obj);
console.log(JSON.stringify(res, null, 2));

75
node_modules/dasherize/index.js generated vendored Normal file
View File

@@ -0,0 +1,75 @@
'use strict';
var isArray = Array.isArray || function (obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
};
var isDate = function (obj) {
return Object.prototype.toString.call(obj) === '[object Date]';
};
var isRegex = function (obj) {
return Object.prototype.toString.call(obj) === '[object RegExp]';
};
var has = Object.prototype.hasOwnProperty;
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) {
if (has.call(obj, key)) {
keys.push(key);
}
}
return keys;
};
function dashCase(str) {
return str.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, function (s, i) {
return (i > 0 ? '-' : '') + s.toLowerCase();
});
}
function map(xs, f) {
if (xs.map) {
return xs.map(f);
}
var res = [];
for (var i = 0; i < xs.length; i++) {
res.push(f(xs[i], i));
}
return res;
}
function reduce(xs, f, acc) {
if (xs.reduce) {
return xs.reduce(f, acc);
}
for (var i = 0; i < xs.length; i++) {
acc = f(acc, xs[i], i);
}
return acc;
}
function walk(obj) {
if (!obj || typeof obj !== 'object') {
return obj;
}
if (isDate(obj) || isRegex(obj)) {
return obj;
}
if (isArray(obj)) {
return map(obj, walk);
}
return reduce(objectKeys(obj), function (acc, key) {
var camel = dashCase(key);
acc[camel] = walk(obj[key]);
return acc;
}, {});
}
module.exports = function (obj) {
if (typeof obj === 'string') {
return dashCase(obj);
}
return walk(obj);
};

78
node_modules/dasherize/package.json generated vendored Normal file
View File

@@ -0,0 +1,78 @@
{
"_from": "dasherize@2.0.0",
"_id": "dasherize@2.0.0",
"_inBundle": false,
"_integrity": "sha1-bYCcnNDPe7iVLYD8hPoT1H3bEwg=",
"_location": "/dasherize",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "dasherize@2.0.0",
"name": "dasherize",
"escapedName": "dasherize",
"rawSpec": "2.0.0",
"saveSpec": null,
"fetchSpec": "2.0.0"
},
"_requiredBy": [
"/helmet-csp"
],
"_resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz",
"_shasum": "6d809c9cd0cf7bb8952d80fc84fa13d47ddb1308",
"_spec": "dasherize@2.0.0",
"_where": "/home/runner/Socketio-Chat-Template/node_modules/helmet-csp",
"author": {
"name": "Shahar Talmi"
},
"bugs": {
"url": "https://github.com/shahata/dasherize/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "recursively transform key strings to dash-case",
"devDependencies": {
"tape": "~2.3.2"
},
"homepage": "https://github.com/shahata/dasherize",
"keywords": [
"dash-case",
"json",
"transform"
],
"license": "MIT",
"main": "index.js",
"name": "dasherize",
"repository": {
"type": "git",
"url": "git://github.com/shahata/dasherize.git"
},
"scripts": {
"test": "tape test/*.js"
},
"testling": {
"files": "test/*.js",
"browsers": {
"iexplore": [
"6.0",
"7.0",
"8.0",
"9.0"
],
"chrome": [
"20.0"
],
"firefox": [
"10.0",
"15.0"
],
"safari": [
"5.1"
],
"opera": [
"12.0"
]
}
},
"version": "2.0.0"
}

68
node_modules/dasherize/readme.markdown generated vendored Normal file
View File

@@ -0,0 +1,68 @@
# dasherize
recursively transform key strings to dash-case
[![build status](https://secure.travis-ci.org/shahata/dasherize.png)](http://travis-ci.org/shahata/dasherize)
[![browser support](https://ci.testling.com/shahata/dasherize.png)](http://ci.testling.com/shahata/dasherize)
# example
``` js
var dasherize = require('dasherize');
var obj = {
feeFieFoe: 'fum',
beepBoop: [
{ 'abcXyz': 'mno' },
{ 'fooBar': 'baz' }
]
};
var res = dasherize(obj);
console.log(JSON.stringify(res, null, 2));
```
output:
```
{
"fee-fie-foe": "fum",
"beep-boop": [
{
"abc-xyz": "mno"
},
{
"foo-bar": "baz"
}
]
}
```
# methods
``` js
var dasherize = require('dasherize')
```
## dasherize(obj)
Convert the key strings in `obj` to dash-case recursively.
## dasherize(str)
Convert the string to dash-case.
# install
With [npm](https://npmjs.org) do:
```
npm install dasherize
```
To use in the browser, use [browserify](http://browserify.org).
# license
derives directly from [camelize](https://github.com/substack/camelize)
MIT

64
node_modules/dasherize/test/dash.js generated vendored Normal file
View File

@@ -0,0 +1,64 @@
'use strict';
var test = require('tape');
var dasherize = require('../');
var obj = {
feeFieFoe: 'fum',
beepBoop: [
{ abcXyz: 'mno' },
{ fooBar: 'baz' }
]
};
test('dasherize a nested object', function (t) {
t.plan(1);
var res = dasherize(obj);
t.deepEqual(res, {
'fee-fie-foe': 'fum',
'beep-boop': [
{ 'abc-xyz': 'mno' },
{ 'foo-bar': 'baz' }
]
});
});
test('string', function (t) {
t.plan(1);
t.equal(dasherize('oneTwo'), 'one-two');
});
test('string all caps', function(t) {
t.plan(1);
t.equal(dasherize('CONSTX'), 'constx');
});
test('string pascal case', function(t) {
t.plan(1);
t.equal(dasherize('TestOne'), 'test-one');
});
test('strings with acronym', function(t) {
t.plan(2);
t.equal(dasherize('inCIA'), 'in-cia');
t.equal(dasherize('isMLBAllStar'), 'is-mlb-all-star');
})
test('date', function (t) {
t.plan(1);
var d = new Date();
t.equal(dasherize(d), d);
});
test('regex', function (t) {
t.plan(1);
var r = /1234/;
t.equal(dasherize(r), r);
});
test('only dasherize strings that are the root value', function (t) {
t.plan(2);
t.equal(dasherize('fooBar'), 'foo-bar');
var res = dasherize({ fooBar: 'baz-foo' });
t.deepEqual(res, { 'foo-bar': 'baz-foo' });
});