new license file version [CI SKIP]

This commit is contained in:
2023-03-15 12:34:41 +00:00
parent 0a6d92a1f3
commit 61328d20ed
13115 changed files with 1892314 additions and 1 deletions

View File

@@ -0,0 +1,69 @@
var Hack = require('./hack');
var Marker = require('../tokenizer/marker');
var ASTERISK_HACK = '*';
var BACKSLASH_HACK = '\\';
var IMPORTANT_TOKEN = '!important';
var UNDERSCORE_HACK = '_';
var BANG_HACK = '!ie';
function restoreFromOptimizing(properties, restoreCallback) {
var property;
var restored;
var current;
var i;
for (i = properties.length - 1; i >= 0; i--) {
property = properties[i];
if (property.unused) {
continue;
}
if (!property.dirty && !property.important && !property.hack) {
continue;
}
if (restoreCallback) {
restored = restoreCallback(property);
property.value = restored;
} else {
restored = property.value;
}
if (property.important) {
restoreImportant(property);
}
if (property.hack) {
restoreHack(property);
}
if ('all' in property) {
current = property.all[property.position];
current[1][1] = property.name;
current.splice(2, current.length - 1);
Array.prototype.push.apply(current, restored);
}
}
}
function restoreImportant(property) {
property.value[property.value.length - 1][1] += IMPORTANT_TOKEN;
}
function restoreHack(property) {
if (property.hack[0] == Hack.UNDERSCORE) {
property.name = UNDERSCORE_HACK + property.name;
} else if (property.hack[0] == Hack.ASTERISK) {
property.name = ASTERISK_HACK + property.name;
} else if (property.hack[0] == Hack.BACKSLASH) {
property.value[property.value.length - 1][1] += BACKSLASH_HACK + property.hack[1];
} else if (property.hack[0] == Hack.BANG) {
property.value[property.value.length - 1][1] += Marker.SPACE + BANG_HACK;
}
}
module.exports = restoreFromOptimizing;

View File

@@ -0,0 +1 @@
{"version":3,"file":"bufferTime.js","sourceRoot":"","sources":["../../../../src/internal/operators/bufferTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAm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,IAAI,QAAQ,EAAE;gBAIZ,QAAQ,GAAG,KAAK,CAAC;gBACjB,IAAM,KAAK,GAAG,SAAU,CAAC;gBACzB,SAAS,GAAG,IAAI,CAAC;gBAEjB,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACvB,CAAC,UAAU,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;aACrC;QACH,CAAC,CAAC;QAEF,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EAMV,UAAC,KAAK;YACJ,QAAQ,GAAG,IAAI,CAAC;YAChB,SAAS,GAAG,KAAK,CAAC;YAClB,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QACjF,CAAC,EACD;YACE,UAAU,GAAG,IAAI,CAAC;YAClB,CAAC,CAAC,QAAQ,IAAI,QAAQ,IAAI,SAAS,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QACrF,CAAC,CACF,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,294 @@
// Declare "static" methods in Error
interface ErrorConstructor {
/** Create .stack property on a target object */
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
/**
* Optional override for formatting stack traces
*
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
*/
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
stackTraceLimit: number;
}
/*-----------------------------------------------*
* *
* GLOBAL *
* *
------------------------------------------------*/
// For backwards compability
interface NodeRequire extends NodeJS.Require { }
interface RequireResolve extends NodeJS.RequireResolve { }
interface NodeModule extends NodeJS.Module { }
declare var process: NodeJS.Process;
declare var console: Console;
declare var __filename: string;
declare var __dirname: string;
declare var require: NodeRequire;
declare var module: NodeModule;
// Same as module.exports
declare var exports: any;
/**
* Only available if `--expose-gc` is passed to the process.
*/
declare var gc: undefined | (() => void);
//#region borrowed
// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
interface AbortController {
/**
* Returns the AbortSignal object associated with this object.
*/
readonly signal: AbortSignal;
/**
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
*/
abort(): void;
}
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
interface AbortSignal extends EventTarget {
/**
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
*/
readonly aborted: boolean;
}
declare var AbortController: {
prototype: AbortController;
new(): AbortController;
};
declare var AbortSignal: {
prototype: AbortSignal;
new(): AbortSignal;
// TODO: Add abort() static
};
//#endregion borrowed
//#region ArrayLike.at()
interface RelativeIndexable<T> {
/**
* Takes an integer value and returns the item at that index,
* allowing for positive and negative integers.
* Negative integers count back from the last item in the array.
*/
at(index: number): T | undefined;
}
interface String extends RelativeIndexable<string> {}
interface Array<T> extends RelativeIndexable<T> {}
interface Int8Array extends RelativeIndexable<number> {}
interface Uint8Array extends RelativeIndexable<number> {}
interface Uint8ClampedArray extends RelativeIndexable<number> {}
interface Int16Array extends RelativeIndexable<number> {}
interface Uint16Array extends RelativeIndexable<number> {}
interface Int32Array extends RelativeIndexable<number> {}
interface Uint32Array extends RelativeIndexable<number> {}
interface Float32Array extends RelativeIndexable<number> {}
interface Float64Array extends RelativeIndexable<number> {}
interface BigInt64Array extends RelativeIndexable<bigint> {}
interface BigUint64Array extends RelativeIndexable<bigint> {}
//#endregion ArrayLike.at() end
/**
* @since v17.0.0
*
* Creates a deep clone of an object.
*/
declare function structuredClone<T>(
value: T,
transfer?: { transfer: ReadonlyArray<import('worker_threads').TransferListItem> },
): T;
/*----------------------------------------------*
* *
* GLOBAL INTERFACES *
* *
*-----------------------------------------------*/
declare namespace NodeJS {
interface CallSite {
/**
* Value of "this"
*/
getThis(): unknown;
/**
* Type of "this" as a string.
* This is the name of the function stored in the constructor field of
* "this", if available. Otherwise the object's [[Class]] internal
* property.
*/
getTypeName(): string | null;
/**
* Current function
*/
getFunction(): Function | undefined;
/**
* Name of the current function, typically its name property.
* If a name property is not available an attempt will be made to try
* to infer a name from the function's context.
*/
getFunctionName(): string | null;
/**
* Name of the property [of "this" or one of its prototypes] that holds
* the current function
*/
getMethodName(): string | null;
/**
* Name of the script [if this function was defined in a script]
*/
getFileName(): string | null;
/**
* Current line number [if this function was defined in a script]
*/
getLineNumber(): number | null;
/**
* Current column number [if this function was defined in a script]
*/
getColumnNumber(): number | null;
/**
* A call site object representing the location where eval was called
* [if this function was created using a call to eval]
*/
getEvalOrigin(): string | undefined;
/**
* Is this a toplevel invocation, that is, is "this" the global object?
*/
isToplevel(): boolean;
/**
* Does this call take place in code defined by a call to eval?
*/
isEval(): boolean;
/**
* Is this call in native V8 code?
*/
isNative(): boolean;
/**
* Is this a constructor call?
*/
isConstructor(): boolean;
}
interface ErrnoException extends Error {
errno?: number | undefined;
code?: string | undefined;
path?: string | undefined;
syscall?: string | undefined;
}
interface ReadableStream extends EventEmitter {
readable: boolean;
read(size?: number): string | Buffer;
setEncoding(encoding: BufferEncoding): this;
pause(): this;
resume(): this;
isPaused(): boolean;
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
unpipe(destination?: WritableStream): this;
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
wrap(oldStream: ReadableStream): this;
[Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
}
interface WritableStream extends EventEmitter {
writable: boolean;
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
end(cb?: () => void): this;
end(data: string | Uint8Array, cb?: () => void): this;
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
}
interface ReadWriteStream extends ReadableStream, WritableStream { }
interface RefCounted {
ref(): this;
unref(): this;
}
type TypedArray =
| Uint8Array
| Uint8ClampedArray
| Uint16Array
| Uint32Array
| Int8Array
| Int16Array
| Int32Array
| BigUint64Array
| BigInt64Array
| Float32Array
| Float64Array;
type ArrayBufferView = TypedArray | DataView;
interface Require {
(id: string): any;
resolve: RequireResolve;
cache: Dict<NodeModule>;
/**
* @deprecated
*/
extensions: RequireExtensions;
main: Module | undefined;
}
interface RequireResolve {
(id: string, options?: { paths?: string[] | undefined; }): string;
paths(request: string): string[] | null;
}
interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
'.js': (m: Module, filename: string) => any;
'.json': (m: Module, filename: string) => any;
'.node': (m: Module, filename: string) => any;
}
interface Module {
/**
* `true` if the module is running during the Node.js preload
*/
isPreloading: boolean;
exports: any;
require: Require;
id: string;
filename: string;
loaded: boolean;
/** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
parent: Module | null | undefined;
children: Module[];
/**
* @since v11.14.0
*
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
*/
path: string;
paths: string[];
}
interface Dict<T> {
[key: string]: T | undefined;
}
interface ReadOnlyDict<T> {
readonly [key: string]: T | undefined;
}
}

View File

@@ -0,0 +1,18 @@
import { Node, Identifier } from 'estree';
import Component from '../../Component';
import TemplateScope from './TemplateScope';
export interface Context {
key: Identifier;
name?: string;
modifier: (node: Node) => Node;
default_modifier: (node: Node, to_ctx: (name: string) => Node) => Node;
}
export declare function unpack_destructuring({ contexts, node, modifier, default_modifier, scope, component, context_rest_properties }: {
contexts: Context[];
node: Node;
modifier?: Context['modifier'];
default_modifier?: Context['default_modifier'];
scope: TemplateScope;
component: Component;
context_rest_properties: Map<string, Node>;
}): void;

View File

@@ -0,0 +1 @@
{"version":3,"file":"UnicodeExtensionValue.d.ts","sourceRoot":"","sources":["../../../../../../../packages/intl-localematcher/abstract/UnicodeExtensionValue.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,sBAoCnE"}

View File

@@ -0,0 +1,98 @@
import { Observable } from '../Observable';
import { OperatorFunction, ObservableInput } from '../types';
import { Subject } from '../Subject';
import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
import { noop } from '../util/noop';
import { innerFrom } from '../observable/innerFrom';
/**
* Branch out the source Observable values as a nested Observable whenever
* `windowBoundaries` emits.
*
* <span class="informal">It's like {@link buffer}, but emits a nested Observable
* instead of an array.</span>
*
* ![](window.png)
*
* Returns an Observable that emits windows of items it collects from the source
* Observable. The output Observable emits connected, non-overlapping
* windows. It emits the current window and opens a new one whenever the
* `windowBoundaries` emits an item. `windowBoundaries` can be any type that
* `ObservableInput` accepts. It internally gets converted to an Observable.
* Because each window is an Observable, the output is a higher-order Observable.
*
* ## Example
*
* In every window of 1 second each, emit at most 2 click events
*
* ```ts
* import { fromEvent, interval, window, map, take, mergeAll } from 'rxjs';
*
* const clicks = fromEvent(document, 'click');
* const sec = interval(1000);
* const result = clicks.pipe(
* window(sec),
* map(win => win.pipe(take(2))), // take at most 2 emissions from each window
* mergeAll() // flatten the Observable-of-Observables
* );
* result.subscribe(x => console.log(x));
* ```
*
* @see {@link windowCount}
* @see {@link windowTime}
* @see {@link windowToggle}
* @see {@link windowWhen}
* @see {@link buffer}
*
* @param windowBoundaries An `ObservableInput` that completes the
* previous window and starts a new window.
* @return A function that returns an Observable of windows, which are
* Observables emitting values of the source Observable.
*/
export function window<T>(windowBoundaries: ObservableInput<any>): OperatorFunction<T, Observable<T>> {
return operate((source, subscriber) => {
let windowSubject: Subject<T> = new Subject<T>();
subscriber.next(windowSubject.asObservable());
const errorHandler = (err: any) => {
windowSubject.error(err);
subscriber.error(err);
};
// Subscribe to our source
source.subscribe(
createOperatorSubscriber(
subscriber,
(value) => windowSubject?.next(value),
() => {
windowSubject.complete();
subscriber.complete();
},
errorHandler
)
);
// Subscribe to the window boundaries.
innerFrom(windowBoundaries).subscribe(
createOperatorSubscriber(
subscriber,
() => {
windowSubject.complete();
subscriber.next((windowSubject = new Subject()));
},
noop,
errorHandler
)
);
return () => {
// Unsubscribing the subject ensures that anyone who has captured
// a reference to this window that tries to use it after it can
// no longer get values from the source will get an ObjectUnsubscribedError.
windowSubject?.unsubscribe();
windowSubject = null!;
};
});
}

View File

@@ -0,0 +1,3 @@
"use strict";
module.exports = require("./lib/weak")(require("./plain"));

View File

@@ -0,0 +1,70 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "help", {
enumerable: true,
get: ()=>help
});
const _packageJson = /*#__PURE__*/ _interopRequireDefault(require("../../../../package.json"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function help({ message , usage , commands , options }) {
let indent = 2;
// Render header
console.log();
console.log(`${_packageJson.default.name} v${_packageJson.default.version}`);
// Render message
if (message) {
console.log();
for (let msg of message.split("\n")){
console.log(msg);
}
}
// Render usage
if (usage && usage.length > 0) {
console.log();
console.log("Usage:");
for (let example of usage){
console.log(" ".repeat(indent), example);
}
}
// Render commands
if (commands && commands.length > 0) {
console.log();
console.log("Commands:");
for (let command of commands){
console.log(" ".repeat(indent), command);
}
}
// Render options
if (options) {
let groupedOptions = {};
for (let [key, value] of Object.entries(options)){
if (typeof value === "object") {
groupedOptions[key] = {
...value,
flags: [
key
]
};
} else {
groupedOptions[value].flags.push(key);
}
}
console.log();
console.log("Options:");
for (let { flags , description , deprecated } of Object.values(groupedOptions)){
if (deprecated) continue;
if (flags.length === 1) {
console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(", ").padEnd(20, " "), description);
} else {
console.log(" ".repeat(indent), flags.slice().reverse().join(", ").padEnd(24, " "), description);
}
}
}
console.log();
}

View File

@@ -0,0 +1,19 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"func-name-matching": 0,
"max-statements": [2, 15]
},
"overrides": [
{
"files": ["test.js"],
"rules": {
"no-magic-numbers": 0,
},
},
],
}

View File

@@ -0,0 +1,51 @@
"use strict";
var util = require("./util");
var maybeWrapAsError = util.maybeWrapAsError;
var errors = require("./errors");
var OperationalError = errors.OperationalError;
var es5 = require("./es5");
function isUntypedError(obj) {
return obj instanceof Error &&
es5.getPrototypeOf(obj) === Error.prototype;
}
var rErrorKey = /^(?:name|message|stack|cause)$/;
function wrapAsOperationalError(obj) {
var ret;
if (isUntypedError(obj)) {
ret = new OperationalError(obj);
ret.name = obj.name;
ret.message = obj.message;
ret.stack = obj.stack;
var keys = es5.keys(obj);
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!rErrorKey.test(key)) {
ret[key] = obj[key];
}
}
return ret;
}
util.markAsOriginatingFromRejection(obj);
return obj;
}
function nodebackForPromise(promise, multiArgs) {
return function(err, value) {
if (promise === null) return;
if (err) {
var wrapped = wrapAsOperationalError(maybeWrapAsError(err));
promise._attachExtraTrace(wrapped);
promise._reject(wrapped);
} else if (!multiArgs) {
promise._fulfill(value);
} else {
var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];};
promise._fulfill(args);
}
promise = null;
};
}
module.exports = nodebackForPromise;

