new license file version [CI SKIP]

This commit is contained in:
2023-03-15 12:34:41 +00:00
parent 0a6d92a1f3
commit 61328d20ed
13115 changed files with 1892314 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').reduceRight;

View File

@@ -0,0 +1,290 @@
<br>
<h1 align="center">wildcard-match</h1>
<p align="center">
<strong>A tiny and extremely fast JavaScript library for compiling and matching basic glob patterns</strong>
</p>
<p align="center">
<a href="https://www.npmjs.com/package/wildcard-match"><img src="https://img.shields.io/npm/v/wildcard-match" alt="npm package"></a>
&nbsp;
<a href="https://bundlephobia.com/package/wildcard-match"><img src="https://img.shields.io/bundlephobia/minzip/wildcard-match?color=%23b4a&label=size" alt="size"></a>
&nbsp;
<a href="https://github.com/axtgr/wildcard-match/actions"><img src="https://img.shields.io/github/workflow/status/axtgr/wildcard-match/CI?label=CI&logo=github" alt="CI"></a>
&nbsp;
<a href="https://www.buymeacoffee.com/axtgr"><img src="https://img.shields.io/badge/%F0%9F%8D%BA-Buy%20me%20a%20beer-red?style=flat" alt="Buy me a beer"></a>
</p>
<br>
Wildcard-match takes one or more basic glob patterns, compiles them into a RegExp and returns a function for matching strings with it.
Glob patterns are strings that contain `?`, `*` and `**` wildcards. When such a pattern is compared with another string, these wildcards can replace one or more symbols. For example, `src/*` would match both `src/foo` and `src/bar`.
This library's goal is to be as small and as fast as possible while supporting only the most basic wildcards. If you need character ranges, extended globs, braces and other advanced features, check out [outmatch](https://github.com/axtgr/outmatch).
## Quickstart
```
npm install wildcard-match
```
```js
import wcmatch from 'wildcard-match'
const isMatch = wcmatch('src/**/*.?s')
isMatch('src/components/header/index.js') //=> true
isMatch('src/README.md') //=> false
isMatch.pattern //=> 'src/**/*.?s'
isMatch.options //=> { separator: true }
isMatch.regexp //=> /^src[/\\]+?(?:[^/\\]*?[/\\]+?)*?[^/\\]*?\.[^/\\]s[/\\]*?$/
```
More details are available in the [Installation](#installation), [Usage](#usage) and [API](#api) sections.
## Features
<table>
<tr>
<td align="center">🍃</td>
<td><strong>Lightweight</strong><br>No dependencies. <em>Less than 1 KB</em> when minified and gzipped</td>
</tr>
<tr>
<td align="center">🏎</td>
<td><strong>Fast</strong><br>Compiles and matches patterns faster than any other known library</td>
</tr>
<tr>
<td align="center">🌞</td>
<td><strong>Simple</strong><br>The API is a single function</td>
</tr>
<tr>
<td align="center">⚒</td>
<td><strong>Reliable</strong><br>Written in TypeScript. Covered by hundreds of unit tests</td>
</tr>
<tr>
<td align="center">🔌</td>
<td><strong>Compatible</strong><br>Works in any ES5+ environment including older versions of Node.js, Deno, React Native and browsers</td>
</tr>
</table>
For comparison with the alternatives, see the [corresponding section](#comparison).
## Installation
The package is distributed via the npm package registry. It can be installed using one of the compatible package managers or included directly from a CDN.
#### [npm](https://www.npmjs.com)
```
npm install wildcard-match
```
#### [Yarn](https://yarnpkg.com)
```
yarn add wildcard-match
```
#### [pnpm](https://pnpm.js.org)
```
pnpm install wildcard-match
```
#### CDN
When included from a CDN, wildcard-match is available as the global function `wcmatch`.
- [unpkg](https://unpkg.com/wildcard-match)
- [jsDelivr](https://www.jsdelivr.com/package/npm/wildcard-match)
## Usage
### Basics
Wildcard-match comes built in ESM, CommonJS and UMD formats and includes TypeScript typings. The examples use ESM imports, which can be replaced with the following line for CommonJS: `const wcmatch = require('wildcard-match')`.
The default export is a function of two arguments, first of which can be either a single glob string or an array of such patterns. The second argument is optional and can be either an [options](#options) object or a separator (which will be the value of the `separator` option). Wildcard-match compiles them into a regular expression and returns a function (usually called `isMatch` in the examples) that tests strings against the pattern. The pattern, options and the compiled RegExp object are available as properties on the returned function:
```js
import wcmatch from 'wildcard-match'
const isMatch = wcmatch('src/?ar')
isMatch('src/bar') //=> true
isMatch('src/car') //=> true
isMatch('src/cvar') //=> false
isMatch.pattern //=> 'src/?ar'
isMatch.options //=> {}
isMatch.regexp //=> /^src[/\\]+?[^/\\]ar[/\\]*?$/
```
The returned function can be invoked immediately if there is no need to match a pattern more than once:
```js
wcmatch('src/**/*.js')('src/components/body/index.js') //=> true
```
Compiling a pattern is much slower than comparing a string to it, so it is recommended to always reuse the returned function when possible.
### Syntax
Wildcard-match supports the following glob syntax in patterns:
- `?` matches exactly one arbitrary character excluding separators
- `*` matches zero or more arbitrary characters excluding separators
- `**` matches any number of segments when used as a whole segment in a separated pattern (e.g. <code>/\*\*/</code> if <code>/</code> is the separator)
- `\` escapes the following character making it be treated literally
More features are available in the [outmatch](https://github.com/axtgr/outmatch) library.
### Separators
Globs are most often used to search file paths, which are, essentially, strings split into segments by slashes. While other libraries are usually restricted to this use-case, wildcard-match is able to work with _arbitrary_ strings by accepting a custom separator in the second parameter:
```js
const matchDomain = wcmatch('*.example.com', { separator: '.' })
matchDomain('subdomain.example.com') //=> true
// Here, the second parameter is a shorthand for `{ separator: ',' }`
const matchLike = wcmatch('one,**,f?ur', ',')
matchLike('one,two,three,four') //=> true
```
The only limitation is that backslashes `\` cannot be used as separators in patterns because
wildcard-match uses them for character escaping. However, when `separator` is `undefined`
or `true`, `/` in patterns will match both `/` and `\`, so a single pattern with forward
slashes can match both Unix and Windows paths:
```js
const isMatchA = outmatch('foo\\bar') // throws an error
const isMatchB = outmatch('foo/bar') // same as passing `true` as the separator
isMatchB('foo/bar') //=> true
isMatchB('foo\\bar') //=> true
const isMatchC = outmatch('foo/bar', '/')
isMatchC('foo/bar') //=> true
isMatchC('foo\\bar') //=> false
```
The matching features work with a _segment_ rather than a whole pattern:
```js
const isMatch = wcmatch('foo/b*')
isMatch('foo/bar') //=> true
isMatch('foo/b/ar') //=> false
```
Segmentation can be turned off completely by passing `false` as the separator, which makes wildcard-match treat whole patterns as a single segment. Slashes become regular symbols and `*` matches _anything_:
```js
const isMatch = wcmatch('foo?ba*', false)
isMatch('foo/bar/qux') //=> true
```
A single separator in a pattern will match _one or more_ separators in a sample string:
```js
wcmatch('foo/bar/baz')('foo/bar///baz') //=> true
```
When a pattern has an explicit separator at its end, samples also require one or more trailing separators:
```js
const isMatch = wcmatch('foo/bar/')
isMatch('foo/bar') //=> false
isMatch('foo/bar/') //=> true
isMatch('foo/bar///') //=> true
```
However, if there is no trailing separator in a pattern, strings will match even if they have separators at the end:
```js
const isMatch = wcmatch('foo/bar')
isMatch('foo/bar') //=> true
isMatch('foo/bar/') //=> true
isMatch('foo/bar///') //=> true
```
### Multiple Patterns
Wildcard-match can take an array of glob patterns as the first argument instead of a single pattern. In that case a string will be considered a match if it matches _any_ of the given patterns:
```js
const isMatch = wcmatch(['src/*', 'tests/*'])
isMatch('src/utils.js') //=> true
isMatch('tests/utils.js') //=> true
```
### Matching Arrays of Strings
The returned function can work with arrays of strings when used as the predicate of the native array methods:
```js
const isMatch = wcmatch('src/*.js')
const paths = ['readme.md', 'src/index.js', 'src/components/body.js']
paths.map(isMatch) //=> [ false, true, false ]
paths.filter(isMatch) //=> [ 'src/index.js' ]
paths.some(isMatch) //=> true
paths.every(isMatch) //=> false
paths.find(isMatch) //=> 'src/index.js'
paths.findIndex(isMatch) //=> 1
```
## API
### wcmatch(patterns, options?): isMatch<br>wcmatch(patterns, separator?): isMatch
Takes a single pattern string or an array of patterns and compiles them into a regular expression. Returns an isMatch function that takes a sample string as its only argument and returns true if the string matches the pattern(s).
### isMatch(sample): boolean
Tests if a sample string matches the patterns that were used to compile the regular expression and create this function.
### isMatch.regexp
The compiled regular expression.
### isMatch.pattern
The original pattern or array of patterns that was used to compile the regular expression and create the isMatch function.
### isMatch.options
The options object that was used to compile the regular expression and create the isMatch function.
### Options
| Option | Type | Default Value | Description |
| ----------- | --------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `separator` | string&nbsp;\|&nbsp;boolean | true | Separator to be used to split patterns and samples into segments<ul><li>`true` — `/` in patterns match both `/` and `\` in samples<li>`false` — don't split<li>_any string_ — custom separator |
| `flags` | string | undefined | [Flags](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Advanced_searching_with_flags) to pass to the RegExp. For example, setting this option to `'i'` will make the matching case-insensitive |
## Comparison
```
Pattern: src/test/**/*.?s
Sample: src/test/foo/bar.js
Compilation
wildcard-match 1,046,326 ops/sec
picomatch 261,589 ops/sec
Matching
wildcard-match 34,646,993 ops/sec
picomatch 10,750,888 ops/sec
```
A better comparison is in the works.

View File

@@ -0,0 +1 @@
{"version":3,"file":"testUtils.js","sources":["../src/index.js"],"sourcesContent":["import { options } from 'preact';\n\n/**\n * Setup a rerender function that will drain the queue of pending renders\n * @returns {() => void}\n */\nexport function setupRerender() {\n\toptions.__test__previousDebounce = options.debounceRendering;\n\toptions.debounceRendering = cb => (options.__test__drainQueue = cb);\n\treturn () => options.__test__drainQueue && options.__test__drainQueue();\n}\n\nconst isThenable = value => value != null && typeof value.then == 'function';\n\n/** Depth of nested calls to `act`. */\nlet actDepth = 0;\n\n/**\n * Run a test function, and flush all effects and rerenders after invoking it.\n *\n * Returns a Promise which resolves \"immediately\" if the callback is\n * synchronous or when the callback's result resolves if it is asynchronous.\n *\n * @param {() => void|Promise<void>} cb The function under test. This may be sync or async.\n * @return {Promise<void>}\n */\nexport function act(cb) {\n\tif (++actDepth > 1) {\n\t\t// If calls to `act` are nested, a flush happens only when the\n\t\t// outermost call returns. In the inner call, we just execute the\n\t\t// callback and return since the infrastructure for flushing has already\n\t\t// been set up.\n\t\t//\n\t\t// If an exception occurs, the outermost `act` will handle cleanup.\n\t\tconst result = cb();\n\t\tif (isThenable(result)) {\n\t\t\treturn result.then(() => {\n\t\t\t\t--actDepth;\n\t\t\t});\n\t\t}\n\t\t--actDepth;\n\t\treturn Promise.resolve();\n\t}\n\n\tconst previousRequestAnimationFrame = options.requestAnimationFrame;\n\tconst rerender = setupRerender();\n\n\t/** @type {() => void} */\n\tlet flush, toFlush;\n\n\t// Override requestAnimationFrame so we can flush pending hooks.\n\toptions.requestAnimationFrame = fc => (flush = fc);\n\n\tconst finish = () => {\n\t\ttry {\n\t\t\trerender();\n\t\t\twhile (flush) {\n\t\t\t\ttoFlush = flush;\n\t\t\t\tflush = null;\n\n\t\t\t\ttoFlush();\n\t\t\t\trerender();\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (!err) {\n\t\t\t\terr = e;\n\t\t\t}\n\t\t} finally {\n\t\t\tteardown();\n\t\t}\n\n\t\toptions.requestAnimationFrame = previousRequestAnimationFrame;\n\t\t--actDepth;\n\t};\n\n\tlet err;\n\tlet result;\n\n\ttry {\n\t\tresult = cb();\n\t} catch (e) {\n\t\terr = e;\n\t}\n\n\tif (isThenable(result)) {\n\t\treturn result.then(finish, err => {\n\t\t\tfinish();\n\t\t\tthrow err;\n\t\t});\n\t}\n\n\t// nb. If the callback is synchronous, effects must be flushed before\n\t// `act` returns, so that the caller does not have to await the result,\n\t// even though React recommends this.\n\tfinish();\n\tif (err) {\n\t\tthrow err;\n\t}\n\treturn Promise.resolve();\n}\n\n/**\n * Teardown test environment and reset preact's internal state\n */\nexport function teardown() {\n\tif (options.__test__drainQueue) {\n\t\t// Flush any pending updates leftover by test\n\t\toptions.__test__drainQueue();\n\t\tdelete options.__test__drainQueue;\n\t}\n\n\tif (typeof options.__test__previousDebounce != 'undefined') {\n\t\toptions.debounceRendering = options.__test__previousDebounce;\n\t\tdelete options.__test__previousDebounce;\n\t} else {\n\t\toptions.debounceRendering = undefined;\n\t}\n}\n"],"names":["setupRerender","options","__test__previousDebounce","debounceRendering","cb","__test__drainQueue","isThenable","value","then","actDepth","teardown","undefined","result","Promise","resolve","flush","toFlush","previousRequestAnimationFrame","requestAnimationFrame","rerender","fc","err","finish","e"],"mappings":"iCAMgBA,IAGf,OAFAC,EAAOA,QAACC,EAA2BD,EAAAA,QAAQE,kBAC3CF,EAAOA,QAACE,kBAAoB,SAAAC,UAAOH,UAAQI,EAAqBD,CAAlC,EACvB,WAAA,OAAMH,EAAOA,QAACI,GAAsBJ,UAAQI,GAA5C,CACP,CAED,IAAMC,EAAa,SAAAC,GAAK,OAAa,MAATA,GAAsC,mBAAdA,EAAMC,IAAlC,EAGpBC,EAAW,EAyFR,SAASC,IACXT,EAAOA,QAACI,IAEXJ,EAAOA,QAACI,WACDJ,EAAAA,QAAQI,QAG+B,IAApCJ,UAAQC,GAClBD,EAAAA,QAAQE,kBAAoBF,EAAOA,QAACC,SAC7BD,EAAOA,QAACC,GAEfD,EAAAA,QAAQE,uBAAoBQ,CAE7B,aA3FM,SAAaP,GACnB,KAAMK,EAAW,EAAG,CAOnB,IAAMG,EAASR,IACf,OAAIE,EAAWM,GACPA,EAAOJ,KAAK,aAChBC,CACF,MAEAA,EACKI,QAAQC,UACf,CAED,IAIIC,EAAOC,EAJLC,EAAgChB,EAAOA,QAACiB,sBACxCC,EAAWnB,IAMjBC,EAAOA,QAACiB,sBAAwB,SAAAE,GAAOL,OAAAA,EAAQK,CAAb,EAElC,IAsBIC,EACAT,EAvBEU,EAAS,WACd,IAEC,IADAH,IACOJ,GACNC,EAAUD,EACVA,EAAQ,KAERC,IACAG,GAQD,CANC,MAAOI,GACHF,IACJA,EAAME,EAEP,CAbD,QAcCb,GACA,CAEDT,EAAOA,QAACiB,sBAAwBD,IAC9BR,CACF,EAKD,IACCG,EAASR,GAGT,CAFC,MAAOmB,GACRF,EAAME,CACN,CAED,GAAIjB,EAAWM,GACd,OAAOA,EAAOJ,KAAKc,EAAQ,SAAAD,GAE1B,MADAC,IACMD,CACN,GAOF,GADAC,IACID,EACH,MAAMA,EAEP,OAAOR,QAAQC,SACf"}

View File

@@ -0,0 +1,366 @@
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
# is-ssh
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/is-ssh.svg)](https://www.npmjs.com/package/is-ssh) [![Downloads](https://img.shields.io/npm/dt/is-ssh.svg)](https://www.npmjs.com/package/is-ssh) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
> Check if an input value is a ssh url or not.
## :cloud: Installation
```sh
# Using npm
npm install --save is-ssh
# Using yarn
yarn add is-ssh
```
## :clipboard: Example
```js
// Dependencies
const isSsh = require("is-ssh");
// Secure Shell Transport Protocol (SSH)
console.log(isSsh("ssh://user@host.xz:port/path/to/repo.git/"));
// true
console.log(isSsh("ssh://user@host.xz/path/to/repo.git/"));
// true
console.log(isSsh("ssh://host.xz:port/path/to/repo.git/"));
// true
console.log(isSsh("ssh://host.xz/path/to/repo.git/"));
// true
console.log(isSsh("ssh://user@host.xz/path/to/repo.git/"));
// true
console.log(isSsh("ssh://host.xz/path/to/repo.git/"));
// true
console.log(isSsh("ssh://user@host.xz/~user/path/to/repo.git/"));
// true
console.log(isSsh("ssh://host.xz/~user/path/to/repo.git/"));
// true
console.log(isSsh("ssh://user@host.xz/~/path/to/repo.git"));
// true
console.log(isSsh("ssh://host.xz/~/path/to/repo.git"));
// true
console.log(isSsh("user@host.xz:/path/to/repo.git/"));
// true
console.log(isSsh("user@host.xz:~user/path/to/repo.git/"));
// true
console.log(isSsh("user@host.xz:path/to/repo.git"));
// true
console.log(isSsh("host.xz:/path/to/repo.git/"));
// true
console.log(isSsh("host.xz:path/to/repo.git"));
// true
console.log(isSsh("host.xz:~user/path/to/repo.git/"));
// true
console.log(isSsh("rsync://host.xz/path/to/repo.git/"));
// true
// Git Transport Protocol
console.log(isSsh("git://host.xz/path/to/repo.git/"));
// false
console.log(isSsh("git://host.xz/~user/path/to/repo.git/"));
// false
// HTTP/S Transport Protocol
console.log(isSsh("http://host.xz/path/to/repo.git/"));
// false
console.log(isSsh("https://host.xz/path/to/repo.git/"));
// false
console.log(isSsh("http://host.xz:8000/path/to/repo.git/"))
// false
console.log(isSsh("https://host.xz:8000/path/to/repo.git/"))
// false
// Local (Filesystem) Transport Protocol
console.log(isSsh("/path/to/repo.git/"));
// false
console.log(isSsh("path/to/repo.git/"));
// false
console.log(isSsh("~/path/to/repo.git"));
// false
console.log(isSsh("file:///path/to/repo.git/"));
// false
console.log(isSsh("file://~/path/to/repo.git/"));
// false
```
## :question: Get Help
There are few ways to get help:
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
2. For bug reports and feature requests, open issues. :bug:
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
## :memo: Documentation
### `isSsh(input)`
Checks if an input value is a ssh url or not.
#### Params
- **String|Array** `input`: The input url or an array of protocols.
#### Return
- **Boolean** `true` if the input is a ssh url, `false` otherwise.
## :yum: How to contribute
Have an idea? Found a bug? See [how to contribute][contributing].
## :sparkling_heart: Support my projects
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
- Starring and sharing the projects you like :rocket:
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
![](https://i.imgur.com/z6OQI95.png)
Thanks! :heart:
## :dizzy: Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:
- `parse-url`
- `git-up`
- `nodegit-clone`
- `mili`
- `@enkeledi/react-native-week-month-date-picker`
- `bb-git-up`
- `normalize-ssh`
- `bb-parse-url`
- `xl-git-up`
- `@hemith/react-native-tnk`
- `miguelcostero-ng2-toasty`
- `native-kakao-login`
- `npm_one_1_2_3`
- `npm-all-packages`
- `react-native-biometric-authenticate`
- `react-native-arunmeena1987`
- `react-native-contact-list`
- `react-native-payu-payment-testing`
- `react-native-is7`
- `react-native-my-first-try-arun-ramya`
- `react-native-kakao-maps`
- `react-native-ytximkit`
- `rn-adyen-dropin`
- `@positionex/position-sdk`
- `@lakutata/core`
- `@corelmax/react-native-my2c2p-sdk`
- `@felipesimmi/react-native-datalogic-module`
- `@hawkingnetwork/react-native-tab-view`
- `install-is`
- `drowl-base-theme-iconset`
- `native-apple-login`
- `react-native-cplus`
- `npm_qwerty`
- `react-native-bubble-chart`
- `react-native-arunjeyam1987`
- `react-native-flyy`
- `@saad27/react-native-bottom-tab-tour`
- `candlelabssdk`
- `generator-bootstrap-boilerplate-template`
- `@geeky-apo/react-native-advanced-clipboard`
- `@apardellass/react-native-audio-stream`
- `react-feedback-sdk`
- `npm_one_12_34_1_`
- `npm_one_2_2`
- `react-native-responsive-size`
- `react-native-sayhello-module`
- `react-native-dsphoto-module`
- `payutesting`
- `@flareapp/ignition-ui`
- `@con-test/react-native-concent-common`
- `birken-react-native-community-image-editor`
- `clonit`
- `luojia-cli-dev`
- `reac-native-arun-ramya-test`
- `react-native-transtracker-library`
- `react-native-pulsator-native`
- `react-native-arun-ramya-test`
- `react-native-arunramya151`
- `react-native-plugpag-wrapper`
- `@screeb/react-native`
- `@buganto/client`
- `react-native-syan-photo-picker`
- `@wecraftapps/react-native-use-keyboard`
- `angularvezba`
- `astra-ufo-sdk`
- `l2forlerna`
- `native-google-login`
- `raact-native-arunramya151`
- `react-native-modal-progress-bar`
- `react-native-test-module-hhh`
- `react-native-badge-control`
- `rn-tm-notify`
- `react-native-jsi-device-info`
## :scroll: License
[MIT][license] © [Ionică Bizău][website]
[license]: /LICENSE
[website]: http://ionicabizau.net
[contributing]: /CONTRIBUTING.md
[docs]: /DOCUMENTATION.md
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
[patreon]: https://www.patreon.com/ionicabizau
[amazon]: http://amzn.eu/hRo9sIZ
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW

View File

@@ -0,0 +1,27 @@
/**
Check if a path is inside another path.
Note that relative paths are resolved against `process.cwd()` to make them absolute.
_Important:_ This package is meant for use with path manipulation. It does not check if the paths exist nor does it resolve symlinks. You should not use this as a security mechanism to guard against access to certain places on the file system.
@example
```
import isPathInside = require('is-path-inside');
isPathInside('a/b/c', 'a/b');
//=> true
isPathInside('a/b/c', 'x/y');
//=> false
isPathInside('a/b/c', 'a/b/c');
//=> false
isPathInside('/Users/sindresorhus/dev/unicorn', '/Users/sindresorhus');
//=> true
```
*/
declare function isPathInside(childPath: string, parentPath: string): boolean;
export = isPathInside;

View File

@@ -0,0 +1,10 @@
'use strict';
var test = require('tape');
var has = require('../');
test('has', function (t) {
t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"');
t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"');
t.end();
});

View File

@@ -0,0 +1,67 @@
import { MonoTypeOperatorFunction, SchedulerLike } from '../types';
import { operate } from '../util/lift';
/**
* Asynchronously subscribes Observers to this Observable on the specified {@link SchedulerLike}.
*
* With `subscribeOn` you can decide what type of scheduler a specific Observable will be using when it is subscribed to.
*
* Schedulers control the speed and order of emissions to observers from an Observable stream.
*
* ![](subscribeOn.png)
*
* ## Example
*
* Given the following code:
*
* ```ts
* import { of, merge } from 'rxjs';
*
* const a = of(1, 2, 3);
* const b = of(4, 5, 6);
*
* merge(a, b).subscribe(console.log);
*
* // Outputs
* // 1
* // 2
* // 3
* // 4
* // 5
* // 6
* ```
*
* Both Observable `a` and `b` will emit their values directly and synchronously once they are subscribed to.
*
* If we instead use the `subscribeOn` operator declaring that we want to use the {@link asyncScheduler} for values emitted by Observable `a`:
*
* ```ts
* import { of, subscribeOn, asyncScheduler, merge } from 'rxjs';
*
* const a = of(1, 2, 3).pipe(subscribeOn(asyncScheduler));
* const b = of(4, 5, 6);
*
* merge(a, b).subscribe(console.log);
*
* // Outputs
* // 4
* // 5
* // 6
* // 1
* // 2
* // 3
* ```
*
* The reason for this is that Observable `b` emits its values directly and synchronously like before
* but the emissions from `a` are scheduled on the event loop because we are now using the {@link asyncScheduler} for that specific Observable.
*
* @param scheduler The {@link SchedulerLike} to perform subscription actions on.
* @param delay A delay to pass to the scheduler to delay subscriptions
* @return A function that returns an Observable modified so that its
* subscriptions happen on the specified {@link SchedulerLike}.
*/
export function subscribeOn<T>(scheduler: SchedulerLike, delay: number = 0): MonoTypeOperatorFunction<T> {
return operate((source, subscriber) => {
subscriber.add(scheduler.schedule(() => source.subscribe(subscriber), delay));
});
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"isFunction.js","sourceRoot":"","sources":["../../../../src/internal/util/isFunction.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,UAAU,CAAC,KAAU;IACnC,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC"}

View File

@@ -0,0 +1,50 @@
{
"name": "typedarray-to-buffer",
"description": "Convert a typed array to a Buffer without a copy",
"version": "3.1.5",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
"url": "http://feross.org/"
},
"bugs": {
"url": "https://github.com/feross/typedarray-to-buffer/issues"
},
"dependencies": {
"is-typedarray": "^1.0.0"
},
"devDependencies": {
"airtap": "0.0.4",
"standard": "*",
"tape": "^4.0.0"
},
"homepage": "http://feross.org",
"keywords": [
"buffer",
"typed array",
"convert",
"no copy",
"uint8array",
"uint16array",
"uint32array",
"int16array",
"int32array",
"float32array",
"float64array",
"browser",
"arraybuffer",
"dataview"
],
"license": "MIT",
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/feross/typedarray-to-buffer.git"
},
"scripts": {
"test": "standard && npm run test-node && npm run test-browser",
"test-browser": "airtap -- test/*.js",
"test-browser-local": "airtap --local -- test/*.js",
"test-node": "tape test/*.js"
}
}

View File

@@ -0,0 +1,2 @@
export declare function not<T>(pred: (value: T, index: number) => boolean, thisArg: any): (value: T, index: number) => boolean;
//# sourceMappingURL=not.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"combineLatestWith.js","sourceRoot":"","sources":["../../../../src/internal/operators/combineLatestWith.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,iDAAgD;AA0ChD,SAAgB,iBAAiB;IAC/B,sBAA6C;SAA7C,UAA6C,EAA7C,qBAA6C,EAA7C,IAA6C;QAA7C,iCAA6C;;IAE7C,OAAO,6BAAa,wCAAI,YAAY,IAAE;AACxC,CAAC;AAJD,8CAIC"}

View File

@@ -0,0 +1 @@
{"name":"buffer","version":"6.0.3","files":{"LICENSE":{"checkedAt":1678883671211,"integrity":"sha512-C4gkwdCuX04P/8WV39+ojXJDZd4Wjv9LQKaLejDf3iyfZaEyt9R3AQT1Ng1OqACvBQftb1ha9gADsNOFwJsFkw==","mode":420,"size":1106},"index.js":{"checkedAt":1678883671216,"integrity":"sha512-B0L8A3nD0KFhQVWwNTQarbUUeDGWUYzC0UCRHQnleKrLxJ1vF02c/Iyf2UC4Oj82PXan8/AEyYOfu299LsKnCg==","mode":420,"size":58353},"package.json":{"checkedAt":1678883671216,"integrity":"sha512-17SrYxTB6Y58UZln0vARcRymU7Ul2UaF+20KOoxb3RDnTOI+Y1dR5rh7P4hhnCr4IQP6lbKAWawWgXd379bG3Q==","mode":420,"size":2546},"AUTHORS.md":{"checkedAt":1678883671217,"integrity":"sha512-ojiQe6GebaI+wSRQ5Ew3SBrl8+LfcgzitAQg/hZgT9EPxCUxKRkjl6L6n0JSjMNSIWASDB12YGMDtjMUl6+tEA==","mode":420,"size":2788},"README.md":{"checkedAt":1678883671218,"integrity":"sha512-X4twMmRzSInUwGPPVJT1+6R8SIBcw3dZZeaXKgYnSdt7EU+XKOcGe9RzBLX40/GSlTgjG0zmGZr1ps4dk4ekVg==","mode":420,"size":17295},"index.d.ts":{"checkedAt":1678883671218,"integrity":"sha512-O+rDgx4I49ZI/riE/YFB0zOeVQlLbKpO649GInHR3hquDiOJg3nWHio/xdggaZd1CVrVjIer0yBOL/ND/OZwHA==","mode":420,"size":9191}}}

View File

@@ -0,0 +1,150 @@
let { list } = require('postcss')
let OldSelector = require('./old-selector')
let Prefixer = require('./prefixer')
let Browsers = require('./browsers')
let utils = require('./utils')
class Selector extends Prefixer {
constructor(name, prefixes, all) {
super(name, prefixes, all)
this.regexpCache = new Map()
}
/**
* Is rule selectors need to be prefixed
*/
check(rule) {
if (rule.selector.includes(this.name)) {
return !!rule.selector.match(this.regexp())
}
return false
}
/**
* Return prefixed version of selector
*/
prefixed(prefix) {
return this.name.replace(/^(\W*)/, `$1${prefix}`)
}
/**
* Lazy loadRegExp for name
*/
regexp(prefix) {
if (!this.regexpCache.has(prefix)) {
let name = prefix ? this.prefixed(prefix) : this.name
this.regexpCache.set(
prefix,
new RegExp(`(^|[^:"'=])${utils.escapeRegexp(name)}`, 'gi')
)
}
return this.regexpCache.get(prefix)
}
/**
* All possible prefixes
*/
possible() {
return Browsers.prefixes()
}
/**
* Return all possible selector prefixes
*/
prefixeds(rule) {
if (rule._autoprefixerPrefixeds) {
if (rule._autoprefixerPrefixeds[this.name]) {
return rule._autoprefixerPrefixeds
}
} else {
rule._autoprefixerPrefixeds = {}
}
let prefixeds = {}
if (rule.selector.includes(',')) {
let ruleParts = list.comma(rule.selector)
let toProcess = ruleParts.filter(el => el.includes(this.name))
for (let prefix of this.possible()) {
prefixeds[prefix] = toProcess
.map(el => this.replace(el, prefix))
.join(', ')
}
} else {
for (let prefix of this.possible()) {
prefixeds[prefix] = this.replace(rule.selector, prefix)
}
}
rule._autoprefixerPrefixeds[this.name] = prefixeds
return rule._autoprefixerPrefixeds
}
/**
* Is rule already prefixed before
*/
already(rule, prefixeds, prefix) {
let index = rule.parent.index(rule) - 1
while (index >= 0) {
let before = rule.parent.nodes[index]
if (before.type !== 'rule') {
return false
}
let some = false
for (let key in prefixeds[this.name]) {
let prefixed = prefixeds[this.name][key]
if (before.selector === prefixed) {
if (prefix === key) {
return true
} else {
some = true
break
}
}
}
if (!some) {
return false
}
index -= 1
}
return false
}
/**
* Replace selectors by prefixed one
*/
replace(selector, prefix) {
return selector.replace(this.regexp(), `$1${this.prefixed(prefix)}`)
}
/**
* Clone and add prefixes for at-rule
*/
add(rule, prefix) {
let prefixeds = this.prefixeds(rule)
if (this.already(rule, prefixeds, prefix)) {
return
}
let cloned = this.clone(rule, { selector: prefixeds[this.name][prefix] })
rule.parent.insertBefore(rule, cloned)
}
/**
* Return function to fast find prefixed selector
*/
old(prefix) {
return new OldSelector(this, prefix)
}
}
module.exports = Selector

View File

@@ -0,0 +1,11 @@
import { popScheduler } from '../util/args';
import { from } from './from';
export function of() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var scheduler = popScheduler(args);
return from(args, scheduler);
}
//# sourceMappingURL=of.js.map

View File

@@ -0,0 +1,2 @@
export declare const reserved_keywords: Set<string>;
export declare function is_reserved_keyword(name: any): boolean;

View File

@@ -0,0 +1,66 @@
/**
* If only a single value is specified (from each category: day, month, year), the
* function returns a true value only on days that match that specification. If
* both values are specified, the result is true between those times, including
* bounds.
*
* Even though the examples don't show, the "GMT" parameter can be specified
* in any of the 9 different call profiles, always as the last parameter.
*
* Examples:
*
* ``` js
* dateRange(1)
* true on the first day of each month, local timezone.
*
* dateRange(1, "GMT")
* true on the first day of each month, GMT timezone.
*
* dateRange(1, 15)
* true on the first half of each month.
*
* dateRange(24, "DEC")
* true on 24th of December each year.
*
* dateRange(24, "DEC", 1995)
* true on 24th of December, 1995.
*
* dateRange("JAN", "MAR")
* true on the first quarter of the year.
*
* dateRange(1, "JUN", 15, "AUG")
* true from June 1st until August 15th, each year (including June 1st and August
* 15th).
*
* dateRange(1, "JUN", 15, 1995, "AUG", 1995)
* true from June 1st, 1995, until August 15th, same year.
*
* dateRange("OCT", 1995, "MAR", 1996)
* true from October 1995 until March 1996 (including the entire month of October
* 1995 and March 1996).
*
* dateRange(1995)
* true during the entire year 1995.
*
* dateRange(1995, 1997)
* true from beginning of year 1995 until the end of year 1997.
* ```
*
* dateRange(day)
* dateRange(day1, day2)
* dateRange(mon)
* dateRange(month1, month2)
* dateRange(year)
* dateRange(year1, year2)
* dateRange(day1, month1, day2, month2)
* dateRange(month1, year1, month2, year2)
* dateRange(day1, month1, year1, day2, month2, year2)
* dateRange(day1, month1, year1, day2, month2, year2, gmt)
*
* @param {String} day is the day of month between 1 and 31 (as an integer).
* @param {String} month is one of the month strings: JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
* @param {String} year is the full year number, for example 1995 (but not 95). Integer.
* @param {String} gmt is either the string "GMT", which makes time comparison occur in GMT timezone; if left unspecified, times are taken to be in the local timezone.
* @return {Boolean}
*/
export default function dateRange(): boolean;

View File

@@ -0,0 +1,22 @@
module.exports = {
"name": "jsonarray",
"processSafe":true,
"regExp": /^\*jsonarray\*/,
"parserFunc": function parser_jsonarray (params) {
var fieldStr = params.head.replace(this.regExp, "");
var headArr = fieldStr.split('.');
var pointer = params.resultRow;
while (headArr.length > 1) {
var headStr = headArr.shift();
if (pointer[headStr] === undefined) {
pointer[headStr] = {};
}
pointer = pointer[headStr];
}
var arrFieldName = headArr.shift();
if (pointer[arrFieldName] === undefined) {
pointer[arrFieldName] = [];
}
pointer[arrFieldName].push(params.item);
}
};

View File

@@ -0,0 +1,9 @@
"use strict";
module.exports = function () {
var assign = Object.assign, obj;
if (typeof assign !== "function") return false;
obj = { foo: "raz" };
assign(obj, { bar: "dwa" }, { trzy: "trzy" });
return obj.foo + obj.bar + obj.trzy === "razdwatrzy";
};

View File

@@ -0,0 +1,11 @@
'use strict';
var msPerDay = require('../helpers/timeConstants').msPerDay;
var DayFromYear = require('./DayFromYear');
// https://262.ecma-international.org/5.1/#sec-15.9.1.3
module.exports = function TimeFromYear(y) {
return msPerDay * DayFromYear(y);
};

View File

@@ -0,0 +1,28 @@
import { Subject } from '../Subject';
import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
import { noop } from '../util/noop';
import { innerFrom } from '../observable/innerFrom';
export function window(windowBoundaries) {
return operate(function (source, subscriber) {
var windowSubject = new Subject();
subscriber.next(windowSubject.asObservable());
var errorHandler = function (err) {
windowSubject.error(err);
subscriber.error(err);
};
source.subscribe(createOperatorSubscriber(subscriber, function (value) { return windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.next(value); }, function () {
windowSubject.complete();
subscriber.complete();
}, errorHandler));
innerFrom(windowBoundaries).subscribe(createOperatorSubscriber(subscriber, function () {
windowSubject.complete();
subscriber.next((windowSubject = new Subject()));
}, noop, errorHandler));
return function () {
windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.unsubscribe();
windowSubject = null;
};
});
}
//# sourceMappingURL=window.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"distinctUntilChanged.js","sourceRoot":"","sources":["../../../../src/internal/operators/distinctUntilChanged.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAuIhE,MAAM,UAAU,oBAAoB,CAClC,UAAiD,EACjD,WAA0D;IAA1D,4BAAA,EAAA,cAA+B,QAA2B;IAK1D,UAAU,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,cAAc,CAAC;IAE1C,OAAO,OAAO,CAAC,UAAC,MAAM,EAAE,UAAU;QAGhC,IAAI,WAAc,CAAC;QAEnB,IAAI,KAAK,GAAG,IAAI,CAAC;QAEjB,MAAM,CAAC,SAAS,CACd,wBAAwB,CAAC,UAAU,EAAE,UAAC,KAAK;YAEzC,IAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;YAKtC,IAAI,KAAK,IAAI,CAAC,UAAW,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE;gBAMlD,KAAK,GAAG,KAAK,CAAC;gBACd,WAAW,GAAG,UAAU,CAAC;gBAGzB,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACxB;QACH,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,cAAc,CAAC,CAAM,EAAE,CAAM;IACpC,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC"}

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('wrapperAt', require('../wrapperAt'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1 @@
export declare const endpoint: import("@octokit/types").EndpointInterface<object>;

View File

@@ -0,0 +1,14 @@
import { Component, ComponentChild, ComponentChildren } from '../../src';
//
// SuspenseList
// -----------------------------------
export interface SuspenseListProps {
children?: ComponentChildren;
revealOrder?: 'forwards' | 'backwards' | 'together';
}
export class SuspenseList extends Component<SuspenseListProps> {
render(): ComponentChild;
}

View File

@@ -0,0 +1,14 @@
{
"root": true,
"extends": "@ljharb",
"globals": {
"StopIteration": false,
},
"rules": {
"func-name-matching": [2, "always"],
"id-length": 0,
},
}

View File

@@ -0,0 +1,15 @@
export const intervalProvider = {
setInterval(handler, timeout, ...args) {
const { delegate } = intervalProvider;
if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
return delegate.setInterval(handler, timeout, ...args);
}
return setInterval(handler, timeout, ...args);
},
clearInterval(handle) {
const { delegate } = intervalProvider;
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);
},
delegate: undefined,
};
//# sourceMappingURL=intervalProvider.js.map

View File

@@ -0,0 +1,113 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.setProp = exports.findUp = exports.isValidLocalPath = exports.hasDepInstalled = exports.getIncludePaths = exports.concat = exports.importAny = void 0;
const fs_1 = require("fs");
const path_1 = require("path");
async function importAny(...modules) {
try {
const mod = await modules.reduce((acc, moduleName) => acc.catch(() => Promise.resolve().then(() => __importStar(require(moduleName)))), Promise.reject());
return mod;
}
catch (e) {
throw new Error(`Cannot find any of modules: ${modules}\n\n${e}`);
}
}
exports.importAny = importAny;
function concat(...arrs) {
return arrs.reduce((acc, a) => {
if (a) {
return acc.concat(a);
}
return acc;
}, []);
}
exports.concat = concat;
/** Paths used by preprocessors to resolve @imports */
function getIncludePaths(fromFilename, base = []) {
return [
...new Set([...base, 'node_modules', process.cwd(), path_1.dirname(fromFilename)]),
];
}
exports.getIncludePaths = getIncludePaths;
const cachedResult = {};
/**
* Checks if a package is installed.
*
* @export
* @param {string} dep
* @returns boolean
*/
async function hasDepInstalled(dep) {
if (cachedResult[dep] != null) {
return cachedResult[dep];
}
let result = false;
try {
await Promise.resolve().then(() => __importStar(require(dep)));
result = true;
}
catch (e) {
result = false;
}
return (cachedResult[dep] = result);
}
exports.hasDepInstalled = hasDepInstalled;
const REMOTE_SRC_PATTERN = /^(https?:)?\/\//;
function isValidLocalPath(path) {
return (path.match(REMOTE_SRC_PATTERN) == null &&
// only literal strings allowed
!path.startsWith('{') &&
!path.endsWith('}'));
}
exports.isValidLocalPath = isValidLocalPath;
// finds a existing path up the tree
function findUp({ what, from }) {
const { root, dir } = path_1.parse(from);
let cur = dir;
try {
while (cur !== root) {
const possiblePath = path_1.join(cur, what);
if (fs_1.existsSync(possiblePath)) {
return possiblePath;
}
cur = path_1.dirname(cur);
}
}
catch (e) {
console.error(e);
}
return null;
}
exports.findUp = findUp;
// set deep property in object
function setProp(obj, keyList, val) {
let i = 0;
for (; i < keyList.length - 1; i++) {
const key = keyList[i];
if (typeof obj[key] !== 'object') {
obj[key] = {};
}
obj = obj[key];
}
obj[keyList[i]] = val;
}
exports.setProp = setProp;

View File

@@ -0,0 +1,44 @@
# strip-indent [![Build Status](https://travis-ci.org/sindresorhus/strip-indent.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-indent)
> Strip leading whitespace from each line in a string
The line with the least number of leading whitespace, ignoring empty lines, determines the number to remove.
Useful for removing redundant indentation.
## Install
```
$ npm install strip-indent
```
## Usage
```js
const stripIndent = require('strip-indent');
const string = '\tunicorn\n\t\tcake';
/*
unicorn
cake
*/
stripIndent(string);
/*
unicorn
cake
*/
```
## Related
- [strip-indent-cli](https://github.com/sindresorhus/strip-indent-cli) - CLI for this module
- [indent-string](https://github.com/sindresorhus/indent-string) - Indent each line in a string
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

View File

@@ -0,0 +1,32 @@
"use strict";
function parsePort(urlObj, options)
{
var defaultPort = -1;
for (var i in options.defaultPorts)
{
if ( i===urlObj.scheme && options.defaultPorts.hasOwnProperty(i) )
{
defaultPort = options.defaultPorts[i];
break;
}
}
if (defaultPort > -1)
{
// Force same type as urlObj.port
defaultPort = defaultPort.toString();
if (urlObj.port === null)
{
urlObj.port = defaultPort;
}
urlObj.extra.portIsDefault = (urlObj.port === defaultPort);
}
}
module.exports = parsePort;

View File

@@ -0,0 +1,2 @@
var _ = require('./lodash.min').runInContext();
module.exports = require('./fp/_baseConvert')(_, _);

View File

@@ -0,0 +1,459 @@
# http2-wrapper
> HTTP/2 client, just with the familiar `https` API
[![Node CI](https://github.com/szmarczak/http2-wrapper/workflows/Node%20CI/badge.svg)](https://github.com/szmarczak/http2-wrapper/actions)
[![codecov](https://codecov.io/gh/szmarczak/http2-wrapper/branch/master/graph/badge.svg)](https://codecov.io/gh/szmarczak/http2-wrapper)
[![npm](https://img.shields.io/npm/dm/http2-wrapper.svg)](https://www.npmjs.com/package/http2-wrapper)
[![install size](https://packagephobia.now.sh/badge?p=http2-wrapper)](https://packagephobia.now.sh/result?p=http2-wrapper)
This package was created to support HTTP/2 without the need to rewrite your code.<br>
I recommend adapting to the [`http2`](https://nodejs.org/api/http2.html) module if possible - it's much simpler to use and has many cool features!
**Tip**: `http2-wrapper` is very useful when you rely on other modules that use the HTTP/1 API and you want to support HTTP/2.
**Pro Tip**: While the native `http2` doesn't have agents yet, you can use `http2-wrapper` Agents and still operate on the native HTTP/2 streams.
## Installation
> `$ npm install http2-wrapper`<br>
> `$ yarn add http2-wrapper`
## Usage
```js
const http2 = require('http2-wrapper');
const options = {
hostname: 'nghttp2.org',
protocol: 'https:',
path: '/httpbin/post',
method: 'POST',
headers: {
'content-length': 6
}
};
const request = http2.request(options, response => {
console.log('statusCode:', response.statusCode);
console.log('headers:', response.headers);
const body = [];
response.on('data', chunk => {
body.push(chunk);
});
response.on('end', () => {
console.log('body:', Buffer.concat(body).toString());
});
});
request.on('error', console.error);
request.write('123');
request.end('456');
// statusCode: 200
// headers: [Object: null prototype] {
// ':status': 200,
// date: 'Fri, 27 Sep 2019 19:45:46 GMT',
// 'content-type': 'application/json',
// 'access-control-allow-origin': '*',
// 'access-control-allow-credentials': 'true',
// 'content-length': '239',
// 'x-backend-header-rtt': '0.002516',
// 'strict-transport-security': 'max-age=31536000',
// server: 'nghttpx',
// via: '1.1 nghttpx',
// 'alt-svc': 'h3-23=":4433"; ma=3600',
// 'x-frame-options': 'SAMEORIGIN',
// 'x-xss-protection': '1; mode=block',
// 'x-content-type-options': 'nosniff'
// }
// body: {
// "args": {},
// "data": "123456",
// "files": {},
// "form": {},
// "headers": {
// "Content-Length": "6",
// "Host": "nghttp2.org"
// },
// "json": 123456,
// "origin": "xxx.xxx.xxx.xxx",
// "url": "https://nghttp2.org/httpbin/post"
// }
```
## API
**Note:** The `session` option was renamed to `tlsSession` for better readability.
**Note:** The `timeout` option applies to HTTP/2 streams only. In order to set session timeout, pass an Agent with custom `timeout` option set.
### http2.auto(url, options, callback)
Performs [ALPN](https://nodejs.org/api/tls.html#tls_alpn_and_sni) negotiation.
Returns a Promise giving proper `ClientRequest` instance (depending on the ALPN).
**Note**: The `agent` option represents an object with `http`, `https` and `http2` properties.
```js
const http2 = require('http2-wrapper');
const options = {
hostname: 'httpbin.org',
protocol: 'http:', // Try changing this to https:
path: '/post',
method: 'POST',
headers: {
'content-length': 6
}
};
(async () => {
try {
const request = await http2.auto(options, response => {
console.log('statusCode:', response.statusCode);
console.log('headers:', response.headers);
const body = [];
response.on('data', chunk => body.push(chunk));
response.on('end', () => {
console.log('body:', Buffer.concat(body).toString());
});
});
request.on('error', console.error);
request.write('123');
request.end('456');
} catch (error) {
console.error(error);
}
})();
// statusCode: 200
// headers: { connection: 'close',
// server: 'gunicorn/19.9.0',
// date: 'Sat, 15 Dec 2018 18:19:32 GMT',
// 'content-type': 'application/json',
// 'content-length': '259',
// 'access-control-allow-origin': '*',
// 'access-control-allow-credentials': 'true',
// via: '1.1 vegur' }
// body: {
// "args": {},
// "data": "123456",
// "files": {},
// "form": {},
// "headers": {
// "Connection": "close",
// "Content-Length": "6",
// "Host": "httpbin.org"
// },
// "json": 123456,
// "origin": "xxx.xxx.xxx.xxx",
// "url": "http://httpbin.org/post"
// }
```
### http2.auto.protocolCache
An instance of [`quick-lru`](https://github.com/sindresorhus/quick-lru) used for ALPN cache.
There is a maximum of 100 entries. You can modify the limit through `protocolCache.maxSize` - note that the change will be visible globally.
### http2.auto.createResolveProtocol(cache, queue, connect)
#### cache
Type: `Map<string, string>`
This is the store where cached ALPN protocols are put into.
#### queue
Type: `Map<string, Promise>`
This is the store that contains pending ALPN negotiation promises.
#### connect
Type: `(options, callback) => TLSSocket | Promise<TLSSocket>`
See https://github.com/szmarczak/resolve-alpn#connect
### http2.auto.resolveProtocol(options)
Returns a `Promise<{alpnProtocol: string}>`.
### http2.request(url, options, callback)
Same as [`https.request`](https://nodejs.org/api/https.html#https_https_request_options_callback).
##### options.h2session
Type: `Http2Session`<br>
The session used to make the actual request. If none provided, it will use `options.agent` to get one.
### http2.get(url, options, callback)
Same as [`https.get`](https://nodejs.org/api/https.html#https_https_get_options_callback).
### new http2.ClientRequest(url, options, callback)
Same as [`https.ClientRequest`](https://nodejs.org/api/https.html#https_class_https_clientrequest).
### new http2.IncomingMessage(socket)
Same as [`https.IncomingMessage`](https://nodejs.org/api/https.html#https_class_https_incomingmessage).
### new http2.Agent(options)
**Note:** this is **not** compatible with the classic `http.Agent`.
Usage example:
```js
const http2 = require('http2-wrapper');
class MyAgent extends http2.Agent {
createConnection(origin, options) {
console.log(`Connecting to ${http2.Agent.normalizeOrigin(origin)}`);
return http2.Agent.connect(origin, options);
}
}
http2.get({
hostname: 'google.com',
agent: new MyAgent()
}, response => {
response.on('data', chunk => console.log(`Received chunk of ${chunk.length} bytes`));
});
```
#### options
Each option is an `Agent` property and can be changed later.
##### timeout
Type: `number`<br>
Default: `0`
If there's no activity after `timeout` milliseconds, the session will be closed. If `0`, no timeout is applied.
##### maxSessions
Type: `number`<br>
Default: `Infinity`
The maximum amount of sessions in total.
##### maxEmptySessions
Type: `number`<br>
Default: `10`
The maximum amount of empty sessions in total. An empty session is a session with no pending requests.
##### maxCachedTlsSessions
Type: `number`<br>
Default: `100`
The maximum amount of cached TLS sessions.
#### agent.protocol
Type: `string`<br>
Default: `https:`
#### agent.settings
Type: `object`<br>
Default: `{enablePush: false}`
[Settings](https://nodejs.org/api/http2.html#http2_settings_object) used by the current agent instance.
#### agent.normalizeOptions([options](https://github.com/szmarczak/http2-wrapper/blob/master/source/agent.js))
Returns a string representing normalized options.
```js
Agent.normalizeOptions({servername: 'example.com'});
// => ':::::::::::::::::::::::::::::::::::::'
```
#### agent.getSession(origin, options)
##### [origin](https://nodejs.org/api/http2.html#http2_http2_connect_authority_options_listener)
Type: `string` `URL` `object`
Origin used to create new session.
##### [options](https://nodejs.org/api/http2.html#http2_http2_connect_authority_options_listener)
Type: `object`
Options used to create new session.
Returns a Promise giving free `Http2Session`. If no free sessions are found, a new one is created.
A session is considered free when pending streams count is less than max concurrent streams settings.
#### agent.getSession([origin](#origin), [options](options-1), listener)
##### listener
Type: `object`
```
{
reject: error => void,
resolve: session => void
}
```
If the `listener` argument is present, the Promise will resolve immediately. It will use the `resolve` function to pass the session.
#### agent.request([origin](#origin), [options](#options-1), [headers](https://nodejs.org/api/http2.html#http2_headers_object), [streamOptions](https://nodejs.org/api/http2.html#http2_clienthttp2session_request_headers_options))
Returns a Promise giving `Http2Stream`.
#### agent.createConnection([origin](#origin), [options](#options-1))
Returns a new `TLSSocket`. It defaults to `Agent.connect(origin, options)`.
#### agent.closeEmptySessions(count)
##### count
Type: `number`
Default: `Number.POSITIVE_INFINITY`
Makes an attempt to close empty sessions. Only sessions with 0 concurrent streams will be closed.
#### agent.destroy(reason)
Destroys **all** sessions.
#### agent.emptySessionCount
Type: `number`
A number of empty sessions.
#### agent.pendingSessionCount
Type: `number`
A number of pending sessions.
#### agent.sessionCount
Type: `number`
A number of all sessions held by the Agent.
#### Event: 'session'
```js
agent.on('session', session => {
// A new session has been created by the Agent.
});
```
## Proxy support
Currently `http2-wrapper` provides support for these proxies:
- `HttpOverHttp2`
- `HttpsOverHttp2`
- `Http2OverHttp2`
- `Http2OverHttp`
- `Http2OverHttps`
Any of the above can be accessed via `http2wrapper.proxies`. Check out the [`examples/proxies`](examples/proxies) directory to learn more.
**Note:** If you use the `http2.auto` function, the real IP address will leak. `http2wrapper` is not aware of the context. It will create a connection to the end server using your real IP address to get the ALPN protocol. Then it will create another connection using proxy. To migitate this, you need to pass a custom `resolveProtocol` function as an option:
```js
const resolveAlpnProxy = new URL('https://username:password@localhost:8000');
const connect = async (options, callback) => new Promise((resolve, reject) => {
const host = `${options.host}:${options.port}`;
(async () => {
try {
const request = await http2.auto(resolveAlpnProxy, {
method: 'CONNECT',
headers: {
host
},
path: host,
// For demo purposes only!
rejectUnauthorized: false,
});
request.end();
request.once('error', reject);
request.once('connect', (response, socket, head) => {
if (head.length > 0) {
reject(new Error(`Unexpected data before CONNECT tunnel: ${head.length} bytes`));
socket.destroy();
return;
}
const tlsSocket = tls.connect({
...options,
socket
}, callback);
resolve(tlsSocket);
});
} catch (error) {
reject(error);
}
})();
});
// This is required to prevent leaking real IP address on ALPN negotiation
const resolveProtocol = http2.auto.createResolveProtocol(new Map(), new Map(), connect);
const request = await http2.auto('https://httpbin.org/anything', {
agent: {…},
resolveProtocol
}, response => {
// Read the response here
});
request.end();
```
See [`unknown-over-unknown.js`](examples/proxies/unknown-over-unknown.js) to learn more.
## Mirroring another server
See [`examples/proxies/mirror.js`](examples/proxies/mirror.js) for an example.
## [WebSockets over HTTP/2](https://tools.ietf.org/html/rfc8441)
See [`examples/ws`](examples/ws) for an example.
## Push streams
See [`examples/push-stream`](examples/push-stream) for an example.
## Related
- [`got`](https://github.com/sindresorhus/got) - Simplified HTTP requests
- [`http2-proxy`](https://github.com/nxtedition/node-http2-proxy) - A simple http/2 & http/1.1 spec compliant proxy helper for Node.
## License
MIT

View File

@@ -0,0 +1,130 @@
import { getUserAgent } from 'universal-user-agent';
import { Collection } from 'before-after-hook';
import { request } from '@octokit/request';
import { withCustomRequest } from '@octokit/graphql';
import { createTokenAuth } from '@octokit/auth-token';
const VERSION = "4.2.0";
class Octokit {
constructor(options = {}) {
const hook = new Collection();
const requestDefaults = {
baseUrl: request.endpoint.DEFAULTS.baseUrl,
headers: {},
request: Object.assign({}, options.request, {
// @ts-ignore internal usage only, no need to type
hook: hook.bind(null, "request"),
}),
mediaType: {
previews: [],
format: "",
},
};
// prepend default user agent with `options.userAgent` if set
requestDefaults.headers["user-agent"] = [
options.userAgent,
`octokit-core.js/${VERSION} ${getUserAgent()}`,
]
.filter(Boolean)
.join(" ");
if (options.baseUrl) {
requestDefaults.baseUrl = options.baseUrl;
}
if (options.previews) {
requestDefaults.mediaType.previews = options.previews;
}
if (options.timeZone) {
requestDefaults.headers["time-zone"] = options.timeZone;
}
this.request = request.defaults(requestDefaults);
this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
this.log = Object.assign({
debug: () => { },
info: () => { },
warn: console.warn.bind(console),
error: console.error.bind(console),
}, options.log);
this.hook = hook;
// (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
// is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.
// (2) If only `options.auth` is set, use the default token authentication strategy.
// (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.
// TODO: type `options.auth` based on `options.authStrategy`.
if (!options.authStrategy) {
if (!options.auth) {
// (1)
this.auth = async () => ({
type: "unauthenticated",
});
}
else {
// (2)
const auth = createTokenAuth(options.auth);
// @ts-ignore ¯\_(ツ)_/¯
hook.wrap("request", auth.hook);
this.auth = auth;
}
}
else {
const { authStrategy, ...otherOptions } = options;
const auth = authStrategy(Object.assign({
request: this.request,
log: this.log,
// we pass the current octokit instance as well as its constructor options
// to allow for authentication strategies that return a new octokit instance
// that shares the same internal state as the current one. The original
// requirement for this was the "event-octokit" authentication strategy
// of https://github.com/probot/octokit-auth-probot.
octokit: this,
octokitOptions: otherOptions,
}, options.auth));
// @ts-ignore ¯\_(ツ)_/¯
hook.wrap("request", auth.hook);
this.auth = auth;
}
// apply plugins
// https://stackoverflow.com/a/16345172
const classConstructor = this.constructor;
classConstructor.plugins.forEach((plugin) => {
Object.assign(this, plugin(this, options));
});
}
static defaults(defaults) {
const OctokitWithDefaults = class extends this {
constructor(...args) {
const options = args[0] || {};
if (typeof defaults === "function") {
super(defaults(options));
return;
}
super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent
? {
userAgent: `${options.userAgent} ${defaults.userAgent}`,
}
: null));
}
};
return OctokitWithDefaults;
}
/**
* Attach a plugin (or many) to your Octokit instance.
*
* @example
* const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
*/
static plugin(...newPlugins) {
var _a;
const currentPlugins = this.plugins;
const NewOctokit = (_a = class extends this {
},
_a.plugins = currentPlugins.concat(newPlugins.filter((plugin) => !currentPlugins.includes(plugin))),
_a);
return NewOctokit;
}
}
Octokit.VERSION = VERSION;
Octokit.plugins = [];
export { Octokit };
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,96 @@
# json-parse-even-better-errors
[`json-parse-even-better-errors`](https://github.com/npm/json-parse-even-better-errors)
is a Node.js library for getting nicer errors out of `JSON.parse()`,
including context and position of the parse errors.
It also preserves the newline and indentation styles of the JSON data, by
putting them in the object or array in the `Symbol.for('indent')` and
`Symbol.for('newline')` properties.
## Install
`$ npm install --save json-parse-even-better-errors`
## Table of Contents
* [Example](#example)
* [Features](#features)
* [Contributing](#contributing)
* [API](#api)
* [`parse`](#parse)
### Example
```javascript
const parseJson = require('json-parse-even-better-errors')
parseJson('"foo"') // returns the string 'foo'
parseJson('garbage') // more useful error message
parseJson.noExceptions('garbage') // returns undefined
```
### Features
* Like JSON.parse, but the errors are better.
* Strips a leading byte-order-mark that you sometimes get reading files.
* Has a `noExceptions` method that returns undefined rather than throwing.
* Attaches the newline character(s) used to the `Symbol.for('newline')`
property on objects and arrays.
* Attaches the indentation character(s) used to the `Symbol.for('indent')`
property on objects and arrays.
## Indentation
To preserve indentation when the file is saved back to disk, use
`data[Symbol.for('indent')]` as the third argument to `JSON.stringify`, and
if you want to preserve windows `\r\n` newlines, replace the `\n` chars in
the string with `data[Symbol.for('newline')]`.
For example:
```js
const txt = await readFile('./package.json', 'utf8')
const data = parseJsonEvenBetterErrors(txt)
const indent = Symbol.for('indent')
const newline = Symbol.for('newline')
// .. do some stuff to the data ..
const string = JSON.stringify(data, null, data[indent]) + '\n'
const eolFixed = data[newline] === '\n' ? string
: string.replace(/\n/g, data[newline])
await writeFile('./package.json', eolFixed)
```
Indentation is determined by looking at the whitespace between the initial
`{` and `[` and the character that follows it. If you have lots of weird
inconsistent indentation, then it won't track that or give you any way to
preserve it. Whether this is a bug or a feature is debatable ;)
### API
#### <a name="parse"></a> `parse(txt, reviver = null, context = 20)`
Works just like `JSON.parse`, but will include a bit more information when
an error happens, and attaches a `Symbol.for('indent')` and
`Symbol.for('newline')` on objects and arrays. This throws a
`JSONParseError`.
#### <a name="parse"></a> `parse.noExceptions(txt, reviver = null)`
Works just like `JSON.parse`, but will return `undefined` rather than
throwing an error.
#### <a name="jsonparseerror"></a> `class JSONParseError(er, text, context = 20, caller = null)`
Extends the JavaScript `SyntaxError` class to parse the message and provide
better metadata.
Pass in the error thrown by the built-in `JSON.parse`, and the text being
parsed, and it'll parse out the bits needed to be helpful.
`context` defaults to 20.
Set a `caller` function to trim internal implementation details out of the
stack trace. When calling `parseJson`, this is set to the `parseJson`
function. If not set, then the constructor defaults to itself, so the
stack trace will point to the spot where you call `new JSONParseError`.

View File

@@ -0,0 +1 @@
module.exports={C:{"2":0,"3":0,"4":0,"5":0.03458,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0.00314,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00314,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.00314,"103":0,"104":0,"105":0,"106":0,"107":0.01572,"108":0.00314,"109":0.13205,"110":0.07546,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00314,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0.00314,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0.00314,"67":0.00314,"68":0.00314,"69":0,"70":0,"71":0.00314,"72":0,"73":0,"74":0.00314,"75":0,"76":0.00314,"77":0,"78":0.00314,"79":0.00943,"80":0.00314,"81":0,"83":0,"84":0.00314,"85":0.00629,"86":0.00629,"87":0.00629,"88":0.00314,"89":0.00629,"90":0,"91":0.00314,"92":0.00943,"93":0.00629,"94":0,"95":0,"96":0.00314,"97":0.00314,"98":0.00314,"99":0.00314,"100":0.00314,"101":0.00314,"102":0.00629,"103":0.03144,"104":0.00943,"105":0.01258,"106":0.01572,"107":0.02515,"108":0.16663,"109":3.67848,"110":2.43974,"111":0.00314,"112":0.00314,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00314,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.00314,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0.00314,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0.00314,"64":0,"65":0,"66":0.00314,"67":0.06288,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0.00314,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.01886,"94":0.27038,"95":0.08803,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.00314,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0.00314,"100":0,"101":0,"102":0,"103":0.00314,"104":0,"105":0.00314,"106":0,"107":0.00629,"108":0.02201,"109":0.4433,"110":0.53448},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00314,"14":0.01572,"15":0.00314,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00314,"13.1":0.01886,"14.1":0.03773,"15.1":0.00943,"15.2-15.3":0.00629,"15.4":0.0283,"15.5":0.03458,"15.6":0.1572,"16.0":0.01258,"16.1":0.06288,"16.2":0.15406,"16.3":0.14777,"16.4":0},G:{"8":0.01023,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00205,"6.0-6.1":0,"7.0-7.1":0.01841,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.03068,"10.0-10.2":0,"10.3":0.03682,"11.0-11.2":0.01227,"11.3-11.4":0,"12.0-12.1":0.00614,"12.2-12.5":0.2618,"13.0-13.1":0.00409,"13.2":0.00205,"13.3":0.01227,"13.4-13.7":0.05932,"14.0-14.4":0.20044,"14.5-14.8":0.32726,"15.0-15.1":0.10636,"15.2-15.3":0.17795,"15.4":0.18408,"15.5":0.38043,"15.6":1.32538,"16.0":1.87558,"16.1":3.59981,"16.2":4.77793,"16.3":5.5388,"16.4":0.02863},P:{"4":0.03072,"20":0.81916,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.03072,"8.2":0,"9.2":0.01024,"10.1":0,"11.1-11.2":0.01024,"12.0":0.01024,"13.0":0.02048,"14.0":0.03072,"15.0":0.01024,"16.0":0.03072,"17.0":0.04096,"18.0":0.07168,"19.0":1.24922},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00282,"4.2-4.3":0.00563,"4.4":0,"4.4.3-4.4.4":0.03098},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.00319,"9":0,"10":0,"11":0.22318,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":3.81879},H:{"0":0.86328},L:{"0":62.30744},R:{_:"0"},M:{"0":0.08227},Q:{"13.1":0}};

View File

@@ -0,0 +1 @@
{"version":3,"file":"switchMap.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/switchMap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAM9E,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,GAAG,CAAC,EACzD,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GACtC,gBAAgB,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,0JAA0J;AAC1J,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,GAAG,CAAC,EACzD,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,EACvC,cAAc,EAAE,SAAS,GACxB,gBAAgB,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,0JAA0J;AAC1J,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,GAAG,CAAC,EAC5D,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,EACvC,cAAc,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC,GAC3G,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1,18 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var Type = require('../Type');
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-subtract
module.exports = function BigIntSubtract(x, y) {
if (Type(x) !== 'BigInt' || Type(y) !== 'BigInt') {
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
}
// shortcut for the actual spec mechanics
return x - y;
};

View File

@@ -0,0 +1 @@
{"name":"is-path-inside","version":"3.0.3","files":{"license":{"checkedAt":1678883669272,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"index.js":{"checkedAt":1678883672611,"integrity":"sha512-lUpTrlfP9BJM7a7NFeSZUYBuuO7q1nj2RTss5lqyQUFCC36RSDaDw0OmWQv0+QafvvJI5nztuU17RxqBAUySzQ==","mode":420,"size":290},"package.json":{"checkedAt":1678883672611,"integrity":"sha512-tQsoe9us2eVPhQa5U63UO9NXEKwRnNxIp1GRFxLaSXgbiMYOnBY/JzbUnSPTRUM4kW+PC8bjZO1L+RfFuMZa0Q==","mode":420,"size":590},"readme.md":{"checkedAt":1678883672611,"integrity":"sha512-PiZFLeq3VsQB3H3EkJB64ErxGkTDkwoMD0Adk/1P4TPKYhKBTgzRpdWyk9Y05uf1ovK7OKezmFqgyNJwtldxzA==","mode":420,"size":1374},"index.d.ts":{"checkedAt":1678883672611,"integrity":"sha512-FR6Y0fEey9oM167ccjIVopspDHUVLdcA+56mjdEG6g+QLSoLFlqCoUENRmSCGyjPoNGXGOwoSLJV2sKkvEIGJA==","mode":420,"size":758}}}

View File

@@ -0,0 +1,97 @@
# 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.5](https://github.com/es-shims/Array.prototype.map/compare/v1.0.4...v1.0.5) - 2022-11-03
### Commits
- [actions] reuse common workflows [`c793092`](https://github.com/es-shims/Array.prototype.map/commit/c793092afae6c6df1a12f83c18b8710993039307)
- [meta] use `npmignore` to autogenerate an npmignore file [`6ec9705`](https://github.com/es-shims/Array.prototype.map/commit/6ec97053be3365748623b9f08460ab0ef98e4a66)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `safe-publish-latest`, `tape` [`7d2b675`](https://github.com/es-shims/Array.prototype.map/commit/7d2b675dca7a1ccab28dde7c5fab390d6cdc4d8a)
- [Deps] update `define-properties`, `es-abstract` [`884c2f1`](https://github.com/es-shims/Array.prototype.map/commit/884c2f11a9fed3053af348f627b2ff9248c95cfd)
- [Tests] add species coverage [`2b6df28`](https://github.com/es-shims/Array.prototype.map/commit/2b6df287c84751c910d3f01d009600684e2b6255)
- [actions] update rebase action to use reusable workflow [`01ccb07`](https://github.com/es-shims/Array.prototype.map/commit/01ccb07c7f77bc218f54de61b2fff3a0479be037)
- [actions] update codecov uploader [`1eec671`](https://github.com/es-shims/Array.prototype.map/commit/1eec67117364ee2913bd5a16e336b22c9e13ae5d)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`b8ae81b`](https://github.com/es-shims/Array.prototype.map/commit/b8ae81b535728ca06b2ea976c6be97b9e1262cc7)
- [Dev Deps] update `aud`, `functions-have-names`, `tape` [`6f2ccae`](https://github.com/es-shims/Array.prototype.map/commit/6f2ccaed5367de01519d96ba25a95966f1f30df2)
- [Deps] update `es-abstract` [`be80326`](https://github.com/es-shims/Array.prototype.map/commit/be80326dea4dd9baff2b84fa8cc8891fd74f967e)
- [Deps] update `es-abstract` [`1450f7d`](https://github.com/es-shims/Array.prototype.map/commit/1450f7d8b02eddd30762e7f81d3a8cc721642d4c)
- [Deps] update `es-abstract` [`8195a0e`](https://github.com/es-shims/Array.prototype.map/commit/8195a0e83620fa05ae03e2617b07b6937cfc3733)
## [v1.0.4](https://github.com/es-shims/Array.prototype.map/compare/v1.0.3...v1.0.4) - 2021-10-01
### Commits
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`5f6bb0a`](https://github.com/es-shims/Array.prototype.map/commit/5f6bb0afa3645cc08cf8ea86a609e54c1efe2e00)
- [Tests] use `call-bind` instead of `function-bind` [`cc1e8be`](https://github.com/es-shims/Array.prototype.map/commit/cc1e8be8f569d94c435cc77aa95c92fa286acf25)
- [Deps] update `es-abstract`, `is-string` [`485a225`](https://github.com/es-shims/Array.prototype.map/commit/485a2254c0aced3e888035659b33dabc5ae04b71)
- [readme] remove travis badge [`b19a58c`](https://github.com/es-shims/Array.prototype.map/commit/b19a58cac0f354a18cdd53c2b23fc2eed5895701)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `auto-changelog`, `tape` [`9c41b47`](https://github.com/es-shims/Array.prototype.map/commit/9c41b47b23bb06e5b5b79b8c830822beedade0aa)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `functions-have-names`, `has-strict-mode`, `tape` [`1c9589c`](https://github.com/es-shims/Array.prototype.map/commit/1c9589cceaefe2930b8ce01a7639decd80b49d39)
- [actions] update workflows [`c52989d`](https://github.com/es-shims/Array.prototype.map/commit/c52989d548d9c65705e80dc630ca1688b58c7403)
- [readme] add github actions/codecov badges [`94d48dc`](https://github.com/es-shims/Array.prototype.map/commit/94d48dc111f97426f54076b7341883ccab86eec3)
- [actions] update workflows [`12d87af`](https://github.com/es-shims/Array.prototype.map/commit/12d87afe4f1efd5e758367eee21ecee628f41738)
- [Tests] increase coverage [`2eb9a09`](https://github.com/es-shims/Array.prototype.map/commit/2eb9a0983daeae85dc450f307789018138329e7b)
- [Dev Deps] update `eslint`, `tape` [`c7b28ab`](https://github.com/es-shims/Array.prototype.map/commit/c7b28ab73951f428f2919d479df30b7506802896)
- [Deps] update `call-bind`, `es-abstract` [`39b103e`](https://github.com/es-shims/Array.prototype.map/commit/39b103ea6f8ede7ec0990af02b7a5235c408a2e4)
- [meta] use `prepublishOnly` script for npm 7+ [`75edba9`](https://github.com/es-shims/Array.prototype.map/commit/75edba96d1b550fa53c727eaebe5b942be8af338)
- [Deps] update `es-abstract` [`eae3b29`](https://github.com/es-shims/Array.prototype.map/commit/eae3b291fb42246a4615aa27bd3b816e8c8e94ec)
## [v1.0.3](https://github.com/es-shims/Array.prototype.map/compare/v1.0.2...v1.0.3) - 2020-11-19
### Commits
- [Tests] migrate tests to Github Actions [`7f300c8`](https://github.com/es-shims/Array.prototype.map/commit/7f300c8dc386f6452a8a742c3ff1955f79fca448)
- [meta] do not publish github action workflow files [`59276a2`](https://github.com/es-shims/Array.prototype.map/commit/59276a22dbac0a431e422d7056b06a51c565c0ed)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`3502b73`](https://github.com/es-shims/Array.prototype.map/commit/3502b73827b0998edd6538ce7728d5fd9933c15f)
- [Deps] update `es-abstract`; use `call-bind` where applicable [`37643d8`](https://github.com/es-shims/Array.prototype.map/commit/37643d8611c54b4b7f159532b4a7ea8fc183cb6b)
- [Tests] run `nyc` on all tests [`78049a0`](https://github.com/es-shims/Array.prototype.map/commit/78049a085944abd2186d9d7fbcf442b19b11d1e7)
- [actions] add "Allow Edits" workflow [`9e486a9`](https://github.com/es-shims/Array.prototype.map/commit/9e486a9865d5874768ed414b1e1cf30ec025fed7)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `functions-have-names`, `tape` [`fef8cac`](https://github.com/es-shims/Array.prototype.map/commit/fef8cac1ed6b3f37fcc8d77e44603d0f885ab4a3)
- [Tests] run `es-shim-api` in postlint; use `tape` runner [`4b26f09`](https://github.com/es-shims/Array.prototype.map/commit/4b26f09fcac54df57fb496ca31f435336e1ef470)
- [Dev Deps] update `auto-changelog`, `tape` [`6d3bb01`](https://github.com/es-shims/Array.prototype.map/commit/6d3bb01f5d092fce194a51d2782133803b8801ee)
- [Deps] update `es-abstract`, `is-string` [`88bce11`](https://github.com/es-shims/Array.prototype.map/commit/88bce1118b8452c9f6c89d68f2f247f1946e89dd)
- [Dev Deps] update `auto-changelog`; add `aud` [`6bfd366`](https://github.com/es-shims/Array.prototype.map/commit/6bfd3666905d45e76a3b988f01720c98619e84a4)
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`fcdb329`](https://github.com/es-shims/Array.prototype.map/commit/fcdb329c0bb0f23a77c4092dbdbed0e1073b4582)
- [Deps] update `es-abstract` [`9ddb318`](https://github.com/es-shims/Array.prototype.map/commit/9ddb31815b8254a2d1f2fc1e9b37da9b42ed979e)
- [Tests] only audit prod deps [`61176f9`](https://github.com/es-shims/Array.prototype.map/commit/61176f995d0c58348a95f04b8b15aa51ba21711f)
## [v1.0.2](https://github.com/es-shims/Array.prototype.map/compare/v1.0.1...v1.0.2) - 2019-12-16
### Commits
- [Refactor] use split-up `es-abstract` (66% bundle size decrease) [`d1bf408`](https://github.com/es-shims/Array.prototype.map/commit/d1bf408f70ef059bcb8beb28f960073ed4792c23)
- [Dev Deps] update `eslint` [`7c6f449`](https://github.com/es-shims/Array.prototype.map/commit/7c6f449e1b0ec6a7b0c04b1952a6a16d145fa2a1)
## [v1.0.1](https://github.com/es-shims/Array.prototype.map/compare/v1.0.0...v1.0.1) - 2019-11-21
### Commits
- [Tests] use shared travis-ci configs [`a3c7bac`](https://github.com/es-shims/Array.prototype.map/commit/a3c7bac90d35642d683ad7704be4c4bf639ae0ee)
- [meta] add `auto-changelog` [`9101d3a`](https://github.com/es-shims/Array.prototype.map/commit/9101d3a09cc6bb3fd814439ea81664cdf436d75a)
- [actions] add automatic rebasing / merge commit blocking [`5183622`](https://github.com/es-shims/Array.prototype.map/commit/5183622f5819712275e1fbdb16c27c4aae35b3c1)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `functions-have-names`, `auto-changelog` [`8bdd590`](https://github.com/es-shims/Array.prototype.map/commit/8bdd5904e505a96f7cfa34cf15618a4b551e9b29)
- [Fix] [Refactor]: move `is-string` to prod deps; use callBound instead of `function-bind` [`f0a4b33`](https://github.com/es-shims/Array.prototype.map/commit/f0a4b33df2268f2e7bdc3f777e0c1d3d85f99a90)
- [readme] fix example [`0fbd655`](https://github.com/es-shims/Array.prototype.map/commit/0fbd655b90b4d7791bd26da4322370230e40aca2)
- [Deps] update `es-abstract` [`9f9a70e`](https://github.com/es-shims/Array.prototype.map/commit/9f9a70ea4666dc644adcd126982bf9095747039a)
- [meta] add `funding` field [`b944c33`](https://github.com/es-shims/Array.prototype.map/commit/b944c3304e142053c6aa34ab69b4fc551e89eb4d)
- [Dev Deps] update `@ljharb/eslint-config` [`9b6d8e3`](https://github.com/es-shims/Array.prototype.map/commit/9b6d8e3390bcf989d940e187eba59f6077d02a7e)
- [actions] fix name of this action [`511a82f`](https://github.com/es-shims/Array.prototype.map/commit/511a82f57071320bb096923f1bba346d9b1c79f2)
## v1.0.0 - 2019-09-28
### Commits
- Tests [`7c021cb`](https://github.com/es-shims/Array.prototype.map/commit/7c021cb73eb1dc791384a85f17f28d3d0c8034fd)
- [Tests] add `travis.yml` [`7c4a1f6`](https://github.com/es-shims/Array.prototype.map/commit/7c4a1f632034cd552be5e179837aaddc44e425cd)
- implementation [`c5e97f7`](https://github.com/es-shims/Array.prototype.map/commit/c5e97f72e70f04166c1eda8d67e21f8c0d7ec973)
- Initial commit [`f7ddee4`](https://github.com/es-shims/Array.prototype.map/commit/f7ddee424d3ea57ba6a8deef32375a74f88d0977)
- readme [`86dfaa0`](https://github.com/es-shims/Array.prototype.map/commit/86dfaa09fc0aba93f5c80813ad3159f61ce37042)
- [Tests] add `npm run lint` [`1a64f45`](https://github.com/es-shims/Array.prototype.map/commit/1a64f457f6b9693c1b56303ded0f0e64253c9704)
- npm init [`cda5cda`](https://github.com/es-shims/Array.prototype.map/commit/cda5cda6fb2b3cd6107d79c1535ded3e4c9cead3)
- [meta] add `safe-publish-latest`, `auto-changelog` [`645f846`](https://github.com/es-shims/Array.prototype.map/commit/645f8465648969b8c908fad098403f3fc112d0e4)
- Only apps should have lockfiles [`32c5860`](https://github.com/es-shims/Array.prototype.map/commit/32c5860900487e6de237ec184d02639eaeea536d)

View File

@@ -0,0 +1,6 @@
import { argsOrArgArray } from '../util/argsOrArgArray';
import { raceWith } from './raceWith';
export function race(...args) {
return raceWith(...argsOrArgArray(args));
}
//# sourceMappingURL=race.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","2":"J D CC","260":"E"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB EC FC","2":"DC tB","516":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"I v J D E F A B C K"},E:{"1":"v J D E F A B C K L G IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I HC zB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"F B C PC QC RC SC qB AC TC","4":"rB"},G:{"1":"E BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","16":"zB UC"},H:{"2":"oC"},I:{"1":"tB I f rC sC BC tC uC","16":"pC qC"},J:{"1":"A","132":"D"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"1":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:1,C:"Online/offline status"};

View File

@@ -0,0 +1,43 @@
{
"name" : "concat-map",
"description" : "concatenative mapdashery",
"version" : "0.0.1",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/node-concat-map.git"
},
"main" : "index.js",
"keywords" : [
"concat",
"concatMap",
"map",
"functional",
"higher-order"
],
"directories" : {
"example" : "example",
"test" : "test"
},
"scripts" : {
"test" : "tape test/*.js"
},
"devDependencies" : {
"tape" : "~2.4.0"
},
"license" : "MIT",
"author" : {
"name" : "James Halliday",
"email" : "mail@substack.net",
"url" : "http://substack.net"
},
"testling" : {
"files" : "test/*.js",
"browsers" : {
"ie" : [ 6, 7, 8, 9 ],
"ff" : [ 3.5, 10, 15.0 ],
"chrome" : [ 10, 22 ],
"safari" : [ 5.1 ],
"opera" : [ 12 ]
}
}
}

View File

@@ -0,0 +1,156 @@
//
// ShellJS
// Unix shell commands on top of Node's API
//
// Copyright (c) 2012 Artur Adib
// http://github.com/shelljs/shelljs
//
var common = require('./src/common');
//@
//@ All commands run synchronously, unless otherwise stated.
//@ All commands accept standard bash globbing characters (`*`, `?`, etc.),
//@ compatible with the [node `glob` module](https://github.com/isaacs/node-glob).
//@
//@ For less-commonly used commands and features, please check out our [wiki
//@ page](https://github.com/shelljs/shelljs/wiki).
//@
// Include the docs for all the default commands
//@commands
// Load all default commands
require('./commands').forEach(function (command) {
require('./src/' + command);
});
//@
//@ ### exit(code)
//@
//@ Exits the current process with the given exit `code`.
exports.exit = process.exit;
//@include ./src/error
exports.error = require('./src/error');
//@include ./src/common
exports.ShellString = common.ShellString;
//@
//@ ### env['VAR_NAME']
//@
//@ Object containing environment variables (both getter and setter). Shortcut
//@ to `process.env`.
exports.env = process.env;
//@
//@ ### Pipes
//@
//@ Examples:
//@
//@ ```javascript
//@ grep('foo', 'file1.txt', 'file2.txt').sed(/o/g, 'a').to('output.txt');
//@ echo('files with o\'s in the name:\n' + ls().grep('o'));
//@ cat('test.js').exec('node'); // pipe to exec() call
//@ ```
//@
//@ Commands can send their output to another command in a pipe-like fashion.
//@ `sed`, `grep`, `cat`, `exec`, `to`, and `toEnd` can appear on the right-hand
//@ side of a pipe. Pipes can be chained.
//@
//@ ## Configuration
//@
exports.config = common.config;
//@
//@ ### config.silent
//@
//@ Example:
//@
//@ ```javascript
//@ var sh = require('shelljs');
//@ var silentState = sh.config.silent; // save old silent state
//@ sh.config.silent = true;
//@ /* ... */
//@ sh.config.silent = silentState; // restore old silent state
//@ ```
//@
//@ Suppresses all command output if `true`, except for `echo()` calls.
//@ Default is `false`.
//@
//@ ### config.fatal
//@
//@ Example:
//@
//@ ```javascript
//@ require('shelljs/global');
//@ config.fatal = true; // or set('-e');
//@ cp('this_file_does_not_exist', '/dev/null'); // throws Error here
//@ /* more commands... */
//@ ```
//@
//@ If `true`, the script will throw a Javascript error when any shell.js
//@ command encounters an error. Default is `false`. This is analogous to
//@ Bash's `set -e`.
//@
//@ ### config.verbose
//@
//@ Example:
//@
//@ ```javascript
//@ config.verbose = true; // or set('-v');
//@ cd('dir/');
//@ rm('-rf', 'foo.txt', 'bar.txt');
//@ exec('echo hello');
//@ ```
//@
//@ Will print each command as follows:
//@
//@ ```
//@ cd dir/
//@ rm -rf foo.txt bar.txt
//@ exec echo hello
//@ ```
//@
//@ ### config.globOptions
//@
//@ Example:
//@
//@ ```javascript
//@ config.globOptions = {nodir: true};
//@ ```
//@
//@ Use this value for calls to `glob.sync()` instead of the default options.
//@
//@ ### config.reset()
//@
//@ Example:
//@
//@ ```javascript
//@ var shell = require('shelljs');
//@ // Make changes to shell.config, and do stuff...
//@ /* ... */
//@ shell.config.reset(); // reset to original state
//@ // Do more stuff, but with original settings
//@ /* ... */
//@ ```
//@
//@ Reset `shell.config` to the defaults:
//@
//@ ```javascript
//@ {
//@ fatal: false,
//@ globOptions: {},
//@ maxdepth: 255,
//@ noglob: false,
//@ silent: false,
//@ verbose: false,
//@ }
//@ ```