new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
var concatMap = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('empty or not', function (t) {
|
||||
var xs = [ 1, 2, 3, 4, 5, 6 ];
|
||||
var ixes = [];
|
||||
var ys = concatMap(xs, function (x, ix) {
|
||||
ixes.push(ix);
|
||||
return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
|
||||
});
|
||||
t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]);
|
||||
t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('always something', function (t) {
|
||||
var xs = [ 'a', 'b', 'c', 'd' ];
|
||||
var ys = concatMap(xs, function (x) {
|
||||
return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ];
|
||||
});
|
||||
t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('scalars', function (t) {
|
||||
var xs = [ 'a', 'b', 'c', 'd' ];
|
||||
var ys = concatMap(xs, function (x) {
|
||||
return x === 'b' ? [ 'B', 'B', 'B' ] : x;
|
||||
});
|
||||
t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('undefs', function (t) {
|
||||
var xs = [ 'a', 'b', 'c', 'd' ];
|
||||
var ys = concatMap(xs, function () {});
|
||||
t.same(ys, [ undefined, undefined, undefined, undefined ]);
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1,89 @@
|
||||
import { AsyncAction } from './AsyncAction';
|
||||
import { Subscription } from '../Subscription';
|
||||
import { AsyncScheduler } from './AsyncScheduler';
|
||||
export class VirtualTimeScheduler extends AsyncScheduler {
|
||||
constructor(schedulerActionCtor = VirtualAction, maxFrames = Infinity) {
|
||||
super(schedulerActionCtor, () => this.frame);
|
||||
this.maxFrames = maxFrames;
|
||||
this.frame = 0;
|
||||
this.index = -1;
|
||||
}
|
||||
flush() {
|
||||
const { actions, maxFrames } = this;
|
||||
let error;
|
||||
let action;
|
||||
while ((action = actions[0]) && action.delay <= maxFrames) {
|
||||
actions.shift();
|
||||
this.frame = action.delay;
|
||||
if ((error = action.execute(action.state, action.delay))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (error) {
|
||||
while ((action = actions.shift())) {
|
||||
action.unsubscribe();
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
VirtualTimeScheduler.frameTimeFactor = 10;
|
||||
export class VirtualAction extends AsyncAction {
|
||||
constructor(scheduler, work, index = (scheduler.index += 1)) {
|
||||
super(scheduler, work);
|
||||
this.scheduler = scheduler;
|
||||
this.work = work;
|
||||
this.index = index;
|
||||
this.active = true;
|
||||
this.index = scheduler.index = index;
|
||||
}
|
||||
schedule(state, delay = 0) {
|
||||
if (Number.isFinite(delay)) {
|
||||
if (!this.id) {
|
||||
return super.schedule(state, delay);
|
||||
}
|
||||
this.active = false;
|
||||
const action = new VirtualAction(this.scheduler, this.work);
|
||||
this.add(action);
|
||||
return action.schedule(state, delay);
|
||||
}
|
||||
else {
|
||||
return Subscription.EMPTY;
|
||||
}
|
||||
}
|
||||
requestAsyncId(scheduler, id, delay = 0) {
|
||||
this.delay = scheduler.frame + delay;
|
||||
const { actions } = scheduler;
|
||||
actions.push(this);
|
||||
actions.sort(VirtualAction.sortActions);
|
||||
return 1;
|
||||
}
|
||||
recycleAsyncId(scheduler, id, delay = 0) {
|
||||
return undefined;
|
||||
}
|
||||
_execute(state, delay) {
|
||||
if (this.active === true) {
|
||||
return super._execute(state, delay);
|
||||
}
|
||||
}
|
||||
static sortActions(a, b) {
|
||||
if (a.delay === b.delay) {
|
||||
if (a.index === b.index) {
|
||||
return 0;
|
||||
}
|
||||
else if (a.index > b.index) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (a.delay > b.delay) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=VirtualTimeScheduler.js.map
|
||||
@@ -0,0 +1,254 @@
|
||||
A. HISTORY OF THE SOFTWARE
|
||||
==========================
|
||||
|
||||
Python was created in the early 1990s by Guido van Rossum at Stichting
|
||||
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
|
||||
as a successor of a language called ABC. Guido remains Python's
|
||||
principal author, although it includes many contributions from others.
|
||||
|
||||
In 1995, Guido continued his work on Python at the Corporation for
|
||||
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
|
||||
in Reston, Virginia where he released several versions of the
|
||||
software.
|
||||
|
||||
In May 2000, Guido and the Python core development team moved to
|
||||
BeOpen.com to form the BeOpen PythonLabs team. In October of the same
|
||||
year, the PythonLabs team moved to Digital Creations, which became
|
||||
Zope Corporation. In 2001, the Python Software Foundation (PSF, see
|
||||
https://www.python.org/psf/) was formed, a non-profit organization
|
||||
created specifically to own Python-related Intellectual Property.
|
||||
Zope Corporation was a sponsoring member of the PSF.
|
||||
|
||||
All Python releases are Open Source (see http://www.opensource.org for
|
||||
the Open Source Definition). Historically, most, but not all, Python
|
||||
releases have also been GPL-compatible; the table below summarizes
|
||||
the various releases.
|
||||
|
||||
Release Derived Year Owner GPL-
|
||||
from compatible? (1)
|
||||
|
||||
0.9.0 thru 1.2 1991-1995 CWI yes
|
||||
1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
|
||||
1.6 1.5.2 2000 CNRI no
|
||||
2.0 1.6 2000 BeOpen.com no
|
||||
1.6.1 1.6 2001 CNRI yes (2)
|
||||
2.1 2.0+1.6.1 2001 PSF no
|
||||
2.0.1 2.0+1.6.1 2001 PSF yes
|
||||
2.1.1 2.1+2.0.1 2001 PSF yes
|
||||
2.1.2 2.1.1 2002 PSF yes
|
||||
2.1.3 2.1.2 2002 PSF yes
|
||||
2.2 and above 2.1.1 2001-now PSF yes
|
||||
|
||||
Footnotes:
|
||||
|
||||
(1) GPL-compatible doesn't mean that we're distributing Python under
|
||||
the GPL. All Python licenses, unlike the GPL, let you distribute
|
||||
a modified version without making your changes open source. The
|
||||
GPL-compatible licenses make it possible to combine Python with
|
||||
other software that is released under the GPL; the others don't.
|
||||
|
||||
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
|
||||
because its license has a choice of law clause. According to
|
||||
CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
|
||||
is "not incompatible" with the GPL.
|
||||
|
||||
Thanks to the many outside volunteers who have worked under Guido's
|
||||
direction to make these releases possible.
|
||||
|
||||
|
||||
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
|
||||
===============================================================
|
||||
|
||||
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
|
||||
--------------------------------------------
|
||||
|
||||
1. This LICENSE AGREEMENT is between the Python Software Foundation
|
||||
("PSF"), and the Individual or Organization ("Licensee") accessing and
|
||||
otherwise using this software ("Python") in source or binary form and
|
||||
its associated documentation.
|
||||
|
||||
2. Subject to the terms and conditions of this License Agreement, PSF hereby
|
||||
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
|
||||
analyze, test, perform and/or display publicly, prepare derivative works,
|
||||
distribute, and otherwise use Python alone or in any derivative version,
|
||||
provided, however, that PSF's License Agreement and PSF's notice of copyright,
|
||||
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation;
|
||||
All Rights Reserved" are retained in Python alone or in any derivative version
|
||||
prepared by Licensee.
|
||||
|
||||
3. In the event Licensee prepares a derivative work that is based on
|
||||
or incorporates Python or any part thereof, and wants to make
|
||||
the derivative work available to others as provided herein, then
|
||||
Licensee hereby agrees to include in any such work a brief summary of
|
||||
the changes made to Python.
|
||||
|
||||
4. PSF is making Python available to Licensee on an "AS IS"
|
||||
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
|
||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
|
||||
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
|
||||
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
|
||||
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||
|
||||
6. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
7. Nothing in this License Agreement shall be deemed to create any
|
||||
relationship of agency, partnership, or joint venture between PSF and
|
||||
Licensee. This License Agreement does not grant permission to use PSF
|
||||
trademarks or trade name in a trademark sense to endorse or promote
|
||||
products or services of Licensee, or any third party.
|
||||
|
||||
8. By copying, installing or otherwise using Python, Licensee
|
||||
agrees to be bound by the terms and conditions of this License
|
||||
Agreement.
|
||||
|
||||
|
||||
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
|
||||
-------------------------------------------
|
||||
|
||||
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
|
||||
|
||||
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
|
||||
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
|
||||
Individual or Organization ("Licensee") accessing and otherwise using
|
||||
this software in source or binary form and its associated
|
||||
documentation ("the Software").
|
||||
|
||||
2. Subject to the terms and conditions of this BeOpen Python License
|
||||
Agreement, BeOpen hereby grants Licensee a non-exclusive,
|
||||
royalty-free, world-wide license to reproduce, analyze, test, perform
|
||||
and/or display publicly, prepare derivative works, distribute, and
|
||||
otherwise use the Software alone or in any derivative version,
|
||||
provided, however, that the BeOpen Python License is retained in the
|
||||
Software, alone or in any derivative version prepared by Licensee.
|
||||
|
||||
3. BeOpen is making the Software available to Licensee on an "AS IS"
|
||||
basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
|
||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
|
||||
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
|
||||
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
|
||||
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||
|
||||
5. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
6. This License Agreement shall be governed by and interpreted in all
|
||||
respects by the law of the State of California, excluding conflict of
|
||||
law provisions. Nothing in this License Agreement shall be deemed to
|
||||
create any relationship of agency, partnership, or joint venture
|
||||
between BeOpen and Licensee. This License Agreement does not grant
|
||||
permission to use BeOpen trademarks or trade names in a trademark
|
||||
sense to endorse or promote products or services of Licensee, or any
|
||||
third party. As an exception, the "BeOpen Python" logos available at
|
||||
http://www.pythonlabs.com/logos.html may be used according to the
|
||||
permissions granted on that web page.
|
||||
|
||||
7. By copying, installing or otherwise using the software, Licensee
|
||||
agrees to be bound by the terms and conditions of this License
|
||||
Agreement.
|
||||
|
||||
|
||||
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
|
||||
---------------------------------------
|
||||
|
||||
1. This LICENSE AGREEMENT is between the Corporation for National
|
||||
Research Initiatives, having an office at 1895 Preston White Drive,
|
||||
Reston, VA 20191 ("CNRI"), and the Individual or Organization
|
||||
("Licensee") accessing and otherwise using Python 1.6.1 software in
|
||||
source or binary form and its associated documentation.
|
||||
|
||||
2. Subject to the terms and conditions of this License Agreement, CNRI
|
||||
hereby grants Licensee a nonexclusive, royalty-free, world-wide
|
||||
license to reproduce, analyze, test, perform and/or display publicly,
|
||||
prepare derivative works, distribute, and otherwise use Python 1.6.1
|
||||
alone or in any derivative version, provided, however, that CNRI's
|
||||
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
|
||||
1995-2001 Corporation for National Research Initiatives; All Rights
|
||||
Reserved" are retained in Python 1.6.1 alone or in any derivative
|
||||
version prepared by Licensee. Alternately, in lieu of CNRI's License
|
||||
Agreement, Licensee may substitute the following text (omitting the
|
||||
quotes): "Python 1.6.1 is made available subject to the terms and
|
||||
conditions in CNRI's License Agreement. This Agreement together with
|
||||
Python 1.6.1 may be located on the Internet using the following
|
||||
unique, persistent identifier (known as a handle): 1895.22/1013. This
|
||||
Agreement may also be obtained from a proxy server on the Internet
|
||||
using the following URL: http://hdl.handle.net/1895.22/1013".
|
||||
|
||||
3. In the event Licensee prepares a derivative work that is based on
|
||||
or incorporates Python 1.6.1 or any part thereof, and wants to make
|
||||
the derivative work available to others as provided herein, then
|
||||
Licensee hereby agrees to include in any such work a brief summary of
|
||||
the changes made to Python 1.6.1.
|
||||
|
||||
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
|
||||
basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
|
||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
|
||||
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
|
||||
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
|
||||
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||
|
||||
6. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
7. This License Agreement shall be governed by the federal
|
||||
intellectual property law of the United States, including without
|
||||
limitation the federal copyright law, and, to the extent such
|
||||
U.S. federal law does not apply, by the law of the Commonwealth of
|
||||
Virginia, excluding Virginia's conflict of law provisions.
|
||||
Notwithstanding the foregoing, with regard to derivative works based
|
||||
on Python 1.6.1 that incorporate non-separable material that was
|
||||
previously distributed under the GNU General Public License (GPL), the
|
||||
law of the Commonwealth of Virginia shall govern this License
|
||||
Agreement only as to issues arising under or with respect to
|
||||
Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
|
||||
License Agreement shall be deemed to create any relationship of
|
||||
agency, partnership, or joint venture between CNRI and Licensee. This
|
||||
License Agreement does not grant permission to use CNRI trademarks or
|
||||
trade name in a trademark sense to endorse or promote products or
|
||||
services of Licensee, or any third party.
|
||||
|
||||
8. By clicking on the "ACCEPT" button where indicated, or by copying,
|
||||
installing or otherwise using Python 1.6.1, Licensee agrees to be
|
||||
bound by the terms and conditions of this License Agreement.
|
||||
|
||||
ACCEPT
|
||||
|
||||
|
||||
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
|
||||
--------------------------------------------------
|
||||
|
||||
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
|
||||
The Netherlands. All rights reserved.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of Stichting Mathematisch
|
||||
Centrum or CWI not be used in advertising or publicity pertaining to
|
||||
distribution of the software without specific, written prior
|
||||
permission.
|
||||
|
||||
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
|
||||
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
|
||||
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
var arr = [1, 2, 3, 4, 5, 6];
|
||||
if (typeof arr.fill !== "function") return false;
|
||||
return String(arr.fill(-1, -3)) === "1,2,3,-1,-1,-1";
|
||||
};
|
||||
@@ -0,0 +1,249 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.WebSocketSubject = void 0;
|
||||
var Subject_1 = require("../../Subject");
|
||||
var Subscriber_1 = require("../../Subscriber");
|
||||
var Observable_1 = require("../../Observable");
|
||||
var Subscription_1 = require("../../Subscription");
|
||||
var ReplaySubject_1 = require("../../ReplaySubject");
|
||||
var DEFAULT_WEBSOCKET_CONFIG = {
|
||||
url: '',
|
||||
deserializer: function (e) { return JSON.parse(e.data); },
|
||||
serializer: function (value) { return JSON.stringify(value); },
|
||||
};
|
||||
var WEBSOCKETSUBJECT_INVALID_ERROR_OBJECT = 'WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }';
|
||||
var WebSocketSubject = (function (_super) {
|
||||
__extends(WebSocketSubject, _super);
|
||||
function WebSocketSubject(urlConfigOrSource, destination) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this._socket = null;
|
||||
if (urlConfigOrSource instanceof Observable_1.Observable) {
|
||||
_this.destination = destination;
|
||||
_this.source = urlConfigOrSource;
|
||||
}
|
||||
else {
|
||||
var config = (_this._config = __assign({}, DEFAULT_WEBSOCKET_CONFIG));
|
||||
_this._output = new Subject_1.Subject();
|
||||
if (typeof urlConfigOrSource === 'string') {
|
||||
config.url = urlConfigOrSource;
|
||||
}
|
||||
else {
|
||||
for (var key in urlConfigOrSource) {
|
||||
if (urlConfigOrSource.hasOwnProperty(key)) {
|
||||
config[key] = urlConfigOrSource[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!config.WebSocketCtor && WebSocket) {
|
||||
config.WebSocketCtor = WebSocket;
|
||||
}
|
||||
else if (!config.WebSocketCtor) {
|
||||
throw new Error('no WebSocket constructor can be found');
|
||||
}
|
||||
_this.destination = new ReplaySubject_1.ReplaySubject();
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
WebSocketSubject.prototype.lift = function (operator) {
|
||||
var sock = new WebSocketSubject(this._config, this.destination);
|
||||
sock.operator = operator;
|
||||
sock.source = this;
|
||||
return sock;
|
||||
};
|
||||
WebSocketSubject.prototype._resetState = function () {
|
||||
this._socket = null;
|
||||
if (!this.source) {
|
||||
this.destination = new ReplaySubject_1.ReplaySubject();
|
||||
}
|
||||
this._output = new Subject_1.Subject();
|
||||
};
|
||||
WebSocketSubject.prototype.multiplex = function (subMsg, unsubMsg, messageFilter) {
|
||||
var self = this;
|
||||
return new Observable_1.Observable(function (observer) {
|
||||
try {
|
||||
self.next(subMsg());
|
||||
}
|
||||
catch (err) {
|
||||
observer.error(err);
|
||||
}
|
||||
var subscription = self.subscribe({
|
||||
next: function (x) {
|
||||
try {
|
||||
if (messageFilter(x)) {
|
||||
observer.next(x);
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
observer.error(err);
|
||||
}
|
||||
},
|
||||
error: function (err) { return observer.error(err); },
|
||||
complete: function () { return observer.complete(); },
|
||||
});
|
||||
return function () {
|
||||
try {
|
||||
self.next(unsubMsg());
|
||||
}
|
||||
catch (err) {
|
||||
observer.error(err);
|
||||
}
|
||||
subscription.unsubscribe();
|
||||
};
|
||||
});
|
||||
};
|
||||
WebSocketSubject.prototype._connectSocket = function () {
|
||||
var _this = this;
|
||||
var _a = this._config, WebSocketCtor = _a.WebSocketCtor, protocol = _a.protocol, url = _a.url, binaryType = _a.binaryType;
|
||||
var observer = this._output;
|
||||
var socket = null;
|
||||
try {
|
||||
socket = protocol ? new WebSocketCtor(url, protocol) : new WebSocketCtor(url);
|
||||
this._socket = socket;
|
||||
if (binaryType) {
|
||||
this._socket.binaryType = binaryType;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
observer.error(e);
|
||||
return;
|
||||
}
|
||||
var subscription = new Subscription_1.Subscription(function () {
|
||||
_this._socket = null;
|
||||
if (socket && socket.readyState === 1) {
|
||||
socket.close();
|
||||
}
|
||||
});
|
||||
socket.onopen = function (evt) {
|
||||
var _socket = _this._socket;
|
||||
if (!_socket) {
|
||||
socket.close();
|
||||
_this._resetState();
|
||||
return;
|
||||
}
|
||||
var openObserver = _this._config.openObserver;
|
||||
if (openObserver) {
|
||||
openObserver.next(evt);
|
||||
}
|
||||
var queue = _this.destination;
|
||||
_this.destination = Subscriber_1.Subscriber.create(function (x) {
|
||||
if (socket.readyState === 1) {
|
||||
try {
|
||||
var serializer = _this._config.serializer;
|
||||
socket.send(serializer(x));
|
||||
}
|
||||
catch (e) {
|
||||
_this.destination.error(e);
|
||||
}
|
||||
}
|
||||
}, function (err) {
|
||||
var closingObserver = _this._config.closingObserver;
|
||||
if (closingObserver) {
|
||||
closingObserver.next(undefined);
|
||||
}
|
||||
if (err && err.code) {
|
||||
socket.close(err.code, err.reason);
|
||||
}
|
||||
else {
|
||||
observer.error(new TypeError(WEBSOCKETSUBJECT_INVALID_ERROR_OBJECT));
|
||||
}
|
||||
_this._resetState();
|
||||
}, function () {
|
||||
var closingObserver = _this._config.closingObserver;
|
||||
if (closingObserver) {
|
||||
closingObserver.next(undefined);
|
||||
}
|
||||
socket.close();
|
||||
_this._resetState();
|
||||
});
|
||||
if (queue && queue instanceof ReplaySubject_1.ReplaySubject) {
|
||||
subscription.add(queue.subscribe(_this.destination));
|
||||
}
|
||||
};
|
||||
socket.onerror = function (e) {
|
||||
_this._resetState();
|
||||
observer.error(e);
|
||||
};
|
||||
socket.onclose = function (e) {
|
||||
if (socket === _this._socket) {
|
||||
_this._resetState();
|
||||
}
|
||||
var closeObserver = _this._config.closeObserver;
|
||||
if (closeObserver) {
|
||||
closeObserver.next(e);
|
||||
}
|
||||
if (e.wasClean) {
|
||||
observer.complete();
|
||||
}
|
||||
else {
|
||||
observer.error(e);
|
||||
}
|
||||
};
|
||||
socket.onmessage = function (e) {
|
||||
try {
|
||||
var deserializer = _this._config.deserializer;
|
||||
observer.next(deserializer(e));
|
||||
}
|
||||
catch (err) {
|
||||
observer.error(err);
|
||||
}
|
||||
};
|
||||
};
|
||||
WebSocketSubject.prototype._subscribe = function (subscriber) {
|
||||
var _this = this;
|
||||
var source = this.source;
|
||||
if (source) {
|
||||
return source.subscribe(subscriber);
|
||||
}
|
||||
if (!this._socket) {
|
||||
this._connectSocket();
|
||||
}
|
||||
this._output.subscribe(subscriber);
|
||||
subscriber.add(function () {
|
||||
var _socket = _this._socket;
|
||||
if (_this._output.observers.length === 0) {
|
||||
if (_socket && (_socket.readyState === 1 || _socket.readyState === 0)) {
|
||||
_socket.close();
|
||||
}
|
||||
_this._resetState();
|
||||
}
|
||||
});
|
||||
return subscriber;
|
||||
};
|
||||
WebSocketSubject.prototype.unsubscribe = function () {
|
||||
var _socket = this._socket;
|
||||
if (_socket && (_socket.readyState === 1 || _socket.readyState === 0)) {
|
||||
_socket.close();
|
||||
}
|
||||
this._resetState();
|
||||
_super.prototype.unsubscribe.call(this);
|
||||
};
|
||||
return WebSocketSubject;
|
||||
}(Subject_1.AnonymousSubject));
|
||||
exports.WebSocketSubject = WebSocketSubject;
|
||||
//# sourceMappingURL=WebSocketSubject.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
import { Octokit as Core } from "@octokit/core";
|
||||
export { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
|
||||
export declare const Octokit: typeof Core & import("@octokit/core/dist-types/types").Constructor<{
|
||||
paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
|
||||
} & import("@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types").RestEndpointMethods & import("@octokit/plugin-rest-endpoint-methods/dist-types/types").Api>;
|
||||
export type Octokit = InstanceType<typeof Octokit>;
|
||||
@@ -0,0 +1,37 @@
|
||||
# inflight
|
||||
|
||||
Add callbacks to requests in flight to avoid async duplication
|
||||
|
||||
## USAGE
|
||||
|
||||
```javascript
|
||||
var inflight = require('inflight')
|
||||
|
||||
// some request that does some stuff
|
||||
function req(key, callback) {
|
||||
// key is any random string. like a url or filename or whatever.
|
||||
//
|
||||
// will return either a falsey value, indicating that the
|
||||
// request for this key is already in flight, or a new callback
|
||||
// which when called will call all callbacks passed to inflightk
|
||||
// with the same key
|
||||
callback = inflight(key, callback)
|
||||
|
||||
// If we got a falsey value back, then there's already a req going
|
||||
if (!callback) return
|
||||
|
||||
// this is where you'd fetch the url or whatever
|
||||
// callback is also once()-ified, so it can safely be assigned
|
||||
// to multiple events etc. First call wins.
|
||||
setTimeout(function() {
|
||||
callback(null, key)
|
||||
}, 100)
|
||||
}
|
||||
|
||||
// only assigns a single setTimeout
|
||||
// when it dings, all cbs get called
|
||||
req('foo', cb1)
|
||||
req('foo', cb2)
|
||||
req('foo', cb3)
|
||||
req('foo', cb4)
|
||||
```
|
||||
@@ -0,0 +1,310 @@
|
||||
// Type definitions for commander 2.11
|
||||
// Project: https://github.com/visionmedia/commander.js
|
||||
// Definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace local {
|
||||
|
||||
class Option {
|
||||
flags: string;
|
||||
required: boolean;
|
||||
optional: boolean;
|
||||
bool: boolean;
|
||||
short?: string;
|
||||
long: string;
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* Initialize a new `Option` with the given `flags` and `description`.
|
||||
*
|
||||
* @param {string} flags
|
||||
* @param {string} [description]
|
||||
*/
|
||||
constructor(flags: string, description?: string);
|
||||
}
|
||||
|
||||
class Command extends NodeJS.EventEmitter {
|
||||
[key: string]: any;
|
||||
|
||||
args: string[];
|
||||
|
||||
/**
|
||||
* Initialize a new `Command`.
|
||||
*
|
||||
* @param {string} [name]
|
||||
*/
|
||||
constructor(name?: string);
|
||||
|
||||
/**
|
||||
* Set the program version to `str`.
|
||||
*
|
||||
* This method auto-registers the "-V, --version" flag
|
||||
* which will print the version number when passed.
|
||||
*
|
||||
* @param {string} str
|
||||
* @param {string} [flags]
|
||||
* @returns {Command} for chaining
|
||||
*/
|
||||
version(str: string, flags?: string): Command;
|
||||
|
||||
/**
|
||||
* Add command `name`.
|
||||
*
|
||||
* The `.action()` callback is invoked when the
|
||||
* command `name` is specified via __ARGV__,
|
||||
* and the remaining arguments are applied to the
|
||||
* function for access.
|
||||
*
|
||||
* When the `name` is "*" an un-matched command
|
||||
* will be passed as the first arg, followed by
|
||||
* the rest of __ARGV__ remaining.
|
||||
*
|
||||
* @example
|
||||
* program
|
||||
* .version('0.0.1')
|
||||
* .option('-C, --chdir <path>', 'change the working directory')
|
||||
* .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
|
||||
* .option('-T, --no-tests', 'ignore test hook')
|
||||
*
|
||||
* program
|
||||
* .command('setup')
|
||||
* .description('run remote setup commands')
|
||||
* .action(function() {
|
||||
* console.log('setup');
|
||||
* });
|
||||
*
|
||||
* program
|
||||
* .command('exec <cmd>')
|
||||
* .description('run the given remote command')
|
||||
* .action(function(cmd) {
|
||||
* console.log('exec "%s"', cmd);
|
||||
* });
|
||||
*
|
||||
* program
|
||||
* .command('teardown <dir> [otherDirs...]')
|
||||
* .description('run teardown commands')
|
||||
* .action(function(dir, otherDirs) {
|
||||
* console.log('dir "%s"', dir);
|
||||
* if (otherDirs) {
|
||||
* otherDirs.forEach(function (oDir) {
|
||||
* console.log('dir "%s"', oDir);
|
||||
* });
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* program
|
||||
* .command('*')
|
||||
* .description('deploy the given env')
|
||||
* .action(function(env) {
|
||||
* console.log('deploying "%s"', env);
|
||||
* });
|
||||
*
|
||||
* program.parse(process.argv);
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {string} [desc] for git-style sub-commands
|
||||
* @param {CommandOptions} [opts] command options
|
||||
* @returns {Command} the new command
|
||||
*/
|
||||
command(name: string, desc?: string, opts?: commander.CommandOptions): Command;
|
||||
|
||||
/**
|
||||
* Define argument syntax for the top-level command.
|
||||
*
|
||||
* @param {string} desc
|
||||
* @returns {Command} for chaining
|
||||
*/
|
||||
arguments(desc: string): Command;
|
||||
|
||||
/**
|
||||
* Parse expected `args`.
|
||||
*
|
||||
* For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
|
||||
*
|
||||
* @param {string[]} args
|
||||
* @returns {Command} for chaining
|
||||
*/
|
||||
parseExpectedArgs(args: string[]): Command;
|
||||
|
||||
/**
|
||||
* Register callback `fn` for the command.
|
||||
*
|
||||
* @example
|
||||
* program
|
||||
* .command('help')
|
||||
* .description('display verbose help')
|
||||
* .action(function() {
|
||||
* // output help here
|
||||
* });
|
||||
*
|
||||
* @param {(...args: any[]) => void} fn
|
||||
* @returns {Command} for chaining
|
||||
*/
|
||||
action(fn: (...args: any[]) => void): Command;
|
||||
|
||||
/**
|
||||
* Define option with `flags`, `description` and optional
|
||||
* coercion `fn`.
|
||||
*
|
||||
* The `flags` string should contain both the short and long flags,
|
||||
* separated by comma, a pipe or space. The following are all valid
|
||||
* all will output this way when `--help` is used.
|
||||
*
|
||||
* "-p, --pepper"
|
||||
* "-p|--pepper"
|
||||
* "-p --pepper"
|
||||
*
|
||||
* @example
|
||||
* // simple boolean defaulting to false
|
||||
* program.option('-p, --pepper', 'add pepper');
|
||||
*
|
||||
* --pepper
|
||||
* program.pepper
|
||||
* // => Boolean
|
||||
*
|
||||
* // simple boolean defaulting to true
|
||||
* program.option('-C, --no-cheese', 'remove cheese');
|
||||
*
|
||||
* program.cheese
|
||||
* // => true
|
||||
*
|
||||
* --no-cheese
|
||||
* program.cheese
|
||||
* // => false
|
||||
*
|
||||
* // required argument
|
||||
* program.option('-C, --chdir <path>', 'change the working directory');
|
||||
*
|
||||
* --chdir /tmp
|
||||
* program.chdir
|
||||
* // => "/tmp"
|
||||
*
|
||||
* // optional argument
|
||||
* program.option('-c, --cheese [type]', 'add cheese [marble]');
|
||||
*
|
||||
* @param {string} flags
|
||||
* @param {string} [description]
|
||||
* @param {((arg1: any, arg2: any) => void) | RegExp} [fn] function or default
|
||||
* @param {*} [defaultValue]
|
||||
* @returns {Command} for chaining
|
||||
*/
|
||||
option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command;
|
||||
option(flags: string, description?: string, defaultValue?: any): Command;
|
||||
|
||||
/**
|
||||
* Allow unknown options on the command line.
|
||||
*
|
||||
* @param {boolean} [arg] if `true` or omitted, no error will be thrown for unknown options.
|
||||
* @returns {Command} for chaining
|
||||
*/
|
||||
allowUnknownOption(arg?: boolean): Command;
|
||||
|
||||
/**
|
||||
* Parse `argv`, settings options and invoking commands when defined.
|
||||
*
|
||||
* @param {string[]} argv
|
||||
* @returns {Command} for chaining
|
||||
*/
|
||||
parse(argv: string[]): Command;
|
||||
|
||||
/**
|
||||
* Parse options from `argv` returning `argv` void of these options.
|
||||
*
|
||||
* @param {string[]} argv
|
||||
* @returns {ParseOptionsResult}
|
||||
*/
|
||||
parseOptions(argv: string[]): commander.ParseOptionsResult;
|
||||
|
||||
/**
|
||||
* Return an object containing options as key-value pairs
|
||||
*
|
||||
* @returns {{[key: string]: any}}
|
||||
*/
|
||||
opts(): { [key: string]: any };
|
||||
|
||||
/**
|
||||
* Set the description to `str`.
|
||||
*
|
||||
* @param {string} str
|
||||
* @param {{[argName: string]: string}} argsDescription
|
||||
* @return {(Command | string)}
|
||||
*/
|
||||
description(str: string, argsDescription?: {[argName: string]: string}): Command;
|
||||
description(): string;
|
||||
|
||||
/**
|
||||
* Set an alias for the command.
|
||||
*
|
||||
* @param {string} alias
|
||||
* @return {(Command | string)}
|
||||
*/
|
||||
alias(alias: string): Command;
|
||||
alias(): string;
|
||||
|
||||
/**
|
||||
* Set or get the command usage.
|
||||
*
|
||||
* @param {string} str
|
||||
* @return {(Command | string)}
|
||||
*/
|
||||
usage(str: string): Command;
|
||||
usage(): string;
|
||||
|
||||
/**
|
||||
* Set the name of the command.
|
||||
*
|
||||
* @param {string} str
|
||||
* @return {Command}
|
||||
*/
|
||||
name(str: string): Command;
|
||||
|
||||
/**
|
||||
* Get the name of the command.
|
||||
*
|
||||
* @return {string}
|
||||
*/
|
||||
name(): string;
|
||||
|
||||
/**
|
||||
* Output help information for this command.
|
||||
*
|
||||
* @param {(str: string) => string} [cb]
|
||||
*/
|
||||
outputHelp(cb?: (str: string) => string): void;
|
||||
|
||||
/** Output help information and exit.
|
||||
*
|
||||
* @param {(str: string) => string} [cb]
|
||||
*/
|
||||
help(cb?: (str: string) => string): never;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare namespace commander {
|
||||
|
||||
type Command = local.Command
|
||||
|
||||
type Option = local.Option
|
||||
|
||||
interface CommandOptions {
|
||||
noHelp?: boolean;
|
||||
isDefault?: boolean;
|
||||
}
|
||||
|
||||
interface ParseOptionsResult {
|
||||
args: string[];
|
||||
unknown: string[];
|
||||
}
|
||||
|
||||
interface CommanderStatic extends Command {
|
||||
Command: typeof local.Command;
|
||||
Option: typeof local.Option;
|
||||
CommandOptions: CommandOptions;
|
||||
ParseOptionsResult: ParseOptionsResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare const commander: commander.CommanderStatic;
|
||||
export = commander;
|
||||
@@ -0,0 +1,2 @@
|
||||
declare function setPrototypeOf(o: any, proto: object | null): any;
|
||||
export = setPrototypeOf;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"K L G M N O","132":"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","322":"C"},C:{"1":"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"DC tB I v J D E F A B C K L G M N O w g x EC FC"},D:{"2":"0 1 2 3 I v J D E F A B C K L G M N O w g x y z","132":"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 S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"2":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"2":"F B C PC QC RC SC qB AC TC rB","132":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"2":"tB I pC qC rC sC BC tC uC","132":"f"},J:{"2":"D A"},K:{"2":"A B C qB AC rB","132":"h"},L:{"132":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"132":"vC"},P:{"2":"I","132":"g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"132":"1B"},R:{"132":"9C"},S:{"1":"AD BD"}},B:6,C:"asm.js"};
|
||||
@@ -0,0 +1,4 @@
|
||||
export type RunnerTeamNotFoundError = {
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').every;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require("./lib/_stream_duplex.js")
|
||||
@@ -0,0 +1,48 @@
|
||||
# String.prototype.trim <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![dependency status][deps-svg]][deps-url]
|
||||
[![dev dependency status][dev-deps-svg]][dev-deps-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][npm-badge-png]][package-url]
|
||||
|
||||
An ES5 spec-compliant `String.prototype.trim` shim. Invoke its "shim" method to shim `String.prototype.trim` if it is unavailable.
|
||||
|
||||
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the spec (both [ES5](https://262.ecma-international.org/5.1/#sec-15.5.4.20) and [current](https://tc39.es/ecma262/#sec-string.prototype.trim)).
|
||||
|
||||
Most common usage:
|
||||
|
||||
```js
|
||||
var assert = require('assert');
|
||||
var trim = require('string.prototype.trim');
|
||||
|
||||
assert(trim(' \t\na \t\n') === 'a');
|
||||
|
||||
trim.shim(); // will be a no-op if not needed
|
||||
|
||||
assert(trim(' \t\na \t\n') === ' \t\na \t\n'.trim());
|
||||
```
|
||||
|
||||
## Engine Bugs
|
||||
Some implementations of `String#trim` incorrectly trim zero-width spaces. This shim detects and corrects this behavior.
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[package-url]: https://npmjs.com/package/string.prototype.trim
|
||||
[npm-version-svg]: https://versionbadg.es/es-shims/String.prototype.trim.svg
|
||||
[deps-svg]: https://david-dm.org/es-shims/String.prototype.trim.svg
|
||||
[deps-url]: https://david-dm.org/es-shims/String.prototype.trim
|
||||
[dev-deps-svg]: https://david-dm.org/es-shims/String.prototype.trim/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/es-shims/String.prototype.trim#info=devDependencies
|
||||
[license-image]: https://img.shields.io/npm/l/string.prototype.trim.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/string.prototype.trim.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=string.prototype.trim
|
||||
[codecov-image]: https://codecov.io/gh/es-shims/String.prototype.trim/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/es-shims/String.prototype.trim/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/String.prototype.trim
|
||||
[actions-url]: https://github.com/es-shims/String.prototype.trim/actions
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0.00451,"4":0.00451,"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.00451,"39":0.00451,"40":0.00451,"41":0.00451,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0.00451,"49":0,"50":0,"51":0,"52":0.00902,"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.00451,"66":0,"67":0,"68":0.00451,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00451,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0.00451,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0.00451,"96":0,"97":0,"98":0,"99":0.00451,"100":0.01352,"101":0.00451,"102":0,"103":0.00451,"104":0.00902,"105":0.00451,"106":0.01803,"107":0.00451,"108":0.02254,"109":0.60858,"110":0.3967,"111":0.00902,"112":0,"3.5":0,"3.6":0.00451},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.00451,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0.00451,"32":0,"33":0,"34":0,"35":0,"36":0.00451,"37":0.00451,"38":0.03156,"39":0.00451,"40":0.00451,"41":0.00902,"42":0.00451,"43":0.01352,"44":0.01803,"45":0.01352,"46":0.00902,"47":0.02254,"48":0,"49":0.24794,"50":0.00451,"51":0.01352,"52":0,"53":0,"54":0,"55":0.00902,"56":0,"57":0,"58":0,"59":0,"60":0.00451,"61":0,"62":0.00902,"63":0,"64":0,"65":0.00451,"66":0,"67":0,"68":0.01352,"69":0.00451,"70":0.00451,"71":0.01803,"72":0,"73":0.01352,"74":0.00451,"75":0.00451,"76":0,"77":0,"78":0,"79":0.08565,"80":0,"81":0.00451,"83":0.00902,"84":0,"85":0.00902,"86":0,"87":0.01803,"88":0.01803,"89":0.00451,"90":0,"91":0.01352,"92":0.04508,"93":0,"94":0.00451,"95":0.01352,"96":0.00902,"97":0.02254,"98":0.01803,"99":0.00451,"100":0.00902,"101":0.00902,"102":0.00902,"103":0.1127,"104":0.00902,"105":0.00902,"106":0.01803,"107":0.03156,"108":0.22991,"109":7.40664,"110":4.40882,"111":0.00902,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00902,"29":0,"30":0.00451,"31":0.00451,"32":0.00451,"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.01803,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0.00451,"55":0.01803,"56":0,"57":0,"58":0,"60":0.00451,"62":0,"63":0.00451,"64":0.02705,"65":0.00451,"66":0.00451,"67":0.29302,"68":0,"69":0,"70":0.00451,"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.02705,"94":0.27499,"95":0.13975,"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.00451},B:{"12":0.00451,"13":0,"14":0.00451,"15":0,"16":0,"17":0.00451,"18":0.00451,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.00451,"103":0.00451,"104":0,"105":0,"106":0.00451,"107":0.00451,"108":0.07664,"109":0.64464,"110":0.72128},E:{"4":0,"5":0,"6":0,"7":0,"8":0.00451,"9":0.01803,"10":0,"11":0,"12":0,"13":0.02254,"14":0.08114,"15":0.00902,_:"0","3.1":0,"3.2":0,"5.1":0.00451,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.02705,"13.1":0.0541,"14.1":0.34712,"15.1":0.04057,"15.2-15.3":0.02254,"15.4":0.04508,"15.5":0.06311,"15.6":0.52293,"16.0":0.0541,"16.1":0.17581,"16.2":0.47785,"16.3":0.37416,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0024,"5.0-5.1":0.0048,"6.0-6.1":0.0072,"7.0-7.1":0.10798,"8.1-8.4":0.14878,"9.0-9.2":0.0264,"9.3":0.22317,"10.0-10.2":0,"10.3":0.47753,"11.0-11.2":0.10079,"11.3-11.4":0.0024,"12.0-12.1":0.15838,"12.2-12.5":0.6887,"13.0-13.1":0.0216,"13.2":0.0312,"13.3":0.0192,"13.4-13.7":0.04799,"14.0-14.4":0.24237,"14.5-14.8":0.37915,"15.0-15.1":0.19197,"15.2-15.3":0.23277,"15.4":0.29516,"15.5":0.46553,"15.6":1.53818,"16.0":3.14595,"16.1":4.97689,"16.2":5.04408,"16.3":3.57549,"16.4":0.0048},P:{"4":0.4746,"20":0.66443,"5.0-5.4":0,"6.2-6.4":0.02109,"7.2-7.4":0.08437,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.02109,"12.0":0.01055,"13.0":0.05273,"14.0":0,"15.0":0.01055,"16.0":0.03164,"17.0":0.06328,"18.0":0.04219,"19.0":0.90701},I:{"0":0,"3":0.00557,"4":0.04459,"2.1":0.00557,"2.2":0.02508,"2.3":0.03344,"4.1":0.0418,"4.2-4.3":0.06967,"4.4":0,"4.4.3-4.4.4":0.16721},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0.00451,"7":0.00902,"8":0.08565,"9":0.02254,"10":0.01803,"11":0.04959,"5.5":0},N:{"10":0.02563,"11":0.01281},S:{"2.5":0.00549,_:"3.0-3.1"},J:{"7":0,"10":0.01098},O:{"0":1.63112},H:{"0":2.06939},L:{"0":49.01767},R:{_:"0"},M:{"0":0.19222},Q:{"13.1":0.00549}};
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Resolves the given DNS hostname into an IP address, and returns it in the dot
|
||||
* separated format as a string.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ``` js
|
||||
* dnsResolve("home.netscape.com")
|
||||
* // returns the string "198.95.249.79".
|
||||
* ```
|
||||
*
|
||||
* @param {String} host hostname to resolve
|
||||
* @return {String} resolved IP address
|
||||
*/
|
||||
export default function dnsResolve(host: string): Promise<string | null>;
|
||||
@@ -0,0 +1,42 @@
|
||||
import { Subject } from '../Subject';
|
||||
import { Observable } from '../Observable';
|
||||
import { Subscription } from '../Subscription';
|
||||
/**
|
||||
* @class ConnectableObservable<T>
|
||||
* @deprecated Will be removed in v8. Use {@link connectable} to create a connectable observable.
|
||||
* If you are using the `refCount` method of `ConnectableObservable`, use the {@link share} operator
|
||||
* instead.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export declare class ConnectableObservable<T> extends Observable<T> {
|
||||
source: Observable<T>;
|
||||
protected subjectFactory: () => Subject<T>;
|
||||
protected _subject: Subject<T> | null;
|
||||
protected _refCount: number;
|
||||
protected _connection: Subscription | null;
|
||||
/**
|
||||
* @param source The source observable
|
||||
* @param subjectFactory The factory that creates the subject used internally.
|
||||
* @deprecated Will be removed in v8. Use {@link connectable} to create a connectable observable.
|
||||
* `new ConnectableObservable(source, factory)` is equivalent to
|
||||
* `connectable(source, { connector: factory })`.
|
||||
* When the `refCount()` method is needed, the {@link share} operator should be used instead:
|
||||
* `new ConnectableObservable(source, factory).refCount()` is equivalent to
|
||||
* `source.pipe(share({ connector: factory }))`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
constructor(source: Observable<T>, subjectFactory: () => Subject<T>);
|
||||
protected getSubject(): Subject<T>;
|
||||
protected _teardown(): void;
|
||||
/**
|
||||
* @deprecated {@link ConnectableObservable} will be removed in v8. Use {@link connectable} instead.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
connect(): Subscription;
|
||||
/**
|
||||
* @deprecated {@link ConnectableObservable} will be removed in v8. Use the {@link share} operator instead.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
refCount(): Observable<T>;
|
||||
}
|
||||
//# sourceMappingURL=ConnectableObservable.d.ts.map
|
||||
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
var assert = require("chai").assert
|
||||
, ensureValue = require("../../value/ensure");
|
||||
|
||||
describe("value/ensure", function () {
|
||||
it("Should return input value", function () {
|
||||
var value = {};
|
||||
assert.equal(ensureValue(value), value);
|
||||
});
|
||||
it("Should crash on no value", function () {
|
||||
try {
|
||||
ensureValue(null);
|
||||
throw new Error("Unexpected");
|
||||
} catch (error) {
|
||||
assert.equal(error.name, "TypeError");
|
||||
assert.equal(error.message, "Cannot use null");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.10
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"2":"C K L G M N O","129":"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":"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 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB EC FC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB","129":"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","450":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB"},E:{"1":"3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F A B C K HC zB IC JC KC LC 0B qB rB 1B","578":"L G MC NC 2B"},F:{"2":"0 1 2 3 F B C G M N O w g x y z PC QC RC SC qB AC TC rB","129":"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","450":"4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},G:{"1":"3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC","578":"mC nC 2B"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"129":"vC"},P:{"1":"g zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I wC xC yC"},Q:{"129":"1B"},R:{"1":"9C"},S:{"1":"BD","2":"AD"}},B:5,C:"CSS Scroll-behavior"};
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* 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 function isValidDate(value: any): value is Date {
|
||||
return value instanceof Date && !isNaN(value as any);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2018, Viacheslav Lotsmanov
|
||||
|
||||
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,5 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.8
|
||||
- "0.10"
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('difference', require('../difference'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
var isValue = require("./object/is-value");
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
module.exports = function (value, propertyName1 /*, …propertyNamen*/) {
|
||||
var propertyNames = slice.call(arguments, 1), index = 0, length = propertyNames.length;
|
||||
while (isValue(value) && index < length) value = value[propertyNames[index++]];
|
||||
return index === length ? value : undefined;
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Get = require('./Get');
|
||||
var IsCallable = require('./IsCallable');
|
||||
var IsConstructor = require('./IsConstructor');
|
||||
|
||||
// https://262.ecma-international.org/12.0/#sec-getpromiseresolve
|
||||
|
||||
module.exports = function GetPromiseResolve(promiseConstructor) {
|
||||
if (!IsConstructor(promiseConstructor)) {
|
||||
throw new $TypeError('Assertion failed: `promiseConstructor` must be a constructor');
|
||||
}
|
||||
var promiseResolve = Get(promiseConstructor, 'resolve');
|
||||
if (IsCallable(promiseResolve) === false) {
|
||||
throw new $TypeError('`resolve` method is not callable');
|
||||
}
|
||||
return promiseResolve;
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
var isArrayLike = require('./isArrayLike'),
|
||||
isObjectLike = require('./isObjectLike');
|
||||
|
||||
/**
|
||||
* This method is like `_.isArrayLike` except that it also checks if `value`
|
||||
* is an object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
||||
* else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isArrayLikeObject([1, 2, 3]);
|
||||
* // => true
|
||||
*
|
||||
* _.isArrayLikeObject(document.body.children);
|
||||
* // => true
|
||||
*
|
||||
* _.isArrayLikeObject('abc');
|
||||
* // => false
|
||||
*
|
||||
* _.isArrayLikeObject(_.noop);
|
||||
* // => false
|
||||
*/
|
||||
function isArrayLikeObject(value) {
|
||||
return isObjectLike(value) && isArrayLike(value);
|
||||
}
|
||||
|
||||
module.exports = isArrayLikeObject;
|
||||
@@ -0,0 +1,16 @@
|
||||
var copyObject = require('./_copyObject'),
|
||||
getSymbolsIn = require('./_getSymbolsIn');
|
||||
|
||||
/**
|
||||
* Copies own and inherited symbols of `source` to `object`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} source The object to copy symbols from.
|
||||
* @param {Object} [object={}] The object to copy symbols to.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function copySymbolsIn(source, object) {
|
||||
return copyObject(source, getSymbolsIn(source), object);
|
||||
}
|
||||
|
||||
module.exports = copySymbolsIn;
|
||||
@@ -0,0 +1 @@
|
||||
* text=auto
|
||||
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isOctal;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var octal = /^(0o)?[0-7]+$/i;
|
||||
|
||||
function isOctal(str) {
|
||||
(0, _assertString.default)(str);
|
||||
return octal.test(str);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,40 @@
|
||||
'use strict';
|
||||
|
||||
var SLOT = require('internal-slot');
|
||||
|
||||
var $SyntaxError = SyntaxError;
|
||||
var $StopIteration = typeof StopIteration === 'object' ? StopIteration : null;
|
||||
|
||||
module.exports = function getStopIterationIterator(origIterator) {
|
||||
if (!$StopIteration) {
|
||||
throw new $SyntaxError('this environment lacks StopIteration');
|
||||
}
|
||||
|
||||
SLOT.set(origIterator, '[[Done]]', false);
|
||||
|
||||
var siIterator = {
|
||||
next: function next() {
|
||||
var iterator = SLOT.get(this, '[[Iterator]]');
|
||||
var done = SLOT.get(iterator, '[[Done]]');
|
||||
try {
|
||||
return {
|
||||
done: done,
|
||||
value: done ? void undefined : iterator.next()
|
||||
};
|
||||
} catch (e) {
|
||||
SLOT.set(iterator, '[[Done]]', true);
|
||||
if (e !== $StopIteration) {
|
||||
throw e;
|
||||
}
|
||||
return {
|
||||
done: true,
|
||||
value: void undefined
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SLOT.set(siIterator, '[[Iterator]]', origIterator);
|
||||
|
||||
return siIterator;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports.browserVersions = require('../../data/browserVersions')
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('uniqBy', require('../uniqBy'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,26 @@
|
||||
# require-relative
|
||||
|
||||
require-relative is a node.js program to require and resolve modules relative to a path of your choice.
|
||||
It exploits node.js's own `module` module, and has no additional dependencies.
|
||||
|
||||
## Example
|
||||
|
||||
requiring modules relatively
|
||||
|
||||
```js
|
||||
var relative = require('require-relative');
|
||||
|
||||
var someModule = relative('./some-module', '/home/kamicane');
|
||||
var somePackage = relative('some-package', '/home/kamicane');
|
||||
var isTrue = relative('./some-module.js', process.cwd()) === relative('./some-module.js');
|
||||
```
|
||||
|
||||
resolving filenames relatively
|
||||
|
||||
```js
|
||||
var relative = require('require-relative');
|
||||
|
||||
relative.resolve('./some-module', '/home/kamicane'); // /home/kamicane/some-module.js
|
||||
relative.resolve('some-package', '/home/kamicane'); // /home/kamicane/node_modules/some-package/index.js
|
||||
var isTrue = relative.resolve('./some-module.js', process.cwd()) === relative.resolve('./some-module.js');
|
||||
```
|
||||
@@ -0,0 +1,152 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ExplorerBase = void 0;
|
||||
exports.getExtensionDescription = getExtensionDescription;
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _getPropertyByPath = require("./getPropertyByPath");
|
||||
|
||||
var _loaders = require("./loaders");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
class ExplorerBase {
|
||||
constructor(options) {
|
||||
if (options.cache) {
|
||||
this.loadCache = new Map();
|
||||
this.searchCache = new Map();
|
||||
}
|
||||
|
||||
this.config = options;
|
||||
this.validateConfig();
|
||||
}
|
||||
|
||||
clearLoadCache() {
|
||||
if (this.loadCache) {
|
||||
this.loadCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
clearSearchCache() {
|
||||
if (this.searchCache) {
|
||||
this.searchCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
clearCaches() {
|
||||
this.clearLoadCache();
|
||||
this.clearSearchCache();
|
||||
}
|
||||
|
||||
validateConfig() {
|
||||
const config = this.config;
|
||||
config.searchPlaces.forEach(place => {
|
||||
const loaderKey = _path.default.extname(place) || 'noExt';
|
||||
const loader = config.loaders[loaderKey];
|
||||
|
||||
if (!loader) {
|
||||
throw new Error(`No loader specified for ${getExtensionDescription(place)}, so searchPlaces item "${place}" is invalid`);
|
||||
}
|
||||
|
||||
if (typeof loader !== 'function') {
|
||||
throw new Error(`loader for ${getExtensionDescription(place)} is not a function (type provided: "${typeof loader}"), so searchPlaces item "${place}" is invalid`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
shouldSearchStopWithResult(result) {
|
||||
if (result === null) return false;
|
||||
return !(result.isEmpty && this.config.ignoreEmptySearchPlaces);
|
||||
}
|
||||
|
||||
nextDirectoryToSearch(currentDir, currentResult) {
|
||||
if (this.shouldSearchStopWithResult(currentResult)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const nextDir = nextDirUp(currentDir);
|
||||
|
||||
if (nextDir === currentDir || currentDir === this.config.stopDir) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return nextDir;
|
||||
}
|
||||
|
||||
loadPackageProp(filepath, content) {
|
||||
const parsedContent = _loaders.loaders.loadJson(filepath, content);
|
||||
|
||||
const packagePropValue = (0, _getPropertyByPath.getPropertyByPath)(parsedContent, this.config.packageProp);
|
||||
return packagePropValue || null;
|
||||
}
|
||||
|
||||
getLoaderEntryForFile(filepath) {
|
||||
if (_path.default.basename(filepath) === 'package.json') {
|
||||
return this.loadPackageProp.bind(this);
|
||||
}
|
||||
|
||||
const loaderKey = _path.default.extname(filepath) || 'noExt';
|
||||
const loader = this.config.loaders[loaderKey];
|
||||
|
||||
if (!loader) {
|
||||
throw new Error(`No loader specified for ${getExtensionDescription(filepath)}`);
|
||||
}
|
||||
|
||||
return loader;
|
||||
}
|
||||
|
||||
loadedContentToCosmiconfigResult(filepath, loadedContent, forceProp) {
|
||||
if (loadedContent === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (loadedContent === undefined) {
|
||||
return {
|
||||
filepath,
|
||||
config: undefined,
|
||||
isEmpty: true
|
||||
};
|
||||
}
|
||||
|
||||
if (this.config.usePackagePropInConfigFiles || forceProp) {
|
||||
loadedContent = (0, _getPropertyByPath.getPropertyByPath)(loadedContent, this.config.packageProp);
|
||||
}
|
||||
|
||||
if (loadedContent === undefined) {
|
||||
return {
|
||||
filepath,
|
||||
config: undefined,
|
||||
isEmpty: true
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
config: loadedContent,
|
||||
filepath
|
||||
};
|
||||
}
|
||||
|
||||
validateFilePath(filepath) {
|
||||
if (!filepath) {
|
||||
throw new Error('load must pass a non-empty string');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.ExplorerBase = ExplorerBase;
|
||||
|
||||
function nextDirUp(dir) {
|
||||
return _path.default.dirname(dir);
|
||||
}
|
||||
|
||||
function getExtensionDescription(filepath) {
|
||||
const ext = _path.default.extname(filepath);
|
||||
|
||||
return ext ? `extension "${ext}"` : 'files without extensions';
|
||||
}
|
||||
//# sourceMappingURL=ExplorerBase.js.map
|
||||
@@ -0,0 +1,20 @@
|
||||
import {
|
||||
PipelineProcessor,
|
||||
PipelineProcessorProps,
|
||||
ProcessorType,
|
||||
} from '../processor';
|
||||
import { ServerStorageOptions } from '../../storage/server';
|
||||
import { TColumnSort } from '../../types';
|
||||
interface ServerSortProps extends PipelineProcessorProps {
|
||||
columns: TColumnSort[];
|
||||
url?: (prevUrl: string, columns: TColumnSort[]) => string;
|
||||
body?: (prevBody: BodyInit, columns: TColumnSort[]) => BodyInit;
|
||||
}
|
||||
declare class ServerSort extends PipelineProcessor<
|
||||
ServerStorageOptions,
|
||||
ServerSortProps
|
||||
> {
|
||||
get type(): ProcessorType;
|
||||
_process(options?: ServerStorageOptions): ServerStorageOptions;
|
||||
}
|
||||
export default ServerSort;
|
||||
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var code = require('./code');
|
||||
|
||||
function isStrictModeReservedWordES6(id) {
|
||||
switch (id) {
|
||||
case 'implements':
|
||||
case 'interface':
|
||||
case 'package':
|
||||
case 'private':
|
||||
case 'protected':
|
||||
case 'public':
|
||||
case 'static':
|
||||
case 'let':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isKeywordES5(id, strict) {
|
||||
// yield should not be treated as keyword under non-strict mode.
|
||||
if (!strict && id === 'yield') {
|
||||
return false;
|
||||
}
|
||||
return isKeywordES6(id, strict);
|
||||
}
|
||||
|
||||
function isKeywordES6(id, strict) {
|
||||
if (strict && isStrictModeReservedWordES6(id)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (id.length) {
|
||||
case 2:
|
||||
return (id === 'if') || (id === 'in') || (id === 'do');
|
||||
case 3:
|
||||
return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try');
|
||||
case 4:
|
||||
return (id === 'this') || (id === 'else') || (id === 'case') ||
|
||||
(id === 'void') || (id === 'with') || (id === 'enum');
|
||||
case 5:
|
||||
return (id === 'while') || (id === 'break') || (id === 'catch') ||
|
||||
(id === 'throw') || (id === 'const') || (id === 'yield') ||
|
||||
(id === 'class') || (id === 'super');
|
||||
case 6:
|
||||
return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
|
||||
(id === 'switch') || (id === 'export') || (id === 'import');
|
||||
case 7:
|
||||
return (id === 'default') || (id === 'finally') || (id === 'extends');
|
||||
case 8:
|
||||
return (id === 'function') || (id === 'continue') || (id === 'debugger');
|
||||
case 10:
|
||||
return (id === 'instanceof');
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isReservedWordES5(id, strict) {
|
||||
return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);
|
||||
}
|
||||
|
||||
function isReservedWordES6(id, strict) {
|
||||
return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);
|
||||
}
|
||||
|
||||
function isRestrictedWord(id) {
|
||||
return id === 'eval' || id === 'arguments';
|
||||
}
|
||||
|
||||
function isIdentifierNameES5(id) {
|
||||
var i, iz, ch;
|
||||
|
||||
if (id.length === 0) { return false; }
|
||||
|
||||
ch = id.charCodeAt(0);
|
||||
if (!code.isIdentifierStartES5(ch)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = 1, iz = id.length; i < iz; ++i) {
|
||||
ch = id.charCodeAt(i);
|
||||
if (!code.isIdentifierPartES5(ch)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function decodeUtf16(lead, trail) {
|
||||
return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
|
||||
}
|
||||
|
||||
function isIdentifierNameES6(id) {
|
||||
var i, iz, ch, lowCh, check;
|
||||
|
||||
if (id.length === 0) { return false; }
|
||||
|
||||
check = code.isIdentifierStartES6;
|
||||
for (i = 0, iz = id.length; i < iz; ++i) {
|
||||
ch = id.charCodeAt(i);
|
||||
if (0xD800 <= ch && ch <= 0xDBFF) {
|
||||
++i;
|
||||
if (i >= iz) { return false; }
|
||||
lowCh = id.charCodeAt(i);
|
||||
if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) {
|
||||
return false;
|
||||
}
|
||||
ch = decodeUtf16(ch, lowCh);
|
||||
}
|
||||
if (!check(ch)) {
|
||||
return false;
|
||||
}
|
||||
check = code.isIdentifierPartES6;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function isIdentifierES5(id, strict) {
|
||||
return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
|
||||
}
|
||||
|
||||
function isIdentifierES6(id, strict) {
|
||||
return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isKeywordES5: isKeywordES5,
|
||||
isKeywordES6: isKeywordES6,
|
||||
isReservedWordES5: isReservedWordES5,
|
||||
isReservedWordES6: isReservedWordES6,
|
||||
isRestrictedWord: isRestrictedWord,
|
||||
isIdentifierNameES5: isIdentifierNameES5,
|
||||
isIdentifierNameES6: isIdentifierNameES6,
|
||||
isIdentifierES5: isIdentifierES5,
|
||||
isIdentifierES6: isIdentifierES6
|
||||
};
|
||||
}());
|
||||
/* vim: set sw=4 ts=4 et tw=80 : */
|
||||
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
|
||||
try { module.exports = eval("(() => {})"); }
|
||||
catch (error) {}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E CC","520":"F A B"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","8":"C K","388":"L G M N O"},C:{"1":"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":"DC tB EC FC","132":"0 1 2 3 I v J D E F A B C K L G M N O w g x y z"},D:{"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 S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"I v","132":"0 J D E F A B C K L G M N O w g x y z"},E:{"1":"sB 6B 7B 8B 9B OC","2":"HC","8":"I v zB IC","520":"J D E F A B C JC KC LC 0B qB","1028":"K rB 1B","7172":"L","8196":"G MC NC 2B 3B 4B 5B"},F:{"1":"0 1 2 3 4 5 6 7 8 9 M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"F PC QC RC","132":"B C G SC qB AC TC rB"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC","1028":"gC hC iC jC kC","3076":"lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"1":"f","2":"pC qC","132":"tB I rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"8":"A B"},O:{"1":"vC"},P:{"1":"g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","132":"I"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:6,C:"WebM video format"};
|
||||
@@ -0,0 +1,14 @@
|
||||
export default class CSVError extends Error {
|
||||
err: string;
|
||||
line: number;
|
||||
extra: string | undefined;
|
||||
static column_mismatched(index: number, extra?: string): CSVError;
|
||||
static unclosed_quote(index: number, extra?: string): CSVError;
|
||||
static fromJSON(obj: any): CSVError;
|
||||
constructor(err: string, line: number, extra?: string | undefined);
|
||||
toJSON(): {
|
||||
err: string;
|
||||
line: number;
|
||||
extra: string | undefined;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { isFunction } from "./isFunction.js";
|
||||
export const isFormData = (value) => Boolean(value
|
||||
&& isFunction(value.constructor)
|
||||
&& value[Symbol.toStringTag] === "FormData"
|
||||
&& isFunction(value.append)
|
||||
&& isFunction(value.getAll)
|
||||
&& isFunction(value.entries)
|
||||
&& isFunction(value[Symbol.iterator]));
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user