View File

@@ -0,0 +1,76 @@
import { Observable } from '../Observable';
import { AsyncSubject } from '../AsyncSubject';
import { ConnectableObservable } from '../observable/ConnectableObservable';
import { UnaryFunction } from '../types';
/**
* Returns a connectable observable sequence that shares a single subscription to the
* underlying sequence containing only the last notification.
*
* ![](publishLast.png)
*
* Similar to {@link publish}, but it waits until the source observable completes and stores
* the last emitted value.
* Similarly to {@link publishReplay} and {@link publishBehavior}, this keeps storing the last
* value even if it has no more subscribers. If subsequent subscriptions happen, they will
* immediately get that last stored value and complete.
*
* ## Example
*
* ```ts
* import { ConnectableObservable, interval, publishLast, tap, take } from 'rxjs';
*
* const connectable = <ConnectableObservable<number>>interval(1000)
* .pipe(
* tap(x => console.log('side effect', x)),
* take(3),
* publishLast()
* );
*
* connectable.subscribe({
* next: x => console.log('Sub. A', x),
* error: err => console.log('Sub. A Error', err),
* complete: () => console.log('Sub. A Complete')
* });
*
* connectable.subscribe({
* next: x => console.log('Sub. B', x),
* error: err => console.log('Sub. B Error', err),
* complete: () => console.log('Sub. B Complete')
* });
*
* connectable.connect();
*
* // Results:
* // 'side effect 0' - after one second
* // 'side effect 1' - after two seconds
* // 'side effect 2' - after three seconds
* // 'Sub. A 2' - immediately after 'side effect 2'
* // 'Sub. B 2'
* // 'Sub. A Complete'
* // 'Sub. B Complete'
* ```
*
* @see {@link ConnectableObservable}
* @see {@link publish}
* @see {@link publishReplay}
* @see {@link publishBehavior}
*
* @return A function that returns an Observable that emits elements of a
* sequence produced by multicasting the source sequence.
* @deprecated Will be removed in v8. To create a connectable observable with an
* {@link AsyncSubject} under the hood, use {@link connectable}.
* `source.pipe(publishLast())` is equivalent to
* `connectable(source, { connector: () => new AsyncSubject(), resetOnDisconnect: false })`.
* If you're using {@link refCount} after `publishLast`, use the {@link share} operator instead.
* `source.pipe(publishLast(), refCount())` is equivalent to
* `source.pipe(share({ connector: () => new AsyncSubject(), resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }))`.
* Details: https://rxjs.dev/deprecations/multicasting
*/
export function publishLast<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>> {
// Note that this has *never* supported a selector function like `publish` and `publishReplay`.
return (source) => {
const subject = new AsyncSubject<T>();
return new ConnectableObservable(source, () => subject);
};
}

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2013 James Halliday
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.

View File

@@ -0,0 +1,25 @@
/**
* Is true if the hostname matches exactly the specified hostname, or if there is
* no domain name part in the hostname, but the unqualified hostname matches.
*
* Examples:
*
* ``` js
* localHostOrDomainIs("www.netscape.com", "www.netscape.com")
* // is true (exact match).
*
* localHostOrDomainIs("www", "www.netscape.com")
* // is true (hostname match, domain not specified).
*
* localHostOrDomainIs("www.mcom.com", "www.netscape.com")
* // is false (domain name mismatch).
*
* localHostOrDomainIs("home.netscape.com", "www.netscape.com")
* // is false (hostname mismatch).
* ```
*
* @param {String} host the hostname from the URL.
* @param {String} hostdom fully qualified hostname to match against.
* @return {Boolean}
*/
export default function localHostOrDomainIs(host: string, hostdom: string): boolean;

View File

