new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
proxy-agent
|
||||
===========
|
||||
### Maps proxy protocols to `http.Agent` implementations
|
||||
[](https://travis-ci.org/TooTallNate/node-proxy-agent)
|
||||
|
||||
This module provides a function that returns proxying `http.Agent` instances to
|
||||
use based off of a given proxy URI. If no URI is provided, then
|
||||
[proxy-from-env](https://www.npmjs.com/package/proxy-from-env) is used to get the URI
|
||||
from `$HTTP_PROXY`, `$HTTPS_PROXY` and `$NO_PROXY` among others.
|
||||
|
||||
An LRU cache is used so that `http.Agent` instances are transparently re-used for
|
||||
subsequent HTTP requests to the same proxy server.
|
||||
|
||||
The currently implemented protocol mappings are listed in the table below:
|
||||
|
||||
|
||||
| Protocol | Proxy Agent for `http` requests | Proxy Agent for `https` requests | Example
|
||||
|:----------:|:-------------------------------:|:--------------------------------:|:--------:
|
||||
| `http` | [http-proxy-agent][] | [https-proxy-agent][] | `http://proxy-server-over-tcp.com:3128`
|
||||
| `https` | [http-proxy-agent][] | [https-proxy-agent][] | `https://proxy-server-over-tls.com:3129`
|
||||
| `socks(v5)`| [socks-proxy-agent][] | [socks-proxy-agent][] | `socks://username:password@some-socks-proxy.com:9050` (username & password are optional)
|
||||
| `socks5` | [socks-proxy-agent][] | [socks-proxy-agent][] | `socks5://username:password@some-socks-proxy.com:9050` (username & password are optional)
|
||||
| `socks4` | [socks-proxy-agent][] | [socks-proxy-agent][] | `socks4://some-socks-proxy.com:9050`
|
||||
| `pac` | [pac-proxy-agent][] | [pac-proxy-agent][] | `pac+http://www.example.com/proxy.pac`
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Install with `npm`:
|
||||
|
||||
``` bash
|
||||
$ npm install proxy-agent
|
||||
```
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
``` js
|
||||
var http = require('http');
|
||||
var ProxyAgent = require('proxy-agent');
|
||||
|
||||
// HTTP, HTTPS, or SOCKS proxy to use
|
||||
var proxyUri = process.env.http_proxy || 'http://168.63.43.102:3128';
|
||||
|
||||
var opts = {
|
||||
method: 'GET',
|
||||
host: 'jsonip.org',
|
||||
path: '/',
|
||||
// this is the important part!
|
||||
// If no proxyUri is specified, then https://www.npmjs.com/package/proxy-from-env
|
||||
// is used to get the proxyUri.
|
||||
agent: new ProxyAgent(proxyUri)
|
||||
};
|
||||
|
||||
// the rest works just like any other normal HTTP request
|
||||
http.get(opts, onresponse);
|
||||
|
||||
function onresponse (res) {
|
||||
console.log(res.statusCode, res.headers);
|
||||
res.pipe(process.stdout);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
### new ProxyAgent(Object|String opts|uri)
|
||||
|
||||
Returns an `http.Agent` instance based off of the given proxy `opts` or URI
|
||||
string. An LRU cache is used, so the same `http.Agent` instance will be
|
||||
returned if identical args are passed in.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
|
||||
|
||||
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.
|
||||
|
||||
|
||||
[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent
|
||||
[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
|
||||
[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
|
||||
[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent
|
||||
@@ -0,0 +1,6 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { isFunction } from './isFunction';
|
||||
export function isObservable(obj) {
|
||||
return !!obj && (obj instanceof Observable || (isFunction(obj.lift) && isFunction(obj.subscribe)));
|
||||
}
|
||||
//# sourceMappingURL=isObservable.js.map
|
||||
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.delay = void 0;
|
||||
var async_1 = require("../scheduler/async");
|
||||
var delayWhen_1 = require("./delayWhen");
|
||||
var timer_1 = require("../observable/timer");
|
||||
function delay(due, scheduler) {
|
||||
if (scheduler === void 0) { scheduler = async_1.asyncScheduler; }
|
||||
var duration = timer_1.timer(due, scheduler);
|
||||
return delayWhen_1.delayWhen(function () { return duration; });
|
||||
}
|
||||
exports.delay = delay;
|
||||
//# sourceMappingURL=delay.js.map
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Helper functions to schedule and unschedule microtasks.
|
||||
*/
|
||||
export declare const Immediate: {
|
||||
setImmediate(cb: () => void): number;
|
||||
clearImmediate(handle: number): void;
|
||||
};
|
||||
/**
|
||||
* Used for internal testing purposes only. Do not export from library.
|
||||
*/
|
||||
export declare const TestTools: {
|
||||
pending(): number;
|
||||
};
|
||||
//# sourceMappingURL=Immediate.d.ts.map
|
||||
@@ -0,0 +1,17 @@
|
||||
// Note: this is the semver.org version of the spec that it implements
|
||||
// Not necessarily the package version of this code.
|
||||
const SEMVER_SPEC_VERSION = '2.0.0'
|
||||
|
||||
const MAX_LENGTH = 256
|
||||
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
||||
/* istanbul ignore next */ 9007199254740991
|
||||
|
||||
// Max safe segment length for coercion.
|
||||
const MAX_SAFE_COMPONENT_LENGTH = 16
|
||||
|
||||
module.exports = {
|
||||
SEMVER_SPEC_VERSION,
|
||||
MAX_LENGTH,
|
||||
MAX_SAFE_INTEGER,
|
||||
MAX_SAFE_COMPONENT_LENGTH
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export { webSocket as webSocket } from '../internal/observable/dom/webSocket';
|
||||
export { WebSocketSubject } from '../internal/observable/dom/WebSocketSubject';
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1,305 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/src</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> csv2json/src
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.69% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>594/634</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">86.56% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>277/320</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">91% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>91/100</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">93.47% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>573/613</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 high'></div>
|
||||
<div class="pad1">
|
||||
<table class="coverage-summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr>
|
||||
<td class="file high" data-value="CSVError.ts"><a href="CSVError.ts.html">CSVError.ts</a></td>
|
||||
<td data-value="88.24" class="pic high"><div class="chart"><div class="cover-fill" style="width: 88%;"></div><div class="cover-empty" style="width:12%;"></div></div></td>
|
||||
<td data-value="88.24" class="pct high">88.24%</td>
|
||||
<td data-value="17" class="abs high">15/17</td>
|
||||
<td data-value="75" class="pct medium">75%</td>
|
||||
<td data-value="4" class="abs medium">3/4</td>
|
||||
<td data-value="66.67" class="pct medium">66.67%</td>
|
||||
<td data-value="6" class="abs medium">4/6</td>
|
||||
<td data-value="87.5" class="pct high">87.5%</td>
|
||||
<td data-value="16" class="abs high">14/16</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="Converter.ts"><a href="Converter.ts.html">Converter.ts</a></td>
|
||||
<td data-value="94" class="pic high"><div class="chart"><div class="cover-fill" style="width: 94%;"></div><div class="cover-empty" style="width:6%;"></div></div></td>
|
||||
<td data-value="94" class="pct high">94%</td>
|
||||
<td data-value="100" class="abs high">94/100</td>
|
||||
<td data-value="84.62" class="pct high">84.62%</td>
|
||||
<td data-value="26" class="abs high">22/26</td>
|
||||
<td data-value="96.43" class="pct high">96.43%</td>
|
||||
<td data-value="28" class="abs high">27/28</td>
|
||||
<td data-value="93.62" class="pct high">93.62%</td>
|
||||
<td data-value="94" class="abs high">88/94</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="Processor.ts"><a href="Processor.ts.html">Processor.ts</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="6" class="abs high">6/6</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="2" class="abs high">2/2</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="5" class="abs high">5/5</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="ProcessorLocal.test.ts"><a href="ProcessorLocal.test.ts.html">ProcessorLocal.test.ts</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="23" class="abs high">23/23</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="3" class="abs high">3/3</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="21" class="abs high">21/21</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="ProcessorLocal.ts"><a href="ProcessorLocal.ts.html">ProcessorLocal.ts</a></td>
|
||||
<td data-value="93.75" class="pic high"><div class="chart"><div class="cover-fill" style="width: 93%;"></div><div class="cover-empty" style="width:7%;"></div></div></td>
|
||||
<td data-value="93.75" class="pct high">93.75%</td>
|
||||
<td data-value="144" class="abs high">135/144</td>
|
||||
<td data-value="87.5" class="pct high">87.5%</td>
|
||||
<td data-value="88" class="abs high">77/88</td>
|
||||
<td data-value="94.12" class="pct high">94.12%</td>
|
||||
<td data-value="17" class="abs high">16/17</td>
|
||||
<td data-value="93.43" class="pct high">93.43%</td>
|
||||
<td data-value="137" class="abs high">128/137</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="Result.ts"><a href="Result.ts.html">Result.ts</a></td>
|
||||
<td data-value="87.32" class="pic high"><div class="chart"><div class="cover-fill" style="width: 87%;"></div><div class="cover-empty" style="width:13%;"></div></div></td>
|
||||
<td data-value="87.32" class="pct high">87.32%</td>
|
||||
<td data-value="71" class="abs high">62/71</td>
|
||||
<td data-value="79.25" class="pct medium">79.25%</td>
|
||||
<td data-value="53" class="abs medium">42/53</td>
|
||||
<td data-value="86.67" class="pct high">86.67%</td>
|
||||
<td data-value="15" class="abs high">13/15</td>
|
||||
<td data-value="86.96" class="pct high">86.96%</td>
|
||||
<td data-value="69" class="abs high">60/69</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file empty" data-value="Worker.ts"><a href="Worker.ts.html">Worker.ts</a></td>
|
||||
<td data-value="0" class="pic empty"><div class="chart"><div class="cover-fill" style="width: 0%;"></div><div class="cover-empty" style="width:100%;"></div></div></td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="0" class="abs empty">0/0</td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="0" class="abs empty">0/0</td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="1" class="abs empty">0/1</td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="0" class="abs empty">0/0</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="dataClean.ts"><a href="dataClean.ts.html">dataClean.ts</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="7" class="abs high">7/7</td>
|
||||
<td data-value="75" class="pct medium">75%</td>
|
||||
<td data-value="4" class="abs medium">3/4</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="1" class="abs high">1/1</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="7" class="abs high">7/7</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="fileline.test.ts"><a href="fileline.test.ts.html">fileline.test.ts</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="4" class="abs high">4/4</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="4" class="abs high">4/4</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="fileline.ts"><a href="fileline.ts.html">fileline.ts</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="2" class="abs high">2/2</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="2" class="abs high">2/2</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="2" class="abs high">2/2</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file empty" data-value="getEol.ts"><a href="getEol.ts.html">getEol.ts</a></td>
|
||||
<td data-value="0" class="pic empty"><div class="chart"><div class="cover-fill" style="width: 0%;"></div><div class="cover-empty" style="width:100%;"></div></div></td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="0" class="abs empty">0/0</td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="3" class="abs empty">3/3</td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="0" class="abs empty">0/0</td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="0" class="abs empty">0/0</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="index.ts"><a href="index.ts.html">index.ts</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="5" class="abs high">5/5</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="1" class="abs high">1/1</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="5" class="abs high">5/5</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="lineToJson.ts"><a href="lineToJson.ts.html">lineToJson.ts</a></td>
|
||||
<td data-value="91.92" class="pic high"><div class="chart"><div class="cover-fill" style="width: 91%;"></div><div class="cover-empty" style="width:9%;"></div></div></td>
|
||||
<td data-value="91.92" class="pct high">91.92%</td>
|
||||
<td data-value="99" class="abs high">91/99</td>
|
||||
<td data-value="86.75" class="pct high">86.75%</td>
|
||||
<td data-value="83" class="abs high">72/83</td>
|
||||
<td data-value="92.86" class="pct high">92.86%</td>
|
||||
<td data-value="14" class="abs high">13/14</td>
|
||||
<td data-value="91.92" class="pct high">91.92%</td>
|
||||
<td data-value="99" class="abs high">91/99</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="rowSplit.test.ts"><a href="rowSplit.test.ts.html">rowSplit.test.ts</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="31" class="abs high">31/31</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="31" class="abs high">31/31</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="rowSplit.ts"><a href="rowSplit.ts.html">rowSplit.ts</a></td>
|
||||
<td data-value="95.08" class="pic high"><div class="chart"><div class="cover-fill" style="width: 95%;"></div><div class="cover-empty" style="width:5%;"></div></div></td>
|
||||
<td data-value="95.08" class="pct high">95.08%</td>
|
||||
<td data-value="122" class="abs high">116/122</td>
|
||||
<td data-value="94.55" class="pct high">94.55%</td>
|
||||
<td data-value="55" class="abs high">52/55</td>
|
||||
<td data-value="91.67" class="pct high">91.67%</td>
|
||||
<td data-value="12" class="abs high">11/12</td>
|
||||
<td data-value="95.04" class="pct high">95.04%</td>
|
||||
<td data-value="121" class="abs high">115/121</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file empty" data-value="test.ts"><a href="test.ts.html">test.ts</a></td>
|
||||
<td data-value="0" class="pic empty"><div class="chart"><div class="cover-fill" style="width: 0%;"></div><div class="cover-empty" style="width:100%;"></div></div></td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="0" class="abs empty">0/0</td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="0" class="abs empty">0/0</td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="0" class="abs empty">0/0</td>
|
||||
<td data-value="0" class="pct empty">0%</td>
|
||||
<td data-value="0" class="abs empty">0/0</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file high" data-value="util.ts"><a href="util.ts.html">util.ts</a></td>
|
||||
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="3" class="abs high">3/3</td>
|
||||
<td data-value="50" class="pct medium">50%</td>
|
||||
<td data-value="2" class="abs medium">1/2</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="2" class="abs high">2/2</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><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:36:07 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,59 @@
|
||||
import { OperatorFunction } from '../types';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
|
||||
/**
|
||||
* Emits a given value if the source Observable completes without emitting any
|
||||
* `next` value, otherwise mirrors the source Observable.
|
||||
*
|
||||
* <span class="informal">If the source Observable turns out to be empty, then
|
||||
* this operator will emit a default value.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `defaultIfEmpty` emits the values emitted by the source Observable or a
|
||||
* specified default value if the source Observable is empty (completes without
|
||||
* having emitted any `next` value).
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* If no clicks happen in 5 seconds, then emit 'no clicks'
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, takeUntil, interval, defaultIfEmpty } from 'rxjs';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const clicksBeforeFive = clicks.pipe(takeUntil(interval(5000)));
|
||||
* const result = clicksBeforeFive.pipe(defaultIfEmpty('no clicks'));
|
||||
* result.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* @see {@link empty}
|
||||
* @see {@link last}
|
||||
*
|
||||
* @param defaultValue The default value used if the source
|
||||
* Observable is empty.
|
||||
* @return A function that returns an Observable that emits either the
|
||||
* specified `defaultValue` if the source Observable emits no items, or the
|
||||
* values emitted by the source Observable.
|
||||
*/
|
||||
export function defaultIfEmpty<T, R>(defaultValue: R): OperatorFunction<T, T | R> {
|
||||
return operate((source, subscriber) => {
|
||||
let hasValue = false;
|
||||
source.subscribe(
|
||||
createOperatorSubscriber(
|
||||
subscriber,
|
||||
(value) => {
|
||||
hasValue = true;
|
||||
subscriber.next(value);
|
||||
},
|
||||
() => {
|
||||
if (!hasValue) {
|
||||
subscriber.next(defaultValue!);
|
||||
}
|
||||
subscriber.complete();
|
||||
}
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,965 @@
|
||||
'use strict';
|
||||
|
||||
/*eslint-disable no-use-before-define*/
|
||||
|
||||
var common = require('./common');
|
||||
var YAMLException = require('./exception');
|
||||
var DEFAULT_SCHEMA = require('./schema/default');
|
||||
|
||||
var _toString = Object.prototype.toString;
|
||||
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
var CHAR_BOM = 0xFEFF;
|
||||
var CHAR_TAB = 0x09; /* Tab */
|
||||
var CHAR_LINE_FEED = 0x0A; /* LF */
|
||||
var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
|
||||
var CHAR_SPACE = 0x20; /* Space */
|
||||
var CHAR_EXCLAMATION = 0x21; /* ! */
|
||||
var CHAR_DOUBLE_QUOTE = 0x22; /* " */
|
||||
var CHAR_SHARP = 0x23; /* # */
|
||||
var CHAR_PERCENT = 0x25; /* % */
|
||||
var CHAR_AMPERSAND = 0x26; /* & */
|
||||
var CHAR_SINGLE_QUOTE = 0x27; /* ' */
|
||||
var CHAR_ASTERISK = 0x2A; /* * */
|
||||
var CHAR_COMMA = 0x2C; /* , */
|
||||
var CHAR_MINUS = 0x2D; /* - */
|
||||
var CHAR_COLON = 0x3A; /* : */
|
||||
var CHAR_EQUALS = 0x3D; /* = */
|
||||
var CHAR_GREATER_THAN = 0x3E; /* > */
|
||||
var CHAR_QUESTION = 0x3F; /* ? */
|
||||
var CHAR_COMMERCIAL_AT = 0x40; /* @ */
|
||||
var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
|
||||
var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
|
||||
var CHAR_GRAVE_ACCENT = 0x60; /* ` */
|
||||
var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
|
||||
var CHAR_VERTICAL_LINE = 0x7C; /* | */
|
||||
var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
|
||||
|
||||
var ESCAPE_SEQUENCES = {};
|
||||
|
||||
ESCAPE_SEQUENCES[0x00] = '\\0';
|
||||
ESCAPE_SEQUENCES[0x07] = '\\a';
|
||||
ESCAPE_SEQUENCES[0x08] = '\\b';
|
||||
ESCAPE_SEQUENCES[0x09] = '\\t';
|
||||
ESCAPE_SEQUENCES[0x0A] = '\\n';
|
||||
ESCAPE_SEQUENCES[0x0B] = '\\v';
|
||||
ESCAPE_SEQUENCES[0x0C] = '\\f';
|
||||
ESCAPE_SEQUENCES[0x0D] = '\\r';
|
||||
ESCAPE_SEQUENCES[0x1B] = '\\e';
|
||||
ESCAPE_SEQUENCES[0x22] = '\\"';
|
||||
ESCAPE_SEQUENCES[0x5C] = '\\\\';
|
||||
ESCAPE_SEQUENCES[0x85] = '\\N';
|
||||
ESCAPE_SEQUENCES[0xA0] = '\\_';
|
||||
ESCAPE_SEQUENCES[0x2028] = '\\L';
|
||||
ESCAPE_SEQUENCES[0x2029] = '\\P';
|
||||
|
||||
var DEPRECATED_BOOLEANS_SYNTAX = [
|
||||
'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
|
||||
'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
|
||||
];
|
||||
|
||||
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
||||
|
||||
function compileStyleMap(schema, map) {
|
||||
var result, keys, index, length, tag, style, type;
|
||||
|
||||
if (map === null) return {};
|
||||
|
||||
result = {};
|
||||
keys = Object.keys(map);
|
||||
|
||||
for (index = 0, length = keys.length; index < length; index += 1) {
|
||||
tag = keys[index];
|
||||
style = String(map[tag]);
|
||||
|
||||
if (tag.slice(0, 2) === '!!') {
|
||||
tag = 'tag:yaml.org,2002:' + tag.slice(2);
|
||||
}
|
||||
type = schema.compiledTypeMap['fallback'][tag];
|
||||
|
||||
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
||||
style = type.styleAliases[style];
|
||||
}
|
||||
|
||||
result[tag] = style;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function encodeHex(character) {
|
||||
var string, handle, length;
|
||||
|
||||
string = character.toString(16).toUpperCase();
|
||||
|
||||
if (character <= 0xFF) {
|
||||
handle = 'x';
|
||||
length = 2;
|
||||
} else if (character <= 0xFFFF) {
|
||||
handle = 'u';
|
||||
length = 4;
|
||||
} else if (character <= 0xFFFFFFFF) {
|
||||
handle = 'U';
|
||||
length = 8;
|
||||
} else {
|
||||
throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
|
||||
}
|
||||
|
||||
return '\\' + handle + common.repeat('0', length - string.length) + string;
|
||||
}
|
||||
|
||||
|
||||
var QUOTING_TYPE_SINGLE = 1,
|
||||
QUOTING_TYPE_DOUBLE = 2;
|
||||
|
||||
function State(options) {
|
||||
this.schema = options['schema'] || DEFAULT_SCHEMA;
|
||||
this.indent = Math.max(1, (options['indent'] || 2));
|
||||
this.noArrayIndent = options['noArrayIndent'] || false;
|
||||
this.skipInvalid = options['skipInvalid'] || false;
|
||||
this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
|
||||
this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
|
||||
this.sortKeys = options['sortKeys'] || false;
|
||||
this.lineWidth = options['lineWidth'] || 80;
|
||||
this.noRefs = options['noRefs'] || false;
|
||||
this.noCompatMode = options['noCompatMode'] || false;
|
||||
this.condenseFlow = options['condenseFlow'] || false;
|
||||
this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
|
||||
this.forceQuotes = options['forceQuotes'] || false;
|
||||
this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;
|
||||
|
||||
this.implicitTypes = this.schema.compiledImplicit;
|
||||
this.explicitTypes = this.schema.compiledExplicit;
|
||||
|
||||
this.tag = null;
|
||||
this.result = '';
|
||||
|
||||
this.duplicates = [];
|
||||
this.usedDuplicates = null;
|
||||
}
|
||||
|
||||
// Indents every line in a string. Empty lines (\n only) are not indented.
|
||||
function indentString(string, spaces) {
|
||||
var ind = common.repeat(' ', spaces),
|
||||
position = 0,
|
||||
next = -1,
|
||||
result = '',
|
||||
line,
|
||||
length = string.length;
|
||||
|
||||
while (position < length) {
|
||||
next = string.indexOf('\n', position);
|
||||
if (next === -1) {
|
||||
line = string.slice(position);
|
||||
position = length;
|
||||
} else {
|
||||
line = string.slice(position, next + 1);
|
||||
position = next + 1;
|
||||
}
|
||||
|
||||
if (line.length && line !== '\n') result += ind;
|
||||
|
||||
result += line;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function generateNextLine(state, level) {
|
||||
return '\n' + common.repeat(' ', state.indent * level);
|
||||
}
|
||||
|
||||
function testImplicitResolving(state, str) {
|
||||
var index, length, type;
|
||||
|
||||
for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
|
||||
type = state.implicitTypes[index];
|
||||
|
||||
if (type.resolve(str)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// [33] s-white ::= s-space | s-tab
|
||||
function isWhitespace(c) {
|
||||
return c === CHAR_SPACE || c === CHAR_TAB;
|
||||
}
|
||||
|
||||
// Returns true if the character can be printed without escaping.
|
||||
// From YAML 1.2: "any allowed characters known to be non-printable
|
||||
// should also be escaped. [However,] This isn’t mandatory"
|
||||
// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
|
||||
function isPrintable(c) {
|
||||
return (0x00020 <= c && c <= 0x00007E)
|
||||
|| ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
|
||||
|| ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)
|
||||
|| (0x10000 <= c && c <= 0x10FFFF);
|
||||
}
|
||||
|
||||
// [34] ns-char ::= nb-char - s-white
|
||||
// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
|
||||
// [26] b-char ::= b-line-feed | b-carriage-return
|
||||
// Including s-white (for some reason, examples doesn't match specs in this aspect)
|
||||
// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark
|
||||
function isNsCharOrWhitespace(c) {
|
||||
return isPrintable(c)
|
||||
&& c !== CHAR_BOM
|
||||
// - b-char
|
||||
&& c !== CHAR_CARRIAGE_RETURN
|
||||
&& c !== CHAR_LINE_FEED;
|
||||
}
|
||||
|
||||
// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out
|
||||
// c = flow-in ⇒ ns-plain-safe-in
|
||||
// c = block-key ⇒ ns-plain-safe-out
|
||||
// c = flow-key ⇒ ns-plain-safe-in
|
||||
// [128] ns-plain-safe-out ::= ns-char
|
||||
// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator
|
||||
// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )
|
||||
// | ( /* An ns-char preceding */ “#” )
|
||||
// | ( “:” /* Followed by an ns-plain-safe(c) */ )
|
||||
function isPlainSafe(c, prev, inblock) {
|
||||
var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
|
||||
var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
|
||||
return (
|
||||
// ns-plain-safe
|
||||
inblock ? // c = flow-in
|
||||
cIsNsCharOrWhitespace
|
||||
: cIsNsCharOrWhitespace
|
||||
// - c-flow-indicator
|
||||
&& c !== CHAR_COMMA
|
||||
&& c !== CHAR_LEFT_SQUARE_BRACKET
|
||||
&& c !== CHAR_RIGHT_SQUARE_BRACKET
|
||||
&& c !== CHAR_LEFT_CURLY_BRACKET
|
||||
&& c !== CHAR_RIGHT_CURLY_BRACKET
|
||||
)
|
||||
// ns-plain-char
|
||||
&& c !== CHAR_SHARP // false on '#'
|
||||
&& !(prev === CHAR_COLON && !cIsNsChar) // false on ': '
|
||||
|| (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'
|
||||
|| (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'
|
||||
}
|
||||
|
||||
// Simplified test for values allowed as the first character in plain style.
|
||||
function isPlainSafeFirst(c) {
|
||||
// Uses a subset of ns-char - c-indicator
|
||||
// where ns-char = nb-char - s-white.
|
||||
// No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part
|
||||
return isPrintable(c) && c !== CHAR_BOM
|
||||
&& !isWhitespace(c) // - s-white
|
||||
// - (c-indicator ::=
|
||||
// “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
|
||||
&& c !== CHAR_MINUS
|
||||
&& c !== CHAR_QUESTION
|
||||
&& c !== CHAR_COLON
|
||||
&& c !== CHAR_COMMA
|
||||
&& c !== CHAR_LEFT_SQUARE_BRACKET
|
||||
&& c !== CHAR_RIGHT_SQUARE_BRACKET
|
||||
&& c !== CHAR_LEFT_CURLY_BRACKET
|
||||
&& c !== CHAR_RIGHT_CURLY_BRACKET
|
||||
// | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"”
|
||||
&& c !== CHAR_SHARP
|
||||
&& c !== CHAR_AMPERSAND
|
||||
&& c !== CHAR_ASTERISK
|
||||
&& c !== CHAR_EXCLAMATION
|
||||
&& c !== CHAR_VERTICAL_LINE
|
||||
&& c !== CHAR_EQUALS
|
||||
&& c !== CHAR_GREATER_THAN
|
||||
&& c !== CHAR_SINGLE_QUOTE
|
||||
&& c !== CHAR_DOUBLE_QUOTE
|
||||
// | “%” | “@” | “`”)
|
||||
&& c !== CHAR_PERCENT
|
||||
&& c !== CHAR_COMMERCIAL_AT
|
||||
&& c !== CHAR_GRAVE_ACCENT;
|
||||
}
|
||||
|
||||
// Simplified test for values allowed as the last character in plain style.
|
||||
function isPlainSafeLast(c) {
|
||||
// just not whitespace or colon, it will be checked to be plain character later
|
||||
return !isWhitespace(c) && c !== CHAR_COLON;
|
||||
}
|
||||
|
||||
// Same as 'string'.codePointAt(pos), but works in older browsers.
|
||||
function codePointAt(string, pos) {
|
||||
var first = string.charCodeAt(pos), second;
|
||||
if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
|
||||
second = string.charCodeAt(pos + 1);
|
||||
if (second >= 0xDC00 && second <= 0xDFFF) {
|
||||
// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
||||
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
|
||||
}
|
||||
}
|
||||
return first;
|
||||
}
|
||||
|
||||
// Determines whether block indentation indicator is required.
|
||||
function needIndentIndicator(string) {
|
||||
var leadingSpaceRe = /^\n* /;
|
||||
return leadingSpaceRe.test(string);
|
||||
}
|
||||
|
||||
var STYLE_PLAIN = 1,
|
||||
STYLE_SINGLE = 2,
|
||||
STYLE_LITERAL = 3,
|
||||
STYLE_FOLDED = 4,
|
||||
STYLE_DOUBLE = 5;
|
||||
|
||||
// Determines which scalar styles are possible and returns the preferred style.
|
||||
// lineWidth = -1 => no limit.
|
||||
// Pre-conditions: str.length > 0.
|
||||
// Post-conditions:
|
||||
// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
|
||||
// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
|
||||
// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
|
||||
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
|
||||
testAmbiguousType, quotingType, forceQuotes, inblock) {
|
||||
|
||||
var i;
|
||||
var char = 0;
|
||||
var prevChar = null;
|
||||
var hasLineBreak = false;
|
||||
var hasFoldableLine = false; // only checked if shouldTrackWidth
|
||||
var shouldTrackWidth = lineWidth !== -1;
|
||||
var previousLineBreak = -1; // count the first line correctly
|
||||
var plain = isPlainSafeFirst(codePointAt(string, 0))
|
||||
&& isPlainSafeLast(codePointAt(string, string.length - 1));
|
||||
|
||||
if (singleLineOnly || forceQuotes) {
|
||||
// Case: no block styles.
|
||||
// Check for disallowed characters to rule out plain and single.
|
||||
for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
|
||||
char = codePointAt(string, i);
|
||||
if (!isPrintable(char)) {
|
||||
return STYLE_DOUBLE;
|
||||
}
|
||||
plain = plain && isPlainSafe(char, prevChar, inblock);
|
||||
prevChar = char;
|
||||
}
|
||||
} else {
|
||||
// Case: block styles permitted.
|
||||
for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
|
||||
char = codePointAt(string, i);
|
||||
if (char === CHAR_LINE_FEED) {
|
||||
hasLineBreak = true;
|
||||
// Check if any line can be folded.
|
||||
if (shouldTrackWidth) {
|
||||
hasFoldableLine = hasFoldableLine ||
|
||||
// Foldable line = too long, and not more-indented.
|
||||
(i - previousLineBreak - 1 > lineWidth &&
|
||||
string[previousLineBreak + 1] !== ' ');
|
||||
previousLineBreak = i;
|
||||
}
|
||||
} else if (!isPrintable(char)) {
|
||||
return STYLE_DOUBLE;
|
||||
}
|
||||
plain = plain && isPlainSafe(char, prevChar, inblock);
|
||||
prevChar = char;
|
||||
}
|
||||
// in case the end is missing a \n
|
||||
hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
|
||||
(i - previousLineBreak - 1 > lineWidth &&
|
||||
string[previousLineBreak + 1] !== ' '));
|
||||
}
|
||||
// Although every style can represent \n without escaping, prefer block styles
|
||||
// for multiline, since they're more readable and they don't add empty lines.
|
||||
// Also prefer folding a super-long line.
|
||||
if (!hasLineBreak && !hasFoldableLine) {
|
||||
// Strings interpretable as another type have to be quoted;
|
||||
// e.g. the string 'true' vs. the boolean true.
|
||||
if (plain && !forceQuotes && !testAmbiguousType(string)) {
|
||||
return STYLE_PLAIN;
|
||||
}
|
||||
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
||||
}
|
||||
// Edge case: block indentation indicator can only have one digit.
|
||||
if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
||||
return STYLE_DOUBLE;
|
||||
}
|
||||
// At this point we know block styles are valid.
|
||||
// Prefer literal style unless we want to fold.
|
||||
if (!forceQuotes) {
|
||||
return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
||||
}
|
||||
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
||||
}
|
||||
|
||||
// Note: line breaking/folding is implemented for only the folded style.
|
||||
// NB. We drop the last trailing newline (if any) of a returned block scalar
|
||||
// since the dumper adds its own newline. This always works:
|
||||
// • No ending newline => unaffected; already using strip "-" chomping.
|
||||
// • Ending newline => removed then restored.
|
||||
// Importantly, this keeps the "+" chomp indicator from gaining an extra line.
|
||||
function writeScalar(state, string, level, iskey, inblock) {
|
||||
state.dump = (function () {
|
||||
if (string.length === 0) {
|
||||
return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
|
||||
}
|
||||
if (!state.noCompatMode) {
|
||||
if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
|
||||
return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'");
|
||||
}
|
||||
}
|
||||
|
||||
var indent = state.indent * Math.max(1, level); // no 0-indent scalars
|
||||
// As indentation gets deeper, let the width decrease monotonically
|
||||
// to the lower bound min(state.lineWidth, 40).
|
||||
// Note that this implies
|
||||
// state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
|
||||
// state.lineWidth > 40 + state.indent: width decreases until the lower bound.
|
||||
// This behaves better than a constant minimum width which disallows narrower options,
|
||||
// or an indent threshold which causes the width to suddenly increase.
|
||||
var lineWidth = state.lineWidth === -1
|
||||
? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
||||
|
||||
// Without knowing if keys are implicit/explicit, assume implicit for safety.
|
||||
var singleLineOnly = iskey
|
||||
// No block styles in flow mode.
|
||||
|| (state.flowLevel > -1 && level >= state.flowLevel);
|
||||
function testAmbiguity(string) {
|
||||
return testImplicitResolving(state, string);
|
||||
}
|
||||
|
||||
switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,
|
||||
testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
|
||||
|
||||
case STYLE_PLAIN:
|
||||
return string;
|
||||
case STYLE_SINGLE:
|
||||
return "'" + string.replace(/'/g, "''") + "'";
|
||||
case STYLE_LITERAL:
|
||||
return '|' + blockHeader(string, state.indent)
|
||||
+ dropEndingNewline(indentString(string, indent));
|
||||
case STYLE_FOLDED:
|
||||
return '>' + blockHeader(string, state.indent)
|
||||
+ dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
||||
case STYLE_DOUBLE:
|
||||
return '"' + escapeString(string, lineWidth) + '"';
|
||||
default:
|
||||
throw new YAMLException('impossible error: invalid scalar style');
|
||||
}
|
||||
}());
|
||||
}
|
||||
|
||||
// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
|
||||
function blockHeader(string, indentPerLevel) {
|
||||
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
|
||||
|
||||
// note the special case: the string '\n' counts as a "trailing" empty line.
|
||||
var clip = string[string.length - 1] === '\n';
|
||||
var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
|
||||
var chomp = keep ? '+' : (clip ? '' : '-');
|
||||
|
||||
return indentIndicator + chomp + '\n';
|
||||
}
|
||||
|
||||
// (See the note for writeScalar.)
|
||||
function dropEndingNewline(string) {
|
||||
return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
|
||||
}
|
||||
|
||||
// Note: a long line without a suitable break point will exceed the width limit.
|
||||
// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
|
||||
function foldString(string, width) {
|
||||
// In folded style, $k$ consecutive newlines output as $k+1$ newlines—
|
||||
// unless they're before or after a more-indented line, or at the very
|
||||
// beginning or end, in which case $k$ maps to $k$.
|
||||
// Therefore, parse each chunk as newline(s) followed by a content line.
|
||||
var lineRe = /(\n+)([^\n]*)/g;
|
||||
|
||||
// first line (possibly an empty line)
|
||||
var result = (function () {
|
||||
var nextLF = string.indexOf('\n');
|
||||
nextLF = nextLF !== -1 ? nextLF : string.length;
|
||||
lineRe.lastIndex = nextLF;
|
||||
return foldLine(string.slice(0, nextLF), width);
|
||||
}());
|
||||
// If we haven't reached the first content line yet, don't add an extra \n.
|
||||
var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
|
||||
var moreIndented;
|
||||
|
||||
// rest of the lines
|
||||
var match;
|
||||
while ((match = lineRe.exec(string))) {
|
||||
var prefix = match[1], line = match[2];
|
||||
moreIndented = (line[0] === ' ');
|
||||
result += prefix
|
||||
+ (!prevMoreIndented && !moreIndented && line !== ''
|
||||
? '\n' : '')
|
||||
+ foldLine(line, width);
|
||||
prevMoreIndented = moreIndented;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Greedy line breaking.
|
||||
// Picks the longest line under the limit each time,
|
||||
// otherwise settles for the shortest line over the limit.
|
||||
// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
|
||||
function foldLine(line, width) {
|
||||
if (line === '' || line[0] === ' ') return line;
|
||||
|
||||
// Since a more-indented line adds a \n, breaks can't be followed by a space.
|
||||
var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
|
||||
var match;
|
||||
// start is an inclusive index. end, curr, and next are exclusive.
|
||||
var start = 0, end, curr = 0, next = 0;
|
||||
var result = '';
|
||||
|
||||
// Invariants: 0 <= start <= length-1.
|
||||
// 0 <= curr <= next <= max(0, length-2). curr - start <= width.
|
||||
// Inside the loop:
|
||||
// A match implies length >= 2, so curr and next are <= length-2.
|
||||
while ((match = breakRe.exec(line))) {
|
||||
next = match.index;
|
||||
// maintain invariant: curr - start <= width
|
||||
if (next - start > width) {
|
||||
end = (curr > start) ? curr : next; // derive end <= length-2
|
||||
result += '\n' + line.slice(start, end);
|
||||
// skip the space that was output as \n
|
||||
start = end + 1; // derive start <= length-1
|
||||
}
|
||||
curr = next;
|
||||
}
|
||||
|
||||
// By the invariants, start <= length-1, so there is something left over.
|
||||
// It is either the whole string or a part starting from non-whitespace.
|
||||
result += '\n';
|
||||
// Insert a break if the remainder is too long and there is a break available.
|
||||
if (line.length - start > width && curr > start) {
|
||||
result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
|
||||
} else {
|
||||
result += line.slice(start);
|
||||
}
|
||||
|
||||
return result.slice(1); // drop extra \n joiner
|
||||
}
|
||||
|
||||
// Escapes a double-quoted string.
|
||||
function escapeString(string) {
|
||||
var result = '';
|
||||
var char = 0;
|
||||
var escapeSeq;
|
||||
|
||||
for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
|
||||
char = codePointAt(string, i);
|
||||
escapeSeq = ESCAPE_SEQUENCES[char];
|
||||
|
||||
if (!escapeSeq && isPrintable(char)) {
|
||||
result += string[i];
|
||||
if (char >= 0x10000) result += string[i + 1];
|
||||
} else {
|
||||
result += escapeSeq || encodeHex(char);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function writeFlowSequence(state, level, object) {
|
||||
var _result = '',
|
||||
_tag = state.tag,
|
||||
index,
|
||||
length,
|
||||
value;
|
||||
|
||||
for (index = 0, length = object.length; index < length; index += 1) {
|
||||
value = object[index];
|
||||
|
||||
if (state.replacer) {
|
||||
value = state.replacer.call(object, String(index), value);
|
||||
}
|
||||
|
||||
// Write only valid elements, put null instead of invalid elements.
|
||||
if (writeNode(state, level, value, false, false) ||
|
||||
(typeof value === 'undefined' &&
|
||||
writeNode(state, level, null, false, false))) {
|
||||
|
||||
if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');
|
||||
_result += state.dump;
|
||||
}
|
||||
}
|
||||
|
||||
state.tag = _tag;
|
||||
state.dump = '[' + _result + ']';
|
||||
}
|
||||
|
||||
function writeBlockSequence(state, level, object, compact) {
|
||||
var _result = '',
|
||||
_tag = state.tag,
|
||||
index,
|
||||
length,
|
||||
value;
|
||||
|
||||
for (index = 0, length = object.length; index < length; index += 1) {
|
||||
value = object[index];
|
||||
|
||||
if (state.replacer) {
|
||||
value = state.replacer.call(object, String(index), value);
|
||||
}
|
||||
|
||||
// Write only valid elements, put null instead of invalid elements.
|
||||
if (writeNode(state, level + 1, value, true, true, false, true) ||
|
||||
(typeof value === 'undefined' &&
|
||||
writeNode(state, level + 1, null, true, true, false, true))) {
|
||||
|
||||
if (!compact || _result !== '') {
|
||||
_result += generateNextLine(state, level);
|
||||
}
|
||||
|
||||
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
||||
_result += '-';
|
||||
} else {
|
||||
_result += '- ';
|
||||
}
|
||||
|
||||
_result += state.dump;
|
||||
}
|
||||
}
|
||||
|
||||
state.tag = _tag;
|
||||
state.dump = _result || '[]'; // Empty sequence if no valid values.
|
||||
}
|
||||
|
||||
function writeFlowMapping(state, level, object) {
|
||||
var _result = '',
|
||||
_tag = state.tag,
|
||||
objectKeyList = Object.keys(object),
|
||||
index,
|
||||
length,
|
||||
objectKey,
|
||||
objectValue,
|
||||
pairBuffer;
|
||||
|
||||
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
||||
|
||||
pairBuffer = '';
|
||||
if (_result !== '') pairBuffer += ', ';
|
||||
|
||||
if (state.condenseFlow) pairBuffer += '"';
|
||||
|
||||
objectKey = objectKeyList[index];
|
||||
objectValue = object[objectKey];
|
||||
|
||||
if (state.replacer) {
|
||||
objectValue = state.replacer.call(object, objectKey, objectValue);
|
||||
}
|
||||
|
||||
if (!writeNode(state, level, objectKey, false, false)) {
|
||||
continue; // Skip this pair because of invalid key;
|
||||
}
|
||||
|
||||
if (state.dump.length > 1024) pairBuffer += '? ';
|
||||
|
||||
pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
|
||||
|
||||
if (!writeNode(state, level, objectValue, false, false)) {
|
||||
continue; // Skip this pair because of invalid value.
|
||||
}
|
||||
|
||||
pairBuffer += state.dump;
|
||||
|
||||
// Both key and value are valid.
|
||||
_result += pairBuffer;
|
||||
}
|
||||
|
||||
state.tag = _tag;
|
||||
state.dump = '{' + _result + '}';
|
||||
}
|
||||
|
||||
function writeBlockMapping(state, level, object, compact) {
|
||||
var _result = '',
|
||||
_tag = state.tag,
|
||||
objectKeyList = Object.keys(object),
|
||||
index,
|
||||
length,
|
||||
objectKey,
|
||||
objectValue,
|
||||
explicitPair,
|
||||
pairBuffer;
|
||||
|
||||
// Allow sorting keys so that the output file is deterministic
|
||||
if (state.sortKeys === true) {
|
||||
// Default sorting
|
||||
objectKeyList.sort();
|
||||
} else if (typeof state.sortKeys === 'function') {
|
||||
// Custom sort function
|
||||
objectKeyList.sort(state.sortKeys);
|
||||
} else if (state.sortKeys) {
|
||||
// Something is wrong
|
||||
throw new YAMLException('sortKeys must be a boolean or a function');
|
||||
}
|
||||
|
||||
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
||||
pairBuffer = '';
|
||||
|
||||
if (!compact || _result !== '') {
|
||||
pairBuffer += generateNextLine(state, level);
|
||||
}
|
||||
|
||||
objectKey = objectKeyList[index];
|
||||
objectValue = object[objectKey];
|
||||
|
||||
if (state.replacer) {
|
||||
objectValue = state.replacer.call(object, objectKey, objectValue);
|
||||
}
|
||||
|
||||
if (!writeNode(state, level + 1, objectKey, true, true, true)) {
|
||||
continue; // Skip this pair because of invalid key.
|
||||
}
|
||||
|
||||
explicitPair = (state.tag !== null && state.tag !== '?') ||
|
||||
(state.dump && state.dump.length > 1024);
|
||||
|
||||
if (explicitPair) {
|
||||
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
||||
pairBuffer += '?';
|
||||
} else {
|
||||
pairBuffer += '? ';
|
||||
}
|
||||
}
|
||||
|
||||
pairBuffer += state.dump;
|
||||
|
||||
if (explicitPair) {
|
||||
pairBuffer += generateNextLine(state, level);
|
||||
}
|
||||
|
||||
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
||||
continue; // Skip this pair because of invalid value.
|
||||
}
|
||||
|
||||
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
||||
pairBuffer += ':';
|
||||
} else {
|
||||
pairBuffer += ': ';
|
||||
}
|
||||
|
||||
pairBuffer += state.dump;
|
||||
|
||||
// Both key and value are valid.
|
||||
_result += pairBuffer;
|
||||
}
|
||||
|
||||
state.tag = _tag;
|
||||
state.dump = _result || '{}'; // Empty mapping if no valid pairs.
|
||||
}
|
||||
|
||||
function detectType(state, object, explicit) {
|
||||
var _result, typeList, index, length, type, style;
|
||||
|
||||
typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
||||
|
||||
for (index = 0, length = typeList.length; index < length; index += 1) {
|
||||
type = typeList[index];
|
||||
|
||||
if ((type.instanceOf || type.predicate) &&
|
||||
(!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
|
||||
(!type.predicate || type.predicate(object))) {
|
||||
|
||||
if (explicit) {
|
||||
if (type.multi && type.representName) {
|
||||
state.tag = type.representName(object);
|
||||
} else {
|
||||
state.tag = type.tag;
|
||||
}
|
||||
} else {
|
||||
state.tag = '?';
|
||||
}
|
||||
|
||||
if (type.represent) {
|
||||
style = state.styleMap[type.tag] || type.defaultStyle;
|
||||
|
||||
if (_toString.call(type.represent) === '[object Function]') {
|
||||
_result = type.represent(object, style);
|
||||
} else if (_hasOwnProperty.call(type.represent, style)) {
|
||||
_result = type.represent[style](object, style);
|
||||
} else {
|
||||
throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
|
||||
}
|
||||
|
||||
state.dump = _result;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Serializes `object` and writes it to global `result`.
|
||||
// Returns true on success, or false on invalid object.
|
||||
//
|
||||
function writeNode(state, level, object, block, compact, iskey, isblockseq) {
|
||||
state.tag = null;
|
||||
state.dump = object;
|
||||
|
||||
if (!detectType(state, object, false)) {
|
||||
detectType(state, object, true);
|
||||
}
|
||||
|
||||
var type = _toString.call(state.dump);
|
||||
var inblock = block;
|
||||
var tagStr;
|
||||
|
||||
if (block) {
|
||||
block = (state.flowLevel < 0 || state.flowLevel > level);
|
||||
}
|
||||
|
||||
var objectOrArray = type === '[object Object]' || type === '[object Array]',
|
||||
duplicateIndex,
|
||||
duplicate;
|
||||
|
||||
if (objectOrArray) {
|
||||
duplicateIndex = state.duplicates.indexOf(object);
|
||||
duplicate = duplicateIndex !== -1;
|
||||
}
|
||||
|
||||
if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
|
||||
compact = false;
|
||||
}
|
||||
|
||||
if (duplicate && state.usedDuplicates[duplicateIndex]) {
|
||||
state.dump = '*ref_' + duplicateIndex;
|
||||
} else {
|
||||
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
|
||||
state.usedDuplicates[duplicateIndex] = true;
|
||||
}
|
||||
if (type === '[object Object]') {
|
||||
if (block && (Object.keys(state.dump).length !== 0)) {
|
||||
writeBlockMapping(state, level, state.dump, compact);
|
||||
if (duplicate) {
|
||||
state.dump = '&ref_' + duplicateIndex + state.dump;
|
||||
}
|
||||
} else {
|
||||
writeFlowMapping(state, level, state.dump);
|
||||
if (duplicate) {
|
||||
state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
|
||||
}
|
||||
}
|
||||
} else if (type === '[object Array]') {
|
||||
if (block && (state.dump.length !== 0)) {
|
||||
if (state.noArrayIndent && !isblockseq && level > 0) {
|
||||
writeBlockSequence(state, level - 1, state.dump, compact);
|
||||
} else {
|
||||
writeBlockSequence(state, level, state.dump, compact);
|
||||
}
|
||||
if (duplicate) {
|
||||
state.dump = '&ref_' + duplicateIndex + state.dump;
|
||||
}
|
||||
} else {
|
||||
writeFlowSequence(state, level, state.dump);
|
||||
if (duplicate) {
|
||||
state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
|
||||
}
|
||||
}
|
||||
} else if (type === '[object String]') {
|
||||
if (state.tag !== '?') {
|
||||
writeScalar(state, state.dump, level, iskey, inblock);
|
||||
}
|
||||
} else if (type === '[object Undefined]') {
|
||||
return false;
|
||||
} else {
|
||||
if (state.skipInvalid) return false;
|
||||
throw new YAMLException('unacceptable kind of an object to dump ' + type);
|
||||
}
|
||||
|
||||
if (state.tag !== null && state.tag !== '?') {
|
||||
// Need to encode all characters except those allowed by the spec:
|
||||
//
|
||||
// [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */
|
||||
// [36] ns-hex-digit ::= ns-dec-digit
|
||||
// | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */
|
||||
// [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */
|
||||
// [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-”
|
||||
// [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#”
|
||||
// | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,”
|
||||
// | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]”
|
||||
//
|
||||
// Also need to encode '!' because it has special meaning (end of tag prefix).
|
||||
//
|
||||
tagStr = encodeURI(
|
||||
state.tag[0] === '!' ? state.tag.slice(1) : state.tag
|
||||
).replace(/!/g, '%21');
|
||||
|
||||
if (state.tag[0] === '!') {
|
||||
tagStr = '!' + tagStr;
|
||||
} else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {
|
||||
tagStr = '!!' + tagStr.slice(18);
|
||||
} else {
|
||||
tagStr = '!<' + tagStr + '>';
|
||||
}
|
||||
|
||||
state.dump = tagStr + ' ' + state.dump;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function getDuplicateReferences(object, state) {
|
||||
var objects = [],
|
||||
duplicatesIndexes = [],
|
||||
index,
|
||||
length;
|
||||
|
||||
inspectNode(object, objects, duplicatesIndexes);
|
||||
|
||||
for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
|
||||
state.duplicates.push(objects[duplicatesIndexes[index]]);
|
||||
}
|
||||
state.usedDuplicates = new Array(length);
|
||||
}
|
||||
|
||||
function inspectNode(object, objects, duplicatesIndexes) {
|
||||
var objectKeyList,
|
||||
index,
|
||||
length;
|
||||
|
||||
if (object !== null && typeof object === 'object') {
|
||||
index = objects.indexOf(object);
|
||||
if (index !== -1) {
|
||||
if (duplicatesIndexes.indexOf(index) === -1) {
|
||||
duplicatesIndexes.push(index);
|
||||
}
|
||||
} else {
|
||||
objects.push(object);
|
||||
|
||||
if (Array.isArray(object)) {
|
||||
for (index = 0, length = object.length; index < length; index += 1) {
|
||||
inspectNode(object[index], objects, duplicatesIndexes);
|
||||
}
|
||||
} else {
|
||||
objectKeyList = Object.keys(object);
|
||||
|
||||
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
||||
inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function dump(input, options) {
|
||||
options = options || {};
|
||||
|
||||
var state = new State(options);
|
||||
|
||||
if (!state.noRefs) getDuplicateReferences(input, state);
|
||||
|
||||
var value = input;
|
||||
|
||||
if (state.replacer) {
|
||||
value = state.replacer.call({ '': value }, '', value);
|
||||
}
|
||||
|
||||
if (writeNode(state, 0, value, true, true)) return state.dump + '\n';
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
module.exports.dump = dump;
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"strictNullChecks": true,
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
},
|
||||
"files": [
|
||||
"./types.js",
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,826 @@
|
||||
## 8.8.2 (2023-01-23)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug that caused `allowHashBang` to be set to false when not provided, even with `ecmaVersion >= 14`.
|
||||
|
||||
Fix an exception when passing no option object to `parse` or `new Parser`.
|
||||
|
||||
Fix incorrect parse error on `if (0) let\n[astral identifier char]`.
|
||||
|
||||
## 8.8.1 (2022-10-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make type for `Comment` compatible with estree types.
|
||||
|
||||
## 8.8.0 (2022-07-21)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Allow parentheses around spread args in destructuring object assignment.
|
||||
|
||||
Fix an issue where the tree contained `directive` properties in when parsing with a language version that doesn't support them.
|
||||
|
||||
### New features
|
||||
|
||||
Support hashbang comments by default in ECMAScript 2023 and later.
|
||||
|
||||
## 8.7.1 (2021-04-26)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Stop handling `"use strict"` directives in ECMAScript versions before 5.
|
||||
|
||||
Fix an issue where duplicate quoted export names in `export *` syntax were incorrectly checked.
|
||||
|
||||
Add missing type for `tokTypes`.
|
||||
|
||||
## 8.7.0 (2021-12-27)
|
||||
|
||||
### New features
|
||||
|
||||
Support quoted export names.
|
||||
|
||||
Upgrade to Unicode 14.
|
||||
|
||||
Add support for Unicode 13 properties in regular expressions.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code.
|
||||
|
||||
## 8.6.0 (2021-11-18)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug where an object literal with multiple `__proto__` properties would incorrectly be accepted if a later property value held an assigment.
|
||||
|
||||
### New features
|
||||
|
||||
Support class private fields with the `in` operator.
|
||||
|
||||
## 8.5.0 (2021-09-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improve context-dependent tokenization in a number of corner cases.
|
||||
|
||||
Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number).
|
||||
|
||||
Fix an issue where arrow function bodies in for loop context would inappropriately consume `in` operators.
|
||||
|
||||
Fix wrong end locations stored on SequenceExpression nodes.
|
||||
|
||||
Implement restriction that `for`/`of` loop LHS can't start with `let`.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for ES2022 class static blocks.
|
||||
|
||||
Allow multiple input files to be passed to the CLI tool.
|
||||
|
||||
## 8.4.1 (2021-06-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug where `allowAwaitOutsideFunction` would allow `await` in class field initializers, and setting `ecmaVersion` to 13 or higher would allow top-level await in non-module sources.
|
||||
|
||||
## 8.4.0 (2021-06-11)
|
||||
|
||||
### New features
|
||||
|
||||
A new option, `allowSuperOutsideMethod`, can be used to suppress the error when `super` is used in the wrong context.
|
||||
|
||||
## 8.3.0 (2021-05-31)
|
||||
|
||||
### New features
|
||||
|
||||
Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher.
|
||||
|
||||
Add support for the `d` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag.
|
||||
|
||||
## 8.2.4 (2021-05-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix spec conformity in corner case 'for await (async of ...)'.
|
||||
|
||||
## 8.2.3 (2021-05-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix an issue where the library couldn't parse 'for (async of ...)'.
|
||||
|
||||
Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances.
|
||||
|
||||
## 8.2.2 (2021-04-29)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions with yield.
|
||||
|
||||
## 8.2.1 (2021-04-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse.
|
||||
|
||||
## 8.2.0 (2021-04-24)
|
||||
|
||||
### New features
|
||||
|
||||
Add support for ES2022 class fields and private methods.
|
||||
|
||||
## 8.1.1 (2021-04-12)
|
||||
|
||||
### Various
|
||||
|
||||
Stop shipping source maps in the NPM package.
|
||||
|
||||
## 8.1.0 (2021-03-09)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a spurious error in nested destructuring arrays.
|
||||
|
||||
### New features
|
||||
|
||||
Expose `allowAwaitOutsideFunction` in CLI interface.
|
||||
|
||||
Make `allowImportExportAnywhere` also apply to `import.meta`.
|
||||
|
||||
## 8.0.5 (2021-01-25)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Adjust package.json to work with Node 12.16.0 and 13.0-13.6.
|
||||
|
||||
## 8.0.4 (2020-10-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make `await x ** y` an error, following the spec.
|
||||
|
||||
Fix potentially exponential regular expression.
|
||||
|
||||
## 8.0.3 (2020-10-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`.
|
||||
|
||||
## 8.0.2 (2020-09-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make the TypeScript types reflect the current allowed values for `ecmaVersion`.
|
||||
|
||||
Fix another regexp/division tokenizer issue.
|
||||
|
||||
## 8.0.1 (2020-08-12)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Provide the correct value in the `version` export.
|
||||
|
||||
## 8.0.0 (2020-08-12)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow expressions like `(a = b) = c`.
|
||||
|
||||
Make non-octal escape sequences a syntax error in strict mode.
|
||||
|
||||
### New features
|
||||
|
||||
The package can now be loaded directly as an ECMAScript module in node 13+.
|
||||
|
||||
Update to the set of Unicode properties from ES2021.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release.
|
||||
|
||||
Some changes to method signatures that may be used by plugins.
|
||||
|
||||
## 7.4.0 (2020-08-03)
|
||||
|
||||
### New features
|
||||
|
||||
Add support for logical assignment operators.
|
||||
|
||||
Add support for numeric separators.
|
||||
|
||||
## 7.3.1 (2020-06-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make the string in the `version` export match the actual library version.
|
||||
|
||||
## 7.3.0 (2020-06-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for optional chaining (`?.`).
|
||||
|
||||
## 7.2.0 (2020-05-09)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix precedence issue in parsing of async arrow functions.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for nullish coalescing.
|
||||
|
||||
Add support for `import.meta`.
|
||||
|
||||
Support `export * as ...` syntax.
|
||||
|
||||
Upgrade to Unicode 13.
|
||||
|
||||
## 6.4.1 (2020-03-09)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
More carefully check for valid UTF16 surrogate pairs in regexp validator.
|
||||
|
||||
## 7.1.1 (2020-03-01)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Treat `\8` and `\9` as invalid escapes in template strings.
|
||||
|
||||
Allow unicode escapes in property names that are keywords.
|
||||
|
||||
Don't error on an exponential operator expression as argument to `await`.
|
||||
|
||||
More carefully check for valid UTF16 surrogate pairs in regexp validator.
|
||||
|
||||
## 7.1.0 (2019-09-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow trailing object literal commas when ecmaVersion is less than 5.
|
||||
|
||||
### New features
|
||||
|
||||
Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on.
|
||||
|
||||
## 7.0.0 (2019-08-13)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression).
|
||||
|
||||
Makes 10 (ES2019) the default value for the `ecmaVersion` option.
|
||||
|
||||
## 6.3.0 (2019-08-12)
|
||||
|
||||
### New features
|
||||
|
||||
`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard.
|
||||
|
||||
## 6.2.1 (2019-07-21)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
|
||||
|
||||
Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
|
||||
|
||||
## 6.2.0 (2019-07-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
|
||||
|
||||
Disallow binding `let` in patterns.
|
||||
|
||||
### New features
|
||||
|
||||
Support bigint syntax with `ecmaVersion` >= 11.
|
||||
|
||||
Support dynamic `import` syntax with `ecmaVersion` >= 11.
|
||||
|
||||
Upgrade to Unicode version 12.
|
||||
|
||||
## 6.1.1 (2019-02-27)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug that caused parsing default exports of with names to fail.
|
||||
|
||||
## 6.1.0 (2019-02-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix scope checking when redefining a `var` as a lexical binding.
|
||||
|
||||
### New features
|
||||
|
||||
Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.
|
||||
|
||||
## 6.0.7 (2019-02-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Check that exported bindings are defined.
|
||||
|
||||
Don't treat `\u180e` as a whitespace character.
|
||||
|
||||
Check for duplicate parameter names in methods.
|
||||
|
||||
Don't allow shorthand properties when they are generators or async methods.
|
||||
|
||||
Forbid binding `await` in async arrow function's parameter list.
|
||||
|
||||
## 6.0.6 (2019-01-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
The content of class declarations and expressions is now always parsed in strict mode.
|
||||
|
||||
Don't allow `let` or `const` to bind the variable name `let`.
|
||||
|
||||
Treat class declarations as lexical.
|
||||
|
||||
Don't allow a generator function declaration as the sole body of an `if` or `else`.
|
||||
|
||||
Ignore `"use strict"` when after an empty statement.
|
||||
|
||||
Allow string line continuations with special line terminator characters.
|
||||
|
||||
Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
|
||||
|
||||
Fix bug with parsing `yield` in a `for` loop initializer.
|
||||
|
||||
Implement special cases around scope checking for functions.
|
||||
|
||||
## 6.0.5 (2019-01-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
|
||||
|
||||
Don't treat `let` as a keyword when the next token is `{` on the next line.
|
||||
|
||||
Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
|
||||
|
||||
## 6.0.4 (2018-11-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Further improvements to tokenizing regular expressions in corner cases.
|
||||
|
||||
## 6.0.3 (2018-11-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
|
||||
|
||||
Remove stray symlink in the package tarball.
|
||||
|
||||
## 6.0.2 (2018-09-26)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
|
||||
|
||||
## 6.0.1 (2018-09-14)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix wrong value in `version` export.
|
||||
|
||||
## 6.0.0 (2018-09-14)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
|
||||
|
||||
Forbid `new.target` in top-level arrow functions.
|
||||
|
||||
Fix issue with parsing a regexp after `yield` in some contexts.
|
||||
|
||||
### New features
|
||||
|
||||
The package now comes with TypeScript definitions.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default value of the `ecmaVersion` option is now 9 (2018).
|
||||
|
||||
Plugins work differently, and will have to be rewritten to work with this version.
|
||||
|
||||
The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
|
||||
|
||||
## 5.7.3 (2018-09-10)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix failure to tokenize regexps after expressions like `x.of`.
|
||||
|
||||
Better error message for unterminated template literals.
|
||||
|
||||
## 5.7.2 (2018-08-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Properly handle `allowAwaitOutsideFunction` in for statements.
|
||||
|
||||
Treat function declarations at the top level of modules like let bindings.
|
||||
|
||||
Don't allow async function declarations as the only statement under a label.
|
||||
|
||||
## 5.7.0 (2018-06-15)
|
||||
|
||||
### New features
|
||||
|
||||
Upgraded to Unicode 11.
|
||||
|
||||
## 5.6.0 (2018-05-31)
|
||||
|
||||
### New features
|
||||
|
||||
Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
|
||||
|
||||
Allow binding-less catch statements when ECMAVersion >= 10.
|
||||
|
||||
Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
|
||||
|
||||
## 5.5.3 (2018-03-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.
|
||||
|
||||
## 5.5.2 (2018-03-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0.
|
||||
|
||||
## 5.5.1 (2018-03-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix misleading error message for octal escapes in template strings.
|
||||
|
||||
## 5.5.0 (2018-02-27)
|
||||
|
||||
### New features
|
||||
|
||||
The identifier character categorization is now based on Unicode version 10.
|
||||
|
||||
Acorn will now validate the content of regular expressions, including new ES9 features.
|
||||
|
||||
## 5.4.0 (2018-02-01)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow duplicate or escaped flags on regular expressions.
|
||||
|
||||
Disallow octal escapes in strings in strict mode.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for async iteration.
|
||||
|
||||
Add support for object spread and rest.
|
||||
|
||||
## 5.3.0 (2017-12-28)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix parsing of floating point literals with leading zeroes in loose mode.
|
||||
|
||||
Allow duplicate property names in object patterns.
|
||||
|
||||
Don't allow static class methods named `prototype`.
|
||||
|
||||
Disallow async functions directly under `if` or `else`.
|
||||
|
||||
Parse right-hand-side of `for`/`of` as an assignment expression.
|
||||
|
||||
Stricter parsing of `for`/`in`.
|
||||
|
||||
Don't allow unicode escapes in contextual keywords.
|
||||
|
||||
### New features
|
||||
|
||||
Parsing class members was factored into smaller methods to allow plugins to hook into it.
|
||||
|
||||
## 5.2.1 (2017-10-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a token context corruption bug.
|
||||
|
||||
## 5.2.0 (2017-10-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix token context tracking for `class` and `function` in property-name position.
|
||||
|
||||
Make sure `%*` isn't parsed as a valid operator.
|
||||
|
||||
Allow shorthand properties `get` and `set` to be followed by default values.
|
||||
|
||||
Disallow `super` when not in callee or object position.
|
||||
|
||||
### New features
|
||||
|
||||
Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
|
||||
|
||||
## 5.1.2 (2017-09-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disable parsing of legacy HTML-style comments in modules.
|
||||
|
||||
Fix parsing of async methods whose names are keywords.
|
||||
|
||||
## 5.1.1 (2017-07-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix problem with disambiguating regexp and division after a class.
|
||||
|
||||
## 5.1.0 (2017-07-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
|
||||
|
||||
Parse zero-prefixed numbers with non-octal digits as decimal.
|
||||
|
||||
Allow object/array patterns in rest parameters.
|
||||
|
||||
Don't error when `yield` is used as a property name.
|
||||
|
||||
Allow `async` as a shorthand object property.
|
||||
|
||||
### New features
|
||||
|
||||
Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
|
||||
|
||||
## 5.0.3 (2017-04-01)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix spurious duplicate variable definition errors for named functions.
|
||||
|
||||
## 5.0.2 (2017-03-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
|
||||
|
||||
## 5.0.0 (2017-03-28)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Raise an error for duplicated lexical bindings.
|
||||
|
||||
Fix spurious error when an assignement expression occurred after a spread expression.
|
||||
|
||||
Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
|
||||
|
||||
Allow labels in front or `var` declarations, even in strict mode.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`.
|
||||
|
||||
## 4.0.11 (2017-02-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Allow all forms of member expressions to be parenthesized as lvalue.
|
||||
|
||||
## 4.0.10 (2017-02-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Don't expect semicolons after default-exported functions or classes, even when they are expressions.
|
||||
|
||||
Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
|
||||
|
||||
## 4.0.9 (2017-02-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
|
||||
|
||||
## 4.0.8 (2017-02-03)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
|
||||
|
||||
## 4.0.7 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Accept invalidly rejected code like `(x).y = 2` again.
|
||||
|
||||
Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
|
||||
|
||||
## 4.0.6 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
|
||||
|
||||
## 4.0.5 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow parenthesized pattern expressions.
|
||||
|
||||
Allow keywords as export names.
|
||||
|
||||
Don't allow the `async` keyword to be parenthesized.
|
||||
|
||||
Properly raise an error when a keyword contains a character escape.
|
||||
|
||||
Allow `"use strict"` to appear after other string literal expressions.
|
||||
|
||||
Disallow labeled declarations.
|
||||
|
||||
## 4.0.4 (2016-12-19)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix crash when `export` was followed by a keyword that can't be
|
||||
exported.
|
||||
|
||||
## 4.0.3 (2016-08-16)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
|
||||
|
||||
Properly parse properties named `async` in ES2017 mode.
|
||||
|
||||
Fix bug where reserved words were broken in ES2017 mode.
|
||||
|
||||
## 4.0.2 (2016-08-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Don't ignore period or 'e' characters after octal numbers.
|
||||
|
||||
Fix broken parsing for call expressions in default parameter values of arrow functions.
|
||||
|
||||
## 4.0.1 (2016-08-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix false positives in duplicated export name errors.
|
||||
|
||||
## 4.0.0 (2016-08-07)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default `ecmaVersion` option value is now 7.
|
||||
|
||||
A number of internal method signatures changed, so plugins might need to be updated.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
The parser now raises errors on duplicated export names.
|
||||
|
||||
`arguments` and `eval` can now be used in shorthand properties.
|
||||
|
||||
Duplicate parameter names in non-simple argument lists now always produce an error.
|
||||
|
||||
### New features
|
||||
|
||||
The `ecmaVersion` option now also accepts year-style version numbers
|
||||
(2015, etc).
|
||||
|
||||
Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
|
||||
|
||||
Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
|
||||
|
||||
## 3.3.0 (2016-07-25)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug in tokenizing of regexp operator after a function declaration.
|
||||
|
||||
Fix parser crash when parsing an array pattern with a hole.
|
||||
|
||||
### New features
|
||||
|
||||
Implement check against complex argument lists in functions that enable strict mode in ES7.
|
||||
|
||||
## 3.2.0 (2016-06-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improve handling of lack of unicode regexp support in host
|
||||
environment.
|
||||
|
||||
Properly reject shorthand properties whose name is a keyword.
|
||||
|
||||
### New features
|
||||
|
||||
Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
|
||||
|
||||
## 3.1.0 (2016-04-18)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Properly tokenize the division operator directly after a function expression.
|
||||
|
||||
Allow trailing comma in destructuring arrays.
|
||||
|
||||
## 3.0.4 (2016-02-25)
|
||||
|
||||
### Fixes
|
||||
|
||||
Allow update expressions as left-hand-side of the ES7 exponential operator.
|
||||
|
||||
## 3.0.2 (2016-02-10)
|
||||
|
||||
### Fixes
|
||||
|
||||
Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
|
||||
|
||||
## 3.0.0 (2016-02-10)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default value of the `ecmaVersion` option is now 6 (used to be 5).
|
||||
|
||||
Support for comprehension syntax (which was dropped from the draft spec) has been removed.
|
||||
|
||||
### Fixes
|
||||
|
||||
`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
|
||||
|
||||
A parenthesized class or function expression after `export default` is now parsed correctly.
|
||||
|
||||
### New features
|
||||
|
||||
When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
|
||||
|
||||
The identifier character ranges are now based on Unicode 8.0.0.
|
||||
|
||||
Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
|
||||
|
||||
## 2.7.0 (2016-01-04)
|
||||
|
||||
### Fixes
|
||||
|
||||
Stop allowing rest parameters in setters.
|
||||
|
||||
Disallow `y` rexexp flag in ES5.
|
||||
|
||||
Disallow `\00` and `\000` escapes in strict mode.
|
||||
|
||||
Raise an error when an import name is a reserved word.
|
||||
|
||||
## 2.6.2 (2015-11-10)
|
||||
|
||||
### Fixes
|
||||
|
||||
Don't crash when no options object is passed.
|
||||
|
||||
## 2.6.0 (2015-11-09)
|
||||
|
||||
### Fixes
|
||||
|
||||
Add `await` as a reserved word in module sources.
|
||||
|
||||
Disallow `yield` in a parameter default value for a generator.
|
||||
|
||||
Forbid using a comma after a rest pattern in an array destructuring.
|
||||
|
||||
### New features
|
||||
|
||||
Support parsing stdin in command-line tool.
|
||||
|
||||
## 2.5.0 (2015-10-27)
|
||||
|
||||
### Fixes
|
||||
|
||||
Fix tokenizer support in the command-line tool.
|
||||
|
||||
Stop allowing `new.target` outside of functions.
|
||||
|
||||
Remove legacy `guard` and `guardedHandler` properties from try nodes.
|
||||
|
||||
Stop allowing multiple `__proto__` properties on an object literal in strict mode.
|
||||
|
||||
Don't allow rest parameters to be non-identifier patterns.
|
||||
|
||||
Check for duplicate paramter names in arrow functions.
|
||||
@@ -0,0 +1,7 @@
|
||||
// Used internally to sort array of lists by length
|
||||
|
||||
"use strict";
|
||||
|
||||
var toPosInt = require("../../number/to-pos-integer");
|
||||
|
||||
module.exports = function (arr1, arr2) { return toPosInt(arr1.length) - toPosInt(arr2.length); };
|
||||
@@ -0,0 +1,209 @@
|
||||
//////////////////////////////////////////////////////////
|
||||
// Here we need to reference our other deep imports
|
||||
// so VS code will figure out where they are
|
||||
// see conversation here:
|
||||
// https://github.com/microsoft/TypeScript/issues/43034
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
// tslint:disable: no-reference
|
||||
// It's tempting to add references to all of the deep-import locations, but
|
||||
// adding references to those that require DOM types breaks Node projects.
|
||||
/// <reference path="./operators/index.ts" />
|
||||
/// <reference path="./testing/index.ts" />
|
||||
// tslint:enable: no-reference
|
||||
|
||||
/* Observable */
|
||||
export { Observable } from './internal/Observable';
|
||||
export { ConnectableObservable } from './internal/observable/ConnectableObservable';
|
||||
export { GroupedObservable } from './internal/operators/groupBy';
|
||||
export { Operator } from './internal/Operator';
|
||||
export { observable } from './internal/symbol/observable';
|
||||
export { animationFrames } from './internal/observable/dom/animationFrames';
|
||||
|
||||
/* Subjects */
|
||||
export { Subject } from './internal/Subject';
|
||||
export { BehaviorSubject } from './internal/BehaviorSubject';
|
||||
export { ReplaySubject } from './internal/ReplaySubject';
|
||||
export { AsyncSubject } from './internal/AsyncSubject';
|
||||
|
||||
/* Schedulers */
|
||||
export { asap, asapScheduler } from './internal/scheduler/asap';
|
||||
export { async, asyncScheduler } from './internal/scheduler/async';
|
||||
export { queue, queueScheduler } from './internal/scheduler/queue';
|
||||
export { animationFrame, animationFrameScheduler } from './internal/scheduler/animationFrame';
|
||||
export { VirtualTimeScheduler, VirtualAction } from './internal/scheduler/VirtualTimeScheduler';
|
||||
export { Scheduler } from './internal/Scheduler';
|
||||
|
||||
/* Subscription */
|
||||
export { Subscription } from './internal/Subscription';
|
||||
export { Subscriber } from './internal/Subscriber';
|
||||
|
||||
/* Notification */
|
||||
export { Notification, NotificationKind } from './internal/Notification';
|
||||
|
||||
/* Utils */
|
||||
export { pipe } from './internal/util/pipe';
|
||||
export { noop } from './internal/util/noop';
|
||||
export { identity } from './internal/util/identity';
|
||||
export { isObservable } from './internal/util/isObservable';
|
||||
|
||||
/* Promise Conversion */
|
||||
export { lastValueFrom } from './internal/lastValueFrom';
|
||||
export { firstValueFrom } from './internal/firstValueFrom';
|
||||
|
||||
/* Error types */
|
||||
export { ArgumentOutOfRangeError } from './internal/util/ArgumentOutOfRangeError';
|
||||
export { EmptyError } from './internal/util/EmptyError';
|
||||
export { NotFoundError } from './internal/util/NotFoundError';
|
||||
export { ObjectUnsubscribedError } from './internal/util/ObjectUnsubscribedError';
|
||||
export { SequenceError } from './internal/util/SequenceError';
|
||||
export { TimeoutError } from './internal/operators/timeout';
|
||||
export { UnsubscriptionError } from './internal/util/UnsubscriptionError';
|
||||
|
||||
/* Static observable creation exports */
|
||||
export { bindCallback } from './internal/observable/bindCallback';
|
||||
export { bindNodeCallback } from './internal/observable/bindNodeCallback';
|
||||
export { combineLatest } from './internal/observable/combineLatest';
|
||||
export { concat } from './internal/observable/concat';
|
||||
export { connectable } from './internal/observable/connectable';
|
||||
export { defer } from './internal/observable/defer';
|
||||
export { empty } from './internal/observable/empty';
|
||||
export { forkJoin } from './internal/observable/forkJoin';
|
||||
export { from } from './internal/observable/from';
|
||||
export { fromEvent } from './internal/observable/fromEvent';
|
||||
export { fromEventPattern } from './internal/observable/fromEventPattern';
|
||||
export { generate } from './internal/observable/generate';
|
||||
export { iif } from './internal/observable/iif';
|
||||
export { interval } from './internal/observable/interval';
|
||||
export { merge } from './internal/observable/merge';
|
||||
export { never } from './internal/observable/never';
|
||||
export { of } from './internal/observable/of';
|
||||
export { onErrorResumeNext } from './internal/observable/onErrorResumeNext';
|
||||
export { pairs } from './internal/observable/pairs';
|
||||
export { partition } from './internal/observable/partition';
|
||||
export { race } from './internal/observable/race';
|
||||
export { range } from './internal/observable/range';
|
||||
export { throwError } from './internal/observable/throwError';
|
||||
export { timer } from './internal/observable/timer';
|
||||
export { using } from './internal/observable/using';
|
||||
export { zip } from './internal/observable/zip';
|
||||
export { scheduled } from './internal/scheduled/scheduled';
|
||||
|
||||
/* Constants */
|
||||
export { EMPTY } from './internal/observable/empty';
|
||||
export { NEVER } from './internal/observable/never';
|
||||
|
||||
/* Types */
|
||||
export * from './internal/types';
|
||||
|
||||
/* Config */
|
||||
export { config, GlobalConfig } from './internal/config';
|
||||
|
||||
/* Operators */
|
||||
export { audit } from './internal/operators/audit';
|
||||
export { auditTime } from './internal/operators/auditTime';
|
||||
export { buffer } from './internal/operators/buffer';
|
||||
export { bufferCount } from './internal/operators/bufferCount';
|
||||
export { bufferTime } from './internal/operators/bufferTime';
|
||||
export { bufferToggle } from './internal/operators/bufferToggle';
|
||||
export { bufferWhen } from './internal/operators/bufferWhen';
|
||||
export { catchError } from './internal/operators/catchError';
|
||||
export { combineAll } from './internal/operators/combineAll';
|
||||
export { combineLatestAll } from './internal/operators/combineLatestAll';
|
||||
export { combineLatestWith } from './internal/operators/combineLatestWith';
|
||||
export { concatAll } from './internal/operators/concatAll';
|
||||
export { concatMap } from './internal/operators/concatMap';
|
||||
export { concatMapTo } from './internal/operators/concatMapTo';
|
||||
export { concatWith } from './internal/operators/concatWith';
|
||||
export { connect, ConnectConfig } from './internal/operators/connect';
|
||||
export { count } from './internal/operators/count';
|
||||
export { debounce } from './internal/operators/debounce';
|
||||
export { debounceTime } from './internal/operators/debounceTime';
|
||||
export { defaultIfEmpty } from './internal/operators/defaultIfEmpty';
|
||||
export { delay } from './internal/operators/delay';
|
||||
export { delayWhen } from './internal/operators/delayWhen';
|
||||
export { dematerialize } from './internal/operators/dematerialize';
|
||||
export { distinct } from './internal/operators/distinct';
|
||||
export { distinctUntilChanged } from './internal/operators/distinctUntilChanged';
|
||||
export { distinctUntilKeyChanged } from './internal/operators/distinctUntilKeyChanged';
|
||||
export { elementAt } from './internal/operators/elementAt';
|
||||
export { endWith } from './internal/operators/endWith';
|
||||
export { every } from './internal/operators/every';
|
||||
export { exhaust } from './internal/operators/exhaust';
|
||||
export { exhaustAll } from './internal/operators/exhaustAll';
|
||||
export { exhaustMap } from './internal/operators/exhaustMap';
|
||||
export { expand } from './internal/operators/expand';
|
||||
export { filter } from './internal/operators/filter';
|
||||
export { finalize } from './internal/operators/finalize';
|
||||
export { find } from './internal/operators/find';
|
||||
export { findIndex } from './internal/operators/findIndex';
|
||||
export { first } from './internal/operators/first';
|
||||
export { groupBy, BasicGroupByOptions, GroupByOptionsWithElement } from './internal/operators/groupBy';
|
||||
export { ignoreElements } from './internal/operators/ignoreElements';
|
||||
export { isEmpty } from './internal/operators/isEmpty';
|
||||
export { last } from './internal/operators/last';
|
||||
export { map } from './internal/operators/map';
|
||||
export { mapTo } from './internal/operators/mapTo';
|
||||
export { materialize } from './internal/operators/materialize';
|
||||
export { max } from './internal/operators/max';
|
||||
export { mergeAll } from './internal/operators/mergeAll';
|
||||
export { flatMap } from './internal/operators/flatMap';
|
||||
export { mergeMap } from './internal/operators/mergeMap';
|
||||
export { mergeMapTo } from './internal/operators/mergeMapTo';
|
||||
export { mergeScan } from './internal/operators/mergeScan';
|
||||
export { mergeWith } from './internal/operators/mergeWith';
|
||||
export { min } from './internal/operators/min';
|
||||
export { multicast } from './internal/operators/multicast';
|
||||
export { observeOn } from './internal/operators/observeOn';
|
||||
export { onErrorResumeNextWith } from './internal/operators/onErrorResumeNextWith';
|
||||
export { pairwise } from './internal/operators/pairwise';
|
||||
export { pluck } from './internal/operators/pluck';
|
||||
export { publish } from './internal/operators/publish';
|
||||
export { publishBehavior } from './internal/operators/publishBehavior';
|
||||
export { publishLast } from './internal/operators/publishLast';
|
||||
export { publishReplay } from './internal/operators/publishReplay';
|
||||
export { raceWith } from './internal/operators/raceWith';
|
||||
export { reduce } from './internal/operators/reduce';
|
||||
export { repeat, RepeatConfig } from './internal/operators/repeat';
|
||||
export { repeatWhen } from './internal/operators/repeatWhen';
|
||||
export { retry, RetryConfig } from './internal/operators/retry';
|
||||
export { retryWhen } from './internal/operators/retryWhen';
|
||||
export { refCount } from './internal/operators/refCount';
|
||||
export { sample } from './internal/operators/sample';
|
||||
export { sampleTime } from './internal/operators/sampleTime';
|
||||
export { scan } from './internal/operators/scan';
|
||||
export { sequenceEqual } from './internal/operators/sequenceEqual';
|
||||
export { share, ShareConfig } from './internal/operators/share';
|
||||
export { shareReplay, ShareReplayConfig } from './internal/operators/shareReplay';
|
||||
export { single } from './internal/operators/single';
|
||||
export { skip } from './internal/operators/skip';
|
||||
export { skipLast } from './internal/operators/skipLast';
|
||||
export { skipUntil } from './internal/operators/skipUntil';
|
||||
export { skipWhile } from './internal/operators/skipWhile';
|
||||
export { startWith } from './internal/operators/startWith';
|
||||
export { subscribeOn } from './internal/operators/subscribeOn';
|
||||
export { switchAll } from './internal/operators/switchAll';
|
||||
export { switchMap } from './internal/operators/switchMap';
|
||||
export { switchMapTo } from './internal/operators/switchMapTo';
|
||||
export { switchScan } from './internal/operators/switchScan';
|
||||
export { take } from './internal/operators/take';
|
||||
export { takeLast } from './internal/operators/takeLast';
|
||||
export { takeUntil } from './internal/operators/takeUntil';
|
||||
export { takeWhile } from './internal/operators/takeWhile';
|
||||
export { tap } from './internal/operators/tap';
|
||||
export { throttle, ThrottleConfig } from './internal/operators/throttle';
|
||||
export { throttleTime } from './internal/operators/throttleTime';
|
||||
export { throwIfEmpty } from './internal/operators/throwIfEmpty';
|
||||
export { timeInterval } from './internal/operators/timeInterval';
|
||||
export { timeout, TimeoutConfig, TimeoutInfo } from './internal/operators/timeout';
|
||||
export { timeoutWith } from './internal/operators/timeoutWith';
|
||||
export { timestamp } from './internal/operators/timestamp';
|
||||
export { toArray } from './internal/operators/toArray';
|
||||
export { window } from './internal/operators/window';
|
||||
export { windowCount } from './internal/operators/windowCount';
|
||||
export { windowTime } from './internal/operators/windowTime';
|
||||
export { windowToggle } from './internal/operators/windowToggle';
|
||||
export { windowWhen } from './internal/operators/windowWhen';
|
||||
export { withLatestFrom } from './internal/operators/withLatestFrom';
|
||||
export { zipAll } from './internal/operators/zipAll';
|
||||
export { zipWith } from './internal/operators/zipWith';
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},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":"1 2 3 4 5 6 7 8 9 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":"0 DC tB I v J D E F A B C K L G M N O w g x y z EC FC"},D:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"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"},E:{"1":"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 D HC zB IC JC"},F:{"1":"8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"0 1 2 3 4 5 6 7 F B C G M N O w g x y z PC QC RC SC qB AC TC rB"},G:{"1":"E 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 XC"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D","16":"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":"g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:6,C:"Array.prototype.findIndex"};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
var toString = require('./toString');
|
||||
|
||||
/**
|
||||
* Replaces matches for `pattern` in `string` with `replacement`.
|
||||
*
|
||||
* **Note:** This method is based on
|
||||
* [`String#replace`](https://mdn.io/String/replace).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to modify.
|
||||
* @param {RegExp|string} pattern The pattern to replace.
|
||||
* @param {Function|string} replacement The match replacement.
|
||||
* @returns {string} Returns the modified string.
|
||||
* @example
|
||||
*
|
||||
* _.replace('Hi Fred', 'Fred', 'Barney');
|
||||
* // => 'Hi Barney'
|
||||
*/
|
||||
function replace() {
|
||||
var args = arguments,
|
||||
string = toString(args[0]);
|
||||
|
||||
return args.length < 3 ? string : string.replace(args[1], args[2]);
|
||||
}
|
||||
|
||||
module.exports = replace;
|
||||
@@ -0,0 +1,4 @@
|
||||
import { Parser } from '../index';
|
||||
import { Node } from 'estree';
|
||||
import { Style } from '../../interfaces';
|
||||
export default function read_style(parser: Parser, start: number, attributes: Node[]): Style;
|
||||
@@ -0,0 +1,5 @@
|
||||
(function (root, factory) {
|
||||
root.Rx = factory();
|
||||
})(window || global || this, function () {
|
||||
return require('../dist/package/Rx');
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bindNodeCallback.js","sourceRoot":"","sources":["../../../../src/internal/observable/bindNodeCallback.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAsHhE,MAAM,UAAU,gBAAgB,CAC9B,YAA4E,EAC5E,cAA0D,EAC1D,SAAyB;IAEzB,OAAO,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;AAC9E,CAAC"}
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Checks to see if a value is not only a `Date` object,
|
||||
* but a *valid* `Date` object that can be converted to a
|
||||
* number. For example, `new Date('blah')` is indeed an
|
||||
* `instanceof Date`, however it cannot be converted to a
|
||||
* number.
|
||||
*/
|
||||
export declare function isValidDate(value: any): value is Date;
|
||||
//# sourceMappingURL=isDate.d.ts.map
|
||||
@@ -0,0 +1,22 @@
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
export function find(predicate, thisArg) {
|
||||
return operate(createFind(predicate, thisArg, 'value'));
|
||||
}
|
||||
export function createFind(predicate, thisArg, emit) {
|
||||
const findIndex = emit === 'index';
|
||||
return (source, subscriber) => {
|
||||
let index = 0;
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
||||
const i = index++;
|
||||
if (predicate.call(thisArg, value, i, source)) {
|
||||
subscriber.next(findIndex ? i : value);
|
||||
subscriber.complete();
|
||||
}
|
||||
}, () => {
|
||||
subscriber.next(findIndex ? -1 : undefined);
|
||||
subscriber.complete();
|
||||
}));
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=find.js.map
|
||||
@@ -0,0 +1,16 @@
|
||||
import { format } from '../../util.js';
|
||||
|
||||
const message = context => {
|
||||
const { isPreRelease, github } = context;
|
||||
const { releaseName, update } = github;
|
||||
const name = format(releaseName, context);
|
||||
return `${update ? 'Update' : 'Create a'} ${isPreRelease ? 'pre-' : ''}release on GitHub (${name})?`;
|
||||
};
|
||||
|
||||
export default {
|
||||
release: {
|
||||
type: 'confirm',
|
||||
message,
|
||||
default: true
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"concatWith.js","sourceRoot":"","sources":["../../../../src/internal/operators/concatWith.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA0ClC,MAAM,UAAU,UAAU;IACxB,sBAA6C;SAA7C,UAA6C,EAA7C,qBAA6C,EAA7C,IAA6C;QAA7C,iCAA6C;;IAE7C,OAAO,MAAM,wCAAI,YAAY,IAAE;AACjC,CAAC"}
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2018 Petka Antonov
|
||||
|
||||
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 @@
|
||||
{"version":3,"file":"argsOrArgArray.js","sourceRoot":"","sources":["../../../../src/internal/util/argsOrArgArray.ts"],"names":[],"mappings":"AAAQ,IAAA,OAAO,GAAK,KAAK,QAAV,CAAW;AAM1B,MAAM,UAAU,cAAc,CAAI,IAAiB;IACjD,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,IAAY,CAAC;AACzE,CAAC"}
|
||||
@@ -0,0 +1,50 @@
|
||||
|
||||
var seed = Math.random();
|
||||
var n = 'rc'+ seed;
|
||||
var N = 'RC'+ seed;
|
||||
var assert = require('assert')
|
||||
|
||||
|
||||
// Basic usage
|
||||
process.env[n+'_someOpt__a'] = 42
|
||||
process.env[n+'_someOpt__x__'] = 99
|
||||
process.env[n+'_someOpt__a__b'] = 186
|
||||
process.env[n+'_someOpt__a__b__c'] = 243
|
||||
process.env[n+'_someOpt__x__y'] = 1862
|
||||
process.env[n+'_someOpt__z'] = 186577
|
||||
|
||||
// Should ignore empty strings from orphaned '__'
|
||||
process.env[n+'_someOpt__z__x__'] = 18629
|
||||
process.env[n+'_someOpt__w__w__'] = 18629
|
||||
|
||||
// Leading '__' should ignore everything up to 'z'
|
||||
process.env[n+'___z__i__'] = 9999
|
||||
|
||||
// should ignore case for config name section.
|
||||
process.env[N+'_test_upperCase'] = 187
|
||||
|
||||
function testPrefix(prefix) {
|
||||
var config = require('../')(prefix, {
|
||||
option: true
|
||||
})
|
||||
|
||||
console.log('\n\n------ nested-env-vars ------\n',{prefix: prefix}, '\n', config);
|
||||
|
||||
assert.equal(config.option, true)
|
||||
assert.equal(config.someOpt.a, 42)
|
||||
assert.equal(config.someOpt.x, 99)
|
||||
// Should not override `a` once it's been set
|
||||
assert.equal(config.someOpt.a/*.b*/, 42)
|
||||
// Should not override `x` once it's been set
|
||||
assert.equal(config.someOpt.x/*.y*/, 99)
|
||||
assert.equal(config.someOpt.z, 186577)
|
||||
// Should not override `z` once it's been set
|
||||
assert.equal(config.someOpt.z/*.x*/, 186577)
|
||||
assert.equal(config.someOpt.w.w, 18629)
|
||||
assert.equal(config.z.i, 9999)
|
||||
|
||||
assert.equal(config.test_upperCase, 187)
|
||||
}
|
||||
|
||||
testPrefix(n);
|
||||
testPrefix(N);
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,84 @@
|
||||
'use strict';
|
||||
|
||||
const pa = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
class DefaultFileSystem {
|
||||
|
||||
resolve(path) {
|
||||
return pa.resolve(path);
|
||||
}
|
||||
|
||||
isSeparator(char) {
|
||||
return char === '/' || char === pa.sep;
|
||||
}
|
||||
|
||||
isAbsolute(path) {
|
||||
return pa.isAbsolute(path);
|
||||
}
|
||||
|
||||
join(...paths) {
|
||||
return pa.join(...paths);
|
||||
}
|
||||
|
||||
basename(path) {
|
||||
return pa.basename(path);
|
||||
}
|
||||
|
||||
dirname(path) {
|
||||
return pa.dirname(path);
|
||||
}
|
||||
|
||||
statSync(path, options) {
|
||||
return fs.statSync(path, options);
|
||||
}
|
||||
|
||||
readFileSync(path, options) {
|
||||
return fs.readFileSync(path, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class VMFileSystem {
|
||||
|
||||
constructor({fs: fsModule = fs, path: pathModule = pa} = {}) {
|
||||
this.fs = fsModule;
|
||||
this.path = pathModule;
|
||||
}
|
||||
|
||||
resolve(path) {
|
||||
return this.path.resolve(path);
|
||||
}
|
||||
|
||||
isSeparator(char) {
|
||||
return char === '/' || char === this.path.sep;
|
||||
}
|
||||
|
||||
isAbsolute(path) {
|
||||
return this.path.isAbsolute(path);
|
||||
}
|
||||
|
||||
join(...paths) {
|
||||
return this.path.join(...paths);
|
||||
}
|
||||
|
||||
basename(path) {
|
||||
return this.path.basename(path);
|
||||
}
|
||||
|
||||
dirname(path) {
|
||||
return this.path.dirname(path);
|
||||
}
|
||||
|
||||
statSync(path, options) {
|
||||
return this.fs.statSync(path, options);
|
||||
}
|
||||
|
||||
readFileSync(path, options) {
|
||||
return this.fs.readFileSync(path, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.DefaultFileSystem = DefaultFileSystem;
|
||||
exports.VMFileSystem = VMFileSystem;
|
||||
@@ -0,0 +1,2 @@
|
||||
import { MemberExpression, Identifier } from 'estree';
|
||||
export declare function string_to_member_expression(name: string): Identifier | MemberExpression;
|
||||
@@ -0,0 +1,61 @@
|
||||
# path-key [](https://travis-ci.org/sindresorhus/path-key)
|
||||
|
||||
> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform
|
||||
|
||||
It's usually `PATH`, but on Windows it can be any casing like `Path`...
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install path-key
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const pathKey = require('path-key');
|
||||
|
||||
const key = pathKey();
|
||||
//=> 'PATH'
|
||||
|
||||
const PATH = process.env[key];
|
||||
//=> '/usr/local/bin:/usr/bin:/bin'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pathKey(options?)
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### env
|
||||
|
||||
Type: `object`<br>
|
||||
Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env)
|
||||
|
||||
Use a custom environment variables object.
|
||||
|
||||
#### platform
|
||||
|
||||
Type: `string`<br>
|
||||
Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform)
|
||||
|
||||
Get the PATH key for a specific platform.
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-path-key?utm_source=npm-path-key&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"Commands:": "Polecenia:",
|
||||
"Options:": "Opcje:",
|
||||
"Examples:": "Przykłady:",
|
||||
"boolean": "boolean",
|
||||
"count": "ilość",
|
||||
"string": "ciąg znaków",
|
||||
"number": "liczba",
|
||||
"array": "tablica",
|
||||
"required": "wymagany",
|
||||
"default": "domyślny",
|
||||
"default:": "domyślny:",
|
||||
"choices:": "dostępne:",
|
||||
"aliases:": "aliasy:",
|
||||
"generated-value": "wygenerowana-wartość",
|
||||
"Not enough non-option arguments: got %s, need at least %s": {
|
||||
"one": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s",
|
||||
"other": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s"
|
||||
},
|
||||
"Too many non-option arguments: got %s, maximum of %s": {
|
||||
"one": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s",
|
||||
"other": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s"
|
||||
},
|
||||
"Missing argument value: %s": {
|
||||
"one": "Brak wartości dla argumentu: %s",
|
||||
"other": "Brak wartości dla argumentów: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Brak wymaganego argumentu: %s",
|
||||
"other": "Brak wymaganych argumentów: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Nieznany argument: %s",
|
||||
"other": "Nieznane argumenty: %s"
|
||||
},
|
||||
"Invalid values:": "Nieprawidłowe wartości:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Otrzymano: %s, Dostępne: %s",
|
||||
"Argument check failed: %s": "Weryfikacja argumentów nie powiodła się: %s",
|
||||
"Implications failed:": "Założenia nie zostały spełnione:",
|
||||
"Not enough arguments following: %s": "Niewystarczająca ilość argumentów następujących po: %s",
|
||||
"Invalid JSON config file: %s": "Nieprawidłowy plik konfiguracyjny JSON: %s",
|
||||
"Path to JSON config file": "Ścieżka do pliku konfiguracyjnego JSON",
|
||||
"Show help": "Pokaż pomoc",
|
||||
"Show version number": "Pokaż numer wersji",
|
||||
"Did you mean %s?": "Czy chodziło Ci o %s?",
|
||||
"Arguments %s and %s are mutually exclusive": "Argumenty %s i %s wzajemnie się wykluczają",
|
||||
"Positionals:": "Pozycyjne:",
|
||||
"command": "polecenie"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* https://tc39.es/ecma402/#sec-getoptionsobject
|
||||
* @param options
|
||||
* @returns
|
||||
*/
|
||||
export function GetOptionsObject(options) {
|
||||
if (typeof options === 'undefined') {
|
||||
return Object.create(null);
|
||||
}
|
||||
if (typeof options === 'object') {
|
||||
return options;
|
||||
}
|
||||
throw new TypeError('Options must be an object');
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('cloneWith', require('../cloneWith'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -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.00406,"34":0.01218,"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.00406,"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.00406,"67":0,"68":0.00406,"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.00406,"98":0,"99":0.00406,"100":0,"101":0,"102":0.00812,"103":0,"104":0,"105":0,"106":0,"107":0.00812,"108":0.00406,"109":0.2273,"110":0.14207,"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.00406,"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.01218,"36":0,"37":0,"38":0,"39":0,"40":0.01218,"41":0,"42":0.00406,"43":0.04465,"44":0,"45":0,"46":0.01218,"47":0,"48":0,"49":0.00406,"50":0,"51":0,"52":0,"53":0.00406,"54":0,"55":0.0203,"56":0,"57":0,"58":0.01218,"59":0,"60":0,"61":0.00406,"62":0.00406,"63":0.00812,"64":0.00406,"65":0.00406,"66":0,"67":0,"68":0,"69":0.02435,"70":0.00812,"71":0,"72":0.00812,"73":0.00406,"74":0.04465,"75":0.00406,"76":0,"77":0.00406,"78":0,"79":0.01218,"80":0,"81":0.02435,"83":0.00812,"84":0.01218,"85":0,"86":0.00406,"87":0.04059,"88":0.00406,"89":0.01218,"90":0.00406,"91":0.00812,"92":0.00812,"93":0.00406,"94":0.00406,"95":0.00406,"96":0.00812,"97":0.01218,"98":0.00406,"99":0.00406,"100":0.01218,"101":0.01218,"102":0.01624,"103":0.03247,"104":0.00812,"105":0.01624,"106":0.02435,"107":0.05277,"108":0.0893,"109":3.39738,"110":1.64795,"111":0.00812,"112":0.00406,"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.00406,"27":0,"28":0,"29":0.00406,"30":0,"31":0,"32":0.00406,"33":0,"34":0,"35":0.00406,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0.00812,"55":0,"56":0,"57":0,"58":0.00812,"60":0.0203,"62":0,"63":0.02435,"64":0.01218,"65":0,"66":0.04465,"67":0.05277,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00406,"74":0.00406,"75":0,"76":0,"77":0,"78":0,"79":0.00406,"80":0,"81":0,"82":0,"83":0,"84":0.00406,"85":0.00812,"86":0,"87":0,"88":0,"89":0,"90":0.00406,"91":0.0203,"92":0,"93":0.00406,"94":0.13801,"95":0.28007,"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.00812,"13":0.00812,"14":0.0203,"15":0.03653,"16":0.00406,"17":0,"18":0.04059,"79":0,"80":0,"81":0,"83":0,"84":0.00812,"85":0,"86":0,"87":0,"88":0,"89":0.00406,"90":0.00812,"91":0,"92":0.01218,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0.01624,"102":0.00406,"103":0.00406,"104":0.00406,"105":0.00406,"106":0.00406,"107":0.04465,"108":0.05277,"109":0.49114,"110":0.61291},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.00406,"15":0,_:"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.00406,"12.1":0.00406,"13.1":0.01624,"14.1":0.0203,"15.1":0,"15.2-15.3":0,"15.4":0.00406,"15.5":0.00812,"15.6":0.05277,"16.0":0,"16.1":0.00406,"16.2":0.01218,"16.3":0.01624,"16.4":0},G:{"8":0.00471,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00314,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0.07697,"8.1-8.4":0.00628,"9.0-9.2":0.00314,"9.3":0.26705,"10.0-10.2":0.00314,"10.3":0.72103,"11.0-11.2":0.05969,"11.3-11.4":0.02199,"12.0-12.1":0.12724,"12.2-12.5":3.69468,"13.0-13.1":0.11467,"13.2":0.00943,"13.3":0.16023,"13.4-13.7":0.49168,"14.0-14.4":0.38329,"14.5-14.8":0.58436,"15.0-15.1":0.32831,"15.2-15.3":0.399,"15.4":0.40528,"15.5":0.70061,"15.6":0.84041,"16.0":0.77444,"16.1":1.01478,"16.2":1.19543,"16.3":0.81528,"16.4":0.00157},P:{"4":0.64851,"20":0.13173,"5.0-5.4":0.11146,"6.2-6.4":0.0608,"7.2-7.4":0.14186,"8.2":0.02027,"9.2":0.0304,"10.1":0.01013,"11.1-11.2":0.0304,"12.0":0.01013,"13.0":0.14186,"14.0":0.04053,"15.0":0.0304,"16.0":0.14186,"17.0":0.13173,"18.0":0.11146,"19.0":0.37492},I:{"0":0,"3":0,"4":0.00069,"2.1":0,"2.2":0,"2.3":0,"4.1":0.01486,"4.2-4.3":0.06878,"4.4":0,"4.4.3-4.4.4":0.16974},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.02841,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0.37428,_:"3.0-3.1"},J:{"7":0,"10":0.01782},O:{"0":0.60004},H:{"0":1.58612},L:{"0":70.90839},R:{_:"0"},M:{"0":0.11882},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,18 @@
|
||||
import util from './dist/util.js'
|
||||
|
||||
export const findPair = util.findPair
|
||||
export const toJSON = util.toJSON
|
||||
|
||||
export const parseMap = util.parseMap
|
||||
export const parseSeq = util.parseSeq
|
||||
|
||||
export const stringifyNumber = util.stringifyNumber
|
||||
export const stringifyString = util.stringifyString
|
||||
|
||||
export const Type = util.Type
|
||||
|
||||
export const YAMLError = util.YAMLError
|
||||
export const YAMLReferenceError = util.YAMLReferenceError
|
||||
export const YAMLSemanticError = util.YAMLSemanticError
|
||||
export const YAMLSyntaxError = util.YAMLSyntaxError
|
||||
export const YAMLWarning = util.YAMLWarning
|
||||
@@ -0,0 +1 @@
|
||||
export default function list(items: string[], conjunction?: string): string;
|
||||
@@ -0,0 +1,55 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
|
||||
var callBound = require('../callBound');
|
||||
|
||||
test('callBound', function (t) {
|
||||
// static primitive
|
||||
t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself');
|
||||
t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself');
|
||||
|
||||
// static non-function object
|
||||
t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself');
|
||||
t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself');
|
||||
t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself');
|
||||
t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself');
|
||||
|
||||
// static function
|
||||
t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself');
|
||||
t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself');
|
||||
|
||||
// prototype primitive
|
||||
t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself');
|
||||
t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself');
|
||||
|
||||
// prototype function
|
||||
t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself');
|
||||
t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself');
|
||||
t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original');
|
||||
t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original');
|
||||
|
||||
t['throws'](
|
||||
function () { callBound('does not exist'); },
|
||||
SyntaxError,
|
||||
'nonexistent intrinsic throws'
|
||||
);
|
||||
t['throws'](
|
||||
function () { callBound('does not exist', true); },
|
||||
SyntaxError,
|
||||
'allowMissing arg still throws for unknown intrinsic'
|
||||
);
|
||||
|
||||
/* globals WeakRef: false */
|
||||
t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) {
|
||||
st['throws'](
|
||||
function () { callBound('WeakRef'); },
|
||||
TypeError,
|
||||
'real but absent intrinsic throws'
|
||||
);
|
||||
st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1,28 @@
|
||||
var createCtor = require('./_createCtor'),
|
||||
root = require('./_root');
|
||||
|
||||
/** Used to compose bitmasks for function metadata. */
|
||||
var WRAP_BIND_FLAG = 1;
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke it with the optional `this`
|
||||
* binding of `thisArg`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
|
||||
* @param {*} [thisArg] The `this` binding of `func`.
|
||||
* @returns {Function} Returns the new wrapped function.
|
||||
*/
|
||||
function createBind(func, bitmask, thisArg) {
|
||||
var isBind = bitmask & WRAP_BIND_FLAG,
|
||||
Ctor = createCtor(func);
|
||||
|
||||
function wrapper() {
|
||||
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
|
||||
return fn.apply(isBind ? thisArg : this, arguments);
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
module.exports = createBind;
|
||||
@@ -0,0 +1,37 @@
|
||||
var copyObject = require('./_copyObject'),
|
||||
createAssigner = require('./_createAssigner'),
|
||||
keys = require('./keys');
|
||||
|
||||
/**
|
||||
* This method is like `_.assign` except that it accepts `customizer`
|
||||
* which is invoked to produce the assigned values. If `customizer` returns
|
||||
* `undefined`, assignment is handled by the method instead. The `customizer`
|
||||
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
||||
*
|
||||
* **Note:** This method mutates `object`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Object
|
||||
* @param {Object} object The destination object.
|
||||
* @param {...Object} sources The source objects.
|
||||
* @param {Function} [customizer] The function to customize assigned values.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.assignInWith
|
||||
* @example
|
||||
*
|
||||
* function customizer(objValue, srcValue) {
|
||||
* return _.isUndefined(objValue) ? srcValue : objValue;
|
||||
* }
|
||||
*
|
||||
* var defaults = _.partialRight(_.assignWith, customizer);
|
||||
*
|
||||
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
|
||||
* // => { 'a': 1, 'b': 2 }
|
||||
*/
|
||||
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
|
||||
copyObject(source, keys(source), object, customizer);
|
||||
});
|
||||
|
||||
module.exports = assignWith;
|
||||
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function isLeadingSurrogate(charCode) {
|
||||
return typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"has-proto","version":"1.0.1","files":{".eslintrc":{"checkedAt":1678883671576,"integrity":"sha512-4+yheARSL/pPQeg25245ejEKIOgmGjgRW2fotkREQVMDnQQZj7Rw9FvimX0senKxW9R3GgLHQbPLwHLqbvQy6Q==","mode":420,"size":43},"LICENSE":{"checkedAt":1678883669576,"integrity":"sha512-16Lw2sQpq8QINLGIfL/+xkhzMDKK7+1KhO0tqPzWh6SJx+JcmBuZ7w7FwLce+/bDBInYIE8pUEWvqkiN2Y1kTg==","mode":420,"size":1067},"index.js":{"checkedAt":1678883671647,"integrity":"sha512-7WWnG52qGnSp2RaYZi7iVwqP+vAqkyA73RSO9nXkl599khfXzGR0g/jEDRtOARsuLlHEaRj4Kl2wgguslBTTqg==","mode":420,"size":197},"test/index.js":{"checkedAt":1678883671647,"integrity":"sha512-E28qM2Pu6DSamp8ZXjrAuR+W58595TdiIisiZRU1KLk6hyUvv49HVvgGeZbPamptMZ3nI14YRlLc7xN0KCFblw==","mode":420,"size":477},"package.json":{"checkedAt":1678883671647,"integrity":"sha512-M1davQmIzlmolA/pD1OAnmW4OS91Z5BUvqi2dwo+x6zOM7bQV7wT3UPBsUhnDFCgbLEvSWO0zYMmFqOkf5kpag==","mode":420,"size":1904},"README.md":{"checkedAt":1678883671647,"integrity":"sha512-H54KK0XEkFw4tKApk7Dm6Hf2goAhVv+Tj4k+gjs0zYVrTOhWNTngsHaK2TnvZ5ne6AuiBrE+AihZAPnmrk/Xdg==","mode":420,"size":1623},"CHANGELOG.md":{"checkedAt":1678883671647,"integrity":"sha512-O0MBLgOWHq+HRFmJxc1fvGPAlwzq8h0gQb5eTcwEOw/aed2dF8+lQvD7rNx7WVLAr2F3bwoW6QsSmVjv4jdcfw==","mode":420,"size":1304},".github/FUNDING.yml":{"checkedAt":1678883671647,"integrity":"sha512-55T45wDpjQugigL2F+WcN919ezyBZ2bui1/3/yD52ZWHl4m4gyeahCc5gCULEeiUJoPbASrsXLHIuPUxEZReuQ==","mode":420,"size":580}}}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"skipLast.js","sourceRoot":"","sources":["../../../../src/internal/operators/skipLast.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA4ChE,MAAM,UAAU,QAAQ,CAAI,SAAiB;IAC3C,OAAO,SAAS,IAAI,CAAC;QACnB,CAAC;YACC,QAAQ;QACV,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;YAI7B,IAAI,IAAI,GAAQ,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;YAGrC,IAAI,IAAI,GAAG,CAAC,CAAC;YACb,MAAM,CAAC,SAAS,CACd,wBAAwB,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;gBAK7C,MAAM,UAAU,GAAG,IAAI,EAAE,CAAC;gBAC1B,IAAI,UAAU,GAAG,SAAS,EAAE;oBAI1B,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;iBAC1B;qBAAM;oBAIL,MAAM,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;oBAGrC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;oBAC7B,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;oBAKpB,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAC3B;YACH,CAAC,CAAC,CACH,CAAC;YAEF,OAAO,GAAG,EAAE;gBAEV,IAAI,GAAG,IAAK,CAAC;YACf,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;AACT,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","2":"CC","8":"J D E"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"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 FC","132":"DC tB EC"},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":"I v J D E F A B C K L G IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","132":"HC zB"},F:{"1":"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:{"1":"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:{"260":"oC"},I:{"1":"tB I f sC BC tC uC","132":"pC qC rC"},J:{"1":"D A"},K:{"1":"A B C h qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"1":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:1,C:"Canvas (basic support)"};
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Algorithmic validation functions
|
||||
* May be used as is or implemented in the workflow of other validators.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ISO 7064 validation function
|
||||
* Called with a string of numbers (incl. check digit)
|
||||
* to validate according to ISO 7064 (MOD 11, 10).
|
||||
*/
|
||||
export function iso7064Check(str) {
|
||||
var checkvalue = 10;
|
||||
|
||||
for (var i = 0; i < str.length - 1; i++) {
|
||||
checkvalue = (parseInt(str[i], 10) + checkvalue) % 10 === 0 ? 10 * 2 % 11 : (parseInt(str[i], 10) + checkvalue) % 10 * 2 % 11;
|
||||
}
|
||||
|
||||
checkvalue = checkvalue === 1 ? 0 : 11 - checkvalue;
|
||||
return checkvalue === parseInt(str[10], 10);
|
||||
}
|
||||
/*
|
||||
* Luhn (mod 10) validation function
|
||||
* Called with a string of numbers (incl. check digit)
|
||||
* to validate according to the Luhn algorithm.
|
||||
*/
|
||||
|
||||
export function luhnCheck(str) {
|
||||
var checksum = 0;
|
||||
var second = false;
|
||||
|
||||
for (var i = str.length - 1; i >= 0; i--) {
|
||||
if (second) {
|
||||
var product = parseInt(str[i], 10) * 2;
|
||||
|
||||
if (product > 9) {
|
||||
// sum digits of product and add to checksum
|
||||
checksum += product.toString().split('').map(function (a) {
|
||||
return parseInt(a, 10);
|
||||
}).reduce(function (a, b) {
|
||||
return a + b;
|
||||
}, 0);
|
||||
} else {
|
||||
checksum += product;
|
||||
}
|
||||
} else {
|
||||
checksum += parseInt(str[i], 10);
|
||||
}
|
||||
|
||||
second = !second;
|
||||
}
|
||||
|
||||
return checksum % 10 === 0;
|
||||
}
|
||||
/*
|
||||
* Reverse TIN multiplication and summation helper function
|
||||
* Called with an array of single-digit integers and a base multiplier
|
||||
* to calculate the sum of the digits multiplied in reverse.
|
||||
* Normally used in variations of MOD 11 algorithmic checks.
|
||||
*/
|
||||
|
||||
export function reverseMultiplyAndSum(digits, base) {
|
||||
var total = 0;
|
||||
|
||||
for (var i = 0; i < digits.length; i++) {
|
||||
total += digits[i] * (base - i);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
/*
|
||||
* Verhoeff validation helper function
|
||||
* Called with a string of numbers
|
||||
* to validate according to the Verhoeff algorithm.
|
||||
*/
|
||||
|
||||
export function verhoeffCheck(str) {
|
||||
var d_table = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]];
|
||||
var p_table = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 5, 7, 6, 2, 8, 3, 0, 9, 4], [5, 8, 0, 3, 7, 9, 6, 1, 4, 2], [8, 9, 1, 6, 0, 4, 3, 5, 2, 7], [9, 4, 5, 3, 1, 2, 6, 8, 7, 0], [4, 2, 8, 6, 5, 7, 3, 9, 0, 1], [2, 7, 9, 3, 8, 0, 6, 4, 1, 5], [7, 0, 4, 6, 9, 1, 3, 2, 5, 8]]; // Copy (to prevent replacement) and reverse
|
||||
|
||||
var str_copy = str.split('').reverse().join('');
|
||||
var checksum = 0;
|
||||
|
||||
for (var i = 0; i < str_copy.length; i++) {
|
||||
checksum = d_table[checksum][p_table[i % 8][parseInt(str_copy[i], 10)]];
|
||||
}
|
||||
|
||||
return checksum === 0;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
# color-convert
|
||||
|
||||
[](https://travis-ci.org/Qix-/color-convert)
|
||||
|
||||
Color-convert is a color conversion library for JavaScript and node.
|
||||
It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest):
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
convert.rgb.hsl(140, 200, 100); // [96, 48, 59]
|
||||
convert.keyword.rgb('blue'); // [0, 0, 255]
|
||||
|
||||
var rgbChannels = convert.rgb.channels; // 3
|
||||
var cmykChannels = convert.cmyk.channels; // 4
|
||||
var ansiChannels = convert.ansi16.channels; // 1
|
||||
```
|
||||
|
||||
# Install
|
||||
|
||||
```console
|
||||
$ npm install color-convert
|
||||
```
|
||||
|
||||
# API
|
||||
|
||||
Simply get the property of the _from_ and _to_ conversion that you're looking for.
|
||||
|
||||
All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function.
|
||||
|
||||
All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha).
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
// Hex to LAB
|
||||
convert.hex.lab('DEADBF'); // [ 76, 21, -2 ]
|
||||
convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ]
|
||||
|
||||
// RGB to CMYK
|
||||
convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ]
|
||||
convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ]
|
||||
```
|
||||
|
||||
### Arrays
|
||||
All functions that accept multiple arguments also support passing an array.
|
||||
|
||||
Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
convert.rgb.hex(123, 45, 67); // '7B2D43'
|
||||
convert.rgb.hex([123, 45, 67]); // '7B2D43'
|
||||
```
|
||||
|
||||
## Routing
|
||||
|
||||
Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex).
|
||||
|
||||
Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js).
|
||||
|
||||
# Contribute
|
||||
|
||||
If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request.
|
||||
|
||||
# License
|
||||
Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE).
|
||||
@@ -0,0 +1,25 @@
|
||||
var defineProperty = require('./_defineProperty');
|
||||
|
||||
/**
|
||||
* The base implementation of `assignValue` and `assignMergeValue` without
|
||||
* value checks.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to modify.
|
||||
* @param {string} key The key of the property to assign.
|
||||
* @param {*} value The value to assign.
|
||||
*/
|
||||
function baseAssignValue(object, key, value) {
|
||||
if (key == '__proto__' && defineProperty) {
|
||||
defineProperty(object, key, {
|
||||
'configurable': true,
|
||||
'enumerable': true,
|
||||
'value': value,
|
||||
'writable': true
|
||||
});
|
||||
} else {
|
||||
object[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = baseAssignValue;
|
||||
@@ -0,0 +1,90 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $Number = GetIntrinsic('%Number%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var $isNaN = require('../helpers/isNaN');
|
||||
|
||||
var IsStringPrefix = require('./IsStringPrefix');
|
||||
var StringToBigInt = require('./StringToBigInt');
|
||||
var ToNumeric = require('./ToNumeric');
|
||||
var ToPrimitive = require('./ToPrimitive');
|
||||
var Type = require('./Type');
|
||||
|
||||
var BigIntLessThan = require('./BigInt/lessThan');
|
||||
var NumberLessThan = require('./Number/lessThan');
|
||||
|
||||
// https://262.ecma-international.org/13.0/#sec-islessthan
|
||||
|
||||
// eslint-disable-next-line max-statements, max-lines-per-function
|
||||
module.exports = function IsLessThan(x, y, LeftFirst) {
|
||||
if (Type(LeftFirst) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean');
|
||||
}
|
||||
var px;
|
||||
var py;
|
||||
if (LeftFirst) {
|
||||
px = ToPrimitive(x, $Number);
|
||||
py = ToPrimitive(y, $Number);
|
||||
} else {
|
||||
py = ToPrimitive(y, $Number);
|
||||
px = ToPrimitive(x, $Number);
|
||||
}
|
||||
var pxType = Type(px);
|
||||
var pyType = Type(py);
|
||||
if (pxType === 'String' && pyType === 'String') {
|
||||
if (IsStringPrefix(py, px)) {
|
||||
return false;
|
||||
}
|
||||
if (IsStringPrefix(px, py)) {
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
c. Let k be the smallest non-negative integer such that the code unit at index k within px is different from the code unit at index k within py. (There must be such a k, for neither String is a prefix of the other.)
|
||||
d. Let m be the integer that is the numeric value of the code unit at index k within px.
|
||||
e. Let n be the integer that is the numeric value of the code unit at index k within py.
|
||||
f. If m < n, return true. Otherwise, return false.
|
||||
*/
|
||||
return px < py; // both strings, neither a prefix of the other. shortcut for steps 3 c-f
|
||||
}
|
||||
|
||||
var nx;
|
||||
var ny;
|
||||
if (pxType === 'BigInt' && pyType === 'String') {
|
||||
ny = StringToBigInt(py);
|
||||
if (typeof ny === 'undefined') {
|
||||
return void undefined;
|
||||
}
|
||||
return BigIntLessThan(px, ny);
|
||||
}
|
||||
if (pxType === 'String' && pyType === 'BigInt') {
|
||||
nx = StringToBigInt(px);
|
||||
if (typeof nx === 'undefined') {
|
||||
return void undefined;
|
||||
}
|
||||
return BigIntLessThan(nx, py);
|
||||
}
|
||||
|
||||
nx = ToNumeric(px);
|
||||
ny = ToNumeric(py);
|
||||
|
||||
var nxType = Type(nx);
|
||||
if (nxType === Type(ny)) {
|
||||
return nxType === 'Number' ? NumberLessThan(nx, ny) : BigIntLessThan(nx, ny);
|
||||
}
|
||||
|
||||
if ($isNaN(nx) || $isNaN(ny)) {
|
||||
return void undefined;
|
||||
}
|
||||
|
||||
if (nx === -Infinity || ny === Infinity) {
|
||||
return true;
|
||||
}
|
||||
if (nx === Infinity || ny === -Infinity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return nx < ny; // by now, these are both finite, and the same type
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,60 @@
|
||||
import { EmptyError } from '../util/EmptyError';
|
||||
import { MonoTypeOperatorFunction } from '../types';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
|
||||
/**
|
||||
* If the source observable completes without emitting a value, it will emit
|
||||
* an error. The error will be created at that time by the optional
|
||||
* `errorFactory` argument, otherwise, the error will be {@link EmptyError}.
|
||||
*
|
||||
* 
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Throw an error if the document wasn't clicked within 1 second
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, takeUntil, timer, throwIfEmpty } from 'rxjs';
|
||||
*
|
||||
* const click$ = fromEvent(document, 'click');
|
||||
*
|
||||
* click$.pipe(
|
||||
* takeUntil(timer(1000)),
|
||||
* throwIfEmpty(() => new Error('The document was not clicked within 1 second'))
|
||||
* )
|
||||
* .subscribe({
|
||||
* next() {
|
||||
* console.log('The document was clicked');
|
||||
* },
|
||||
* error(err) {
|
||||
* console.error(err.message);
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param errorFactory A factory function called to produce the
|
||||
* error to be thrown when the source observable completes without emitting a
|
||||
* value.
|
||||
* @return A function that returns an Observable that throws an error if the
|
||||
* source Observable completed without emitting.
|
||||
*/
|
||||
export function throwIfEmpty<T>(errorFactory: () => any = defaultErrorFactory): MonoTypeOperatorFunction<T> {
|
||||
return operate((source, subscriber) => {
|
||||
let hasValue = false;
|
||||
source.subscribe(
|
||||
createOperatorSubscriber(
|
||||
subscriber,
|
||||
(value) => {
|
||||
hasValue = true;
|
||||
subscriber.next(value);
|
||||
},
|
||||
() => (hasValue ? subscriber.complete() : subscriber.error(errorFactory()))
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function defaultErrorFactory() {
|
||||
return new EmptyError();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('gte', require('../gte'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var hasBigInts = require('..');
|
||||
|
||||
test('interface', function (t) {
|
||||
t.equal(typeof hasBigInts, 'function', 'is a function');
|
||||
t.equal(typeof hasBigInts(), 'boolean', 'returns a boolean');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('BigInts are supported', { skip: !hasBigInts() }, function (t) {
|
||||
t.equal(typeof BigInt, 'function', 'global BigInt is a function');
|
||||
if (typeof BigInt !== 'function') {
|
||||
return;
|
||||
}
|
||||
|
||||
t.equal(BigInt(42), BigInt(42), '42n === 42n');
|
||||
t['throws'](
|
||||
function () { BigInt(NaN); },
|
||||
RangeError,
|
||||
'NaN is not an integer; BigInt(NaN) throws'
|
||||
);
|
||||
|
||||
t['throws'](
|
||||
function () { BigInt(Infinity); },
|
||||
RangeError,
|
||||
'Infinity is not an integer; BigInt(Infinity) throws'
|
||||
);
|
||||
|
||||
t['throws'](
|
||||
function () { BigInt(1.1); },
|
||||
RangeError,
|
||||
'1.1 is not an integer; BigInt(1.1) throws'
|
||||
);
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('BigInts are not supported', { skip: hasBigInts() }, function (t) {
|
||||
t.equal(typeof BigInt, 'undefined', 'global BigInt is undefined');
|
||||
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
export { default as DataHandler } from '../DataHandler';
|
||||
export { default as Datatable } from '../Datatable.svelte';
|
||||
export { default as Pagination } from '../Pagination.svelte';
|
||||
export { default as RowCount } from '../RowCount.svelte';
|
||||
export { default as RowsPerPage } from '../RowsPerPage.svelte';
|
||||
export { default as Search } from '../Search.svelte';
|
||||
export { default as Th } from '../Th.svelte';
|
||||
export { default as ThFilter } from '../ThFilter.svelte';
|
||||
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
var isWindows = process.platform === 'win32';
|
||||
var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
|
||||
|
||||
// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
|
||||
module.exports = function () {
|
||||
var path;
|
||||
|
||||
if (isWindows) {
|
||||
path = process.env.TEMP ||
|
||||
process.env.TMP ||
|
||||
(process.env.SystemRoot || process.env.windir) + '\\temp';
|
||||
} else {
|
||||
path = process.env.TMPDIR ||
|
||||
process.env.TMP ||
|
||||
process.env.TEMP ||
|
||||
'/tmp';
|
||||
}
|
||||
|
||||
if (trailingSlashRe.test(path)) {
|
||||
path = path.slice(0, -1);
|
||||
}
|
||||
|
||||
return path;
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $ObjectCreate = GetIntrinsic('%Object.create%', true);
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
||||
|
||||
var IsArray = require('./IsArray');
|
||||
var Type = require('./Type');
|
||||
|
||||
var forEach = require('../helpers/forEach');
|
||||
|
||||
var SLOT = require('internal-slot');
|
||||
|
||||
var hasProto = require('has-proto')();
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-objectcreate
|
||||
|
||||
module.exports = function ObjectCreate(proto, internalSlotsList) {
|
||||
if (proto !== null && Type(proto) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: `proto` must be null or an object');
|
||||
}
|
||||
var slots = arguments.length < 2 ? [] : internalSlotsList; // step 1
|
||||
if (arguments.length >= 2 && !IsArray(slots)) {
|
||||
throw new $TypeError('Assertion failed: `internalSlotsList` must be an Array');
|
||||
}
|
||||
|
||||
var O;
|
||||
if ($ObjectCreate) {
|
||||
O = $ObjectCreate(proto);
|
||||
} else if (hasProto) {
|
||||
O = { __proto__: proto };
|
||||
} else {
|
||||
if (proto === null) {
|
||||
throw new $SyntaxError('native Object.create support is required to create null objects');
|
||||
}
|
||||
var T = function T() {};
|
||||
T.prototype = proto;
|
||||
O = new T();
|
||||
}
|
||||
|
||||
if (slots.length > 0) {
|
||||
forEach(slots, function (slot) {
|
||||
SLOT.set(O, slot, void undefined);
|
||||
});
|
||||
}
|
||||
|
||||
return O; // step 6
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
# function.prototype.name <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
[![dependency status][5]][6]
|
||||
[![dev dependency status][7]][8]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][11]][1]
|
||||
|
||||
An ES2015 spec-compliant `Function.prototype.name` shim. Invoke its "shim" method to shim Function.prototype.name if it is unavailable.
|
||||
*Note*: `Function#name` requires a true ES5 environment - specifically, one with ES5 getters.
|
||||
|
||||
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES5-supported environment and complies with the [spec](https://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.flags).
|
||||
|
||||
Most common usage:
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var functionName = require('function.prototype.name');
|
||||
var assert = require('assert');
|
||||
|
||||
assert.equal(functionName(function foo() {}), 'foo');
|
||||
|
||||
functionName.shim();
|
||||
assert.equal(function foo() {}.name, 'foo');
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[1]: https://npmjs.org/package/function.prototype.name
|
||||
[2]: https://versionbadg.es/es-shims/Function.prototype.name.svg
|
||||
[5]: https://david-dm.org/es-shims/Function.prototype.name.svg
|
||||
[6]: https://david-dm.org/es-shims/Function.prototype.name
|
||||
[7]: https://david-dm.org/es-shims/Function.prototype.name/dev-status.svg
|
||||
[8]: https://david-dm.org/es-shims/Function.prototype.name#info=devDependencies
|
||||
[11]: https://nodei.co/npm/function.prototype.name.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/function.prototype.name.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/function.prototype.name.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=function.prototype.name
|
||||
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
var toPosInt = require("../../number/to-pos-integer")
|
||||
, value = require("../../object/valid-value")
|
||||
, objHasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
module.exports = function () {
|
||||
var i, length;
|
||||
if (!(length = toPosInt(value(this).length))) return null;
|
||||
i = length - 1;
|
||||
while (!objHasOwnProperty.call(this, i)) {
|
||||
if (--i === -1) return null;
|
||||
}
|
||||
return i;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mergeInternals.js","sourceRoot":"","sources":["../../../../src/internal/operators/mergeInternals.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAehE,MAAM,UAAU,cAAc,CAC5B,MAAqB,EACrB,UAAyB,EACzB,OAAwD,EACxD,UAAkB,EAClB,YAAsC,EACtC,MAAgB,EAChB,iBAAiC,EACjC,mBAAgC;IAGhC,MAAM,MAAM,GAAQ,EAAE,CAAC;IAEvB,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,IAAI,UAAU,GAAG,KAAK,CAAC;IAKvB,MAAM,aAAa,GAAG,GAAG,EAAE;QAIzB,IAAI,UAAU,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE;YAC3C,UAAU,CAAC,QAAQ,EAAE,CAAC;SACvB;IACH,CAAC,CAAC;IAGF,MAAM,SAAS,GAAG,CAAC,KAAQ,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAE/F,MAAM,UAAU,GAAG,CAAC,KAAQ,EAAE,EAAE;QAI9B,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,KAAY,CAAC,CAAC;QAIxC,MAAM,EAAE,CAAC;QAKT,IAAI,aAAa,GAAG,KAAK,CAAC;QAG1B,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAC1C,wBAAwB,CACtB,UAAU,EACV,CAAC,UAAU,EAAE,EAAE;YAGb,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,UAAU,CAAC,CAAC;YAE3B,IAAI,MAAM,EAAE;gBAGV,SAAS,CAAC,UAAiB,CAAC,CAAC;aAC9B;iBAAM;gBAEL,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aAC7B;QACH,CAAC,EACD,GAAG,EAAE;YAGH,aAAa,GAAG,IAAI,CAAC;QACvB,CAAC,EAED,SAAS,EACT,GAAG,EAAE;YAIH,IAAI,aAAa,EAAE;gBAKjB,IAAI;oBAIF,MAAM,EAAE,CAAC;oBAKT,OAAO,MAAM,CAAC,MAAM,IAAI,MAAM,GAAG,UAAU,EAAE;wBAC3C,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,EAAG,CAAC;wBAItC,IAAI,iBAAiB,EAAE;4BACrB,eAAe,CAAC,UAAU,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;yBACjF;6BAAM;4BACL,UAAU,CAAC,aAAa,CAAC,CAAC;yBAC3B;qBACF;oBAED,aAAa,EAAE,CAAC;iBACjB;gBAAC,OAAO,GAAG,EAAE;oBACZ,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;iBACvB;aACF;QACH,CAAC,CACF,CACF,CAAC;IACJ,CAAC,CAAC;IAGF,MAAM,CAAC,SAAS,CACd,wBAAwB,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,EAAE;QAEnD,UAAU,GAAG,IAAI,CAAC;QAClB,aAAa,EAAE,CAAC;IAClB,CAAC,CAAC,CACH,CAAC;IAIF,OAAO,GAAG,EAAE;QACV,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,EAAI,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC"}
|
||||
@@ -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.00553,"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.00553,"49":0,"50":0.00553,"51":0,"52":0.01658,"53":0,"54":0,"55":0.01105,"56":0,"57":0.00553,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0.00553,"67":0,"68":0,"69":0,"70":0,"71":0.00553,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.04422,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0.00553,"89":0.00553,"90":0,"91":0.02211,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0.01105,"99":0.00553,"100":0.00553,"101":0.00553,"102":0.17686,"103":0.00553,"104":0.00553,"105":0.01658,"106":0.01658,"107":0.02764,"108":0.32609,"109":2.34345,"110":1.64705,"111":0.01658,"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.00553,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.01658,"50":0,"51":0.00553,"52":0.28188,"53":0.00553,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0.01658,"61":0,"62":0,"63":0,"64":0,"65":0.01105,"66":0.04422,"67":0.01105,"68":0.01105,"69":0,"70":0,"71":0,"72":0.00553,"73":0,"74":0.00553,"75":0,"76":0,"77":0.00553,"78":0.01105,"79":0.10501,"80":0.01105,"81":0.01105,"83":0.01105,"84":0.03316,"85":0.03316,"86":0.01658,"87":0.05527,"88":0.00553,"89":0.01105,"90":0.00553,"91":0.00553,"92":0.03316,"93":0.00553,"94":0.00553,"95":0.00553,"96":0.00553,"97":0.00553,"98":0.01105,"99":0.02211,"100":0.02764,"101":0.03316,"102":0.38136,"103":0.29293,"104":0.03316,"105":0.03869,"106":0.04422,"107":0.08843,"108":0.46427,"109":6.51633,"110":4.2779,"111":0.00553,"112":0.00553,"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,"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.00553,"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.00553,"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.0608,"94":0.57481,"95":0.35373,"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.00553,"16":0.00553,"17":0,"18":0.00553,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0.00553,"91":0,"92":0.00553,"93":0,"94":0,"95":0,"96":0.00553,"97":0.00553,"98":0,"99":0.01105,"100":0.00553,"101":0.00553,"102":0,"103":0.00553,"104":0.00553,"105":0.00553,"106":0.01105,"107":0.02764,"108":0.22661,"109":2.31029,"110":2.84641},E:{"4":0,"5":0,"6":0,"7":0.00553,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.02211,"14":0.10501,"15":0.02764,_:"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.00553,"12.1":0.08843,"13.1":0.25977,"14.1":0.39242,"15.1":0.04974,"15.2-15.3":0.0608,"15.4":0.12712,"15.5":0.21555,"15.6":0.99486,"16.0":0.14923,"16.1":0.38136,"16.2":1.17725,"16.3":0.96723,"16.4":0.00553},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,"8.1-8.4":0.0082,"9.0-9.2":0.46334,"9.3":0.19272,"10.0-10.2":0,"10.3":0.12711,"11.0-11.2":0.0164,"11.3-11.4":0.12301,"12.0-12.1":0.0246,"12.2-12.5":0.56995,"13.0-13.1":0.0082,"13.2":0.0041,"13.3":0.0328,"13.4-13.7":0.16401,"14.0-14.4":0.38543,"14.5-14.8":0.95948,"15.0-15.1":0.25422,"15.2-15.3":0.40594,"15.4":0.45924,"15.5":1.07019,"15.6":3.84614,"16.0":4.70311,"16.1":9.84496,"16.2":10.04178,"16.3":5.62159,"16.4":0.0205},P:{"4":0.09314,"20":1.34538,"5.0-5.4":0.0207,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0.0207,"10.1":0,"11.1-11.2":0,"12.0":0.01035,"13.0":0.0207,"14.0":0.0207,"15.0":0.01035,"16.0":0.0207,"17.0":0.05175,"18.0":0.08279,"19.0":2.16295},I:{"0":0,"3":0,"4":0.00555,"2.1":0,"2.2":0,"2.3":0.01665,"4.1":0.0111,"4.2-4.3":0.01388,"4.4":0,"4.4.3-4.4.4":0.06939},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.00599,"9":0.01796,"10":0,"11":0.11975,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0.00447},O:{"0":0.05815},H:{"0":0.21597},L:{"0":23.17659},R:{_:"0"},M:{"0":0.74252},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { PipelineProcessor, ProcessorType } from '../processor';
|
||||
import Tabular from '../../tabular';
|
||||
import { ArrayResponse } from './storageResponseToArray';
|
||||
declare class ArrayToTabularTransformer extends PipelineProcessor<Tabular, {}> {
|
||||
get type(): ProcessorType;
|
||||
_process(arrayResponse: ArrayResponse): Tabular;
|
||||
}
|
||||
export default ArrayToTabularTransformer;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"A B","260":"J D E F CC"},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 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","132":"B","260":"DC tB I v J D EC FC","516":"E F A"},D:{"1":"7 8 9 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","132":"0 1 2 3 4 5 6 I v J D E F A B C K L G M N O w g x y z"},E:{"1":"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","132":"I v J D HC zB IC JC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 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","16":"F PC","132":"B C G M N QC RC SC qB AC TC rB"},G:{"1":"E 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","132":"zB UC BC VC WC XC"},H:{"132":"oC"},I:{"1":"f tC uC","132":"tB I pC qC rC sC BC"},J:{"132":"D A"},K:{"1":"h","16":"A","132":"B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"1":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:4,C:"DOM Parsing and Serialization"};
|
||||
@@ -0,0 +1,66 @@
|
||||
/// <reference types="node" />
|
||||
import { SmartBuffer } from './smartbuffer';
|
||||
import { Buffer } from 'buffer';
|
||||
/**
|
||||
* Error strings
|
||||
*/
|
||||
declare const ERRORS: {
|
||||
INVALID_ENCODING: string;
|
||||
INVALID_SMARTBUFFER_SIZE: string;
|
||||
INVALID_SMARTBUFFER_BUFFER: string;
|
||||
INVALID_SMARTBUFFER_OBJECT: string;
|
||||
INVALID_OFFSET: string;
|
||||
INVALID_OFFSET_NON_NUMBER: string;
|
||||
INVALID_LENGTH: string;
|
||||
INVALID_LENGTH_NON_NUMBER: string;
|
||||
INVALID_TARGET_OFFSET: string;
|
||||
INVALID_TARGET_LENGTH: string;
|
||||
INVALID_READ_BEYOND_BOUNDS: string;
|
||||
INVALID_WRITE_BEYOND_BOUNDS: string;
|
||||
};
|
||||
/**
|
||||
* Checks if a given encoding is a valid Buffer encoding. (Throws an exception if check fails)
|
||||
*
|
||||
* @param { String } encoding The encoding string to check.
|
||||
*/
|
||||
declare function checkEncoding(encoding: BufferEncoding): void;
|
||||
/**
|
||||
* Checks if a given number is a finite integer. (Throws an exception if check fails)
|
||||
*
|
||||
* @param { Number } value The number value to check.
|
||||
*/
|
||||
declare function isFiniteInteger(value: number): boolean;
|
||||
/**
|
||||
* Checks if a length value is valid. (Throws an exception if check fails)
|
||||
*
|
||||
* @param { Number } length The value to check.
|
||||
*/
|
||||
declare function checkLengthValue(length: any): void;
|
||||
/**
|
||||
* Checks if a offset value is valid. (Throws an exception if check fails)
|
||||
*
|
||||
* @param { Number } offset The value to check.
|
||||
*/
|
||||
declare function checkOffsetValue(offset: any): void;
|
||||
/**
|
||||
* Checks if a target offset value is out of bounds. (Throws an exception if check fails)
|
||||
*
|
||||
* @param { Number } offset The offset value to check.
|
||||
* @param { SmartBuffer } buff The SmartBuffer instance to check against.
|
||||
*/
|
||||
declare function checkTargetOffset(offset: number, buff: SmartBuffer): void;
|
||||
interface Buffer {
|
||||
readBigInt64BE(offset?: number): bigint;
|
||||
readBigInt64LE(offset?: number): bigint;
|
||||
readBigUInt64BE(offset?: number): bigint;
|
||||
readBigUInt64LE(offset?: number): bigint;
|
||||
writeBigInt64BE(value: bigint, offset?: number): number;
|
||||
writeBigInt64LE(value: bigint, offset?: number): number;
|
||||
writeBigUInt64BE(value: bigint, offset?: number): number;
|
||||
writeBigUInt64LE(value: bigint, offset?: number): number;
|
||||
}
|
||||
/**
|
||||
* Throws if Node.js version is too low to support bigint
|
||||
*/
|
||||
declare function bigIntAndBufferInt64Check(bufferMethod: keyof Buffer): void;
|
||||
export { ERRORS, isFiniteInteger, checkEncoding, checkOffsetValue, checkLengthValue, checkTargetOffset, bigIntAndBufferInt64Check };
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CanonicalizeLocaleList.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-localematcher/abstract/CanonicalizeLocaleList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAG5E"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CanonicalizeLocaleList.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/CanonicalizeLocaleList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAG5E"}
|
||||
@@ -0,0 +1,10 @@
|
||||
declare namespace ieee754 {
|
||||
export function read(
|
||||
buffer: Uint8Array, offset: number, isLE: boolean, mLen: number,
|
||||
nBytes: number): number;
|
||||
export function write(
|
||||
buffer: Uint8Array, value: number, offset: number, isLE: boolean,
|
||||
mLen: number, nBytes: number): void;
|
||||
}
|
||||
|
||||
export = ieee754;
|
||||
Reference in New Issue
Block a user