new license file version [CI SKIP]

This commit is contained in:
2023-03-15 13:43:57 +00:00
parent d8a3063735
commit 00359d25c1
5600 changed files with 523898 additions and 2 deletions

View File

@@ -0,0 +1 @@
{"name":"chalk","version":"4.1.0","files":{"license":{"checkedAt":1678887829653,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"source/index.js":{"checkedAt":1678887830520,"integrity":"sha512-bm9r2fxPG5vpwd8qhm2+xozcBBaaQsfaRmf+TNabaGR70nVy1d2PvBOeyaRgbr2v/ZsjrEObbA6fNtDQIaWM8w==","mode":420,"size":6075},"source/templates.js":{"checkedAt":1678887830520,"integrity":"sha512-2bH4hJ4J6+DMzgmVmTzPf4PuOPlBTO+/DvNNyuIdQvMVzK1AMqQO6913UXZeM4Qj/n+05bhbcdXeu+O7qJTZ+A==","mode":420,"size":3367},"source/util.js":{"checkedAt":1678887830520,"integrity":"sha512-niRJz5zRCOfRW8aMV7RatOy7hLjsfWwuejZ6R6pO3mXHxKpXCzmUC+dyFMZmcwwfpSUKx2dANFtuDu+FLM+KUg==","mode":420,"size":1035},"package.json":{"checkedAt":1678887830520,"integrity":"sha512-TsW/rGoFwNEpwyQ1DrTwf2oldcQSTLHvM28GuykW+zBLZSpo3GYtdJhUsbvjhJ9bh0ue4FyG0EMRhGwjXqCGhg==","mode":420,"size":1197},"readme.md":{"checkedAt":1678887830520,"integrity":"sha512-/5BH4RUHIMWYXovQLV/cV2QjA9PO68WgSuPuO9R/e9l88yCi3uJSlmWOVGO/Ed2Dv2BBbh2/RGZo8I3LDlNCQQ==","mode":420,"size":11949},"index.d.ts":{"checkedAt":1678887830532,"integrity":"sha512-Un4AkHM1HBNbSz0E13bQHd3RNvh8Q4BLb/9Jn/fWPw1pj80+4F/jN0gMIOSWd2dlzIrmT1wESetR0MjopAoukQ==","mode":420,"size":8899}}}

View File

@@ -0,0 +1,297 @@
'use strict'
let { dirname, resolve, relative, sep } = require('path')
let { pathToFileURL } = require('url')
let mozilla = require('source-map')
let pathAvailable = Boolean(dirname && resolve && relative && sep)
class MapGenerator {
constructor(stringify, root, opts) {
this.stringify = stringify
this.mapOpts = opts.map || {}
this.root = root
this.opts = opts
}
isMap() {
if (typeof this.opts.map !== 'undefined') {
return !!this.opts.map
}
return this.previous().length > 0
}
previous() {
if (!this.previousMaps) {
this.previousMaps = []
this.root.walk(node => {
if (node.source && node.source.input.map) {
let map = node.source.input.map
if (!this.previousMaps.includes(map)) {
this.previousMaps.push(map)
}
}
})
}
return this.previousMaps
}
isInline() {
if (typeof this.mapOpts.inline !== 'undefined') {
return this.mapOpts.inline
}
let annotation = this.mapOpts.annotation
if (typeof annotation !== 'undefined' && annotation !== true) {
return false
}
if (this.previous().length) {
return this.previous().some(i => i.inline)
}
return true
}
isSourcesContent() {
if (typeof this.mapOpts.sourcesContent !== 'undefined') {
return this.mapOpts.sourcesContent
}
if (this.previous().length) {
return this.previous().some(i => i.withContent())
}
return true
}
clearAnnotation() {
if (this.mapOpts.annotation === false) return
let node
for (let i = this.root.nodes.length - 1; i >= 0; i--) {
node = this.root.nodes[i]
if (node.type !== 'comment') continue
if (node.text.indexOf('# sourceMappingURL=') === 0) {
this.root.removeChild(i)
}
}
}
setSourcesContent() {
let already = {}
this.root.walk(node => {
if (node.source) {
let from = node.source.input.from
if (from && !already[from]) {
already[from] = true
this.map.setSourceContent(
this.toUrl(this.path(from)),
node.source.input.css
)
}
}
})
}
applyPrevMaps() {
for (let prev of this.previous()) {
let from = this.toUrl(this.path(prev.file))
let root = prev.root || dirname(prev.file)
let map
if (this.mapOpts.sourcesContent === false) {
map = new mozilla.SourceMapConsumer(prev.text)
if (map.sourcesContent) {
map.sourcesContent = map.sourcesContent.map(() => null)
}
} else {
map = prev.consumer()
}
this.map.applySourceMap(map, from, this.toUrl(this.path(root)))
}
}
isAnnotation() {
if (this.isInline()) {
return true
}
if (typeof this.mapOpts.annotation !== 'undefined') {
return this.mapOpts.annotation
}
if (this.previous().length) {
return this.previous().some(i => i.annotation)
}
return true
}
toBase64(str) {
if (Buffer) {
return Buffer.from(str).toString('base64')
} else {
// istanbul ignore next
return window.btoa(unescape(encodeURIComponent(str)))
}
}
addAnnotation() {
let content
if (this.isInline()) {
content =
'data:application/json;base64,' + this.toBase64(this.map.toString())
} else if (typeof this.mapOpts.annotation === 'string') {
content = this.mapOpts.annotation
} else if (typeof this.mapOpts.annotation === 'function') {
content = this.mapOpts.annotation(this.opts.to, this.root)
} else {
content = this.outputFile() + '.map'
}
let eol = '\n'
if (this.css.includes('\r\n')) eol = '\r\n'
this.css += eol + '/*# sourceMappingURL=' + content + ' */'
}
outputFile() {
if (this.opts.to) {
return this.path(this.opts.to)
}
if (this.opts.from) {
return this.path(this.opts.from)
}
return 'to.css'
}
generateMap() {
this.generateString()
if (this.isSourcesContent()) this.setSourcesContent()
if (this.previous().length > 0) this.applyPrevMaps()
if (this.isAnnotation()) this.addAnnotation()
if (this.isInline()) {
return [this.css]
}
return [this.css, this.map]
}
path(file) {
if (file.indexOf('<') === 0) return file
if (/^\w+:\/\//.test(file)) return file
if (this.mapOpts.absolute) return file
let from = this.opts.to ? dirname(this.opts.to) : '.'
if (typeof this.mapOpts.annotation === 'string') {
from = dirname(resolve(from, this.mapOpts.annotation))
}
file = relative(from, file)
return file
}
toUrl(path) {
if (sep === '\\') {
// istanbul ignore next
path = path.replace(/\\/g, '/')
}
return encodeURI(path).replace(/[#?]/g, encodeURIComponent)
}
sourcePath(node) {
if (this.mapOpts.from) {
return this.toUrl(this.mapOpts.from)
} else if (this.mapOpts.absolute) {
if (pathToFileURL) {
return pathToFileURL(node.source.input.from).toString()
} else {
// istanbul ignore next
throw new Error('`map.absolute` option is not available in this PostCSS build')
}
} else {
return this.toUrl(this.path(node.source.input.from))
}
}
generateString() {
this.css = ''
this.map = new mozilla.SourceMapGenerator({ file: this.outputFile() })
let line = 1
let column = 1
let noSource = '<no source>'
let mapping = {
source: '',
generated: { line: 0, column: 0 },
original: { line: 0, column: 0 }
}
let lines, last
this.stringify(this.root, (str, node, type) => {
this.css += str
if (node && type !== 'end') {
mapping.generated.line = line
mapping.generated.column = column - 1
if (node.source && node.source.start) {
mapping.source = this.sourcePath(node)
mapping.original.line = node.source.start.line
mapping.original.column = node.source.start.column - 1
this.map.addMapping(mapping)
} else {
mapping.source = noSource
mapping.original.line = 1
mapping.original.column = 0
this.map.addMapping(mapping)
}
}
lines = str.match(/\n/g)
if (lines) {
line += lines.length
last = str.lastIndexOf('\n')
column = str.length - last
} else {
column += str.length
}
if (node && type !== 'start') {
let p = node.parent || { raws: {} }
if (node.type !== 'decl' || node !== p.last || p.raws.semicolon) {
if (node.source && node.source.end) {
mapping.source = this.sourcePath(node)
mapping.original.line = node.source.end.line
mapping.original.column = node.source.end.column - 1
mapping.generated.line = line
mapping.generated.column = column - 2
this.map.addMapping(mapping)
} else {
mapping.source = noSource
mapping.original.line = 1
mapping.original.column = 0
mapping.generated.line = line
mapping.generated.column = column - 1
this.map.addMapping(mapping)
}
}
}
})
}
generate() {
this.clearAnnotation()
if (pathAvailable && this.isMap()) {
return this.generateMap()
}
let result = ''
this.stringify(this.root, i => {
result += i
})
return [result]
}
}
module.exports = MapGenerator

View File

@@ -0,0 +1 @@
{"version":3,"file":"take.js","sources":["../src/operator/take.ts"],"names":[],"mappings":";;;;;AAAA,+CAA0C"}

View File

@@ -0,0 +1,107 @@
var Stream = require('stream').Stream;
var util = require('util');
module.exports = DelayedStream;
function DelayedStream() {
this.source = null;
this.dataSize = 0;
this.maxDataSize = 1024 * 1024;
this.pauseStream = true;
this._maxDataSizeExceeded = false;
this._released = false;
this._bufferedEvents = [];
}
util.inherits(DelayedStream, Stream);
DelayedStream.create = function(source, options) {
var delayedStream = new this();
options = options || {};
for (var option in options) {
delayedStream[option] = options[option];
}
delayedStream.source = source;
var realEmit = source.emit;
source.emit = function() {
delayedStream._handleEmit(arguments);
return realEmit.apply(source, arguments);
};
source.on('error', function() {});
if (delayedStream.pauseStream) {
source.pause();
}
return delayedStream;
};
Object.defineProperty(DelayedStream.prototype, 'readable', {
configurable: true,
enumerable: true,
get: function() {
return this.source.readable;
}
});
DelayedStream.prototype.setEncoding = function() {
return this.source.setEncoding.apply(this.source, arguments);
};
DelayedStream.prototype.resume = function() {
if (!this._released) {
this.release();
}
this.source.resume();
};
DelayedStream.prototype.pause = function() {
this.source.pause();
};
DelayedStream.prototype.release = function() {
this._released = true;
this._bufferedEvents.forEach(function(args) {
this.emit.apply(this, args);
}.bind(this));
this._bufferedEvents = [];
};
DelayedStream.prototype.pipe = function() {
var r = Stream.prototype.pipe.apply(this, arguments);
this.resume();
return r;
};
DelayedStream.prototype._handleEmit = function(args) {
if (this._released) {
this.emit.apply(this, args);
return;
}
if (args[0] === 'data') {
this.dataSize += args[1].length;
this._checkIfMaxDataSizeExceeded();
}
this._bufferedEvents.push(args);
};
DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
if (this._maxDataSizeExceeded) {
return;
}
if (this.dataSize <= this.maxDataSize) {
return;
}
this._maxDataSizeExceeded = true;
var message =
'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
this.emit('error', new Error(message));
};

View File

@@ -0,0 +1,26 @@
import { Subscriber } from '../Subscriber';
import { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';
import { empty as emptyObserver } from '../Observer';
import { PartialObserver } from '../types';
export function toSubscriber<T>(
nextOrObserver?: PartialObserver<T> | ((value: T) => void),
error?: (error: any) => void,
complete?: () => void): Subscriber<T> {
if (nextOrObserver) {
if (nextOrObserver instanceof Subscriber) {
return (<Subscriber<T>> nextOrObserver);
}
if (nextOrObserver[rxSubscriberSymbol]) {
return nextOrObserver[rxSubscriberSymbol]();
}
}
if (!nextOrObserver && !error && !complete) {
return new Subscriber(emptyObserver);
}
return new Subscriber(nextOrObserver, error, complete);
}

View File

@@ -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.00645,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0.00645,"49":0,"50":0.00645,"51":0,"52":0.01935,"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.00645,"67":0,"68":0.00645,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.03225,"79":0,"80":0.00645,"81":0,"82":0,"83":0.00645,"84":0,"85":0,"86":0,"87":0.1032,"88":0,"89":0,"90":0,"91":0.00645,"92":0,"93":0,"94":0,"95":0,"96":0.12255,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.0903,"103":0.00645,"104":0.00645,"105":0.00645,"106":0.0129,"107":0.0258,"108":1.3158,"109":0.7482,"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,"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.00645,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.0258,"50":0,"51":0,"52":0,"53":0.00645,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0.00645,"61":0,"62":0,"63":0,"64":0.10965,"65":0.00645,"66":0.01935,"67":0.0129,"68":0.00645,"69":0,"70":0,"71":0,"72":0.00645,"73":0,"74":0.04515,"75":0.0387,"76":0.0387,"77":0.0387,"78":0.58695,"79":0.7998,"80":0.01935,"81":0.0129,"83":0.07095,"84":0.01935,"85":0.0258,"86":0.0129,"87":0.04515,"88":0.00645,"89":0.0129,"90":0.0129,"91":0.01935,"92":0.0258,"93":0.03225,"94":0.0129,"95":0.00645,"96":0.0129,"97":0.03225,"98":0.00645,"99":0.0387,"100":0.0129,"101":0.01935,"102":0.0387,"103":0.129,"104":0.03225,"105":0.129,"106":0.08385,"107":0.32895,"108":14.40285,"109":9.33315,"110":0.00645,"111":0,"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,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.00645,"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.00645,"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.38055,"94":0.3741,"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.00645,"16":0.00645,"17":0,"18":0.00645,"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.0129,"93":0,"94":0,"95":0,"96":0,"97":0.00645,"98":0,"99":0.0129,"100":0.00645,"101":0.00645,"102":0.00645,"103":0.0129,"104":0.01935,"105":0.0129,"106":0.01935,"107":0.08385,"108":3.72165,"109":2.80575},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00645,"12":0,"13":0.0129,"14":0.07095,"15":0.03225,_:"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.00645,"12.1":0.0387,"13.1":0.1419,"14.1":0.2193,"15.1":0.04515,"15.2-15.3":0.04515,"15.4":0.1161,"15.5":0.2322,"15.6":1.1739,"16.0":0.14835,"16.1":0.45795,"16.2":0.8256,"16.3":0.0516},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.08714,"10.0-10.2":0.0029,"10.3":0.1249,"11.0-11.2":0.02324,"11.3-11.4":0.07262,"12.0-12.1":0.01452,"12.2-12.5":0.46474,"13.0-13.1":0.00581,"13.2":0.0029,"13.3":0.02033,"13.4-13.7":0.10747,"14.0-14.4":0.26432,"14.5-14.8":0.76972,"15.0-15.1":0.20042,"15.2-15.3":0.31079,"15.4":0.32822,"15.5":0.822,"15.6":3.6569,"16.0":4.33658,"16.1":9.97153,"16.2":5.63785,"16.3":0.40374},P:{"4":0.06191,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.06191,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0,"12.0":0,"13.0":0.01032,"14.0":0.02064,"15.0":0.01032,"16.0":0.02064,"17.0":0.03096,"18.0":0.06191,"19.0":2.68277},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00899,"4.2-4.3":0.01797,"4.4":0,"4.4.3-4.4.4":0.09884},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.00645,"9":0.00645,"10":0,"11":0.07095,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.2343},Q:{"13.1":0},O:{"0":0.01065},H:{"0":0.10083},L:{"0":25.7172},S:{"2.5":0}};

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("rxjs-compat/add/observable/of");
//# sourceMappingURL=of.js.map

View File

@@ -0,0 +1,11 @@
import { observable as Symbol_observable } from '../symbol/observable';
export const subscribeToObservable = (obj) => (subscriber) => {
const obs = obj[Symbol_observable]();
if (typeof obs.subscribe !== 'function') {
throw new TypeError('Provided object does not correctly implement Symbol.observable');
}
else {
return obs.subscribe(subscriber);
}
};
//# sourceMappingURL=subscribeToObservable.js.map

View File

@@ -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/concatMapTo"));
//# sourceMappingURL=concatMapTo.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"auditTime.js","sources":["../../src/internal/operators/auditTime.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAC3C,iCAAgC;AAChC,6CAA4C;AAoD5C,SAAgB,SAAS,CAAI,QAAgB,EAAE,SAAgC;IAAhC,0BAAA,EAAA,YAA2B,aAAK;IAC7E,OAAO,aAAK,CAAC,cAAM,OAAA,aAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,EAA1B,CAA0B,CAAC,CAAC;AACjD,CAAC;AAFD,8BAEC"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/getDirectory.ts"],"names":["getDirectory","filepath","filePathIsDirectory","directory","path","dirname","getDirectorySync"],"mappings":";;;;;;;;AAAA;;AACA;;;;AAEA,eAAeA,YAAf,CAA4BC,QAA5B,EAA+D;AAC7D,QAAMC,mBAAmB,GAAG,MAAM,2BAAYD,QAAZ,CAAlC;;AAEA,MAAIC,mBAAmB,KAAK,IAA5B,EAAkC;AAChC,WAAOD,QAAP;AACD;;AAED,QAAME,SAAS,GAAGC,cAAKC,OAAL,CAAaJ,QAAb,CAAlB;;AAEA,SAAOE,SAAP;AACD;;AAED,SAASG,gBAAT,CAA0BL,QAA1B,EAAoD;AAClD,QAAMC,mBAAmB,GAAG,+BAAgBD,QAAhB,CAA5B;;AAEA,MAAIC,mBAAmB,KAAK,IAA5B,EAAkC;AAChC,WAAOD,QAAP;AACD;;AAED,QAAME,SAAS,GAAGC,cAAKC,OAAL,CAAaJ,QAAb,CAAlB;;AAEA,SAAOE,SAAP;AACD","sourcesContent":["import path from 'path';\nimport { isDirectory, isDirectorySync } from 'path-type';\n\nasync function getDirectory(filepath: string): Promise<string> {\n const filePathIsDirectory = await isDirectory(filepath);\n\n if (filePathIsDirectory === true) {\n return filepath;\n }\n\n const directory = path.dirname(filepath);\n\n return directory;\n}\n\nfunction getDirectorySync(filepath: string): string {\n const filePathIsDirectory = isDirectorySync(filepath);\n\n if (filePathIsDirectory === true) {\n return filepath;\n }\n\n const directory = path.dirname(filepath);\n\n return directory;\n}\n\nexport { getDirectory, getDirectorySync };\n"],"file":"getDirectory.js"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"concatMapTo.js","sources":["../../../src/internal/operators/concatMapTo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAmExC,MAAM,UAAU,WAAW,CACzB,eAAkB,EAClB,cAA6G;IAE7G,OAAO,SAAS,CAAC,cAAM,OAAA,eAAe,EAAf,CAAe,EAAE,cAAc,CAAC,CAAC;AAC1D,CAAC"}

View File

@@ -0,0 +1,6 @@
/** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */
import { ZipOperator } from '../observable/zip';
export function zipAll(project) {
return function (source) { return source.lift(new ZipOperator(project)); };
}
//# sourceMappingURL=zipAll.js.map

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = require("fs");
const util_1 = require("util");
const is_1 = require("@sindresorhus/is");
const is_form_data_1 = require("./is-form-data");
const statAsync = util_1.promisify(fs_1.stat);
exports.default = async (body, headers) => {
if (headers && 'content-length' in headers) {
return Number(headers['content-length']);
}
if (!body) {
return 0;
}
if (is_1.default.string(body)) {
return Buffer.byteLength(body);
}
if (is_1.default.buffer(body)) {
return body.length;
}
if (is_form_data_1.default(body)) {
return util_1.promisify(body.getLength.bind(body))();
}
if (body instanceof fs_1.ReadStream) {
const { size } = await statAsync(body.path);
if (size === 0) {
return undefined;
}
return size;
}
return undefined;
};

View File

@@ -0,0 +1,45 @@
import { Observable } from '../Observable';
import { OperatorFunction } from '../types';
/**
* Buffers the source Observable values, using a factory function of closing
* Observables to determine when to close, emit, and reset the buffer.
*
* <span class="informal">Collects values from the past as an array. When it
* starts collecting values, it calls a function that returns an Observable that
* tells when to close the buffer and restart collecting.</span>
*
* ![](bufferWhen.png)
*
* Opens a buffer immediately, then closes the buffer when the observable
* returned by calling `closingSelector` function emits a value. When it closes
* the buffer, it immediately opens a new buffer and repeats the process.
*
* ## Example
*
* Emit an array of the last clicks every [1-5] random seconds
*
* ```ts
* import { fromEvent, interval } from 'rxjs';
* import { bufferWhen } from 'rxjs/operators';
*
* const clicks = fromEvent(document, 'click');
* const buffered = clicks.pipe(bufferWhen(() =>
* interval(1000 + Math.random() * 4000)
* ));
* buffered.subscribe(x => console.log(x));
* ```
*
*
* @see {@link buffer}
* @see {@link bufferCount}
* @see {@link bufferTime}
* @see {@link bufferToggle}
* @see {@link windowWhen}
*
* @param {function(): Observable} closingSelector A function that takes no
* arguments and returns an Observable that signals buffer closure.
* @return {Observable<T[]>} An observable of arrays of buffered values.
* @method bufferWhen
* @owner Observable
*/
export declare function bufferWhen<T>(closingSelector: () => Observable<any>): OperatorFunction<T, T[]>;

View File

@@ -0,0 +1,26 @@
/** PURE_IMPORTS_START tslib,_Subscriber,_Subscription PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
export function finalize(callback) {
return function (source) { return source.lift(new FinallyOperator(callback)); };
}
var FinallyOperator = /*@__PURE__*/ (function () {
function FinallyOperator(callback) {
this.callback = callback;
}
FinallyOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new FinallySubscriber(subscriber, this.callback));
};
return FinallyOperator;
}());
var FinallySubscriber = /*@__PURE__*/ (function (_super) {
tslib_1.__extends(FinallySubscriber, _super);
function FinallySubscriber(destination, callback) {
var _this = _super.call(this, destination) || this;
_this.add(new Subscription(callback));
return _this;
}
return FinallySubscriber;
}(Subscriber));
//# sourceMappingURL=finalize.js.map

View File

@@ -0,0 +1,17 @@
var serialOrdered = require('./serialOrdered.js');
// Public API
module.exports = serial;
/**
* Runs iterator over provided array elements in series
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} callback - invoked when all elements processed
* @returns {function} - jobs terminator
*/
function serial(list, iterator, callback)
{
return serialOrdered(list, iterator, null, callback);
}

View File

@@ -0,0 +1,64 @@
"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 Subscriber_1 = require("../Subscriber");
var ArgumentOutOfRangeError_1 = require("../util/ArgumentOutOfRangeError");
function skipLast(count) {
return function (source) { return source.lift(new SkipLastOperator(count)); };
}
exports.skipLast = skipLast;
var SkipLastOperator = (function () {
function SkipLastOperator(_skipCount) {
this._skipCount = _skipCount;
if (this._skipCount < 0) {
throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;
}
}
SkipLastOperator.prototype.call = function (subscriber, source) {
if (this._skipCount === 0) {
return source.subscribe(new Subscriber_1.Subscriber(subscriber));
}
else {
return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));
}
};
return SkipLastOperator;
}());
var SkipLastSubscriber = (function (_super) {
__extends(SkipLastSubscriber, _super);
function SkipLastSubscriber(destination, _skipCount) {
var _this = _super.call(this, destination) || this;
_this._skipCount = _skipCount;
_this._count = 0;
_this._ring = new Array(_skipCount);
return _this;
}
SkipLastSubscriber.prototype._next = function (value) {
var skipCount = this._skipCount;
var count = this._count++;
if (count < skipCount) {
this._ring[count] = value;
}
else {
var currentIndex = count % skipCount;
var ring = this._ring;
var oldValue = ring[currentIndex];
ring[currentIndex] = value;
this.destination.next(oldValue);
}
};
return SkipLastSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=skipLast.js.map

View File

@@ -0,0 +1,3 @@
export function isDate(value: any): value is Date {
return value instanceof Date && !isNaN(+value);
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"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","33":"C K L H M N O"},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 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 DC EC"},D:{"1":"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 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","258":"2"},E:{"2":"I u J E F G A B C K L H GC zB IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","258":"HC"},F:{"1":"JB 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":"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 KB OC PC QC RC qB 9B SC rB"},G:{"2":"zB TC AC","33":"F 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:{"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:{"33":"D"},N:{"161":"A B"},O:{"1":"uC"},P:{"1":"vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","2":"I"},Q:{"1":"1B"},R:{"1":"8C"},S:{"2":"9C"}},B:7,C:"CSS text-size-adjust"};