@@ -0,0 +1,225 @@
import chokidar from 'chokidar'
import fs from 'fs'
import micromatch from 'micromatch'
import normalizePath from 'normalize-path'
import path from 'path'
import { readFileWithRetries } from './utils'
/**
* The core idea of this watcher is:
* 1. Whenever a file is added, changed, or renamed we queue a rebuild
* 2. Perform as few rebuilds as possible by batching them together
* 3. Coalesce events that happen in quick succession to avoid unnecessary rebuilds
* 4. Ensure another rebuild happens _if_ changed while a rebuild is in progress
*/
/**
*
* @param {*} args
* @param {{ state, rebuild(changedFiles: any[]): Promise<any> }} param1
* @returns {{
* fswatcher: import('chokidar').FSWatcher,
* refreshWatchedFiles(): void,
* }}
*/
export function createWatcher(args, { state, rebuild }) {
let shouldPoll = args['--poll']
let shouldCoalesceWriteEvents = shouldPoll || process.platform === 'win32'
// Polling interval in milliseconds
// Used only when polling or coalescing add/change events on Windows
let pollInterval = 10
let watcher = chokidar.watch([], {
// Force checking for atomic writes in all situations
// This causes chokidar to wait up to 100ms for a file to re-added after it's been unlinked
// This only works when watching directories though
atomic: true,
usePolling: shouldPoll,
interval: shouldPoll ? pollInterval : undefined,
ignoreInitial: true,
awaitWriteFinish: shouldCoalesceWriteEvents
? {
stabilityThreshold: 50,
pollInterval: pollInterval,
}
: false,
})
// A queue of rebuilds, file reads, etc… to run
let chain = Promise.resolve()
/**
* A list of files that have been changed since the last rebuild
*
* @type {{file: string, content: () => Promise<string>, extension: string}[]}
*/
let changedContent = []
/**
* A list of files for which a rebuild has already been queued.
* This is used to prevent duplicate rebuilds when multiple events are fired for the same file.
* The rebuilt file is cleared from this list when it's associated rebuild has _started_
* This is because if the file is changed during a rebuild it won't trigger a new rebuild which it should
**/
let pendingRebuilds = new Set()
let _timer
let _reject
/**
* Rebuilds the changed files and resolves when the rebuild is
* complete regardless of whether it was successful or not
*/
async function rebuildAndContinue() {
let changes = changedContent.splice(0)
// There are no changes to rebuild so we can just do nothing
if (changes.length === 0) {
return Promise.resolve()
}
// Clear all pending rebuilds for the about-to-be-built files
changes.forEach((change) => pendingRebuilds.delete(change.file))
// Resolve the promise even when the rebuild fails
return rebuild(changes).then(
() => {},
() => {}
)
}
/**
*
* @param {*} file
* @param {(() => Promise<string>) | null} content
* @param {boolean} skipPendingCheck
* @returns {Promise<void>}
*/
function recordChangedFile(file, content = null, skipPendingCheck = false) {
file = path.resolve(file)
// Applications like Vim/Neovim fire both rename and change events in succession for atomic writes
// In that case rebuild has already been queued by rename, so can be skipped in change
if (pendingRebuilds.has(file) && !skipPendingCheck) {
return Promise.resolve()
}
// Mark that a rebuild of this file is going to happen
// It MUST happen synchronously before the rebuild is queued for this to be effective
pendingRebuilds.add(file)
changedContent.push({
file,
content: content ?? (() => fs.promises.readFile(file, 'utf8')),
extension: path.extname(file).slice(1),
})
if (_timer) {
clearTimeout(_timer)
_reject()
}
// If a rebuild is already in progress we don't want to start another one until the 10ms timer has expired
chain = chain.then(
() =>
new Promise((resolve, reject) => {
_timer = setTimeout(resolve, 10)
_reject = reject
})
)
// Resolves once this file has been rebuilt (or the rebuild for this file has failed)
// This queues as many rebuilds as there are changed files
// But those rebuilds happen after some delay
// And will immediately resolve if there are no changes
chain = chain.then(rebuildAndContinue, rebuildAndContinue)
return chain
}
watcher.on('change', (file) => recordChangedFile(file))
watcher.on('add', (file) => recordChangedFile(file))
// Restore watching any files that are "removed"
// This can happen when a file is pseudo-atomically replaced (a copy is created, overwritten, the old one is unlinked, and the new one is renamed)
// TODO: An an optimization we should allow removal when the config changes
watcher.on('unlink', (file) => {
file = normalizePath(file)
// Only re-add the file if it's not covered by a dynamic pattern
if (!micromatch.some([file], state.contentPatterns.dynamic)) {
watcher.add(file)
}
})
// Some applications such as Visual Studio (but not VS Code)
// will only fire a rename event for atomic writes and not a change event
// This is very likely a chokidar bug but it's one we need to work around
// We treat this as a change event and rebuild the CSS
watcher.on('raw', (evt, filePath, meta) => {
if (evt !== 'rename') {
return
}
let watchedPath = meta.watchedPath
// Watched path might be the file itself
// Or the directory it is in
filePath = watchedPath.endsWith(filePath) ? watchedPath : path.join(watchedPath, filePath)
// Skip this event since the files it is for does not match any of the registered content globs
if (!micromatch.some([filePath], state.contentPatterns.all)) {
return
}
// Skip since we've already queued a rebuild for this file that hasn't happened yet
if (pendingRebuilds.has(filePath)) {
return
}
// We'll go ahead and add the file to the pending rebuilds list here
// It'll be removed when the rebuild starts unless the read fails
// which will be taken care of as well
pendingRebuilds.add(filePath)
async function enqueue() {
try {
// We need to read the file as early as possible outside of the chain
// because it may be gone by the time we get to it. doing the read
// immediately increases the chance that the file is still there
let content = await readFileWithRetries(path.resolve(filePath))
if (content === undefined) {
return
}
// This will push the rebuild onto the chain
// We MUST skip the rebuild check here otherwise the rebuild will never happen on Linux
// This is because the order of events and timing is different on Linux
// @ts-ignore: TypeScript isn't picking up that content is a string here
await recordChangedFile(filePath, () => content, true)
} catch {
// If reading the file fails, it's was probably a deleted temporary file
// So we can ignore it and no rebuild is needed
}
}
enqueue().then(() => {
// If the file read fails we still need to make sure the file isn't stuck in the pending rebuilds list
pendingRebuilds.delete(filePath)
})
})
return {
fswatcher: watcher,
refreshWatchedFiles() {
watcher.add(Array.from(state.contextDependencies))
watcher.add(Array.from(state.configDependencies))
watcher.add(state.contentPatterns.all)
},
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"Subscriber.js","sourceRoot":"","sources":["../../../src/internal/Subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAA+C;AAE/C,+CAA8D;AAC9D,mCAAkC;AAClC,oEAAmE;AACnE,oCAAmC;AACnC,iEAAqG;AACrG,+DAA8D;AAC9D,oDAAmD;AAYnD;IAAmC,8BAAY;IA6B7C,oBAAY,WAA6C;QAAzD,YACE,iBAAO,SAWR;QApBS,eAAS,GAAY,KAAK,CAAC;QAUnC,IAAI,WAAW,EAAE;YACf,KAAI,CAAC,WAAW,GAAG,WAAW,CAAC;YAG/B,IAAI,6BAAc,CAAC,WAAW,CAAC,EAAE;gBAC/B,WAAW,CAAC,GAAG,CAAC,KAAI,CAAC,CAAC;aACvB;SACF;aAAM;YACL,KAAI,CAAC,WAAW,GAAG,sBAAc,CAAC;SACnC;;IACH,CAAC;IAzBM,iBAAM,GAAb,UAAiB,IAAsB,EAAE,KAAyB,EAAE,QAAqB;QACvF,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACnD,CAAC;IAgCD,yBAAI,GAAJ,UAAK,KAAS;QACZ,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,yBAAyB,CAAC,wCAAgB,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;SAC1D;aAAM;YACL,IAAI,CAAC,KAAK,CAAC,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,CAAC;AACZ,CAAC;AAOD,SAAS,yBAAyB,CAAC,YAAyC,EAAE,UAA2B;IAC/F,IAAA,qBAAqB,GAAK,eAAM,sBAAX,CAAY;IACzC,qBAAqB,IAAI,iCAAe,CAAC,UAAU,CAAC,cAAM,OAAA,qBAAqB,CAAC,YAAY,EAAE,UAAU,CAAC,EAA/C,CAA+C,CAAC,CAAC;AAC7G,CAAC;AAOY,QAAA,cAAc,GAA+C;IACxE,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,WAAI;IACV,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,WAAI;CACf,CAAC"}

View File

@@ -0,0 +1,54 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $ArrayPrototype = GetIntrinsic('%Array.prototype%');
var $RangeError = GetIntrinsic('%RangeError%');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $TypeError = GetIntrinsic('%TypeError%');
var IsInteger = require('./IsInteger');
var hasProto = require('has-proto')();
var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1;
var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || (
hasProto
? function (O, proto) {
O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign
return O;
}
: null
);
// https://262.ecma-international.org/6.0/#sec-arraycreate
module.exports = function ArrayCreate(length) {
if (!IsInteger(length) || length < 0) {
throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0');
}
if (length > MAX_ARRAY_LENGTH) {
throw new $RangeError('length is greater than (2**32 - 1)');
}
var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype;
var A = []; // steps 5 - 7, and 9
if (proto !== $ArrayPrototype) { // step 8
if (!$setProto) {
throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]');
}
$setProto(A, proto);
}
if (length !== 0) { // bypasses the need for step 2
A.length = length;
}
/* step 10, the above as a shortcut for the below
OrdinaryDefineOwnProperty(A, 'length', {
'[[Configurable]]': false,
'[[Enumerable]]': false,
'[[Value]]': length,
'[[Writable]]': true
});
*/
return A;
};

View File

@@ -0,0 +1,5 @@
import { Colors } from "./types"
declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors }
export = picocolors

View File

@@ -0,0 +1,97 @@
{
"name": "object-inspect",
"version": "1.12.3",
"description": "string representations of objects in node and the browser",
"main": "index.js",
"sideEffects": false,
"devDependencies": {
"@ljharb/eslint-config": "^21.0.1",
"@pkgjs/support": "^0.0.6",
"aud": "^2.0.2",
"auto-changelog": "^2.4.0",
"core-js": "^2.6.12",
"error-cause": "^1.0.5",
"es-value-fixtures": "^1.4.2",
"eslint": "=8.8.0",
"for-each": "^0.3.3",
"functions-have-names": "^1.2.3",
"has-tostringtag": "^1.0.0",
"in-publish": "^2.0.1",
"make-arrow-function": "^1.2.0",
"mock-property": "^1.0.0",
"npmignore": "^0.3.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"string.prototype.repeat": "^1.0.0",
"tape": "^5.6.1"
},
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"pretest": "npm run lint",
"lint": "eslint --ext=js,mjs .",
"postlint": "npx @pkgjs/support validate",
"test": "npm run tests-only && npm run test:corejs",
"tests-only": "nyc tape 'test/*.js'",
"test:corejs": "nyc tape test-core-js.js 'test/*.js'",
"posttest": "npx aud --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"testling": {
"files": [
"test/*.js",
"test/browser/*.js"
],
"browsers": [
"ie/6..latest",
"chrome/latest",
"firefox/latest",
"safari/latest",
"opera/latest",
"iphone/latest",
"ipad/latest",
"android/latest"
]
},
"repository": {
"type": "git",
"url": "git://github.com/inspect-js/object-inspect.git"
},
"homepage": "https://github.com/inspect-js/object-inspect",
"keywords": [
"inspect",
"util.inspect",
"object",
"stringify",
"pretty"
],
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"browser": {
"./util.inspect.js": false
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows",
"./test-core-js.js"
]
},
"support": true
}

View File

