# add dist

This commit is contained in:
Mario Romano
2016-04-21 11:56:31 +01:00
parent 5914688467
commit 07807e7bc3
13499 changed files with 1808930 additions and 5 deletions

View File

@@ -0,0 +1,12 @@
'use strict';
var mapObj = require('map-obj');
var camelCase = require('camelcase');
module.exports = function (input, options) {
options = options || {};
var exclude = options.exclude || [];
return mapObj(input, function (key, val) {
key = exclude.indexOf(key) === -1 ? camelCase(key) : key;
return [key, val];
});
};

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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.

View File

@@ -0,0 +1,56 @@
'use strict';
function preserveCamelCase(str) {
var isLastCharLower = false;
for (var i = 0; i < str.length; i++) {
var c = str.charAt(i);
if (isLastCharLower && (/[a-zA-Z]/).test(c) && c.toUpperCase() === c) {
str = str.substr(0, i) + '-' + str.substr(i);
isLastCharLower = false;
i++;
} else {
isLastCharLower = (c.toLowerCase() === c);
}
}
return str;
}
module.exports = function () {
var str = [].map.call(arguments, function (str) {
return str.trim();
}).filter(function (str) {
return str.length;
}).join('-');
if (!str.length) {
return '';
}
if (str.length === 1) {
return str;
}
if (!(/[_.\- ]+/).test(str)) {
if (str === str.toUpperCase()) {
return str.toLowerCase();
}
if (str[0] !== str[0].toLowerCase()) {
return str[0].toLowerCase() + str.slice(1);
}
return str;
}
str = preserveCamelCase(str);
return str
.replace(/^[_.\- ]+/, '')
.toLowerCase()
.replace(/[_.\- ]+(\w|$)/g, function (m, p1) {
return p1.toUpperCase();
});
};

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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.

View File

@@ -0,0 +1,99 @@
{
"_args": [
[
"camelcase@^2.0.0",
"/Users/mromano/dev/dev-platform-webcomponents/ng2-components/ng2-alfresco-documentslist/node_modules/camelcase-keys"
]
],
"_from": "camelcase@>=2.0.0 <3.0.0",
"_id": "camelcase@2.1.1",
"_inCache": true,
"_installable": true,
"_location": "/camelcase-keys/camelcase",
"_nodeVersion": "4.3.0",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/camelcase-2.1.1.tgz_1457803836074_0.4515206723008305"
},
"_npmUser": {
"email": "sindresorhus@gmail.com",
"name": "sindresorhus"
},
"_npmVersion": "2.14.12",
"_phantomChildren": {},
"_requested": {
"name": "camelcase",
"raw": "camelcase@^2.0.0",
"rawSpec": "^2.0.0",
"scope": null,
"spec": ">=2.0.0 <3.0.0",
"type": "range"
},
"_requiredBy": [
"/camelcase-keys"
],
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
"_shasum": "7c1d16d679a1bbe59ca02cacecfb011e201f5a1f",
"_shrinkwrap": null,
"_spec": "camelcase@^2.0.0",
"_where": "/Users/mromano/dev/dev-platform-webcomponents/ng2-components/ng2-alfresco-documentslist/node_modules/camelcase-keys",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "http://sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/camelcase/issues"
},
"dependencies": {},
"description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"directories": {},
"dist": {
"shasum": "7c1d16d679a1bbe59ca02cacecfb011e201f5a1f",
"tarball": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "35c9c8abce5b9cc9defe534ab25823dc6383180f",
"homepage": "https://github.com/sindresorhus/camelcase",
"keywords": [
"camelcase",
"camel-case",
"camel",
"case",
"dash",
"hyphen",
"dot",
"underscore",
"separator",
"string",
"text",
"convert"
],
"license": "MIT",
"maintainers": [
{
"email": "sindresorhus@gmail.com",
"name": "sindresorhus"
}
],
"name": "camelcase",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/camelcase.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.1.1"
}

View File

