mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-17 01:16:00 +00:00
Modules
This commit is contained in:
20
node_modules/which-boxed-primitive/.editorconfig
generated
vendored
Normal file
20
node_modules/which-boxed-primitive/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 150
|
||||
|
||||
[CHANGELOG.md]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.json]
|
||||
max_line_length = off
|
||||
|
||||
[Makefile]
|
||||
max_line_length = off
|
9
node_modules/which-boxed-primitive/.eslintrc
generated
vendored
Normal file
9
node_modules/which-boxed-primitive/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"max-statements": [2, 12],
|
||||
},
|
||||
}
|
12
node_modules/which-boxed-primitive/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/which-boxed-primitive/.github/FUNDING.yml
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/which-boxed-primitive
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
313
node_modules/which-boxed-primitive/.travis.yml
generated
vendored
Normal file
313
node_modules/which-boxed-primitive/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,313 @@
|
||||
language: node_js
|
||||
os:
|
||||
- linux
|
||||
node_js:
|
||||
- "12.8"
|
||||
- "11.15"
|
||||
- "10.16"
|
||||
- "9.11"
|
||||
- "8.16"
|
||||
- "7.10"
|
||||
- "6.17"
|
||||
- "5.12"
|
||||
- "4.9"
|
||||
- "iojs-v3.3"
|
||||
- "iojs-v2.5"
|
||||
- "iojs-v1.8"
|
||||
- "0.12"
|
||||
- "0.10"
|
||||
- "0.8"
|
||||
before_install:
|
||||
- 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac'
|
||||
- 'nvm install-latest-npm'
|
||||
install:
|
||||
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
|
||||
script:
|
||||
- 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
|
||||
- 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
|
||||
- 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
|
||||
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
|
||||
sudo: false
|
||||
env:
|
||||
- TEST=true
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- node_js: "lts/*"
|
||||
env: PRETEST=true
|
||||
- node_js: "lts/*"
|
||||
env: POSTTEST=true
|
||||
- node_js: "4"
|
||||
env: COVERAGE=true
|
||||
- node_js: "12.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "12.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "12.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "12.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "12.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "12.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "12.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "12.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.14"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.13"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.12"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.10"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "11.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.15"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.14"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.13"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.12"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.10"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "10.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.10"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "9.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.15"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.14"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.13"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.12"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.10"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.16"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.15"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.14"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.13"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.12"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.10"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.10"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v3.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v3.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v3.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
allow_failures:
|
||||
- os: osx
|
||||
- env: TEST=true ALLOW_FAILURE=true
|
||||
- env: COVERAGE=true
|
27
node_modules/which-boxed-primitive/CHANGELOG.md
generated
vendored
Normal file
27
node_modules/which-boxed-primitive/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.0.1](https://github.com/ljharb/which-boxed-primitive/compare/v1.0.0...v1.0.1) - 2019-08-11
|
||||
|
||||
### Commits
|
||||
|
||||
- [meta] avoid running `safe-publish-latest` when not publishing [`140be87`](https://github.com/ljharb/which-boxed-primitive/commit/140be875149a3f413c80b68688d6edc92f668103)
|
||||
|
||||
## v1.0.0 - 2019-08-10
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] add `.travis.yml` [`764b0cf`](https://github.com/ljharb/which-boxed-primitive/commit/764b0cf75f8d2b3a0ad2056de5f4ad85d5d1b765)
|
||||
- Initial commit [`da7d068`](https://github.com/ljharb/which-boxed-primitive/commit/da7d068913d591294bf155db5d438f7804d71b9a)
|
||||
- readme [`1395bb2`](https://github.com/ljharb/which-boxed-primitive/commit/1395bb27b72137ac01e48ee398a0f54e93fd87f5)
|
||||
- [Tests] add tests [`0ff580f`](https://github.com/ljharb/which-boxed-primitive/commit/0ff580f99579cd4424af7b814bd76fcb69a2b04e)
|
||||
- implementation [`8811c32`](https://github.com/ljharb/which-boxed-primitive/commit/8811c3262a57963634cdc83ceb5bb2c5e9ae4e7e)
|
||||
- npm init [`cffdea9`](https://github.com/ljharb/which-boxed-primitive/commit/cffdea9755eabfa2f9ec62a6fcbce0c28f04495b)
|
||||
- [Tests] add `npm run lint` [`a8be993`](https://github.com/ljharb/which-boxed-primitive/commit/a8be9933fec1b21267acd847df77f6438e07e3b9)
|
||||
- [meta] add FUNDING.yml [`941258c`](https://github.com/ljharb/which-boxed-primitive/commit/941258c70c9a397466e05b614126cb8c7be77b99)
|
||||
- Only apps should have lockfiles [`6857316`](https://github.com/ljharb/which-boxed-primitive/commit/68573165d8ce842cdf15d94af82f8cccb961b8cf)
|
||||
- [Tests] use `npx aud` in `posttest` [`ee48a91`](https://github.com/ljharb/which-boxed-primitive/commit/ee48a9144bea23bde5cc47788a54d5aa7969d489)
|
21
node_modules/which-boxed-primitive/LICENSE
generated
vendored
Normal file
21
node_modules/which-boxed-primitive/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Jordan Harband
|
||||
|
||||
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.
|
76
node_modules/which-boxed-primitive/README.md
generated
vendored
Normal file
76
node_modules/which-boxed-primitive/README.md
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
# which-boxed-primitive <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
[![Build Status][3]][4]
|
||||
[![dependency status][5]][6]
|
||||
[![dev dependency status][7]][8]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][11]][1]
|
||||
|
||||
Which kind of boxed JS primitive is this? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and works despite ES6 Symbol.toStringTag.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var whichBoxedPrimitive = require('which-boxed-primitive');
|
||||
var assert = require('assert');
|
||||
|
||||
// unboxed primitives return `null`
|
||||
// boxed primitives return the builtin contructor name
|
||||
|
||||
assert.equal(whichBoxedPrimitive(undefined), null);
|
||||
assert.equal(whichBoxedPrimitive(null), null);
|
||||
|
||||
assert.equal(whichBoxedPrimitive(false), null);
|
||||
assert.equal(whichBoxedPrimitive(true), null);
|
||||
assert.equal(whichBoxedPrimitive(new Boolean(false)), 'Boolean');
|
||||
assert.equal(whichBoxedPrimitive(new Boolean(true)), 'Boolean');
|
||||
|
||||
assert.equal(whichBoxedPrimitive(42), null);
|
||||
assert.equal(whichBoxedPrimitive(NaN), null);
|
||||
assert.equal(whichBoxedPrimitive(Infinity), null);
|
||||
assert.equal(whichBoxedPrimitive(new Number(42)), 'Number');
|
||||
assert.equal(whichBoxedPrimitive(new Number(NaN)), 'Number');
|
||||
assert.equal(whichBoxedPrimitive(new Number(Infinity)), 'Number');
|
||||
|
||||
assert.equal(whichBoxedPrimitive(''), null);
|
||||
assert.equal(whichBoxedPrimitive('foo'), null);
|
||||
assert.equal(whichBoxedPrimitive(new String('')), 'String');
|
||||
assert.equal(whichBoxedPrimitive(new String('foo')), 'String');
|
||||
|
||||
assert.equal(whichBoxedPrimitive(Symbol()), null);
|
||||
assert.equal(whichBoxedPrimitive(Object(Symbol()), 'Symbol');
|
||||
|
||||
assert.equal(whichBoxedPrimitive(42n), null);
|
||||
assert.equal(whichBoxedPrimitive(Object(42n), 'BigInt');
|
||||
|
||||
// non-boxed-primitive objects return `undefined`
|
||||
assert.equal(whichBoxedPrimitive([]), undefined);
|
||||
assert.equal(whichBoxedPrimitive({}), undefined);
|
||||
assert.equal(whichBoxedPrimitive(/a/g), undefined);
|
||||
assert.equal(whichBoxedPrimitive(new RegExp('a', 'g')), undefined);
|
||||
assert.equal(whichBoxedPrimitive(new Date()), undefined);
|
||||
assert.equal(whichBoxedPrimitive(function () {}), undefined);
|
||||
assert.equal(whichBoxedPrimitive(function* () {}), undefined);
|
||||
assert.equal(whichBoxedPrimitive(x => x * x), undefined);
|
||||
assert.equal(whichBoxedPrimitive([]), undefined);
|
||||
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[1]: https://npmjs.org/package/which-boxed-primitive
|
||||
[2]: http://versionbadg.es/ljharb/which-boxed-primitive.svg
|
||||
[3]: https://travis-ci.org/ljharb/which-boxed-primitive.svg
|
||||
[4]: https://travis-ci.org/ljharb/which-boxed-primitive
|
||||
[5]: https://david-dm.org/ljharb/which-boxed-primitive.svg
|
||||
[6]: https://david-dm.org/ljharb/which-boxed-primitive
|
||||
[7]: https://david-dm.org/ljharb/which-boxed-primitive/dev-status.svg
|
||||
[8]: https://david-dm.org/ljharb/which-boxed-primitive#info=devDependencies
|
||||
[11]: https://nodei.co/npm/which-boxed-primitive.png?downloads=true&stars=true
|
||||
[license-image]: http://img.shields.io/npm/l/which-boxed-primitive.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: http://img.shields.io/npm/dm/which-boxed-primitive.svg
|
||||
[downloads-url]: http://npm-stat.com/charts.html?package=which-boxed-primitive
|
30
node_modules/which-boxed-primitive/index.js
generated
vendored
Normal file
30
node_modules/which-boxed-primitive/index.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var isString = require('is-string');
|
||||
var isNumber = require('is-number-object');
|
||||
var isBoolean = require('is-boolean-object');
|
||||
var isSymbol = require('is-symbol');
|
||||
var isBigInt = require('is-bigint');
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
module.exports = function whichBoxedPrimitive(value) {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (value == null || (typeof value !== 'object' && typeof value !== 'function')) {
|
||||
return null;
|
||||
}
|
||||
if (isString(value)) {
|
||||
return 'String';
|
||||
}
|
||||
if (isNumber(value)) {
|
||||
return 'Number';
|
||||
}
|
||||
if (isBoolean(value)) {
|
||||
return 'Boolean';
|
||||
}
|
||||
if (isSymbol(value)) {
|
||||
return 'Symbol';
|
||||
}
|
||||
if (isBigInt(value)) {
|
||||
return 'BigInt';
|
||||
}
|
||||
};
|
83
node_modules/which-boxed-primitive/package.json
generated
vendored
Normal file
83
node_modules/which-boxed-primitive/package.json
generated
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
{
|
||||
"_from": "which-boxed-primitive@^1.0.1",
|
||||
"_id": "which-boxed-primitive@1.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-7BT4TwISdDGBgaemWU0N0OU7FeAEJ9Oo2P1PHRm/FCWoEi2VLWC9b6xvxAA3C/NMpxg3HXVgi0sMmGbNUbNepQ==",
|
||||
"_location": "/which-boxed-primitive",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "which-boxed-primitive@^1.0.1",
|
||||
"name": "which-boxed-primitive",
|
||||
"escapedName": "which-boxed-primitive",
|
||||
"rawSpec": "^1.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/deep-equal"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.1.tgz",
|
||||
"_shasum": "cbe8f838ebe91ba2471bb69e9edbda67ab5a5ec1",
|
||||
"_spec": "which-boxed-primitive@^1.0.1",
|
||||
"_where": "C:\\Users\\matia\\Documents\\GitHub\\Musix\\node_modules\\deep-equal",
|
||||
"author": {
|
||||
"name": "Jordan Harband",
|
||||
"email": "ljharb@gmail.com"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"backfillLimit": false,
|
||||
"commitLimit": false,
|
||||
"template": "keepachangelog"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/which-boxed-primitive/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"is-bigint": "^1.0.0",
|
||||
"is-boolean-object": "^1.0.0",
|
||||
"is-number-object": "^1.0.3",
|
||||
"is-string": "^1.0.4",
|
||||
"is-symbol": "^1.0.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Which kind of boxed JS primitive is this?",
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^14.0.2",
|
||||
"auto-changelog": "^1.14.1",
|
||||
"eslint": "^6.1.0",
|
||||
"has-symbols": "^1.0.0",
|
||||
"in-publish": "^2.0.0",
|
||||
"object-inspect": "^1.6.0",
|
||||
"safe-publish-latest": "^1.1.2",
|
||||
"tape": "^4.11.0"
|
||||
},
|
||||
"homepage": "https://github.com/ljharb/which-boxed-primitive#readme",
|
||||
"keywords": [
|
||||
"boxed",
|
||||
"primitive",
|
||||
"object",
|
||||
"ecmascript",
|
||||
"javascript",
|
||||
"which"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "which-boxed-primitive",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ljharb/which-boxed-primitive.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"posttest": "npx aud",
|
||||
"prepublish": "not-in-publish || safe-publish-latest",
|
||||
"pretest": "npm run lint",
|
||||
"preversion": "auto-changelog",
|
||||
"test": "npm run tests-only",
|
||||
"tests-only": "node test"
|
||||
},
|
||||
"version": "1.0.1"
|
||||
}
|
66
node_modules/which-boxed-primitive/test/index.js
generated
vendored
Normal file
66
node_modules/which-boxed-primitive/test/index.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var inspect = require('object-inspect');
|
||||
var whichBoxedPrimitive = require('..');
|
||||
|
||||
var debug = function (v, m) { return inspect(v) + ' ' + m; };
|
||||
|
||||
var forEach = function (arr, func) {
|
||||
var i;
|
||||
for (i = 0; i < arr.length; ++i) {
|
||||
func(arr[i], i, arr);
|
||||
}
|
||||
};
|
||||
|
||||
var hasSymbols = require('has-symbols')();
|
||||
var hasBigInts = typeof BigInt === 'function';
|
||||
|
||||
var primitives = [
|
||||
true,
|
||||
false,
|
||||
42,
|
||||
NaN,
|
||||
Infinity,
|
||||
'',
|
||||
'foo'
|
||||
].concat(
|
||||
hasSymbols ? [Symbol(), Symbol.iterator] : [],
|
||||
hasBigInts ? BigInt(42) : []
|
||||
);
|
||||
|
||||
var objects = [
|
||||
/a/g,
|
||||
new Date(),
|
||||
function () {},
|
||||
[],
|
||||
{}
|
||||
];
|
||||
|
||||
test('isBoxedPrimitive', function (t) {
|
||||
t.test('unboxed primitives', function (st) {
|
||||
forEach([null, undefined].concat(primitives), function (primitive) {
|
||||
st.equal(null, whichBoxedPrimitive(primitive), debug(primitive, 'is a primitive, but not a boxed primitive'));
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('boxed primitives', function (st) {
|
||||
forEach(primitives, function (primitive) {
|
||||
var boxed = Object(primitive);
|
||||
var expected = boxed.constructor.name;
|
||||
st.equal(typeof expected, 'string', 'expected is string');
|
||||
st.equal(whichBoxedPrimitive(boxed), expected, debug(boxed, 'is a boxed primitive: ' + expected));
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('non-primitive objects', function (st) {
|
||||
forEach(objects, function (object) {
|
||||
st.equal(undefined, whichBoxedPrimitive(object), debug(object, 'is not a primitive, boxed or otherwise'));
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
Reference in New Issue
Block a user