@@ -0,0 +1,10 @@
// Reexport your entry components here
import DataHandler from './DataHandler.js';
import Datatable from './Datatable.svelte';
import Th from './Th.svelte';
import ThFilter from './ThFilter.svelte';
import Pagination from './Pagination.svelte';
import RowCount from './RowCount.svelte';
import RowsPerPage from './RowsPerPage.svelte';
import Search from './Search.svelte';
export { DataHandler, Datatable, Th, ThFilter, Pagination, RowCount, RowsPerPage, Search };

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J D E CC","132":"A B","388":"F"},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","132":"C K L G M N O"},C:{"1":"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","16":"DC tB EC FC","132":"0 1 2 3 4 5 6 7 8 9 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","388":"I v"},D:{"1":"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","16":"I v J D E F A B C K L","132":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB"},E:{"1":"B C K L G 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","16":"I v J HC zB","132":"D E F A JC KC LC","388":"IC"},F:{"1":"2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","16":"F B PC QC RC SC qB AC","132":"0 1 G M N O w g x y z","516":"C TC rB"},G:{"1":"cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","16":"zB UC BC VC WC","132":"E XC YC ZC aC bC"},H:{"516":"oC"},I:{"1":"f","16":"tB pC qC rC uC","132":"tC","388":"I sC BC"},J:{"16":"D","132":"A"},K:{"1":"h","16":"A B C qB AC","516":"rB"},L:{"1":"H"},M:{"1":"H"},N:{"132":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"BD","132":"AD"}},B:5,C:":indeterminate CSS pseudo-class"};

View File

@@ -0,0 +1,324 @@
# normalize-url [![Coverage Status](https://codecov.io/gh/sindresorhus/normalize-url/branch/main/graph/badge.svg)](https://codecov.io/gh/sindresorhus/normalize-url)
> [Normalize](https://en.wikipedia.org/wiki/URL_normalization) a URL
Useful when you need to display, store, deduplicate, sort, compare, etc, URLs.
**Note:** This package does **not** do URL sanitization. [Garbage in, garbage out.](https://en.wikipedia.org/wiki/Garbage_in,_garbage_out) If you use this in a server context and accept URLs as user input, it's up to you to protect against invalid URLs, [path traversal attacks](https://owasp.org/www-community/attacks/Path_Traversal), etc.
## Install
```sh
npm install normalize-url
```
*If you need Safari support, use version 4: `npm i normalize-url@4`*
## Usage
```js
import normalizeUrl from 'normalize-url';
normalizeUrl('sindresorhus.com');
//=> 'http://sindresorhus.com'
normalizeUrl('//www.sindresorhus.com:80/../baz?b=bar&a=foo');
//=> 'http://sindresorhus.com/baz?a=foo&b=bar'
```
## API
### normalizeUrl(url, options?)
URLs with custom protocols are not normalized and just passed through by default. Supported protocols are: `https`, `http`, `file`, and `data`.
#### url
Type: `string`
URL to normalize, including [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs).
#### options
Type: `object`
##### defaultProtocol
Type: `string`\
Default: `'http'`\
Values: `'https' | 'http'`
##### normalizeProtocol
Type: `boolean`\
Default: `true`
Prepend `defaultProtocol` to the URL if it's protocol-relative.
```js
normalizeUrl('//sindresorhus.com');
//=> 'http://sindresorhus.com'
normalizeUrl('//sindresorhus.com', {normalizeProtocol: false});
//=> '//sindresorhus.com'
```
##### forceHttp
Type: `boolean`\
Default: `false`
Normalize HTTPS to HTTP.
```js
normalizeUrl('https://sindresorhus.com');
//=> 'https://sindresorhus.com'
normalizeUrl('https://sindresorhus.com', {forceHttp: true});
//=> 'http://sindresorhus.com'
```
##### forceHttps
Type: `boolean`\
Default: `false`
Normalize HTTP to HTTPS.
```js
normalizeUrl('http://sindresorhus.com');
//=> 'http://sindresorhus.com'
normalizeUrl('http://sindresorhus.com', {forceHttps: true});
//=> 'https://sindresorhus.com'
```
This option cannot be used with the `forceHttp` option at the same time.
##### stripAuthentication
Type: `boolean`\
Default: `true`
Strip the [authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) part of the URL.
```js
normalizeUrl('user:password@sindresorhus.com');
//=> 'https://sindresorhus.com'
normalizeUrl('user:password@sindresorhus.com', {stripAuthentication: false});
//=> 'https://user:password@sindresorhus.com'
```
##### stripHash
Type: `boolean`\
Default: `false`
Strip the hash part of the URL.
```js
normalizeUrl('sindresorhus.com/about.html#contact');
//=> 'http://sindresorhus.com/about.html#contact'
normalizeUrl('sindresorhus.com/about.html#contact', {stripHash: true});
//=> 'http://sindresorhus.com/about.html'
```
##### stripProtocol
Type: `boolean`\
Default: `false`
Remove the protocol from the URL: `http://sindresorhus.com` → `sindresorhus.com`.
It will only remove `https://` and `http://` protocols.
```js
normalizeUrl('https://sindresorhus.com');
//=> 'https://sindresorhus.com'
normalizeUrl('https://sindresorhus.com', {stripProtocol: true});
//=> 'sindresorhus.com'
```
##### stripTextFragment
Type: `boolean`\
Default: `true`
Strip the [text fragment](https://web.dev/text-fragments/) part of the URL.
**Note:** The text fragment will always be removed if the `stripHash` option is set to `true`, as the hash contains the text fragment.
```js
normalizeUrl('http://sindresorhus.com/about.html#:~:text=hello');
//=> 'http://sindresorhus.com/about.html#'
normalizeUrl('http://sindresorhus.com/about.html#section:~:text=hello');
//=> 'http://sindresorhus.com/about.html#section'
normalizeUrl('http://sindresorhus.com/about.html#:~:text=hello', {stripTextFragment: false});
//=> 'http://sindresorhus.com/about.html#:~:text=hello'
normalizeUrl('http://sindresorhus.com/about.html#section:~:text=hello', {stripTextFragment: false});
//=> 'http://sindresorhus.com/about.html#section:~:text=hello'
```
##### stripWWW
Type: `boolean`\
Default: `true`
Remove `www.` from the URL.
```js
normalizeUrl('http://www.sindresorhus.com');
//=> 'http://sindresorhus.com'
normalizeUrl('http://www.sindresorhus.com', {stripWWW: false});
//=> 'http://www.sindresorhus.com'
```
##### removeQueryParameters
Type: `Array<RegExp | string> | boolean`\
Default: `[/^utm_\w+/i]`
Remove query parameters that matches any of the provided strings or regexes.
```js
normalizeUrl('www.sindresorhus.com?foo=bar&ref=test_ref', {
removeQueryParameters: ['ref']
});
//=> 'http://sindresorhus.com/?foo=bar'
```
If a boolean is provided, `true` will remove all the query parameters.
```js
normalizeUrl('www.sindresorhus.com?foo=bar', {
removeQueryParameters: true
});
//=> 'http://sindresorhus.com'
```
`false` will not remove any query parameter.
```js
normalizeUrl('www.sindresorhus.com?foo=bar&utm_medium=test&ref=test_ref', {
removeQueryParameters: false
});
//=> 'http://www.sindresorhus.com/?foo=bar&ref=test_ref&utm_medium=test'
```
##### keepQueryParameters
Type: `Array<RegExp | string>`\
Default: `undefined`
Keeps only query parameters that matches any of the provided strings or regexes.
**Note:** It overrides the `removeQueryParameters` option.
```js
normalizeUrl('https://sindresorhus.com?foo=bar&ref=unicorn', {
keepQueryParameters: ['ref']
});
//=> 'https://sindresorhus.com/?ref=unicorn'
```
##### removeTrailingSlash
Type: `boolean`\
Default: `true`
Remove trailing slash.
**Note:** Trailing slash is always removed if the URL doesn't have a pathname unless the `removeSingleSlash` option is set to `false`.
```js
normalizeUrl('http://sindresorhus.com/redirect/');
//=> 'http://sindresorhus.com/redirect'
normalizeUrl('http://sindresorhus.com/redirect/', {removeTrailingSlash: false});
//=> 'http://sindresorhus.com/redirect/'
normalizeUrl('http://sindresorhus.com/', {removeTrailingSlash: false});
//=> 'http://sindresorhus.com'
```
##### removeSingleSlash
Type: `boolean`\
Default: `true`
Remove a sole `/` pathname in the output. This option is independent of `removeTrailingSlash`.
```js
normalizeUrl('https://sindresorhus.com/');
//=> 'https://sindresorhus.com'
normalizeUrl('https://sindresorhus.com/', {removeSingleSlash: false});
//=> 'https://sindresorhus.com/'
```
##### removeDirectoryIndex
Type: `boolean | Array<RegExp | string>`\
Default: `false`
Removes the default directory index file from path that matches any of the provided strings or regexes. When `true`, the regex `/^index\.[a-z]+$/` is used.
```js
normalizeUrl('www.sindresorhus.com/foo/default.php', {
removeDirectoryIndex: [/^default\.[a-z]+$/]
});
//=> 'http://sindresorhus.com/foo'
```
##### removeExplicitPort
Type: `boolean`\
Default: `false`
Removes an explicit port number from the URL.
Port 443 is always removed from HTTPS URLs and 80 is always removed from HTTP URLs regardless of this option.
```js
normalizeUrl('sindresorhus.com:123', {
removeExplicitPort: true
});
//=> 'http://sindresorhus.com'
```
##### sortQueryParameters
Type: `boolean`\
Default: `true`
Sorts the query parameters alphabetically by key.
```js
normalizeUrl('www.sindresorhus.com?b=two&a=one&c=three', {
sortQueryParameters: false
});
//=> 'http://sindresorhus.com/?b=two&a=one&c=three'
```
## Related
- [compare-urls](https://github.com/sindresorhus/compare-urls) - Compare URLs by first normalizing them
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-normalize-url?utm_source=npm-normalize-url&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

View File

@@ -0,0 +1,33 @@
var baseDifference = require('./_baseDifference'),
baseFlatten = require('./_baseFlatten'),
baseRest = require('./_baseRest'),
isArrayLikeObject = require('./isArrayLikeObject');
/**
* Creates an array of `array` values not included in the other given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* **Note:** Unlike `_.pullAll`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.without, _.xor
* @example
*
* _.difference([2, 1], [2, 3]);
* // => [1]
*/
var difference = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: [];
});
module.exports = difference;

View File

@@ -0,0 +1,201 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.EMPTY_OBSERVER = exports.SafeSubscriber = exports.Subscriber = void 0;
var isFunction_1 = require("./util/isFunction");
var Subscription_1 = require("./Subscription");
var config_1 = require("./config");
var reportUnhandledError_1 = require("./util/reportUnhandledError");
var noop_1 = require("./util/noop");
var NotificationFactories_1 = require("./NotificationFactories");
var timeoutProvider_1 = require("./scheduler/timeoutProvider");
var errorContext_1 = require("./util/errorContext");
var Subscriber = (function (_super) {
__extends(Subscriber, _super);
function Subscriber(destination) {
var _this = _super.call(this) || this;
_this.isStopped = false;
if (destination) {
_this.destination = destination;
if (Subscription_1.isSubscription(destination)) {
destination.add(_this);
}
}
else {
_this.destination = exports.EMPTY_OBSERVER;
}
return _this;
}
Subscriber.create = function (next, error, complete) {
return new SafeSubscriber(next, error, complete);
};
Subscriber.prototype.next = function (value) {
if (this.isStopped) {
handleStoppedNotification(NotificationFactories_1.nextNotification(value), this);
}
else {
this._next(value);
}
};
Subscriber.prototype.error = function (err) {
if (this.isStopped) {
handleStoppedNotification(NotificationFactories_1.errorNotification(err), this);
}
else {
this.isStopped = true;
this._error(err);
}
};
Subscriber.prototype.complete = function () {
if (this.isStopped) {
handleStoppedNotification(NotificationFactories_1.COMPLETE_NOTIFICATION, this);
}
else {
this.isStopped = true;
this._complete();
}
};
Subscriber.prototype.unsubscribe = function () {
if (!this.closed) {
this.isStopped = true;
_super.prototype.unsubscribe.call(this);
this.destination = null;
}
};
Subscriber.prototype._next = function (value) {
this.destination.next(value);
};
Subscriber.prototype._error = function (err) {
try {
this.destination.error(err);
}
finally {
this.unsubscribe();
}
};
Subscriber.prototype._complete = function () {
try {
this.destination.complete();
}
finally {
this.unsubscribe();
}
};
return Subscriber;
}(Subscription_1.Subscription));
exports.Subscriber = Subscriber;
var _bind = Function.prototype.bind;
function bind(fn, thisArg) {
return _bind.call(fn, thisArg);
}
var ConsumerObserver = (function () {
function ConsumerObserver(partialObserver) {
this.partialObserver = partialObserver;
}
ConsumerObserver.prototype.next = function (value) {
var partialObserver = this.partialObserver;
if (partialObserver.next) {
try {
partialObserver.next(value);
}
catch (error) {
handleUnhandledError(error);
}
}
};
ConsumerObserver.prototype.error = function (err) {
var partialObserver = this.partialObserver;
if (partialObserver.error) {
try {
partialObserver.error(err);
}
catch (error) {
handleUnhandledError(error);
}
}
else {
handleUnhandledError(err);
}
};
ConsumerObserver.prototype.complete = function () {
var partialObserver = this.partialObserver;
if (partialObserver.complete) {
try {
partialObserver.complete();
}
catch (error) {
handleUnhandledError(error);
}
}
};
return ConsumerObserver;
}());
var SafeSubscriber = (function (_super) {
__extends(SafeSubscriber, _super);
function SafeSubscriber(observerOrNext, error, complete) {
var _this = _super.call(this) || this;
var partialObserver;
if (isFunction_1.isFunction(observerOrNext) || !observerOrNext) {
partialObserver = {
next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
error: error !== null && error !== void 0 ? error : undefined,
complete: complete !== null && complete !== void 0 ? complete : undefined,
};
}
else {
var context_1;
if (_this && config_1.config.useDeprecatedNextContext) {
context_1 = Object.create(observerOrNext);
context_1.unsubscribe = function () { return _this.unsubscribe(); };
partialObserver = {
next: observerOrNext.next && bind(observerOrNext.next, context_1),
error: observerOrNext.error && bind(observerOrNext.error, context_1),
complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),
};
}
else {
partialObserver = observerOrNext;
}
}
_this.destination = new ConsumerObserver(partialObserver);
return _this;
}
return SafeSubscriber;
}(Subscriber));
exports.SafeSubscriber = SafeSubscriber;
function handleUnhandledError(error) {
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
errorContext_1.captureError(error);
}
else {
reportUnhandledError_1.reportUnhandledError(error);
}
}
function defaultErrorHandler(err) {
throw err;
}
function handleStoppedNotification(notification, subscriber) {
var onStoppedNotification = config_1.config.onStoppedNotification;
onStoppedNotification && timeoutProvider_1.timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });
}
exports.EMPTY_OBSERVER = {
closed: true,
next: noop_1.noop,
error: defaultErrorHandler,
complete: noop_1.noop,
};
//# sourceMappingURL=Subscriber.js.map

View File

@@ -0,0 +1,7 @@
export type UpdateDistanceDonation = {
runner: number;
amountPerDistance: number;
id: number;
donor: number;
paidAmount?: number;
};

View File

@@ -0,0 +1,10 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "clz32", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@@ -0,0 +1,9 @@
'use strict';
var $isNaN = require('../helpers/isNaN');
// https://262.ecma-international.org/6.0/#sec-samevaluezero
module.exports = function SameValueZero(x, y) {
return (x === y) || ($isNaN(x) && $isNaN(y));
};

View File

