feature: tests

This commit is contained in:
Joel Male 2022-11-10 23:06:47 +10:00
parent ee20d8c79e
commit 80541e6fb8
52 changed files with 6109 additions and 832 deletions

View File

@ -6,4 +6,4 @@ updates:
directory: "/"
# Check the npm registry for updates every day (weekdays)
schedule:
interval: "daily"
interval: "weekly"

9
.github/mergify.yml vendored
View File

@ -1,9 +0,0 @@
pull_request_rules:
- name: automatic merge for develop raised by dependabot with label dependencies
conditions:
- base=develop
- label=dependencies
- -conflict
actions:
merge:
method: merge

40
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Tests
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
release:
types:
- created
jobs:
tests:
name: Tests
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
node-version: [14.x, 16.x]
stability: [prefer-stable]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile --${{ matrix.stability }}
- name: Execute tests
run: yarn test

10
__tests__/main.test.ts Normal file
View File

@ -0,0 +1,10 @@
import { http } from '../src/http'
import {expect, test} from '@jest/globals'
test('it makes a post request', async () => {
const url = 'https://httpbin.org/post'
const body = '{"hello": "world"}'
const insecure = false
const res = await http.make(url, body)
expect(res.status).toBe(200)
})

1
babel.config.js Normal file
View File

@ -0,0 +1 @@
module.exports = {presets: ['@babel/preset-env']}

4
dist/index.js vendored
View File

