new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import { MonoTypeOperatorFunction, SchedulerLike } from '../types';
|
||||
/**
|
||||
* Delays the emission of items from the source Observable by a given timeout or
|
||||
* until a given Date.
|
||||
*
|
||||
* <span class="informal">Time shifts each item by some specified amount of
|
||||
* milliseconds.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* If the delay argument is a Number, this operator time shifts the source
|
||||
* Observable by that amount of time expressed in milliseconds. The relative
|
||||
* time intervals between the values are preserved.
|
||||
*
|
||||
* If the delay argument is a Date, this operator time shifts the start of the
|
||||
* Observable execution until the given date occurs.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* Delay each click by one second
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, delay } from 'rxjs';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const delayedClicks = clicks.pipe(delay(1000)); // each click emitted after 1 second
|
||||
* delayedClicks.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* Delay all clicks until a future date happens
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, delay } from 'rxjs';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const date = new Date('March 15, 2050 12:00:00'); // in the future
|
||||
* const delayedClicks = clicks.pipe(delay(date)); // click emitted only after that date
|
||||
* delayedClicks.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* @see {@link delayWhen}
|
||||
* @see {@link throttle}
|
||||
* @see {@link throttleTime}
|
||||
* @see {@link debounce}
|
||||
* @see {@link debounceTime}
|
||||
* @see {@link sample}
|
||||
* @see {@link sampleTime}
|
||||
* @see {@link audit}
|
||||
* @see {@link auditTime}
|
||||
*
|
||||
* @param {number|Date} due The delay duration in milliseconds (a `number`) or
|
||||
* a `Date` until which the emission of the source items is delayed.
|
||||
* @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for
|
||||
* managing the timers that handle the time-shift for each item.
|
||||
* @return A function that returns an Observable that delays the emissions of
|
||||
* the source Observable by the specified timeout or Date.
|
||||
*/
|
||||
export declare function delay<T>(due: number | Date, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
|
||||
//# sourceMappingURL=delay.d.ts.map
|
||||
@@ -0,0 +1,129 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/libs/core/getEol.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../../index.html">All files</a> / <a href="index.html">csv2json/libs/core</a> getEol.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>0/14</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/12</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>0/14</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line low'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">//return eol from a data chunk.
|
||||
var eol = <span class="cstat-no" title="statement not covered" >require("os").EOL;</span>
|
||||
<span class="cstat-no" title="statement not covered" >module.exports = <span class="fstat-no" title="function not covered" >fu</span>nction(data, param) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (!param.eol && data) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > for (var i = 0, len = data.length; i < len; i++) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (data[i] === "\r") {</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (data[i + 1] === "\n") {</span>
|
||||
<span class="cstat-no" title="statement not covered" > param.eol = "\r\n";</span>
|
||||
} else <span class="cstat-no" title="statement not covered" >if (data[i + 1]) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > param.eol = "\r";</span>
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > return param.eol;</span>
|
||||
} else <span class="cstat-no" title="statement not covered" >if (data[i] === "\n") {</span>
|
||||
<span class="cstat-no" title="statement not covered" > param.eol = "\n";</span>
|
||||
<span class="cstat-no" title="statement not covered" > return param.eol;</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="cstat-no" title="statement not covered" > return param.eol;</span>
|
||||
};
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:20:20 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../../sorter.js"></script>
|
||||
<script src="../../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,96 @@
|
||||
const parseRepoURL = require('parse-github-url')
|
||||
const { cmd } = require('./utils')
|
||||
|
||||
const fetchRemote = async options => {
|
||||
const remoteURL = await cmd(`git config --get remote.${options.remote}.url`)
|
||||
return getRemote(remoteURL, options)
|
||||
}
|
||||
|
||||
const getRemote = (remoteURL, options = {}) => {
|
||||
const overrides = getOverrides(options)
|
||||
if (!remoteURL) {
|
||||
// No point warning if everything is overridden
|
||||
if (Object.keys(overrides).length !== 4) {
|
||||
console.warn(`Warning: Git remote ${options.remote} was not found`)
|
||||
}
|
||||
return {
|
||||
getCommitLink: () => null,
|
||||
getIssueLink: () => null,
|
||||
getMergeLink: () => null,
|
||||
getCompareLink: () => null,
|
||||
...overrides
|
||||
}
|
||||
}
|
||||
const remote = parseRepoURL(remoteURL)
|
||||
const protocol = remote.protocol === 'http:' ? 'http:' : 'https:'
|
||||
const hostname = remote.hostname || remote.host
|
||||
|
||||
const IS_BITBUCKET = /bitbucket/.test(hostname)
|
||||
const IS_GITLAB = /gitlab/.test(hostname)
|
||||
const IS_GITLAB_SUBGROUP = /\.git$/.test(remote.branch)
|
||||
const IS_AZURE = /dev\.azure/.test(hostname)
|
||||
const IS_VISUAL_STUDIO = /visualstudio/.test(hostname)
|
||||
|
||||
if (IS_BITBUCKET) {
|
||||
const url = `${protocol}//${hostname}/${remote.repo}`
|
||||
return {
|
||||
getCommitLink: id => `${url}/commits/${id}`,
|
||||
getIssueLink: id => `${url}/issues/${id}`,
|
||||
getMergeLink: id => `${url}/pull-requests/${id}`,
|
||||
getCompareLink: (from, to) => `${url}/compare/${to}..${from}`,
|
||||
...overrides
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_GITLAB) {
|
||||
const url = IS_GITLAB_SUBGROUP
|
||||
? `${protocol}//${hostname}/${remote.repo}/${remote.branch.replace(/\.git$/, '')}`
|
||||
: `${protocol}//${hostname}/${remote.repo}`
|
||||
return {
|
||||
getCommitLink: id => `${url}/commit/${id}`,
|
||||
getIssueLink: id => `${url}/issues/${id}`,
|
||||
getMergeLink: id => `${url}/merge_requests/${id}`,
|
||||
getCompareLink: (from, to) => `${url}/compare/${from}...${to}`,
|
||||
...overrides
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_AZURE || IS_VISUAL_STUDIO) {
|
||||
const url = IS_AZURE
|
||||
? `${protocol}//${hostname}/${remote.path}`
|
||||
: `${protocol}//${hostname}/${remote.repo}/${remote.branch}`
|
||||
const project = IS_AZURE
|
||||
? `${protocol}//${hostname}/${remote.repo}`
|
||||
: `${protocol}//${hostname}/${remote.owner}`
|
||||
return {
|
||||
getCommitLink: id => `${url}/commit/${id}`,
|
||||
getIssueLink: id => `${project}/_workitems/edit/${id}`,
|
||||
getMergeLink: id => `${url}/pullrequest/${id}`,
|
||||
getCompareLink: (from, to) => `${url}/branches?baseVersion=GT${to}&targetVersion=GT${from}&_a=commits`,
|
||||
...overrides
|
||||
}
|
||||
}
|
||||
|
||||
const url = `${protocol}//${hostname}/${remote.repo}`
|
||||
return {
|
||||
getCommitLink: id => `${url}/commit/${id}`,
|
||||
getIssueLink: id => `${url}/issues/${id}`,
|
||||
getMergeLink: id => `${url}/pull/${id}`,
|
||||
getCompareLink: (from, to) => `${url}/compare/${from}...${to}`,
|
||||
...overrides
|
||||
}
|
||||
}
|
||||
|
||||
const getOverrides = ({ commitUrl, issueUrl, mergeUrl, compareUrl }) => {
|
||||
const overrides = {}
|
||||
if (commitUrl) overrides.getCommitLink = id => commitUrl.replace('{id}', id)
|
||||
if (issueUrl) overrides.getIssueLink = id => issueUrl.replace('{id}', id)
|
||||
if (mergeUrl) overrides.getMergeLink = id => mergeUrl.replace('{id}', id)
|
||||
if (compareUrl) overrides.getCompareLink = (from, to) => compareUrl.replace('{from}', from).replace('{to}', to)
|
||||
return overrides
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
fetchRemote,
|
||||
getRemote
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"declaration": true,
|
||||
"rootDir": ".",
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"importHelpers": true,
|
||||
"stripInternal": true,
|
||||
"lib": ["es2015"]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"test/data"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
# IP
|
||||
[](https://www.npmjs.com/package/ip)
|
||||
|
||||
IP address utilities for node.js
|
||||
|
||||
## Installation
|
||||
|
||||
### npm
|
||||
```shell
|
||||
npm install ip
|
||||
```
|
||||
|
||||
### git
|
||||
|
||||
```shell
|
||||
git clone https://github.com/indutny/node-ip.git
|
||||
```
|
||||
|
||||
## Usage
|
||||
Get your ip address, compare ip addresses, validate ip addresses, etc.
|
||||
|
||||
```js
|
||||
var ip = require('ip');
|
||||
|
||||
ip.address() // my ip address
|
||||
ip.isEqual('::1', '::0:1'); // true
|
||||
ip.toBuffer('127.0.0.1') // Buffer([127, 0, 0, 1])
|
||||
ip.toString(new Buffer([127, 0, 0, 1])) // 127.0.0.1
|
||||
ip.fromPrefixLen(24) // 255.255.255.0
|
||||
ip.mask('192.168.1.134', '255.255.255.0') // 192.168.1.0
|
||||
ip.cidr('192.168.1.134/26') // 192.168.1.128
|
||||
ip.not('255.255.255.0') // 0.0.0.255
|
||||
ip.or('192.168.1.134', '0.0.0.255') // 192.168.1.255
|
||||
ip.isPrivate('127.0.0.1') // true
|
||||
ip.isV4Format('127.0.0.1'); // true
|
||||
ip.isV6Format('::ffff:127.0.0.1'); // true
|
||||
|
||||
// operate on buffers in-place
|
||||
var buf = new Buffer(128);
|
||||
var offset = 64;
|
||||
ip.toBuffer('127.0.0.1', buf, offset); // [127, 0, 0, 1] at offset 64
|
||||
ip.toString(buf, offset, 4); // '127.0.0.1'
|
||||
|
||||
// subnet information
|
||||
ip.subnet('192.168.1.134', '255.255.255.192')
|
||||
// { networkAddress: '192.168.1.128',
|
||||
// firstAddress: '192.168.1.129',
|
||||
// lastAddress: '192.168.1.190',
|
||||
// broadcastAddress: '192.168.1.191',
|
||||
// subnetMask: '255.255.255.192',
|
||||
// subnetMaskLength: 26,
|
||||
// numHosts: 62,
|
||||
// length: 64,
|
||||
// contains: function(addr){...} }
|
||||
ip.cidrSubnet('192.168.1.134/26')
|
||||
// Same as previous.
|
||||
|
||||
// range checking
|
||||
ip.cidrSubnet('192.168.1.134/26').contains('192.168.1.190') // true
|
||||
|
||||
|
||||
// ipv4 long conversion
|
||||
ip.toLong('127.0.0.1'); // 2130706433
|
||||
ip.fromLong(2130706433); // '127.0.0.1'
|
||||
```
|
||||
|
||||
### License
|
||||
|
||||
This software is licensed under the MIT License.
|
||||
|
||||
Copyright Fedor Indutny, 2012.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,127 @@
|
||||
# YAML <a href="https://www.npmjs.com/package/yaml"><img align="right" src="https://badge.fury.io/js/yaml.svg" title="npm package" /></a>
|
||||
|
||||
`yaml` is a JavaScript parser and stringifier for [YAML](http://yaml.org/), a human friendly data serialization standard. It supports both parsing and stringifying data using all versions of YAML, along with all common data schemas. As a particularly distinguishing feature, `yaml` fully supports reading and writing comments and blank lines in YAML documents.
|
||||
|
||||
The library is released under the ISC open source license, and the code is [available on GitHub](https://github.com/eemeli/yaml/). It has no external dependencies and runs on Node.js 6 and later, and in browsers from IE 11 upwards.
|
||||
|
||||
For the purposes of versioning, any changes that break any of the endpoints or APIs documented here will be considered semver-major breaking changes. Undocumented library internals may change between minor versions, and previous APIs may be deprecated (but not removed).
|
||||
|
||||
For more information, see the project's documentation site: [**eemeli.org/yaml/v1**](https://eemeli.org/yaml/v1/)
|
||||
|
||||
To install:
|
||||
|
||||
```sh
|
||||
npm install yaml
|
||||
```
|
||||
|
||||
**Note:** This is `yaml@1`. You may also be interested in the next version, currently available as [`yaml@next`](https://www.npmjs.com/package/yaml/v/next).
|
||||
|
||||
## API Overview
|
||||
|
||||
The API provided by `yaml` has three layers, depending on how deep you need to go: [Parse & Stringify](https://eemeli.org/yaml/v1/#parse-amp-stringify), [Documents](https://eemeli.org/yaml/#documents), and the [CST Parser](https://eemeli.org/yaml/#cst-parser). The first has the simplest API and "just works", the second gets you all the bells and whistles supported by the library along with a decent [AST](https://eemeli.org/yaml/#content-nodes), and the third is the closest to YAML source, making it fast, raw, and crude.
|
||||
|
||||
```js
|
||||
import YAML from 'yaml'
|
||||
// or
|
||||
const YAML = require('yaml')
|
||||
```
|
||||
|
||||
### Parse & Stringify
|
||||
|
||||
- [`YAML.parse(str, options): value`](https://eemeli.org/yaml/v1/#yaml-parse)
|
||||
- [`YAML.stringify(value, options): string`](https://eemeli.org/yaml/v1/#yaml-stringify)
|
||||
|
||||
### YAML Documents
|
||||
|
||||
- [`YAML.createNode(value, wrapScalars, tag): Node`](https://eemeli.org/yaml/v1/#creating-nodes)
|
||||
- [`YAML.defaultOptions`](https://eemeli.org/yaml/v1/#options)
|
||||
- [`YAML.Document`](https://eemeli.org/yaml/v1/#yaml-documents)
|
||||
- [`constructor(options)`](https://eemeli.org/yaml/v1/#creating-documents)
|
||||
- [`defaults`](https://eemeli.org/yaml/v1/#options)
|
||||
- [`#anchors`](https://eemeli.org/yaml/v1/#working-with-anchors)
|
||||
- [`#contents`](https://eemeli.org/yaml/v1/#content-nodes)
|
||||
- [`#errors`](https://eemeli.org/yaml/v1/#errors)
|
||||
- [`YAML.parseAllDocuments(str, options): YAML.Document[]`](https://eemeli.org/yaml/v1/#parsing-documents)
|
||||
- [`YAML.parseDocument(str, options): YAML.Document`](https://eemeli.org/yaml/v1/#parsing-documents)
|
||||
|
||||
```js
|
||||
import { Pair, YAMLMap, YAMLSeq } from 'yaml/types'
|
||||
```
|
||||
|
||||
- [`new Pair(key, value)`](https://eemeli.org/yaml/v1/#creating-nodes)
|
||||
- [`new YAMLMap()`](https://eemeli.org/yaml/v1/#creating-nodes)
|
||||
- [`new YAMLSeq()`](https://eemeli.org/yaml/v1/#creating-nodes)
|
||||
|
||||
### CST Parser
|
||||
|
||||
```js
|
||||
import parseCST from 'yaml/parse-cst'
|
||||
```
|
||||
|
||||
- [`parseCST(str): CSTDocument[]`](https://eemeli.org/yaml/v1/#parsecst)
|
||||
- [`YAML.parseCST(str): CSTDocument[]`](https://eemeli.org/yaml/v1/#parsecst)
|
||||
|
||||
## YAML.parse
|
||||
|
||||
```yaml
|
||||
# file.yml
|
||||
YAML:
|
||||
- A human-readable data serialization language
|
||||
- https://en.wikipedia.org/wiki/YAML
|
||||
yaml:
|
||||
- A complete JavaScript implementation
|
||||
- https://www.npmjs.com/package/yaml
|
||||
```
|
||||
|
||||
```js
|
||||
import fs from 'fs'
|
||||
import YAML from 'yaml'
|
||||
|
||||
YAML.parse('3.14159')
|
||||
// 3.14159
|
||||
|
||||
YAML.parse('[ true, false, maybe, null ]\n')
|
||||
// [ true, false, 'maybe', null ]
|
||||
|
||||
const file = fs.readFileSync('./file.yml', 'utf8')
|
||||
YAML.parse(file)
|
||||
// { YAML:
|
||||
// [ 'A human-readable data serialization language',
|
||||
// 'https://en.wikipedia.org/wiki/YAML' ],
|
||||
// yaml:
|
||||
// [ 'A complete JavaScript implementation',
|
||||
// 'https://www.npmjs.com/package/yaml' ] }
|
||||
```
|
||||
|
||||
## YAML.stringify
|
||||
|
||||
```js
|
||||
import YAML from 'yaml'
|
||||
|
||||
YAML.stringify(3.14159)
|
||||
// '3.14159\n'
|
||||
|
||||
YAML.stringify([true, false, 'maybe', null])
|
||||
// `- true
|
||||
// - false
|
||||
// - maybe
|
||||
// - null
|
||||
// `
|
||||
|
||||
YAML.stringify({ number: 3, plain: 'string', block: 'two\nlines\n' })
|
||||
// `number: 3
|
||||
// plain: string
|
||||
// block: >
|
||||
// two
|
||||
//
|
||||
// lines
|
||||
// `
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Browser testing provided by:
|
||||
|
||||
<a href="https://www.browserstack.com/open-source">
|
||||
<img width=200 src="https://eemeli.org/yaml/images/browserstack.svg" />
|
||||
</a>
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"fastq","version":"1.15.0","files":{"LICENSE":{"checkedAt":1678883673374,"integrity":"sha512-evchPJoEapp+9Kk5zZRA95xtvbXd0GFSaY4aac4rsnAZ0vneEh2tg31ybvorQDRRsid4MQBgM2kH5WpdchOY+w==","mode":420,"size":765},"bench.js":{"checkedAt":1678883673374,"integrity":"sha512-+iDoaM4ZD8Zhfp3FWKoRnGS3uinwAuRJ00JjByAe7ncmIQnU0mRnp0Gtv8Sc5sDiGAX2MNSyjjxCf8ZFGhSMtw==","mode":420,"size":1195},"example.js":{"checkedAt":1678883673374,"integrity":"sha512-mVyQ/Qr0vtPfvHYhmLmQE8jVm+w/kUGleDFk7AsB3+RZb+T+EqLa/6qt/b3naQVTQHtJmaJC+vv1pwDWkpAhPg==","mode":420,"size":238},"test/promise.js":{"checkedAt":1678883673374,"integrity":"sha512-R690BEirZdB85FOqiSUK9TU5L5HVUfGuiWnWkSwFsu02Z8rkK897NFth12mLXxIr/JBRkoynNCG3JiDn6/Yw0g==","mode":420,"size":5430},"test/tsconfig.json":{"checkedAt":1678883673376,"integrity":"sha512-IDz3YjBY1JHTNafNe7pvDTVHDTsJsJpTEF0auzU41Ie7/YvP7PbjpJL15NCx9kej0OpNNQWEVZGwFH7RUI182A==","mode":420,"size":154},"queue.js":{"checkedAt":1678883673376,"integrity":"sha512-vNpy9CQBmhrST3fkAr1lOGdOjcm+22rnPNy3bzTYbcBzSIerzauY61ovJrmsEWF9WB41mIvM1BYVbLMDZq4z+g==","mode":420,"size":5617},"test/test.js":{"checkedAt":1678883673376,"integrity":"sha512-MSrad5O4WQpnkD3Z7DLRw6KfiwXH6U6YSIEo+eHbtBLPNBg/SMnMC8koKYdMnQfjC4UC32Lgw1asKBFVYPhXcg==","mode":420,"size":11624},"package.json":{"checkedAt":1678883673376,"integrity":"sha512-bzmKoA0z2i5HUT3Y3JfvfMB82aH7u1H/3+Rci9lDPXITNJfW25E17zJ/K5F7R14BA9IQ4iR/7pz4cxjtFBirRQ==","mode":420,"size":1378},"README.md":{"checkedAt":1678883673377,"integrity":"sha512-Vd8OlDO9RcuAmF/XxrsHv1u/QDsfBKVTHntubPVOSTS0Y/fNrtIKveL0U17CiaBpnCMnW5P77Lm8IBLz6auABg==","mode":420,"size":8319},"index.d.ts":{"checkedAt":1678883673377,"integrity":"sha512-582DKPQwpq5NqTV0BZmMOoZLA5PHt1dkSsMmtm4lLTrMfRJVdshI0jmy+p5YjunlJ8dcAhSjGNf9+E3Y4o3C2g==","mode":420,"size":1392},"test/example.ts":{"checkedAt":1678883673377,"integrity":"sha512-WLeRe9pA5IM7DDTrVYrVJp6CpHCiV8plHyqfqxAI7lImRXITNktiqCjbzkmO5Tt8x2mylybJZQMN6ZszDlg+Dg==","mode":420,"size":1445},".github/workflows/ci.yml":{"checkedAt":1678883673377,"integrity":"sha512-qBmSD+gO/d+vHKh/ZWZLJfvoUGhlkQPRowtIGCyxyIBydrG/v70HF2VYyJsJ7KcUOCmIFKgoDIlRWST9dA4AAA==","mode":420,"size":915},"example.mjs":{"checkedAt":1678883673377,"integrity":"sha512-AFtzXI7xjdmMtpI/gIogVu2gHJbHj1NGQtvK4cFOMO7/KcWSMg9LNGLmwSpBlIP0g/V7cxG2giJjNdklEIerpQ==","mode":420,"size":221},".github/dependabot.yml":{"checkedAt":1678883673377,"integrity":"sha512-X99brF4xMYFpV19YG2rwc9Z8c3Dd1RSctfiao7387XVAGS8hlzICHKT1w0uKLggjbN2D2gdG9Zk+blajxLe/QQ==","mode":420,"size":192}}}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../../src/internal/operators/find.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA4DhE,MAAM,UAAU,IAAI,CAClB,SAAsE,EACtE,OAAa;IAEb,OAAO,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,SAAsE,EACtE,OAAY,EACZ,IAAuB;IAEvB,IAAM,SAAS,GAAG,IAAI,KAAK,OAAO,CAAC;IACnC,OAAO,UAAC,MAAqB,EAAE,UAA2B;QACxD,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EACV,UAAC,KAAK;YACJ,IAAM,CAAC,GAAG,KAAK,EAAE,CAAC;YAClB,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE;gBAC7C,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACvC,UAAU,CAAC,QAAQ,EAAE,CAAC;aACvB;QACH,CAAC,EACD;YACE,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC5C,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC,CACF,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
||||
@@ -0,0 +1,135 @@
|
||||
import {Split} from './utilities';
|
||||
import {StringDigit} from '../source/utilities';
|
||||
|
||||
/**
|
||||
Like the `Get` type but receives an array of strings as a path parameter.
|
||||
*/
|
||||
type GetWithPath<BaseType, Keys extends readonly string[]> =
|
||||
Keys extends []
|
||||
? BaseType
|
||||
: Keys extends [infer Head, ...infer Tail]
|
||||
? GetWithPath<PropertyOf<BaseType, Extract<Head, string>>, Extract<Tail, string[]>>
|
||||
: never;
|
||||
|
||||
/**
|
||||
Splits a dot-prop style path into a tuple comprised of the properties in the path. Handles square-bracket notation.
|
||||
|
||||
@example
|
||||
```
|
||||
ToPath<'foo.bar.baz'>
|
||||
//=> ['foo', 'bar', 'baz']
|
||||
|
||||
ToPath<'foo[0].bar.baz'>
|
||||
//=> ['foo', '0', 'bar', 'baz']
|
||||
```
|
||||
*/
|
||||
type ToPath<S extends string> = Split<FixPathSquareBrackets<S>, '.'>;
|
||||
|
||||
/**
|
||||
Replaces square-bracketed dot notation with dots, for example, `foo[0].bar` -> `foo.0.bar`.
|
||||
*/
|
||||
type FixPathSquareBrackets<Path extends string> =
|
||||
Path extends `${infer Head}[${infer Middle}]${infer Tail}`
|
||||
? `${Head}.${Middle}${FixPathSquareBrackets<Tail>}`
|
||||
: Path;
|
||||
|
||||
/**
|
||||
Returns true if `LongString` is made up out of `Substring` repeated 0 or more times.
|
||||
|
||||
@example
|
||||
```
|
||||
ConsistsOnlyOf<'aaa', 'a'> //=> true
|
||||
ConsistsOnlyOf<'ababab', 'ab'> //=> true
|
||||
ConsistsOnlyOf<'aBa', 'a'> //=> false
|
||||
ConsistsOnlyOf<'', 'a'> //=> true
|
||||
```
|
||||
*/
|
||||
type ConsistsOnlyOf<LongString extends string, Substring extends string> =
|
||||
LongString extends ''
|
||||
? true
|
||||
: LongString extends `${Substring}${infer Tail}`
|
||||
? ConsistsOnlyOf<Tail, Substring>
|
||||
: false;
|
||||
|
||||
/**
|
||||
Convert a type which may have number keys to one with string keys, making it possible to index using strings retrieved from template types.
|
||||
|
||||
@example
|
||||
```
|
||||
type WithNumbers = {foo: string; 0: boolean};
|
||||
type WithStrings = WithStringKeys<WithNumbers>;
|
||||
|
||||
type WithNumbersKeys = keyof WithNumbers;
|
||||
//=> 'foo' | 0
|
||||
type WithStringsKeys = keyof WithStrings;
|
||||
//=> 'foo' | '0'
|
||||
```
|
||||
*/
|
||||
type WithStringKeys<BaseType extends Record<string | number, any>> = {
|
||||
[Key in `${Extract<keyof BaseType, string | number>}`]: BaseType[Key]
|
||||
};
|
||||
|
||||
/**
|
||||
Get a property of an object or array. Works when indexing arrays using number-literal-strings, for example, `PropertyOf<number[], '0'> = number`, and when indexing objects with number keys.
|
||||
|
||||
Note:
|
||||
- Returns `unknown` if `Key` is not a property of `BaseType`, since TypeScript uses structural typing, and it cannot be guaranteed that extra properties unknown to the type system will exist at runtime.
|
||||
- Returns `undefined` from nullish values, to match the behaviour of most deep-key libraries like `lodash`, `dot-prop`, etc.
|
||||
*/
|
||||
type PropertyOf<BaseType, Key extends string> =
|
||||
BaseType extends null | undefined
|
||||
? undefined
|
||||
: Key extends keyof BaseType
|
||||
? BaseType[Key]
|
||||
: BaseType extends [] | [unknown, ...unknown[]]
|
||||
? unknown // It's a tuple, but `Key` did not extend `keyof BaseType`. So the index is out of bounds.
|
||||
: BaseType extends {
|
||||
[n: number]: infer Item;
|
||||
length: number; // Note: This is needed to avoid being too lax with records types using number keys like `{0: string; 1: boolean}`.
|
||||
}
|
||||
? (
|
||||
ConsistsOnlyOf<Key, StringDigit> extends true
|
||||
? Item
|
||||
: unknown
|
||||
)
|
||||
: Key extends keyof WithStringKeys<BaseType>
|
||||
? WithStringKeys<BaseType>[Key]
|
||||
: unknown;
|
||||
|
||||
// This works by first splitting the path based on `.` and `[...]` characters into a tuple of string keys. Then it recursively uses the head key to get the next property of the current object, until there are no keys left. Number keys extract the item type from arrays, or are converted to strings to extract types from tuples and dictionaries with number keys.
|
||||
/**
|
||||
Get a deeply-nested property from an object using a key path, like Lodash's `.get()` function.
|
||||
|
||||
Use-case: Retrieve a property from deep inside an API response or some other complex object.
|
||||
|
||||
@example
|
||||
```
|
||||
import {Get} from 'type-fest';
|
||||
import * as lodash from 'lodash';
|
||||
|
||||
const get = <BaseType, Path extends string>(object: BaseType, path: Path): Get<BaseType, Path> =>
|
||||
lodash.get(object, path);
|
||||
|
||||
interface ApiResponse {
|
||||
hits: {
|
||||
hits: Array<{
|
||||
_id: string
|
||||
_source: {
|
||||
name: Array<{
|
||||
given: string[]
|
||||
family: string
|
||||
}>
|
||||
birthDate: string
|
||||
}
|
||||
}>
|
||||
}
|
||||
}
|
||||
|
||||
const getName = (apiResponse: ApiResponse) =>
|
||||
get(apiResponse, 'hits.hits[0]._source.name');
|
||||
//=> Array<{given: string[]; family: string}>
|
||||
```
|
||||
|
||||
@category Template Literals
|
||||
*/
|
||||
export type Get<BaseType, Path extends string> = GetWithPath<BaseType, ToPath<Path>>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/// <reference types="bluebird" />
|
||||
import { Converter } from "./Converter";
|
||||
import { ProcessLineResult } from "./Processor";
|
||||
import P from "bluebird";
|
||||
import CSVError from "./CSVError";
|
||||
export declare class Result {
|
||||
private converter;
|
||||
private readonly needEmitLine;
|
||||
private _needPushDownstream?;
|
||||
private readonly needPushDownstream;
|
||||
private readonly needEmitAll;
|
||||
private finalResult;
|
||||
constructor(converter: Converter);
|
||||
processResult(resultLines: ProcessLineResult[]): P<any>;
|
||||
appendFinalResult(lines: any[]): void;
|
||||
processError(err: CSVError): void;
|
||||
endProcess(): void;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* The base implementation of `_.times` without support for iteratee shorthands
|
||||
* or max array length checks.
|
||||
*
|
||||
* @private
|
||||
* @param {number} n The number of times to invoke `iteratee`.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array} Returns the array of results.
|
||||
*/
|
||||
function baseTimes(n, iteratee) {
|
||||
var index = -1,
|
||||
result = Array(n);
|
||||
|
||||
while (++index < n) {
|
||||
result[index] = iteratee(index);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = baseTimes;
|
||||
@@ -0,0 +1 @@
|
||||
!function e(t,n,r){function o(u,c){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!c&&s)return s(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var a=n[u]={exports:{}};t[u][0].call(a.exports,function(e){var n=t[u][1][e];return o(n?n:e)},a,a.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(e,t,n){"use strict";function r(){}function o(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=w,this.queue=[],this.outcome=void 0,e!==r&&s(this,e)}function i(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function u(e,t,n){v(function(){var r;try{r=t(n)}catch(t){return d.reject(e,t)}r===e?d.reject(e,new TypeError("Cannot resolve promise with itself")):d.resolve(e,r)})}function c(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function s(e,t){function n(t){i||(i=!0,d.reject(e,t))}function r(t){i||(i=!0,d.resolve(e,t))}function o(){t(r,n)}var i=!1,u=f(o);"error"===u.status&&n(u.value)}function f(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}function a(e){return e instanceof this?e:d.resolve(new this(r),e)}function l(e){var t=new this(r);return d.reject(t,e)}function h(e){function t(e,t){function r(e){u[t]=e,++c!==o||i||(i=!0,d.resolve(f,u))}n.resolve(e).then(r,function(e){i||(i=!0,d.reject(f,e))})}var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var o=e.length,i=!1;if(!o)return this.resolve([]);for(var u=new Array(o),c=0,s=-1,f=new this(r);++s<o;)t(e[s],s);return f}function p(e){function t(e){n.resolve(e).then(function(e){i||(i=!0,d.resolve(c,e))},function(e){i||(i=!0,d.reject(c,e))})}var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var o=e.length,i=!1;if(!o)return this.resolve([]);for(var u=-1,c=new this(r);++u<o;)t(e[u]);return c}var v=e(2),d={},y=["REJECTED"],m=["FULFILLED"],w=["PENDING"];t.exports=o,o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){if("function"!=typeof e&&this.state===m||"function"!=typeof t&&this.state===y)return this;var n=new this.constructor(r);if(this.state!==w){var o=this.state===m?e:t;u(n,o,this.outcome)}else this.queue.push(new i(n,e,t));return n},i.prototype.callFulfilled=function(e){d.resolve(this.promise,e)},i.prototype.otherCallFulfilled=function(e){u(this.promise,this.onFulfilled,e)},i.prototype.callRejected=function(e){d.reject(this.promise,e)},i.prototype.otherCallRejected=function(e){u(this.promise,this.onRejected,e)},d.resolve=function(e,t){var n=f(c,t);if("error"===n.status)return d.reject(e,n.value);var r=n.value;if(r)s(e,r);else{e.state=m,e.outcome=t;for(var o=-1,i=e.queue.length;++o<i;)e.queue[o].callFulfilled(t)}return e},d.reject=function(e,t){e.state=y,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},o.resolve=a,o.reject=l,o.all=h,o.race=p},{2:2}],2:[function(e,t,n){(function(e){"use strict";function n(){a=!0;for(var e,t,n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}a=!1}function r(e){1!==l.push(e)||a||o()}var o,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var u=0,c=new i(n),s=e.document.createTextNode("");c.observe(s,{characterData:!0}),o=function(){s.data=u=++u%2}}else if(e.setImmediate||"undefined"==typeof e.MessageChannel)o="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){n(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(n,0)};else{var f=new e.MessageChannel;f.port1.onmessage=n,o=function(){f.port2.postMessage(0)}}var a,l=[];t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,t,n){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(1))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1}]},{},[3]);
|
||||
@@ -0,0 +1,75 @@
|
||||
'use strict';
|
||||
|
||||
var isWindows = process.platform === 'win32';
|
||||
|
||||
// Regex to split a windows path into into [dir, root, basename, name, ext]
|
||||
var splitWindowsRe =
|
||||
/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
|
||||
|
||||
var win32 = {};
|
||||
|
||||
function win32SplitPath(filename) {
|
||||
return splitWindowsRe.exec(filename).slice(1);
|
||||
}
|
||||
|
||||
win32.parse = function(pathString) {
|
||||
if (typeof pathString !== 'string') {
|
||||
throw new TypeError(
|
||||
"Parameter 'pathString' must be a string, not " + typeof pathString
|
||||
);
|
||||
}
|
||||
var allParts = win32SplitPath(pathString);
|
||||
if (!allParts || allParts.length !== 5) {
|
||||
throw new TypeError("Invalid path '" + pathString + "'");
|
||||
}
|
||||
return {
|
||||
root: allParts[1],
|
||||
dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
|
||||
base: allParts[2],
|
||||
ext: allParts[4],
|
||||
name: allParts[3]
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Split a filename into [dir, root, basename, name, ext], unix version
|
||||
// 'root' is just a slash, or nothing.
|
||||
var splitPathRe =
|
||||
/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
|
||||
var posix = {};
|
||||
|
||||
|
||||
function posixSplitPath(filename) {
|
||||
return splitPathRe.exec(filename).slice(1);
|
||||
}
|
||||
|
||||
|
||||
posix.parse = function(pathString) {
|
||||
if (typeof pathString !== 'string') {
|
||||
throw new TypeError(
|
||||
"Parameter 'pathString' must be a string, not " + typeof pathString
|
||||
);
|
||||
}
|
||||
var allParts = posixSplitPath(pathString);
|
||||
if (!allParts || allParts.length !== 5) {
|
||||
throw new TypeError("Invalid path '" + pathString + "'");
|
||||
}
|
||||
|
||||
return {
|
||||
root: allParts[1],
|
||||
dir: allParts[0].slice(0, -1),
|
||||
base: allParts[2],
|
||||
ext: allParts[4],
|
||||
name: allParts[3],
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
if (isWindows)
|
||||
module.exports = win32.parse;
|
||||
else /* posix */
|
||||
module.exports = posix.parse;
|
||||
|
||||
module.exports.posix = posix.parse;
|
||||
module.exports.win32 = win32.parse;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"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,"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.0014,"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,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"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,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0.0014,"109":0.02102,"110":0.01401,"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.0028,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.0014,"50":0,"51":0,"52":0,"53":0.0014,"54":0,"55":0,"56":0,"57":0.0014,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0.0014,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0.01261,"80":0.0014,"81":0.0028,"83":0.0014,"84":0.0014,"85":0.0028,"86":0.0028,"87":0.0028,"88":0,"89":0.0014,"90":0,"91":0.0014,"92":0.0014,"93":0,"94":0,"95":0.0014,"96":0.0014,"97":0.0014,"98":0,"99":0.0014,"100":0.0028,"101":0.0014,"102":0.0014,"103":0.0042,"104":0.0028,"105":0.0028,"106":0.0028,"107":0.0042,"108":0.01821,"109":0.47354,"110":0.30122,"111":0,"112":0,"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.0014,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0.0014,"37":0.00841,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.0028,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0.0014,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.0028,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"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,"94":0.00841,"95":0.00701,"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.0014,"16":0,"17":0,"18":0,"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,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0.0014,"109":0.03082,"110":0.04203},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.0014,"14":0.0042,"15":0.0014,_:"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,"13.1":0.0042,"14.1":0.01121,"15.1":0.0014,"15.2-15.3":0.0014,"15.4":0.0028,"15.5":0.0056,"15.6":0.02522,"16.0":0.0014,"16.1":0.0056,"16.2":0.01261,"16.3":0.00841,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00284,"6.0-6.1":0.00284,"7.0-7.1":0.01986,"8.1-8.4":0.01135,"9.0-9.2":0.01703,"9.3":0.105,"10.0-10.2":0.02838,"10.3":0.19864,"11.0-11.2":0.05959,"11.3-11.4":0.08797,"12.0-12.1":0.08513,"12.2-12.5":1.98361,"13.0-13.1":0.03973,"13.2":0.0227,"13.3":0.15324,"13.4-13.7":0.52215,"14.0-14.4":1.23444,"14.5-14.8":2.6136,"15.0-15.1":0.52215,"15.2-15.3":0.72647,"15.4":0.79458,"15.5":1.36214,"15.6":3.34575,"16.0":1.43876,"16.1":3.90479,"16.2":3.29183,"16.3":1.71686,"16.4":0.00851},P:{"4":0.34593,"20":0.97674,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.11192,"8.2":0,"9.2":0.0407,"10.1":0.02035,"11.1-11.2":0.10174,"12.0":0.03052,"13.0":0.0814,"14.0":0.07122,"15.0":0.05087,"16.0":0.13227,"17.0":0.15262,"18.0":0.16279,"19.0":1.71947},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.0256},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.0028,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":2.01217},H:{"0":0.42333},L:{"0":64.65364},R:{_:"0"},M:{"0":0.06019},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,18 @@
|
||||
import { OperatorFunction } from '../types';
|
||||
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
||||
export declare function pluck<T, K1 extends keyof T>(k1: K1): OperatorFunction<T, T[K1]>;
|
||||
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
||||
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1]>(k1: K1, k2: K2): OperatorFunction<T, T[K1][K2]>;
|
||||
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
||||
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2]>(k1: K1, k2: K2, k3: K3): OperatorFunction<T, T[K1][K2][K3]>;
|
||||
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
||||
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3]>(k1: K1, k2: K2, k3: K3, k4: K4): OperatorFunction<T, T[K1][K2][K3][K4]>;
|
||||
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
||||
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3], K5 extends keyof T[K1][K2][K3][K4]>(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5): OperatorFunction<T, T[K1][K2][K3][K4][K5]>;
|
||||
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
||||
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3], K5 extends keyof T[K1][K2][K3][K4], K6 extends keyof T[K1][K2][K3][K4][K5]>(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5, k6: K6): OperatorFunction<T, T[K1][K2][K3][K4][K5][K6]>;
|
||||
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
||||
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3], K5 extends keyof T[K1][K2][K3][K4], K6 extends keyof T[K1][K2][K3][K4][K5]>(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5, k6: K6, ...rest: string[]): OperatorFunction<T, unknown>;
|
||||
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
||||
export declare function pluck<T>(...properties: string[]): OperatorFunction<T, unknown>;
|
||||
//# sourceMappingURL=pluck.d.ts.map
|
||||
@@ -0,0 +1,59 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var debug = require('object-inspect');
|
||||
var forEach = require('for-each');
|
||||
|
||||
var isMap = require('..');
|
||||
|
||||
test('non-collections', function (t) {
|
||||
forEach([
|
||||
null,
|
||||
undefined,
|
||||
true,
|
||||
false,
|
||||
42,
|
||||
0,
|
||||
-0,
|
||||
NaN,
|
||||
Infinity,
|
||||
'',
|
||||
'foo',
|
||||
/a/g,
|
||||
[],
|
||||
{},
|
||||
function () {}
|
||||
], function (nonCollection) {
|
||||
t.equal(isMap(nonCollection), false, debug(nonCollection) + ' is not a Map');
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Maps', { skip: typeof Map !== 'function' }, function (t) {
|
||||
var m = new Map();
|
||||
t.equal(isMap(m), true, debug(m) + ' is a Map');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Sets', { skip: typeof Set !== 'function' }, function (t) {
|
||||
var s = new Set();
|
||||
t.equal(isMap(s), false, debug(s) + ' is not a Map');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('WeakMaps', { skip: typeof WeakMap !== 'function' }, function (t) {
|
||||
var wm = new WeakMap();
|
||||
t.equal(isMap(wm), false, debug(wm) + ' is not a Map');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('WeakSets', { skip: typeof WeakSet !== 'function' }, function (t) {
|
||||
var ws = new WeakSet();
|
||||
t.equal(isMap(ws), false, debug(ws) + ' is not a Map');
|
||||
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
export const config = {
|
||||
onUnhandledError: null,
|
||||
onStoppedNotification: null,
|
||||
Promise: undefined,
|
||||
useDeprecatedSynchronousErrorHandling: false,
|
||||
useDeprecatedNextContext: false,
|
||||
};
|
||||
//# sourceMappingURL=config.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A CC","129":"B"},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":"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 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","2":"DC tB EC FC"},D:{"1":"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 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"},E:{"1":"D E F A B C K L G KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J HC zB IC JC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 C 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 rB","2":"F B PC QC RC SC qB AC TC"},G:{"1":"E 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","2":"zB UC BC VC WC"},H:{"2":"oC"},I:{"1":"f tC uC","2":"tB I pC qC rC sC BC"},J:{"1":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"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:6,C:"Strict Transport Security"};
|
||||
@@ -0,0 +1,48 @@
|
||||
var LazyWrapper = require('./_LazyWrapper'),
|
||||
LodashWrapper = require('./_LodashWrapper'),
|
||||
baseAt = require('./_baseAt'),
|
||||
flatRest = require('./_flatRest'),
|
||||
isIndex = require('./_isIndex'),
|
||||
thru = require('./thru');
|
||||
|
||||
/**
|
||||
* This method is the wrapper version of `_.at`.
|
||||
*
|
||||
* @name at
|
||||
* @memberOf _
|
||||
* @since 1.0.0
|
||||
* @category Seq
|
||||
* @param {...(string|string[])} [paths] The property paths to pick.
|
||||
* @returns {Object} Returns the new `lodash` wrapper instance.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
|
||||
*
|
||||
* _(object).at(['a[0].b.c', 'a[1]']).value();
|
||||
* // => [3, 4]
|
||||
*/
|
||||
var wrapperAt = flatRest(function(paths) {
|
||||
var length = paths.length,
|
||||
start = length ? paths[0] : 0,
|
||||
value = this.__wrapped__,
|
||||
interceptor = function(object) { return baseAt(object, paths); };
|
||||
|
||||
if (length > 1 || this.__actions__.length ||
|
||||
!(value instanceof LazyWrapper) || !isIndex(start)) {
|
||||
return this.thru(interceptor);
|
||||
}
|
||||
value = value.slice(start, +start + (length ? 1 : 0));
|
||||
value.__actions__.push({
|
||||
'func': thru,
|
||||
'args': [interceptor],
|
||||
'thisArg': undefined
|
||||
});
|
||||
return new LodashWrapper(value, this.__chain__).thru(function(array) {
|
||||
if (length && !array.length) {
|
||||
array.push(undefined);
|
||||
}
|
||||
return array;
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = wrapperAt;
|
||||
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
||||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
||||
to[j] = from[i];
|
||||
return to;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.mergeWith = void 0;
|
||||
var merge_1 = require("./merge");
|
||||
function mergeWith() {
|
||||
var otherSources = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
otherSources[_i] = arguments[_i];
|
||||
}
|
||||
return merge_1.merge.apply(void 0, __spreadArray([], __read(otherSources)));
|
||||
}
|
||||
exports.mergeWith = mergeWith;
|
||||
//# sourceMappingURL=mergeWith.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{D:{"1":"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":"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 HB IB JB KB LB MB NB"},L:{"1":"H"},B:{"1":"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","2":"C K L G M N O"},C:{"1":"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","2":"DC tB I v J D E F EC FC","33":"0 1 2 3 4 5 6 7 8 9 A B C K 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"},M:{"1":"H"},A:{"2":"J D E F A B CC"},F:{"1":"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":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB PC QC RC SC qB AC TC rB"},K:{"1":"h","2":"A B C qB AC rB"},E:{"1":"B C K L G qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"I v HC zB IC OC","33":"J D E F A JC KC LC 0B"},G:{"1":"dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"zB UC BC VC","33":"E WC XC YC ZC aC bC cC"},P:{"1":"g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"}},B:6,C:"plaintext from unicode-bidi"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../src/internal/observable/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAmB,aAAa,EAAE,MAAM,UAAU,CAAC;AAK1D,aAAK,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;AAC9C,aAAK,WAAW,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AACtC,aAAK,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AAExC,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC;;OAEG;IACH,YAAY,EAAE,CAAC,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC7B;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,mBAAmB,CAAC,CAAC,CAAC;IACnE;;OAEG;IACH,cAAc,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAC3B,YAAY,EAAE,CAAC,EACf,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EACvB,cAAc,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,EAChC,SAAS,CAAC,EAAE,aAAa,GACxB,UAAU,CAAC,CAAC,CAAC,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6IG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,YAAY,EAAE,CAAC,EACf,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EACvB,SAAS,CAAC,EAAE,aAAa,GACxB,UAAU,CAAC,CAAC,CAAC,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A CC","161":"B"},B:{"2":"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","161":"C K L G M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB 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 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"},D:{"2":"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 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"},E:{"2":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C 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 PC QC RC SC qB AC TC rB"},G:{"2":"E zB UC 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"},H:{"2":"oC"},I:{"2":"tB I f pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"2":"A B C h qB AC rB"},L:{"2":"H"},M:{"2":"H"},N:{"2":"A","161":"B"},O:{"2":"vC"},P:{"2":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"2":"1B"},R:{"2":"9C"},S:{"2":"AD BD"}},B:7,C:"Input Method Editor API"};
|
||||
@@ -0,0 +1,28 @@
|
||||
var createCompounder = require('./_createCompounder');
|
||||
|
||||
/**
|
||||
* Converts `string` to
|
||||
* [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.0.0
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to convert.
|
||||
* @returns {string} Returns the kebab cased string.
|
||||
* @example
|
||||
*
|
||||
* _.kebabCase('Foo Bar');
|
||||
* // => 'foo-bar'
|
||||
*
|
||||
* _.kebabCase('fooBar');
|
||||
* // => 'foo-bar'
|
||||
*
|
||||
* _.kebabCase('__FOO_BAR__');
|
||||
* // => 'foo-bar'
|
||||
*/
|
||||
var kebabCase = createCompounder(function(result, word, index) {
|
||||
return result + (index ? '-' : '') + word.toLowerCase();
|
||||
});
|
||||
|
||||
module.exports = kebabCase;
|
||||
@@ -0,0 +1,5 @@
|
||||
export declare function omit(object: {
|
||||
[key: string]: any;
|
||||
}, keysToOmit: string[]): {
|
||||
[key: string]: any;
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "toidentifier",
|
||||
"description": "Convert a string of words to a JavaScript identifier",
|
||||
"version": "1.0.1",
|
||||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"contributors": [
|
||||
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
|
||||
],
|
||||
"repository": "component/toidentifier",
|
||||
"devDependencies": {
|
||||
"eslint": "7.32.0",
|
||||
"eslint-config-standard": "14.1.1",
|
||||
"eslint-plugin-import": "2.25.3",
|
||||
"eslint-plugin-markdown": "2.2.1",
|
||||
"eslint-plugin-node": "11.1.0",
|
||||
"eslint-plugin-promise": "4.3.1",
|
||||
"eslint-plugin-standard": "4.1.0",
|
||||
"mocha": "9.1.3",
|
||||
"nyc": "15.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "mocha --reporter spec --bail --check-leaks test/",
|
||||
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
||||
"test-cov": "nyc --reporter=html --reporter=text npm test",
|
||||
"version": "node scripts/version-history.js && git add HISTORY.md"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"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,"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.01057,"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,"67":0,"68":0.00352,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00352,"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.00705,"99":0.00352,"100":0.00352,"101":0,"102":0.00352,"103":0.00705,"104":0.00705,"105":0.00705,"106":0,"107":0.00352,"108":0.00705,"109":0.5214,"110":0.32059,"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.00352,"39":0,"40":0,"41":0.00352,"42":0,"43":0,"44":0.00352,"45":0,"46":0,"47":0,"48":0,"49":0.02114,"50":0,"51":0,"52":0,"53":0.01762,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0.00352,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0.00705,"67":0,"68":0.01409,"69":0,"70":0.00352,"71":0,"72":0,"73":0,"74":0.00352,"75":0.00352,"76":0,"77":0,"78":0,"79":0.09512,"80":0.00705,"81":0.01409,"83":0.01409,"84":0.00352,"85":0.01762,"86":0.00705,"87":0.01409,"88":0.00352,"89":0.00352,"90":0.00352,"91":0,"92":0.04228,"93":0.03875,"94":0.01057,"95":0.00705,"96":0.00705,"97":0.00705,"98":0.00352,"99":0.01409,"100":0.02466,"101":0.00352,"102":0.01762,"103":0.05637,"104":0.00352,"105":0.05285,"106":0.02114,"107":0.1691,"108":0.22195,"109":5.7284,"110":2.6951,"111":0,"112":0,"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.02114,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0.00352,"41":0,"42":0.00352,"43":0,"44":0,"45":0,"46":0.00352,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.00352,"68":0.00705,"69":0,"70":0,"71":0,"72":0,"73":0.00352,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0.00705,"86":0,"87":0.00352,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.01057,"94":0.25366,"95":0.17615,"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,"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.01057,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0.00352,"104":0,"105":0,"106":0,"107":0.03523,"108":0.01409,"109":0.22195,"110":0.23956},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.01057,"15":0.00352,_:"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.01057,"13.1":0.01409,"14.1":0.0458,"15.1":0.00352,"15.2-15.3":0.01762,"15.4":0.09512,"15.5":0.02466,"15.6":0.13387,"16.0":0.00705,"16.1":0.02466,"16.2":0.11626,"16.3":0.03875,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0.04525,"8.1-8.4":0.00617,"9.0-9.2":0.00411,"9.3":0.07198,"10.0-10.2":0,"10.3":0.11311,"11.0-11.2":0.01851,"11.3-11.4":0.01028,"12.0-12.1":0.0144,"12.2-12.5":0.26736,"13.0-13.1":0.00823,"13.2":0,"13.3":0.07609,"13.4-13.7":0.07404,"14.0-14.4":0.22006,"14.5-14.8":0.77328,"15.0-15.1":0.1234,"15.2-15.3":0.28792,"15.4":0.32494,"15.5":0.83704,"15.6":2.3363,"16.0":2.76202,"16.1":4.37234,"16.2":4.06591,"16.3":2.53579,"16.4":0.01028},P:{"4":0.16133,"20":1.15954,"5.0-5.4":0.01008,"6.2-6.4":0,"7.2-7.4":0.02017,"8.2":0,"9.2":0.01008,"10.1":0,"11.1-11.2":0.18149,"12.0":0.01008,"13.0":0.03025,"14.0":0.02017,"15.0":0.02017,"16.0":0.04033,"17.0":0.05041,"18.0":0.07058,"19.0":2.03675},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00318,"4.2-4.3":0.00953,"4.4":0,"4.4.3-4.4.4":0.07309},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.01057,"9":0.00352,"10":0,"11":0.01762,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.01295},H:{"0":0.22075},L:{"0":62.65394},R:{_:"0"},M:{"0":0.13602},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('words', require('../words'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"name": "node-fetch",
|
||||
"version": "2.6.9",
|
||||
"description": "A light-weight module that brings window.fetch to node.js",
|
||||
"main": "lib/index.js",
|
||||
"browser": "./browser.js",
|
||||
"module": "lib/index.mjs",
|
||||
"files": [
|
||||
"lib/index.js",
|
||||
"lib/index.mjs",
|
||||
"lib/index.es.js",
|
||||
"browser.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "cross-env BABEL_ENV=rollup rollup -c",
|
||||
"prepare": "npm run build",
|
||||
"test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js",
|
||||
"report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js",
|
||||
"coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bitinn/node-fetch.git"
|
||||
},
|
||||
"keywords": [
|
||||
"fetch",
|
||||
"http",
|
||||
"promise"
|
||||
],
|
||||
"author": "David Frank",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/bitinn/node-fetch/issues"
|
||||
},
|
||||
"homepage": "https://github.com/bitinn/node-fetch",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ungap/url-search-params": "^0.1.2",
|
||||
"abort-controller": "^1.1.0",
|
||||
"abortcontroller-polyfill": "^1.3.0",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-plugin-istanbul": "^4.1.6",
|
||||
"babel-plugin-transform-async-generator-functions": "^6.24.1",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"babel-preset-env": "1.4.0",
|
||||
"babel-register": "^6.16.3",
|
||||
"chai": "^3.5.0",
|
||||
"chai-as-promised": "^7.1.1",
|
||||
"chai-iterator": "^1.1.1",
|
||||
"chai-string": "~1.3.0",
|
||||
"codecov": "3.3.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"form-data": "^2.3.3",
|
||||
"is-builtin-module": "^1.0.0",
|
||||
"mocha": "^5.0.0",
|
||||
"nyc": "11.9.0",
|
||||
"parted": "^0.1.1",
|
||||
"promise": "^8.0.3",
|
||||
"resumer": "0.0.0",
|
||||
"rollup": "^0.63.4",
|
||||
"rollup-plugin-babel": "^3.0.7",
|
||||
"string-to-arraybuffer": "^1.0.2",
|
||||
"teeny-request": "3.7.0"
|
||||
},
|
||||
"release": {
|
||||
"branches": [
|
||||
"+([0-9]).x",
|
||||
"main",
|
||||
"next",
|
||||
{
|
||||
"name": "beta",
|
||||
"prerelease": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { cloneDeep } from '../util/cloneDeep'
|
||||
import defaultConfig from '../../stubs/defaultConfig.stub'
|
||||
|
||||
export default cloneDeep(defaultConfig.theme)
|
||||
@@ -0,0 +1,5 @@
|
||||
function restoreImport(uri, mediaQuery) {
|
||||
return ('@import ' + uri + ' ' + mediaQuery).trim();
|
||||
}
|
||||
|
||||
module.exports = restoreImport;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"string-width","version":"4.2.3","files":{"license":{"checkedAt":1678883669272,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"package.json":{"checkedAt":1678883669288,"integrity":"sha512-PkPX1lbuECmr1dxtqCfbgZB9mdYAMREddH65tzVBReAmLBE6Bh/jQ9QCCjy6Qfr8Yg19nyfNLYA1oq8yt+6rng==","mode":420,"size":941},"readme.md":{"checkedAt":1678883669288,"integrity":"sha512-bQhgcN8/iOJdRcgspTTFsjeElzfqZ1KCzULTF8ppshMa+p7QF3FZNQ16xvqcm9vZU6TbEz7gLySFIRgtjBfusg==","mode":420,"size":1396},"index.js":{"checkedAt":1678883669288,"integrity":"sha512-8K0p/JnLN557yymVwYpV2pramFJFbo2nUuzGeeDK89D5idVYul8EG7ArwC+4iowviufxpSSioEG1TsVjfHHBIQ==","mode":420,"size":923},"index.d.ts":{"checkedAt":1678883669290,"integrity":"sha512-qvL60DCqLB3SS59BasyEV7fR8EqUL/i8Jv1Inc7yCCIMpfvoaDxHJSBfOw7CUbTqkSV5kfmQ/LQG3RUDHA7FYA==","mode":420,"size":792}}}
|
||||
@@ -0,0 +1,36 @@
|
||||
var common = require('./common');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
common.register('toEnd', _toEnd, {
|
||||
pipeOnly: true,
|
||||
wrapOutput: false,
|
||||
});
|
||||
|
||||
//@
|
||||
//@ ### ShellString.prototype.toEnd(file)
|
||||
//@
|
||||
//@ Examples:
|
||||
//@
|
||||
//@ ```javascript
|
||||
//@ cat('input.txt').toEnd('output.txt');
|
||||
//@ ```
|
||||
//@
|
||||
//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with
|
||||
//@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.).
|
||||
function _toEnd(options, file) {
|
||||
if (!file) common.error('wrong arguments');
|
||||
|
||||
if (!fs.existsSync(path.dirname(file))) {
|
||||
common.error('no such file or directory: ' + path.dirname(file));
|
||||
}
|
||||
|
||||
try {
|
||||
fs.appendFileSync(file, this.stdout || this.toString(), 'utf8');
|
||||
return this;
|
||||
} catch (e) {
|
||||
/* istanbul ignore next */
|
||||
common.error('could not append to file (code ' + e.code + '): ' + file, { continue: true });
|
||||
}
|
||||
}
|
||||
module.exports = _toEnd;
|
||||
@@ -0,0 +1,242 @@
|
||||
import { Octokit } from "@octokit/core";
|
||||
import * as OctokitTypes from "@octokit/types";
|
||||
export { EndpointOptions, RequestInterface, OctokitResponse, RequestParameters, Route, } from "@octokit/types";
|
||||
export { PaginatingEndpoints } from "./generated/paginating-endpoints";
|
||||
import { PaginatingEndpoints } from "./generated/paginating-endpoints";
|
||||
type KnownKeys<T> = Extract<{
|
||||
[K in keyof T]: string extends K ? never : number extends K ? never : K;
|
||||
} extends {
|
||||
[_ in keyof T]: infer U;
|
||||
} ? U : never, keyof T>;
|
||||
type KeysMatching<T, V> = {
|
||||
[K in keyof T]: T[K] extends V ? K : never;
|
||||
}[keyof T];
|
||||
type KnownKeysMatching<T, V> = KeysMatching<Pick<T, KnownKeys<T>>, V>;
|
||||
type GetResultsType<T> = T extends {
|
||||
data: any[];
|
||||
} ? T["data"] : T extends {
|
||||
data: object;
|
||||
} ? T["data"][KnownKeysMatching<T["data"], any[]>] : never;
|
||||
type NormalizeResponse<T> = T & {
|
||||
data: GetResultsType<T>;
|
||||
};
|
||||
type DataType<T> = "data" extends keyof T ? T["data"] : unknown;
|
||||
export interface MapFunction<T = OctokitTypes.OctokitResponse<PaginationResults<unknown>>, M = unknown[]> {
|
||||
(response: T, done: () => void): M;
|
||||
}
|
||||
export type PaginationResults<T = unknown> = T[];
|
||||
export interface PaginateInterface {
|
||||
/**
|
||||
* Paginate a request using endpoint options and map each response to a custom array
|
||||
*
|
||||
* @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
* @param {function} mapFn Optional method to map each response to a custom array
|
||||
*/
|
||||
<T, M>(options: OctokitTypes.EndpointOptions, mapFn: MapFunction<OctokitTypes.OctokitResponse<PaginationResults<T>>, M[]>): Promise<PaginationResults<M>>;
|
||||
/**
|
||||
* Paginate a request using endpoint options
|
||||
*
|
||||
* @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<T>(options: OctokitTypes.EndpointOptions): Promise<PaginationResults<T>>;
|
||||
/**
|
||||
* Paginate a request using a known endpoint route string and map each response to a custom array
|
||||
*
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {function} mapFn Optional method to map each response to a custom array
|
||||
*/
|
||||
<R extends keyof PaginatingEndpoints, M extends unknown[]>(route: R, mapFn: MapFunction<PaginatingEndpoints[R]["response"], M>): Promise<M>;
|
||||
/**
|
||||
* Paginate a request using a known endpoint route string and parameters, and map each response to a custom array
|
||||
*
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
* @param {function} mapFn Optional method to map each response to a custom array
|
||||
*/
|
||||
<R extends keyof PaginatingEndpoints, M extends unknown[]>(route: R, parameters: PaginatingEndpoints[R]["parameters"], mapFn: MapFunction<PaginatingEndpoints[R]["response"], M>): Promise<M>;
|
||||
/**
|
||||
* Paginate a request using an known endpoint route string
|
||||
*
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<R extends keyof PaginatingEndpoints>(route: R, parameters?: PaginatingEndpoints[R]["parameters"]): Promise<DataType<PaginatingEndpoints[R]["response"]>>;
|
||||
/**
|
||||
* Paginate a request using an unknown endpoint route string
|
||||
*
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<T, R extends OctokitTypes.Route = OctokitTypes.Route>(route: R, parameters?: R extends keyof PaginatingEndpoints ? PaginatingEndpoints[R]["parameters"] : OctokitTypes.RequestParameters): Promise<T[]>;
|
||||
/**
|
||||
* Paginate a request using an endpoint method and a map function
|
||||
*
|
||||
* @param {string} request Request method (`octokit.request` or `@octokit/request`)
|
||||
* @param {function} mapFn? Optional method to map each response to a custom array
|
||||
*/
|
||||
<R extends OctokitTypes.RequestInterface, M extends unknown[]>(request: R, mapFn: MapFunction<NormalizeResponse<OctokitTypes.GetResponseTypeFromEndpointMethod<R>>, M>): Promise<M>;
|
||||
/**
|
||||
* Paginate a request using an endpoint method, parameters, and a map function
|
||||
*
|
||||
* @param {string} request Request method (`octokit.request` or `@octokit/request`)
|
||||
* @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
* @param {function} mapFn? Optional method to map each response to a custom array
|
||||
*/
|
||||
<R extends OctokitTypes.RequestInterface, M extends unknown[]>(request: R, parameters: Parameters<R>[0], mapFn: MapFunction<NormalizeResponse<OctokitTypes.GetResponseTypeFromEndpointMethod<R>>, M>): Promise<M>;
|
||||
/**
|
||||
* Paginate a request using an endpoint method and parameters
|
||||
*
|
||||
* @param {string} request Request method (`octokit.request` or `@octokit/request`)
|
||||
* @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<R extends OctokitTypes.RequestInterface>(request: R, parameters?: Parameters<R>[0]): Promise<NormalizeResponse<OctokitTypes.GetResponseTypeFromEndpointMethod<R>>["data"]>;
|
||||
iterator: {
|
||||
/**
|
||||
* Get an async iterator to paginate a request using endpoint options
|
||||
*
|
||||
* @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of
|
||||
* @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<T>(options: OctokitTypes.EndpointOptions): AsyncIterableIterator<OctokitTypes.OctokitResponse<PaginationResults<T>>>;
|
||||
/**
|
||||
* Get an async iterator to paginate a request using a known endpoint route string and optional parameters
|
||||
*
|
||||
* @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<R extends keyof PaginatingEndpoints>(route: R, parameters?: PaginatingEndpoints[R]["parameters"]): AsyncIterableIterator<OctokitTypes.OctokitResponse<DataType<PaginatingEndpoints[R]["response"]>>>;
|
||||
/**
|
||||
* Get an async iterator to paginate a request using an unknown endpoint route string and optional parameters
|
||||
*
|
||||
* @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<T, R extends OctokitTypes.Route = OctokitTypes.Route>(route: R, parameters?: R extends keyof PaginatingEndpoints ? PaginatingEndpoints[R]["parameters"] : OctokitTypes.RequestParameters): AsyncIterableIterator<OctokitTypes.OctokitResponse<PaginationResults<T>>>;
|
||||
/**
|
||||
* Get an async iterator to paginate a request using a request method and optional parameters
|
||||
*
|
||||
* @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of
|
||||
* @param {string} request `@octokit/request` or `octokit.request` method
|
||||
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<R extends OctokitTypes.RequestInterface>(request: R, parameters?: Parameters<R>[0]): AsyncIterableIterator<NormalizeResponse<OctokitTypes.GetResponseTypeFromEndpointMethod<R>>>;
|
||||
};
|
||||
}
|
||||
export interface ComposePaginateInterface {
|
||||
/**
|
||||
* Paginate a request using endpoint options and map each response to a custom array
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
* @param {function} mapFn Optional method to map each response to a custom array
|
||||
*/
|
||||
<T, M>(octokit: Octokit, options: OctokitTypes.EndpointOptions, mapFn: MapFunction<OctokitTypes.OctokitResponse<PaginationResults<T>>, M[]>): Promise<PaginationResults<M>>;
|
||||
/**
|
||||
* Paginate a request using endpoint options
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<T>(octokit: Octokit, options: OctokitTypes.EndpointOptions): Promise<PaginationResults<T>>;
|
||||
/**
|
||||
* Paginate a request using a known endpoint route string and map each response to a custom array
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {function} mapFn Optional method to map each response to a custom array
|
||||
*/
|
||||
<R extends keyof PaginatingEndpoints, M extends unknown[]>(octokit: Octokit, route: R, mapFn: MapFunction<PaginatingEndpoints[R]["response"], M>): Promise<M>;
|
||||
/**
|
||||
* Paginate a request using a known endpoint route string and parameters, and map each response to a custom array
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
* @param {function} mapFn Optional method to map each response to a custom array
|
||||
*/
|
||||
<R extends keyof PaginatingEndpoints, M extends unknown[]>(octokit: Octokit, route: R, parameters: PaginatingEndpoints[R]["parameters"], mapFn: MapFunction<PaginatingEndpoints[R]["response"], M>): Promise<M>;
|
||||
/**
|
||||
* Paginate a request using an known endpoint route string
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<R extends keyof PaginatingEndpoints>(octokit: Octokit, route: R, parameters?: PaginatingEndpoints[R]["parameters"]): Promise<DataType<PaginatingEndpoints[R]["response"]>>;
|
||||
/**
|
||||
* Paginate a request using an unknown endpoint route string
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<T, R extends OctokitTypes.Route = OctokitTypes.Route>(octokit: Octokit, route: R, parameters?: R extends keyof PaginatingEndpoints ? PaginatingEndpoints[R]["parameters"] : OctokitTypes.RequestParameters): Promise<T[]>;
|
||||
/**
|
||||
* Paginate a request using an endpoint method and a map function
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {string} request Request method (`octokit.request` or `@octokit/request`)
|
||||
* @param {function} mapFn? Optional method to map each response to a custom array
|
||||
*/
|
||||
<R extends OctokitTypes.RequestInterface, M extends unknown[]>(octokit: Octokit, request: R, mapFn: MapFunction<NormalizeResponse<OctokitTypes.GetResponseTypeFromEndpointMethod<R>>, M>): Promise<M>;
|
||||
/**
|
||||
* Paginate a request using an endpoint method, parameters, and a map function
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {string} request Request method (`octokit.request` or `@octokit/request`)
|
||||
* @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
* @param {function} mapFn? Optional method to map each response to a custom array
|
||||
*/
|
||||
<R extends OctokitTypes.RequestInterface, M extends unknown[]>(octokit: Octokit, request: R, parameters: Parameters<R>[0], mapFn: MapFunction<NormalizeResponse<OctokitTypes.GetResponseTypeFromEndpointMethod<R>>, M>): Promise<M>;
|
||||
/**
|
||||
* Paginate a request using an endpoint method and parameters
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {string} request Request method (`octokit.request` or `@octokit/request`)
|
||||
* @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<R extends OctokitTypes.RequestInterface>(octokit: Octokit, request: R, parameters?: Parameters<R>[0]): Promise<NormalizeResponse<OctokitTypes.GetResponseTypeFromEndpointMethod<R>>["data"]>;
|
||||
iterator: {
|
||||
/**
|
||||
* Get an async iterator to paginate a request using endpoint options
|
||||
*
|
||||
* @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<T>(octokit: Octokit, options: OctokitTypes.EndpointOptions): AsyncIterableIterator<OctokitTypes.OctokitResponse<PaginationResults<T>>>;
|
||||
/**
|
||||
* Get an async iterator to paginate a request using a known endpoint route string and optional parameters
|
||||
*
|
||||
* @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<R extends keyof PaginatingEndpoints>(octokit: Octokit, route: R, parameters?: PaginatingEndpoints[R]["parameters"]): AsyncIterableIterator<OctokitTypes.OctokitResponse<DataType<PaginatingEndpoints[R]["response"]>>>;
|
||||
/**
|
||||
* Get an async iterator to paginate a request using an unknown endpoint route string and optional parameters
|
||||
*
|
||||
* @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
|
||||
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<T, R extends OctokitTypes.Route = OctokitTypes.Route>(octokit: Octokit, route: R, parameters?: R extends keyof PaginatingEndpoints ? PaginatingEndpoints[R]["parameters"] : OctokitTypes.RequestParameters): AsyncIterableIterator<OctokitTypes.OctokitResponse<PaginationResults<T>>>;
|
||||
/**
|
||||
* Get an async iterator to paginate a request using a request method and optional parameters
|
||||
*
|
||||
* @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of
|
||||
*
|
||||
* @param {object} octokit Octokit instance
|
||||
* @param {string} request `@octokit/request` or `octokit.request` method
|
||||
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.format`, `request`, or `baseUrl`.
|
||||
*/
|
||||
<R extends OctokitTypes.RequestInterface>(octokit: Octokit, request: R, parameters?: Parameters<R>[0]): AsyncIterableIterator<NormalizeResponse<OctokitTypes.GetResponseTypeFromEndpointMethod<R>>>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
# responselike
|
||||
|
||||
> A response-like object for mocking a Node.js HTTP response stream
|
||||
|
||||
Returns a streamable response object similar to a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage). Useful for formatting cached responses so they can be consumed by code expecting a real response.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install responselike
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import Response from 'responselike';
|
||||
|
||||
const response = new Response({
|
||||
statusCode: 200,
|
||||
headers: {
|
||||
foo: 'bar'
|
||||
},
|
||||
body: Buffer.from('Hi!'),
|
||||
url: 'https://example.com'
|
||||
});
|
||||
|
||||
response.statusCode;
|
||||
// 200
|
||||
|
||||
response.headers;
|
||||
// {foo: 'bar'}
|
||||
|
||||
response.body;
|
||||
// <Buffer 48 69 21>
|
||||
|
||||
response.url;
|
||||
// 'https://example.com'
|
||||
|
||||
response.pipe(process.stdout);
|
||||
// 'Hi!'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### new Response(options?)
|
||||
|
||||
Returns a streamable response object similar to a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage).
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### statusCode
|
||||
|
||||
Type: `number`
|
||||
|
||||
The HTTP response status code.
|
||||
|
||||
##### headers
|
||||
|
||||
Type: `object`
|
||||
|
||||
The HTTP headers. Keys will be automatically lowercased.
|
||||
|
||||
##### body
|
||||
|
||||
Type: `Buffer`
|
||||
|
||||
The response body. The Buffer contents will be streamable but is also exposed directly as `response.body`.
|
||||
|
||||
##### url
|
||||
|
||||
Type: `string`
|
||||
|
||||
The request URL string.
|
||||
@@ -0,0 +1,29 @@
|
||||
var path = require('path');
|
||||
var test = require('tape');
|
||||
var resolve = require('../');
|
||||
|
||||
test('dotdot', function (t) {
|
||||
t.plan(4);
|
||||
var dir = path.join(__dirname, '/dotdot/abc');
|
||||
|
||||
resolve('..', { basedir: dir }, function (err, res, pkg) {
|
||||
t.ifError(err);
|
||||
t.equal(res, path.join(__dirname, 'dotdot/index.js'));
|
||||
});
|
||||
|
||||
resolve('.', { basedir: dir }, function (err, res, pkg) {
|
||||
t.ifError(err);
|
||||
t.equal(res, path.join(dir, 'index.js'));
|
||||
});
|
||||
});
|
||||
|
||||
test('dotdot sync', function (t) {
|
||||
t.plan(2);
|
||||
var dir = path.join(__dirname, '/dotdot/abc');
|
||||
|
||||
var a = resolve.sync('..', { basedir: dir });
|
||||
t.equal(a, path.join(__dirname, 'dotdot/index.js'));
|
||||
|
||||
var b = resolve.sync('.', { basedir: dir });
|
||||
t.equal(b, path.join(dir, 'index.js'));
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"race.js","sourceRoot":"","sources":["../../../../src/internal/operators/race.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAetC,MAAM,UAAU,IAAI,CAAI,GAAG,IAAW;IACpC,OAAO,QAAQ,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3C,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"asap.d.ts","sourceRoot":"","sources":["../../../../src/internal/scheduler/asap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,eAAO,MAAM,aAAa,eAAgC,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,IAAI,eAAgB,CAAC"}
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"name": "chalk",
|
||||
"version": "5.2.0",
|
||||
"description": "Terminal string styling done right",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/chalk",
|
||||
"funding": "https://github.com/chalk/chalk?sponsor=1",
|
||||
"type": "module",
|
||||
"main": "./source/index.js",
|
||||
"exports": "./source/index.js",
|
||||
"imports": {
|
||||
"#ansi-styles": "./source/vendor/ansi-styles/index.js",
|
||||
"#supports-color": {
|
||||
"node": "./source/vendor/supports-color/index.js",
|
||||
"default": "./source/vendor/supports-color/browser.js"
|
||||
}
|
||||
},
|
||||
"types": "./source/index.d.ts",
|
||||
"engines": {
|
||||
"node": "^12.17.0 || ^14.13 || >=16.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && c8 ava && tsd",
|
||||
"bench": "matcha benchmark.js"
|
||||
},
|
||||
"files": [
|
||||
"source",
|
||||
"!source/index.test-d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"ansi",
|
||||
"style",
|
||||
"styles",
|
||||
"tty",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.10",
|
||||
"ava": "^3.15.0",
|
||||
"c8": "^7.10.0",
|
||||
"color-convert": "^2.0.1",
|
||||
"execa": "^6.0.0",
|
||||
"log-update": "^5.0.0",
|
||||
"matcha": "^0.7.0",
|
||||
"tsd": "^0.19.0",
|
||||
"xo": "^0.53.0",
|
||||
"yoctodelay": "^2.0.0"
|
||||
},
|
||||
"xo": {
|
||||
"rules": {
|
||||
"unicorn/prefer-string-slice": "off",
|
||||
"@typescript-eslint/consistent-type-imports": "off",
|
||||
"@typescript-eslint/consistent-type-exports": "off",
|
||||
"@typescript-eslint/consistent-type-definitions": "off"
|
||||
}
|
||||
},
|
||||
"c8": {
|
||||
"reporter": [
|
||||
"text",
|
||||
"lcov"
|
||||
],
|
||||
"exclude": [
|
||||
"source/vendor"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export function removeUndefinedProperties(obj) {
|
||||
for (const key in obj) {
|
||||
if (obj[key] === undefined) {
|
||||
delete obj[key];
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
export type Permission = {
|
||||
id: number;
|
||||
target: Permission.target;
|
||||
action: Permission.action;
|
||||
};
|
||||
export declare namespace Permission {
|
||||
enum target {
|
||||
RUNNER = "RUNNER",
|
||||
ORGANIZATION = "ORGANIZATION",
|
||||
TEAM = "TEAM",
|
||||
TRACK = "TRACK",
|
||||
USER = "USER",
|
||||
USERGROUP = "USERGROUP",
|
||||
PERMISSION = "PERMISSION",
|
||||
STATSCLIENT = "STATSCLIENT",
|
||||
DONOR = "DONOR",
|
||||
SCAN = "SCAN",
|
||||
STATION = "STATION",
|
||||
CARD = "CARD",
|
||||
DONATION = "DONATION",
|
||||
CONTACT = "CONTACT",
|
||||
MAIL = "MAIL"
|
||||
}
|
||||
enum action {
|
||||
GET = "GET",
|
||||
CREATE = "CREATE",
|
||||
UPDATE = "UPDATE",
|
||||
DELETE = "DELETE",
|
||||
IMPORT = "IMPORT"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,580 @@
|
||||
var util = require("util");
|
||||
var Transform = require("stream").Transform;
|
||||
var os = require("os");
|
||||
var stripBom = require('strip-bom');
|
||||
var eol = os.EOL;
|
||||
// var Processor = require("./Processor.js");
|
||||
var defParam = require("./defParam");
|
||||
var fileline = require("./fileline");
|
||||
var fileLineToCSVLine = require("./fileLineToCSVLine");
|
||||
var linesToJson = require("./linesToJson");
|
||||
var CSVError = require("./CSVError");
|
||||
var workerMgr = null;
|
||||
var _ = require('lodash');
|
||||
var rowSplit = require("./rowSplit");
|
||||
function Converter(params, options) {
|
||||
Transform.call(this, options);
|
||||
this._options = options || {};
|
||||
this.param = defParam(params);
|
||||
this.param._options = this._options;
|
||||
// this.resultObject = new Result(this);
|
||||
// this.pipe(this.resultObject); // it is important to have downstream for a transform otherwise it will stuck
|
||||
this.started = false;//indicate if parsing has started.
|
||||
this.recordNum = 0;
|
||||
this.lineNumber = 0; //file line number
|
||||
this._csvLineBuffer = "";
|
||||
this.lastIndex = 0; // index in result json array
|
||||
//this._pipe(this.lineParser).pipe(this.processor);
|
||||
// this.initNoFork();
|
||||
if (this.param.forked) {
|
||||
this.param.forked = false;
|
||||
this.workerNum = 2;
|
||||
}
|
||||
this.flushCb = null;
|
||||
this.processEnd = false;
|
||||
this.sequenceBuffer = [];
|
||||
this._needJson = null;
|
||||
this._needEmitResult = null;
|
||||
this._needEmitFinalResult = null;
|
||||
this._needEmitHeader = null;
|
||||
this._needEmitJson = null;
|
||||
this._needPush = null;
|
||||
this._needEmitCsv = null;
|
||||
this._csvTransf = null;
|
||||
this.finalResult = [];
|
||||
// this.on("data", function() {});
|
||||
this.on("error", emitDone(this));
|
||||
this.on("end", emitDone(this));
|
||||
this.initWorker();
|
||||
process.nextTick(function () {
|
||||
if (this._needEmitFinalResult === null) {
|
||||
this._needEmitFinalResult = this.listeners("end_parsed").length > 0;
|
||||
}
|
||||
if (this._needEmitResult === null) {
|
||||
this._needEmitResult = this.listeners("record_parsed").length > 0;
|
||||
}
|
||||
if (this._needEmitJson === null) {
|
||||
this._needEmitJson = this.listeners("json").length > 0;
|
||||
}
|
||||
if (this._needEmitHeader === null) {
|
||||
this._needEmitHeader = this.listeners("header").length > 0;
|
||||
}
|
||||
if (this._needEmitCsv === null) {
|
||||
this._needEmitCsv = this.listeners("csv").length > 0;
|
||||
}
|
||||
if (this._needJson === null) {
|
||||
this._needJson = this._needEmitJson || this._needEmitFinalResult || this._needEmitResult || this.transform || this._options.objectMode;
|
||||
}
|
||||
if (this._needPush === null) {
|
||||
this._needPush = this.listeners("data").length > 0 || this.listeners("readable").length > 0;
|
||||
// this._needPush=false;
|
||||
}
|
||||
this.param._needParseJson = this._needJson || this._needPush;
|
||||
}.bind(this));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
util.inherits(Converter, Transform);
|
||||
function emitDone(conv) {
|
||||
return function (err) {
|
||||
if (!conv._hasDone) {
|
||||
conv._hasDone = true;
|
||||
process.nextTick(function () {
|
||||
conv.emit('done', err);
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function bufFromString(str) {
|
||||
var length=Buffer.byteLength(str);
|
||||
var buffer = Buffer.allocUnsafe
|
||||
? Buffer.allocUnsafe(length)
|
||||
: new Buffer(length);
|
||||
buffer.write(str);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
Converter.prototype._transform = function (data, encoding, cb) {
|
||||
data=this.prepareData(data);
|
||||
var idx =data.length-1;
|
||||
var left=null;
|
||||
/**
|
||||
* From Keyang:
|
||||
* The code below is to check if a single utf8 char (which could be multiple bytes) being split.
|
||||
* If the char being split, the buffer from two chunk needs to be concat
|
||||
* check how utf8 being encoded to understand the code below.
|
||||
* If anyone has any better way to do this, please let me know.
|
||||
*/
|
||||
if ((data[idx] & 1<<7) !=0){
|
||||
while ((data[idx] & 3<<6) === 128){
|
||||
idx--;
|
||||
}
|
||||
idx--;
|
||||
}
|
||||
if (idx !=data.length-1){
|
||||
left=data.slice(idx+1);
|
||||
data=data.slice(0,idx+1)
|
||||
var _cb=cb;
|
||||
var self=this;
|
||||
cb=function(){
|
||||
if (self._csvLineBuffer){
|
||||
self._csvLineBuffer=Buffer.concat([bufFromString(self._csvLineBuffer,"utf8"),left]);
|
||||
}else{
|
||||
self._csvLineBuffer=left;
|
||||
}
|
||||
_cb();
|
||||
}
|
||||
}
|
||||
data = data.toString("utf8");
|
||||
if (this.started === false) {
|
||||
this.started = true;
|
||||
data = stripBom(data);
|
||||
if (this.param.toArrayString) {
|
||||
if (this._needPush) {
|
||||
this.push("[" + eol, "utf8");
|
||||
}
|
||||
}
|
||||
}
|
||||
var self = this;
|
||||
this.preProcessRaw(data, function (d) {
|
||||
if (d && d.length > 0) {
|
||||
self.processData(d, cb);
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Converter.prototype.prepareData = function (data) {
|
||||
if (this._csvLineBuffer && this._csvLineBuffer.length>0){
|
||||
if (typeof this._csvLineBuffer === "string"){
|
||||
this._csvLineBuffer=bufFromString(this._csvLineBuffer);
|
||||
}
|
||||
return Buffer.concat([this._csvLineBuffer,data]);
|
||||
}else{
|
||||
return data;
|
||||
}
|
||||
// return this._csvLineBuffer + data;
|
||||
};
|
||||
|
||||
Converter.prototype.setPartialData = function (d) {
|
||||
this._csvLineBuffer = d;
|
||||
};
|
||||
|
||||
Converter.prototype.processData = function (data, cb) {
|
||||
var params = this.param;
|
||||
if (params.ignoreEmpty && !params._headers) {
|
||||
data = data.replace(/^\s+/, "");
|
||||
}
|
||||
var eol = this.param.eol;
|
||||
var fileLines = fileline(data, this.param);
|
||||
if (this.param.eol !== eol) {
|
||||
this.emit("eol", this.param.eol);
|
||||
}
|
||||
if (fileLines.lines.length > 0) {
|
||||
if (this.preProcessLine && typeof this.preProcessLine === "function") {
|
||||
fileLines.lines = this._preProcessLines(fileLines.lines, this.lastIndex);
|
||||
}
|
||||
if (!params._headers) { //header is not inited. init header
|
||||
this.processHead(fileLines, cb);
|
||||
} else {
|
||||
if (params.workerNum <= 1) {
|
||||
var lines = fileLineToCSVLine(fileLines, params);
|
||||
this.setPartialData(lines.partial);
|
||||
var jsonArr = linesToJson(lines.lines, params, this.recordNum);
|
||||
this.processResult(jsonArr);
|
||||
this.lastIndex += jsonArr.length;
|
||||
this.recordNum += jsonArr.length;
|
||||
cb();
|
||||
} else {
|
||||
this.workerProcess(fileLines, cb);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setPartialData(fileLines.partial);
|
||||
cb();
|
||||
}
|
||||
};
|
||||
|
||||
Converter.prototype._preProcessLines = function (lines, startIdx) {
|
||||
var rtn = [];
|
||||
for (var i = 0, len = lines.length; i < len; i++) {
|
||||
var result = this.preProcessLine(lines[i], startIdx + i + 1);
|
||||
if (typeof result === "string") {
|
||||
rtn.push(result);
|
||||
} else {
|
||||
rtn.push(lines[i]);
|
||||
this.emit("error", new Error("preProcessLine should return a string but got: " + JSON.stringify(result)));
|
||||
}
|
||||
}
|
||||
return rtn;
|
||||
};
|
||||
|
||||
Converter.prototype.initWorker = function () {
|
||||
var workerNum = this.param.workerNum - 1;
|
||||
if (workerNum > 0) {
|
||||
workerMgr = require("./workerMgr");
|
||||
this.workerMgr = workerMgr();
|
||||
this.workerMgr.initWorker(workerNum, this.param);
|
||||
}
|
||||
};
|
||||
|
||||
Converter.prototype.preRawData = function (func) {
|
||||
this.preProcessRaw = func;
|
||||
return this;
|
||||
};
|
||||
|
||||
Converter.prototype.preFileLine = function (func) {
|
||||
this.preProcessLine = func;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* workerpRocess does not support embeded multiple lines.
|
||||
*/
|
||||
Converter.prototype.workerProcess = function (fileLine, cb) {
|
||||
var self = this;
|
||||
var line = fileLine;
|
||||
var eol = this.getEol();
|
||||
this.setPartialData(line.partial);
|
||||
this.workerMgr.sendWorker(line.lines.join(eol) + eol, this.lastIndex, cb, function (results, lastIndex) {
|
||||
var buf;
|
||||
var cur = self.sequenceBuffer[0];
|
||||
if (cur.idx === lastIndex) {
|
||||
cur.result = results;
|
||||
var records = [];
|
||||
while (self.sequenceBuffer[0] && self.sequenceBuffer[0].result) {
|
||||
buf = self.sequenceBuffer.shift();
|
||||
records = records.concat(buf.result);
|
||||
}
|
||||
self.processResult(records);
|
||||
self.recordNum += records.length;
|
||||
} else {
|
||||
for (var i = 0, len = self.sequenceBuffer.length; i < len; i++) {
|
||||
buf = self.sequenceBuffer[i];
|
||||
if (buf.idx === lastIndex) {
|
||||
buf.result = results;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.sequenceBuffer.push({
|
||||
idx: this.lastIndex,
|
||||
result: null
|
||||
});
|
||||
this.lastIndex += line.lines.length;
|
||||
};
|
||||
|
||||
Converter.prototype.processHead = function (fileLine, cb) {
|
||||
var params = this.param;
|
||||
if (params._headers) {
|
||||
return cb();
|
||||
}
|
||||
//dirty hack
|
||||
params._needFilterRow = false;
|
||||
// if header is not inited. init header
|
||||
var lines = fileLine.lines;
|
||||
var left = "";
|
||||
var headerRow = [];
|
||||
if (!params.noheader) {
|
||||
while (lines.length) {
|
||||
var line = left + lines.shift();
|
||||
var delimiter = params.delimiter;
|
||||
var row = rowSplit(line, params);
|
||||
if (params.delimiter !== delimiter) {
|
||||
this.emit("delimiter", params.delimiter);
|
||||
}
|
||||
if (row.closed) {
|
||||
headerRow = row.cols;
|
||||
left = "";
|
||||
break;
|
||||
} else {
|
||||
left = line + this.getEol();
|
||||
}
|
||||
}
|
||||
}
|
||||
params._needFilterRow = true;
|
||||
if (!params.noheader && headerRow.length === 0) { //if one chunk of data does not complete header row.
|
||||
this.setPartialData(left);
|
||||
return cb();
|
||||
}
|
||||
if (params.noheader) {
|
||||
if (params.headers) {
|
||||
params._headers = params.headers;
|
||||
} else {
|
||||
params._headers = [];
|
||||
}
|
||||
} else {
|
||||
if (params.headers) {
|
||||
params._headers = params.headers;
|
||||
} else {
|
||||
params._headers = headerRow;
|
||||
}
|
||||
}
|
||||
configIgnoreIncludeColumns(params);
|
||||
params._headers = require("./filterRow")(params._headers, params);
|
||||
if (this._needEmitHeader && this.param._headers) {
|
||||
this.emit("header", this.param._headers);
|
||||
}
|
||||
var delimiter = params.delimiter;
|
||||
var lines = fileLineToCSVLine(fileLine, params);
|
||||
if (params.delimiter !== delimiter) {
|
||||
this.emit("delimiter", params.delimiter);
|
||||
}
|
||||
this.setPartialData(lines.partial);
|
||||
if (this.param.workerNum > 1) {
|
||||
this.workerMgr.setParams(params);
|
||||
}
|
||||
var res = linesToJson(lines.lines, params, 0);
|
||||
// Put the header with the first row
|
||||
// if(res.length > 0) res[0].header = params._headers;
|
||||
this.processResult(res);
|
||||
this.lastIndex += res.length;
|
||||
this.recordNum += res.length;
|
||||
|
||||
cb();
|
||||
};
|
||||
function configIgnoreIncludeColumns(params) {
|
||||
if (params._postIgnoreColumns) {
|
||||
for (var i = 0; i < params.ignoreColumns.length; i++) {
|
||||
var ignoreCol = params.ignoreColumns[i];
|
||||
if (typeof ignoreCol === "string") {
|
||||
var idx = params._headers.indexOf(ignoreCol);
|
||||
if (idx > -1) {
|
||||
params.ignoreColumns[i] = idx;
|
||||
} else {
|
||||
params.ignoreColumns[i] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
params.ignoreColumns.sort(function (a, b) { return b - a; });
|
||||
}
|
||||
if (params._postIncludeColumns) {
|
||||
for (var i = 0; i < params.includeColumns.length; i++) {
|
||||
var includeCol = params.includeColumns[i];
|
||||
if (typeof includeCol === "string") {
|
||||
var idx = params._headers.indexOf(includeCol);
|
||||
if (idx > -1) {
|
||||
params.includeColumns[i] = idx;
|
||||
} else {
|
||||
params.includeColumns[i] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
params.ignoreColumns = _.uniq(params.ignoreColumns);
|
||||
params.includeColumns = _.uniq(params.includeColumns);
|
||||
}
|
||||
|
||||
Converter.prototype.processResult = function (result) {
|
||||
for (var i = 0, len = result.length; i < len; i++) {
|
||||
var r = result[i];
|
||||
if (r.err) {
|
||||
this.emit("error", r.err);
|
||||
} else {
|
||||
this.emitResult(r);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Converter.prototype.emitResult = function (r) {
|
||||
var index = r.index;
|
||||
var header = this.param;
|
||||
var row = r.row;
|
||||
var result = r.json;
|
||||
var resultJson = null;
|
||||
var resultStr = null;
|
||||
if (typeof result === "string") {
|
||||
resultStr = result;
|
||||
} else {
|
||||
resultJson = result;
|
||||
}
|
||||
if (resultJson === null && this._needJson) {
|
||||
resultJson = JSON.parse(resultStr);
|
||||
if (typeof row === "string") {
|
||||
row = JSON.parse(row);
|
||||
}
|
||||
}
|
||||
if (this.transform && typeof this.transform === "function") {
|
||||
this.transform(resultJson, row, index);
|
||||
resultStr = null;
|
||||
}
|
||||
if (this._needEmitJson) {
|
||||
this.emit("json", resultJson, index);
|
||||
}
|
||||
if (this._needEmitCsv) {
|
||||
if (typeof row === "string") {
|
||||
row = JSON.parse(row);
|
||||
}
|
||||
this.emit("csv", row, index);
|
||||
}
|
||||
if (this.param.constructResult && this._needEmitFinalResult) {
|
||||
this.finalResult.push(resultJson);
|
||||
}
|
||||
if (this._needEmitResult) {
|
||||
this.emit("record_parsed", resultJson, row, index);
|
||||
}
|
||||
if (this.param.toArrayString && index > 0 && this._needPush) {
|
||||
this.push("," + eol);
|
||||
}
|
||||
if (this._options && this._options.objectMode) {
|
||||
this.push(resultJson);
|
||||
} else {
|
||||
if (this._needPush) {
|
||||
if (resultStr === null) {
|
||||
resultStr = JSON.stringify(resultJson);
|
||||
}
|
||||
this.push(!this.param.toArrayString ? resultStr + eol : resultStr, "utf8");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Converter.prototype.preProcessRaw = function (data, cb) {
|
||||
cb(data);
|
||||
};
|
||||
|
||||
// FIXME: lineNumber is not used.
|
||||
Converter.prototype.preProcessLine = function (line, lineNumber) {
|
||||
return line;
|
||||
};
|
||||
|
||||
Converter.prototype._flush = function (cb) {
|
||||
var self = this;
|
||||
this.flushCb = function () {
|
||||
self.emit("end_parsed", self.finalResult);
|
||||
if (self.workerMgr) {
|
||||
self.workerMgr.destroyWorker();
|
||||
}
|
||||
cb();
|
||||
if (!self._needPush) {
|
||||
self.emit("end");
|
||||
}
|
||||
};
|
||||
if (this._csvLineBuffer.length > 0) {
|
||||
var eol = this.getEol();
|
||||
if (this._csvLineBuffer[this._csvLineBuffer.length - 1] !== eol) {
|
||||
this._csvLineBuffer += eol;
|
||||
}
|
||||
this.processData(this._csvLineBuffer, function () {
|
||||
this.checkAndFlush();
|
||||
}.bind(this));
|
||||
} else {
|
||||
this.checkAndFlush();
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
||||
Converter.prototype.checkAndFlush = function () {
|
||||
if (this._csvLineBuffer.length !== 0) {
|
||||
this.emit("error", CSVError.unclosed_quote(this.recordNum, this._csvLineBuffer), this._csvLineBuffer);
|
||||
}
|
||||
if (this.param.toArrayString && this._needPush) {
|
||||
this.push(eol + "]", "utf8");
|
||||
}
|
||||
if (this.workerMgr && this.workerMgr.isRunning()) {
|
||||
this.workerMgr.drain = function () {
|
||||
this.flushCb();
|
||||
}.bind(this);
|
||||
} else {
|
||||
this.flushCb();
|
||||
}
|
||||
};
|
||||
|
||||
Converter.prototype.getEol = function (data) {
|
||||
if (!this.param.eol && data) {
|
||||
for (var i = 0, len = data.length; i < len; i++) {
|
||||
if (data[i] === "\r") {
|
||||
if (data[i + 1] === "\n") {
|
||||
this.param.eol = "\r\n";
|
||||
} else {
|
||||
this.param.eol = "\r";
|
||||
}
|
||||
return this.param.eol;
|
||||
} else if (data[i] === "\n") {
|
||||
this.param.eol = "\n";
|
||||
return this.param.eol;
|
||||
}
|
||||
}
|
||||
this.param.eol = eol;
|
||||
}
|
||||
|
||||
return this.param.eol || eol;
|
||||
};
|
||||
|
||||
Converter.prototype.fromFile = function (filePath, cb, options) {
|
||||
var fs = require('fs');
|
||||
var rs = null;
|
||||
if (typeof cb ==="object" && typeof options === "undefined"){
|
||||
options=cb;
|
||||
cb=null;
|
||||
}
|
||||
this.wrapCallback(cb, function () {
|
||||
if (rs && rs.destroy) {
|
||||
rs.destroy();
|
||||
}
|
||||
});
|
||||
fs.exists(filePath, function (exist) {
|
||||
if (exist) {
|
||||
rs = fs.createReadStream(filePath,options);
|
||||
rs.pipe(this);
|
||||
} else {
|
||||
this.emit('error', new Error("File does not exist. Check to make sure the file path to your csv is correct."));
|
||||
}
|
||||
}.bind(this));
|
||||
return this;
|
||||
};
|
||||
|
||||
Converter.prototype.fromStream = function (readStream, cb) {
|
||||
if (cb && typeof cb === "function") {
|
||||
this.wrapCallback(cb);
|
||||
}
|
||||
readStream.pipe(this);
|
||||
return this;
|
||||
};
|
||||
|
||||
Converter.prototype.transf = function (func) {
|
||||
this.transform = func;
|
||||
return this;
|
||||
};
|
||||
|
||||
Converter.prototype.fromString = function (csvString, cb) {
|
||||
if (typeof csvString !== "string") {
|
||||
if (cb && typeof cb ==="function"){
|
||||
return cb(new Error("Passed CSV Data is not a string."));
|
||||
}
|
||||
}
|
||||
if (cb && typeof cb === "function") {
|
||||
this.wrapCallback(cb, function () {
|
||||
});
|
||||
}
|
||||
process.nextTick(function () {
|
||||
this.end(csvString);
|
||||
}.bind(this));
|
||||
return this;
|
||||
};
|
||||
|
||||
Converter.prototype.wrapCallback = function (cb, clean) {
|
||||
if (clean === undefined) {
|
||||
clean = function () { };
|
||||
}
|
||||
if (cb && typeof cb === "function") {
|
||||
this.once("end_parsed", function (res) {
|
||||
if (!this.hasError) {
|
||||
cb(null, res);
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
this.once("error", function (err) {
|
||||
this.hasError = true;
|
||||
if (cb && typeof cb === "function") {
|
||||
cb(err);
|
||||
}
|
||||
clean();
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
module.exports = Converter;
|
||||
@@ -0,0 +1,74 @@
|
||||
<a href="https://marked.js.org">
|
||||
<img width="60px" height="60px" src="https://marked.js.org/img/logo-black.svg" align="right" />
|
||||
</a>
|
||||
|
||||
# Marked
|
||||
|
||||
[](https://www.npmjs.com/package/marked)
|
||||
[](https://cdn.jsdelivr.net/npm/marked/marked.min.js)
|
||||
[](https://packagephobia.now.sh/result?p=marked)
|
||||
[](https://www.npmjs.com/package/marked)
|
||||
[](https://github.com/markedjs/marked/actions)
|
||||
[](https://snyk.io/test/npm/marked)
|
||||
|
||||
- ⚡ built for speed
|
||||
- ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time
|
||||
- ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications
|
||||
- 🌐 works in a browser, on a server, or from a command line interface (CLI)
|
||||
|
||||
## Demo
|
||||
|
||||
Checkout the [demo page](https://marked.js.org/demo/) to see marked in action ⛹️
|
||||
|
||||
## Docs
|
||||
|
||||
Our [documentation pages](https://marked.js.org) are also rendered using marked 💯
|
||||
|
||||
Also read about:
|
||||
|
||||
* [Options](https://marked.js.org/#/USING_ADVANCED.md)
|
||||
* [Extensibility](https://marked.js.org/#/USING_PRO.md)
|
||||
|
||||
## Installation
|
||||
|
||||
**CLI:** `npm install -g marked`
|
||||
|
||||
**In-browser:** `npm install marked`
|
||||
|
||||
## Usage
|
||||
|
||||
### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/#/USING_ADVANCED.md#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the output HTML! 🚨
|
||||
|
||||
**CLI**
|
||||
|
||||
``` bash
|
||||
$ marked -o hello.html
|
||||
hello world
|
||||
^D
|
||||
$ cat hello.html
|
||||
<p>hello world</p>
|
||||
```
|
||||
|
||||
**Browser**
|
||||
|
||||
```html
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Marked in the browser</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content"></div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||
<script>
|
||||
document.getElementById('content').innerHTML =
|
||||
marked('# Marked in the browser\n\nRendered by **marked**.');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
|
||||
@@ -0,0 +1,76 @@
|
||||
# dir-glob [](https://travis-ci.org/kevva/dir-glob)
|
||||
|
||||
> Convert directories to glob compatible strings
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install dir-glob
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const dirGlob = require('dir-glob');
|
||||
|
||||
(async () => {
|
||||
console.log(await dirGlob(['index.js', 'test.js', 'fixtures']));
|
||||
//=> ['index.js', 'test.js', 'fixtures/**']
|
||||
|
||||
console.log(await dirGlob(['index.js', 'inner_folder'], {cwd: 'fixtures'}));
|
||||
//=> ['index.js', 'inner_folder/**']
|
||||
|
||||
console.log(await dirGlob(['lib/**', 'fixtures'], {
|
||||
files: ['test', 'unicorn']
|
||||
extensions: ['js']
|
||||
}));
|
||||
//=> ['lib/**', 'fixtures/**/test.js', 'fixtures/**/unicorn.js']
|
||||
|
||||
console.log(await dirGlob(['lib/**', 'fixtures'], {
|
||||
files: ['test', 'unicorn', '*.jsx'],
|
||||
extensions: ['js', 'png']
|
||||
}));
|
||||
//=> ['lib/**', 'fixtures/**/test.{js,png}', 'fixtures/**/unicorn.{js,png}', 'fixtures/**/*.jsx']
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### dirGlob(input, options?)
|
||||
|
||||
Returns a `Promise<string[]>` with globs.
|
||||
|
||||
### dirGlob.sync(input, options?)
|
||||
|
||||
Returns a `string[]` with globs.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string | string[]`
|
||||
|
||||
Paths.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### extensions
|
||||
|
||||
Type: `string[]`
|
||||
|
||||
Append extensions to the end of your globs.
|
||||
|
||||
##### files
|
||||
|
||||
Type: `string[]`
|
||||
|
||||
Only glob for certain files.
|
||||
|
||||
##### cwd
|
||||
|
||||
Type: `string[]`
|
||||
|
||||
Test in specific directory.
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "anymatch",
|
||||
"version": "3.1.3",
|
||||
"description": "Matches strings against configurable strings, globs, regular expressions, and/or functions",
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"dependencies": {
|
||||
"normalize-path": "^3.0.0",
|
||||
"picomatch": "^2.0.4"
|
||||
},
|
||||
"author": {
|
||||
"name": "Elan Shanker",
|
||||
"url": "https://github.com/es128"
|
||||
},
|
||||
"license": "ISC",
|
||||
"homepage": "https://github.com/micromatch/anymatch",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/micromatch/anymatch"
|
||||
},
|
||||
"keywords": [
|
||||
"match",
|
||||
"any",
|
||||
"string",
|
||||
"file",
|
||||
"fs",
|
||||
"list",
|
||||
"glob",
|
||||
"regex",
|
||||
"regexp",
|
||||
"regular",
|
||||
"expression",
|
||||
"function"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "nyc mocha",
|
||||
"mocha": "mocha"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "^6.1.3",
|
||||
"nyc": "^14.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user