@@ -0,0 +1,583 @@
import { Converter } from "../src/Converter";
import csv from "../src";
var assert = require("assert");
var fs = require("fs");
var sandbox = require('sinon').sandbox.create();
describe("testCSVConverter2", function () {
afterEach(function () {
sandbox.restore();
});
it("should convert from large csv string", function (done) {
var csvStr = fs.readFileSync(__dirname + "/data/large-csv-sample.csv", "utf8");
var conv = new Converter({
});
conv.fromString(csvStr).then(function (res) {
assert(res.length === 5290);
done();
});
});
it("should set eol", function (done) {
var rs = fs.createReadStream(__dirname + "/data/large-csv-sample.csv");
var conv = new Converter({
eol: "\n"
});
var count = 0;
conv.subscribe(function (resultJson, index) {
count++;
assert(resultJson);
// assert(row.length === 2);
assert(index >= 0);
});
conv.on("error", function () {
console.log(arguments);
});
conv.then(function (result) {
assert(result);
assert(count === 5290);
done();
});
rs.pipe(conv);
});
it("should convert tsv String", function (done) {
var tsv = __dirname + "/data/dataTsv";
var csvStr = fs.readFileSync(tsv, "utf8");
var conv = new Converter({
delimiter: "\t",
"checkType": false
});
conv.fromString(csvStr).then(function (res) {
assert(res);
assert.equal(res.length, 200);
done();
});
});
it("should allow customised header with nohead csv string.", function (done) {
var testData = __dirname + "/data/noheadercsv";
var rs = fs.readFileSync(testData, "utf8");
var conv = new Converter({
noheader: true,
headers: ["a", "b", "c", "e", "f", "g"]
});
conv.fromString(rs).then(function (json) {
assert.equal(json[0].field7, 40);
assert.equal(json[0].a, "CC102-PDMI-001");
done();
});
});
it("should parse fromFile", function (done) {
var csvFile = __dirname + "/data/large-csv-sample.csv";
var conv = new Converter({
});
conv.fromFile(csvFile).then(function (res) {
assert.equal(res.length, 5290);
done();
});
});
it("should fromFile should emit error", function (done) {
var csvFile = __dirname + "/data/dataWithUnclosedQuotes";
var conv = new Converter({
});
conv.fromFile(csvFile).then(function (res) {
done();
}, function (err) {
assert(err);
done();
});
});
it("should parse no header with dynamic column number", function (done) {
var testData = __dirname + "/data/noheaderWithVaryColumnNum";
var rs = fs.readFileSync(testData, "utf8");
var conv = new Converter({
noheader: true
});
conv.fromString(rs).then(function (json) {
assert.equal(json.length, 2);
assert.equal(json[1].field4, 7);
done();
});
});
it("should parse tabsv data with dynamic columns", function (done) {
var testData = __dirname + "/data/tabsv";
var rs = fs.readFileSync(testData, "utf8");
var conv = new Converter({
delimiter: "\t"
});
conv.fromString(rs).then(function (json) {
assert.equal(json[0].Idevise, "");
done();
});
});
it("should use first line break as eol", function (done) {
var testData = __dirname + "/data/testEol";
var conv = new Converter({
noheader: true
});
conv.fromFile(testData).then(function (json) {
assert(json);
done();
});
});
it("should detect delimiter", function (done) {
var testData = __dirname + "/data/dataWithAutoDelimiter";
var rs = fs.createReadStream(testData);
var conv = new Converter({ delimiter: "auto" });
conv.then(function (res) {
assert.equal(res[0].col1, "Mini. Sectt:hisar S.O");
assert.equal(res[1].col1, "#Mini. Sectt");
done();
});
rs.pipe(conv);
});
it("should emit delimiter event", function (done) {
var testData = __dirname + "/data/dataWithAutoDelimiter";
var rs = fs.createReadStream(testData);
var conv = new Converter({ delimiter: "auto" });
var delimiterCallback = sandbox.spy(function (delimiter) {
assert.equal(delimiter, ":");
});
conv.on("delimiter", delimiterCallback);
conv.then(function () {
assert.equal(delimiterCallback.callCount, 1);
done();
});
rs.pipe(conv);
});
it("should emit delimiter event when no header", function (done) {
var testData = __dirname + "/data/dataWithAutoDelimiter";
var rs = fs.createReadStream(testData);
var conv = new Converter({ delimiter: "auto", noheader: true });
var delimiterCallback = sandbox.spy(function (delimiter) {
assert.equal(delimiter, ":");
});
conv.on("delimiter", delimiterCallback);
conv.then(function () {
assert.equal(delimiterCallback.callCount, 1);
done();
});
rs.pipe(conv);
});
// it("should not emit delimiter event when delimiter is specified", function (done) {
// var testData = __dirname + "/data/columnArray";
// var rs = fs.createReadStream(testData);
// var conv = new Converter();
// conv.on("delimiter", function (delimiter) {
// assert.fail("delimiter event should not have been emitted");
// });
// conv.then(function () {
// done();
// });
// rs.pipe(conv);
// });
it("should stripe out whitespaces if trim is true", function (done) {
var testData = __dirname + "/data/dataWithWhiteSpace";
var rs = fs.createReadStream(testData);
var conv = new Converter({ trim: true });
conv.then(function (res) {
assert.equal(res[0]["Column 1"], "Column1Row1");
assert.equal(res[0]["Column 2"], "Column2Row1");
done();
});
rs.pipe(conv);
});
it("should convert triple quotes correctly", function (done) {
var testData = __dirname + "/data/dataWithTripleQoutes";
var rs = fs.createReadStream(testData);
var conv = new Converter({ trim: true });
conv.then(function (res) {
assert.equal(res[0].Description, "ac, abs, moon");
assert.equal(res[1].Model, "Venture \"Extended Edition\"");
assert.equal(res[2].Model, "Venture \"Extended Edition, Very Large\"");
done();
});
rs.pipe(conv);
});
it("should pre process raw data in the line", function (done) {
var testData = __dirname + "/data/quoteTolerant";
var rs = fs.createReadStream(testData);
var conv = new Converter();
conv.preRawData(function (d) {
return d.replace('THICK', 'THIN');
});
conv.then(function (res) {
assert(res[0].Description.indexOf('THIN') > -1);
done();
});
rs.pipe(conv);
});
it("should pre process by line in the line", function (done) {
var testData = __dirname + "/data/quoteTolerant";
var rs = fs.createReadStream(testData);
var conv = new Converter();
conv.preFileLine(function (line, lineNumber) {
if (lineNumber === 1) {
line = line.replace('THICK', 'THIN');
}
return line;
});
conv.then(function (res) {
assert(res[0].Description.indexOf('THIN') > -1);
done();
});
rs.pipe(conv);
});
it("should support object mode", function (done) {
var testData = __dirname + "/data/complexJSONCSV";
var rs = fs.createReadStream(testData);
var conv = new Converter({}, {
objectMode: true
});
conv.on("data", function (d) {
assert(typeof d === "object");
});
conv.then(function (res) {
assert(res);
assert(res.length > 0);
done();
});
rs.pipe(conv);
});
it("should get delimiter automatically if there is no header", function (done) {
var test_converter = new Converter({
delimiter: 'auto',
headers: ['col1', 'col2'],
noheader: true,
checkColumn: true
});
var my_data = 'first_val\tsecond_val';
test_converter.fromString(my_data).then(function (result) {
assert.equal(result.length, 1);
assert.equal(result[0].col1, "first_val");
assert.equal(result[0].col2, "second_val");
done();
});
});
it("should process escape chars", function (done) {
var test_converter = new Converter({
escape: "\\",
checkType: true
});
var testData = __dirname + "/data/dataWithSlashEscape";
var rs = fs.createReadStream(testData);
test_converter.then(function (res) {
assert.equal(res[0].raw.hello, "world");
assert.equal(res[0].raw.test, true);
done();
});
rs.pipe(test_converter);
});
it("should process escape chars when delimiter is between escaped quotes", function(done) {
var test_converter = new Converter({
escape: "\\"
});
var testData =
__dirname + "/data/dataWithSlashEscapeAndDelimiterBetweenQuotes";
var rs = fs.createReadStream(testData);
test_converter.then(function(res) {
assert.equal(res[0].raw, '"hello,"world"');
done();
});
rs.pipe(test_converter);
});
it("should output ndjson format", function(done) {
var conv = new Converter();
conv.fromString("a,b,c\n1,2,3\n4,5,6")
.on("data", function (d) {
d = d.toString();
assert.equal(d[d.length - 1], "\n");
})
.on("done", done);
});
it("should parse from stream", function (done) {
var testData = __dirname + "/data/complexJSONCSV";
var rs = fs.createReadStream(testData);
csv()
.fromStream(rs)
.then(function (res) {
assert(res);
done();
});
});
it("should set output as csv", function (done) {
var testData = __dirname + "/data/complexJSONCSV";
var rs = fs.createReadStream(testData);
var numOfRow = 0;
csv({ output: "csv" })
.fromStream(rs)
.subscribe(function (row, idx) {
numOfRow++;
assert(row);
assert(idx >= 0);
})
.on("done", function (error) {
assert(!error);
assert.equal(2, numOfRow);
assert(numOfRow !== 0);
done();
});
});
it("should transform with subscribe function", function (done) {
var testData = __dirname + "/data/complexJSONCSV";
var rs = fs.createReadStream(testData);
var numOfRow = 0;
var numOfJson = 0;
csv()
.fromStream(rs)
.subscribe(function (json, idx) {
json.a = "test";
assert(idx >= 0);
})
.on("data", function (d) {
const j = JSON.parse(d.toString());
assert.equal(j.a, "test");
})
.on("end", function () {
done();
});
});
it("should parse a complex JSON", function (done) {
var converter = new Converter({ checkType: true });
var r = fs.createReadStream(__dirname + "/data/complexJSONCSV");
converter.then(function (res) {
assert(res);
assert(res.length === 2);
assert(res[0].fieldA.title === "Food Factory");
assert(res[0].fieldA.children.length === 2);
assert(res[0].fieldA.children[0].name === "Oscar");
assert(res[0].fieldA.children[0].id === 23);
assert(res[0].fieldA.children[1].name === "Tikka");
assert.equal(res[0].fieldA.children[1].employee.length, 2);
assert(res[0].fieldA.children[1].employee[0].name === "Tim", JSON.stringify(res[0].fieldA.children[1].employee[0]));
assert(res[0].fieldA.address.length === 2);
assert(res[0].fieldA.address[0] === "3 Lame Road");
assert(res[0].fieldA.address[1] === "Grantstown");
assert(res[0].description === "A fresh new food factory", res[0].description);
done();
});
r.pipe(converter);
});
it("should allow flatKey to change parse behaviour", function (done) {
var conv = new Converter({
flatKeys: true
});
conv.fromString("a.b,b.d,c.a\n1,2,3\n4,5,6").subscribe(function (d) {
assert(d["a.b"]);
assert(d["b.d"]);
assert(d["c.a"]);
})
.on("done", done);
});
it("should allow flat mods to change parse behaviour", function (done) {
var conv = new Converter({
colParser: {
"a.b": {
flat: true
}
}
});
conv.fromString("a.b,b.d,c.a\n1,2,3\n4,5,6").subscribe(function (d) {
assert(d["a.b"]);
})
.on("done", done);
});
it("should process long header", function (done) {
var testData = __dirname + "/data/longHeader";
var rs = fs.createReadStream(testData, { highWaterMark: 100 });
var numOfRow = 0;
var numOfJson = 0;
csv({}, { highWaterMark: 100 })
.fromStream(rs)
.subscribe(function (res, idx) {
numOfJson++;
assert.equal(res.Date, '8/26/16');
assert(idx >= 0);
})
.on("done", function () {
assert(numOfJson === 1);
done();
});
});
it("should parse #139", function (done) {
var rs = fs.createReadStream(__dirname + "/data/data#139");
csv()
.fromStream(rs)
.then(function (res) {
assert.equal(res[1].field3, "9001009395 9001009990");
done();
});
});
it("should ignore column", function (done) {
var rs = fs.createReadStream(__dirname + "/data/dataWithQoutes");
var headerEmitted = false;
csv({
ignoreColumns: /TIMESTAMP/
})
.fromStream(rs)
.on("header", function (header) {
assert.equal(header.indexOf("TIMESTAMP"), -1);
assert.equal(header.indexOf("UPDATE"), 0);
if (headerEmitted) {
throw ("header event should only happen once")
}
headerEmitted = true;
})
// .on("csv", function (row, idx) {
// if (!headerEmitted) {
// throw ("header should be emitted before any data events");
// }
// assert(idx >= 0);
// if (idx === 1) {
// assert.equal(row[0], "n");
// }
// })
.subscribe(function (j, idx) {
assert(!j.TIMESTAMP);
assert(idx >= 0);
})
.on("done", function () {
assert(headerEmitted);
done();
});
});
it("should keep space around comma in csv", function () {
const str = `"Name","Number"
"John , space", 1234
"Mr. , space", 4321
`;
return csv().fromString(str)
.then((data) => {
assert.equal(data[0].Name, "John , space");
assert.equal(data[1].Name, "Mr. , space");
})
})
it("should include column", function (done) {
var rs = fs.createReadStream(__dirname + "/data/dataWithQoutes");
csv({
includeColumns: /TIMESTAMP/
})
.fromStream(rs)
.on("header", function (header) {
assert.equal(header.indexOf("TIMESTAMP"), 0);
assert.equal(header.indexOf("UPDATE"), -1);
assert.equal(header.length, 1);
})
.subscribe(function (j, idx) {
assert(idx >= 0);
if (idx === 1) {
assert.equal(j.TIMESTAMP, "abc, def, ccc");
}
assert(!j.UID)
assert(!j['BYTES SENT'])
})
.on("done", function () {
done();
});
});
it("should allow headers and include columns to be given as reference to the same var", function (done) {
var rs = fs.createReadStream(__dirname + "/data/complexJSONCSV");
var headers = [
'first',
'second',
'third',
];
var expected = headers;
csv({
headers: headers,
includeColumns: /(first|second|third)/,
})
.fromStream(rs)
.on("header", function (header) {
expected.forEach(function (value, index) {
assert.equal(header.indexOf(value), index);
});
})
.subscribe(function (j, idx) {
assert(idx >= 0);
assert.equal(expected.length, Object.keys(j).length);
expected.forEach(function (attribute) {
assert(j.hasOwnProperty(attribute));
});
})
.on("done", function () {
done();
});
});
it("should leave provided params objects unmutated", function() {
var rs = fs.createReadStream(__dirname + "/data/complexJSONCSV");
var includeColumns = [
'fieldA.title',
'description',
];
return csv({
includeColumns: /(fieldA\.title|description)/,
})
.fromStream(rs)
.on("json", function(j, idx) {
assert(idx >= 0);
})
.on("header", function(header) {
includeColumns.forEach(function (value, index) {
assert.equal(index, header.indexOf(value));
});
})
});
it("should only call done once", function (done) {
var counter=0;
csv()
.fromString('"a","b", "c""')
.on('done',function(){
counter++;
});
setTimeout(function(){
assert.equal(counter,1);
done();
},100);
})
});