@@ -0,0 +1,57 @@
# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase)
> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar`
## Install
```
$ npm install --save camelcase
```
## Usage
```js
const camelCase = require('camelcase');
camelCase('foo-bar');
//=> 'fooBar'
camelCase('foo_bar');
//=> 'fooBar'
camelCase('Foo-Bar');
//=> 'fooBar'
camelCase('--foo.bar');
//=> 'fooBar'
camelCase('__foo__bar__');
//=> 'fooBar'
camelCase('foo bar');
//=> 'fooBar'
console.log(process.argv[3]);
//=> '--foo-bar'
camelCase(process.argv[3]);
//=> 'fooBar'
camelCase('foo', 'bar');
//=> 'fooBar'
camelCase('__foo__', '--bar');
//=> 'fooBar'
```
## Related
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

View File

@@ -0,0 +1,111 @@
{
"_args": [
[
"camelcase-keys@^2.0.0",
"/Users/mromano/dev/dev-platform-webcomponents/ng2-components/ng2-alfresco-documentslist/node_modules/meow"
]
],
"_from": "camelcase-keys@>=2.0.0 <3.0.0",
"_id": "camelcase-keys@2.1.0",
"_inCache": true,
"_installable": true,
"_location": "/camelcase-keys",
"_nodeVersion": "4.3.0",
"_npmOperationalInternal": {
"host": "packages-13-west.internal.npmjs.com",
"tmp": "tmp/camelcase-keys-2.1.0.tgz_1458051723517_0.14490422373637557"
},
"_npmUser": {
"email": "sindresorhus@gmail.com",
"name": "sindresorhus"
},
"_npmVersion": "2.14.12",
"_phantomChildren": {},
"_requested": {
"name": "camelcase-keys",
"raw": "camelcase-keys@^2.0.0",
"rawSpec": "^2.0.0",
"scope": null,
"spec": ">=2.0.0 <3.0.0",
"type": "range"
},
"_requiredBy": [
"/meow"
],
"_resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
"_shasum": "308beeaffdf28119051efa1d932213c91b8f92e7",
"_shrinkwrap": null,
"_spec": "camelcase-keys@^2.0.0",
"_where": "/Users/mromano/dev/dev-platform-webcomponents/ng2-components/ng2-alfresco-documentslist/node_modules/meow",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "http://sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/camelcase-keys/issues"
},
"dependencies": {
"camelcase": "^2.0.0",
"map-obj": "^1.0.0"
},
"description": "Convert object keys to camelCase",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"directories": {},
"dist": {
"shasum": "308beeaffdf28119051efa1d932213c91b8f92e7",
"tarball": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "d92dfb3b5eb2985d62839cdd44672f01139d1822",
"homepage": "https://github.com/sindresorhus/camelcase-keys",
"keywords": [
"map",
"obj",
"object",
"key",
"keys",
"value",
"values",
"val",
"iterate",
"camelcase",
"camel-case",
"camel",
"case",
"dash",
"hyphen",
"dot",
"underscore",
"separator",
"string",
"text",
"convert"
],
"license": "MIT",
"maintainers": [
{
"email": "sindresorhus@gmail.com",
"name": "sindresorhus"
}
],
"name": "camelcase-keys",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/camelcase-keys.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.1.0"
}

View File

@@ -0,0 +1,54 @@
# camelcase-keys [![Build Status](https://travis-ci.org/sindresorhus/camelcase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase-keys)
> Convert object keys to camelCase using [`camelcase`](https://github.com/sindresorhus/camelcase)
## Install
```
$ npm install --save camelcase-keys
```
## Usage
```js
const camelcaseKeys = require('camelcase-keys');
camelcaseKeys({'foo-bar': true});
//=> {fooBar: true}
const argv = require('minimist')(process.argv.slice(2));
//=> {_: [], 'foo-bar': true}
camelcaseKeys(argv);
//=> {_: [], fooBar: true}
```
## API
### camelcaseKeys(input, [options])
#### input
Type: `object`
Object to camelCase.
#### options
Type: `object`
##### exclude
Type: `array`
Default: `[]`
Exclude keys from being camelCased.
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)