new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Alex Indigo
|
||||
|
||||
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 @@
|
||||
import 'rxjs-compat/add/operator/skip';
|
||||
@@ -0,0 +1,3 @@
|
||||
import { ResponseType, Response, ParseJsonFunction } from './types';
|
||||
declare const parseBody: (response: Response, responseType: ResponseType, parseJson: ParseJsonFunction, encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined) => unknown;
|
||||
export default parseBody;
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/Observable';
|
||||
@@ -0,0 +1,48 @@
|
||||
import { OperatorFunction, SubscribableOrPromise } from '../types';
|
||||
/**
|
||||
* Buffers the source Observable values starting from an emission from
|
||||
* `openings` and ending when the output of `closingSelector` emits.
|
||||
*
|
||||
* <span class="informal">Collects values from the past as an array. Starts
|
||||
* collecting only when `opening` emits, and calls the `closingSelector`
|
||||
* function to get an Observable that tells when to close the buffer.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* Buffers values from the source by opening the buffer via signals from an
|
||||
* Observable provided to `openings`, and closing and sending the buffers when
|
||||
* a Subscribable or Promise returned by the `closingSelector` function emits.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Every other second, emit the click events from the next 500ms
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, interval, EMPTY } from 'rxjs';
|
||||
* import { bufferToggle } from 'rxjs/operators';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const openings = interval(1000);
|
||||
* const buffered = clicks.pipe(bufferToggle(openings, i =>
|
||||
* i % 2 ? interval(500) : EMPTY
|
||||
* ));
|
||||
* buffered.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* @see {@link buffer}
|
||||
* @see {@link bufferCount}
|
||||
* @see {@link bufferTime}
|
||||
* @see {@link bufferWhen}
|
||||
* @see {@link windowToggle}
|
||||
*
|
||||
* @param {SubscribableOrPromise<O>} openings A Subscribable or Promise of notifications to start new
|
||||
* buffers.
|
||||
* @param {function(value: O): SubscribableOrPromise} closingSelector A function that takes
|
||||
* the value emitted by the `openings` observable and returns a Subscribable or Promise,
|
||||
* which, when it emits, signals that the associated buffer should be emitted
|
||||
* and cleared.
|
||||
* @return {Observable<T[]>} An observable of arrays of buffered values.
|
||||
* @method bufferToggle
|
||||
* @owner Observable
|
||||
*/
|
||||
export declare function bufferToggle<T, O>(openings: SubscribableOrPromise<O>, closingSelector: (value: O) => SubscribableOrPromise<any>): OperatorFunction<T, T[]>;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","260":"C","514":"K L H"},C:{"1":"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 e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"0 1 2 3 4 5 6 7 CC tB I u J E F G A B C K L H M N O v w x y z DC EC","194":"8 9 AB BB CB DB"},D:{"1":"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 e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z","260":"AB BB CB DB"},E:{"1":"G A B C K L H KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"I u J E GC zB HC IC","260":"F JC"},F:{"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 ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"G B C H M N O v w OC PC QC RC qB 9B SC rB","260":"0 x y z"},G:{"1":"YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"zB TC AC UC VC WC","260":"F XC"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:1,C:"Srcset and sizes attributes"};
|
||||
@@ -0,0 +1,78 @@
|
||||
/* 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';
|
||||
|
||||
/* 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';
|
||||
|
||||
/* Error types */
|
||||
export { ArgumentOutOfRangeError } from './internal/util/ArgumentOutOfRangeError';
|
||||
export { EmptyError } from './internal/util/EmptyError';
|
||||
export { ObjectUnsubscribedError } from './internal/util/ObjectUnsubscribedError';
|
||||
export { UnsubscriptionError } from './internal/util/UnsubscriptionError';
|
||||
export { TimeoutError } from './internal/util/TimeoutError';
|
||||
|
||||
/* 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 { 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 } from './internal/config';
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,92 @@
|
||||
'use strict'
|
||||
|
||||
let CssSyntaxError = require('./css-syntax-error')
|
||||
let Declaration = require('./declaration')
|
||||
let LazyResult = require('./lazy-result')
|
||||
let Container = require('./container')
|
||||
let Processor = require('./processor')
|
||||
let stringify = require('./stringify')
|
||||
let fromJSON = require('./fromJSON')
|
||||
let Warning = require('./warning')
|
||||
let Comment = require('./comment')
|
||||
let AtRule = require('./at-rule')
|
||||
let Result = require('./result.js')
|
||||
let Input = require('./input')
|
||||
let parse = require('./parse')
|
||||
let list = require('./list')
|
||||
let Rule = require('./rule')
|
||||
let Root = require('./root')
|
||||
let Node = require('./node')
|
||||
|
||||
function postcss(...plugins) {
|
||||
if (plugins.length === 1 && Array.isArray(plugins[0])) {
|
||||
plugins = plugins[0]
|
||||
}
|
||||
return new Processor(plugins)
|
||||
}
|
||||
|
||||
postcss.plugin = function plugin(name, initializer) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
name +
|
||||
': postcss.plugin was deprecated. Migration guide:\n' +
|
||||
'https://evilmartians.com/chronicles/postcss-8-plugin-migration'
|
||||
)
|
||||
if (process.env.LANG && process.env.LANG.startsWith('cn')) {
|
||||
// istanbul ignore next
|
||||
console.warn(
|
||||
name +
|
||||
': 里面 postcss.plugin 被弃用. 迁移指南:\n' +
|
||||
'https://www.w3ctech.com/topic/2226'
|
||||
)
|
||||
}
|
||||
}
|
||||
function creator(...args) {
|
||||
let transformer = initializer(...args)
|
||||
transformer.postcssPlugin = name
|
||||
transformer.postcssVersion = new Processor().version
|
||||
return transformer
|
||||
}
|
||||
|
||||
let cache
|
||||
Object.defineProperty(creator, 'postcss', {
|
||||
get() {
|
||||
if (!cache) cache = creator()
|
||||
return cache
|
||||
}
|
||||
})
|
||||
|
||||
creator.process = function (css, processOpts, pluginOpts) {
|
||||
return postcss([creator(pluginOpts)]).process(css, processOpts)
|
||||
}
|
||||
|
||||
return creator
|
||||
}
|
||||
|
||||
postcss.stringify = stringify
|
||||
postcss.parse = parse
|
||||
postcss.fromJSON = fromJSON
|
||||
postcss.list = list
|
||||
|
||||
postcss.comment = defaults => new Comment(defaults)
|
||||
postcss.atRule = defaults => new AtRule(defaults)
|
||||
postcss.decl = defaults => new Declaration(defaults)
|
||||
postcss.rule = defaults => new Rule(defaults)
|
||||
postcss.root = defaults => new Root(defaults)
|
||||
|
||||
postcss.CssSyntaxError = CssSyntaxError
|
||||
postcss.Declaration = Declaration
|
||||
postcss.Container = Container
|
||||
postcss.Comment = Comment
|
||||
postcss.Warning = Warning
|
||||
postcss.AtRule = AtRule
|
||||
postcss.Result = Result
|
||||
postcss.Input = Input
|
||||
postcss.Rule = Rule
|
||||
postcss.Root = Root
|
||||
postcss.Node = Node
|
||||
|
||||
LazyResult.registerPostcss(postcss)
|
||||
|
||||
module.exports = postcss
|
||||
postcss.default = postcss
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2436":"J E F G A B BC"},B:{"260":"N O","2436":"C K L H M","8196":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"2":"CC tB I u J E F G A B C K L H M N O v w x DC EC","772":"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB EB FB GB","4100":"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 e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB"},D:{"2":"I u J E F G A B C","2564":"0 1 2 3 4 5 6 7 8 9 K L H M N O v w x y z AB BB CB DB EB FB GB HB IB","8196":"YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","10244":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB"},E:{"1":"C K L H rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","16":"GC zB","2308":"A B 0B qB","2820":"I u J E F G HC IC JC KC"},F:{"2":"G B OC PC QC RC qB 9B SC","16":"C","516":"rB","2564":"0 1 2 3 4 5 H M N O v w x y z","8196":"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 e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","10244":"6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB"},G:{"1":"eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"zB TC AC","2820":"F UC VC WC XC YC ZC aC bC cC dC"},H:{"2":"nC"},I:{"2":"tB I oC pC qC rC AC","260":"D","2308":"sC tC"},J:{"2":"E","2308":"A"},K:{"2":"A B C qB 9B","16":"rB","8196":"e"},L:{"8196":"D"},M:{"1028":"D"},N:{"2":"A B"},O:{"8196":"uC"},P:{"2052":"vC wC","2308":"I","8196":"xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"8196":"1B"},R:{"8196":"8C"},S:{"4100":"9C"}},B:5,C:"Synchronous Clipboard API"};
|
||||
@@ -0,0 +1 @@
|
||||
import 'rxjs-compat/add/operator/combineLatest';
|
||||
@@ -0,0 +1,23 @@
|
||||
// When on node 14, it validates that all of the commonjs exports
|
||||
// are correctly re-exported for es modules importers.
|
||||
|
||||
const nodeMajor = Number(process.version.split(".")[0].slice(1))
|
||||
if (nodeMajor < 14) {
|
||||
console.log("Skipping because node does not support module exports.")
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
// ES Modules import via the ./modules folder
|
||||
import * as esTSLib from "../../modules/index.js"
|
||||
|
||||
// Force a commonjs resolve
|
||||
import { createRequire } from "module";
|
||||
const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js");
|
||||
|
||||
for (const key in commonJSTSLib) {
|
||||
if (commonJSTSLib.hasOwnProperty(key)) {
|
||||
if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in ./modules/index.js`)
|
||||
}
|
||||
}
|
||||
|
||||
console.log("All exports in commonjs are available for es module consumers.")
|
||||
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isDataURI;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var validMediaType = /^[a-z]+\/[a-z0-9\-\+]+$/i;
|
||||
var validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i;
|
||||
var validData = /^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;
|
||||
|
||||
function isDataURI(str) {
|
||||
(0, _assertString.default)(str);
|
||||
var data = str.split(',');
|
||||
|
||||
if (data.length < 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var attributes = data.shift().trim().split(';');
|
||||
var schemeAndMediaType = attributes.shift();
|
||||
|
||||
if (schemeAndMediaType.substr(0, 5) !== 'data:') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var mediaType = schemeAndMediaType.substr(5);
|
||||
|
||||
if (mediaType !== '' && !validMediaType.test(mediaType)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < attributes.length; i++) {
|
||||
if (i === attributes.length - 1 && attributes[i].toLowerCase() === 'base64') {// ok
|
||||
} else if (!validAttribute.test(attributes[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (var _i = 0; _i < data.length; _i++) {
|
||||
if (!validData.test(data[_i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var TestScheduler_1 = require("../internal/testing/TestScheduler");
|
||||
exports.TestScheduler = TestScheduler_1.TestScheduler;
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operator/auditTime';
|
||||
@@ -0,0 +1,6 @@
|
||||
import { mergeMap } from './mergeMap';
|
||||
import { identity } from '../util/identity';
|
||||
export function mergeAll(concurrent = Number.POSITIVE_INFINITY) {
|
||||
return mergeMap(identity, concurrent);
|
||||
}
|
||||
//# sourceMappingURL=mergeAll.js.map
|
||||
@@ -0,0 +1,108 @@
|
||||
"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 (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
}
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var innerSubscribe_1 = require("../innerSubscribe");
|
||||
function mergeScan(accumulator, seed, concurrent) {
|
||||
if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
|
||||
return function (source) { return source.lift(new MergeScanOperator(accumulator, seed, concurrent)); };
|
||||
}
|
||||
exports.mergeScan = mergeScan;
|
||||
var MergeScanOperator = (function () {
|
||||
function MergeScanOperator(accumulator, seed, concurrent) {
|
||||
this.accumulator = accumulator;
|
||||
this.seed = seed;
|
||||
this.concurrent = concurrent;
|
||||
}
|
||||
MergeScanOperator.prototype.call = function (subscriber, source) {
|
||||
return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent));
|
||||
};
|
||||
return MergeScanOperator;
|
||||
}());
|
||||
exports.MergeScanOperator = MergeScanOperator;
|
||||
var MergeScanSubscriber = (function (_super) {
|
||||
__extends(MergeScanSubscriber, _super);
|
||||
function MergeScanSubscriber(destination, accumulator, acc, concurrent) {
|
||||
var _this = _super.call(this, destination) || this;
|
||||
_this.accumulator = accumulator;
|
||||
_this.acc = acc;
|
||||
_this.concurrent = concurrent;
|
||||
_this.hasValue = false;
|
||||
_this.hasCompleted = false;
|
||||
_this.buffer = [];
|
||||
_this.active = 0;
|
||||
_this.index = 0;
|
||||
return _this;
|
||||
}
|
||||
MergeScanSubscriber.prototype._next = function (value) {
|
||||
if (this.active < this.concurrent) {
|
||||
var index = this.index++;
|
||||
var destination = this.destination;
|
||||
var ish = void 0;
|
||||
try {
|
||||
var accumulator = this.accumulator;
|
||||
ish = accumulator(this.acc, value, index);
|
||||
}
|
||||
catch (e) {
|
||||
return destination.error(e);
|
||||
}
|
||||
this.active++;
|
||||
this._innerSub(ish);
|
||||
}
|
||||
else {
|
||||
this.buffer.push(value);
|
||||
}
|
||||
};
|
||||
MergeScanSubscriber.prototype._innerSub = function (ish) {
|
||||
var innerSubscriber = new innerSubscribe_1.SimpleInnerSubscriber(this);
|
||||
var destination = this.destination;
|
||||
destination.add(innerSubscriber);
|
||||
var innerSubscription = innerSubscribe_1.innerSubscribe(ish, innerSubscriber);
|
||||
if (innerSubscription !== innerSubscriber) {
|
||||
destination.add(innerSubscription);
|
||||
}
|
||||
};
|
||||
MergeScanSubscriber.prototype._complete = function () {
|
||||
this.hasCompleted = true;
|
||||
if (this.active === 0 && this.buffer.length === 0) {
|
||||
if (this.hasValue === false) {
|
||||
this.destination.next(this.acc);
|
||||
}
|
||||
this.destination.complete();
|
||||
}
|
||||
this.unsubscribe();
|
||||
};
|
||||
MergeScanSubscriber.prototype.notifyNext = function (innerValue) {
|
||||
var destination = this.destination;
|
||||
this.acc = innerValue;
|
||||
this.hasValue = true;
|
||||
destination.next(innerValue);
|
||||
};
|
||||
MergeScanSubscriber.prototype.notifyComplete = function () {
|
||||
var buffer = this.buffer;
|
||||
this.active--;
|
||||
if (buffer.length > 0) {
|
||||
this._next(buffer.shift());
|
||||
}
|
||||
else if (this.active === 0 && this.hasCompleted) {
|
||||
if (this.hasValue === false) {
|
||||
this.destination.next(this.acc);
|
||||
}
|
||||
this.destination.complete();
|
||||
}
|
||||
};
|
||||
return MergeScanSubscriber;
|
||||
}(innerSubscribe_1.SimpleOuterSubscriber));
|
||||
exports.MergeScanSubscriber = MergeScanSubscriber;
|
||||
//# sourceMappingURL=mergeScan.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0.01573,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0.00524,"46":0.00524,"47":0.00524,"48":0.01049,"49":0.01049,"50":0.00524,"51":0.01049,"52":0.00524,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.00524,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00524,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0.00524,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0.01049,"96":0,"97":0,"98":0,"99":0.00524,"100":0,"101":0,"102":0.00524,"103":0.00524,"104":0.00524,"105":0.00524,"106":0.01049,"107":0.01049,"108":0.43525,"109":0.22025,"110":0,"111":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00524,"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.00524,"31":0,"32":0,"33":0,"34":0.01573,"35":0,"36":0,"37":0,"38":0.06293,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.07866,"50":0.00524,"51":0.00524,"52":0.00524,"53":0.05768,"54":0.00524,"55":0.01049,"56":0.02098,"57":0,"58":0.00524,"59":0,"60":0,"61":0.02622,"62":0.00524,"63":0.00524,"64":0.00524,"65":0.00524,"66":0.00524,"67":0.01049,"68":0.00524,"69":0.00524,"70":0.00524,"71":0.01049,"72":0.00524,"73":0.00524,"74":0.01049,"75":0.00524,"76":0.00524,"77":0.00524,"78":0.00524,"79":0.3094,"80":0.01049,"81":0.02622,"83":0.02098,"84":0.01049,"85":0.01049,"86":0.02098,"87":0.05768,"88":0.00524,"89":0.02622,"90":0.01049,"91":0.01573,"92":0.02098,"93":0.00524,"94":0.01049,"95":0.01049,"96":0.02098,"97":0.04195,"98":0.02098,"99":0.02098,"100":0.02098,"101":0.02098,"102":0.03146,"103":0.10488,"104":0.03671,"105":0.06817,"106":0.07866,"107":0.16781,"108":8.85187,"109":7.54612,"110":0.01049,"111":0.00524,"112":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.01573,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0.01049,"37":0.00524,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.05244,"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,"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.00524,"94":0.06293,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0.00524,"18":0.01049,"79":0,"80":0,"81":0,"83":0,"84":0.00524,"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.00524,"102":0,"103":0.00524,"104":0.00524,"105":0.00524,"106":0.00524,"107":0.02622,"108":1.1799,"109":1.01734},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.04195,"14":0.1311,"15":0.02098,_:"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.00524,"12.1":0.02622,"13.1":0.09439,"14.1":0.35659,"15.1":0.04195,"15.2-15.3":0.03671,"15.4":0.14683,"15.5":0.3094,"15.6":1.43161,"16.0":0.0472,"16.1":0.24122,"16.2":0.51391,"16.3":0.02622},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.04534,"6.0-6.1":0.01889,"7.0-7.1":0.17001,"8.1-8.4":0.06801,"9.0-9.2":0.02645,"9.3":0.35136,"10.0-10.2":0.02267,"10.3":0.37781,"11.0-11.2":0.04156,"11.3-11.4":0.04912,"12.0-12.1":0.09823,"12.2-12.5":1.07676,"13.0-13.1":0.06801,"13.2":0.03022,"13.3":0.1209,"13.4-13.7":0.26069,"14.0-14.4":1.5528,"14.5-14.8":2.2782,"15.0-15.1":0.84252,"15.2-15.3":0.91052,"15.4":1.26944,"15.5":1.91928,"15.6":5.53115,"16.0":3.82345,"16.1":8.81055,"16.2":5.4027,"16.3":0.32492},P:{"4":0.67075,"5.0-5.4":0.04398,"6.2-6.4":0,"7.2-7.4":0,"8.2":0.011,"9.2":0.03299,"10.1":0.011,"11.1-11.2":0.04398,"12.0":0.02199,"13.0":0.10996,"14.0":0.05498,"15.0":0.05498,"16.0":0.12095,"17.0":0.15394,"18.0":0.25291,"19.0":2.54005},I:{"0":0,"3":0,"4":0.00833,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00417,"4.2-4.3":0.02083,"4.4":0,"4.4.3-4.4.4":0.09582},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.08915,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},L:{"0":32.4734},S:{"2.5":0},R:{_:"0"},M:{"0":0.10463},Q:{"13.1":0.00951},O:{"0":0.10939},H:{"0":0.1756}};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0.00453,"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.00453,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0.00453,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.00453,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.00453,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.04078,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0.02266,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0.01359,"100":0,"101":0,"102":0.00453,"103":0,"104":0.00453,"105":0.00453,"106":0.00453,"107":0.00906,"108":0.37154,"109":0.22202,"110":0.00453,"111":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.00453,"36":0,"37":0,"38":0.00453,"39":0.00453,"40":0.00453,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0.00906,"48":0,"49":0.03172,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0.00453,"57":0,"58":0.00906,"59":0.00453,"60":0,"61":0,"62":0.00453,"63":0.00453,"64":0,"65":0,"66":0.00906,"67":0,"68":0.01812,"69":0,"70":0.00453,"71":0,"72":0,"73":0.02266,"74":0.00906,"75":0,"76":0.01359,"77":0,"78":0.01359,"79":0.10421,"80":0.00906,"81":0.01359,"83":0.09062,"84":0.00453,"85":0.01359,"86":0.07703,"87":0.04531,"88":0.00906,"89":0.00453,"90":0.03625,"91":0.01812,"92":0.01359,"93":0.00453,"94":0.01812,"95":0.01359,"96":0.00906,"97":0.01359,"98":0.03172,"99":0.01812,"100":0.01359,"101":0.00906,"102":0.03625,"103":0.06343,"104":0.03625,"105":0.02719,"106":0.05437,"107":0.14952,"108":7.05024,"109":6.05795,"110":0.00453,"111":0.00453,"112":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.01812,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0.00453,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.02719,"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.00906,"64":0,"65":0,"66":0.00453,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00906,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0.01359,"80":0,"81":0,"82":0.00453,"83":0,"84":0.00906,"85":0.02719,"86":0.00453,"87":0,"88":0,"89":0.00453,"90":0,"91":0,"92":0.00453,"93":0.37607,"94":1.0965,"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.00453,"13":0.01812,"14":0.04531,"15":0.00453,"16":0.02266,"17":0.00453,"18":0.02719,"79":0,"80":0,"81":0,"83":0,"84":0.00453,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.01359,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0.00453,"99":0.00453,"100":0,"101":0.01359,"102":0,"103":0.00453,"104":0.00453,"105":0.00906,"106":0.01359,"107":0.04984,"108":0.87448,"109":0.77027},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00453,"14":0.01359,"15":0.00906,_:"0","3.1":0,"3.2":0,"5.1":0.00453,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00453,"13.1":0.03172,"14.1":0.04078,"15.1":0.04984,"15.2-15.3":0.00906,"15.4":0.02266,"15.5":0.0589,"15.6":0.14499,"16.0":0.02719,"16.1":0.11328,"16.2":0.14499,"16.3":0.01359},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.04657,"6.0-6.1":0,"7.0-7.1":0.18806,"8.1-8.4":0,"9.0-9.2":0.00358,"9.3":0.06985,"10.0-10.2":0,"10.3":0.12717,"11.0-11.2":0.06448,"11.3-11.4":0.01612,"12.0-12.1":0.01791,"12.2-12.5":0.84539,"13.0-13.1":0.00716,"13.2":0.00896,"13.3":0.08955,"13.4-13.7":0.10567,"14.0-14.4":0.36896,"14.5-14.8":0.72718,"15.0-15.1":0.19344,"15.2-15.3":0.28836,"15.4":0.35642,"15.5":0.61076,"15.6":1.41674,"16.0":3.09856,"16.1":4.22336,"16.2":2.81378,"16.3":0.28836},P:{"4":0.73289,"5.0-5.4":0.03097,"6.2-6.4":0,"7.2-7.4":0.07226,"8.2":0,"9.2":0.01032,"10.1":0,"11.1-11.2":0.02064,"12.0":0.01032,"13.0":0.04129,"14.0":0.02064,"15.0":0.01032,"16.0":0.05161,"17.0":0.06193,"18.0":0.07226,"19.0":1.24902},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.0347,"4.2-4.3":0.19086,"4.4":0,"4.4.3-4.4.4":0.7808},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.02266,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.0711},Q:{"13.1":0},O:{"0":0.04922},H:{"0":0.26924},L:{"0":59.03121},S:{"2.5":0}};
|
||||
@@ -0,0 +1,42 @@
|
||||
declare namespace latestVersion {
|
||||
interface Options {
|
||||
/**
|
||||
A semver range or [dist-tag](https://docs.npmjs.com/cli/dist-tag).
|
||||
*/
|
||||
readonly version?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare const latestVersion: {
|
||||
/**
|
||||
Get the latest version of an npm package.
|
||||
|
||||
@example
|
||||
```
|
||||
import latestVersion = require('latest-version');
|
||||
|
||||
(async () => {
|
||||
console.log(await latestVersion('ava'));
|
||||
//=> '0.18.0'
|
||||
|
||||
console.log(await latestVersion('@sindresorhus/df'));
|
||||
//=> '1.0.1'
|
||||
|
||||
// Also works with semver ranges and dist-tags
|
||||
console.log(await latestVersion('npm', {version: 'latest-5'}));
|
||||
//=> '5.5.1'
|
||||
})();
|
||||
```
|
||||
*/
|
||||
(packageName: string, options?: latestVersion.Options): Promise<string>;
|
||||
|
||||
// TODO: Remove this for the next major release, refactor the whole definition to:
|
||||
// declare function latestVersion(
|
||||
// packageName: string,
|
||||
// options?: latestVersion.Options
|
||||
// ): Promise<string>;
|
||||
// export = latestVersion;
|
||||
default: typeof latestVersion;
|
||||
};
|
||||
|
||||
export = latestVersion;
|
||||
@@ -0,0 +1,236 @@
|
||||
# flat [](http://travis-ci.org/hughsk/flat)
|
||||
|
||||
Take a nested Javascript object and flatten it, or unflatten an object with
|
||||
delimited keys.
|
||||
|
||||
## Installation
|
||||
|
||||
``` bash
|
||||
$ npm install flat
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
### flatten(original, options)
|
||||
|
||||
Flattens the object - it'll return an object one level deep, regardless of how
|
||||
nested the original object was:
|
||||
|
||||
``` javascript
|
||||
var flatten = require('flat')
|
||||
|
||||
flatten({
|
||||
key1: {
|
||||
keyA: 'valueI'
|
||||
},
|
||||
key2: {
|
||||
keyB: 'valueII'
|
||||
},
|
||||
key3: { a: { b: { c: 2 } } }
|
||||
})
|
||||
|
||||
// {
|
||||
// 'key1.keyA': 'valueI',
|
||||
// 'key2.keyB': 'valueII',
|
||||
// 'key3.a.b.c': 2
|
||||
// }
|
||||
```
|
||||
|
||||
### unflatten(original, options)
|
||||
|
||||
Flattening is reversible too, you can call `flatten.unflatten()` on an object:
|
||||
|
||||
``` javascript
|
||||
var unflatten = require('flat').unflatten
|
||||
|
||||
unflatten({
|
||||
'three.levels.deep': 42,
|
||||
'three.levels': {
|
||||
nested: true
|
||||
}
|
||||
})
|
||||
|
||||
// {
|
||||
// three: {
|
||||
// levels: {
|
||||
// deep: 42,
|
||||
// nested: true
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### delimiter
|
||||
|
||||
Use a custom delimiter for (un)flattening your objects, instead of `.`.
|
||||
|
||||
### safe
|
||||
|
||||
When enabled, both `flat` and `unflatten` will preserve arrays and their
|
||||
contents. This is disabled by default.
|
||||
|
||||
``` javascript
|
||||
var flatten = require('flat')
|
||||
|
||||
flatten({
|
||||
this: [
|
||||
{ contains: 'arrays' },
|
||||
{ preserving: {
|
||||
them: 'for you'
|
||||
}}
|
||||
]
|
||||
}, {
|
||||
safe: true
|
||||
})
|
||||
|
||||
// {
|
||||
// 'this': [
|
||||
// { contains: 'arrays' },
|
||||
// { preserving: {
|
||||
// them: 'for you'
|
||||
// }}
|
||||
// ]
|
||||
// }
|
||||
```
|
||||
|
||||
### object
|
||||
|
||||
When enabled, arrays will not be created automatically when calling unflatten, like so:
|
||||
|
||||
``` javascript
|
||||
unflatten({
|
||||
'hello.you.0': 'ipsum',
|
||||
'hello.you.1': 'lorem',
|
||||
'hello.other.world': 'foo'
|
||||
}, { object: true })
|
||||
|
||||
// hello: {
|
||||
// you: {
|
||||
// 0: 'ipsum',
|
||||
// 1: 'lorem',
|
||||
// },
|
||||
// other: { world: 'foo' }
|
||||
// }
|
||||
```
|
||||
|
||||
### overwrite
|
||||
|
||||
When enabled, existing keys in the unflattened object may be overwritten if they cannot hold a newly encountered nested value:
|
||||
|
||||
```javascript
|
||||
unflatten({
|
||||
'TRAVIS': 'true',
|
||||
'TRAVIS.DIR': '/home/travis/build/kvz/environmental'
|
||||
}, { overwrite: true })
|
||||
|
||||
// TRAVIS: {
|
||||
// DIR: '/home/travis/build/kvz/environmental'
|
||||
// }
|
||||
```
|
||||
|
||||
Without `overwrite` set to `true`, the `TRAVIS` key would already have been set to a string, thus could not accept the nested `DIR` element.
|
||||
|
||||
This only makes sense on ordered arrays, and since we're overwriting data, should be used with care.
|
||||
|
||||
|
||||
### maxDepth
|
||||
|
||||
Maximum number of nested objects to flatten.
|
||||
|
||||
``` javascript
|
||||
var flatten = require('flat')
|
||||
|
||||
flatten({
|
||||
key1: {
|
||||
keyA: 'valueI'
|
||||
},
|
||||
key2: {
|
||||
keyB: 'valueII'
|
||||
},
|
||||
key3: { a: { b: { c: 2 } } }
|
||||
}, { maxDepth: 2 })
|
||||
|
||||
// {
|
||||
// 'key1.keyA': 'valueI',
|
||||
// 'key2.keyB': 'valueII',
|
||||
// 'key3.a': { b: { c: 2 } }
|
||||
// }
|
||||
```
|
||||
|
||||
### transformKey
|
||||
|
||||
Transform each part of a flat key before and after flattening.
|
||||
|
||||
```javascript
|
||||
var flatten = require('flat')
|
||||
var unflatten = require('flat').unflatten
|
||||
|
||||
flatten({
|
||||
key1: {
|
||||
keyA: 'valueI'
|
||||
},
|
||||
key2: {
|
||||
keyB: 'valueII'
|
||||
},
|
||||
key3: { a: { b: { c: 2 } } }
|
||||
}, {
|
||||
transformKey: function(key){
|
||||
return '__' + key + '__';
|
||||
}
|
||||
})
|
||||
|
||||
// {
|
||||
// '__key1__.__keyA__': 'valueI',
|
||||
// '__key2__.__keyB__': 'valueII',
|
||||
// '__key3__.__a__.__b__.__c__': 2
|
||||
// }
|
||||
|
||||
unflatten({
|
||||
'__key1__.__keyA__': 'valueI',
|
||||
'__key2__.__keyB__': 'valueII',
|
||||
'__key3__.__a__.__b__.__c__': 2
|
||||
}, {
|
||||
transformKey: function(key){
|
||||
return key.substring(2, key.length - 2)
|
||||
}
|
||||
})
|
||||
|
||||
// {
|
||||
// key1: {
|
||||
// keyA: 'valueI'
|
||||
// },
|
||||
// key2: {
|
||||
// keyB: 'valueII'
|
||||
// },
|
||||
// key3: { a: { b: { c: 2 } } }
|
||||
// }
|
||||
```
|
||||
|
||||
## Command Line Usage
|
||||
|
||||
`flat` is also available as a command line tool. You can run it with
|
||||
[`npx`](https://ghub.io/npx):
|
||||
|
||||
```sh
|
||||
npx flat foo.json
|
||||
```
|
||||
|
||||
Or install the `flat` command globally:
|
||||
|
||||
```sh
|
||||
npm i -g flat && flat foo.json
|
||||
```
|
||||
|
||||
Accepts a filename as an argument:
|
||||
|
||||
```sh
|
||||
flat foo.json
|
||||
```
|
||||
|
||||
Also accepts JSON on stdin:
|
||||
|
||||
```sh
|
||||
cat foo.json | flat
|
||||
```
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
import assertString from './util/assertString';
|
||||
var rgbColor = /^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/;
|
||||
var rgbaColor = /^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;
|
||||
var rgbColorPercent = /^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)/;
|
||||
var rgbaColorPercent = /^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)/;
|
||||
export default function isRgbColor(str) {
|
||||
var includePercentValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
assertString(str);
|
||||
|
||||
if (!includePercentValues) {
|
||||
return rgbColor.test(str) || rgbaColor.test(str);
|
||||
}
|
||||
|
||||
return rgbColor.test(str) || rgbaColor.test(str) || rgbColorPercent.test(str) || rgbaColorPercent.test(str);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A BC","132":"B"},B:{"1":"H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","16":"C K L"},C:{"1":"0 1 2 3 4 5 6 7 8 9 v w 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 e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"CC tB I u J E F G A B C K L H M N O DC EC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 H M N O v w 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 e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","16":"I u J E F G A B C K L"},E:{"1":"I u J E F G A B C K L H HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","16":"GC zB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 C H M N O v w 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 e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d rB","2":"G B OC PC QC RC qB 9B SC"},G:{"1":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"2":"tB I D oC pC qC rC AC sC tC"},J:{"16":"E A"},K:{"2":"A B C e qB 9B rB"},L:{"2":"D"},M:{"2":"D"},N:{"16":"A B"},O:{"2":"uC"},P:{"2":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"2":"8C"},S:{"2":"9C"}},B:6,C:"Built-in PDF viewer"};
|
||||
@@ -0,0 +1,260 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const childProcess = require('child_process');
|
||||
const crossSpawn = require('cross-spawn');
|
||||
const stripFinalNewline = require('strip-final-newline');
|
||||
const npmRunPath = require('npm-run-path');
|
||||
const onetime = require('onetime');
|
||||
const makeError = require('./lib/error');
|
||||
const normalizeStdio = require('./lib/stdio');
|
||||
const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = require('./lib/kill');
|
||||
const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = require('./lib/stream.js');
|
||||
const {mergePromise, getSpawnedPromise} = require('./lib/promise.js');
|
||||
const {joinCommand, parseCommand} = require('./lib/command.js');
|
||||
|
||||
const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;
|
||||
|
||||
const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => {
|
||||
const env = extendEnv ? {...process.env, ...envOption} : envOption;
|
||||
|
||||
if (preferLocal) {
|
||||
return npmRunPath.env({env, cwd: localDir, execPath});
|
||||
}
|
||||
|
||||
return env;
|
||||
};
|
||||
|
||||
const handleArguments = (file, args, options = {}) => {
|
||||
const parsed = crossSpawn._parse(file, args, options);
|
||||
file = parsed.command;
|
||||
args = parsed.args;
|
||||
options = parsed.options;
|
||||
|
||||
options = {
|
||||
maxBuffer: DEFAULT_MAX_BUFFER,
|
||||
buffer: true,
|
||||
stripFinalNewline: true,
|
||||
extendEnv: true,
|
||||
preferLocal: false,
|
||||
localDir: options.cwd || process.cwd(),
|
||||
execPath: process.execPath,
|
||||
encoding: 'utf8',
|
||||
reject: true,
|
||||
cleanup: true,
|
||||
all: false,
|
||||
windowsHide: true,
|
||||
...options
|
||||
};
|
||||
|
||||
options.env = getEnv(options);
|
||||
|
||||
options.stdio = normalizeStdio(options);
|
||||
|
||||
if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') {
|
||||
// #116
|
||||
args.unshift('/q');
|
||||
}
|
||||
|
||||
return {file, args, options, parsed};
|
||||
};
|
||||
|
||||
const handleOutput = (options, value, error) => {
|
||||
if (typeof value !== 'string' && !Buffer.isBuffer(value)) {
|
||||
// When `execa.sync()` errors, we normalize it to '' to mimic `execa()`
|
||||
return error === undefined ? undefined : '';
|
||||
}
|
||||
|
||||
if (options.stripFinalNewline) {
|
||||
return stripFinalNewline(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
const execa = (file, args, options) => {
|
||||
const parsed = handleArguments(file, args, options);
|
||||
const command = joinCommand(file, args);
|
||||
|
||||
let spawned;
|
||||
try {
|
||||
spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
|
||||
} catch (error) {
|
||||
// Ensure the returned error is always both a promise and a child process
|
||||
const dummySpawned = new childProcess.ChildProcess();
|
||||
const errorPromise = Promise.reject(makeError({
|
||||
error,
|
||||
stdout: '',
|
||||
stderr: '',
|
||||
all: '',
|
||||
command,
|
||||
parsed,
|
||||
timedOut: false,
|
||||
isCanceled: false,
|
||||
killed: false
|
||||
}));
|
||||
return mergePromise(dummySpawned, errorPromise);
|
||||
}
|
||||
|
||||
const spawnedPromise = getSpawnedPromise(spawned);
|
||||
const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
|
||||
const processDone = setExitHandler(spawned, parsed.options, timedPromise);
|
||||
|
||||
const context = {isCanceled: false};
|
||||
|
||||
spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
|
||||
spawned.cancel = spawnedCancel.bind(null, spawned, context);
|
||||
|
||||
const handlePromise = async () => {
|
||||
const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
|
||||
const stdout = handleOutput(parsed.options, stdoutResult);
|
||||
const stderr = handleOutput(parsed.options, stderrResult);
|
||||
const all = handleOutput(parsed.options, allResult);
|
||||
|
||||
if (error || exitCode !== 0 || signal !== null) {
|
||||
const returnedError = makeError({
|
||||
error,
|
||||
exitCode,
|
||||
signal,
|
||||
stdout,
|
||||
stderr,
|
||||
all,
|
||||
command,
|
||||
parsed,
|
||||
timedOut,
|
||||
isCanceled: context.isCanceled,
|
||||
killed: spawned.killed
|
||||
});
|
||||
|
||||
if (!parsed.options.reject) {
|
||||
return returnedError;
|
||||
}
|
||||
|
||||
throw returnedError;
|
||||
}
|
||||
|
||||
return {
|
||||
command,
|
||||
exitCode: 0,
|
||||
stdout,
|
||||
stderr,
|
||||
all,
|
||||
failed: false,
|
||||
timedOut: false,
|
||||
isCanceled: false,
|
||||
killed: false
|
||||
};
|
||||
};
|
||||
|
||||
const handlePromiseOnce = onetime(handlePromise);
|
||||
|
||||
crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
|
||||
|
||||
handleInput(spawned, parsed.options.input);
|
||||
|
||||
spawned.all = makeAllStream(spawned, parsed.options);
|
||||
|
||||
return mergePromise(spawned, handlePromiseOnce);
|
||||
};
|
||||
|
||||
module.exports = execa;
|
||||
|
||||
module.exports.sync = (file, args, options) => {
|
||||
const parsed = handleArguments(file, args, options);
|
||||
const command = joinCommand(file, args);
|
||||
|
||||
validateInputSync(parsed.options);
|
||||
|
||||
let result;
|
||||
try {
|
||||
result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);
|
||||
} catch (error) {
|
||||
throw makeError({
|
||||
error,
|
||||
stdout: '',
|
||||
stderr: '',
|
||||
all: '',
|
||||
command,
|
||||
parsed,
|
||||
timedOut: false,
|
||||
isCanceled: false,
|
||||
killed: false
|
||||
});
|
||||
}
|
||||
|
||||
const stdout = handleOutput(parsed.options, result.stdout, result.error);
|
||||
const stderr = handleOutput(parsed.options, result.stderr, result.error);
|
||||
|
||||
if (result.error || result.status !== 0 || result.signal !== null) {
|
||||
const error = makeError({
|
||||
stdout,
|
||||
stderr,
|
||||
error: result.error,
|
||||
signal: result.signal,
|
||||
exitCode: result.status,
|
||||
command,
|
||||
parsed,
|
||||
timedOut: result.error && result.error.code === 'ETIMEDOUT',
|
||||
isCanceled: false,
|
||||
killed: result.signal !== null
|
||||
});
|
||||
|
||||
if (!parsed.options.reject) {
|
||||
return error;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
return {
|
||||
command,
|
||||
exitCode: 0,
|
||||
stdout,
|
||||
stderr,
|
||||
failed: false,
|
||||
timedOut: false,
|
||||
isCanceled: false,
|
||||
killed: false
|
||||
};
|
||||
};
|
||||
|
||||
module.exports.command = (command, options) => {
|
||||
const [file, ...args] = parseCommand(command);
|
||||
return execa(file, args, options);
|
||||
};
|
||||
|
||||
module.exports.commandSync = (command, options) => {
|
||||
const [file, ...args] = parseCommand(command);
|
||||
return execa.sync(file, args, options);
|
||||
};
|
||||
|
||||
module.exports.node = (scriptPath, args, options = {}) => {
|
||||
if (args && !Array.isArray(args) && typeof args === 'object') {
|
||||
options = args;
|
||||
args = [];
|
||||
}
|
||||
|
||||
const stdio = normalizeStdio.node(options);
|
||||
const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect'));
|
||||
|
||||
const {
|
||||
nodePath = process.execPath,
|
||||
nodeOptions = defaultExecArgv
|
||||
} = options;
|
||||
|
||||
return execa(
|
||||
nodePath,
|
||||
[
|
||||
...nodeOptions,
|
||||
scriptPath,
|
||||
...(Array.isArray(args) ? args : [])
|
||||
],
|
||||
{
|
||||
...options,
|
||||
stdin: undefined,
|
||||
stdout: undefined,
|
||||
stderr: undefined,
|
||||
stdio,
|
||||
shell: false
|
||||
}
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("rxjs-compat/operators/sampleTime"));
|
||||
//# sourceMappingURL=sampleTime.js.map
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("rxjs-compat/operators/bufferTime"));
|
||||
//# sourceMappingURL=bufferTime.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"N O","2":"C K L H M","257":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB DC EC","257":"KB MB NB OB PB QB RB TB UB VB WB XB YB uB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","1281":"LB SB ZB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB","257":"QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","388":"KB LB MB NB OB PB"},E:{"2":"I u J GC zB HC IC","514":"E F G A B C K L H JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB","4612":"6B 7B 8B NC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB OC PC QC RC qB 9B SC rB","16":"DB EB FB GB HB","257":"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 e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d"},G:{"2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"2":"tB I D oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"2":"8C"},S:{"257":"9C"}},B:5,C:"Push API"};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"s D t","2":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o","194":"p q r"},C:{"1":"l m n o p q r s D t xB yB","2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w 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 e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k DC EC"},D:{"1":"s D t xB yB FC","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w 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 e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j","194":"k l m n o p q r"},E:{"1":"3B 4B 5B sB 6B 7B 8B NC","2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B"},F:{"1":"d","2":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w 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 e lB mB nB oB pB P Q R wB S T U V W X Y Z OC PC QC RC qB 9B SC rB","194":"a b c"},G:{"1":"3B 4B 5B sB 6B 7B 8B","2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"2":"A B C e qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"uC"},P:{"2":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"2":"1B"},R:{"2":"8C"},S:{"2":"9C"}},B:5,C:"Small, Large, and Dynamic viewport units"};
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "rxjs/testing",
|
||||
"typings": "./index.d.ts",
|
||||
"main": "./index.js",
|
||||
"module": "../_esm5/testing/index.js",
|
||||
"es2015": "../_esm2015/testing/index.js",
|
||||
"sideEffects": false
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operator/every';
|
||||
Reference in New Issue
Block a user