View File

@@ -0,0 +1 @@
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.00823,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00823,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0.00412,"101":0,"102":0.0247,"103":0.00412,"104":0.00412,"105":0.00412,"106":0.00412,"107":0.00412,"108":0.03294,"109":1.2104,"110":0.63814,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.00412,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0.00412,"75":0,"76":0,"77":0.00823,"78":0,"79":0.00412,"80":0.00412,"81":0,"83":0.00412,"84":0,"85":0,"86":0,"87":0.01235,"88":0,"89":0.00412,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0.03705,"96":0,"97":0,"98":0,"99":0.00412,"100":0.00823,"101":0,"102":0.00823,"103":0.0247,"104":0.00412,"105":0.03294,"106":0.01235,"107":0.04117,"108":0.1935,"109":4.63574,"110":2.99718,"111":0,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.00823,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0.00412,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.00412,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0.00412,"90":0,"91":0,"92":0,"93":0.05764,"94":0.40347,"95":0.1935,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.00412,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00412,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.01235,"103":0,"104":0.0247,"105":0.00412,"106":0.00412,"107":0.02882,"108":0.03294,"109":1.09101,"110":1.42037},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00823,"14":0.03705,"15":0.0247,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0.03294,"12.1":0.00823,"13.1":0.07822,"14.1":0.11116,"15.1":0.02882,"15.2-15.3":0.09881,"15.4":0.28407,"15.5":0.12351,"15.6":0.54344,"16.0":0.04117,"16.1":0.12763,"16.2":0.63402,"16.3":0.53933,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.04066,"10.0-10.2":0,"10.3":0.05808,"11.0-11.2":0,"11.3-11.4":0.37172,"12.0-12.1":0.0029,"12.2-12.5":0.27879,"13.0-13.1":0,"13.2":0.0029,"13.3":0.04646,"13.4-13.7":0.02614,"14.0-14.4":0.32816,"14.5-14.8":0.44432,"15.0-15.1":0.212,"15.2-15.3":0.20909,"15.4":0.46755,"15.5":0.92929,"15.6":2.47134,"16.0":4.66099,"16.1":5.43928,"16.2":6.56895,"16.3":5.28536,"16.4":0.02614},P:{"4":0.02084,"20":1.28152,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.03126,"8.2":0,"9.2":0.01042,"10.1":0,"11.1-11.2":0.04168,"12.0":0.01042,"13.0":0,"14.0":0.36466,"15.0":0.02084,"16.0":0.15628,"17.0":0.03126,"18.0":0.13544,"19.0":2.85476},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.13293},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.01235,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.01765},H:{"0":0.06684},L:{"0":48.25572},R:{_:"0"},M:{"0":0.25297},Q:{"13.1":0}};

View File

@@ -0,0 +1,49 @@
{
"name": "@odit/license-exporter",
"version": "0.0.12",
"description": "A simple license crawler for crediting open source work",
"keywords": [
"license",
"ODIT.Services",
"cli"
],
"repository": {
"type": "git",
"url": "https://git.odit.services/odit/license-exporter"
},
"author": {
"name": "ODIT.Services",
"email": "info@odit.services",
"url": "https://odit.services"
},
"license": "MIT",
"publishConfig": {
"access": "public"
},
"contributors": [
{
"name": "Philipp Dormann",
"email": "philipp@philippdormann.de",
"url": "https://philippdormann.de"
},
{
"name": "Nicolai Ort",
"email": "info@nicolai-ort.com",
"url": "https://nicolai-ort.com"
}
],
"main": "exporter.js",
"bin": {
"license-exporter": "bin/exporter.js"
},
"files": [
"bin",
"exporter.js",
"README.md",
"package.json",
"LICENSE"
],
"dependencies": {
"yargs": "^17.3.1"
}
}

View File

