1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-17 01:16:00 +00:00
This commit is contained in:
MatteZ02
2020-03-03 22:30:50 +02:00
parent edfcc6f474
commit 30022c7634
11800 changed files with 1984416 additions and 1 deletions

4
node_modules/snakeize/.npmignore generated vendored Normal file
View File

@ -0,0 +1,4 @@
node_modules
npm-debug.log
components
build

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

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

18
node_modules/snakeize/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.

17
node_modules/snakeize/component.json generated vendored Normal file
View File

@ -0,0 +1,17 @@
{
"name": "snakeize",
"repo": "nathan7/snakeize",
"description": "recursively transform key strings from camel-case to underscore-style",
"version": "0.1.0",
"keywords": [
"snake-case",
"json",
"transform"
],
"dependencies": {},
"development": {},
"license": "MIT",
"scripts": [
"index.js"
]
}

10
node_modules/snakeize/example/snakeize.js generated vendored Normal file
View File

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

20
node_modules/snakeize/index.js generated vendored Normal file
View File

@ -0,0 +1,20 @@
module.exports = function walk (obj) {
if (!obj || typeof obj !== 'object') return obj;
if (isDate(obj) || isRegex(obj)) return obj;
if (Array.isArray(obj)) return obj.map(walk);
return Object.keys(obj).reduce(function (acc, key) {
var camel = key[0].toLowerCase() + key.slice(1).replace(/([A-Z]+)/g, function (m, x) {
return '_' + x.toLowerCase();
});
acc[camel] = walk(obj[key]);
return acc;
}, {});
};
var isDate = function (obj) {
return Object.prototype.toString.call(obj) === '[object Date]';
};
var isRegex = function (obj) {
return Object.prototype.toString.call(obj) === '[object RegExp]';
};

85
node_modules/snakeize/package.json generated vendored Normal file
View File

@ -0,0 +1,85 @@
{
"_args": [
[
"snakeize@0.1.0",
"C:\\Users\\matia\\Musix"
]
],
"_from": "snakeize@0.1.0",
"_id": "snakeize@0.1.0",
"_inBundle": false,
"_integrity": "sha1-EMCI2LWOsHazIpu1oE4jLOEmQi0=",
"_location": "/snakeize",
"_optional": true,
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "snakeize@0.1.0",
"name": "snakeize",
"escapedName": "snakeize",
"rawSpec": "0.1.0",
"saveSpec": null,
"fetchSpec": "0.1.0"
},
"_requiredBy": [
"/@google-cloud/storage"
],
"_resolved": "https://registry.npmjs.org/snakeize/-/snakeize-0.1.0.tgz",
"_spec": "0.1.0",
"_where": "C:\\Users\\matia\\Musix",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"bugs": {
"url": "https://github.com/nathan7/snakeize/issues"
},
"description": "recursively transform key strings from camel-case to underscore-style",
"devDependencies": {
"tap": "~0.4.0",
"tape": "~0.3.0"
},
"homepage": "https://github.com/nathan7/snakeize",
"keywords": [
"snake-case",
"json",
"transform"
],
"license": "MIT",
"main": "index.js",
"name": "snakeize",
"repository": {
"type": "git",
"url": "git://github.com/nathan7/snakeize.git"
},
"scripts": {
"test": "tap 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": "0.1.0"
}

70
node_modules/snakeize/readme.markdown generated vendored Normal file
View File

@ -0,0 +1,70 @@
# snakeize
recursively transform key strings from camel-case to underscore-style.
Derives directly from [substack](https://github.com/substack)'s [camelize](https://github.com/substack/camelize)
[![build status](https://secure.travis-ci.org/nathan7/snakeize.png)](http://travis-ci.org/nathan7/snakeize)
[![browser support](https://ci.testling.com/nathan7/snakeize.png)](http://ci.testling.com/nathan7/snakeize)
# example
``` js
var snakeize = require('snakeize');
var obj = {
feeFieFoe: 'fum',
beepBoop: [
{ 'abcXyz': 'mno' },
{ 'FooBar': 'baz' },
{ 'CheeseID': 'wensleydale' }
]
};
var res = snakeize(obj);
console.log(JSON.stringify(res, null, 2));
```
output:
```
{
"fee_fie_foe": "fum",
"beep_boop": [
{
"abc_xyz": "mno"
},
{
"foo_bar": "baz"
},
{
"cheese_id": "wensleydale"
}
]
}
```
# methods
``` js
var snakeize = require('snakeize')
```
## snakeize(obj)
Convert the key strings in `obj` from camel-case to underscore-stlye recursively.
# install
With [npm](https://npmjs.org) do:
```
npm install snakeize
```
To use in the browser, use [browserify](http://browserify.org) or [component](http://github.com/component):
```
component install nathan7/snakeize
```
# license
MIT

36
node_modules/snakeize/test/snakeize.js generated vendored Normal file
View File

@ -0,0 +1,36 @@
var test = require('tape');
var snakeize = require('../');
var obj = {
feeFieFoe: 'fum',
beepBoop: [
{ 'abcXyz': 'mno' },
{ 'FooBar': 'baz' },
{ 'CheeseID': 'wensleydale' }
]
};
test('snakeize a nested object', function (t) {
t.plan(1);
var res = snakeize(obj);
t.deepEqual(res, {
"fee_fie_foe": "fum",
"beep_boop": [
{ "abc_xyz": "mno" },
{ "foo_bar": "baz" },
{ "cheese_id": "wensleydale" }
]
});
});
test('date object is not modified', function (t) {
t.plan(1);
var d = new Date();
t.equal(snakeize(d), d);
});
test('regex object is not modified', function (t) {
t.plan(1);
var r = /1234/;
t.equal(snakeize(r), r);
});