@ -6940,7 +6940,7 @@ exports.http = void 0;
const node_fetch_1 = __nccwpck_require__(4429);
var https = __nccwpck_require__(5687);
class Http {
make(url, headers, body, ignoreCertificate) {
make(url, body, headers = null, ignoreCertificate = false) {
return new Promise((resolve, reject) => {
(0, node_fetch_1.default)(url, this.getOptions('post', headers, body, ignoreCertificate)).then((res) => resolve(res));
});
@ -7010,7 +7010,7 @@ function run() {
}
core.info(`Sending webhook request to ${url}`);
http_1.http
.make(url, headers, body, insecure)
.make(url, body, headers, insecure)
.then(res => {
if (res.status >= 400) {
error(res.status);

7
jest.config.js Normal file
View File

@ -0,0 +1,7 @@
module.exports = {
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(js)$': 'babel-jest'
},
transformIgnorePatterns: []
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,13 +1,11 @@
'use strict';
module.exports = string => {
if (typeof string !== 'string') {
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
module.exports = function (str) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}
// Escape characters with special meaning either inside or outside character sets.
// Use a simple backslash escape when its always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns stricter grammar.
return string
.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
.replace(/-/g, '\\x2d');
return str.replace(matchOperatorsRe, '\\$&');
};

View File

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

View File

@ -1,38 +1,41 @@
{
"name": "escape-string-regexp",
"version": "4.0.0",
"description": "Escape RegExp special characters",
"license": "MIT",
"repository": "sindresorhus/escape-string-regexp",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"escape",
"regex",
"regexp",
"regular",
"expression",
"string",
"special",
"characters"
],
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.11.0",
"xo": "^0.28.3"
}
"name": "escape-string-regexp",
"version": "1.0.5",
"description": "Escape RegExp special characters",
"license": "MIT",
"repository": "sindresorhus/escape-string-regexp",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"maintainers": [
"Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
"Joshua Boy Nicolai Appelman <joshua@jbna.nl> (jbna.nl)"
],
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"escape",
"regex",
"regexp",
"re",
"regular",
"expression",
"string",
"str",
"special",
"characters"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
}

View File

@ -2,33 +2,26 @@
> Escape RegExp special characters
## Install
```
$ npm install escape-string-regexp
$ npm install --save escape-string-regexp
```
## Usage
```js
const escapeStringRegexp = require('escape-string-regexp');
const escapedString = escapeStringRegexp('How much $ for a 🦄?');
//=> 'How much \\$ for a 🦄\\?'
const escapedString = escapeStringRegexp('how much $ for a unicorn?');
//=> 'how much \$ for a unicorn\?'
new RegExp(escapedString);
```
You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.
---
## License
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-escape-string-regexp?utm_source=npm-escape-string-regexp&utm_medium=referral&utm_campaign=readme">Get professional support for this package 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>
MIT © [Sindre Sorhus](http://sindresorhus.com)

2
node_modules/find-up/license generated vendored
View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
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:

15
node_modules/find-up/package.json generated vendored
View File

@ -1,17 +1,16 @@
{
"name": "find-up",
"version": "5.0.0",
"version": "4.1.0",
"description": "Find a file or directory by walking up parent directories",
"license": "MIT",
"repository": "sindresorhus/find-up",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
"url": "sindresorhus.com"
},
"engines": {
"node": ">=10"
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
@ -41,14 +40,14 @@
"path"
],
"dependencies": {
"locate-path": "^6.0.0",
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
},
"devDependencies": {
"ava": "^2.1.0",
"is-path-inside": "^2.1.0",
"tempy": "^0.6.0",
"tsd": "^0.13.1",
"xo": "^0.33.0"
"tempy": "^0.3.0",
"tsd": "^0.7.3",
"xo": "^0.24.0"
}
}

15
node_modules/find-up/readme.md generated vendored
View File

@ -1,13 +1,15 @@
# find-up [![Build Status](https://travis-ci.com/sindresorhus/find-up.svg?branch=master)](https://travis-ci.com/github/sindresorhus/find-up)
# find-up [![Build Status](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up)
> Find a file or directory by walking up parent directories
## Install
```
$ npm install find-up
```
## Usage
```
@ -42,6 +44,7 @@ const findUp = require('find-up');
})();
```
## API
### findUp(name, options?)
@ -82,22 +85,22 @@ Type: `object`
##### cwd
Type: `string`\
Type: `string`<br>
Default: `process.cwd()`
Directory to start from.
##### type
Type: `string`\
Default: `'file'`\
Type: `string`<br>
Default: `'file'`<br>
Values: `'file'` `'directory'`
The type of paths that can match.
##### allowSymlinks
Type: `boolean`\
Type: `boolean`<br>
Default: `true`
Allow symbolic links to match if they point to the chosen path type.
@ -131,6 +134,7 @@ const findUp = require('find-up');
})();
```
## Related
- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module
@ -138,6 +142,7 @@ const findUp = require('find-up');
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package
- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path
---
<div align="center">

263
node_modules/globals/globals.json generated vendored
View File

@ -1,6 +1,5 @@
{
"builtin": {
"AggregateError": false,
"Array": false,
"ArrayBuffer": false,
"Atomics": false,
@ -19,7 +18,6 @@
"escape": false,
"eval": false,
"EvalError": false,
"FinalizationRegistry": false,
"Float32Array": false,
"Float64Array": false,
"Function": false,
@ -64,7 +62,6 @@
"URIError": false,
"valueOf": false,
"WeakMap": false,
"WeakRef": false,
"WeakSet": false
},
"es5": {
@ -227,139 +224,6 @@
"WeakMap": false,
"WeakSet": false
},
"es2020": {
"Array": false,
"ArrayBuffer": false,
"Atomics": false,
"BigInt": false,
"BigInt64Array": false,
"BigUint64Array": false,
"Boolean": false,
"constructor": false,
"DataView": false,
"Date": false,
"decodeURI": false,
"decodeURIComponent": false,
"encodeURI": false,
"encodeURIComponent": false,
"Error": false,
"escape": false,
"eval": false,
"EvalError": false,
"Float32Array": false,
"Float64Array": false,
"Function": false,
"globalThis": false,
"hasOwnProperty": false,
"Infinity": false,
"Int16Array": false,
"Int32Array": false,
"Int8Array": false,
"isFinite": false,
"isNaN": false,
"isPrototypeOf": false,
"JSON": false,
"Map": false,
"Math": false,
"NaN": false,
"Number": false,
"Object": false,
"parseFloat": false,
"parseInt": false,
"Promise": false,
"propertyIsEnumerable": false,
"Proxy": false,
"RangeError": false,
"ReferenceError": false,
"Reflect": false,
"RegExp": false,
"Set": false,
"SharedArrayBuffer": false,
"String": false,
"Symbol": false,
"SyntaxError": false,
"toLocaleString": false,
"toString": false,
"TypeError": false,
"Uint16Array": false,
"Uint32Array": false,
"Uint8Array": false,
"Uint8ClampedArray": false,
"undefined": false,
"unescape": false,
"URIError": false,
"valueOf": false,
"WeakMap": false,
"WeakSet": false
},
"es2021": {
"AggregateError": false,
"Array": false,
"ArrayBuffer": false,
"Atomics": false,
"BigInt": false,
"BigInt64Array": false,
"BigUint64Array": false,
"Boolean": false,
"constructor": false,
"DataView": false,
"Date": false,
"decodeURI": false,
"decodeURIComponent": false,
"encodeURI": false,
"encodeURIComponent": false,
"Error": false,
"escape": false,
"eval": false,
"EvalError": false,
"FinalizationRegistry": false,
"Float32Array": false,
"Float64Array": false,
"Function": false,
"globalThis": false,
"hasOwnProperty": false,
"Infinity": false,
"Int16Array": false,
"Int32Array": false,
"Int8Array": false,
"isFinite": false,
"isNaN": false,
"isPrototypeOf": false,
"JSON": false,
"Map": false,
"Math": false,
"NaN": false,
"Number": false,
"Object": false,
"parseFloat": false,
"parseInt": false,
"Promise": false,
"propertyIsEnumerable": false,
"Proxy": false,
"RangeError": false,
"ReferenceError": false,
"Reflect": false,
"RegExp": false,
"Set": false,
"SharedArrayBuffer": false,
"String": false,
"Symbol": false,
"SyntaxError": false,
"toLocaleString": false,
"toString": false,
"TypeError": false,
"Uint16Array": false,
"Uint32Array": false,
"Uint8Array": false,
"Uint8ClampedArray": false,
"undefined": false,
"unescape": false,
"URIError": false,
"valueOf": false,
"WeakMap": false,
"WeakRef": false,
"WeakSet": false
},
"browser": {
"AbortController": false,
"AbortSignal": false,
@ -388,7 +252,7 @@
"AudioParam": false,
"AudioProcessingEvent": false,
"AudioScheduledSourceNode": false,
"AudioWorkletGlobalScope": false,
"AudioWorkletGlobalScope ": false,
"AudioWorkletNode": false,
"AudioWorkletProcessor": false,
"BarProp": false,
@ -442,24 +306,15 @@
"CSSImportRule": false,
"CSSKeyframeRule": false,
"CSSKeyframesRule": false,
"CSSMatrixComponent": false,
"CSSMediaRule": false,
"CSSNamespaceRule": false,
"CSSPageRule": false,
"CSSPerspective": false,
"CSSRotate": false,
"CSSRule": false,
"CSSRuleList": false,
"CSSScale": false,
"CSSSkew": false,
"CSSSkewX": false,
"CSSSkewY": false,
"CSSStyleDeclaration": false,
"CSSStyleRule": false,
"CSSStyleSheet": false,
"CSSSupportsRule": false,
"CSSTransformValue": false,
"CSSTranslate": false,
"CustomElementRegistry": false,
"customElements": false,
"CustomEvent": false,
@ -487,7 +342,6 @@
"DOMPointReadOnly": false,
"DOMQuad": false,
"DOMRect": false,
"DOMRectList": false,
"DOMRectReadOnly": false,
"DOMStringList": false,
"DOMStringMap": false,
@ -511,7 +365,6 @@
"FontFace": false,
"FontFaceSetLoadEvent": false,
"FormData": false,
"FormDataEvent": false,
"frameElement": false,
"frames": false,
"GainNode": false,
@ -647,7 +500,6 @@
"MediaKeyStatusMap": false,
"MediaKeySystemAccess": false,
"MediaList": false,
"MediaMetadata": false,
"MediaQueryList": false,
"MediaQueryListEvent": false,
"MediaRecorder": false,
@ -694,7 +546,6 @@
"OfflineAudioContext": false,
"offscreenBuffering": false,
"OffscreenCanvas": true,
"OffscreenCanvasRenderingContext2D": false,
"onabort": true,
"onafterprint": true,
"onanimationend": true,
@ -799,7 +650,6 @@
"OscillatorNode": false,
"outerHeight": false,
"outerWidth": false,
"OverconstrainedError": false,
"PageTransitionEvent": false,
"pageXOffset": false,
"pageYOffset": false,
@ -856,7 +706,6 @@
"registerProcessor": false,
"RemotePlayback": false,
"removeEventListener": false,
"reportError": false,
"Request": false,
"requestAnimationFrame": false,
"requestIdleCallback": false,
@ -919,11 +768,9 @@
"Storage": false,
"StorageEvent": false,
"StorageManager": false,
"structuredClone": false,
"styleMedia": false,
"StyleSheet": false,
"StyleSheetList": false,
"SubmitEvent": false,
"SubtleCrypto": false,
"SVGAElement": false,
"SVGAngle": false,
@ -1040,7 +887,6 @@
"TouchEvent": false,
"TouchList": false,
"TrackEvent": false,
"TransformStream": false,
"TransitionEvent": false,
"TreeWalker": false,
"UIEvent": false,
@ -1098,9 +944,6 @@
"clearTimeout": false,
"close": true,
"console": false,
"CustomEvent": false,
"ErrorEvent": false,
"Event": false,
"fetch": false,
"FileReaderSync": false,
"FormData": false,
@ -1121,7 +964,6 @@
"indexedDB": false,
"location": false,
"MessageChannel": false,
"MessageEvent": false,
"MessagePort": false,
"name": false,
"navigator": false,
@ -1147,7 +989,6 @@
"Promise": false,
"queueMicrotask": false,
"removeEventListener": false,
"reportError": false,
"Request": false,
"Response": false,
"self": true,
@ -1166,65 +1007,21 @@
"node": {
"__dirname": false,
"__filename": false,
"AbortController": false,
"AbortSignal": false,
"atob": false,
"btoa": false,
"Buffer": false,
"clearImmediate": false,
"clearInterval": false,
"clearTimeout": false,
"console": false,
"DOMException": false,
"Event": false,
"EventTarget": false,
"exports": true,
"fetch": false,
"global": false,
"Intl": false,
"MessageChannel": false,
"MessageEvent": false,
"MessagePort": false,
"module": false,
"performance": false,
"process": false,
"queueMicrotask": false,
"require": false,
"setImmediate": false,
"setInterval": false,
"setTimeout": false,
"structuredClone": false,
"TextDecoder": false,
"TextEncoder": false,
"URL": false,
"URLSearchParams": false
},
"nodeBuiltin": {
"AbortController": false,
"AbortSignal": false,
"atob": false,
"btoa": false,
"Buffer": false,
"clearImmediate": false,
"clearInterval": false,
"clearTimeout": false,
"console": false,
"DOMException": false,
"Event": false,
"EventTarget": false,
"fetch": false,
"global": false,
"Intl": false,
"MessageChannel": false,
"MessageEvent": false,
"MessagePort": false,
"performance": false,
"process": false,
"queueMicrotask": false,
"setImmediate": false,
"setInterval": false,
"setTimeout": false,
"structuredClone": false,
"TextDecoder": false,
"TextEncoder": false,
"URL": false,
@ -1269,7 +1066,6 @@
"beforeEach": false,
"describe": false,
"expect": false,
"expectAsync": false,
"fail": false,
"fdescribe": false,
"fit": false,
@ -1278,7 +1074,6 @@
"pending": false,
"runs": false,
"spyOn": false,
"spyOnAllFunctions": false,
"spyOnProperty": false,
"waits": false,
"waitsFor": false,
@ -1388,19 +1183,17 @@
"quit": false
},
"wsh": {
"ActiveXObject": false,
"CollectGarbage": false,
"Debug": false,
"Enumerator": false,
"GetObject": false,
"RuntimeObject": false,
"ScriptEngine": false,
"ScriptEngineBuildVersion": false,
"ScriptEngineMajorVersion": false,
"ScriptEngineMinorVersion": false,
"VBArray": false,
"WScript": false,
"WSH": false
"ActiveXObject": true,
"Enumerator": true,
"GetObject": true,
"ScriptEngine": true,
"ScriptEngineBuildVersion": true,
"ScriptEngineMajorVersion": true,
"ScriptEngineMinorVersion": true,
"VBArray": true,
"WScript": true,
"WSH": true,
"XDomainRequest": true
},
"jquery": {
"$": false,
@ -1483,6 +1276,7 @@
"Try": false
},
"meteor": {
"_": false,
"$": false,
"Accounts": false,
"AccountsClient": false,
@ -1588,9 +1382,6 @@
"Clients": false,
"close": true,
"console": false,
"CustomEvent": false,
"ErrorEvent": false,
"Event": false,
"ExtendableEvent": false,
"ExtendableMessageEvent": false,
"fetch": false,
@ -1614,7 +1405,6 @@
"indexedDB": false,
"location": false,
"MessageChannel": false,
"MessageEvent": false,
"MessagePort": false,
"name": false,
"navigator": false,
@ -1672,7 +1462,6 @@
},
"atomtest": {
"advanceClock": false,
"atom": false,
"fakeClearInterval": false,
"fakeClearTimeout": false,
"fakeSetInterval": false,
@ -1708,28 +1497,11 @@
"protractor": false
},
"shared-node-browser": {
"AbortController": false,
"AbortSignal": false,
"atob": false,
"btoa": false,
"clearInterval": false,
"clearTimeout": false,
"console": false,
"DOMException": false,
"Event": false,
"EventTarget": false,
"fetch": false,
"Intl": false,
"MessageChannel": false,
"MessageEvent": false,
"MessagePort": false,
"performance": false,
"queueMicrotask": false,
"setInterval": false,
"setTimeout": false,
"structuredClone": false,
"TextDecoder": false,
"TextEncoder": false,
"URL": false,
"URLSearchParams": false
},
@ -1743,27 +1515,18 @@
"createObjectIn": false,
"exportFunction": false,
"GM": false,
"GM_addElement": false,
"GM_addStyle": false,
"GM_addValueChangeListener": false,
"GM_deleteValue": false,
"GM_download": false,
"GM_getResourceText": false,
"GM_getResourceURL": false,
"GM_getTab": false,
"GM_getTabs": false,
"GM_getValue": false,
"GM_info": false,
"GM_listValues": false,
"GM_log": false,
"GM_notification": false,
"GM_openInTab": false,
"GM_registerMenuCommand": false,
"GM_removeValueChangeListener": false,
"GM_saveTab": false,
"GM_setClipboard": false,
"GM_setValue": false,
"GM_unregisterMenuCommand": false,
"GM_xmlhttpRequest": false,
"unsafeWindow": false
},

6
node_modules/globals/index.d.ts generated vendored
View File

@ -1,6 +0,0 @@
import {ReadonlyDeep} from 'type-fest';
import globalsJson = require('./globals.json');
declare const globals: ReadonlyDeep<typeof globalsJson>;
export = globals;

2
node_modules/globals/license generated vendored
View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
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:

26
node_modules/globals/package.json generated vendored
View File

@ -1,24 +1,22 @@
{
"name": "globals",
"version": "13.17.0",
"version": "11.12.0",
"description": "Global identifiers from different JavaScript environments",
"license": "MIT",
"repository": "sindresorhus/globals",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js",
"index.d.ts",
"globals.json"
],
"keywords": [
@ -31,25 +29,13 @@
"eslint",
"environments"
],
"dependencies": {
"type-fest": "^0.20.2"
},
"devDependencies": {
"ava": "^2.4.0",
"tsd": "^0.14.0",
"xo": "^0.36.1"
"ava": "0.21.0",
"xo": "0.18.0"
},
"xo": {
"ignores": [
"get-browser-globals.js"
],
"rules": {
"node/no-unsupported-features/es-syntax": "off"
}
},
"tsd": {
"compilerOptions": {
"resolveJsonModule": true
}
]
}
}

33
node_modules/globals/readme.md generated vendored
View File

@ -1,12 +1,13 @@
# globals
# globals [![Build Status](https://travis-ci.org/sindresorhus/globals.svg?branch=master)](https://travis-ci.org/sindresorhus/globals)
> Global identifiers from different JavaScript environments
It's just a [JSON file](globals.json), so use it in any environment.
Extracted from [JSHint](https://github.com/jshint/jshint/blob/3a8efa979dbb157bfb5c10b5826603a55a33b9ad/src/vars.js) and [ESLint](https://github.com/eslint/eslint/blob/b648406218f8a2d7302b98f5565e23199f44eb31/conf/environments.json) and merged.
This package is used by ESLint.
It's just a [JSON file](globals.json), so use it in whatever environment you like.
**This module [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).**
**This package [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).**
## Install
@ -14,6 +15,7 @@ This package is used by ESLint.
$ npm install globals
```
## Usage
```js
@ -26,31 +28,14 @@ console.log(globals.browser);
applicationCache: false,
ArrayBuffer: false,
atob: false,
...
}
*/
```
Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise.
For Node.js this package provides two sets of globals:
- `globals.nodeBuiltin`: Globals available to all code running in Node.js.
These will usually be available as properties on the `global` object and include `process`, `Buffer`, but not CommonJS arguments like `require`.
See: https://nodejs.org/api/globals.html
- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope").
See: https://nodejs.org/api/modules.html#modules_the_module_scope
## License
When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references.
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-globals?utm_source=npm-globals&utm_medium=referral&utm_campaign=readme">Get professional support for this package 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>
MIT © [Sindre Sorhus](https://sindresorhus.com)

274
node_modules/json5/CHANGELOG.md generated vendored
View File

@ -1,274 +0,0 @@
### v1.0.1 [[code][c1.0.1], [diff][d1.0.1]]
[c1.0.1]: https://github.com/json5/json5/tree/v1.0.1
[d1.0.1]: https://github.com/json5/json5/compare/v1.0.0...v1.0.1
This release includes a bug fix and minor change.
- Fix: `parse` throws on unclosed objects and arrays.
- New: `package.json5` has been removed until an easier way to keep it in sync
with `package.json` is found.
### v1.0.0 [[code][c1.0.0], [diff][d1.0.0]]
[c1.0.0]: https://github.com/json5/json5/tree/v1.0.0
[d1.0.0]: https://github.com/json5/json5/compare/v0.5.1...v1.0.0
This release includes major internal changes and public API enhancements.
- **Major** JSON5 officially supports Node.js v4 and later. Support for Node.js
v0.10 and v0.12 have been dropped.
- New: Unicode property names and Unicode escapes in property names are
supported. ([#1])
- New: `stringify` outputs trailing commas in objects and arrays when a `space`
option is provided. ([#66])
- New: JSON5 allows line and paragraph separator characters (U+2028 and U+2029)
in strings in order to be compatible with JSON. However, ES5 does not allow
these characters in strings, so JSON5 gives a warning when they are parsed and
escapes them when they are stringified. ([#70])
- New: `stringify` accepts an options object as its second argument. The
supported options are `replacer`, `space`, and a new `quote` option that
specifies the quote character used in strings. ([#71])
- New: The CLI supports STDIN and STDOUT and adds `--out-file`, `--space`, and
`--validate` options. See `json5 --help` for more information. ([#72], [#84],
and [#108])
- New: In addition to the white space characters space `\t`, `\v`, `\f`, `\n`,
`\r`, and `\xA0`, the additional white space characters `\u2028`, `\u2029`,
and all other characters in the Space Separator Unicode category are allowed.
- New: In addition to the character escapes `\'`, `\"`, `\\`, `\b`, `\f`, `\n`,
`\r`, and `\t`, the additional character escapes `\v` and `\0`, hexadecimal
escapes like `\x0F`, and unnecessary escapes like `\a` are allowed in string
values and string property names.
- New: `stringify` outputs strings with single quotes by default but
intelligently uses double quotes if there are more single quotes than double
quotes inside the string. (i.e. `stringify('Stay here.')` outputs
`'Stay here.'` while `stringify('Let\'s go.')` outputs `"Let's go."`)
- New: When a character is not allowed in a string, `stringify` outputs a
character escape like `\t` when available, a hexadecimal escape like `\x0F`
when the Unicode code point is less than 256, or a Unicode character escape
like `\u01FF`, in that order.
- New: `stringify` checks for a `toJSON5` method on objects and, if it exists,
stringifies its return value instead of the object. `toJSON5` overrides
`toJSON` if they both exist.
- New: To `require` or `import` JSON5 files, use `require('json5/lib/register')`
or `import 'json5/lib/register'`. Previous versions used `json5/lib/require`,
which still exists for backward compatibility but is deprecated and will give
a warning.
- New: To use JSON5 in browsers, use the file at `dist/index.js` or
`https://unpkg.com/json5@^1.0.0`.
- Fix: `stringify` properly outputs `Infinity` and `NaN`. ([#67])
- Fix: `isWord` no longer becomes a property of `JSON5` after calling
`stringify`. ([#68] and [#89])
- Fix: `stringify` no longer throws when an object does not have a `prototype`.
([#154])
- Fix: `stringify` properly handles the `key` argument of `toJSON(key)` methods.
`toJSON5(key)` follows this pattern.
- Fix: `stringify` accepts `Number` and `String` objects as its `space`
argument.
- Fix: In addition to a function, `stringify` also accepts an array of keys to
include in the output as its `replacer` argument. Numbers, `Number` objects,
and `String` objects will be converted to a string if they are given as array
values.
### v0.5.1 [[code][c0.5.1], [diff][d0.5.1]]
[c0.5.1]: https://github.com/json5/json5/tree/v0.5.1
[d0.5.1]: https://github.com/json5/json5/compare/v0.5.0...v0.5.1
This release includes a minor fix for indentations when stringifying empty
arrays.
- Fix: Indents no longer appear in empty arrays when stringified. ([#134])
### v0.5.0 [[code][c0.5.0], [diff][d0.5.0]]
[c0.5.0]: https://github.com/json5/json5/tree/v0.5.0
[d0.5.0]: https://github.com/json5/json5/compare/v0.4.0...v0.5.0
This release includes major internal changes and public API enhancements.
- **Major:** JSON5 officially supports Node.js v4 LTS and v5. Support for
Node.js v0.6 and v0.8 have been dropped, while support for v0.10 and v0.12
remain.
- Fix: YUI Compressor no longer fails when compressing json5.js. ([#97])
- New: `parse` and the CLI provide line and column numbers when displaying error
messages. ([#101]; awesome work by [@amb26].)
### v0.4.0 [[code][c0.4.0], [diff][d0.4.0]]
[c0.4.0]: https://github.com/json5/json5/tree/v0.4.0
[d0.4.0]: https://github.com/json5/json5/compare/v0.2.0...v0.4.0
Note that v0.3.0 was tagged, but never published to npm, so this v0.4.0
changelog entry includes v0.3.0 features.
This is a massive release that adds `stringify` support, among other things.
- **Major:** `JSON5.stringify()` now exists!
This method is analogous to the native `JSON.stringify()`;
it just avoids quoting keys where possible.
See the [usage documentation](./README.md#usage) for more.
([#32]; huge thanks and props [@aeisenberg]!)
- New: `NaN` and `-NaN` are now allowed number literals.
([#30]; thanks [@rowanhill].)
- New: Duplicate object keys are now allowed; the last value is used.
This is the same behavior as JSON. ([#57]; thanks [@jordanbtucker].)
- Fix: Properly handle various whitespace and newline cases now.
E.g. JSON5 now properly supports escaped CR and CRLF newlines in strings,
and JSON5 now accepts the same whitespace as JSON (stricter than ES5).
([#58], [#60], and [#63]; thanks [@jordanbtucker].)
- New: Negative hexadecimal numbers (e.g. `-0xC8`) are allowed again.
(They were disallowed in v0.2.0; see below.)
It turns out they *are* valid in ES5, so JSON5 supports them now too.
([#36]; thanks [@jordanbtucker]!)
### v0.2.0 [[code][c0.2.0], [diff][d0.2.0]]
[c0.2.0]: https://github.com/json5/json5/tree/v0.2.0
[d0.2.0]: https://github.com/json5/json5/compare/v0.1.0...v0.2.0
This release fixes some bugs and adds some more utility features to help you
express data more easily:
- **Breaking:** Negative hexadecimal numbers (e.g. `-0xC8`) are rejected now.
While V8 (e.g. Chrome and Node) supported them, it turns out they're invalid
in ES5. This has been [fixed in V8][v8-hex-fix] (and by extension, Chrome
and Node), so JSON5 officially rejects them now, too. ([#36])
- New: Trailing decimal points in decimal numbers are allowed again.
(They were disallowed in v0.1.0; see below.)
They're allowed by ES5, and differentiating between integers and floats may
make sense on some platforms. ([#16]; thanks [@Midar].)
- New: `Infinity` and `-Infinity` are now allowed number literals.
([#30]; thanks [@pepkin88].)
- New: Plus signs (`+`) in front of numbers are now allowed, since it can
be helpful in some contexts to explicitly mark numbers as positive.
(E.g. when a property represents changes or deltas.)
- Fix: unescaped newlines in strings are rejected now.
([#24]; thanks [@Midar].)
### v0.1.0 [[code][c0.1.0], [diff][d0.1.0]]
[c0.1.0]: https://github.com/json5/json5/tree/v0.1.0
[d0.1.0]: https://github.com/json5/json5/compare/v0.0.1...v0.1.0
This release tightens JSON5 support and adds helpful utility features:
- New: Support hexadecimal numbers. (Thanks [@MaxNanasy].)
- Fix: Reject octal numbers properly now. Previously, they were accepted but
improperly parsed as base-10 numbers. (Thanks [@MaxNanasy].)
- **Breaking:** Reject "noctal" numbers now (base-10 numbers that begin with a
leading zero). These are disallowed by both JSON5 and JSON, as well as by
ES5's strict mode. (Thanks [@MaxNanasy].)
- New: Support leading decimal points in decimal numbers.
(Thanks [@MaxNanasy].)
- **Breaking:** Reject trailing decimal points in decimal numbers now. These
are disallowed by both JSON5 and JSON. (Thanks [@MaxNanasy].)
- **Breaking:** Reject omitted elements in arrays now. These are disallowed by
both JSON5 and JSON.
- Fix: Throw proper `SyntaxError` instances on errors now.
- New: Add Node.js `require()` hook. Register via `json5/lib/require`.
- New: Add Node.js `json5` executable to compile JSON5 files to JSON.
### v0.0.1 [[code][c0.0.1], [diff][d0.0.1]]
[c0.0.1]: https://github.com/json5/json5/tree/v0.0.1
[d0.0.1]: https://github.com/json5/json5/compare/v0.0.0...v0.0.1
This was the first implementation of this JSON5 parser.
- Support unquoted object keys, including reserved words. Unicode characters
and escape sequences sequences aren't yet supported.
- Support single-quoted strings.
- Support multi-line strings.
- Support trailing commas in arrays and objects.
- Support comments, both inline and block.
### v0.0.0 [[code](https://github.com/json5/json5/tree/v0.0.0)]
Let's consider this to be Douglas Crockford's original [json_parse.js] — a
parser for the regular JSON format.
[json_parse.js]: https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js
[v8-hex-fix]: http://code.google.com/p/v8/issues/detail?id=2240
[@MaxNanasy]: https://github.com/MaxNanasy
[@Midar]: https://github.com/Midar
[@pepkin88]: https://github.com/pepkin88
[@rowanhill]: https://github.com/rowanhill
[@aeisenberg]: https://github.com/aeisenberg
[@jordanbtucker]: https://github.com/jordanbtucker
[@amb26]: https://github.com/amb26
[#1]: https://github.com/json5/json5/issues/1
[#16]: https://github.com/json5/json5/issues/16
[#24]: https://github.com/json5/json5/issues/24
[#30]: https://github.com/json5/json5/issues/30
[#32]: https://github.com/json5/json5/issues/32
[#36]: https://github.com/json5/json5/issues/36
[#57]: https://github.com/json5/json5/issues/57
[#58]: https://github.com/json5/json5/pull/58
[#60]: https://github.com/json5/json5/pull/60
[#63]: https://github.com/json5/json5/pull/63
[#66]: https://github.com/json5/json5/issues/66
[#67]: https://github.com/json5/json5/issues/67
[#68]: https://github.com/json5/json5/issues/68
[#70]: https://github.com/json5/json5/issues/70
[#71]: https://github.com/json5/json5/issues/71
[#72]: https://github.com/json5/json5/issues/72
[#84]: https://github.com/json5/json5/pull/84
[#89]: https://github.com/json5/json5/pull/89
[#97]: https://github.com/json5/json5/pull/97
[#101]: https://github.com/json5/json5/pull/101
[#108]: https://github.com/json5/json5/pull/108
[#134]: https://github.com/json5/json5/pull/134
[#154]: https://github.com/json5/json5/issues/154

12
node_modules/json5/README.md generated vendored
View File

@ -1,6 +1,6 @@
# JSON5 JSON for Humans
[![Build Status](https://travis-ci.org/json5/json5.svg)][Build Status]
[![Build Status](https://travis-ci.com/json5/json5.svg)][Build Status]
[![Coverage
Status](https://coveralls.io/repos/github/json5/json5/badge.svg)][Coverage
Status]
@ -12,7 +12,7 @@ some productions from [ECMAScript 5.1].
This JavaScript library is the official reference implementation for JSON5
parsing and serialization libraries.
[Build Status]: https://travis-ci.org/json5/json5
[Build Status]: https://travis-ci.com/json5/json5
[Coverage Status]: https://coveralls.io/github/json5/json5
@ -84,7 +84,7 @@ const JSON5 = require('json5')
### Browsers
```html
<script src="https://unpkg.com/json5@^1.0.0"></script>
<script src="https://unpkg.com/json5@^2.0.0/dist/index.min.js"></script>
```
This will create a global `JSON5` variable.
@ -182,7 +182,7 @@ If `<file>` is not provided, then STDIN is used.
- `-V`, `--version`: Output the version number
- `-h`, `--help`: Output usage information
## Contibuting
## Contributing
### Development
```sh
git clone https://github.com/json5/json5
@ -199,7 +199,7 @@ To report bugs or request features regarding the JSON5 data format, please
submit an issue to the [official specification
repository](https://github.com/json5/json5-spec).
To report bugs or request features regarding the JavaScript implentation of
To report bugs or request features regarding the JavaScript implementation of
JSON5, please submit an issue to this repository.
## License
@ -221,7 +221,7 @@ implementation of JSON5 was also modeled directly off of Dougs open-source
code.
[json_parse.js]:
https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js
https://github.com/douglascrockford/JSON-js/blob/03157639c7a7cddd2e9f032537f346f1a87c0f6d/json_parse.js
[Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific
supporter, contributing multiple patches and ideas.

1711
node_modules/json5/dist/index.js generated vendored

File diff suppressed because one or more lines are too long

152
node_modules/json5/lib/cli.js generated vendored
View File

@ -1,2 +1,152 @@
#!/usr/bin/env node
'use strict';var _fs=require('fs');var _fs2=_interopRequireDefault(_fs);var _path=require('path');var _path2=_interopRequireDefault(_path);var _minimist=require('minimist');var _minimist2=_interopRequireDefault(_minimist);var _package=require('../package.json');var _package2=_interopRequireDefault(_package);var _=require('./');var _2=_interopRequireDefault(_);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var argv=(0,_minimist2.default)(process.argv.slice(2),{alias:{'convert':'c','space':'s','validate':'v','out-file':'o','version':'V','help':'h'},boolean:['convert','validate','version','help'],string:['space','out-file']});if(argv.version){version()}else if(argv.help){usage()}else{var inFilename=argv._[0];var readStream=void 0;if(inFilename){readStream=_fs2.default.createReadStream(inFilename)}else{readStream=process.stdin}var json5='';readStream.on('data',function(data){json5+=data});readStream.on('end',function(){var space=void 0;if(argv.space==='t'||argv.space==='tab'){space='\t'}else{space=Number(argv.space)}var value=void 0;try{value=_2.default.parse(json5);if(!argv.validate){var json=JSON.stringify(value,null,space);var writeStream=void 0;if(argv.convert&&inFilename&&!argv.o){var parsedFilename=_path2.default.parse(inFilename);var outFilename=_path2.default.format(Object.assign(parsedFilename,{base:_path2.default.basename(parsedFilename.base,parsedFilename.ext)+'.json'}));writeStream=_fs2.default.createWriteStream(outFilename)}else if(argv.o){writeStream=_fs2.default.createWriteStream(argv.o)}else{writeStream=process.stdout}writeStream.write(json)}}catch(err){console.error(err.message);process.exit(1)}})}function version(){console.log(_package2.default.version)}function usage(){console.log('\n Usage: json5 [options] <file>\n\n If <file> is not provided, then STDIN is used.\n\n Options:\n\n -s, --space The number of spaces to indent or \'t\' for tabs\n -o, --out-file [file] Output to the specified file, otherwise STDOUT\n -v, --validate Validate JSON5 but do not output JSON\n -V, --version Output the version number\n -h, --help Output usage information')}
const fs = require('fs')
const path = require('path')
const pkg = require('../package.json')
const JSON5 = require('./')
const argv = parseArgs()
if (argv.version) {
version()
} else if (argv.help) {
usage()
} else {
const inFilename = argv.defaults[0]
let readStream
if (inFilename) {
readStream = fs.createReadStream(inFilename)
} else {
readStream = process.stdin
}
let json5 = ''
readStream.on('data', data => {
json5 += data
})
readStream.on('end', () => {
let space
if (argv.space === 't' || argv.space === 'tab') {
space = '\t'
} else {
space = Number(argv.space)
}
let value
try {
value = JSON5.parse(json5)
if (!argv.validate) {
const json = JSON.stringify(value, null, space)
let writeStream
// --convert is for backward compatibility with v0.5.1. If
// specified with <file> and not --out-file, then a file with
// the same name but with a .json extension will be written.
if (argv.convert && inFilename && !argv.outFile) {
const parsedFilename = path.parse(inFilename)
const outFilename = path.format(
Object.assign(
parsedFilename,
{base: path.basename(parsedFilename.base, parsedFilename.ext) + '.json'}
)
)
writeStream = fs.createWriteStream(outFilename)
} else if (argv.outFile) {
writeStream = fs.createWriteStream(argv.outFile)
} else {
writeStream = process.stdout
}
writeStream.write(json)
}
} catch (err) {
console.error(err.message)
process.exit(1)
}
})
}
function parseArgs () {
let convert
let space
let validate
let outFile
let version
let help
const defaults = []
const args = process.argv.slice(2)
for (let i = 0; i < args.length; i++) {
const arg = args[i]
switch (arg) {
case '--convert':
case '-c':
convert = true
break
case '--space':
case '-s':
space = args[++i]
break
case '--validate':
case '-v':
validate = true
break
case '--out-file':
case '-o':
outFile = args[++i]
break
case '--version':
case '-V':
version = true
break
case '--help':
case '-h':
help = true
break
default:
defaults.push(arg)
break
}
}
return {
convert,
space,
validate,
outFile,
version,
help,
defaults,
}
}
function version () {
console.log(pkg.version)
}
function usage () {
console.log(
`
Usage: json5 [options] <file>
If <file> is not provided, then STDIN is used.
Options:
-s, --space The number of spaces to indent or 't' for tabs
-o, --out-file [file] Output to the specified file, otherwise STDOUT
-v, --validate Validate JSON5 but do not output JSON
-V, --version Output the version number
-h, --help Output usage information`
)
}

10
node_modules/json5/lib/index.js generated vendored
View File

@ -1 +1,9 @@
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _parse=require('./parse');var _parse2=_interopRequireDefault(_parse);var _stringify=require('./stringify');var _stringify2=_interopRequireDefault(_stringify);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={parse:_parse2.default,stringify:_stringify2.default};module.exports=exports['default'];
const parse = require('./parse')
const stringify = require('./stringify')
const JSON5 = {
parse,
stringify,
}
module.exports = JSON5

1088
node_modules/json5/lib/parse.js generated vendored

File diff suppressed because one or more lines are too long

14
node_modules/json5/lib/register.js generated vendored
View File

@ -1 +1,13 @@
'use strict';var _fs=require('fs');var _fs2=_interopRequireDefault(_fs);var _=require('./');var _2=_interopRequireDefault(_);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}require.extensions['.json5']=function(module,filename){var content=_fs2.default.readFileSync(filename,'utf8');try{module.exports=_2.default.parse(content)}catch(err){err.message=filename+': '+err.message;throw err}};
const fs = require('fs')
const JSON5 = require('./')
// eslint-disable-next-line node/no-deprecated-api
require.extensions['.json5'] = function (module, filename) {
const content = fs.readFileSync(filename, 'utf8')
try {
module.exports = JSON5.parse(content)
} catch (err) {
err.message = filename + ': ' + err.message
throw err
}
}

5
node_modules/json5/lib/require.js generated vendored
View File

@ -1 +1,4 @@
"use strict";require("./register");console.warn("'json5/require' is deprecated. Please use 'json5/register' instead.");
// This file is for backward compatibility with v0.5.1.
require('./register')
console.warn("'json5/require' is deprecated. Please use 'json5/register' instead.")

262
node_modules/json5/lib/stringify.js generated vendored

File diff suppressed because one or more lines are too long

5
node_modules/json5/lib/unicode.js generated vendored

File diff suppressed because one or more lines are too long

36
node_modules/json5/lib/util.js generated vendored
View File

@ -1 +1,35 @@
'use strict';Object.defineProperty(exports,'__esModule',{value:true});exports.isSpaceSeparator=isSpaceSeparator;exports.isIdStartChar=isIdStartChar;exports.isIdContinueChar=isIdContinueChar;exports.isDigit=isDigit;exports.isHexDigit=isHexDigit;var _unicode=require('../lib/unicode');var unicode=_interopRequireWildcard(_unicode);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}function isSpaceSeparator(c){return unicode.Space_Separator.test(c)}function isIdStartChar(c){return c>='a'&&c<='z'||c>='A'&&c<='Z'||c==='$'||c==='_'||unicode.ID_Start.test(c)}function isIdContinueChar(c){return c>='a'&&c<='z'||c>='A'&&c<='Z'||c>='0'&&c<='9'||c==='$'||c==='_'||c==='\u200C'||c==='\u200D'||unicode.ID_Continue.test(c)}function isDigit(c){return /[0-9]/.test(c)}function isHexDigit(c){return /[0-9A-Fa-f]/.test(c)}
const unicode = require('../lib/unicode')
module.exports = {
isSpaceSeparator (c) {
return typeof c === 'string' && unicode.Space_Separator.test(c)
},
isIdStartChar (c) {
return typeof c === 'string' && (
(c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c === '$') || (c === '_') ||
unicode.ID_Start.test(c)
)
},
isIdContinueChar (c) {
return typeof c === 'string' && (
(c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c >= '0' && c <= '9') ||
(c === '$') || (c === '_') ||
(c === '\u200C') || (c === '\u200D') ||
unicode.ID_Continue.test(c)
)
},
isDigit (c) {
return typeof c === 'string' && /[0-9]/.test(c)
},
isHexDigit (c) {
return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)
},
}

71
node_modules/json5/package.json generated vendored
View File

@ -1,23 +1,30 @@
{
"name": "json5",
"version": "1.0.1",
"version": "2.2.1",
"description": "JSON for humans.",
"main": "lib/index.js",
"module": "dist/index.mjs",
"bin": "lib/cli.js",
"browser": "dist/index.js",
"types": "lib/index.d.ts",
"files": [
"lib/",
"dist/"
],
"engines": {
"node": ">=6"
},
"scripts": {
"build": "babel-node build/build.js && babel src -d lib && rollup -c",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"lint": "eslint --fix build src",
"prepublishOnly": "npm run lint && npm test && npm run production",
"pretest": "cross-env NODE_ENV=test npm run build",
"preversion": "npm run lint && npm test && npm run production",
"production": "cross-env NODE_ENV=production npm run build",
"test": "nyc --reporter=html --reporter=text mocha"
"build": "rollup -c",
"build-package": "node build/package.js",
"build-unicode": "node build/unicode.js",
"coverage": "tap --coverage-report html test",
"lint": "eslint --fix .",
"prepublishOnly": "npm run production",
"preversion": "npm run production",
"production": "npm run lint && npm test && npm run build",
"test": "tap -Rspec --100 test",
"version": "npm run build-package && git add package.json5"
},
"repository": {
"type": "git",
@ -41,36 +48,22 @@
"url": "https://github.com/json5/json5/issues"
},
"homepage": "http://json5.org/",
"dependencies": {
"minimist": "^1.2.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-istanbul": "^4.1.5",
"babel-preset-env": "^1.6.1",
"babel-register": "^6.26.0",
"babelrc-rollup": "^3.0.0",
"coveralls": "^3.0.0",
"cross-env": "^5.1.4",
"del": "^3.0.0",
"eslint": "^4.18.2",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-standard": "^3.0.1",
"mocha": "^5.0.4",
"nyc": "^11.4.1",
"regenerate": "^1.3.3",
"rollup": "^0.56.5",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-commonjs": "^9.0.0",
"rollup-plugin-node-resolve": "^3.2.0",
"rollup-plugin-uglify": "^3.0.0",
"sinon": "^4.4.2",
"unicode-9.0.0": "^0.7.5"
"core-js": "^2.6.5",
"eslint": "^5.15.3",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"regenerate": "^1.4.0",
"rollup": "^0.64.1",
"rollup-plugin-buble": "^0.19.6",
"rollup-plugin-commonjs": "^9.2.1",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-terser": "^1.0.1",
"sinon": "^6.3.5",
"tap": "^12.6.0",
"unicode-10.0.0": "^0.7.5"
}
}

9
node_modules/locate-path/index.js generated vendored
View File

@ -29,16 +29,14 @@ module.exports = async (paths, options) => {
allowSymlinks: true,
...options
};
checkType(options);
const statFn = options.allowSymlinks ? fsStat : fsLStat;
return pLocate(paths, async path_ => {
try {
const stat = await statFn(path.resolve(options.cwd, path_));
return matchType(options.type, stat);
} catch {
} catch (_) {
return false;
}
}, options);
@ -51,9 +49,7 @@ module.exports.sync = (paths, options) => {
type: 'file',
...options
};
checkType(options);
const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;
for (const path_ of paths) {
@ -63,6 +59,7 @@ module.exports.sync = (paths, options) => {
if (matchType(options.type, stat)) {
return path_;
}
} catch {}
} catch (_) {
}
}
};

2
node_modules/locate-path/license generated vendored
View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
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:

View File

@ -1,17 +1,16 @@
{
"name": "locate-path",
"version": "6.0.0",
"version": "5.0.0",
"description": "Get the first path that exists on disk of multiple paths",
"license": "MIT",
"repository": "sindresorhus/locate-path",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
"url": "sindresorhus.com"
},
"engines": {
"node": ">=10"
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
@ -36,11 +35,11 @@
"iterator"
],
"dependencies": {
"p-locate": "^5.0.0"
"p-locate": "^4.1.0"
},
"devDependencies": {
"ava": "^2.4.0",
"tsd": "^0.13.1",
"xo": "^0.32.1"
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

43
node_modules/locate-path/readme.md generated vendored
View File

@ -1,13 +1,15 @@
# locate-path [![Build Status](https://travis-ci.com/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.com/github/sindresorhus/locate-path)
# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path)
> Get the first path that exists on disk of multiple paths
## Install
```
$ npm install locate-path
```
## Usage
Here we find the first file that exists on disk, in array order.
@ -27,9 +29,10 @@ const files = [
})();
```
## API
### locatePath(paths, options?)
### locatePath(paths, [options])
Returns a `Promise<string>` for the first path that exists or `undefined` if none exists.
@ -41,19 +44,19 @@ Paths to check.
#### options
Type: `object`
Type: `Object`
##### concurrency
Type: `number`\
Default: `Infinity`\
Type: `number`<br>
Default: `Infinity`<br>
Minimum: `1`
Number of concurrently pending promises.
##### preserveOrder
Type: `boolean`\
Type: `boolean`<br>
Default: `true`
Preserve `paths` order when searching.
@ -62,27 +65,27 @@ Disable this to improve performance if you don't care about the order.
##### cwd
Type: `string`\
Type: `string`<br>
Default: `process.cwd()`
Current working directory.
##### type
Type: `string`\
Default: `'file'`\
Values: `'file' | 'directory'`
Type: `string`<br>
Default: `file`<br>
Values: `file` `directory`
The type of paths that can match.
##### allowSymlinks
Type: `boolean`\
Type: `boolean`<br>
Default: `true`
Allow symbolic links to match if they point to the chosen path type.
### locatePath.sync(paths, options?)
### locatePath.sync(paths, [options])
Returns the first path that exists or `undefined` if none exists.
@ -94,7 +97,7 @@ Paths to check.
#### options
Type: `object`
Type: `Object`
##### cwd
@ -108,18 +111,12 @@ Same as above.
Same as above.
## Related
- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-locate-path?utm_source=npm-locate-path&utm_medium=referral&utm_campaign=readme">Get professional support for this package 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>
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

2
node_modules/p-locate/index.js generated vendored
View File

@ -48,3 +48,5 @@ const pLocate = async (iterable, tester, options) => {
};
module.exports = pLocate;
// TODO: Remove this for the next major release
module.exports.default = pLocate;

2
node_modules/p-locate/license generated vendored
View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
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:

19
node_modules/p-locate/package.json generated vendored
View File

@ -1,17 +1,16 @@
{
"name": "p-locate",
"version": "5.0.0",
"version": "4.1.0",
"description": "Get the first fulfilled promise that satisfies the provided testing function",
"license": "MIT",
"repository": "sindresorhus/p-locate",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
"url": "sindresorhus.com"
},
"engines": {
"node": ">=10"
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
@ -41,14 +40,14 @@
"bluebird"
],
"dependencies": {
"p-limit": "^3.0.2"
"p-limit": "^2.2.0"
},
"devDependencies": {
"ava": "^2.4.0",
"ava": "^1.4.1",
"delay": "^4.1.0",
"in-range": "^2.0.0",
"time-span": "^4.0.0",
"tsd": "^0.13.1",
"xo": "^0.32.1"
"in-range": "^1.0.0",
"time-span": "^3.0.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

29
node_modules/p-locate/readme.md generated vendored
View File

@ -1,15 +1,17 @@
# p-locate [![Build Status](https://travis-ci.com/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.com/github/sindresorhus/p-locate)
# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate)
> Get the first fulfilled promise that satisfies the provided testing function
Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find).
## Install
```
$ npm install p-locate
```
## Usage
Here we find the first file that exists on disk, in array order.
@ -34,9 +36,10 @@ const files = [
*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.*
## API
### pLocate(input, tester, options?)
### pLocate(input, tester, [options])
Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`.
@ -54,25 +57,26 @@ This function will receive resolved values from `input` and is expected to retur
#### options
Type: `object`
Type: `Object`
##### concurrency
Type: `number`\
Default: `Infinity`\
Type: `number`<br>
Default: `Infinity`<br>
Minimum: `1`
Number of concurrently pending promises returned by `tester`.
##### preserveOrder
Type: `boolean`\
Type: `boolean`<br>
Default: `true`
Preserve `input` order when searching.
Disable this to improve performance if you don't care about the order.
## Related
- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
@ -80,14 +84,7 @@ Disable this to improve performance if you don't care about the order.
- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled
- [More…](https://github.com/sindresorhus/promise-fun)
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-p-locate?utm_source=npm-p-locate&utm_medium=referral&utm_campaign=readme">Get professional support for this package 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>
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

30
node_modules/resolve-from/index.js generated vendored
View File

@ -3,9 +3,9 @@ const path = require('path');
const Module = require('module');
const fs = require('fs');
const resolveFrom = (fromDir, moduleId, silent) => {
if (typeof fromDir !== 'string') {
throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``);
const resolveFrom = (fromDirectory, moduleId, silent) => {
if (typeof fromDirectory !== 'string') {
throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``);
}
if (typeof moduleId !== 'string') {
@ -13,35 +13,35 @@ const resolveFrom = (fromDir, moduleId, silent) => {
}
try {
fromDir = fs.realpathSync(fromDir);
} catch (err) {
if (err.code === 'ENOENT') {
fromDir = path.resolve(fromDir);
fromDirectory = fs.realpathSync(fromDirectory);
} catch (error) {
if (error.code === 'ENOENT') {
fromDirectory = path.resolve(fromDirectory);
} else if (silent) {
return null;
return;
} else {
throw err;
throw error;
}
}
const fromFile = path.join(fromDir, 'noop.js');
const fromFile = path.join(fromDirectory, 'noop.js');
const resolveFileName = () => Module._resolveFilename(moduleId, {
id: fromFile,
filename: fromFile,
paths: Module._nodeModulePaths(fromDir)
paths: Module._nodeModulePaths(fromDirectory)
});
if (silent) {
try {
return resolveFileName();
} catch (err) {
return null;
} catch (error) {
return;
}
}
return resolveFileName();
};
module.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId);
module.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true);
module.exports = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId);
module.exports.silent = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId, true);

View File

@ -1,6 +1,6 @@
{
"name": "resolve-from",
"version": "4.0.0",
"version": "5.0.0",
"description": "Resolve the path of a module like `require.resolve()` but from a given path",
"license": "MIT",
"repository": "sindresorhus/resolve-from",
@ -10,13 +10,14 @@
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
"node": ">=8"
},
"scripts": {
"test": "xo && ava"
"test": "xo && ava && tsd"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],
"keywords": [
"require",
@ -28,7 +29,8 @@
"import"
],
"devDependencies": {
"ava": "*",
"xo": "*"
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

10
node_modules/resolve-from/readme.md generated vendored
View File

@ -24,15 +24,15 @@ resolveFrom('foo', './bar');
## API
### resolveFrom(fromDir, moduleId)
### resolveFrom(fromDirectory, moduleId)
Like `require()`, throws when the module can't be found.
### resolveFrom.silent(fromDir, moduleId)
### resolveFrom.silent(fromDirectory, moduleId)
Returns `null` instead of throwing when the module can't be found.
Returns `undefined` instead of throwing when the module can't be found.
#### fromDir
#### fromDirectory
Type: `string`
@ -47,7 +47,7 @@ What you would use in `require()`.
## Tip
Create a partial using a bound function if you want to resolve from the same `fromDir` multiple times:
Create a partial using a bound function if you want to resolve from the same `fromDirectory` multiple times:
```js
const resolveFromFoo = resolveFrom.bind(null, 'foo');

View File

@ -1 +1 @@
../../../json5/lib/cli.js
../json5/lib/cli.js

View File

@ -30,15 +30,19 @@
"node-fetch": "^3.2.10"
},
"devDependencies": {
"@babel/preset-env": "^7.20.2",
"@types/node": "^18.11.9",
"@typescript-eslint/parser": "^5.42.1",
"@vercel/ncc": "^0.34.0",
"babel-jest": "^29.3.1",
"eslint": "^8.27.0",
"eslint-plugin-github": "^4.4.1",
"https": "^1.0.0",
"jest": "^29.3.1",
"js-yaml": "^4.1.0",
"prettier": "2.7.1",
"semver": "^7.3.8",
"ts-jest": "^29.0.3",
"typescript": "^4.8.4",
"uuid": "^9.0.0"
}

View File

@ -4,9 +4,9 @@ var https = require('https')
class Http {
make(
url: string,
headers: string | null,
body: string | null,
ignoreCertificate: boolean | null
headers: string | null = null,
ignoreCertificate: boolean | null = false
): Promise<any> {
return new Promise((resolve, reject) => {
fetch(

View File

@ -37,7 +37,7 @@ async function run() {
// make the request
http
.make(url, headers, body, insecure)
.make(url, body, headers, insecure)
.then(res => {
// if the status code is not 2xx
if (res.status >= 400) {

2549
yarn.lock

File diff suppressed because it is too large Load Diff