LINXD-1029: Add relative path to simulator
This commit is contained in:
88
node_modules/camelcase/index.js
generated
vendored
88
node_modules/camelcase/index.js
generated
vendored
@ -1,56 +1,76 @@
|
||||
'use strict';
|
||||
|
||||
function preserveCamelCase(str) {
|
||||
var isLastCharLower = false;
|
||||
const preserveCamelCase = string => {
|
||||
let isLastCharLower = false;
|
||||
let isLastCharUpper = false;
|
||||
let isLastLastCharUpper = false;
|
||||
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
var c = str.charAt(i);
|
||||
for (let i = 0; i < string.length; i++) {
|
||||
const character = string[i];
|
||||
|
||||
if (isLastCharLower && (/[a-zA-Z]/).test(c) && c.toUpperCase() === c) {
|
||||
str = str.substr(0, i) + '-' + str.substr(i);
|
||||
if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) {
|
||||
string = string.slice(0, i) + '-' + string.slice(i);
|
||||
isLastCharLower = false;
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = true;
|
||||
i++;
|
||||
} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) {
|
||||
string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = false;
|
||||
isLastCharLower = true;
|
||||
} else {
|
||||
isLastCharLower = (c.toLowerCase() === c);
|
||||
isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character;
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character;
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
return string;
|
||||
};
|
||||
|
||||
module.exports = function () {
|
||||
var str = [].map.call(arguments, function (str) {
|
||||
return str.trim();
|
||||
}).filter(function (str) {
|
||||
return str.length;
|
||||
}).join('-');
|
||||
const camelCase = (input, options) => {
|
||||
if (!(typeof input === 'string' || Array.isArray(input))) {
|
||||
throw new TypeError('Expected the input to be `string | string[]`');
|
||||
}
|
||||
|
||||
if (!str.length) {
|
||||
options = Object.assign({
|
||||
pascalCase: false
|
||||
}, options);
|
||||
|
||||
const postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x;
|
||||
|
||||
if (Array.isArray(input)) {
|
||||
input = input.map(x => x.trim())
|
||||
.filter(x => x.length)
|
||||
.join('-');
|
||||
} else {
|
||||
input = input.trim();
|
||||
}
|
||||
|
||||
if (input.length === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (str.length === 1) {
|
||||
return str;
|
||||
if (input.length === 1) {
|
||||
return options.pascalCase ? input.toUpperCase() : input.toLowerCase();
|
||||
}
|
||||
|
||||
if (!(/[_.\- ]+/).test(str)) {
|
||||
if (str === str.toUpperCase()) {
|
||||
return str.toLowerCase();
|
||||
}
|
||||
const hasUpperCase = input !== input.toLowerCase();
|
||||
|
||||
if (str[0] !== str[0].toLowerCase()) {
|
||||
return str[0].toLowerCase() + str.slice(1);
|
||||
}
|
||||
|
||||
return str;
|
||||
if (hasUpperCase) {
|
||||
input = preserveCamelCase(input);
|
||||
}
|
||||
|
||||
str = preserveCamelCase(str);
|
||||
input = input
|
||||
.replace(/^[_.\- ]+/, '')
|
||||
.toLowerCase()
|
||||
.replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase())
|
||||
.replace(/\d+(\w|$)/g, m => m.toUpperCase());
|
||||
|
||||
return str
|
||||
.replace(/^[_.\- ]+/, '')
|
||||
.toLowerCase()
|
||||
.replace(/[_.\- ]+(\w|$)/g, function (m, p1) {
|
||||
return p1.toUpperCase();
|
||||
});
|
||||
return postProcess(input);
|
||||
};
|
||||
|
||||
module.exports = camelCase;
|
||||
// TODO: Remove this for the next major release
|
||||
module.exports.default = camelCase;
|
||||
|
20
node_modules/camelcase/license
generated
vendored
20
node_modules/camelcase/license
generated
vendored
@ -1,21 +1,9 @@
|
||||
The MIT License (MIT)
|
||||
MIT License
|
||||
|
||||
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:
|
||||
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 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.
|
||||
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.
|
||||
|
44
node_modules/camelcase/package.json
generated
vendored
44
node_modules/camelcase/package.json
generated
vendored
@ -1,47 +1,49 @@
|
||||
{
|
||||
"_from": "camelcase@^2.0.1",
|
||||
"_id": "camelcase@2.1.1",
|
||||
"_from": "camelcase@^5.0.0",
|
||||
"_id": "camelcase@5.3.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=",
|
||||
"_integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
|
||||
"_location": "/camelcase",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "camelcase@^2.0.1",
|
||||
"raw": "camelcase@^5.0.0",
|
||||
"name": "camelcase",
|
||||
"escapedName": "camelcase",
|
||||
"rawSpec": "^2.0.1",
|
||||
"rawSpec": "^5.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.0.1"
|
||||
"fetchSpec": "^5.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/yargs"
|
||||
"/yargs-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
|
||||
"_shasum": "7c1d16d679a1bbe59ca02cacecfb011e201f5a1f",
|
||||
"_spec": "camelcase@^2.0.1",
|
||||
"_where": "/home/sergiu/linx-audio-simulator/node_modules/yargs",
|
||||
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||
"_shasum": "e3c9b31569e106811df242f715725a1f4c494320",
|
||||
"_spec": "camelcase@^5.0.0",
|
||||
"_where": "/home/sergiu/linx-simulator2/node_modules/yargs-parser",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/camelcase/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar",
|
||||
"description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/camelcase#readme",
|
||||
"keywords": [
|
||||
@ -56,7 +58,9 @@
|
||||
"separator",
|
||||
"string",
|
||||
"text",
|
||||
"convert"
|
||||
"convert",
|
||||
"pascalcase",
|
||||
"pascal-case"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "camelcase",
|
||||
@ -65,7 +69,7 @@
|
||||
"url": "git+https://github.com/sindresorhus/camelcase.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"version": "2.1.1"
|
||||
"version": "5.3.1"
|
||||
}
|
||||
|
60
node_modules/camelcase/readme.md
generated
vendored
60
node_modules/camelcase/readme.md
generated
vendored
@ -1,12 +1,25 @@
|
||||
# camelcase [](https://travis-ci.org/sindresorhus/camelcase)
|
||||
|
||||
> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar`
|
||||
> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=readme">Get professional support for 'camelcase' with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save camelcase
|
||||
$ npm install camelcase
|
||||
```
|
||||
|
||||
|
||||
@ -24,10 +37,10 @@ camelCase('foo_bar');
|
||||
camelCase('Foo-Bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('--foo.bar');
|
||||
//=> 'fooBar'
|
||||
camelCase('Foo-Bar', {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
|
||||
camelCase('__foo__bar__');
|
||||
camelCase('--foo.bar', {pascalCase: false});
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo bar');
|
||||
@ -38,20 +51,49 @@ console.log(process.argv[3]);
|
||||
camelCase(process.argv[3]);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo', 'bar');
|
||||
camelCase(['foo', 'bar']);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('__foo__', '--bar');
|
||||
//=> 'fooBar'
|
||||
camelCase(['__foo__', '--bar'], {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### camelCase(input, [options])
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string` `string[]`
|
||||
|
||||
String to convert to camel case.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### pascalCase
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Uppercase the first character: `foo-bar` → `FooBar`
|
||||
|
||||
|
||||
## Security
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
|
||||
## 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
|
||||
- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string
|
||||
- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
|
Reference in New Issue
Block a user