Fix dependabot issues
This commit is contained in:
parent
c89d9bd8b0
commit
531c6ba7c8
705 changed files with 53406 additions and 20466 deletions
114
node_modules/camelcase/index.d.ts
generated
vendored
114
node_modules/camelcase/index.d.ts
generated
vendored
|
|
@ -6,58 +6,96 @@ declare namespace camelcase {
|
|||
@default false
|
||||
*/
|
||||
readonly pascalCase?: boolean;
|
||||
|
||||
/**
|
||||
Preserve the consecutive uppercase characters: `foo-BAR` → `FooBAR`.
|
||||
|
||||
@default false
|
||||
*/
|
||||
readonly preserveConsecutiveUppercase?: boolean;
|
||||
|
||||
/**
|
||||
The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used.
|
||||
|
||||
Default: The host environment’s current locale.
|
||||
|
||||
@example
|
||||
```
|
||||
import camelCase = require('camelcase');
|
||||
|
||||
camelCase('lorem-ipsum', {locale: 'en-US'});
|
||||
//=> 'loremIpsum'
|
||||
camelCase('lorem-ipsum', {locale: 'tr-TR'});
|
||||
//=> 'loremİpsum'
|
||||
camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']});
|
||||
//=> 'loremIpsum'
|
||||
camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']});
|
||||
//=> 'loremİpsum'
|
||||
```
|
||||
*/
|
||||
readonly locale?: string | readonly string[];
|
||||
}
|
||||
}
|
||||
|
||||
declare const camelcase: {
|
||||
/**
|
||||
Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`.
|
||||
/**
|
||||
Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`.
|
||||
|
||||
@param input - String to convert to camel case.
|
||||
Correctly handles Unicode strings.
|
||||
|
||||
@example
|
||||
```
|
||||
import camelCase = require('camelcase');
|
||||
@param input - String to convert to camel case.
|
||||
|
||||
camelCase('foo-bar');
|
||||
//=> 'fooBar'
|
||||
@example
|
||||
```
|
||||
import camelCase = require('camelcase');
|
||||
|
||||
camelCase('foo_bar');
|
||||
//=> 'fooBar'
|
||||
camelCase('foo-bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar');
|
||||
//=> 'fooBar'
|
||||
camelCase('foo_bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar', {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
camelCase('Foo-Bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('--foo.bar', {pascalCase: false});
|
||||
//=> 'fooBar'
|
||||
camelCase('розовый_пушистый_единороги');
|
||||
//=> 'розовыйПушистыйЕдинороги'
|
||||
|
||||
camelCase('foo bar');
|
||||
//=> 'fooBar'
|
||||
camelCase('Foo-Bar', {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
|
||||
console.log(process.argv[3]);
|
||||
//=> '--foo-bar'
|
||||
camelCase(process.argv[3]);
|
||||
//=> 'fooBar'
|
||||
camelCase('--foo.bar', {pascalCase: false});
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['foo', 'bar']);
|
||||
//=> 'fooBar'
|
||||
camelCase('Foo-BAR', {preserveConsecutiveUppercase: true});
|
||||
//=> 'fooBAR'
|
||||
|
||||
camelCase(['__foo__', '--bar'], {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
```
|
||||
*/
|
||||
(input: string | ReadonlyArray<string>, options?: camelcase.Options): string;
|
||||
camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true}));
|
||||
//=> 'FooBAR'
|
||||
|
||||
// TODO: Remove this for the next major release, refactor the whole definition to:
|
||||
// declare function camelcase(
|
||||
// input: string | ReadonlyArray<string>,
|
||||
// options?: camelcase.Options
|
||||
// ): string;
|
||||
// export = camelcase;
|
||||
default: typeof camelcase;
|
||||
};
|
||||
camelCase('foo bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
console.log(process.argv[3]);
|
||||
//=> '--foo-bar'
|
||||
camelCase(process.argv[3]);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['foo', 'bar']);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['__foo__', '--bar'], {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
|
||||
camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true})
|
||||
//=> 'FooBAR'
|
||||
|
||||
camelCase('lorem-ipsum', {locale: 'en-US'});
|
||||
//=> 'loremIpsum'
|
||||
```
|
||||
*/
|
||||
declare function camelcase(
|
||||
input: string | readonly string[],
|
||||
options?: camelcase.Options
|
||||
): string;
|
||||
|
||||
export = camelcase;
|
||||
|
|
|
|||
53
node_modules/camelcase/index.js
generated
vendored
53
node_modules/camelcase/index.js
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
const preserveCamelCase = string => {
|
||||
const preserveCamelCase = (string, locale) => {
|
||||
let isLastCharLower = false;
|
||||
let isLastCharUpper = false;
|
||||
let isLastLastCharUpper = false;
|
||||
|
|
@ -8,37 +8,46 @@ const preserveCamelCase = string => {
|
|||
for (let i = 0; i < string.length; i++) {
|
||||
const character = string[i];
|
||||
|
||||
if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) {
|
||||
if (isLastCharLower && /[\p{Lu}]/u.test(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) {
|
||||
} else if (isLastCharUpper && isLastLastCharUpper && /[\p{Ll}]/u.test(character)) {
|
||||
string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = false;
|
||||
isLastCharLower = true;
|
||||
} else {
|
||||
isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character;
|
||||
isLastCharLower = character.toLocaleLowerCase(locale) === character && character.toLocaleUpperCase(locale) !== character;
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character;
|
||||
isLastCharUpper = character.toLocaleUpperCase(locale) === character && character.toLocaleLowerCase(locale) !== character;
|
||||
}
|
||||
}
|
||||
|
||||
return string;
|
||||
};
|
||||
|
||||
const preserveConsecutiveUppercase = input => {
|
||||
return input.replace(/^[\p{Lu}](?![\p{Lu}])/gu, m1 => m1.toLowerCase());
|
||||
};
|
||||
|
||||
const postProcess = (input, options) => {
|
||||
return input.replace(/[_.\- ]+([\p{Alpha}\p{N}_]|$)/gu, (_, p1) => p1.toLocaleUpperCase(options.locale))
|
||||
.replace(/\d+([\p{Alpha}\p{N}_]|$)/gu, m => m.toLocaleUpperCase(options.locale));
|
||||
};
|
||||
|
||||
const camelCase = (input, options) => {
|
||||
if (!(typeof input === 'string' || Array.isArray(input))) {
|
||||
throw new TypeError('Expected the input to be `string | string[]`');
|
||||
}
|
||||
|
||||
options = Object.assign({
|
||||
pascalCase: false
|
||||
}, options);
|
||||
|
||||
const postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x;
|
||||
options = {
|
||||
pascalCase: false,
|
||||
preserveConsecutiveUppercase: false,
|
||||
...options
|
||||
};
|
||||
|
||||
if (Array.isArray(input)) {
|
||||
input = input.map(x => x.trim())
|
||||
|
|
@ -53,22 +62,28 @@ const camelCase = (input, options) => {
|
|||
}
|
||||
|
||||
if (input.length === 1) {
|
||||
return options.pascalCase ? input.toUpperCase() : input.toLowerCase();
|
||||
return options.pascalCase ? input.toLocaleUpperCase(options.locale) : input.toLocaleLowerCase(options.locale);
|
||||
}
|
||||
|
||||
const hasUpperCase = input !== input.toLowerCase();
|
||||
const hasUpperCase = input !== input.toLocaleLowerCase(options.locale);
|
||||
|
||||
if (hasUpperCase) {
|
||||
input = preserveCamelCase(input);
|
||||
input = preserveCamelCase(input, options.locale);
|
||||
}
|
||||
|
||||
input = input
|
||||
.replace(/^[_.\- ]+/, '')
|
||||
.toLowerCase()
|
||||
.replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase())
|
||||
.replace(/\d+(\w|$)/g, m => m.toUpperCase());
|
||||
input = input.replace(/^[_.\- ]+/, '');
|
||||
|
||||
return postProcess(input);
|
||||
if (options.preserveConsecutiveUppercase) {
|
||||
input = preserveConsecutiveUppercase(input);
|
||||
} else {
|
||||
input = input.toLocaleLowerCase();
|
||||
}
|
||||
|
||||
if (options.pascalCase) {
|
||||
input = input.charAt(0).toLocaleUpperCase(options.locale) + input.slice(1);
|
||||
}
|
||||
|
||||
return postProcess(input, options);
|
||||
};
|
||||
|
||||
module.exports = camelCase;
|
||||
|
|
|
|||
2
node_modules/camelcase/license
generated
vendored
2
node_modules/camelcase/license
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://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:
|
||||
|
||||
|
|
|
|||
11
node_modules/camelcase/package.json
generated
vendored
11
node_modules/camelcase/package.json
generated
vendored
|
|
@ -1,16 +1,17 @@
|
|||
{
|
||||
"name": "camelcase",
|
||||
"version": "5.3.1",
|
||||
"version": "6.2.0",
|
||||
"description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/camelcase",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
"node": ">=10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
|
|
@ -37,7 +38,7 @@
|
|||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.28.3"
|
||||
}
|
||||
}
|
||||
81
node_modules/camelcase/readme.md
generated
vendored
81
node_modules/camelcase/readme.md
generated
vendored
|
|
@ -1,20 +1,8 @@
|
|||
# camelcase [](https://travis-ci.org/sindresorhus/camelcase)
|
||||
# camelcase [](https://travis-ci.com/sindresorhus/camelcase)
|
||||
|
||||
> 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>
|
||||
|
||||
---
|
||||
Correctly handles Unicode strings.
|
||||
|
||||
## Install
|
||||
|
||||
|
|
@ -22,6 +10,7 @@
|
|||
$ npm install camelcase
|
||||
```
|
||||
|
||||
*If you need to support Firefox, stay on version 5 as version 6 uses regex features not available in Firefox.*
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
@ -37,12 +26,21 @@ camelCase('foo_bar');
|
|||
camelCase('Foo-Bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('розовый_пушистый_единороги');
|
||||
//=> 'розовыйПушистыйЕдинороги'
|
||||
|
||||
camelCase('Foo-Bar', {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
|
||||
camelCase('--foo.bar', {pascalCase: false});
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-BAR', {preserveConsecutiveUppercase: true});
|
||||
//=> 'fooBAR'
|
||||
|
||||
camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true}));
|
||||
//=> 'FooBAR'
|
||||
|
||||
camelCase('foo bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
|
|
@ -56,35 +54,70 @@ camelCase(['foo', 'bar']);
|
|||
|
||||
camelCase(['__foo__', '--bar'], {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
```
|
||||
|
||||
camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true})
|
||||
//=> 'FooBAR'
|
||||
|
||||
camelCase('lorem-ipsum', {locale: 'en-US'});
|
||||
//=> 'loremIpsum'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### camelCase(input, [options])
|
||||
### camelCase(input, options?)
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string` `string[]`
|
||||
Type: `string | string[]`
|
||||
|
||||
String to convert to camel case.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
Type: `object`
|
||||
|
||||
##### pascalCase
|
||||
|
||||
Type: `boolean`<br>
|
||||
Type: `boolean`\
|
||||
Default: `false`
|
||||
|
||||
Uppercase the first character: `foo-bar` → `FooBar`
|
||||
|
||||
##### preserveConsecutiveUppercase
|
||||
|
||||
## Security
|
||||
Type: `boolean`\
|
||||
Default: `false`
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
Preserve the consecutive uppercase characters: `foo-BAR` → `FooBAR`.
|
||||
|
||||
##### locale
|
||||
|
||||
Type: `string | string[]`\
|
||||
Default: The host environment’s current locale.
|
||||
|
||||
The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used.
|
||||
|
||||
```js
|
||||
const camelCase = require('camelcase');
|
||||
|
||||
camelCase('lorem-ipsum', {locale: 'en-US'});
|
||||
//=> 'loremIpsum'
|
||||
|
||||
camelCase('lorem-ipsum', {locale: 'tr-TR'});
|
||||
//=> 'loremİpsum'
|
||||
|
||||
camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']});
|
||||
//=> 'loremIpsum'
|
||||
|
||||
camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']});
|
||||
//=> 'loremİpsum'
|
||||
```
|
||||
|
||||
## camelcase for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of camelcase and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
|
||||
## Related
|
||||
|
||||
|
|
@ -92,8 +125,4 @@ To report a security vulnerability, please use the [Tidelift security contact](h
|
|||
- [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](https://sindresorhus.com)
|
||||
- [camelcase-keys](https://github.com/sindresorhus/camelcase-keys) - Convert object keys to camel case
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue