new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = -(Math.pow(2, 53) - 1);
|
||||
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.publishLast = void 0;
|
||||
var AsyncSubject_1 = require("../AsyncSubject");
|
||||
var ConnectableObservable_1 = require("../observable/ConnectableObservable");
|
||||
function publishLast() {
|
||||
return function (source) {
|
||||
var subject = new AsyncSubject_1.AsyncSubject();
|
||||
return new ConnectableObservable_1.ConnectableObservable(source, function () { return subject; });
|
||||
};
|
||||
}
|
||||
exports.publishLast = publishLast;
|
||||
//# sourceMappingURL=publishLast.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/data.ts"],"names":[],"mappings":"AAAA,cAAM,sBAAuB,SAAQ,KAAK;IACjC,IAAI,SAAwB;CACpC;AAED,wBAAgB,wBAAwB,CACtC,CAAC,EAAE,KAAK,GACP,CAAC,IAAI,sBAAsB,CAE7B"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"J D E F A B","16":"CC"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB EC FC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"1":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e PC QC RC SC qB AC TC rB","16":"F"},G:{"1":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"1":"oC"},I:{"1":"tB I f rC sC BC tC uC","16":"pC qC"},J:{"1":"D A"},K:{"1":"A B C h qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"1":"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":"AD BD"}},B:1,C:"Element.insertAdjacentElement() & Element.insertAdjacentText()"};
|
||||
@@ -0,0 +1,58 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { asyncScheduler } from '../scheduler/async';
|
||||
import { SchedulerLike } from '../types';
|
||||
import { timer } from './timer';
|
||||
|
||||
/**
|
||||
* Creates an Observable that emits sequential numbers every specified
|
||||
* interval of time, on a specified {@link SchedulerLike}.
|
||||
*
|
||||
* <span class="informal">Emits incremental numbers periodically in time.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `interval` returns an Observable that emits an infinite sequence of
|
||||
* ascending integers, with a constant interval of time of your choosing
|
||||
* between those emissions. The first emission is not sent immediately, but
|
||||
* only after the first period has passed. By default, this operator uses the
|
||||
* `async` {@link SchedulerLike} to provide a notion of time, but you may pass any
|
||||
* {@link SchedulerLike} to it.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Emits ascending numbers, one every second (1000ms) up to the number 3
|
||||
*
|
||||
* ```ts
|
||||
* import { interval, take } from 'rxjs';
|
||||
*
|
||||
* const numbers = interval(1000);
|
||||
*
|
||||
* const takeFourNumbers = numbers.pipe(take(4));
|
||||
*
|
||||
* takeFourNumbers.subscribe(x => console.log('Next: ', x));
|
||||
*
|
||||
* // Logs:
|
||||
* // Next: 0
|
||||
* // Next: 1
|
||||
* // Next: 2
|
||||
* // Next: 3
|
||||
* ```
|
||||
*
|
||||
* @see {@link timer}
|
||||
* @see {@link delay}
|
||||
*
|
||||
* @param {number} [period=0] The interval size in milliseconds (by default)
|
||||
* or the time unit determined by the scheduler's clock.
|
||||
* @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling
|
||||
* the emission of values, and providing a notion of "time".
|
||||
* @return {Observable} An Observable that emits a sequential number each time
|
||||
* interval.
|
||||
*/
|
||||
export function interval(period = 0, scheduler: SchedulerLike = asyncScheduler): Observable<number> {
|
||||
if (period < 0) {
|
||||
// We cannot schedule an interval in the past.
|
||||
period = 0;
|
||||
}
|
||||
|
||||
return timer(period, period, scheduler);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
# is-fullwidth-code-point [](https://travis-ci.org/sindresorhus/is-fullwidth-code-point)
|
||||
|
||||
> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install is-fullwidth-code-point
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const isFullwidthCodePoint = require('is-fullwidth-code-point');
|
||||
|
||||
isFullwidthCodePoint('谢'.codePointAt(0));
|
||||
//=> true
|
||||
|
||||
isFullwidthCodePoint('a'.codePointAt(0));
|
||||
//=> false
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### isFullwidthCodePoint(codePoint)
|
||||
|
||||
#### codePoint
|
||||
|
||||
Type: `number`
|
||||
|
||||
The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
//
|
||||
// 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.
|
||||
// a passthrough stream.
|
||||
// basically just the most minimal sort of Transform stream.
|
||||
// Every written chunk gets output as-is.
|
||||
'use strict';
|
||||
|
||||
module.exports = PassThrough;
|
||||
|
||||
var Transform = require('./_stream_transform');
|
||||
|
||||
require('inherits')(PassThrough, Transform);
|
||||
|
||||
function PassThrough(options) {
|
||||
if (!(this instanceof PassThrough)) return new PassThrough(options);
|
||||
Transform.call(this, options);
|
||||
}
|
||||
|
||||
PassThrough.prototype._transform = function (chunk, encoding, cb) {
|
||||
cb(null, chunk);
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[855] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№ыЫзЗшШэЭщЩчЧ§■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly.
|
||||
|
||||
The generic type parameter can be anything. It doesn't have to be an object.
|
||||
|
||||
[Read more about opaque types.](https://codemix.com/opaque-types-in-javascript/)
|
||||
|
||||
There have been several discussions about adding this feature to TypeScript via the `opaque type` operator, similar to how Flow does it. Unfortunately, nothing has (yet) moved forward:
|
||||
- [Microsoft/TypeScript#15408](https://github.com/Microsoft/TypeScript/issues/15408)
|
||||
- [Microsoft/TypeScript#15807](https://github.com/Microsoft/TypeScript/issues/15807)
|
||||
|
||||
@example
|
||||
```
|
||||
import {Opaque} from 'type-fest';
|
||||
|
||||
type AccountNumber = Opaque<number, 'AccountNumber'>;
|
||||
type AccountBalance = Opaque<number, 'AccountBalance'>;
|
||||
|
||||
// The Token parameter allows the compiler to differentiate between types, whereas "unknown" will not. For example, consider the following structures:
|
||||
type ThingOne = Opaque<string>;
|
||||
type ThingTwo = Opaque<string>;
|
||||
|
||||
// To the compiler, these types are allowed to be cast to each other as they have the same underlying type. They are both `string & { __opaque__: unknown }`.
|
||||
// To avoid this behaviour, you would instead pass the "Token" parameter, like so.
|
||||
type NewThingOne = Opaque<string, 'ThingOne'>;
|
||||
type NewThingTwo = Opaque<string, 'ThingTwo'>;
|
||||
|
||||
// Now they're completely separate types, so the following will fail to compile.
|
||||
function createNewThingOne (): NewThingOne {
|
||||
// As you can see, casting from a string is still allowed. However, you may not cast NewThingOne to NewThingTwo, and vice versa.
|
||||
return 'new thing one' as NewThingOne;
|
||||
}
|
||||
|
||||
// This will fail to compile, as they are fundamentally different types.
|
||||
const thingTwo = createNewThingOne() as NewThingTwo;
|
||||
|
||||
// Here's another example of opaque typing.
|
||||
function createAccountNumber(): AccountNumber {
|
||||
return 2 as AccountNumber;
|
||||
}
|
||||
|
||||
function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance {
|
||||
return 4 as AccountBalance;
|
||||
}
|
||||
|
||||
// This will compile successfully.
|
||||
getMoneyForAccount(createAccountNumber());
|
||||
|
||||
// But this won't, because it has to be explicitly passed as an `AccountNumber` type.
|
||||
getMoneyForAccount(2);
|
||||
|
||||
// You can use opaque values like they aren't opaque too.
|
||||
const accountNumber = createAccountNumber();
|
||||
|
||||
// This will not compile successfully.
|
||||
const newAccountNumber = accountNumber + 2;
|
||||
|
||||
// As a side note, you can (and should) use recursive types for your opaque types to make them stronger and hopefully easier to type.
|
||||
type Person = {
|
||||
id: Opaque<number, Person>;
|
||||
name: string;
|
||||
};
|
||||
```
|
||||
|
||||
@category Utilities
|
||||
*/
|
||||
export type Opaque<Type, Token = unknown> = Type & {readonly __opaque__: Token};
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.defer = void 0;
|
||||
var Observable_1 = require("../Observable");
|
||||
var innerFrom_1 = require("./innerFrom");
|
||||
function defer(observableFactory) {
|
||||
return new Observable_1.Observable(function (subscriber) {
|
||||
innerFrom_1.innerFrom(observableFactory()).subscribe(subscriber);
|
||||
});
|
||||
}
|
||||
exports.defer = defer;
|
||||
//# sourceMappingURL=defer.js.map
|
||||
@@ -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":"a b c d e i j k l m n o p q r s t u f H xB yB","2":"DC tB EC FC","33":"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","164":"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"},D:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"I v J D E F A B C K L G M N O w g","132":"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB EB FB GB HB"},E:{"1":"L G 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J HC zB IC","132":"D E F A B C K JC KC LC 0B qB rB"},F:{"1":"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","2":"F PC QC RC","132":"0 1 2 3 4 G M N O w g x y z","164":"B C SC qB AC TC rB"},G:{"1":"kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"zB UC BC VC WC","132":"E XC YC ZC aC bC cC dC eC fC gC hC iC jC"},H:{"164":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC","132":"tC uC"},J:{"132":"D A"},K:{"1":"h","2":"A","164":"B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"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:{"164":"AD BD"}},B:4,C:"CSS3 tab-size"};
|
||||
@@ -0,0 +1,10 @@
|
||||
import ConstTag from '../../../nodes/ConstTag';
|
||||
export declare function get_const_tags(const_tags: ConstTag[]): {
|
||||
type: string;
|
||||
kind: string;
|
||||
declarations: {
|
||||
type: string;
|
||||
id: import("estree").Pattern;
|
||||
init: import("estree").Expression;
|
||||
}[];
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export function focusTrap(node: HTMLElement): void
|
||||
@@ -0,0 +1,64 @@
|
||||
import { MonoTypeOperatorFunction } from '../types';
|
||||
/**
|
||||
* Returns an Observable that mirrors the source Observable, but will call a specified function when
|
||||
* the source terminates on complete or error.
|
||||
* The specified function will also be called when the subscriber explicitly unsubscribes.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* Execute callback function when the observable completes
|
||||
*
|
||||
* ```ts
|
||||
* import { interval, take, finalize } from 'rxjs';
|
||||
*
|
||||
* // emit value in sequence every 1 second
|
||||
* const source = interval(1000);
|
||||
* const example = source.pipe(
|
||||
* take(5), //take only the first 5 values
|
||||
* finalize(() => console.log('Sequence complete')) // Execute when the observable completes
|
||||
* );
|
||||
* const subscribe = example.subscribe(val => console.log(val));
|
||||
*
|
||||
* // results:
|
||||
* // 0
|
||||
* // 1
|
||||
* // 2
|
||||
* // 3
|
||||
* // 4
|
||||
* // 'Sequence complete'
|
||||
* ```
|
||||
*
|
||||
* Execute callback function when the subscriber explicitly unsubscribes
|
||||
*
|
||||
* ```ts
|
||||
* import { interval, finalize, tap, noop, timer } from 'rxjs';
|
||||
*
|
||||
* const source = interval(100).pipe(
|
||||
* finalize(() => console.log('[finalize] Called')),
|
||||
* tap({
|
||||
* next: () => console.log('[next] Called'),
|
||||
* error: () => console.log('[error] Not called'),
|
||||
* complete: () => console.log('[tap complete] Not called')
|
||||
* })
|
||||
* );
|
||||
*
|
||||
* const sub = source.subscribe({
|
||||
* next: x => console.log(x),
|
||||
* error: noop,
|
||||
* complete: () => console.log('[complete] Not called')
|
||||
* });
|
||||
*
|
||||
* timer(150).subscribe(() => sub.unsubscribe());
|
||||
*
|
||||
* // results:
|
||||
* // '[next] Called'
|
||||
* // 0
|
||||
* // '[finalize] Called'
|
||||
* ```
|
||||
*
|
||||
* @param {function} callback Function to be called when source terminates.
|
||||
* @return A function that returns an Observable that mirrors the source, but
|
||||
* will call the specified function on termination.
|
||||
*/
|
||||
export declare function finalize<T>(callback: () => void): MonoTypeOperatorFunction<T>;
|
||||
//# sourceMappingURL=finalize.d.ts.map
|
||||
@@ -0,0 +1,34 @@
|
||||
import { createElement } from 'preact';
|
||||
import { shallowDiffers } from './util';
|
||||
|
||||
/**
|
||||
* Memoize a component, so that it only updates when the props actually have
|
||||
* changed. This was previously known as `React.pure`.
|
||||
* @param {import('./internal').FunctionComponent} c functional component
|
||||
* @param {(prev: object, next: object) => boolean} [comparer] Custom equality function
|
||||
* @returns {import('./internal').FunctionComponent}
|
||||
*/
|
||||
export function memo(c, comparer) {
|
||||
function shouldUpdate(nextProps) {
|
||||
let ref = this.props.ref;
|
||||
let updateRef = ref == nextProps.ref;
|
||||
if (!updateRef && ref) {
|
||||
ref.call ? ref(null) : (ref.current = null);
|
||||
}
|
||||
|
||||
if (!comparer) {
|
||||
return shallowDiffers(this.props, nextProps);
|
||||
}
|
||||
|
||||
return !comparer(this.props, nextProps) || !updateRef;
|
||||
}
|
||||
|
||||
function Memoed(props) {
|
||||
this.shouldComponentUpdate = shouldUpdate;
|
||||
return createElement(c, props);
|
||||
}
|
||||
Memoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';
|
||||
Memoed.prototype.isReactComponent = true;
|
||||
Memoed._forwarded = true;
|
||||
return Memoed;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate
|
||||
module.exports = 1;
|
||||
@@ -0,0 +1,35 @@
|
||||
define(['exports', 'module', '../utils'], function (exports, module, _utils) {
|
||||
'use strict';
|
||||
|
||||
module.exports = function (instance) {
|
||||
instance.registerHelper('blockHelperMissing', function (context, options) {
|
||||
var inverse = options.inverse,
|
||||
fn = options.fn;
|
||||
|
||||
if (context === true) {
|
||||
return fn(this);
|
||||
} else if (context === false || context == null) {
|
||||
return inverse(this);
|
||||
} else if (_utils.isArray(context)) {
|
||||
if (context.length > 0) {
|
||||
if (options.ids) {
|
||||
options.ids = [options.name];
|
||||
}
|
||||
|
||||
return instance.helpers.each(context, options);
|
||||
} else {
|
||||
return inverse(this);
|
||||
}
|
||||
} else {
|
||||
if (options.data && options.ids) {
|
||||
var data = _utils.createFrame(options.data);
|
||||
data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
|
||||
options = { data: data };
|
||||
}
|
||||
|
||||
return fn(context, options);
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvYmxvY2staGVscGVyLW1pc3NpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O21CQUVlLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFlBQVEsQ0FBQyxjQUFjLENBQUMsb0JBQW9CLEVBQUUsVUFBUyxPQUFPLEVBQUUsT0FBTyxFQUFFO0FBQ3ZFLFVBQUksT0FBTyxHQUFHLE9BQU8sQ0FBQyxPQUFPO1VBQzNCLEVBQUUsR0FBRyxPQUFPLENBQUMsRUFBRSxDQUFDOztBQUVsQixVQUFJLE9BQU8sS0FBSyxJQUFJLEVBQUU7Q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ggPSBhcHBlbmRDb250ZXh0UGF0aChcbiAgICAgICAgICBvcHRpb25zLmRhdGEuY29udGV4dFBhdGgsXG4gICAgICAgICAgb3B0aW9ucy5uYW1lXG4gICAgICAgICk7XG4gICAgICAgIG9wdGlvbnMgPSB7IGRhdGE6IGRhdGEgfTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIGZuKGNvbnRleHQsIG9wdGlvbnMpO1xuICAgIH1cbiAgfSk7XG59XG4iXX0=
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isDate.js","sourceRoot":"","sources":["../../../../src/internal/util/isDate.ts"],"names":[],"mappings":";;;AAOA,SAAgB,WAAW,CAAC,KAAU;IACpC,OAAO,KAAK,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,KAAY,CAAC,CAAC;AACvD,CAAC;AAFD,kCAEC"}
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
var cbrt = Math.cbrt;
|
||||
if (typeof cbrt !== "function") return false;
|
||||
return cbrt(2) === 1.2599210498948732;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={"0":"24","1":"25","2":"26","3":"27","4":"28","5":"29","6":"30","7":"31","8":"32","9":"33",A:"10",B:"11",C:"12",D:"7",E:"8",F:"9",G:"15",H:"110",I:"4",J:"6",K:"13",L:"14",M:"16",N:"17",O:"18",P:"79",Q:"80",R:"81",S:"83",T:"84",U:"85",V:"86",W:"87",X:"88",Y:"89",Z:"90",a:"91",b:"92",c:"93",d:"94",e:"95",f:"109",g:"20",h:"73",i:"96",j:"97",k:"98",l:"99",m:"100",n:"101",o:"102",p:"103",q:"104",r:"105",s:"106",t:"107",u:"108",v:"5",w:"19",x:"21",y:"22",z:"23",AB:"34",BB:"35",CB:"36",DB:"37",EB:"38",FB:"39",GB:"40",HB:"41",IB:"42",JB:"43",KB:"44",LB:"45",MB:"46",NB:"47",OB:"48",PB:"49",QB:"50",RB:"51",SB:"52",TB:"53",UB:"54",VB:"55",WB:"56",XB:"57",YB:"58",ZB:"60",aB:"62",bB:"63",cB:"64",dB:"65",eB:"66",fB:"67",gB:"68",hB:"69",iB:"70",jB:"71",kB:"72",lB:"74",mB:"75",nB:"76",oB:"77",pB:"78",qB:"11.1",rB:"12.1",sB:"16.0",tB:"3",uB:"59",vB:"61",wB:"82",xB:"111",yB:"112",zB:"3.2","0B":"10.1","1B":"13.1","2B":"15.2-15.3","3B":"15.4","4B":"15.5","5B":"15.6","6B":"16.1","7B":"16.2","8B":"16.3","9B":"16.4",AC:"11.5",BC:"4.2-4.3",CC:"5.5",DC:"2",EC:"3.5",FC:"3.6",GC:"113",HC:"3.1",IC:"5.1",JC:"6.1",KC:"7.1",LC:"9.1",MC:"14.1",NC:"15.1",OC:"TP",PC:"9.5-9.6",QC:"10.0-10.1",RC:"10.5",SC:"10.6",TC:"11.6",UC:"4.0-4.1",VC:"5.0-5.1",WC:"6.0-6.1",XC:"7.0-7.1",YC:"8.1-8.4",ZC:"9.0-9.2",aC:"9.3",bC:"10.0-10.2",cC:"10.3",dC:"11.0-11.2",eC:"11.3-11.4",fC:"12.0-12.1",gC:"12.2-12.5",hC:"13.0-13.1",iC:"13.2",jC:"13.3",kC:"13.4-13.7",lC:"14.0-14.4",mC:"14.5-14.8",nC:"15.0-15.1",oC:"all",pC:"2.1",qC:"2.2",rC:"2.3",sC:"4.1",tC:"4.4",uC:"4.4.3-4.4.4",vC:"13.4",wC:"5.0-5.4",xC:"6.2-6.4",yC:"7.2-7.4",zC:"8.2","0C":"9.2","1C":"11.1-11.2","2C":"12.0","3C":"13.0","4C":"14.0","5C":"15.0","6C":"17.0","7C":"18.0","8C":"19.0","9C":"13.18",AD:"2.5",BD:"3.0-3.1"};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
||||
export default class WeakableMap<K, V> {
|
||||
weakMap: WeakMap<Record<string, unknown>, V>;
|
||||
map: Map<K, V>;
|
||||
constructor();
|
||||
set(key: K, value: V): void;
|
||||
get(key: K): V | undefined;
|
||||
has(key: K): boolean;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('sortedLastIndexBy', require('../sortedLastIndexBy'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -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":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"DC tB I v J D E F A B C K L EC FC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB 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"},E:{"1":"J D E F A B C K L G IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v HC zB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e TC rB","2":"F B PC QC RC SC qB AC"},G:{"1":"E VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","16":"zB UC BC"},H:{"1":"oC"},I:{"1":"f tC uC","16":"tB I pC qC rC sC BC"},J:{"16":"D A"},K:{"1":"C h rB","2":"A B qB AC"},L:{"1":"H"},M:{"1":"H"},N:{"2":"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":"AD BD"}},B:4,C:"SVG vector-effect: non-scaling-stroke"};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
require('../auto');
|
||||
|
||||
var test = require('tape');
|
||||
|
||||
var runTests = require('./builtin');
|
||||
|
||||
test('shimmed', function (t) {
|
||||
runTests(t);
|
||||
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1,95 @@
|
||||
# [Apache License 2.0](https://spdx.org/licenses/Apache-2.0)
|
||||
|
||||
Copyright 2018 Renée Kooi <renee@kooi.me>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
> http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
## acorn-bigint
|
||||
|
||||
The code in the `lib/bigint` folder is compiled from code licensed as MIT:
|
||||
|
||||
> Copyright (C) 2017-2018 by Adrian Heine
|
||||
>
|
||||
> 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.
|
||||
|
||||
Find the source code at https://github.com/acornjs/acorn-bigint.
|
||||
|
||||
## acorn-import-meta
|
||||
|
||||
The code in the `lib/import-meta` folder is compiled from code licensed as MIT:
|
||||
|
||||
> Copyright (C) 2017-2018 by Adrian Heine
|
||||
>
|
||||
> 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.
|
||||
|
||||
Find the source code at https://github.com/acornjs/acorn-import-meta.
|
||||
|
||||
## acorn-dynamic-import
|
||||
|
||||
The code in the `lib/dynamic-import` folder is licensed as MIT:
|
||||
|
||||
> MIT License
|
||||
>
|
||||
> Copyright (c) 2016 Jordan Gensler
|
||||
>
|
||||
> 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.
|
||||
|
||||
Find the source code at https://github.com/kesne/acorn-dynamic-import.
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('sortedIndex', require('../sortedIndex'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","33":"I v J D E F A B C K L G M N O EC FC","164":"DC tB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"1":"I v J D E F A B C K L G zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","16":"HC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"F B C PC QC RC SC qB AC TC rB"},G:{"1":"E UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","16":"zB"},H:{"2":"oC"},I:{"1":"tB I f rC sC BC tC uC","16":"pC qC"},J:{"1":"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":"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":"AD BD"}},B:4,C:"CSS initial value"};
|
||||
@@ -0,0 +1,120 @@
|
||||
var minus = "-".charCodeAt(0);
|
||||
var plus = "+".charCodeAt(0);
|
||||
var dot = ".".charCodeAt(0);
|
||||
var exp = "e".charCodeAt(0);
|
||||
var EXP = "E".charCodeAt(0);
|
||||
|
||||
// Check if three code points would start a number
|
||||
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
|
||||
function likeNumber(value) {
|
||||
var code = value.charCodeAt(0);
|
||||
var nextCode;
|
||||
|
||||
if (code === plus || code === minus) {
|
||||
nextCode = value.charCodeAt(1);
|
||||
|
||||
if (nextCode >= 48 && nextCode <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var nextNextCode = value.charCodeAt(2);
|
||||
|
||||
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (code === dot) {
|
||||
nextCode = value.charCodeAt(1);
|
||||
|
||||
if (nextCode >= 48 && nextCode <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (code >= 48 && code <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Consume a number
|
||||
// https://www.w3.org/TR/css-syntax-3/#consume-number
|
||||
module.exports = function(value) {
|
||||
var pos = 0;
|
||||
var length = value.length;
|
||||
var code;
|
||||
var nextCode;
|
||||
var nextNextCode;
|
||||
|
||||
if (length === 0 || !likeNumber(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code === plus || code === minus) {
|
||||
pos++;
|
||||
}
|
||||
|
||||
while (pos < length) {
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code < 48 || code > 57) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos += 1;
|
||||
}
|
||||
|
||||
code = value.charCodeAt(pos);
|
||||
nextCode = value.charCodeAt(pos + 1);
|
||||
|
||||
if (code === dot && nextCode >= 48 && nextCode <= 57) {
|
||||
pos += 2;
|
||||
|
||||
while (pos < length) {
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code < 48 || code > 57) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos += 1;
|
||||
}
|
||||
}
|
||||
|
||||
code = value.charCodeAt(pos);
|
||||
nextCode = value.charCodeAt(pos + 1);
|
||||
nextNextCode = value.charCodeAt(pos + 2);
|
||||
|
||||
if (
|
||||
(code === exp || code === EXP) &&
|
||||
((nextCode >= 48 && nextCode <= 57) ||
|
||||
((nextCode === plus || nextCode === minus) &&
|
||||
nextNextCode >= 48 &&
|
||||
nextNextCode <= 57))
|
||||
) {
|
||||
pos += nextCode === plus || nextCode === minus ? 3 : 2;
|
||||
|
||||
while (pos < length) {
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code < 48 || code > 57) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
number: value.slice(0, pos),
|
||||
unit: value.slice(pos)
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _utils = require('../utils');
|
||||
|
||||
exports['default'] = function (instance) {
|
||||
instance.registerDecorator('inline', function (fn, props, container, options) {
|
||||
var ret = fn;
|
||||
if (!props.partials) {
|
||||
props.partials = {};
|
||||
ret = function (context, options) {
|
||||
// Create a new partials stack frame prior to exec.
|
||||
var original = container.partials;
|
||||
container.partials = _utils.extend({}, original, props.partials);
|
||||
var ret = fn(context, options);
|
||||
container.partials = original;
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
|
||||
props.partials[options.args[0]] = options.fn;
|
||||
|
||||
return ret;
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = exports['default'];
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2RlY29yYXRvcnMvaW5saW5lLmpzIl0sIm5hbWVzIjpbXSwibWFw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NvcmF0b3IoJ2lubGluZScsIGZ1bmN0aW9uKGZuLCBwcm9wcywgY29udGFpbmVyLCBvcHRpb25zKSB7XG4gICAgbGV0IHJldCA9IGZuO1xuICAgIGlmICghcHJvcHMucGFydGlhbHMpIHtcbiAgICAgIHByb3BzLnBhcnRpYWxzID0ge307XG4gICAgICByZXQgPSBmdW5jdGlvbihjb250ZXh0LCBvcHRpb25zKSB7XG4gICAgICAgIC8vIENyZWF0ZSBhIG5ldyBwYXJ0aWFscyBzdGFjayBmcmFtZSBwcmlvciB0byBleGVjLlxuICAgICAgICBsZXQgb3JpZ2luYWwgPSBjb250YWluZXIucGFydGlhbHM7XG4gICAgICAgIGNvbnRhaW5lci5wYXJ0aWFscyA9IGV4dGVuZCh7fSwgb3JpZ2luYWwsIHByb3BzLnBhcnRpYWxzKTtcbiAgICAgICAgbGV0IHJldCA9IGZuKGNvbnRleHQsIG9wdGlvbnMpO1xuICAgICAgICBjb250YWluZXIucGFydGlhbHMgPSBvcmlnaW5hbDtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgIH07XG4gICAgfVxuXG4gICAgcHJvcHMucGFydGlhbHNbb3B0aW9ucy5hcmdzWzBdXSA9IG9wdGlvbnMuZm47XG5cbiAgICByZXR1cm4gcmV0O1xuICB9KTtcbn1cbiJdfQ==
|
||||
@@ -0,0 +1,57 @@
|
||||
import Container, { ContainerProps } from './container.js'
|
||||
import { ProcessOptions } from './postcss.js'
|
||||
import Result from './result.js'
|
||||
import Root, { RootProps } from './root.js'
|
||||
|
||||
export interface DocumentProps extends ContainerProps {
|
||||
nodes?: Root[]
|
||||
|
||||
/**
|
||||
* Information to generate byte-to-byte equal node string as it was
|
||||
* in the origin input.
|
||||
*
|
||||
* Every parser saves its own properties.
|
||||
*/
|
||||
raws?: Record<string, any>
|
||||
}
|
||||
|
||||
type ChildNode = Root
|
||||
type ChildProps = RootProps
|
||||
|
||||
/**
|
||||
* Represents a file and contains all its parsed nodes.
|
||||
*
|
||||
* **Experimental:** some aspects of this node could change within minor
|
||||
* or patch version releases.
|
||||
*
|
||||
* ```js
|
||||
* const document = htmlParser(
|
||||
* '<html><style>a{color:black}</style><style>b{z-index:2}</style>'
|
||||
* )
|
||||
* document.type //=> 'document'
|
||||
* document.nodes.length //=> 2
|
||||
* ```
|
||||
*/
|
||||
export default class Document extends Container<Root> {
|
||||
type: 'document'
|
||||
parent: undefined
|
||||
|
||||
constructor(defaults?: DocumentProps)
|
||||
|
||||
/**
|
||||
* Returns a `Result` instance representing the document’s CSS roots.
|
||||
*
|
||||
* ```js
|
||||
* const root1 = postcss.parse(css1, { from: 'a.css' })
|
||||
* const root2 = postcss.parse(css2, { from: 'b.css' })
|
||||
* const document = postcss.document()
|
||||
* document.append(root1)
|
||||
* document.append(root2)
|
||||
* const result = document.toResult({ to: 'all.css', map: true })
|
||||
* ```
|
||||
*
|
||||
* @param opts Options.
|
||||
* @return Result with current document’s CSS.
|
||||
*/
|
||||
toResult(options?: ProcessOptions): Result
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { Observable } from '../Observable';
|
||||
import { Subject } from '../Subject';
|
||||
import { ObservableInput, OperatorFunction } from '../types';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
import { innerFrom } from '../observable/innerFrom';
|
||||
|
||||
/**
|
||||
* Branch out the source Observable values as a nested Observable using a
|
||||
* factory function of closing Observables to determine when to start a new
|
||||
* window.
|
||||
*
|
||||
* <span class="informal">It's like {@link bufferWhen}, but emits a nested
|
||||
* Observable instead of an array.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* 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 Observable
|
||||
* produced by the specified `closingSelector` function emits an item. The first
|
||||
* window is opened immediately when subscribing to the output Observable.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Emit only the first two clicks events in every window of [1-5] random seconds
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, windowWhen, interval, map, take, mergeAll } from 'rxjs';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const result = clicks.pipe(
|
||||
* windowWhen(() => interval(1000 + Math.random() * 4000)),
|
||||
* 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 window}
|
||||
* @see {@link windowCount}
|
||||
* @see {@link windowTime}
|
||||
* @see {@link windowToggle}
|
||||
* @see {@link bufferWhen}
|
||||
*
|
||||
* @param {function(): Observable} closingSelector A function that takes no
|
||||
* arguments and returns an Observable that signals (on either `next` or
|
||||
* `complete`) when to close the previous window and start a new one.
|
||||
* @return A function that returns an Observable of windows, which in turn are
|
||||
* Observables.
|
||||
*/
|
||||
export function windowWhen<T>(closingSelector: () => ObservableInput<any>): OperatorFunction<T, Observable<T>> {
|
||||
return operate((source, subscriber) => {
|
||||
let window: Subject<T> | null;
|
||||
let closingSubscriber: Subscriber<any> | undefined;
|
||||
|
||||
/**
|
||||
* When we get an error, we have to notify both the
|
||||
* destination subscriber and the window.
|
||||
*/
|
||||
const handleError = (err: any) => {
|
||||
window!.error(err);
|
||||
subscriber.error(err);
|
||||
};
|
||||
|
||||
/**
|
||||
* Called every time we need to open a window.
|
||||
* Recursive, as it will start the closing notifier, which
|
||||
* inevitably *should* call openWindow -- but may not if
|
||||
* it is a "never" observable.
|
||||
*/
|
||||
const openWindow = () => {
|
||||
// We need to clean up our closing subscription,
|
||||
// we only cared about the first next or complete notification.
|
||||
closingSubscriber?.unsubscribe();
|
||||
|
||||
// Close our window before starting a new one.
|
||||
window?.complete();
|
||||
|
||||
// Start the new window.
|
||||
window = new Subject<T>();
|
||||
subscriber.next(window.asObservable());
|
||||
|
||||
// Get our closing notifier.
|
||||
let closingNotifier: Observable<any>;
|
||||
try {
|
||||
closingNotifier = innerFrom(closingSelector());
|
||||
} catch (err) {
|
||||
handleError(err);
|
||||
return;
|
||||
}
|
||||
|
||||
// Subscribe to the closing notifier, be sure
|
||||
// to capture the subscriber (aka Subscription)
|
||||
// so we can clean it up when we close the window
|
||||
// and open a new one.
|
||||
closingNotifier.subscribe((closingSubscriber = createOperatorSubscriber(subscriber, openWindow, openWindow, handleError)));
|
||||
};
|
||||
|
||||
// Start the first window.
|
||||
openWindow();
|
||||
|
||||
// Subscribe to the source
|
||||
source.subscribe(
|
||||
createOperatorSubscriber(
|
||||
subscriber,
|
||||
(value) => window!.next(value),
|
||||
() => {
|
||||
// The source completed, close the window and complete.
|
||||
window!.complete();
|
||||
subscriber.complete();
|
||||
},
|
||||
handleError,
|
||||
() => {
|
||||
// Be sure to clean up our closing subscription
|
||||
// when this tears down.
|
||||
closingSubscriber?.unsubscribe();
|
||||
window = null!;
|
||||
}
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/// <reference types="node" />
|
||||
import { Readable } from 'stream';
|
||||
import { UrlWithStringQuery } from 'url';
|
||||
import { Stats, createReadStream } from 'fs';
|
||||
import { GetUriOptions } from '.';
|
||||
declare type ReadStreamOptions = Exclude<Parameters<typeof createReadStream>[1], string>;
|
||||
interface FileReadable extends Readable {
|
||||
stat?: Stats;
|
||||
}
|
||||
declare type FileOptions = GetUriOptions & ReadStreamOptions & {
|
||||
cache?: FileReadable;
|
||||
};
|
||||
/**
|
||||
* Returns a `fs.ReadStream` instance from a "file:" URI.
|
||||
*/
|
||||
export default function get({ href: uri }: UrlWithStringQuery, opts: FileOptions): Promise<Readable>;
|
||||
export {};
|
||||
@@ -0,0 +1,170 @@
|
||||
'use strict';
|
||||
|
||||
const stringify = require('./lib/stringify');
|
||||
const compile = require('./lib/compile');
|
||||
const expand = require('./lib/expand');
|
||||
const parse = require('./lib/parse');
|
||||
|
||||
/**
|
||||
* Expand the given pattern or create a regex-compatible string.
|
||||
*
|
||||
* ```js
|
||||
* const braces = require('braces');
|
||||
* console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
|
||||
* console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
|
||||
* ```
|
||||
* @param {String} `str`
|
||||
* @param {Object} `options`
|
||||
* @return {String}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
const braces = (input, options = {}) => {
|
||||
let output = [];
|
||||
|
||||
if (Array.isArray(input)) {
|
||||
for (let pattern of input) {
|
||||
let result = braces.create(pattern, options);
|
||||
if (Array.isArray(result)) {
|
||||
output.push(...result);
|
||||
} else {
|
||||
output.push(result);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
output = [].concat(braces.create(input, options));
|
||||
}
|
||||
|
||||
if (options && options.expand === true && options.nodupes === true) {
|
||||
output = [...new Set(output)];
|
||||
}
|
||||
return output;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse the given `str` with the given `options`.
|
||||
*
|
||||
* ```js
|
||||
* // braces.parse(pattern, [, options]);
|
||||
* const ast = braces.parse('a/{b,c}/d');
|
||||
* console.log(ast);
|
||||
* ```
|
||||
* @param {String} pattern Brace pattern to parse
|
||||
* @param {Object} options
|
||||
* @return {Object} Returns an AST
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.parse = (input, options = {}) => parse(input, options);
|
||||
|
||||
/**
|
||||
* Creates a braces string from an AST, or an AST node.
|
||||
*
|
||||
* ```js
|
||||
* const braces = require('braces');
|
||||
* let ast = braces.parse('foo/{a,b}/bar');
|
||||
* console.log(stringify(ast.nodes[2])); //=> '{a,b}'
|
||||
* ```
|
||||
* @param {String} `input` Brace pattern or AST.
|
||||
* @param {Object} `options`
|
||||
* @return {Array} Returns an array of expanded values.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.stringify = (input, options = {}) => {
|
||||
if (typeof input === 'string') {
|
||||
return stringify(braces.parse(input, options), options);
|
||||
}
|
||||
return stringify(input, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Compiles a brace pattern into a regex-compatible, optimized string.
|
||||
* This method is called by the main [braces](#braces) function by default.
|
||||
*
|
||||
* ```js
|
||||
* const braces = require('braces');
|
||||
* console.log(braces.compile('a/{b,c}/d'));
|
||||
* //=> ['a/(b|c)/d']
|
||||
* ```
|
||||
* @param {String} `input` Brace pattern or AST.
|
||||
* @param {Object} `options`
|
||||
* @return {Array} Returns an array of expanded values.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.compile = (input, options = {}) => {
|
||||
if (typeof input === 'string') {
|
||||
input = braces.parse(input, options);
|
||||
}
|
||||
return compile(input, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Expands a brace pattern into an array. This method is called by the
|
||||
* main [braces](#braces) function when `options.expand` is true. Before
|
||||
* using this method it's recommended that you read the [performance notes](#performance))
|
||||
* and advantages of using [.compile](#compile) instead.
|
||||
*
|
||||
* ```js
|
||||
* const braces = require('braces');
|
||||
* console.log(braces.expand('a/{b,c}/d'));
|
||||
* //=> ['a/b/d', 'a/c/d'];
|
||||
* ```
|
||||
* @param {String} `pattern` Brace pattern
|
||||
* @param {Object} `options`
|
||||
* @return {Array} Returns an array of expanded values.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.expand = (input, options = {}) => {
|
||||
if (typeof input === 'string') {
|
||||
input = braces.parse(input, options);
|
||||
}
|
||||
|
||||
let result = expand(input, options);
|
||||
|
||||
// filter out empty strings if specified
|
||||
if (options.noempty === true) {
|
||||
result = result.filter(Boolean);
|
||||
}
|
||||
|
||||
// filter out duplicates if specified
|
||||
if (options.nodupes === true) {
|
||||
result = [...new Set(result)];
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Processes a brace pattern and returns either an expanded array
|
||||
* (if `options.expand` is true), a highly optimized regex-compatible string.
|
||||
* This method is called by the main [braces](#braces) function.
|
||||
*
|
||||
* ```js
|
||||
* const braces = require('braces');
|
||||
* console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
|
||||
* //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
|
||||
* ```
|
||||
* @param {String} `pattern` Brace pattern
|
||||
* @param {Object} `options`
|
||||
* @return {Array} Returns an array of expanded values.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.create = (input, options = {}) => {
|
||||
if (input === '' || input.length < 3) {
|
||||
return [input];
|
||||
}
|
||||
|
||||
return options.expand !== true
|
||||
? braces.compile(input, options)
|
||||
: braces.expand(input, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Expose "braces"
|
||||
*/
|
||||
|
||||
module.exports = braces;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,424 @@
|
||||
/**
|
||||
* The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that
|
||||
* is available both as a standalone program or includible in other applications.
|
||||
* It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('repl');
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/repl.js)
|
||||
*/
|
||||
declare module 'repl' {
|
||||
import { Interface, Completer, AsyncCompleter } from 'node:readline';
|
||||
import { Context } from 'node:vm';
|
||||
import { InspectOptions } from 'node:util';
|
||||
interface ReplOptions {
|
||||
/**
|
||||
* The input prompt to display.
|
||||
* @default "> "
|
||||
*/
|
||||
prompt?: string | undefined;
|
||||
/**
|
||||
* The `Readable` stream from which REPL input will be read.
|
||||
* @default process.stdin
|
||||
*/
|
||||
input?: NodeJS.ReadableStream | undefined;
|
||||
/**
|
||||
* The `Writable` stream to which REPL output will be written.
|
||||
* @default process.stdout
|
||||
*/
|
||||
output?: NodeJS.WritableStream | undefined;
|
||||
/**
|
||||
* If `true`, specifies that the output should be treated as a TTY terminal, and have
|
||||
* ANSI/VT100 escape codes written to it.
|
||||
* Default: checking the value of the `isTTY` property on the output stream upon
|
||||
* instantiation.
|
||||
*/
|
||||
terminal?: boolean | undefined;
|
||||
/**
|
||||
* The function to be used when evaluating each given line of input.
|
||||
* Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can
|
||||
* error with `repl.Recoverable` to indicate the input was incomplete and prompt for
|
||||
* additional lines.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions
|
||||
*/
|
||||
eval?: REPLEval | undefined;
|
||||
/**
|
||||
* Defines if the repl prints output previews or not.
|
||||
* @default `true` Always `false` in case `terminal` is falsy.
|
||||
*/
|
||||
preview?: boolean | undefined;
|
||||
/**
|
||||
* If `true`, specifies that the default `writer` function should include ANSI color
|
||||
* styling to REPL output. If a custom `writer` function is provided then this has no
|
||||
* effect.
|
||||
* Default: the REPL instance's `terminal` value.
|
||||
*/
|
||||
useColors?: boolean | undefined;
|
||||
/**
|
||||
* If `true`, specifies that the default evaluation function will use the JavaScript
|
||||
* `global` as the context as opposed to creating a new separate context for the REPL
|
||||
* instance. The node CLI REPL sets this value to `true`.
|
||||
* Default: `false`.
|
||||
*/
|
||||
useGlobal?: boolean | undefined;
|
||||
/**
|
||||
* If `true`, specifies that the default writer will not output the return value of a
|
||||
* command if it evaluates to `undefined`.
|
||||
* Default: `false`.
|
||||
*/
|
||||
ignoreUndefined?: boolean | undefined;
|
||||
/**
|
||||
* The function to invoke to format the output of each command before writing to `output`.
|
||||
* Default: a wrapper for `util.inspect`.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output
|
||||
*/
|
||||
writer?: REPLWriter | undefined;
|
||||
/**
|
||||
* An optional function used for custom Tab auto completion.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function
|
||||
*/
|
||||
completer?: Completer | AsyncCompleter | undefined;
|
||||
/**
|
||||
* A flag that specifies whether the default evaluator executes all JavaScript commands in
|
||||
* strict mode or default (sloppy) mode.
|
||||
* Accepted values are:
|
||||
* - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
|
||||
* - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
|
||||
* prefacing every repl statement with `'use strict'`.
|
||||
*/
|
||||
replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined;
|
||||
/**
|
||||
* Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is
|
||||
* pressed. This cannot be used together with a custom `eval` function.
|
||||
* Default: `false`.
|
||||
*/
|
||||
breakEvalOnSigint?: boolean | undefined;
|
||||
}
|
||||
type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
|
||||
type REPLWriter = (this: REPLServer, obj: any) => string;
|
||||
/**
|
||||
* This is the default "writer" value, if none is passed in the REPL options,
|
||||
* and it can be overridden by custom print functions.
|
||||
*/
|
||||
const writer: REPLWriter & {
|
||||
options: InspectOptions;
|
||||
};
|
||||
type REPLCommandAction = (this: REPLServer, text: string) => void;
|
||||
interface REPLCommand {
|
||||
/**
|
||||
* Help text to be displayed when `.help` is entered.
|
||||
*/
|
||||
help?: string | undefined;
|
||||
/**
|
||||
* The function to execute, optionally accepting a single string argument.
|
||||
*/
|
||||
action: REPLCommandAction;
|
||||
}
|
||||
/**
|
||||
* Instances of `repl.REPLServer` are created using the {@link start} method
|
||||
* or directly using the JavaScript `new` keyword.
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('repl');
|
||||
*
|
||||
* const options = { useColors: true };
|
||||
*
|
||||
* const firstInstance = repl.start(options);
|
||||
* const secondInstance = new repl.REPLServer(options);
|
||||
* ```
|
||||
* @since v0.1.91
|
||||
*/
|
||||
class REPLServer extends Interface {
|
||||
/**
|
||||
* The `vm.Context` provided to the `eval` function to be used for JavaScript
|
||||
* evaluation.
|
||||
*/
|
||||
readonly context: Context;
|
||||
/**
|
||||
* @deprecated since v14.3.0 - Use `input` instead.
|
||||
*/
|
||||
readonly inputStream: NodeJS.ReadableStream;
|
||||
/**
|
||||
* @deprecated since v14.3.0 - Use `output` instead.
|
||||
*/
|
||||
readonly outputStream: NodeJS.WritableStream;
|
||||
/**
|
||||
* The `Readable` stream from which REPL input will be read.
|
||||
*/
|
||||
readonly input: NodeJS.ReadableStream;
|
||||
/**
|
||||
* The `Writable` stream to which REPL output will be written.
|
||||
*/
|
||||
readonly output: NodeJS.WritableStream;
|
||||
/**
|
||||
* The commands registered via `replServer.defineCommand()`.
|
||||
*/
|
||||
readonly commands: NodeJS.ReadOnlyDict<REPLCommand>;
|
||||
/**
|
||||
* A value indicating whether the REPL is currently in "editor mode".
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys
|
||||
*/
|
||||
readonly editorMode: boolean;
|
||||
/**
|
||||
* A value indicating whether the `_` variable has been assigned.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
*/
|
||||
readonly underscoreAssigned: boolean;
|
||||
/**
|
||||
* The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
*/
|
||||
readonly last: any;
|
||||
/**
|
||||
* A value indicating whether the `_error` variable has been assigned.
|
||||
*
|
||||
* @since v9.8.0
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
*/
|
||||
readonly underscoreErrAssigned: boolean;
|
||||
/**
|
||||
* The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
|
||||
*
|
||||
* @since v9.8.0
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
*/
|
||||
readonly lastError: any;
|
||||
/**
|
||||
* Specified in the REPL options, this is the function to be used when evaluating each
|
||||
* given line of input. If not specified in the REPL options, this is an async wrapper
|
||||
* for the JavaScript `eval()` function.
|
||||
*/
|
||||
readonly eval: REPLEval;
|
||||
/**
|
||||
* Specified in the REPL options, this is a value indicating whether the default
|
||||
* `writer` function should include ANSI color styling to REPL output.
|
||||
*/
|
||||
readonly useColors: boolean;
|
||||
/**
|
||||
* Specified in the REPL options, this is a value indicating whether the default `eval`
|
||||
* function will use the JavaScript `global` as the context as opposed to creating a new
|
||||
* separate context for the REPL instance.
|
||||
*/
|
||||
readonly useGlobal: boolean;
|
||||
/**
|
||||
* Specified in the REPL options, this is a value indicating whether the default `writer`
|
||||
* function should output the result of a command if it evaluates to `undefined`.
|
||||
*/
|
||||
readonly ignoreUndefined: boolean;
|
||||
/**
|
||||
* Specified in the REPL options, this is the function to invoke to format the output of
|
||||
* each command before writing to `outputStream`. If not specified in the REPL options,
|
||||
* this will be a wrapper for `util.inspect`.
|
||||
*/
|
||||
readonly writer: REPLWriter;
|
||||
/**
|
||||
* Specified in the REPL options, this is the function to use for custom Tab auto-completion.
|
||||
*/
|
||||
readonly completer: Completer | AsyncCompleter;
|
||||
/**
|
||||
* Specified in the REPL options, this is a flag that specifies whether the default `eval`
|
||||
* function should execute all JavaScript commands in strict mode or default (sloppy) mode.
|
||||
* Possible values are:
|
||||
* - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
|
||||
* - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
|
||||
* prefacing every repl statement with `'use strict'`.
|
||||
*/
|
||||
readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
|
||||
/**
|
||||
* NOTE: According to the documentation:
|
||||
*
|
||||
* > Instances of `repl.REPLServer` are created using the `repl.start()` method and
|
||||
* > _should not_ be created directly using the JavaScript `new` keyword.
|
||||
*
|
||||
* `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver
|
||||
*/
|
||||
private constructor();
|
||||
/**
|
||||
* The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands
|
||||
* to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following
|
||||
* properties:
|
||||
*
|
||||
* The following example shows two new commands added to the REPL instance:
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('repl');
|
||||
*
|
||||
* const replServer = repl.start({ prompt: '> ' });
|
||||
* replServer.defineCommand('sayhello', {
|
||||
* help: 'Say hello',
|
||||
* action(name) {
|
||||
* this.clearBufferedCommand();
|
||||
* console.log(`Hello, ${name}!`);
|
||||
* this.displayPrompt();
|
||||
* }
|
||||
* });
|
||||
* replServer.defineCommand('saybye', function saybye() {
|
||||
* console.log('Goodbye!');
|
||||
* this.close();
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* The new commands can then be used from within the REPL instance:
|
||||
*
|
||||
* ```console
|
||||
* > .sayhello Node.js User
|
||||
* Hello, Node.js User!
|
||||
* > .saybye
|
||||
* Goodbye!
|
||||
* ```
|
||||
* @since v0.3.0
|
||||
* @param keyword The command keyword (_without_ a leading `.` character).
|
||||
* @param cmd The function to invoke when the command is processed.
|
||||
*/
|
||||
defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void;
|
||||
/**
|
||||
* The `replServer.displayPrompt()` method readies the REPL instance for input
|
||||
* from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input.
|
||||
*
|
||||
* When multi-line input is being entered, an ellipsis is printed rather than the
|
||||
* 'prompt'.
|
||||
*
|
||||
* When `preserveCursor` is `true`, the cursor placement will not be reset to `0`.
|
||||
*
|
||||
* The `replServer.displayPrompt` method is primarily intended to be called from
|
||||
* within the action function for commands registered using the`replServer.defineCommand()` method.
|
||||
* @since v0.1.91
|
||||
*/
|
||||
displayPrompt(preserveCursor?: boolean): void;
|
||||
/**
|
||||
* The `replServer.clearBufferedCommand()` method clears any command that has been
|
||||
* buffered but not yet executed. This method is primarily intended to be
|
||||
* called from within the action function for commands registered using the`replServer.defineCommand()` method.
|
||||
* @since v9.0.0
|
||||
*/
|
||||
clearBufferedCommand(): void;
|
||||
/**
|
||||
* Initializes a history log file for the REPL instance. When executing the
|
||||
* Node.js binary and using the command-line REPL, a history file is initialized
|
||||
* by default. However, this is not the case when creating a REPL
|
||||
* programmatically. Use this method to initialize a history log file when working
|
||||
* with REPL instances programmatically.
|
||||
* @since v11.10.0
|
||||
* @param historyPath the path to the history file
|
||||
* @param callback called when history writes are ready or upon error
|
||||
*/
|
||||
setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void;
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. close - inherited from `readline.Interface`
|
||||
* 2. line - inherited from `readline.Interface`
|
||||
* 3. pause - inherited from `readline.Interface`
|
||||
* 4. resume - inherited from `readline.Interface`
|
||||
* 5. SIGCONT - inherited from `readline.Interface`
|
||||
* 6. SIGINT - inherited from `readline.Interface`
|
||||
* 7. SIGTSTP - inherited from `readline.Interface`
|
||||
* 8. exit
|
||||
* 9. reset
|
||||
*/
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: 'close', listener: () => void): this;
|
||||
addListener(event: 'line', listener: (input: string) => void): this;
|
||||
addListener(event: 'pause', listener: () => void): this;
|
||||
addListener(event: 'resume', listener: () => void): this;
|
||||
addListener(event: 'SIGCONT', listener: () => void): this;
|
||||
addListener(event: 'SIGINT', listener: () => void): this;
|
||||
addListener(event: 'SIGTSTP', listener: () => void): this;
|
||||
addListener(event: 'exit', listener: () => void): this;
|
||||
addListener(event: 'reset', listener: (context: Context) => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: 'close'): boolean;
|
||||
emit(event: 'line', input: string): boolean;
|
||||
emit(event: 'pause'): boolean;
|
||||
emit(event: 'resume'): boolean;
|
||||
emit(event: 'SIGCONT'): boolean;
|
||||
emit(event: 'SIGINT'): boolean;
|
||||
emit(event: 'SIGTSTP'): boolean;
|
||||
emit(event: 'exit'): boolean;
|
||||
emit(event: 'reset', context: Context): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: 'close', listener: () => void): this;
|
||||
on(event: 'line', listener: (input: string) => void): this;
|
||||
on(event: 'pause', listener: () => void): this;
|
||||
on(event: 'resume', listener: () => void): this;
|
||||
on(event: 'SIGCONT', listener: () => void): this;
|
||||
on(event: 'SIGINT', listener: () => void): this;
|
||||
on(event: 'SIGTSTP', listener: () => void): this;
|
||||
on(event: 'exit', listener: () => void): this;
|
||||
on(event: 'reset', listener: (context: Context) => void): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: 'close', listener: () => void): this;
|
||||
once(event: 'line', listener: (input: string) => void): this;
|
||||
once(event: 'pause', listener: () => void): this;
|
||||
once(event: 'resume', listener: () => void): this;
|
||||
once(event: 'SIGCONT', listener: () => void): this;
|
||||
once(event: 'SIGINT', listener: () => void): this;
|
||||
once(event: 'SIGTSTP', listener: () => void): this;
|
||||
once(event: 'exit', listener: () => void): this;
|
||||
once(event: 'reset', listener: (context: Context) => void): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: 'close', listener: () => void): this;
|
||||
prependListener(event: 'line', listener: (input: string) => void): this;
|
||||
prependListener(event: 'pause', listener: () => void): this;
|
||||
prependListener(event: 'resume', listener: () => void): this;
|
||||
prependListener(event: 'SIGCONT', listener: () => void): this;
|
||||
prependListener(event: 'SIGINT', listener: () => void): this;
|
||||
prependListener(event: 'SIGTSTP', listener: () => void): this;
|
||||
prependListener(event: 'exit', listener: () => void): this;
|
||||
prependListener(event: 'reset', listener: (context: Context) => void): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: 'close', listener: () => void): this;
|
||||
prependOnceListener(event: 'line', listener: (input: string) => void): this;
|
||||
prependOnceListener(event: 'pause', listener: () => void): this;
|
||||
prependOnceListener(event: 'resume', listener: () => void): this;
|
||||
prependOnceListener(event: 'SIGCONT', listener: () => void): this;
|
||||
prependOnceListener(event: 'SIGINT', listener: () => void): this;
|
||||
prependOnceListener(event: 'SIGTSTP', listener: () => void): this;
|
||||
prependOnceListener(event: 'exit', listener: () => void): this;
|
||||
prependOnceListener(event: 'reset', listener: (context: Context) => void): this;
|
||||
}
|
||||
/**
|
||||
* A flag passed in the REPL options. Evaluates expressions in sloppy mode.
|
||||
*/
|
||||
const REPL_MODE_SLOPPY: unique symbol;
|
||||
/**
|
||||
* A flag passed in the REPL options. Evaluates expressions in strict mode.
|
||||
* This is equivalent to prefacing every repl statement with `'use strict'`.
|
||||
*/
|
||||
const REPL_MODE_STRICT: unique symbol;
|
||||
/**
|
||||
* The `repl.start()` method creates and starts a {@link REPLServer} instance.
|
||||
*
|
||||
* If `options` is a string, then it specifies the input prompt:
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('repl');
|
||||
*
|
||||
* // a Unix style prompt
|
||||
* repl.start('$ ');
|
||||
* ```
|
||||
* @since v0.1.91
|
||||
*/
|
||||
function start(options?: string | ReplOptions): REPLServer;
|
||||
/**
|
||||
* Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors
|
||||
*/
|
||||
class Recoverable extends SyntaxError {
|
||||
err: Error;
|
||||
constructor(err: Error);
|
||||
}
|
||||
}
|
||||
declare module 'node:repl' {
|
||||
export * from 'repl';
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/icu-messageformat-parser/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAC,mBAAmB,EAAC,MAAM,+BAA+B,CAAA;AAEjE,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;I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ACD,wBAAgB,kBAAkB,CAChC,EAAE,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,QAAQ,GAC1D,EAAE,IAAI,gBAAgB,CAExB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAKlE;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,aAAa,CAMf"}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hoistSelectors = void 0;
|
||||
var tslib_1 = require("tslib");
|
||||
var types_1 = require("./types");
|
||||
function cloneDeep(obj) {
|
||||
if (Array.isArray(obj)) {
|
||||
// @ts-expect-error meh
|
||||
return (0, tslib_1.__spreadArray)([], obj.map(cloneDeep), true);
|
||||
}
|
||||
if (typeof obj === 'object') {
|
||||
// @ts-expect-error meh
|
||||
return Object.keys(obj).reduce(function (cloned, k) {
|
||||
// @ts-expect-error meh
|
||||
cloned[k] = cloneDeep(obj[k]);
|
||||
return cloned;
|
||||
}, {});
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
/**
|
||||
* Hoist all selectors to the beginning of the AST & flatten the
|
||||
* resulting options. E.g:
|
||||
* "I have {count, plural, one{a dog} other{many dogs}}"
|
||||
* becomes "{count, plural, one{I have a dog} other{I have many dogs}}".
|
||||
* If there are multiple selectors, the order of which one is hoisted 1st
|
||||
* is non-deterministic.
|
||||
* The goal is to provide as many full sentences as possible since fragmented
|
||||
* sentences are not translator-friendly
|
||||
* @param ast AST
|
||||
*/
|
||||
function hoistSelectors(ast) {
|
||||
var _loop_1 = function (i) {
|
||||
var el = ast[i];
|
||||
if ((0, types_1.isPluralElement)(el) || (0, types_1.isSelectElement)(el)) {
|
||||
// pull this out of the ast and move it to the top
|
||||
var cloned = cloneDeep(el);
|
||||
var options_1 = cloned.options;
|
||||
cloned.options = Object.keys(options_1).reduce(function (all, k) {
|
||||
var newValue = hoistSelectors((0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], ast.slice(0, i), true), options_1[k].value, true), ast.slice(i + 1), true));
|
||||
all[k] = {
|
||||
value: newValue,
|
||||
};
|
||||
return all;
|
||||
}, {});
|
||||
return { value: [cloned] };
|
||||
}
|
||||
};
|
||||
for (var i = 0; i < ast.length; i++) {
|
||||
var state_1 = _loop_1(i);
|
||||
if (typeof state_1 === "object")
|
||||
return state_1.value;
|
||||
}
|
||||
return ast;
|
||||
}
|
||||
exports.hoistSelectors = hoistSelectors;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').autoInject;
|
||||
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isHexColor;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;
|
||||
|
||||
function isHexColor(str) {
|
||||
(0, _assertString.default)(str);
|
||||
return hexcolor.test(str);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,204 @@
|
||||
# yallist
|
||||
|
||||
Yet Another Linked List
|
||||
|
||||
There are many doubly-linked list implementations like it, but this
|
||||
one is mine.
|
||||
|
||||
For when an array would be too big, and a Map can't be iterated in
|
||||
reverse order.
|
||||
|
||||
|
||||
[](https://travis-ci.org/isaacs/yallist) [](https://coveralls.io/github/isaacs/yallist)
|
||||
|
||||
## basic usage
|
||||
|
||||
```javascript
|
||||
var yallist = require('yallist')
|
||||
var myList = yallist.create([1, 2, 3])
|
||||
myList.push('foo')
|
||||
myList.unshift('bar')
|
||||
// of course pop() and shift() are there, too
|
||||
console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo']
|
||||
myList.forEach(function (k) {
|
||||
// walk the list head to tail
|
||||
})
|
||||
myList.forEachReverse(function (k, index, list) {
|
||||
// walk the list tail to head
|
||||
})
|
||||
var myDoubledList = myList.map(function (k) {
|
||||
return k + k
|
||||
})
|
||||
// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo']
|
||||
// mapReverse is also a thing
|
||||
var myDoubledListReverse = myList.mapReverse(function (k) {
|
||||
return k + k
|
||||
}) // ['foofoo', 6, 4, 2, 'barbar']
|
||||
|
||||
var reduced = myList.reduce(function (set, entry) {
|
||||
set += entry
|
||||
return set
|
||||
}, 'start')
|
||||
console.log(reduced) // 'startfoo123bar'
|
||||
```
|
||||
|
||||
## api
|
||||
|
||||
The whole API is considered "public".
|
||||
|
||||
Functions with the same name as an Array method work more or less the
|
||||
same way.
|
||||
|
||||
There's reverse versions of most things because that's the point.
|
||||
|
||||
### Yallist
|
||||
|
||||
Default export, the class that holds and manages a list.
|
||||
|
||||
Call it with either a forEach-able (like an array) or a set of
|
||||
arguments, to initialize the list.
|
||||
|
||||
The Array-ish methods all act like you'd expect. No magic length,
|
||||
though, so if you change that it won't automatically prune or add
|
||||
empty spots.
|
||||
|
||||
### Yallist.create(..)
|
||||
|
||||
Alias for Yallist function. Some people like factories.
|
||||
|
||||
#### yallist.head
|
||||
|
||||
The first node in the list
|
||||
|
||||
#### yallist.tail
|
||||
|
||||
The last node in the list
|
||||
|
||||
#### yallist.length
|
||||
|
||||
The number of nodes in the list. (Change this at your peril. It is
|
||||
not magic like Array length.)
|
||||
|
||||
#### yallist.toArray()
|
||||
|
||||
Convert the list to an array.
|
||||
|
||||
#### yallist.forEach(fn, [thisp])
|
||||
|
||||
Call a function on each item in the list.
|
||||
|
||||
#### yallist.forEachReverse(fn, [thisp])
|
||||
|
||||
Call a function on each item in the list, in reverse order.
|
||||
|
||||
#### yallist.get(n)
|
||||
|
||||
Get the data at position `n` in the list. If you use this a lot,
|
||||
probably better off just using an Array.
|
||||
|
||||
#### yallist.getReverse(n)
|
||||
|
||||
Get the data at position `n`, counting from the tail.
|
||||
|
||||
#### yallist.map(fn, thisp)
|
||||
|
||||
Create a new Yallist with the result of calling the function on each
|
||||
item.
|
||||
|
||||
#### yallist.mapReverse(fn, thisp)
|
||||
|
||||
Same as `map`, but in reverse.
|
||||
|
||||
#### yallist.pop()
|
||||
|
||||
Get the data from the list tail, and remove the tail from the list.
|
||||
|
||||
#### yallist.push(item, ...)
|
||||
|
||||
Insert one or more items to the tail of the list.
|
||||
|
||||
#### yallist.reduce(fn, initialValue)
|
||||
|
||||
Like Array.reduce.
|
||||
|
||||
#### yallist.reduceReverse
|
||||
|
||||
Like Array.reduce, but in reverse.
|
||||
|
||||
#### yallist.reverse
|
||||
|
||||
Reverse the list in place.
|
||||
|
||||
#### yallist.shift()
|
||||
|
||||
Get the data from the list head, and remove the head from the list.
|
||||
|
||||
#### yallist.slice([from], [to])
|
||||
|
||||
Just like Array.slice, but returns a new Yallist.
|
||||
|
||||
#### yallist.sliceReverse([from], [to])
|
||||
|
||||
Just like yallist.slice, but the result is returned in reverse.
|
||||
|
||||
#### yallist.toArray()
|
||||
|
||||
Create an array representation of the list.
|
||||
|
||||
#### yallist.toArrayReverse()
|
||||
|
||||
Create a reversed array representation of the list.
|
||||
|
||||
#### yallist.unshift(item, ...)
|
||||
|
||||
Insert one or more items to the head of the list.
|
||||
|
||||
#### yallist.unshiftNode(node)
|
||||
|
||||
Move a Node object to the front of the list. (That is, pull it out of
|
||||
wherever it lives, and make it the new head.)
|
||||
|
||||
If the node belongs to a different list, then that list will remove it
|
||||
first.
|
||||
|
||||
#### yallist.pushNode(node)
|
||||
|
||||
Move a Node object to the end of the list. (That is, pull it out of
|
||||
wherever it lives, and make it the new tail.)
|
||||
|
||||
If the node belongs to a list already, then that list will remove it
|
||||
first.
|
||||
|
||||
#### yallist.removeNode(node)
|
||||
|
||||
Remove a node from the list, preserving referential integrity of head
|
||||
and tail and other nodes.
|
||||
|
||||
Will throw an error if you try to have a list remove a node that
|
||||
doesn't belong to it.
|
||||
|
||||
### Yallist.Node
|
||||
|
||||
The class that holds the data and is actually the list.
|
||||
|
||||
Call with `var n = new Node(value, previousNode, nextNode)`
|
||||
|
||||
Note that if you do direct operations on Nodes themselves, it's very
|
||||
easy to get into weird states where the list is broken. Be careful :)
|
||||
|
||||
#### node.next
|
||||
|
||||
The next node in the list.
|
||||
|
||||
#### node.prev
|
||||
|
||||
The previous node in the list.
|
||||
|
||||
#### node.value
|
||||
|
||||
The data the node contains.
|
||||
|
||||
#### node.list
|
||||
|
||||
The list to which this node belongs. (Null if it does not belong to
|
||||
any list.)
|
||||
@@ -0,0 +1,84 @@
|
||||
export interface RunPathOptions {
|
||||
/**
|
||||
Working directory.
|
||||
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly cwd?: string | URL;
|
||||
|
||||
/**
|
||||
PATH to be appended. Default: [`PATH`](https://github.com/sindresorhus/path-key).
|
||||
|
||||
Set it to an empty string to exclude the default PATH.
|
||||
*/
|
||||
readonly path?: string;
|
||||
|
||||
/**
|
||||
Path to the Node.js executable to use in child processes if that is different from the current one. Its directory is pushed to the front of PATH.
|
||||
|
||||
This can be either an absolute path or a path relative to the `cwd` option.
|
||||
|
||||
@default process.execPath
|
||||
*/
|
||||
readonly execPath?: string;
|
||||
}
|
||||
|
||||
export type ProcessEnv = Record<string, string | undefined>;
|
||||
|
||||
export interface EnvOptions {
|
||||
/**
|
||||
The working directory.
|
||||
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly cwd?: string | URL;
|
||||
|
||||
/**
|
||||
Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options.
|
||||
*/
|
||||
readonly env?: ProcessEnv;
|
||||
|
||||
/**
|
||||
The path to the current Node.js executable. Its directory is pushed to the front of PATH.
|
||||
|
||||
This can be either an absolute path or a path relative to the `cwd` option.
|
||||
|
||||
@default process.execPath
|
||||
*/
|
||||
readonly execPath?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries.
|
||||
|
||||
@returns The augmented path string.
|
||||
|
||||
@example
|
||||
```
|
||||
import childProcess from 'node:child_process';
|
||||
import {npmRunPath} from 'npm-run-path';
|
||||
|
||||
console.log(process.env.PATH);
|
||||
//=> '/usr/local/bin'
|
||||
|
||||
console.log(npmRunPath());
|
||||
//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin'
|
||||
```
|
||||
*/
|
||||
export function npmRunPath(options?: RunPathOptions): string;
|
||||
|
||||
/**
|
||||
@returns The augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object.
|
||||
|
||||
@example
|
||||
```
|
||||
import childProcess from 'node:child_process';
|
||||
import {npmRunPathEnv} from 'npm-run-path';
|
||||
|
||||
// `foo` is a locally installed binary
|
||||
childProcess.execFileSync('foo', {
|
||||
env: npmRunPathEnv()
|
||||
});
|
||||
```
|
||||
*/
|
||||
export function npmRunPathEnv(options?: EnvOptions): ProcessEnv;
|
||||
@@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var IsInteger = require('./IsInteger');
|
||||
var Type = require('./Type');
|
||||
|
||||
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
|
||||
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate');
|
||||
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var $charCodeAt = require('call-bind/callBound')('String.prototype.charCodeAt');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-advancestringindex
|
||||
|
||||
module.exports = function AdvanceStringIndex(S, index, unicode) {
|
||||
if (Type(S) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `S` must be a String');
|
||||
}
|
||||
if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {
|
||||
throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');
|
||||
}
|
||||
if (Type(unicode) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: `unicode` must be a Boolean');
|
||||
}
|
||||
if (!unicode) {
|
||||
return index + 1;
|
||||
}
|
||||
var length = S.length;
|
||||
if ((index + 1) >= length) {
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
var first = $charCodeAt(S, index);
|
||||
if (!isLeadingSurrogate(first)) {
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
var second = $charCodeAt(S, index + 1);
|
||||
if (!isTrailingSurrogate(second)) {
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
return index + 2;
|
||||
};
|
||||
@@ -0,0 +1,272 @@
|
||||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# protocols
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [](https://github.com/IonicaBizau/ama) [](https://travis-ci.org/IonicaBizau/protocols/) [](https://www.npmjs.com/package/protocols) [](https://www.npmjs.com/package/protocols) [](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
> Get the protocols of an input url.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save protocols
|
||||
|
||||
# Using yarn
|
||||
yarn add protocols
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
// Dependencies
|
||||
const protocols = require("protocols");
|
||||
|
||||
console.log(protocols("git+ssh://git@some-host.com/and-the-path/name"));
|
||||
// ["git", "ssh"]
|
||||
|
||||
console.log(protocols("http://ionicabizau.net", true));
|
||||
// "http"
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `protocols(input, first)`
|
||||
Returns the protocols of an input url.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String|URL** `input`: The input url (string or `URL` instance)
|
||||
- **Boolean|Number** `first`: If `true`, the first protocol will be returned. If number, it will represent the zero-based index of the protocols array.
|
||||
|
||||
#### Return
|
||||
- **Array|String** The array of protocols or the specified protocol.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||

|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
- `parse-url`
|
||||
- `parse-path`
|
||||
- `is-ssh`
|
||||
- `@enkeledi/react-native-week-month-date-picker`
|
||||
- `bb-parse-url`
|
||||
- `@hemith/react-native-tnk`
|
||||
- `miguelcostero-ng2-toasty`
|
||||
- `native-kakao-login`
|
||||
- `react-native-my-first-try-arun-ramya`
|
||||
- `react-native-kakao-maps`
|
||||
- `react-native-is7`
|
||||
- `react-native-ytximkit`
|
||||
- `react-native-payu-payment-testing`
|
||||
- `npm_one_1_2_3`
|
||||
- `react-native-biometric-authenticate`
|
||||
- `react-native-arunmeena1987`
|
||||
- `react-native-contact-list`
|
||||
- `rn-adyen-dropin`
|
||||
- `@positionex/position-sdk`
|
||||
- `@corelmax/react-native-my2c2p-sdk`
|
||||
- `@felipesimmi/react-native-datalogic-module`
|
||||
- `@hawkingnetwork/react-native-tab-view`
|
||||
- `react-native-cplus`
|
||||
- `npm_qwerty`
|
||||
- `native-apple-login`
|
||||
- `drowl-base-theme-iconset`
|
||||
- `react-native-arunjeyam1987`
|
||||
- `react-native-bubble-chart`
|
||||
- `react-native-flyy`
|
||||
- `@apardellass/react-native-audio-stream`
|
||||
- `@geeky-apo/react-native-advanced-clipboard`
|
||||
- `candlelabssdk`
|
||||
- `@saad27/react-native-bottom-tab-tour`
|
||||
- `generator-bootstrap-boilerplate-template`
|
||||
- `react-feedback-sdk`
|
||||
- `npm_one_12_34_1_`
|
||||
- `npm_one_2_2`
|
||||
- `payutesting`
|
||||
- `react-native-dsphoto-module`
|
||||
- `react-native-sayhello-module`
|
||||
- `react-native-responsive-size`
|
||||
- `@con-test/react-native-concent-common`
|
||||
- `luojia-cli-dev`
|
||||
- `birken-react-native-community-image-editor`
|
||||
- `reac-native-arun-ramya-test`
|
||||
- `react-native-arun-ramya-test`
|
||||
- `react-native-arunramya151`
|
||||
- `react-native-pulsator-native`
|
||||
- `react-native-plugpag-wrapper`
|
||||
- `react-native-transtracker-library`
|
||||
- `@screeb/react-native`
|
||||
- `@buganto/client`
|
||||
- `astra-ufo-sdk`
|
||||
- `angularvezba`
|
||||
- `react-native-syan-photo-picker`
|
||||
- `@wecraftapps/react-native-use-keyboard`
|
||||
- `l2forlerna`
|
||||
- `native-google-login`
|
||||
- `raact-native-arunramya151`
|
||||
- `react-native-modal-progress-bar`
|
||||
- `react-native-test-module-hhh`
|
||||
- `react-native-jsi-device-info`
|
||||
- `react-native-badge-control`
|
||||
- `rn-tm-notify`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[license]: /LICENSE
|
||||
[website]: https://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"id-length": 0,
|
||||
"max-statements-per-line": [2, { "max": 2 }],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
var arrayEvery = require('./_arrayEvery'),
|
||||
baseEvery = require('./_baseEvery'),
|
||||
baseIteratee = require('./_baseIteratee'),
|
||||
isArray = require('./isArray'),
|
||||
isIterateeCall = require('./_isIterateeCall');
|
||||
|
||||
/**
|
||||
* Checks if `predicate` returns truthy for **all** elements of `collection`.
|
||||
* Iteration is stopped once `predicate` returns falsey. The predicate is
|
||||
* invoked with three arguments: (value, index|key, collection).
|
||||
*
|
||||
* **Note:** This method returns `true` for
|
||||
* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
|
||||
* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
|
||||
* elements of empty collections.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 0.1.0
|
||||
* @category Collection
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
||||
* @returns {boolean} Returns `true` if all elements pass the predicate check,
|
||||
* else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.every([true, 1, null, 'yes'], Boolean);
|
||||
* // => false
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36, 'active': false },
|
||||
* { 'user': 'fred', 'age': 40, 'active': false }
|
||||
* ];
|
||||
*
|
||||
* // The `_.matches` iteratee shorthand.
|
||||
* _.every(users, { 'user': 'barney', 'active': false });
|
||||
* // => false
|
||||
*
|
||||
* // The `_.matchesProperty` iteratee shorthand.
|
||||
* _.every(users, ['active', false]);
|
||||
* // => true
|
||||
*
|
||||
* // The `_.property` iteratee shorthand.
|
||||
* _.every(users, 'active');
|
||||
* // => false
|
||||
*/
|
||||
function every(collection, predicate, guard) {
|
||||
var func = isArray(collection) ? arrayEvery : baseEvery;
|
||||
if (guard && isIterateeCall(collection, predicate, guard)) {
|
||||
predicate = undefined;
|
||||
}
|
||||
return func(collection, baseIteratee(predicate, 3));
|
||||
}
|
||||
|
||||
module.exports = every;
|
||||
Reference in New Issue
Block a user