@@ -0,0 +1,247 @@
# bl *(BufferList)*
[![Build Status](https://api.travis-ci.com/rvagg/bl.svg?branch=master)](https://travis-ci.com/rvagg/bl/)
**A Node.js Buffer list collector, reader and streamer thingy.**
[![NPM](https://nodei.co/npm/bl.svg)](https://nodei.co/npm/bl/)
**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!
The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.
```js
const { BufferList } = require('bl')
const bl = new BufferList()
bl.append(Buffer.from('abcd'))
bl.append(Buffer.from('efg'))
bl.append('hi') // bl will also accept & convert Strings
bl.append(Buffer.from('j'))
bl.append(Buffer.from([ 0x3, 0x4 ]))
console.log(bl.length) // 12
console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'
console.log(bl.slice(3, 10).toString('ascii')) // 'defghij'
console.log(bl.slice(3, 6).toString('ascii')) // 'def'
console.log(bl.slice(3, 8).toString('ascii')) // 'defgh'
console.log(bl.slice(5, 10).toString('ascii')) // 'fghij'
console.log(bl.indexOf('def')) // 3
console.log(bl.indexOf('asdf')) // -1
// or just use toString!
console.log(bl.toString()) // 'abcdefghij\u0003\u0004'
console.log(bl.toString('ascii', 3, 8)) // 'defgh'
console.log(bl.toString('ascii', 5, 10)) // 'fghij'
// other standard Buffer readables
console.log(bl.readUInt16BE(10)) // 0x0304
console.log(bl.readUInt16LE(10)) // 0x0403
```
Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:
```js
const { BufferListStream } = require('bl')
const fs = require('fs')
fs.createReadStream('README.md')
.pipe(BufferListStream((err, data) => { // note 'new' isn't strictly required
// `data` is a complete Buffer object containing the full data
console.log(data.toString())
}))
```
Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.
Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):
```js
const hyperquest = require('hyperquest')
const { BufferListStream } = require('bl')
const url = 'https://raw.github.com/rvagg/bl/master/README.md'
hyperquest(url).pipe(BufferListStream((err, data) => {
console.log(data.toString())
}))
```
Or, use it as a readable stream to recompose a list of Buffers to an output source:
```js
const { BufferListStream } = require('bl')
const fs = require('fs')
var bl = new BufferListStream()
bl.append(Buffer.from('abcd'))
bl.append(Buffer.from('efg'))
bl.append(Buffer.from('hi'))
bl.append(Buffer.from('j'))
bl.pipe(fs.createWriteStream('gibberish.txt'))
```
## API
* <a href="#ctor"><code><b>new BufferList([ buf ])</b></code></a>
* <a href="#isBufferList"><code><b>BufferList.isBufferList(obj)</b></code></a>
* <a href="#length"><code>bl.<b>length</b></code></a>
* <a href="#append"><code>bl.<b>append(buffer)</b></code></a>
* <a href="#get"><code>bl.<b>get(index)</b></code></a>
* <a href="#indexOf"><code>bl.<b>indexOf(value[, byteOffset][, encoding])</b></code></a>
* <a href="#slice"><code>bl.<b>slice([ start[, end ] ])</b></code></a>
* <a href="#shallowSlice"><code>bl.<b>shallowSlice([ start[, end ] ])</b></code></a>
* <a href="#copy"><code>bl.<b>copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])</b></code></a>
* <a href="#duplicate"><code>bl.<b>duplicate()</b></code></a>
* <a href="#consume"><code>bl.<b>consume(bytes)</b></code></a>
* <a href="#toString"><code>bl.<b>toString([encoding, [ start, [ end ]]])</b></code></a>
* <a href="#readXX"><code>bl.<b>readDoubleBE()</b></code>, <code>bl.<b>readDoubleLE()</b></code>, <code>bl.<b>readFloatBE()</b></code>, <code>bl.<b>readFloatLE()</b></code>, <code>bl.<b>readInt32BE()</b></code>, <code>bl.<b>readInt32LE()</b></code>, <code>bl.<b>readUInt32BE()</b></code>, <code>bl.<b>readUInt32LE()</b></code>, <code>bl.<b>readInt16BE()</b></code>, <code>bl.<b>readInt16LE()</b></code>, <code>bl.<b>readUInt16BE()</b></code>, <code>bl.<b>readUInt16LE()</b></code>, <code>bl.<b>readInt8()</b></code>, <code>bl.<b>readUInt8()</b></code></a>
* <a href="#ctorStream"><code><b>new BufferListStream([ callback ])</b></code></a>
--------------------------------------------------------
<a name="ctor"></a>
### new BufferList([ Buffer | Buffer array | BufferList | BufferList array | String ])
No arguments are _required_ for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` objects.
`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
```js
const { BufferList } = require('bl')
const bl = BufferList()
// equivalent to:
const { BufferList } = require('bl')
const bl = new BufferList()
```
--------------------------------------------------------
<a name="isBufferList"></a>
### BufferList.isBufferList(obj)
Determines if the passed object is a `BufferList`. It will return `true` if the passed object is an instance of `BufferList` **or** `BufferListStream` and `false` otherwise.
N.B. this won't return `true` for `BufferList` or `BufferListStream` instances created by versions of this library before this static method was added.
--------------------------------------------------------
<a name="length"></a>
### bl.length
Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.
--------------------------------------------------------
<a name="append"></a>
### bl.append(Buffer | Buffer array | BufferList | BufferList array | String)
`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained.
--------------------------------------------------------
<a name="get"></a>
### bl.get(index)
`get()` will return the byte at the specified index.
--------------------------------------------------------
<a name="indexOf"></a>
### bl.indexOf(value[, byteOffset][, encoding])
`get()` will return the byte at the specified index.
`indexOf()` method returns the first index at which a given element can be found in the BufferList, or -1 if it is not present.
--------------------------------------------------------
<a name="slice"></a>
### bl.slice([ start, [ end ] ])
`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.
--------------------------------------------------------
<a name="shallowSlice"></a>
### bl.shallowSlice([ start, [ end ] ])
`shallowSlice()` returns a new `BufferList` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
No copies will be performed. All buffers in the result share memory with the original list.
--------------------------------------------------------
<a name="copy"></a>
### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.
--------------------------------------------------------
<a name="duplicate"></a>
### bl.duplicate()
`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:
```js
var bl = new BufferListStream()
bl.append('hello')
bl.append(' world')
bl.append('\n')
bl.duplicate().pipe(process.stdout, { end: false })
console.log(bl.toString())
```
--------------------------------------------------------
<a name="consume"></a>
### bl.consume(bytes)
`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers&mdash;initial offsets will be calculated accordingly in order to give you a consistent view of the data.
--------------------------------------------------------
<a name="toString"></a>
### bl.toString([encoding, [ start, [ end ]]])
`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.
--------------------------------------------------------
<a name="readXX"></a>
### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
See the <b><code>[Buffer](http://nodejs.org/docs/latest/api/buffer.html)</code></b> documentation for how these work.
--------------------------------------------------------
<a name="ctorStream"></a>
### new BufferListStream([ callback | Buffer | Buffer array | BufferList | BufferList array | String ])
**BufferListStream** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **BufferListStream** instance.
The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
```js
const { BufferListStream } = require('bl')
const bl = BufferListStream()
// equivalent to:
const { BufferListStream } = require('bl')
const bl = new BufferListStream()
```
N.B. For backwards compatibility reasons, `BufferListStream` is the **default** export when you `require('bl')`:
```js
const { BufferListStream } = require('bl')
// equivalent to:
const BufferListStream = require('bl')
```
--------------------------------------------------------
## Contributors
**bl** is brought to you by the following hackers:
* [Rod Vagg](https://github.com/rvagg)
* [Matteo Collina](https://github.com/mcollina)
* [Jarett Cruger](https://github.com/jcrugzz)
<a name="license"></a>
## License &amp; copyright
Copyright (c) 2013-2019 bl contributors (listed above).
bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.

View File

@@ -0,0 +1 @@
{"name":"sade","version":"1.8.1","files":{"license":{"checkedAt":1678883668743,"integrity":"sha512-ZkoPlLLLNE+x7uYhT2lFNl+mwCMeZeFOJcAZPO7exJwgOsqOVgLz1xP7U8obr3Ev63lEyJpJ72AcTI7XSYzgQg==","mode":420,"size":1122},"lib/index.js":{"checkedAt":1678883668743,"integrity":"sha512-m7SOqqUgwdpibf6rypjg4DOcGje8uO4I4Dd7EN1DK2ItqcvqoNJ/uJqcbHluR9Y6nAGQCscmQsNlKhG0eaoZXg==","mode":420,"size":4274},"package.json":{"checkedAt":1678883668743,"integrity":"sha512-x2Lv4SujmjRu+lR3B3i4+hqU7fJwDSGkVCN3VWRxZp1hiz1dOgcIHYH02d6yXnlQrinBe3i4vg7VcGeB78egCA==","mode":420,"size":820},"readme.md":{"checkedAt":1678883668749,"integrity":"sha512-+y/iyXwKKJ2qvXmYwYFZa10ffsrA5bbj2FNqBH5O/0AiBEqEbheGDhSzzKTTqXQQXk2VQkWVUixNLCqpgFW9dA==","mode":420,"size":20116},"index.d.ts":{"checkedAt":1678883668759,"integrity":"sha512-Va1hjgmhaErOe9OmUM/6vfT53DyfvMOpfJeHIVMGrgaWXIxopPAhSoC4zTEWJw03fxKqKUU5D0MUpNBCBEaHUA==","mode":420,"size":938},"lib/index.mjs":{"checkedAt":1678883668759,"integrity":"sha512-3NFLEogGMTq1kzyVpkirp38+qD7yVn30Bkwme32smCG1U1rNqfXE8ADmCZTmKz92MfzL2dI38hdhPicuznsDhg==","mode":420,"size":4275}}}

View File

@@ -0,0 +1 @@
{"version":3,"file":"elementAt.js","sourceRoot":"","sources":["../../../../src/internal/operators/elementAt.ts"],"names":[],"mappings":";;;AAAA,2EAA0E;AAG1E,mCAAkC;AAClC,+CAA8C;AAC9C,mDAAkD;AAClD,+BAA8B;AAkD9B,SAAgB,SAAS,CAAW,KAAa,EAAE,YAAgB;IACjE,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,MAAM,IAAI,iDAAuB,EAAE,CAAC;KACrC;IACD,IAAM,eAAe,GAAG,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC;IAC9C,OAAO,UAAC,MAAqB;QAC3B,OAAA,MAAM,CAAC,IAAI,CACT,eAAM,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,KAAK,KAAK,EAAX,CAAW,CAAC,EAC7B,WAAI,CAAC,CAAC,CAAC,EACP,eAAe,CAAC,CAAC,CAAC,+BAAc,CAAC,YAAa,CAAC,CAAC,CAAC,CAAC,2BAAY,CAAC,cAAM,OAAA,IAAI,iDAAuB,EAAE,EAA7B,CAA6B,CAAC,CACpG;IAJD,CAIC,CAAC;AACN,CAAC;AAXD,8BAWC"}

View File

@@ -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:{"1":"bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB 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"},D:{"1":"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 YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h"},E:{"1":"B C K L G 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F A HC zB IC JC KC LC"},F:{"1":"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 PB QB RB SB TB UB VB WB XB YB ZB aB bB PC QC RC SC qB AC TC rB"},G:{"1":"cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC aC bC"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"g 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I wC xC yC zC 0C 0B"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"BD","2":"AD"}},B:5,C:"prefers-reduced-motion media query"};

View File

@@ -0,0 +1,15 @@
/**
Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
@example
```
import stripAnsi from 'strip-ansi';
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'
```
*/
export default function stripAnsi(string: string): string;

View File

@@ -0,0 +1 @@
{"name":"functions-have-names","version":"1.2.3","files":{".editorconfig":{"checkedAt":1678883671533,"integrity":"sha512-gD3iQtgC7ZgFS97pyZqR0FPjMNyRAfat8dipbSL28iiJ6B1MP5dDeDYeEnP5sYMTz8whQIk3E5vltk2kcyJJEQ==","mode":420,"size":286},".nycrc":{"checkedAt":1678883669555,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"LICENSE":{"checkedAt":1678883671533,"integrity":"sha512-d2fjYr50p8QKjqC0qhH5nWv3sgAsKHHicw91kVzLPCZ54cpPIRw8zJk+nn45Y6q/yJ/T/xdxK77zBLuAvFgmVg==","mode":420,"size":1071},".eslintrc":{"checkedAt":1678883671637,"integrity":"sha512-DtwYX4YeuzuPnIZABU1O2H00e4l3mXmgnayUqmb3aFU9utX1wZF1YZG4OOPJ5SKeYhohg4ku9NGKt8XhOKjrng==","mode":420,"size":219},"index.js":{"checkedAt":1678883671637,"integrity":"sha512-8WqIvCnEslYY20uVQaFbQLTlwATT2UBb326wPVX4gtzJy7qx5PxOo5rRv6fMrmB/G1Phk6W73j9u9Nid5MZT3Q==","mode":420,"size":774},"test/index.js":{"checkedAt":1678883671640,"integrity":"sha512-B/55dvRtJwrp7kZTYMKhMwh6yOMf9uGrEUYeEzFXooZEK650RCvi+Tw1p9QHCfTuyQbRcfb62ej5KPLF0PvUSg==","mode":420,"size":1958},"package.json":{"checkedAt":1678883671640,"integrity":"sha512-2N6m8yr6gtgQxmLEabmTfxIRMpY0pJ7f99Oz03Od4LnE3R6nLm6gO+zVcScs+P7x0pKiMzjmzNndWhC/OtGq8w==","mode":420,"size":1554},"README.md":{"checkedAt":1678883671642,"integrity":"sha512-odJo1c2NQR+tjAAVsxEqb6H6+XQrILGHMWiLBO2Y/ZEMq+D4dry1DnDtfWzepdl/iTIxRTc/tHD+9i2Rr+V6kw==","mode":420,"size":1894},"CHANGELOG.md":{"checkedAt":1678883671642,"integrity":"sha512-IuZia71Bq0BoVwIiK3A87+p4MX6xL5zydSnNf4hyh5XdvEKSgJDzNE9vuKrMSOmji6btjyS951XnrxKZn0Jnsw==","mode":420,"size":8229},".github/FUNDING.yml":{"checkedAt":1678883671642,"integrity":"sha512-YfsYas5tNfBo7HxGLn6QRUwk1emzfkT+AsVl9yK2eTNl7iv7zwWI0T96rhesP8exiv19HTBKpa6a+KaBhBmsLw==","mode":420,"size":591}}}

View File

@@ -0,0 +1,8 @@
"use strict";
var str = "razdwatrzy";
module.exports = function () {
if (typeof str.includes !== "function") return false;
return str.includes("dwa") === true && str.includes("foo") === false;
};

View File

@@ -0,0 +1,11 @@
"use strict";
exports.URL = require("./URL").interface;
exports.serializeURL = require("./url-state-machine").serializeURL;
exports.serializeURLOrigin = require("./url-state-machine").serializeURLOrigin;
exports.basicURLParse = require("./url-state-machine").basicURLParse;
exports.setTheUsername = require("./url-state-machine").setTheUsername;
exports.setThePassword = require("./url-state-machine").setThePassword;
exports.serializeHost = require("./url-state-machine").serializeHost;
exports.serializeInteger = require("./url-state-machine").serializeInteger;
exports.parseURL = require("./url-state-machine").parseURL;

View File

@@ -0,0 +1,168 @@
[![Travis Build Status](https://img.shields.io/travis/wycats/handlebars.js/master.svg)](https://travis-ci.org/wycats/handlebars.js)
[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/github/wycats/handlebars.js?branch=master&svg=true)](https://ci.appveyor.com/project/wycats/handlebars-js)
[![Selenium Test Status](https://saucelabs.com/buildstatus/handlebars)](https://saucelabs.com/u/handlebars)
Handlebars.js
=============
Handlebars.js is an extension to the [Mustache templating
language](http://mustache.github.com/) created by Chris Wanstrath.
Handlebars.js and Mustache are both logicless templating languages that
keep the view and the code separated like we all know they should be.
Checkout the official Handlebars docs site at
[https://handlebarsjs.com/](https://handlebarsjs.com) and the live demo at [http://tryhandlebarsjs.com/](http://tryhandlebarsjs.com/).
Installing
----------
See our [installation documentation](https://handlebarsjs.com/installation/).
Usage
-----
In general, the syntax of Handlebars.js templates is a superset
of Mustache templates. For basic syntax, check out the [Mustache
manpage](http://mustache.github.com/mustache.5.html).
Once you have a template, use the `Handlebars.compile` method to compile
the template into a function. The generated function takes a context
argument, which will be used to render the template.
```js
var source = "<p>Hello, my name is {{name}}. I am from {{hometown}}. I have " +
"{{kids.length}} kids:</p>" +
"<ul>{{#kids}}<li>{{name}} is {{age}}</li>{{/kids}}</ul>";
var template = Handlebars.compile(source);
var data = { "name": "Alan", "hometown": "Somewhere, TX",
"kids": [{"name": "Jimmy", "age": "12"}, {"name": "Sally", "age": "4"}]};
var result = template(data);
// Would render:
// <p>Hello, my name is Alan. I am from Somewhere, TX. I have 2 kids:</p>
// <ul>
// <li>Jimmy is 12</li>
// <li>Sally is 4</li>
// </ul>
```
Full documentation and more examples are at [handlebarsjs.com](https://handlebarsjs.com/).
Precompiling Templates
----------------------
Handlebars allows templates to be precompiled and included as javascript code rather than the handlebars template allowing for faster startup time. Full details are located [here](https://handlebarsjs.com/installation/precompilation.html).
Differences Between Handlebars.js and Mustache
----------------------------------------------
Handlebars.js adds a couple of additional features to make writing
templates easier and also changes a tiny detail of how partials work.
- [Nested Paths](https://handlebarsjs.com/guide/expressions.html#path-expressions)
- [Helpers](https://handlebarsjs.com/guide/expressions.html#helpers)
- [Block Expressions](https://handlebarsjs.com/guide/block-helpers.html#basic-blocks)
- [Literal Values](https://handlebarsjs.com/guide/expressions.html#literal-segments)
- [Delimited Comments](https://handlebarsjs.com/guide/#template-comments)
Block expressions have the same syntax as mustache sections but should not be confused with one another. Sections are akin to an implicit `each` or `with` statement depending on the input data and helpers are explicit pieces of code that are free to implement whatever behavior they like. The [mustache spec](http://mustache.github.io/mustache.5.html) defines the exact behavior of sections. In the case of name conflicts, helpers are given priority.
### Compatibility
There are a few Mustache behaviors that Handlebars does not implement.
- Handlebars deviates from Mustache slightly in that it does not perform recursive lookup by default. The compile time `compat` flag must be set to enable this functionality. Users should note that there is a performance cost for enabling this flag. The exact cost varies by template, but it's recommended that performance sensitive operations should avoid this mode and instead opt for explicit path references.
- The optional Mustache-style lambdas are not supported. Instead Handlebars provides its own lambda resolution that follows the behaviors of helpers.
- Alternative delimiters are not supported.
Supported Environments
----------------------
Handlebars has been designed to work in any ECMAScript 3 environment. This includes
- Node.js
- Chrome
- Firefox
- Safari 5+
- Opera 11+
- IE 6+
Older versions and other runtimes are likely to work but have not been formally
tested. The compiler requires `JSON.stringify` to be implemented natively or via a polyfill. If using the precompiler this is not necessary.
[![Selenium Test Status](https://saucelabs.com/browser-matrix/handlebars.svg)](https://saucelabs.com/u/handlebars)
Performance
-----------
In a rough performance test, precompiled Handlebars.js templates (in
the original version of Handlebars.js) rendered in about half the
time of Mustache templates. It would be a shame if it were any other
way, since they were precompiled, but the difference in architecture
does have some big performance advantages. Justin Marney, a.k.a.
[gotascii](http://github.com/gotascii), confirmed that with an
[independent test](http://sorescode.com/2010/09/12/benchmarks.html). The
rewritten Handlebars (current version) is faster than the old version,
with many [performance tests](https://travis-ci.org/wycats/handlebars.js/builds/33392182#L538) being 5 to 7 times faster than the Mustache equivalent.
Upgrading
---------
See [release-notes.md](https://github.com/wycats/handlebars.js/blob/master/release-notes.md) for upgrade notes.
Known Issues
------------
See [FAQ.md](https://github.com/wycats/handlebars.js/blob/master/FAQ.md) for known issues and common pitfalls.
Handlebars in the Wild
----------------------
* [Assemble](http://assemble.io), by [@jonschlinkert](https://github.com/jonschlinkert)
and [@doowb](https://github.com/doowb), is a static site generator that uses Handlebars.js
as its template engine.
* [Cory](https://github.com/leo/cory), by [@leo](https://github.com/leo), is another tiny static site generator
* [CoSchedule](http://coschedule.com) An editorial calendar for WordPress that uses Handlebars.js
* [dashbars](https://github.com/pismute/dashbars) A modern helper library for Handlebars.js.
* [Ember.js](http://www.emberjs.com) makes Handlebars.js the primary way to
structure your views, also with automatic data binding support.
* [Ghost](https://ghost.org/) Just a blogging platform.
* [handlebars_assets](http://github.com/leshill/handlebars_assets): A Rails Asset Pipeline gem
from Les Hill (@leshill).
* [handlebars-helpers](https://github.com/assemble/handlebars-helpers) is an extensive library
with 100+ handlebars helpers.
* [handlebars-layouts](https://github.com/shannonmoeller/handlebars-layouts) is a set of helpers which implement extendible and embeddable layout blocks as seen in other popular templating languages.
* [hbs](http://github.com/donpark/hbs): An Express.js view engine adapter for Handlebars.js,
from Don Park.
* [koa-hbs](https://github.com/jwilm/koa-hbs): [koa](https://github.com/koajs/koa) generator based
renderer for Handlebars.js.
* [jblotus](http://github.com/jblotus) created [http://tryhandlebarsjs.com](http://tryhandlebarsjs.com)
for anyone who would like to try out Handlebars.js in their browser.
* [jQuery plugin](http://71104.github.io/jquery-handlebars/): allows you to use
Handlebars.js with [jQuery](http://jquery.com/).
* [Lumbar](http://walmartlabs.github.io/lumbar) provides easy module-based template management for
handlebars projects.
* [Marionette.Handlebars](https://github.com/hashchange/marionette.handlebars) adds support for Handlebars and Mustache templates to Marionette.
* [sammy.js](http://github.com/quirkey/sammy) by Aaron Quint, a.k.a. quirkey,
supports Handlebars.js as one of its template plugins.
* [SproutCore](http://www.sproutcore.com) uses Handlebars.js as its main
templating engine, extending it with automatic data binding support.
* [YUI](http://yuilibrary.com/yui/docs/handlebars/) implements a port of handlebars
* [Swag](https://github.com/elving/swag) by [@elving](https://github.com/elving) is a growing collection of helpers for handlebars.js. Give your handlebars.js templates some swag son!
* [DOMBars](https://github.com/blakeembrey/dombars) is a DOM-based templating engine built on the Handlebars parser and runtime **DEPRECATED**
* [promised-handlebars](https://github.com/nknapp/promised-handlebars) is a wrapper for Handlebars that allows helpers to return Promises.
* [just-handlebars-helpers](https://github.com/leapfrogtechnology/just-handlebars-helpers) A fully tested lightweight package with common Handlebars helpers.
External Resources
------------------
* [Gist about Synchronous and asynchronous loading of external handlebars templates](https://gist.github.com/2287070)
Have a project using Handlebars? Send us a [pull request][pull-request]!
License
-------
Handlebars.js is released under the MIT license.
[pull-request]: https://github.com/wycats/handlebars.js/pull/new/master

View File

@@ -0,0 +1,80 @@
[![Cybernetically enhanced web apps: Svelte](https://sveltejs.github.io/assets/banner.png)](https://svelte.dev)
[![npm version](https://img.shields.io/npm/v/svelte.svg)](https://www.npmjs.com/package/svelte) [![license](https://img.shields.io/npm/l/svelte.svg)](LICENSE.md) [![Chat](https://img.shields.io/discord/457912077277855764?label=chat&logo=discord)](https://svelte.dev/chat)
## What is Svelte?
Svelte is a new way to build web applications. It's a compiler that takes your declarative components and converts them into efficient JavaScript that surgically updates the DOM.
Learn more at the [Svelte website](https://svelte.dev), or stop by the [Discord chatroom](https://svelte.dev/chat).
## Supporting Svelte
Svelte is an MIT-licensed open source project with its ongoing development made possible entirely by fantastic volunteers. If you'd like to support their efforts, please consider:
- [Becoming a backer on Open Collective](https://opencollective.com/svelte).
Funds donated via Open Collective will be used for compensating expenses related to Svelte's development such as hosting costs. If sufficient donations are received, funds may also be used to support Svelte's development more directly.
## Roadmap
You may view [our roadmap](https://svelte.dev/roadmap) if you'd like to see what we're currently working on.
## Development
Pull requests are encouraged and always welcome. [Pick an issue](https://github.com/sveltejs/svelte/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) and help us out!
To install and work on Svelte locally:
```bash
git clone https://github.com/sveltejs/svelte.git
cd svelte
npm install
```
> Do not use Yarn to install the dependencies, as the specific package versions in `package-lock.json` are used to build and test Svelte.
To build the compiler and all the other modules included in the package:
```bash
npm run build
```
To watch for changes and continually rebuild the package (this is useful if you're using [npm link](https://docs.npmjs.com/cli/link.html) to test out changes in a project locally):
```bash
npm run dev
```
The compiler is written in [TypeScript](https://www.typescriptlang.org/), but don't let that put you off — it's basically just JavaScript with type annotations. You'll pick it up in no time. If you're using an editor other than [Visual Studio Code](https://code.visualstudio.com/), you may need to install a plugin in order to get syntax highlighting and code hints, etc.
### Running Tests
```bash
npm run test
```
To filter tests, use `-g` (aka `--grep`). For example, to only run tests involving transitions:
```bash
npm run test -- -g transition
```
## svelte.dev
The source code for https://svelte.dev lives in the [sites](https://github.com/sveltejs/sites) repository, with all the documentation in the [site/content](site/content) directory. The site is built with [SvelteKit](https://kit.svelte.dev).
### Is svelte.dev down?
Probably not, but it's possible. If you can't seem to access any `.dev` sites, check out [this SuperUser question and answer](https://superuser.com/q/1413402).
## License
[MIT](LICENSE.md)

View File

@@ -0,0 +1,5 @@
export type UpperCaseCharacters = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
export type WordSeparators = '-' | '_' | ' ';
export type StringDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';

View File

@@ -0,0 +1,10 @@
import { ObservableInputTuple, OperatorFunction, Cons } from '../types';
/** @deprecated Replaced with {@link zipWith}. Will be removed in v8. */
export declare function zip<T, A extends readonly unknown[]>(otherInputs: [...ObservableInputTuple<A>]): OperatorFunction<T, Cons<T, A>>;
/** @deprecated Replaced with {@link zipWith}. Will be removed in v8. */
export declare function zip<T, A extends readonly unknown[], R>(otherInputsAndProject: [...ObservableInputTuple<A>], project: (...values: Cons<T, A>) => R): OperatorFunction<T, R>;
/** @deprecated Replaced with {@link zipWith}. Will be removed in v8. */
export declare function zip<T, A extends readonly unknown[]>(...otherInputs: [...ObservableInputTuple<A>]): OperatorFunction<T, Cons<T, A>>;
/** @deprecated Replaced with {@link zipWith}. Will be removed in v8. */
export declare function zip<T, A extends readonly unknown[], R>(...otherInputsAndProject: [...ObservableInputTuple<A>, (...values: Cons<T, A>) => R]): OperatorFunction<T, R>;
//# sourceMappingURL=zip.d.ts.map

View File

@@ -0,0 +1 @@
{"name":"is-glob","version":"4.0.3","files":{"LICENSE":{"checkedAt":1678883670399,"integrity":"sha512-UOO2nHn9DAmjyzpwwV0Scu/0jezBkqGLoKZNVJCn7ZV+l7ApYhoDOI/OlCh2TR6tqwtrEPB/7ahRiuplEJnMXQ==","mode":420,"size":1088},"index.js":{"checkedAt":1678883670844,"integrity":"sha512-hW6fYhSjwB/rc3CcLjS7ikVg9UBP31nqCtAtG+LOSgPj3ZWEN+MJKNq86rlyn4MOXWPpBWd5kMOH/+gPnA46Jg==","mode":420,"size":3628},"package.json":{"checkedAt":1678883670844,"integrity":"sha512-IgPpYswwIpDtsuYcKmWZ3s1wWFIV75Idk04UdWrCE2UTfLECJ2l4SfZ6zr//aYTdPtT5AXqPSLCjiQlQOX5bIw==","mode":420,"size":1748},"README.md":{"checkedAt":1678883670848,"integrity":"sha512-hA0MA4Qeyp/Kr17jB3+8yOAt8VhWHG36gyxa8F/14D9jkwX3EZQ17n8Vuzn9Q2KLC91B2jB1dCXkScwFJmFBEg==","mode":420,"size":7145}}}

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Processor = /** @class */ (function () {
function Processor(converter) {
this.converter = converter;
this.params = converter.parseParam;
this.runtime = converter.parseRuntime;
}
return Processor;
}());
exports.Processor = Processor;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL1VzZXJzL2t4aWFuZy93b3JrL3Byb2plY3RzL2NzdjJqc29uL3NyYy9Qcm9jZXNzb3IudHMiLCJzb3VyY2VzIjpbIi9Vc2Vycy9reGlhbmcvd29yay9wcm9qZWN0cy9jc3YyanNvbi9zcmMvUHJvY2Vzc29yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBTUE7SUFHRSxtQkFBc0IsU0FBb0I7UUFBcEIsY0FBUyxHQUFULFNBQVMsQ0FBVztRQUN4QyxJQUFJLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQyxVQUFVLENBQUM7UUFDbkMsSUFBSSxDQUFDLE9BQU8sR0FBRyxTQUFTLENBQUMsWUFBWSxDQUFDO0lBQ3hDLENBQUM7SUFJSCxnQkFBQztBQUFELENBQUMsQUFWRCxJQVVDO0FBVnFCLDhCQUFTIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ29udmVydGVyIH0gZnJv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