mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-17 01:16:00 +00:00
Modules
This commit is contained in:
38
node_modules/arrify/index.d.ts
generated
vendored
Normal file
38
node_modules/arrify/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/**
|
||||
Convert a value to an array.
|
||||
|
||||
_Supplying `null` or `undefined` results in an empty array._
|
||||
|
||||
@example
|
||||
```
|
||||
import arrify = require('arrify');
|
||||
|
||||
arrify('🦄');
|
||||
//=> ['🦄']
|
||||
|
||||
arrify(['🦄']);
|
||||
//=> ['🦄']
|
||||
|
||||
arrify(new Set(['🦄']));
|
||||
//=> ['🦄']
|
||||
|
||||
arrify(null);
|
||||
//=> []
|
||||
|
||||
arrify(undefined);
|
||||
//=> []
|
||||
```
|
||||
*/
|
||||
declare function arrify<ValueType>(
|
||||
value: ValueType
|
||||
): ValueType extends (null | undefined)
|
||||
? []
|
||||
: ValueType extends string
|
||||
? [string]
|
||||
: ValueType extends ReadonlyArray<unknown> // TODO: Use 'readonly unknown[]' in the next major version
|
||||
? ValueType
|
||||
: ValueType extends Iterable<infer T>
|
||||
? T[]
|
||||
: [ValueType];
|
||||
|
||||
export = arrify;
|
23
node_modules/arrify/index.js
generated
vendored
Normal file
23
node_modules/arrify/index.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
const arrify = value => {
|
||||
if (value === null || value === undefined) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (typeof value === 'string') {
|
||||
return [value];
|
||||
}
|
||||
|
||||
if (typeof value[Symbol.iterator] === 'function') {
|
||||
return [...value];
|
||||
}
|
||||
|
||||
return [value];
|
||||
};
|
||||
|
||||
module.exports = arrify;
|
9
node_modules/arrify/license
generated
vendored
Normal file
9
node_modules/arrify/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
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:
|
||||
|
||||
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.
|
74
node_modules/arrify/package.json
generated
vendored
Normal file
74
node_modules/arrify/package.json
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"arrify@2.0.1",
|
||||
"C:\\Users\\matia\\Musix"
|
||||
]
|
||||
],
|
||||
"_from": "arrify@2.0.1",
|
||||
"_id": "arrify@2.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==",
|
||||
"_location": "/arrify",
|
||||
"_optional": true,
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "arrify@2.0.1",
|
||||
"name": "arrify",
|
||||
"escapedName": "arrify",
|
||||
"rawSpec": "2.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@google-cloud/common",
|
||||
"/@google-cloud/paginator",
|
||||
"/@google-cloud/storage",
|
||||
"/google-auth-library"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
|
||||
"_spec": "2.0.1",
|
||||
"_where": "C:\\Users\\matia\\Musix",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/arrify/issues"
|
||||
},
|
||||
"description": "Convert a value to an array",
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/arrify#readme",
|
||||
"keywords": [
|
||||
"array",
|
||||
"arrify",
|
||||
"arrayify",
|
||||
"convert",
|
||||
"value",
|
||||
"ensure"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "arrify",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/arrify.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"version": "2.0.1"
|
||||
}
|
39
node_modules/arrify/readme.md
generated
vendored
Normal file
39
node_modules/arrify/readme.md
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
# arrify [](https://travis-ci.org/sindresorhus/arrify)
|
||||
|
||||
> Convert a value to an array
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install arrify
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const arrify = require('arrify');
|
||||
|
||||
arrify('🦄');
|
||||
//=> ['🦄']
|
||||
|
||||
arrify(['🦄']);
|
||||
//=> ['🦄']
|
||||
|
||||
arrify(new Set(['🦄']));
|
||||
//=> ['🦄']
|
||||
|
||||
arrify(null);
|
||||
//=> []
|
||||
|
||||
arrify(undefined);
|
||||
//=> []
|
||||
```
|
||||
|
||||
*Supplying `null` or `undefined` results in an empty array.*
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
Reference in New Issue
Block a user