new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C K L G M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB EC FC","132":"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"},D:{"1":"aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB","66":"YB uB ZB vB"},E:{"1":"L G 1B MC NC 2B 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"},F:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PC QC RC SC qB AC TC rB"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC","260":"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","260":"f"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"132":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"2":"I wC xC yC zC","260":"g 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"2":"AD","132":"BD"}},B:5,C:"Asynchronous Clipboard API"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/main.js"],"names":["getSignalsByName","signals","reduce","getSignalByName","signalByNameMemo","name","number","description","supported","action","forced","standard","signalsByName","getSignalsByNumber","length","SIGRTMAX","signalsA","Array","from","value","getSignalByNumber","Object","assign","signal","findSignalByNumber","undefined","find","constants","signalA","signalsByNumber"],"mappings":"2HAAA;;AAEA;AACA;;;;AAIA,KAAMA,CAAAA,gBAAgB,CAAG,UAAW;AAClC,KAAMC,CAAAA,OAAO,CAAG,yBAAhB;AACA,MAAOA,CAAAA,OAAO,CAACC,MAAR,CAAeC,eAAf,CAAgC,EAAhC,CAAP;AACD,CAHD;;AAKA,KAAMA,CAAAA,eAAe,CAAG;AACtBC,gBADsB;AAEtB,CAAEC,IAAF,CAAQC,MAAR,CAAgBC,WAAhB,CAA6BC,SAA7B,CAAwCC,MAAxC,CAAgDC,MAAhD,CAAwDC,QAAxD,CAFsB;AAGtB;AACA,MAAO;AACL,GAAGP,gBADE;AAEL,CAACC,IAAD,EAAQ,CAAEA,IAAF,CAAQC,MAAR,CAAgBC,WAAhB,CAA6BC,SAA7B,CAAwCC,MAAxC,CAAgDC,MAAhD,CAAwDC,QAAxD,CAFH,CAAP;;AAID,CARD;;AAUO,KAAMC,CAAAA,aAAa,CAAGZ,gBAAgB,EAAtC,C;;;;;AAKP,KAAMa,CAAAA,kBAAkB,CAAG,UAAW;AACpC,KAAMZ,CAAAA,OAAO,CAAG,yBAAhB;AACA,KAAMa,CAAAA,MAAM,CAAGC,mBAAW,CAA1B;AACA,KAAMC,CAAAA,QAAQ,CAAGC,KAAK,CAACC,IAAN,CAAW,CAAEJ,MAAF,CAAX,CAAuB,CAACK,KAAD,CAAQb,MAAR;AACtCc,iBAAiB,CAACd,MAAD,CAASL,OAAT,CADF,CAAjB;;AAGA,MAAOoB,CAAAA,MAAM,CAACC,MAAP,CAAc,EAAd,CAAkB,GAAGN,QAArB,CAAP;AACD,CAPD;;AASA,KAAMI,CAAAA,iBAAiB,CAAG,SAASd,MAAT,CAAiBL,OAAjB,CAA0B;AAClD,KAAMsB,CAAAA,MAAM,CAAGC,kBAAkB,CAAClB,MAAD,CAASL,OAAT,CAAjC;;AAEA,GAAIsB,MAAM,GAAKE,SAAf,CAA0B;AACxB,MAAO,EAAP;AACD;;AAED,KAAM,CAAEpB,IAAF,CAAQE,WAAR,CAAqBC,SAArB,CAAgCC,MAAhC,CAAwCC,MAAxC,CAAgDC,QAAhD,EAA6DY,MAAnE;AACA,MAAO;AACL,CAACjB,MAAD,EAAU;AACRD,IADQ;AAERC,MAFQ;AAGRC,WAHQ;AAIRC,SAJQ;AAKRC,MALQ;AAMRC,MANQ;AAORC,QAPQ,CADL,CAAP;;;AAWD,CAnBD;;;;AAuBA,KAAMa,CAAAA,kBAAkB,CAAG,SAASlB,MAAT,CAAiBL,OAAjB,CAA0B;AACnD,KAAMsB,CAAAA,MAAM,CAAGtB,OAAO,CAACyB,IAAR,CAAa,CAAC,CAAErB,IAAF,CAAD,GAAcsB,cAAU1B,OAAV,CAAkBI,IAAlB,IAA4BC,MAAvD,CAAf;;AAEA,GAAIiB,MAAM,GAAKE,SAAf,CAA0B;AACxB,MAAOF,CAAAA,MAAP;AACD;;AAED,MAAOtB,CAAAA,OAAO,CAACyB,IAAR,CAAaE,OAAO,EAAIA,OAAO,CAACtB,MAAR,GAAmBA,MAA3C,CAAP;AACD,CARD;;AAUO,KAAMuB,CAAAA,eAAe,CAAGhB,kBAAkB,EAA1C,C","sourcesContent":["import { constants } from 'os'\n\nimport { getSignals } from './signals.js'\nimport { SIGRTMAX } from './realtime.js'\n\n// Retrieve `signalsByName`, an object mapping signal name to signal properties.\n// We make sure the object is sorted by `number`.\nconst getSignalsByName = function() {\n const signals = getSignals()\n return signals.reduce(getSignalByName, {})\n}\n\nconst getSignalByName = function(\n signalByNameMemo,\n { name, number, description, supported, action, forced, standard },\n) {\n return {\n ...signalByNameMemo,\n [name]: { name, number, description, supported, action, forced, standard },\n }\n}\n\nexport const signalsByName = getSignalsByName()\n\n// Retrieve `signalsByNumber`, an object mapping signal number to signal\n// properties.\n// We make sure the object is sorted by `number`.\nconst getSignalsByNumber = function() {\n const signals = getSignals()\n const length = SIGRTMAX + 1\n const signalsA = Array.from({ length }, (value, number) =>\n getSignalByNumber(number, signals),\n )\n return Object.assign({}, ...signalsA)\n}\n\nconst getSignalByNumber = function(number, signals) {\n const signal = findSignalByNumber(number, signals)\n\n if (signal === undefined) {\n return {}\n }\n\n const { name, description, supported, action, forced, standard } = signal\n return {\n [number]: {\n name,\n number,\n description,\n supported,\n action,\n forced,\n standard,\n },\n }\n}\n\n// Several signals might end up sharing the same number because of OS-specific\n// numbers, in which case those prevail.\nconst findSignalByNumber = function(number, signals) {\n const signal = signals.find(({ name }) => constants.signals[name] === number)\n\n if (signal !== undefined) {\n return signal\n }\n\n return signals.find(signalA => signalA.number === number)\n}\n\nexport const signalsByNumber = getSignalsByNumber()\n"],"file":"src/main.js"}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { ObservableInputTuple, OperatorFunction } from '../types';
|
||||
/**
|
||||
* Emits all of the values from the source observable, then, once it completes, subscribes
|
||||
* to each observable source provided, one at a time, emitting all of their values, and not subscribing
|
||||
* to the next one until it completes.
|
||||
*
|
||||
* `concat(a$, b$, c$)` is the same as `a$.pipe(concatWith(b$, c$))`.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Listen for one mouse click, then listen for all mouse moves.
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, map, take, concatWith } from 'rxjs';
|
||||
*
|
||||
* const clicks$ = fromEvent(document, 'click');
|
||||
* const moves$ = fromEvent(document, 'mousemove');
|
||||
*
|
||||
* clicks$.pipe(
|
||||
* map(() => 'click'),
|
||||
* take(1),
|
||||
* concatWith(
|
||||
* moves$.pipe(
|
||||
* map(() => 'move')
|
||||
* )
|
||||
* )
|
||||
* )
|
||||
* .subscribe(x => console.log(x));
|
||||
*
|
||||
* // 'click'
|
||||
* // 'move'
|
||||
* // 'move'
|
||||
* // 'move'
|
||||
* // ...
|
||||
* ```
|
||||
*
|
||||
* @param otherSources Other observable sources to subscribe to, in sequence, after the original source is complete.
|
||||
* @return A function that returns an Observable that concatenates
|
||||
* subscriptions to the source and provided Observables subscribing to the next
|
||||
* only once the current subscription completes.
|
||||
*/
|
||||
export declare function concatWith<T, A extends readonly unknown[]>(...otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
|
||||
//# sourceMappingURL=concatWith.d.ts.map
|
||||
@@ -0,0 +1,5 @@
|
||||
import {YargsFactory} from './build/lib/yargs-factory';
|
||||
|
||||
declare const Yargs: ReturnType<typeof YargsFactory>;
|
||||
|
||||
export default Yargs;
|
||||
@@ -0,0 +1,103 @@
|
||||
var test = require("tape")
|
||||
var extend = require("./")
|
||||
var mutableExtend = require("./mutable")
|
||||
|
||||
test("merge", function(assert) {
|
||||
var a = { a: "foo" }
|
||||
var b = { b: "bar" }
|
||||
|
||||
assert.deepEqual(extend(a, b), { a: "foo", b: "bar" })
|
||||
assert.end()
|
||||
})
|
||||
|
||||
test("replace", function(assert) {
|
||||
var a = { a: "foo" }
|
||||
var b = { a: "bar" }
|
||||
|
||||
assert.deepEqual(extend(a, b), { a: "bar" })
|
||||
assert.end()
|
||||
})
|
||||
|
||||
test("undefined", function(assert) {
|
||||
var a = { a: undefined }
|
||||
var b = { b: "foo" }
|
||||
|
||||
assert.deepEqual(extend(a, b), { a: undefined, b: "foo" })
|
||||
assert.deepEqual(extend(b, a), { a: undefined, b: "foo" })
|
||||
assert.end()
|
||||
})
|
||||
|
||||
test("handle 0", function(assert) {
|
||||
var a = { a: "default" }
|
||||
var b = { a: 0 }
|
||||
|
||||
assert.deepEqual(extend(a, b), { a: 0 })
|
||||
assert.deepEqual(extend(b, a), { a: "default" })
|
||||
assert.end()
|
||||
})
|
||||
|
||||
test("is immutable", function (assert) {
|
||||
var record = {}
|
||||
|
||||
extend(record, { foo: "bar" })
|
||||
assert.equal(record.foo, undefined)
|
||||
assert.end()
|
||||
})
|
||||
|
||||
test("null as argument", function (assert) {
|
||||
var a = { foo: "bar" }
|
||||
var b = null
|
||||
var c = void 0
|
||||
|
||||
assert.deepEqual(extend(b, a, c), { foo: "bar" })
|
||||
assert.end()
|
||||
})
|
||||
|
||||
test("mutable", function (assert) {
|
||||
var a = { foo: "bar" }
|
||||
|
||||
mutableExtend(a, { bar: "baz" })
|
||||
|
||||
assert.equal(a.bar, "baz")
|
||||
assert.end()
|
||||
})
|
||||
|
||||
test("null prototype", function(assert) {
|
||||
var a = { a: "foo" }
|
||||
var b = Object.create(null)
|
||||
b.b = "bar";
|
||||
|
||||
assert.deepEqual(extend(a, b), { a: "foo", b: "bar" })
|
||||
assert.end()
|
||||
})
|
||||
|
||||
test("null prototype mutable", function (assert) {
|
||||
var a = { foo: "bar" }
|
||||
var b = Object.create(null)
|
||||
b.bar = "baz";
|
||||
|
||||
mutableExtend(a, b)
|
||||
|
||||
assert.equal(a.bar, "baz")
|
||||
assert.end()
|
||||
})
|
||||
|
||||
test("prototype pollution", function (assert) {
|
||||
var a = {}
|
||||
var maliciousPayload = '{"__proto__":{"oops":"It works!"}}'
|
||||
|
||||
assert.strictEqual(a.oops, undefined)
|
||||
extend({}, maliciousPayload)
|
||||
assert.strictEqual(a.oops, undefined)
|
||||
assert.end()
|
||||
})
|
||||
|
||||
test("prototype pollution mutable", function (assert) {
|
||||
var a = {}
|
||||
var maliciousPayload = '{"__proto__":{"oops":"It works!"}}'
|
||||
|
||||
assert.strictEqual(a.oops, undefined)
|
||||
mutableExtend({}, maliciousPayload)
|
||||
assert.strictEqual(a.oops, undefined)
|
||||
assert.end()
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"distinct.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/distinct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAezH"}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"cacheable-request","version":"10.2.8","files":{"LICENSE":{"checkedAt":1678883670950,"integrity":"sha512-GDp6lEU4euaBV0+DbdWCp6X0nPfQt/TGBfECRnT4LO1lXxhX/m+8I99RSXWgwoA3ewIm2YHDRnk7FBgD+EALZQ==","mode":420,"size":1103},"dist/index.js":{"checkedAt":1678883670950,"integrity":"sha512-N2G0d5lSbhI/GIV69Y0rnBiHMUR6JxPD9HTLnm+J0Qj9ffKjs7ZOt7b2tSzylgaOh2h0WMmw/QkagXdNaf8j8w==","mode":420,"size":12836},"dist/types.js":{"checkedAt":1678883670954,"integrity":"sha512-Vg8R82zZR9OWWooQ8Mmy9vuB/KZYJ5BiNtHoLN16mNHAkC+VRtwfxBnTReVWM0ifTg7vezFkOgyemUkkSRGhag==","mode":420,"size":655},"package.json":{"checkedAt":1678883670954,"integrity":"sha512-ZVTwk1CMKcXP704I+M4HNp6TqEUs53qhZ3hLerYYaqWsuNndTRdjEfeKFa3gJZla3QdynuN99kq4YjjM49S5nw==","mode":420,"size":3123},"dist/index.d.ts.map":{"checkedAt":1678883670954,"integrity":"sha512-8HveD4Fe0KSWRJhb02GEk3l+OjULBd+ki91wmdzhvqqgskFrAGC11sY6wgg83c0mL6OhoKaWtS3M4JYHClC0pA==","mode":420,"size":740},"dist/index.js.map":{"checkedAt":1678883670956,"integrity":"sha512-XXU7B+mMQibOuMqN+2Fub4jModDlXNcRzL3/GjBvQdD+3JjSjtuRtR+sv8v5ZsmBRf93F4p9y+o/fJGO5mBKaQ==","mode":420,"size":10255},"dist/types.js.map":{"checkedAt":1678883670956,"integrity":"sha512-KkNS+/upuPZwO3BfB+z4kMH5YOvmEDXv2wepbWktawviMdJVrDAVk97ZdIC0falKUSqELBkXUON0v0s8D2oBfg==","mode":420,"size":488},"dist/types.d.ts.map":{"checkedAt":1678883670956,"integrity":"sha512-dAYxaF9I8jYvRdi5guXN5F+fX9bpY2unWLGWt8EPX0z6pPNyMqw+eoO8wPU8eXKe99kOgqm725p53Y1wlIZbqg==","mode":420,"size":4648},"README.md":{"checkedAt":1678883670957,"integrity":"sha512-bYIGWStk3ruk4z+ssWt03yCgLb6CWYoeWL9Xl8zI8mQthraWrg419kfKeClnE6gV9YlL0sd3R1p4w5V5c4R6wA==","mode":420,"size":12613},"dist/index.d.ts":{"checkedAt":1678883670957,"integrity":"sha512-9mu1oMCLz6By4yeYYZCt6I2NFc6V5CdM2l0e/OCslB0CO7L9cpnP1U051m5YxvHnFDSKk3twixCXNZeY/Wj5Dg==","mode":420,"size":788},"dist/types.d.ts":{"checkedAt":1678883670957,"integrity":"sha512-2hKlF8spquvvfTdAK/guxIBuU9RK7IcOS0U+k7Jv9WyjiG1HxF3oVZn2R0OE0OTsIdOzb8+FCpAjsCdnsA0awg==","mode":420,"size":5661}}}
|
||||
@@ -0,0 +1,89 @@
|
||||
declare namespace npmRunPath {
|
||||
interface RunPathOptions {
|
||||
/**
|
||||
Working directory.
|
||||
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly cwd?: string;
|
||||
|
||||
/**
|
||||
PATH to be appended. Default: [`PATH`](https://github.com/sindresorhus/path-key).
|
||||
|
||||
Set it to an empty string to exclude the default PATH.
|
||||
*/
|
||||
readonly path?: string;
|
||||
|
||||
/**
|
||||
Path to the Node.js executable to use in child processes if that is different from the current one. Its directory is pushed to the front of PATH.
|
||||
|
||||
This can be either an absolute path or a path relative to the `cwd` option.
|
||||
|
||||
@default process.execPath
|
||||
*/
|
||||
readonly execPath?: string;
|
||||
}
|
||||
|
||||
interface ProcessEnv {
|
||||
[key: string]: string | undefined;
|
||||
}
|
||||
|
||||
interface EnvOptions {
|
||||
/**
|
||||
Working directory.
|
||||
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly cwd?: string;
|
||||
|
||||
/**
|
||||
Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options.
|
||||
*/
|
||||
readonly env?: ProcessEnv;
|
||||
|
||||
/**
|
||||
Path to the current Node.js executable. Its directory is pushed to the front of PATH.
|
||||
|
||||
This can be either an absolute path or a path relative to the `cwd` option.
|
||||
|
||||
@default process.execPath
|
||||
*/
|
||||
readonly execPath?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare const npmRunPath: {
|
||||
/**
|
||||
Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries.
|
||||
|
||||
@returns The augmented path string.
|
||||
|
||||
@example
|
||||
```
|
||||
import * as childProcess from 'child_process';
|
||||
import npmRunPath = require('npm-run-path');
|
||||
|
||||
console.log(process.env.PATH);
|
||||
//=> '/usr/local/bin'
|
||||
|
||||
console.log(npmRunPath());
|
||||
//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin'
|
||||
|
||||
// `foo` is a locally installed binary
|
||||
childProcess.execFileSync('foo', {
|
||||
env: npmRunPath.env()
|
||||
});
|
||||
```
|
||||
*/
|
||||
(options?: npmRunPath.RunPathOptions): string;
|
||||
|
||||
/**
|
||||
@returns The augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object.
|
||||
*/
|
||||
env(options?: npmRunPath.EnvOptions): npmRunPath.ProcessEnv;
|
||||
|
||||
// TODO: Remove this for the next major release
|
||||
default: typeof npmRunPath;
|
||||
};
|
||||
|
||||
export = npmRunPath;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"last.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/last.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAO3D,wBAAgB,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,kBAAkB,GAAG,gBAAgB,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9F,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,YAAY,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACtH,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/F,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EACjC,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,EACzE,YAAY,CAAC,EAAE,CAAC,GACf,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1B,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,EACtE,YAAY,CAAC,EAAE,CAAC,GACf,gBAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"noEmit": true,
|
||||
"strict": true
|
||||
},
|
||||
"files": [
|
||||
"./example.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var isNaN = require('../../helpers/isNaN');
|
||||
|
||||
var Type = require('../Type');
|
||||
|
||||
// https://262.ecma-international.org/12.0/#sec-numeric-types-number-remainder
|
||||
|
||||
module.exports = function NumberRemainder(n, d) {
|
||||
if (Type(n) !== 'Number' || Type(d) !== 'Number') {
|
||||
throw new $TypeError('Assertion failed: `n` and `d` arguments must be Numbers');
|
||||
}
|
||||
|
||||
// If either operand is NaN, the result is NaN.
|
||||
// If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN.
|
||||
if (isNaN(n) || isNaN(d) || !isFinite(n) || d === 0) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
// If the dividend is finite and the divisor is an infinity, the result equals the dividend.
|
||||
// If the dividend is a zero and the divisor is nonzero and finite, the result is the same as the dividend.
|
||||
if (!isFinite(d) || n === 0) {
|
||||
return n;
|
||||
}
|
||||
|
||||
// In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved…
|
||||
return n % d;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EmptyError.d.ts","sourceRoot":"","sources":["../../../../src/internal/util/EmptyError.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAW,SAAQ,KAAK;CAAG;AAE5C,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,UAAU,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,EAAE,cAIvB,CAAC"}
|
||||
@@ -0,0 +1,48 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "build", {
|
||||
enumerable: true,
|
||||
get: ()=>build
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
||||
const _pluginJs = require("./plugin.js");
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
async function build(args, configs) {
|
||||
let input = args["--input"];
|
||||
let shouldWatch = args["--watch"];
|
||||
// TODO: Deprecate this in future versions
|
||||
if (!input && args["_"][1]) {
|
||||
console.error("[deprecation] Running tailwindcss without -i, please provide an input file.");
|
||||
input = args["--input"] = args["_"][1];
|
||||
}
|
||||
if (input && input !== "-" && !_fs.default.existsSync(input = _path.default.resolve(input))) {
|
||||
console.error(`Specified input file ${args["--input"]} does not exist.`);
|
||||
process.exit(9);
|
||||
}
|
||||
if (args["--config"] && !_fs.default.existsSync(args["--config"] = _path.default.resolve(args["--config"]))) {
|
||||
console.error(`Specified config file ${args["--config"]} does not exist.`);
|
||||
process.exit(9);
|
||||
}
|
||||
// TODO: Reference the @config path here if exists
|
||||
let configPath = args["--config"] ? args["--config"] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null)(_path.default.resolve(`./${configs.tailwind}`));
|
||||
let processor = await (0, _pluginJs.createProcessor)(args, configPath);
|
||||
if (shouldWatch) {
|
||||
// Abort the watcher if stdin is closed to avoid zombie processes
|
||||
// You can disable this behavior with --watch=always
|
||||
if (args["--watch"] !== "always") {
|
||||
process.stdin.on("end", ()=>process.exit(0));
|
||||
}
|
||||
process.stdin.resume();
|
||||
await processor.watch();
|
||||
} else {
|
||||
await processor.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"window.js","sourceRoot":"","sources":["../../../../src/internal/operators/window.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AA8CpD,MAAM,UAAU,MAAM,CAAI,gBAAsC;IAC9D,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,IAAI,aAAa,GAAe,IAAI,OAAO,EAAK,CAAC;QAEjD,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC,CAAC;QAE9C,MAAM,YAAY,GAAG,CAAC,GAAQ,EAAE,EAAE;YAChC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACzB,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC,CAAC;QAGF,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EACV,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,CAAC,KAAK,CAAC,EACrC,GAAG,EAAE;YACH,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzB,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC,EACD,YAAY,CACb,CACF,CAAC;QAGF,SAAS,CAAC,gBAAgB,CAAC,CAAC,SAAS,CACnC,wBAAwB,CACtB,UAAU,EACV,GAAG,EAAE;YACH,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzB,UAAU,CAAC,IAAI,CAAC,CAAC,aAAa,GAAG,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC;QACnD,CAAC,EACD,IAAI,EACJ,YAAY,CACb,CACF,CAAC;QAEF,OAAO,GAAG,EAAE;YAIV,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,EAAE,CAAC;YAC7B,aAAa,GAAG,IAAK,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1,48 @@
|
||||
import type { CreateScanStation } from '../models/CreateScanStation';
|
||||
import type { ResponseEmpty } from '../models/ResponseEmpty';
|
||||
import type { ResponseScanStation } from '../models/ResponseScanStation';
|
||||
import type { UpdateScanStation } from '../models/UpdateScanStation';
|
||||
export declare class ScanStationService {
|
||||
/**
|
||||
* Get all
|
||||
* Lists all stations. <br> This includes their associated tracks.
|
||||
* @result ResponseScanStation
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanStationControllerGetAll(): Promise<Array<ResponseScanStation>>;
|
||||
/**
|
||||
* Post
|
||||
* Create a new station. <br> Please remeber to provide the station's track's id. <br> Please also remember that the station key is only visibe on creation.
|
||||
* @param requestBody CreateScanStation
|
||||
* @result ResponseScanStation
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanStationControllerPost(requestBody?: CreateScanStation): Promise<ResponseScanStation>;
|
||||
/**
|
||||
* Get one
|
||||
* Lists all information about the station whose id got provided. <br> This includes it's associated track.
|
||||
* @param id
|
||||
* @result ResponseScanStation
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanStationControllerGetOne(id: number): Promise<ResponseScanStation>;
|
||||
/**
|
||||
* Put
|
||||
* Update the station whose id you provided. <br> Please remember that only the description and enabled state can be changed.
|
||||
* @param id
|
||||
* @param requestBody UpdateScanStation
|
||||
* @result ResponseScanStation
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanStationControllerPut(id: number, requestBody?: UpdateScanStation): Promise<ResponseScanStation>;
|
||||
/**
|
||||
* Remove
|
||||
* Delete the station whose id you provided. <br> If no station with this id exists it will just return 204(no content). <br> If the station still has scans associated you have to provide the force=true query param (warning: this deletes all scans associated with/created by this station - please disable it instead).
|
||||
* @param id
|
||||
* @param force
|
||||
* @result ResponseScanStation
|
||||
* @result ResponseEmpty
|
||||
* @throws ApiError
|
||||
*/
|
||||
static scanStationControllerRemove(id: number, force?: boolean): Promise<ResponseScanStation | ResponseEmpty>;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"2":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB EC FC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"2":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e PC QC RC SC qB AC TC rB"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"2":"tB I f pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"2":"A B C h qB AC rB"},L:{"2":"H"},M:{"2":"H"},N:{"2":"A B"},O:{"2":"vC"},P:{"2":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"2":"1B"},R:{"2":"9C"},S:{"2":"AD BD"}},B:7,C:"CSS3 attr() function for all properties"};
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {};
|
||||
|
||||
module.exports = function (/* CustomCreate*/) {
|
||||
var setPrototypeOf = Object.setPrototypeOf, customCreate = arguments[0] || create;
|
||||
if (typeof setPrototypeOf !== "function") return false;
|
||||
return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject;
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
var root = require('./_root');
|
||||
|
||||
/** Used to detect overreaching core-js shims. */
|
||||
var coreJsData = root['__core-js_shared__'];
|
||||
|
||||
module.exports = coreJsData;
|
||||
@@ -0,0 +1,420 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for Parameters.ts</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="prettify.css" />
|
||||
<link rel="stylesheet" href="base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="index.html">All files</a> Parameters.ts
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>10/10</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">83.33% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>5/6</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>1/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>10/10</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a>
|
||||
<a name='L70'></a><a href='#L70'>70</a>
|
||||
<a name='L71'></a><a href='#L71'>71</a>
|
||||
<a name='L72'></a><a href='#L72'>72</a>
|
||||
<a name='L73'></a><a href='#L73'>73</a>
|
||||
<a name='L74'></a><a href='#L74'>74</a>
|
||||
<a name='L75'></a><a href='#L75'>75</a>
|
||||
<a name='L76'></a><a href='#L76'>76</a>
|
||||
<a name='L77'></a><a href='#L77'>77</a>
|
||||
<a name='L78'></a><a href='#L78'>78</a>
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a>
|
||||
<a name='L83'></a><a href='#L83'>83</a>
|
||||
<a name='L84'></a><a href='#L84'>84</a>
|
||||
<a name='L85'></a><a href='#L85'>85</a>
|
||||
<a name='L86'></a><a href='#L86'>86</a>
|
||||
<a name='L87'></a><a href='#L87'>87</a>
|
||||
<a name='L88'></a><a href='#L88'>88</a>
|
||||
<a name='L89'></a><a href='#L89'>89</a>
|
||||
<a name='L90'></a><a href='#L90'>90</a>
|
||||
<a name='L91'></a><a href='#L91'>91</a>
|
||||
<a name='L92'></a><a href='#L92'>92</a>
|
||||
<a name='L93'></a><a href='#L93'>93</a>
|
||||
<a name='L94'></a><a href='#L94'>94</a>
|
||||
<a name='L95'></a><a href='#L95'>95</a>
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a>
|
||||
<a name='L99'></a><a href='#L99'>99</a>
|
||||
<a name='L100'></a><a href='#L100'>100</a>
|
||||
<a name='L101'></a><a href='#L101'>101</a>
|
||||
<a name='L102'></a><a href='#L102'>102</a>
|
||||
<a name='L103'></a><a href='#L103'>103</a>
|
||||
<a name='L104'></a><a href='#L104'>104</a>
|
||||
<a name='L105'></a><a href='#L105'>105</a>
|
||||
<a name='L106'></a><a href='#L106'>106</a>
|
||||
<a name='L107'></a><a href='#L107'>107</a>
|
||||
<a name='L108'></a><a href='#L108'>108</a>
|
||||
<a name='L109'></a><a href='#L109'>109</a>
|
||||
<a name='L110'></a><a href='#L110'>110</a>
|
||||
<a name='L111'></a><a href='#L111'>111</a>
|
||||
<a name='L112'></a><a href='#L112'>112</a>
|
||||
<a name='L113'></a><a href='#L113'>113</a>
|
||||
<a name='L114'></a><a href='#L114'>114</a>
|
||||
<a name='L115'></a><a href='#L115'>115</a>
|
||||
<a name='L116'></a><a href='#L116'>116</a>
|
||||
<a name='L117'></a><a href='#L117'>117</a>
|
||||
<a name='L118'></a><a href='#L118'>118</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">83x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">83x</span>
|
||||
<span class="cline-any cline-yes">30x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">83x</span>
|
||||
<span class="cline-any cline-yes">62x</span>
|
||||
<span class="cline-any cline-yes">62x</span>
|
||||
<span class="cline-any cline-yes">6x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">56x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">83x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">export interface CSVParseParam {
|
||||
/**
|
||||
* delimiter used for seperating columns. Use "auto" if delimiter is unknown in advance, in this case, delimiter will be auto-detected (by best attempt). Use an array to give a list of potential delimiters e.g. [",","|","$"]. default: ","
|
||||
*/
|
||||
delimiter: string | string[];
|
||||
/**
|
||||
* This parameter instructs the parser to ignore columns as specified by an array of column indexes or header names. Example: [1,3,5,"title","age"] will ignore columns 1, 3, 5, title column and age column and will not return them in the JSON output
|
||||
*/
|
||||
ignoreColumns?: RegExp;
|
||||
/**
|
||||
* This parameter instructs the parser to include only those columns as specified by an array of column indexes or header names. Example: [0,2,3,"name"] will parse and include only columns 0, 2, 3, and column with header "name" in the JSON output.
|
||||
*/
|
||||
includeColumns?: RegExp;
|
||||
/**
|
||||
* If a column contains delimiter, it is able to use quote character to surround the column content. e.g. "hello, world" wont be split into two columns while parsing. Set to "off" will ignore all quotes. default: " (double quote)
|
||||
*/
|
||||
quote: string;
|
||||
/**
|
||||
* Indicate if parser trim off spaces surrounding column content. e.g. " content " will be trimmed to "content". Default: true
|
||||
*/
|
||||
trim: boolean;
|
||||
/**
|
||||
* This parameter turns on and off whether check field type. Default is false.
|
||||
*/
|
||||
checkType: boolean;
|
||||
/**
|
||||
* Ignore the empty value in CSV columns. If a column value is not given, set this to true to skip them. Default: false.
|
||||
*/
|
||||
ignoreEmpty: boolean;
|
||||
/**
|
||||
* Delegate parsing work to another process.
|
||||
*/
|
||||
fork: boolean;
|
||||
/**
|
||||
* Indicating csv data has no header row and first row is data row. Default is false.
|
||||
*/
|
||||
noheader: boolean;
|
||||
/**
|
||||
* An array to specify the headers of CSV data. If --noheader is false, this value will override CSV header row. Default: null. Example: ["my field","name"].
|
||||
*/
|
||||
headers?: string[];
|
||||
/**
|
||||
* Don't interpret dots (.) and square brackets in header fields as nested object or array identifiers at all (treat them like regular characters for JSON field identifiers). Default: false.
|
||||
*/
|
||||
flatKeys: boolean;
|
||||
/**
|
||||
* the max character a csv row could have. 0 means infinite. If max number exceeded, parser will emit "error" of "row_exceed". if a possibly corrupted csv data provided, give it a number like 65535 so the parser wont consume memory. default: 0
|
||||
*/
|
||||
maxRowLength: number;
|
||||
/**
|
||||
* whether check column number of a row is the same as headers. If column number mismatched headers number, an error of "mismatched_column" will be emitted.. default: false
|
||||
*/
|
||||
checkColumn: boolean;
|
||||
/**
|
||||
* escape character used in quoted column. Default is double quote (") according to RFC4108. Change to back slash (\) or other chars for your own case.
|
||||
*/
|
||||
escape: string;
|
||||
/**
|
||||
* Allows override parsing logic for a specific column. It accepts a JSON object with fields like: headName: <String | Function> . e.g. {field1:'number'} will use built-in number parser to convert value of the field1 column to number. Another example {"name":nameProcessFunc} will use specified function to parse the value.
|
||||
*/
|
||||
colParser: {
|
||||
[key: string]: string | CellParser | ColumnParam
|
||||
};
|
||||
/**
|
||||
* End of line character. If omitted, parser will attempt to retrieve it from the first chunks of CSV data
|
||||
*/
|
||||
eol?: string;
|
||||
/**
|
||||
* Always interpret each line (as defined by eol) as a row. This will prevent eol characters from being used within a row (even inside a quoted field). This ensures that misplaced quotes only break on row, and not all ensuing rows.
|
||||
*/
|
||||
alwaysSplitAtEOL: boolean;
|
||||
output: "json" | "csv" | "line";
|
||||
}
|
||||
|
||||
export type CellParser = (item: string, head: string, resultRow: any, row: string[], columnIndex: number) => any;
|
||||
|
||||
export interface ColumnParam {
|
||||
flat?: boolean;
|
||||
cellParser?: string | CellParser;
|
||||
}
|
||||
|
||||
export function mergeParams(params?: Partial<CSVParseParam>): CSVParseParam {
|
||||
const defaultParam: CSVParseParam = {
|
||||
delimiter: ',',
|
||||
ignoreColumns: undefined,
|
||||
includeColumns: undefined,
|
||||
quote: '"',
|
||||
trim: true,
|
||||
checkType: false,
|
||||
ignoreEmpty: false,
|
||||
fork: false,
|
||||
noheader: false,
|
||||
headers: undefined,
|
||||
flatKeys: false,
|
||||
maxRowLength: 0,
|
||||
checkColumn: false,
|
||||
escape: '"',
|
||||
colParser: {},
|
||||
eol: undefined,
|
||||
alwaysSplitAtEOL: false,
|
||||
output: "json"
|
||||
}
|
||||
if (!params) {
|
||||
params = {};
|
||||
}
|
||||
for (let key in params) {
|
||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (params.hasOwnProperty(key)) {
|
||||
if (Array.isArray(params[key])) {
|
||||
defaultParam[key] = [].concat(params[key]);
|
||||
} else {
|
||||
defaultParam[key] = params[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return defaultParam;
|
||||
}
|
||||
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Thu May 17 2018 01:22:23 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="sorter.js"></script>
|
||||
<script src="block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,79 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2014 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = require('./util');
|
||||
|
||||
/**
|
||||
* Determine whether mappingB is after mappingA with respect to generated
|
||||
* position.
|
||||
*/
|
||||
function generatedPositionAfter(mappingA, mappingB) {
|
||||
// Optimized for most common case
|
||||
var lineA = mappingA.generatedLine;
|
||||
var lineB = mappingB.generatedLine;
|
||||
var columnA = mappingA.generatedColumn;
|
||||
var columnB = mappingB.generatedColumn;
|
||||
return lineB > lineA || lineB == lineA && columnB >= columnA ||
|
||||
util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* A data structure to provide a sorted view of accumulated mappings in a
|
||||
* performance conscious manner. It trades a neglibable overhead in general
|
||||
* case for a large speedup in case of mappings being added in order.
|
||||
*/
|
||||
function MappingList() {
|
||||
this._array = [];
|
||||
this._sorted = true;
|
||||
// Serves as infimum
|
||||
this._last = {generatedLine: -1, generatedColumn: 0};
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate through internal items. This method takes the same arguments that
|
||||
* `Array.prototype.forEach` takes.
|
||||
*
|
||||
* NOTE: The order of the mappings is NOT guaranteed.
|
||||
*/
|
||||
MappingList.prototype.unsortedForEach =
|
||||
function MappingList_forEach(aCallback, aThisArg) {
|
||||
this._array.forEach(aCallback, aThisArg);
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the given source mapping.
|
||||
*
|
||||
* @param Object aMapping
|
||||
*/
|
||||
MappingList.prototype.add = function MappingList_add(aMapping) {
|
||||
if (generatedPositionAfter(this._last, aMapping)) {
|
||||
this._last = aMapping;
|
||||
this._array.push(aMapping);
|
||||
} else {
|
||||
this._sorted = false;
|
||||
this._array.push(aMapping);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the flat, sorted array of mappings. The mappings are sorted by
|
||||
* generated position.
|
||||
*
|
||||
* WARNING: This method returns internal data without copying, for
|
||||
* performance. The return value must NOT be mutated, and should be treated as
|
||||
* an immutable borrow. If you want to take ownership, you must make your own
|
||||
* copy.
|
||||
*/
|
||||
MappingList.prototype.toArray = function MappingList_toArray() {
|
||||
if (!this._sorted) {
|
||||
this._array.sort(util.compareByGeneratedPositionsInflated);
|
||||
this._sorted = true;
|
||||
}
|
||||
return this._array;
|
||||
};
|
||||
|
||||
exports.MappingList = MappingList;
|
||||
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.visit = exports.use = exports.Type = exports.someField = exports.PathVisitor = exports.Path = exports.NodePath = exports.namedTypes = exports.getSupertypeNames = exports.getFieldValue = exports.getFieldNames = exports.getBuilderName = exports.finalize = exports.eachField = exports.defineMethod = exports.builtInTypes = exports.builders = exports.astNodesAreEquivalent = void 0;
|
||||
var tslib_1 = require("tslib");
|
||||
var fork_1 = tslib_1.__importDefault(require("./fork"));
|
||||
var core_1 = tslib_1.__importDefault(require("./def/core"));
|
||||
var es6_1 = tslib_1.__importDefault(require("./def/es6"));
|
||||
var es7_1 = tslib_1.__importDefault(require("./def/es7"));
|
||||
var es2020_1 = tslib_1.__importDefault(require("./def/es2020"));
|
||||
var jsx_1 = tslib_1.__importDefault(require("./def/jsx"));
|
||||
var flow_1 = tslib_1.__importDefault(require("./def/flow"));
|
||||
var esprima_1 = tslib_1.__importDefault(require("./def/esprima"));
|
||||
var babel_1 = tslib_1.__importDefault(require("./def/babel"));
|
||||
var typescript_1 = tslib_1.__importDefault(require("./def/typescript"));
|
||||
var es_proposals_1 = tslib_1.__importDefault(require("./def/es-proposals"));
|
||||
var namedTypes_1 = require("./gen/namedTypes");
|
||||
Object.defineProperty(exports, "namedTypes", { enumerable: true, get: function () { return namedTypes_1.namedTypes; } });
|
||||
var _a = fork_1.default([
|
||||
// This core module of AST types captures ES5 as it is parsed today by
|
||||
// git://github.com/ariya/esprima.git#master.
|
||||
core_1.default,
|
||||
// Feel free to add to or remove from this list of extension modules to
|
||||
// configure the precise type hierarchy that you need.
|
||||
es6_1.default,
|
||||
es7_1.default,
|
||||
es2020_1.default,
|
||||
jsx_1.default,
|
||||
flow_1.default,
|
||||
esprima_1.default,
|
||||
babel_1.default,
|
||||
typescript_1.default,
|
||||
es_proposals_1.default,
|
||||
]), astNodesAreEquivalent = _a.astNodesAreEquivalent, builders = _a.builders, builtInTypes = _a.builtInTypes, defineMethod = _a.defineMethod, eachField = _a.eachField, finalize = _a.finalize, getBuilderName = _a.getBuilderName, getFieldNames = _a.getFieldNames, getFieldValue = _a.getFieldValue, getSupertypeNames = _a.getSupertypeNames, n = _a.namedTypes, NodePath = _a.NodePath, Path = _a.Path, PathVisitor = _a.PathVisitor, someField = _a.someField, Type = _a.Type, use = _a.use, visit = _a.visit;
|
||||
exports.astNodesAreEquivalent = astNodesAreEquivalent;
|
||||
exports.builders = builders;
|
||||
exports.builtInTypes = builtInTypes;
|
||||
exports.defineMethod = defineMethod;
|
||||
exports.eachField = eachField;
|
||||
exports.finalize = finalize;
|
||||
exports.getBuilderName = getBuilderName;
|
||||
exports.getFieldNames = getFieldNames;
|
||||
exports.getFieldValue = getFieldValue;
|
||||
exports.getSupertypeNames = getSupertypeNames;
|
||||
exports.NodePath = NodePath;
|
||||
exports.Path = Path;
|
||||
exports.PathVisitor = PathVisitor;
|
||||
exports.someField = someField;
|
||||
exports.Type = Type;
|
||||
exports.use = use;
|
||||
exports.visit = visit;
|
||||
// Populate the exported fields of the namedTypes namespace, while still
|
||||
// retaining its member types.
|
||||
Object.assign(namedTypes_1.namedTypes, n);
|
||||
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function mergeParams(params) {
|
||||
var defaultParam = {
|
||||
delimiter: ',',
|
||||
ignoreColumns: undefined,
|
||||
includeColumns: undefined,
|
||||
quote: '"',
|
||||
trim: true,
|
||||
checkType: false,
|
||||
ignoreEmpty: false,
|
||||
// fork: false,
|
||||
noheader: false,
|
||||
headers: undefined,
|
||||
flatKeys: false,
|
||||
maxRowLength: 0,
|
||||
checkColumn: false,
|
||||
escape: '"',
|
||||
colParser: {},
|
||||
eol: undefined,
|
||||
alwaysSplitAtEOL: false,
|
||||
output: "json",
|
||||
nullObject: false,
|
||||
downstreamFormat: "line",
|
||||
needEmitAll: true
|
||||
};
|
||||
if (!params) {
|
||||
params = {};
|
||||
}
|
||||
for (var key in params) {
|
||||
if (params.hasOwnProperty(key)) {
|
||||
if (Array.isArray(params[key])) {
|
||||
defaultParam[key] = [].concat(params[key]);
|
||||
}
|
||||
else {
|
||||
defaultParam[key] = params[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return defaultParam;
|
||||
}
|
||||
exports.mergeParams = mergeParams;
|
||||
//# sourceMappingURL=Parameters.js.map
|
||||
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
var iteratorSymbol = require("es6-symbol").iterator;
|
||||
|
||||
module.exports = function () {
|
||||
var arr = ["foo", 1], iterator, result;
|
||||
if (typeof arr[iteratorSymbol] !== "function") return false;
|
||||
iterator = arr[iteratorSymbol]();
|
||||
if (!iterator) return false;
|
||||
if (typeof iterator.next !== "function") return false;
|
||||
result = iterator.next();
|
||||
if (!result) return false;
|
||||
if (result.value !== "foo") return false;
|
||||
if (result.done !== false) return false;
|
||||
return true;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"ansi-escapes","version":"6.0.0","files":{"license":{"checkedAt":1678883669302,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"package.json":{"checkedAt":1678883671081,"integrity":"sha512-BhwVX9iPyugrDh78aSJYJ1mwmsMQcTL04fDQcIEZi+mBciWKV3rV2p0I+XYANOPPAaQecRRimfmhGRikq3JNXw==","mode":420,"size":1004},"index.js":{"checkedAt":1678883671081,"integrity":"sha512-38xNdeY0f8C0y7qpYffUFgchJyFXV4p3Ka73czFLtwL7ib4yJSzLsuu2nLF29IMTxKAwTeRqyCsL/hMhxcd2wA==","mode":420,"size":3807},"readme.md":{"checkedAt":1678883671081,"integrity":"sha512-Noro2+twFX9z9mJ2fDYfTAr+16JXIb19xTuNGpnm31SuqjHiLcUApasyjOCGs1xmA/9UA95J5g+7SiuDfcCSEw==","mode":420,"size":4564},"index.d.ts":{"checkedAt":1678883671087,"integrity":"sha512-GyTuFJvqqt5E+JtqZIIDw/cTeauVfJzlwsGhAMO0UuKJUNIuRAzopNjTBKoyqACogqck2BSh1w9+xgzToEDF8w==","mode":420,"size":5505}}}
|
||||
@@ -0,0 +1,27 @@
|
||||
# Array length
|
||||
|
||||
_number_ primitive that conforms as valid _array length_
|
||||
|
||||
## `array-length/coerce`
|
||||
|
||||
Follows [`safe-integer/coerce`](safe-integer.md#safe-integercoerce) but returns `null` in place of values which are below `0`
|
||||
|
||||
```javascript
|
||||
const coerceToArrayLength = require("type/safe-integer/coerce");
|
||||
|
||||
coerceToArrayLength("12.95"); // 12
|
||||
coerceToArrayLength(9007199254740992); // null
|
||||
coerceToArrayLength(null); // null
|
||||
```
|
||||
|
||||
## `array-length/ensure`
|
||||
|
||||
If given argument is an _array length_ coercible value (via [`array-length/coerce`](#array-lengthcoerce)) returns result number.
|
||||
Otherwise `TypeError` is thrown.
|
||||
|
||||
```javascript
|
||||
const ensureArrayLength = require("type/array-length/ensure");
|
||||
|
||||
ensureArrayLength(12.93); // "12"
|
||||
ensureArrayLength(9007199254740992); // Thrown TypeError: 9007199254740992 is not a valid array length
|
||||
```
|
||||
@@ -0,0 +1,111 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/src/fileline.test.ts</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> / <a href="index.html">csv2json/src</a> fileline.test.ts
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>4/4</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>4/4</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {stringToLines} from "./fileline";
|
||||
import { mergeParams } from "./Parameters";
|
||||
import { Converter } from "./Converter";
|
||||
var assert = require("assert");
|
||||
describe("fileline function", function() {
|
||||
it ("should convert data to multiple lines ", function() {
|
||||
const conv=new Converter();
|
||||
var data = "abcde\nefef";
|
||||
var result = stringToLines(data, conv.parseRuntime);
|
||||
assert.equal(result.lines.length, 1);
|
||||
assert.equal(result.partial, "efef");
|
||||
assert.equal(result.lines[0], "abcde");
|
||||
});
|
||||
});
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:20:20 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,33 @@
|
||||
/* global Float32Array */
|
||||
|
||||
// Credit: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js
|
||||
|
||||
"use strict";
|
||||
|
||||
var toFloat32;
|
||||
|
||||
if (typeof Float32Array === "undefined") {
|
||||
toFloat32 = (function () {
|
||||
var pack = require("../_pack-ieee754")
|
||||
, unpack = require("../_unpack-ieee754");
|
||||
|
||||
return function (value) { return unpack(pack(value, 8, 23), 8, 23); };
|
||||
})();
|
||||
} else {
|
||||
toFloat32 = (function () {
|
||||
var float32Array = new Float32Array(1);
|
||||
return function (num) {
|
||||
float32Array[0] = num;
|
||||
return float32Array[0];
|
||||
};
|
||||
})();
|
||||
}
|
||||
|
||||
module.exports = function (value) {
|
||||
if (isNaN(value)) return NaN;
|
||||
value = Number(value);
|
||||
if (value === 0) return value;
|
||||
if (!isFinite(value)) return value;
|
||||
|
||||
return toFloat32(value);
|
||||
};
|
||||
@@ -0,0 +1,119 @@
|
||||
# pify [](https://travis-ci.org/sindresorhus/pify)
|
||||
|
||||
> Promisify a callback-style function
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save pify
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const pify = require('pify');
|
||||
|
||||
// promisify a single function
|
||||
|
||||
pify(fs.readFile)('package.json', 'utf8').then(data => {
|
||||
console.log(JSON.parse(data).name);
|
||||
//=> 'pify'
|
||||
});
|
||||
|
||||
// or promisify all methods in a module
|
||||
|
||||
pify(fs).readFile('package.json', 'utf8').then(data => {
|
||||
console.log(JSON.parse(data).name);
|
||||
//=> 'pify'
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pify(input, [promiseModule], [options])
|
||||
|
||||
Returns a promise wrapped version of the supplied function or module.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `function`, `object`
|
||||
|
||||
Callback-style function or module whose methods you want to promisify.
|
||||
|
||||
#### promiseModule
|
||||
|
||||
Type: `function`
|
||||
|
||||
Custom promise module to use instead of the native one.
|
||||
|
||||
Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill.
|
||||
|
||||
#### options
|
||||
|
||||
##### multiArgs
|
||||
|
||||
Type: `boolean`
|
||||
Default: `false`
|
||||
|
||||
By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument.
|
||||
|
||||
```js
|
||||
const request = require('request');
|
||||
const pify = require('pify');
|
||||
|
||||
pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => {
|
||||
const [httpResponse, body] = result;
|
||||
});
|
||||
```
|
||||
|
||||
##### include
|
||||
|
||||
Type: `array` of (`string`|`regex`)
|
||||
|
||||
Methods in a module to promisify. Remaining methods will be left untouched.
|
||||
|
||||
##### exclude
|
||||
|
||||
Type: `array` of (`string`|`regex`)
|
||||
Default: `[/.+Sync$/]`
|
||||
|
||||
Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default.
|
||||
|
||||
##### excludeMain
|
||||
|
||||
Type: `boolean`
|
||||
Default: `false`
|
||||
|
||||
By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module.
|
||||
|
||||
```js
|
||||
const pify = require('pify');
|
||||
|
||||
function fn() {
|
||||
return true;
|
||||
}
|
||||
|
||||
fn.method = (data, callback) => {
|
||||
setImmediate(() => {
|
||||
callback(data, null);
|
||||
});
|
||||
};
|
||||
|
||||
// promisify methods but not fn()
|
||||
const promiseFn = pify(fn, {excludeMain: true});
|
||||
|
||||
if (promiseFn()) {
|
||||
promiseFn.method('hi').then(data => {
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
(0, tslib_1.__exportStar)(require("./date-time"), exports);
|
||||
(0, tslib_1.__exportStar)(require("./number"), exports);
|
||||
@@ -0,0 +1,18 @@
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Checks if `value` is likely a prototype object.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
||||
*/
|
||||
function isPrototype(value) {
|
||||
var Ctor = value && value.constructor,
|
||||
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
||||
|
||||
return value === proto;
|
||||
}
|
||||
|
||||
module.exports = isPrototype;
|
||||
@@ -0,0 +1,30 @@
|
||||
import postcss from './postcss.js'
|
||||
|
||||
export default postcss
|
||||
|
||||
export const stringify = postcss.stringify
|
||||
export const fromJSON = postcss.fromJSON
|
||||
export const plugin = postcss.plugin
|
||||
export const parse = postcss.parse
|
||||
export const list = postcss.list
|
||||
|
||||
export const document = postcss.document
|
||||
export const comment = postcss.comment
|
||||
export const atRule = postcss.atRule
|
||||
export const rule = postcss.rule
|
||||
export const decl = postcss.decl
|
||||
export const root = postcss.root
|
||||
|
||||
export const CssSyntaxError = postcss.CssSyntaxError
|
||||
export const Declaration = postcss.Declaration
|
||||
export const Container = postcss.Container
|
||||
export const Processor = postcss.Processor
|
||||
export const Document = postcss.Document
|
||||
export const Comment = postcss.Comment
|
||||
export const Warning = postcss.Warning
|
||||
export const AtRule = postcss.AtRule
|
||||
export const Result = postcss.Result
|
||||
export const Input = postcss.Input
|
||||
export const Rule = postcss.Rule
|
||||
export const Root = postcss.Root
|
||||
export const Node = postcss.Node
|
||||
@@ -0,0 +1,202 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const http_1 = __importDefault(require("http"));
|
||||
const https_1 = __importDefault(require("https"));
|
||||
const once_1 = __importDefault(require("@tootallnate/once"));
|
||||
const debug_1 = __importDefault(require("debug"));
|
||||
const url_1 = require("url");
|
||||
const http_error_1 = __importDefault(require("./http-error"));
|
||||
const notfound_1 = __importDefault(require("./notfound"));
|
||||
const notmodified_1 = __importDefault(require("./notmodified"));
|
||||
const debug = debug_1.default('get-uri:http');
|
||||
/**
|
||||
* Returns a Readable stream from an "http:" URI.
|
||||
*/
|
||||
function get(parsed, opts) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
debug('GET %o', parsed.href);
|
||||
const cache = getCache(parsed, opts.cache);
|
||||
// first check the previous Expires and/or Cache-Control headers
|
||||
// of a previous response if a `cache` was provided
|
||||
if (cache && isFresh(cache) && typeof cache.statusCode === 'number') {
|
||||
// check for a 3xx "redirect" status code on the previous cache
|
||||
const type = (cache.statusCode / 100) | 0;
|
||||
if (type === 3 && cache.headers.location) {
|
||||
debug('cached redirect');
|
||||
throw new Error('TODO: implement cached redirects!');
|
||||
}
|
||||
// otherwise we assume that it's the destination endpoint,
|
||||
// since there's nowhere else to redirect to
|
||||
throw new notmodified_1.default();
|
||||
}
|
||||
// 5 redirects allowed by default
|
||||
const maxRedirects = typeof opts.maxRedirects === 'number' ? opts.maxRedirects : 5;
|
||||
debug('allowing %o max redirects', maxRedirects);
|
||||
let mod;
|
||||
if (opts.http) {
|
||||
// the `https` module passed in from the "http.js" file
|
||||
mod = opts.http;
|
||||
debug('using secure `https` core module');
|
||||
}
|
||||
else {
|
||||
mod = http_1.default;
|
||||
debug('using `http` core module');
|
||||
}
|
||||
const options = Object.assign(Object.assign({}, opts), parsed);
|
||||
// add "cache validation" headers if a `cache` was provided
|
||||
if (cache) {
|
||||
if (!options.headers) {
|
||||
options.headers = {};
|
||||
}
|
||||
const lastModified = cache.headers['last-modified'];
|
||||
if (lastModified) {
|
||||
options.headers['If-Modified-Since'] = lastModified;
|
||||
debug('added "If-Modified-Since" request header: %o', lastModified);
|
||||
}
|
||||
const etag = cache.headers.etag;
|
||||
if (etag) {
|
||||
options.headers['If-None-Match'] = etag;
|
||||
debug('added "If-None-Match" request header: %o', etag);
|
||||
}
|
||||
}
|
||||
const req = mod.get(options);
|
||||
const res = yield once_1.default(req, 'response');
|
||||
const code = res.statusCode || 0;
|
||||
// assign a Date to this response for the "Cache-Control" delta calculation
|
||||
res.date = Date.now();
|
||||
res.parsed = parsed;
|
||||
debug('got %o response status code', code);
|
||||
// any 2xx response is a "success" code
|
||||
let type = (code / 100) | 0;
|
||||
// check for a 3xx "redirect" status code
|
||||
let location = res.headers.location;
|
||||
if (type === 3 && location) {
|
||||
if (!opts.redirects)
|
||||
opts.redirects = [];
|
||||
let redirects = opts.redirects;
|
||||
if (redirects.length < maxRedirects) {
|
||||
debug('got a "redirect" status code with Location: %o', location);
|
||||
// flush this response - we're not going to use it
|
||||
res.resume();
|
||||
// hang on to this Response object for the "redirects" Array
|
||||
redirects.push(res);
|
||||
let newUri = url_1.resolve(parsed.href, location);
|
||||
debug('resolved redirect URL: %o', newUri);
|
||||
let left = maxRedirects - redirects.length;
|
||||
debug('%o more redirects allowed after this one', left);
|
||||
// check if redirecting to a different protocol
|
||||
let parsedUrl = url_1.parse(newUri);
|
||||
if (parsedUrl.protocol !== parsed.protocol) {
|
||||
opts.http = parsedUrl.protocol === 'https:' ? https_1.default : undefined;
|
||||
}
|
||||
return get(parsedUrl, opts);
|
||||
}
|
||||
}
|
||||
// if we didn't get a 2xx "success" status code, then create an Error object
|
||||
if (type !== 2) {
|
||||
res.resume();
|
||||
if (code === 304) {
|
||||
throw new notmodified_1.default();
|
||||
}
|
||||
else if (code === 404) {
|
||||
throw new notfound_1.default();
|
||||
}
|
||||
// other HTTP-level error
|
||||
throw new http_error_1.default(code);
|
||||
}
|
||||
if (opts.redirects) {
|
||||
// store a reference to the "redirects" Array on the Response object so that
|
||||
// they can be inspected during a subsequent call to GET the same URI
|
||||
res.redirects = opts.redirects;
|
||||
}
|
||||
return res;
|
||||
});
|
||||
}
|
||||
exports.default = get;
|
||||
/**
|
||||
* Returns `true` if the provided cache's "freshness" is valid. That is, either
|
||||
* the Cache-Control header or Expires header values are still within the allowed
|
||||
* time period.
|
||||
*
|
||||
* @return {Boolean}
|
||||
* @api private
|
||||
*/
|
||||
function isFresh(cache) {
|
||||
let fresh = false;
|
||||
let expires = parseInt(cache.headers.expires || '', 10);
|
||||
const cacheControl = cache.headers['cache-control'];
|
||||
if (cacheControl) {
|
||||
// for Cache-Control rules, see: http://www.mnot.net/cache_docs/#CACHE-CONTROL
|
||||
debug('Cache-Control: %o', cacheControl);
|
||||
const parts = cacheControl.split(/,\s*?\b/);
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
const part = parts[i];
|
||||
const subparts = part.split('=');
|
||||
const name = subparts[0];
|
||||
switch (name) {
|
||||
case 'max-age':
|
||||
expires = (cache.date || 0) + parseInt(subparts[1], 10) * 1000;
|
||||
fresh = Date.now() < expires;
|
||||
if (fresh) {
|
||||
debug('cache is "fresh" due to previous %o Cache-Control param', part);
|
||||
}
|
||||
return fresh;
|
||||
case 'must-revalidate':
|
||||
// XXX: what we supposed to do here?
|
||||
break;
|
||||
case 'no-cache':
|
||||
case 'no-store':
|
||||
debug('cache is "stale" due to explicit %o Cache-Control param', name);
|
||||
return false;
|
||||
default:
|
||||
// ignore unknown cache value
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (expires) {
|
||||
// for Expires rules, see: http://www.mnot.net/cache_docs/#EXPIRES
|
||||
debug('Expires: %o', expires);
|
||||
fresh = Date.now() < expires;
|
||||
if (fresh) {
|
||||
debug('cache is "fresh" due to previous Expires response header');
|
||||
}
|
||||
return fresh;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Attempts to return a previous Response object from a previous GET call to the
|
||||
* same URI.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
function getCache(parsed, cache) {
|
||||
if (cache) {
|
||||
if (cache.parsed && cache.parsed.href === parsed.href) {
|
||||
return cache;
|
||||
}
|
||||
if (cache.redirects) {
|
||||
for (let i = 0; i < cache.redirects.length; i++) {
|
||||
const c = getCache(parsed, cache.redirects[i]);
|
||||
if (c) {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//# sourceMappingURL=http.js.map
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,166 @@
|
||||
# lru cache
|
||||
|
||||
A cache object that deletes the least-recently-used items.
|
||||
|
||||
[](https://travis-ci.org/isaacs/node-lru-cache) [](https://coveralls.io/github/isaacs/node-lru-cache)
|
||||
|
||||
## Installation:
|
||||
|
||||
```javascript
|
||||
npm install lru-cache --save
|
||||
```
|
||||
|
||||
## Usage:
|
||||
|
||||
```javascript
|
||||
var LRU = require("lru-cache")
|
||||
, options = { max: 500
|
||||
, length: function (n, key) { return n * 2 + key.length }
|
||||
, dispose: function (key, n) { n.close() }
|
||||
, maxAge: 1000 * 60 * 60 }
|
||||
, cache = new LRU(options)
|
||||
, otherCache = new LRU(50) // sets just the max size
|
||||
|
||||
cache.set("key", "value")
|
||||
cache.get("key") // "value"
|
||||
|
||||
// non-string keys ARE fully supported
|
||||
// but note that it must be THE SAME object, not
|
||||
// just a JSON-equivalent object.
|
||||
var someObject = { a: 1 }
|
||||
cache.set(someObject, 'a value')
|
||||
// Object keys are not toString()-ed
|
||||
cache.set('[object Object]', 'a different value')
|
||||
assert.equal(cache.get(someObject), 'a value')
|
||||
// A similar object with same keys/values won't work,
|
||||
// because it's a different object identity
|
||||
assert.equal(cache.get({ a: 1 }), undefined)
|
||||
|
||||
cache.reset() // empty the cache
|
||||
```
|
||||
|
||||
If you put more stuff in it, then items will fall out.
|
||||
|
||||
If you try to put an oversized thing in it, then it'll fall out right
|
||||
away.
|
||||
|
||||
## Options
|
||||
|
||||
* `max` The maximum size of the cache, checked by applying the length
|
||||
function to all values in the cache. Not setting this is kind of
|
||||
silly, since that's the whole purpose of this lib, but it defaults
|
||||
to `Infinity`. Setting it to a non-number or negative number will
|
||||
throw a `TypeError`. Setting it to 0 makes it be `Infinity`.
|
||||
* `maxAge` Maximum age in ms. Items are not pro-actively pruned out
|
||||
as they age, but if you try to get an item that is too old, it'll
|
||||
drop it and return undefined instead of giving it to you.
|
||||
Setting this to a negative value will make everything seem old!
|
||||
Setting it to a non-number will throw a `TypeError`.
|
||||
* `length` Function that is used to calculate the length of stored
|
||||
items. If you're storing strings or buffers, then you probably want
|
||||
to do something like `function(n, key){return n.length}`. The default is
|
||||
`function(){return 1}`, which is fine if you want to store `max`
|
||||
like-sized things. The item is passed as the first argument, and
|
||||
the key is passed as the second argumnet.
|
||||
* `dispose` Function that is called on items when they are dropped
|
||||
from the cache. This can be handy if you want to close file
|
||||
descriptors or do other cleanup tasks when items are no longer
|
||||
accessible. Called with `key, value`. It's called *before*
|
||||
actually removing the item from the internal cache, so if you want
|
||||
to immediately put it back in, you'll have to do that in a
|
||||
`nextTick` or `setTimeout` callback or it won't do anything.
|
||||
* `stale` By default, if you set a `maxAge`, it'll only actually pull
|
||||
stale items out of the cache when you `get(key)`. (That is, it's
|
||||
not pre-emptively doing a `setTimeout` or anything.) If you set
|
||||
`stale:true`, it'll return the stale value before deleting it. If
|
||||
you don't set this, then it'll return `undefined` when you try to
|
||||
get a stale entry, as if it had already been deleted.
|
||||
* `noDisposeOnSet` By default, if you set a `dispose()` method, then
|
||||
it'll be called whenever a `set()` operation overwrites an existing
|
||||
key. If you set this option, `dispose()` will only be called when a
|
||||
key falls out of the cache, not when it is overwritten.
|
||||
* `updateAgeOnGet` When using time-expiring entries with `maxAge`,
|
||||
setting this to `true` will make each item's effective time update
|
||||
to the current time whenever it is retrieved from cache, causing it
|
||||
to not expire. (It can still fall out of cache based on recency of
|
||||
use, of course.)
|
||||
|
||||
## API
|
||||
|
||||
* `set(key, value, maxAge)`
|
||||
* `get(key) => value`
|
||||
|
||||
Both of these will update the "recently used"-ness of the key.
|
||||
They do what you think. `maxAge` is optional and overrides the
|
||||
cache `maxAge` option if provided.
|
||||
|
||||
If the key is not found, `get()` will return `undefined`.
|
||||
|
||||
The key and val can be any value.
|
||||
|
||||
* `peek(key)`
|
||||
|
||||
Returns the key value (or `undefined` if not found) without
|
||||
updating the "recently used"-ness of the key.
|
||||
|
||||
(If you find yourself using this a lot, you *might* be using the
|
||||
wrong sort of data structure, but there are some use cases where
|
||||
it's handy.)
|
||||
|
||||
* `del(key)`
|
||||
|
||||
Deletes a key out of the cache.
|
||||
|
||||
* `reset()`
|
||||
|
||||
Clear the cache entirely, throwing away all values.
|
||||
|
||||
* `has(key)`
|
||||
|
||||
Check if a key is in the cache, without updating the recent-ness
|
||||
or deleting it for being stale.
|
||||
|
||||
* `forEach(function(value,key,cache), [thisp])`
|
||||
|
||||
Just like `Array.prototype.forEach`. Iterates over all the keys
|
||||
in the cache, in order of recent-ness. (Ie, more recently used
|
||||
items are iterated over first.)
|
||||
|
||||
* `rforEach(function(value,key,cache), [thisp])`
|
||||
|
||||
The same as `cache.forEach(...)` but items are iterated over in
|
||||
reverse order. (ie, less recently used items are iterated over
|
||||
first.)
|
||||
|
||||
* `keys()`
|
||||
|
||||
Return an array of the keys in the cache.
|
||||
|
||||
* `values()`
|
||||
|
||||
Return an array of the values in the cache.
|
||||
|
||||
* `length`
|
||||
|
||||
Return total length of objects in cache taking into account
|
||||
`length` options function.
|
||||
|
||||
* `itemCount`
|
||||
|
||||
Return total quantity of objects currently in cache. Note, that
|
||||
`stale` (see options) items are returned as part of this item
|
||||
count.
|
||||
|
||||
* `dump()`
|
||||
|
||||
Return an array of the cache entries ready for serialization and usage
|
||||
with 'destinationCache.load(arr)`.
|
||||
|
||||
* `load(cacheEntriesArray)`
|
||||
|
||||
Loads another cache entries array, obtained with `sourceCache.dump()`,
|
||||
into the cache. The destination cache is reset before loading new entries
|
||||
|
||||
* `prune()`
|
||||
|
||||
Manually iterates over the entire cache proactively pruning old entries
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"manipulator.d.ts","sourceRoot":"","sources":["../../../../../packages/icu-messageformat-parser/manipulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,oBAAoB,EAErB,MAAM,SAAS,CAAA;AAkBhB;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,oBAAoB,EAAE,GAC1B,oBAAoB,EAAE,CAyBxB"}
|
||||
@@ -0,0 +1,34 @@
|
||||
export { is_void } from '../../shared/utils/names';
|
||||
export declare const invalid_attribute_name_character: RegExp;
|
||||
export declare function spread(args: any, attrs_to_add: any): string;
|
||||
export declare function merge_ssr_styles(style_attribute: any, style_directive: any): {};
|
||||
/**
|
||||
* Note: this method is performance sensitive and has been optimized
|
||||
* https://github.com/sveltejs/svelte/pull/5701
|
||||
*/
|
||||
export declare function escape(value: unknown, is_attr?: boolean): string;
|
||||
export declare function escape_attribute_value(value: any): any;
|
||||
export declare function escape_object(obj: any): {};
|
||||
export declare function each(items: any, fn: any): string;
|
||||
export declare const missing_component: {
|
||||
$$render: () => string;
|
||||
};
|
||||
export declare function validate_component(component: any, name: any): any;
|
||||
export declare function debug(file: any, line: any, column: any, values: any): string;
|
||||
export declare function create_ssr_component(fn: any): {
|
||||
render: (props?: {}, { $$slots, context }?: {
|
||||
$$slots?: {};
|
||||
context?: Map<any, any>;
|
||||
}) => {
|
||||
html: any;
|
||||
css: {
|
||||
code: string;
|
||||
map: any;
|
||||
};
|
||||
head: string;
|
||||
};
|
||||
$$render: (result: any, props: any, bindings: any, slots: any, context: any) => any;
|
||||
};
|
||||
export declare function add_attribute(name: any, value: any, boolean: any): string;
|
||||
export declare function add_classes(classes: any): string;
|
||||
export declare function add_styles(style_object: any): string;
|
||||
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.raceInit = exports.race = void 0;
|
||||
var Observable_1 = require("../Observable");
|
||||
var innerFrom_1 = require("./innerFrom");
|
||||
var argsOrArgArray_1 = require("../util/argsOrArgArray");
|
||||
var OperatorSubscriber_1 = require("../operators/OperatorSubscriber");
|
||||
function race() {
|
||||
var sources = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
sources[_i] = arguments[_i];
|
||||
}
|
||||
sources = argsOrArgArray_1.argsOrArgArray(sources);
|
||||
return sources.length === 1 ? innerFrom_1.innerFrom(sources[0]) : new Observable_1.Observable(raceInit(sources));
|
||||
}
|
||||
exports.race = race;
|
||||
function raceInit(sources) {
|
||||
return function (subscriber) {
|
||||
var subscriptions = [];
|
||||
var _loop_1 = function (i) {
|
||||
subscriptions.push(innerFrom_1.innerFrom(sources[i]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function (value) {
|
||||
if (subscriptions) {
|
||||
for (var s = 0; s < subscriptions.length; s++) {
|
||||
s !== i && subscriptions[s].unsubscribe();
|
||||
}
|
||||
subscriptions = null;
|
||||
}
|
||||
subscriber.next(value);
|
||||
})));
|
||||
};
|
||||
for (var i = 0; subscriptions && !subscriber.closed && i < sources.length; i++) {
|
||||
_loop_1(i);
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.raceInit = raceInit;
|
||||
//# sourceMappingURL=race.js.map
|
||||
@@ -0,0 +1,150 @@
|
||||
/*!
|
||||
* @description Recursive object extending
|
||||
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
||||
* @license MIT
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
function isSpecificValue(val) {
|
||||
return (
|
||||
val instanceof Buffer
|
||||
|| val instanceof Date
|
||||
|| val instanceof RegExp
|
||||
) ? true : false;
|
||||
}
|
||||
|
||||
function cloneSpecificValue(val) {
|
||||
if (val instanceof Buffer) {
|
||||
var x = Buffer.alloc
|
||||
? Buffer.alloc(val.length)
|
||||
: new Buffer(val.length);
|
||||
val.copy(x);
|
||||
return x;
|
||||
} else if (val instanceof Date) {
|
||||
return new Date(val.getTime());
|
||||
} else if (val instanceof RegExp) {
|
||||
return new RegExp(val);
|
||||
} else {
|
||||
throw new Error('Unexpected situation');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive cloning array.
|
||||
*/
|
||||
function deepCloneArray(arr) {
|
||||
var clone = [];
|
||||
arr.forEach(function (item, index) {
|
||||
if (typeof item === 'object' && item !== null) {
|
||||
if (Array.isArray(item)) {
|
||||
clone[index] = deepCloneArray(item);
|
||||
} else if (isSpecificValue(item)) {
|
||||
clone[index] = cloneSpecificValue(item);
|
||||
} else {
|
||||
clone[index] = deepExtend({}, item);
|
||||
}
|
||||
} else {
|
||||
clone[index] = item;
|
||||
}
|
||||
});
|
||||
return clone;
|
||||
}
|
||||
|
||||
function safeGetProperty(object, property) {
|
||||
return property === '__proto__' ? undefined : object[property];
|
||||
}
|
||||
|
||||
/**
|
||||
* Extening object that entered in first argument.
|
||||
*
|
||||
* Returns extended object or false if have no target object or incorrect type.
|
||||
*
|
||||
* If you wish to clone source object (without modify it), just use empty new
|
||||
* object as first argument, like this:
|
||||
* deepExtend({}, yourObj_1, [yourObj_N]);
|
||||
*/
|
||||
var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) {
|
||||
if (arguments.length < 1 || typeof arguments[0] !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (arguments.length < 2) {
|
||||
return arguments[0];
|
||||
}
|
||||
|
||||
var target = arguments[0];
|
||||
|
||||
// convert arguments to array and cut off target object
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
|
||||
var val, src, clone;
|
||||
|
||||
args.forEach(function (obj) {
|
||||
// skip argument if isn't an object, is null, or is an array
|
||||
if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object.keys(obj).forEach(function (key) {
|
||||
src = safeGetProperty(target, key); // source value
|
||||
val = safeGetProperty(obj, key); // new value
|
||||
|
||||
// recursion prevention
|
||||
if (val === target) {
|
||||
return;
|
||||
|
||||
/**
|
||||
* if new value isn't object then just overwrite by new value
|
||||
* instead of extending.
|
||||
*/
|
||||
} else if (typeof val !== 'object' || val === null) {
|
||||
target[key] = val;
|
||||
return;
|
||||
|
||||
// just clone arrays (and recursive clone objects inside)
|
||||
} else if (Array.isArray(val)) {
|
||||
target[key] = deepCloneArray(val);
|
||||
return;
|
||||
|
||||
// custom cloning and overwrite for specific objects
|
||||
} else if (isSpecificValue(val)) {
|
||||
target[key] = cloneSpecificValue(val);
|
||||
return;
|
||||
|
||||
// overwrite by new value if source isn't object or array
|
||||
} else if (typeof src !== 'object' || src === null || Array.isArray(src)) {
|
||||
target[key] = deepExtend({}, val);
|
||||
return;
|
||||
|
||||
// source value and new value is objects both, extending...
|
||||
} else {
|
||||
target[key] = deepExtend(src, val);
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return target;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"ansi-align","version":"3.0.1","files":{"LICENSE":{"checkedAt":1678883672450,"integrity":"sha512-kRxHfFqWpkSG2hb5KtnGvgGb0E7TakZN7fuLAQPJxzhhfT+gp3eqr9qdv+QwsgNG8w/TbETqtg6Iunhub8sk6Q==","mode":420,"size":731},"package.json":{"checkedAt":1678883672450,"integrity":"sha512-mNTuvMD8KAXu8VO2RQGvWYjzEnk+tNkfOWIwNPmwhIo5HxGOzz2POO73tstonT1n8An+3cIjmddgGitz5hSvDQ==","mode":420,"size":926},"index.js":{"checkedAt":1678883672450,"integrity":"sha512-aFO3Mu4EXzGOVoO0UjWGAZD1xR4p1iRakL2YyzT8UaTWJVqJljS2NuOiA22lo/d1yX4oJzAlrhlCDgngTTkFbA==","mode":420,"size":1334},"CHANGELOG.md":{"checkedAt":1678883672450,"integrity":"sha512-6kPTxPy6sNjS+9lJnjiEajwkxrhR3VVjG7EmrewLAPC5ljQz0LaQICCcBRW/7cIQqBxKnVMugxSjPLmh6nR0QA==","mode":420,"size":1748},"README.md":{"checkedAt":1678883672450,"integrity":"sha512-0ljvoq7z9bl1HlD99giDgQlAjh1GYiQfSqVvdzSP9z91SkKh4REocz8ACP8y4lLMS5Jlttmpv8XKlWFfpdX9rg==","mode":420,"size":2945}}}
|
||||
@@ -0,0 +1,2 @@
|
||||
var convert = require('./convert');
|
||||
module.exports = convert(require('../string'));
|
||||
@@ -0,0 +1,2 @@
|
||||
declare function isPlainObject(value: any): boolean;
|
||||
export default isPlainObject;
|
||||
@@ -0,0 +1,473 @@
|
||||
import { SourceMapGenerator, RawSourceMap } from 'source-map-js'
|
||||
|
||||
import Node, {
|
||||
Position,
|
||||
Source,
|
||||
ChildNode,
|
||||
NodeErrorOptions,
|
||||
NodeProps,
|
||||
ChildProps,
|
||||
AnyNode
|
||||
} from './node.js'
|
||||
import Declaration, { DeclarationProps } from './declaration.js'
|
||||
import Container, { ContainerProps } from './container.js'
|
||||
import Document, { DocumentProps } from './document.js'
|
||||
import Warning, { WarningOptions } from './warning.js'
|
||||
import Comment, { CommentProps } from './comment.js'
|
||||
import AtRule, { AtRuleProps } from './at-rule.js'
|
||||
import Input, { FilePosition } from './input.js'
|
||||
import Result, { Message } from './result.js'
|
||||
import Root, { RootProps } from './root.js'
|
||||
import Rule, { RuleProps } from './rule.js'
|
||||
import CssSyntaxError from './css-syntax-error.js'
|
||||
import list, { List } from './list.js'
|
||||
import LazyResult from './lazy-result.js'
|
||||
import Processor from './processor.js'
|
||||
|
||||
export {
|
||||
NodeErrorOptions,
|
||||
DeclarationProps,
|
||||
CssSyntaxError,
|
||||
ContainerProps,
|
||||
WarningOptions,
|
||||
DocumentProps,
|
||||
FilePosition,
|
||||
CommentProps,
|
||||
AtRuleProps,
|
||||
Declaration,
|
||||
ChildProps,
|
||||
LazyResult,
|
||||
ChildNode,
|
||||
NodeProps,
|
||||
Processor,
|
||||
RuleProps,
|
||||
RootProps,
|
||||
Container,
|
||||
Position,
|
||||
Document,
|
||||
AnyNode,
|
||||
Warning,
|
||||
Message,
|
||||
Comment,
|
||||
Source,
|
||||
AtRule,
|
||||
Result,
|
||||
Input,
|
||||
Node,
|
||||
list,
|
||||
Rule,
|
||||
Root
|
||||
}
|
||||
|
||||
export type SourceMap = SourceMapGenerator & {
|
||||
toJSON(): RawSourceMap
|
||||
}
|
||||
|
||||
export type Helpers = { result: Result; postcss: Postcss } & Postcss
|
||||
|
||||
type DocumentProcessor = (
|
||||
document: Document,
|
||||
helper: Helpers
|
||||
) => Promise<void> | void
|
||||
type RootProcessor = (root: Root, helper: Helpers) => Promise<void> | void
|
||||
type DeclarationProcessor = (
|
||||
decl: Declaration,
|
||||
helper: Helpers
|
||||
) => Promise<void> | void
|
||||
type RuleProcessor = (rule: Rule, helper: Helpers) => Promise<void> | void
|
||||
type AtRuleProcessor = (atRule: AtRule, helper: Helpers) => Promise<void> | void
|
||||
type CommentProcessor = (
|
||||
comment: Comment,
|
||||
helper: Helpers
|
||||
) => Promise<void> | void
|
||||
|
||||
interface Processors {
|
||||
/**
|
||||
* Will be called on `Document` node.
|
||||
*
|
||||
* Will be called again on children changes.
|
||||
*/
|
||||
Document?: DocumentProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Document` node, when all children will be processed.
|
||||
*
|
||||
* Will be called again on children changes.
|
||||
*/
|
||||
DocumentExit?: DocumentProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Root` node once.
|
||||
*/
|
||||
Once?: RootProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Root` node once, when all children will be processed.
|
||||
*/
|
||||
OnceExit?: RootProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Root` node.
|
||||
*
|
||||
* Will be called again on children changes.
|
||||
*/
|
||||
Root?: RootProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Root` node, when all children will be processed.
|
||||
*
|
||||
* Will be called again on children changes.
|
||||
*/
|
||||
RootExit?: RootProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all `Declaration` nodes after listeners
|
||||
* for `Declaration` event.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
Declaration?: DeclarationProcessor | { [prop: string]: DeclarationProcessor }
|
||||
|
||||
/**
|
||||
* Will be called on all `Declaration` nodes.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
DeclarationExit?:
|
||||
| DeclarationProcessor
|
||||
| { [prop: string]: DeclarationProcessor }
|
||||
|
||||
/**
|
||||
* Will be called on all `Rule` nodes.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
Rule?: RuleProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all `Rule` nodes, when all children will be processed.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
RuleExit?: RuleProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all`AtRule` nodes.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
AtRule?: AtRuleProcessor | { [name: string]: AtRuleProcessor }
|
||||
|
||||
/**
|
||||
* Will be called on all `AtRule` nodes, when all children will be processed.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
AtRuleExit?: AtRuleProcessor | { [name: string]: AtRuleProcessor }
|
||||
|
||||
/**
|
||||
* Will be called on all `Comment` nodes.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
Comment?: CommentProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all `Comment` nodes after listeners
|
||||
* for `Comment` event.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
CommentExit?: CommentProcessor
|
||||
|
||||
/**
|
||||
* Will be called when all other listeners processed the document.
|
||||
*
|
||||
* This listener will not be called again.
|
||||
*/
|
||||
Exit?: RootProcessor
|
||||
}
|
||||
|
||||
export interface Plugin extends Processors {
|
||||
postcssPlugin: string
|
||||
prepare?: (result: Result) => Processors
|
||||
}
|
||||
|
||||
export interface PluginCreator<PluginOptions> {
|
||||
(opts?: PluginOptions): Plugin | Processor
|
||||
postcss: true
|
||||
}
|
||||
|
||||
export interface Transformer extends TransformCallback {
|
||||
postcssPlugin: string
|
||||
postcssVersion: string
|
||||
}
|
||||
|
||||
export interface TransformCallback {
|
||||
(root: Root, result: Result): Promise<void> | void
|
||||
}
|
||||
|
||||
export interface OldPlugin<T> extends Transformer {
|
||||
(opts?: T): Transformer
|
||||
postcss: Transformer
|
||||
}
|
||||
|
||||
export type AcceptedPlugin =
|
||||
| Plugin
|
||||
| PluginCreator<any>
|
||||
| OldPlugin<any>
|
||||
| TransformCallback
|
||||
| {
|
||||
postcss: TransformCallback | Processor
|
||||
}
|
||||
| Processor
|
||||
|
||||
export interface Parser<RootNode = Root | Document> {
|
||||
(
|
||||
css: string | { toString(): string },
|
||||
opts?: Pick<ProcessOptions, 'map' | 'from'>
|
||||
): RootNode
|
||||
}
|
||||
|
||||
export interface Builder {
|
||||
(part: string, node?: AnyNode, type?: 'start' | 'end'): void
|
||||
}
|
||||
|
||||
export interface Stringifier {
|
||||
(node: AnyNode, builder: Builder): void
|
||||
}
|
||||
|
||||
export interface JSONHydrator {
|
||||
(data: object[]): Node[]
|
||||
(data: object): Node
|
||||
}
|
||||
|
||||
export interface Syntax {
|
||||
/**
|
||||
* Function to generate AST by string.
|
||||
*/
|
||||
parse?: Parser
|
||||
|
||||
/**
|
||||
* Class to generate string by AST.
|
||||
*/
|
||||
stringify?: Stringifier
|
||||
}
|
||||
|
||||
export interface SourceMapOptions {
|
||||
/**
|
||||
* Indicates that the source map should be embedded in the output CSS
|
||||
* as a Base64-encoded comment. By default, it is `true`.
|
||||
* But if all previous maps are external, not inline, PostCSS will not embed
|
||||
* the map even if you do not set this option.
|
||||
*
|
||||
* If you have an inline source map, the result.map property will be empty,
|
||||
* as the source map will be contained within the text of `result.css`.
|
||||
*/
|
||||
inline?: boolean
|
||||
|
||||
/**
|
||||
* Source map content from a previous processing step (e.g., Sass).
|
||||
*
|
||||
* PostCSS will try to read the previous source map
|
||||
* automatically (based on comments within the source CSS), but you can use
|
||||
* this option to identify it manually.
|
||||
*
|
||||
* If desired, you can omit the previous map with prev: `false`.
|
||||
*/
|
||||
prev?: string | boolean | object | ((file: string) => string)
|
||||
|
||||
/**
|
||||
* Indicates that PostCSS should set the origin content (e.g., Sass source)
|
||||
* of the source map. By default, it is true. But if all previous maps do not
|
||||
* contain sources content, PostCSS will also leave it out even if you
|
||||
* do not set this option.
|
||||
*/
|
||||
sourcesContent?: boolean
|
||||
|
||||
/**
|
||||
* Indicates that PostCSS should add annotation comments to the CSS.
|
||||
* By default, PostCSS will always add a comment with a path
|
||||
* to the source map. PostCSS will not add annotations to CSS files
|
||||
* that do not contain any comments.
|
||||
*
|
||||
* By default, PostCSS presumes that you want to save the source map as
|
||||
* `opts.to + '.map'` and will use this path in the annotation comment.
|
||||
* A different path can be set by providing a string value for annotation.
|
||||
*
|
||||
* If you have set `inline: true`, annotation cannot be disabled.
|
||||
*/
|
||||
annotation?: string | boolean | ((file: string, root: Root) => string)
|
||||
|
||||
/**
|
||||
* Override `from` in map’s sources.
|
||||
*/
|
||||
from?: string
|
||||
|
||||
/**
|
||||
* Use absolute path in generated source map.
|
||||
*/
|
||||
absolute?: boolean
|
||||
}
|
||||
|
||||
export interface ProcessOptions {
|
||||
/**
|
||||
* The path of the CSS source file. You should always set `from`,
|
||||
* because it is used in source map generation and syntax error messages.
|
||||
*/
|
||||
from?: string
|
||||
|
||||
/**
|
||||
* The path where you'll put the output CSS file. You should always set `to`
|
||||
* to generate correct source maps.
|
||||
*/
|
||||
to?: string
|
||||
|
||||
/**
|
||||
* Function to generate AST by string.
|
||||
*/
|
||||
parser?: Syntax | Parser
|
||||
|
||||
/**
|
||||
* Class to generate string by AST.
|
||||
*/
|
||||
stringifier?: Syntax | Stringifier
|
||||
|
||||
/**
|
||||
* Object with parse and stringify.
|
||||
*/
|
||||
syntax?: Syntax
|
||||
|
||||
/**
|
||||
* Source map options
|
||||
*/
|
||||
map?: SourceMapOptions | boolean
|
||||
}
|
||||
|
||||
export interface Postcss {
|
||||
/**
|
||||
* Create a new `Processor` instance that will apply `plugins`
|
||||
* as CSS processors.
|
||||
*
|
||||
* ```js
|
||||
* let postcss = require('postcss')
|
||||
*
|
||||
* postcss(plugins).process(css, { from, to }).then(result => {
|
||||
* console.log(result.css)
|
||||
* })
|
||||
* ```
|
||||
*
|
||||
* @param plugins PostCSS plugins.
|
||||
* @return Processor to process multiple CSS.
|
||||
*/
|
||||
(plugins?: AcceptedPlugin[]): Processor
|
||||
(...plugins: AcceptedPlugin[]): Processor
|
||||
|
||||
/**
|
||||
* Default function to convert a node tree into a CSS string.
|
||||
*/
|
||||
stringify: Stringifier
|
||||
|
||||
/**
|
||||
* Parses source css and returns a new `Root` or `Document` node,
|
||||
* which contains the source CSS nodes.
|
||||
*
|
||||
* ```js
|
||||
* // Simple CSS concatenation with source map support
|
||||
* const root1 = postcss.parse(css1, { from: file1 })
|
||||
* const root2 = postcss.parse(css2, { from: file2 })
|
||||
* root1.append(root2).toResult().css
|
||||
* ```
|
||||
*/
|
||||
parse: Parser<Root>
|
||||
|
||||
/**
|
||||
* Rehydrate a JSON AST (from `Node#toJSON`) back into the AST classes.
|
||||
*
|
||||
* ```js
|
||||
* const json = root.toJSON()
|
||||
* // save to file, send by network, etc
|
||||
* const root2 = postcss.fromJSON(json)
|
||||
* ```
|
||||
*/
|
||||
fromJSON: JSONHydrator
|
||||
|
||||
/**
|
||||
* Contains the `list` module.
|
||||
*/
|
||||
list: List
|
||||
|
||||
/**
|
||||
* Creates a new `Comment` node.
|
||||
*
|
||||
* @param defaults Properties for the new node.
|
||||
* @return New comment node
|
||||
*/
|
||||
comment(defaults?: CommentProps): Comment
|
||||
|
||||
/**
|
||||
* Creates a new `AtRule` node.
|
||||
*
|
||||
* @param defaults Properties for the new node.
|
||||
* @return New at-rule node.
|
||||
*/
|
||||
atRule(defaults?: AtRuleProps): AtRule
|
||||
|
||||
/**
|
||||
* Creates a new `Declaration` node.
|
||||
*
|
||||
* @param defaults Properties for the new node.
|
||||
* @return New declaration node.
|
||||
*/
|
||||
decl(defaults?: DeclarationProps): Declaration
|
||||
|
||||
/**
|
||||
* Creates a new `Rule` node.
|
||||
*
|
||||
* @param default Properties for the new node.
|
||||
* @return New rule node.
|
||||
*/
|
||||
rule(defaults?: RuleProps): Rule
|
||||
|
||||
/**
|
||||
* Creates a new `Root` node.
|
||||
*
|
||||
* @param defaults Properties for the new node.
|
||||
* @return New root node.
|
||||
*/
|
||||
root(defaults?: RootProps): Root
|
||||
|
||||
/**
|
||||
* Creates a new `Document` node.
|
||||
*
|
||||
* @param defaults Properties for the new node.
|
||||
* @return New document node.
|
||||
*/
|
||||
document(defaults?: DocumentProps): Document
|
||||
|
||||
CssSyntaxError: typeof CssSyntaxError
|
||||
Declaration: typeof Declaration
|
||||
Container: typeof Container
|
||||
Comment: typeof Comment
|
||||
Warning: typeof Warning
|
||||
AtRule: typeof AtRule
|
||||
Result: typeof Result
|
||||
Input: typeof Input
|
||||
Rule: typeof Rule
|
||||
Root: typeof Root
|
||||
Node: typeof Node
|
||||
}
|
||||
|
||||
export const stringify: Stringifier
|
||||
export const parse: Parser<Root>
|
||||
export const fromJSON: JSONHydrator
|
||||
|
||||
export const comment: Postcss['comment']
|
||||
export const atRule: Postcss['atRule']
|
||||
export const decl: Postcss['decl']
|
||||
export const rule: Postcss['rule']
|
||||
export const root: Postcss['root']
|
||||
|
||||
declare const postcss: Postcss
|
||||
|
||||
export default postcss
|
||||
Reference in New Issue
Block a user