new license file version [CI SKIP]
This commit is contained in:
@@ -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":"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":"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 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 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 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 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:{"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:"HTMLElement.innerText"};
|
||||
@@ -0,0 +1,111 @@
|
||||
import { EOL } from 'node:os';
|
||||
import { format, parseGitUrl } from '../util.js';
|
||||
import Plugin from './Plugin.js';
|
||||
|
||||
const options = { write: false };
|
||||
const changelogFallback = 'git log --pretty=format:"* %s (%h)"';
|
||||
|
||||
class GitBase extends Plugin {
|
||||
async init() {
|
||||
const remoteUrl = await this.getRemoteUrl();
|
||||
await this.fetch(remoteUrl);
|
||||
|
||||
const branchName = await this.getBranchName();
|
||||
const repo = parseGitUrl(remoteUrl);
|
||||
this.setContext({ remoteUrl, branchName, repo });
|
||||
this.config.setContext({ remoteUrl, branchName, repo });
|
||||
|
||||
const latestTag = await this.getLatestTagName();
|
||||
const secondLatestTag = !this.config.isIncrement ? await this.getSecondLatestTagName(latestTag) : null;
|
||||
const tagTemplate = this.options.tagName || ((latestTag || '').match(/^v/) ? 'v${version}' : '${version}');
|
||||
this.config.setContext({ latestTag, secondLatestTag, tagTemplate });
|
||||
}
|
||||
|
||||
getName() {
|
||||
return this.getContext('repo.project');
|
||||
}
|
||||
|
||||
getLatestVersion() {
|
||||
const { tagTemplate, latestTag } = this.config.getContext();
|
||||
const prefix = tagTemplate.replace(/\$\{version\}/, '');
|
||||
return latestTag ? latestTag.replace(prefix, '').replace(/^v/, '') : null;
|
||||
}
|
||||
|
||||
async getChangelog() {
|
||||
const { latestTag, secondLatestTag } = this.config.getContext();
|
||||
const context = { latestTag, from: latestTag, to: 'HEAD' };
|
||||
const { changelog } = this.options;
|
||||
if (!changelog) return null;
|
||||
|
||||
if (latestTag && !this.config.isIncrement) {
|
||||
context.from = secondLatestTag;
|
||||
context.to = `${latestTag}^1`;
|
||||
}
|
||||
|
||||
if (!context.from && changelog.includes('${from}')) {
|
||||
return this.exec(changelogFallback);
|
||||
}
|
||||
|
||||
return this.exec(changelog, { context, options });
|
||||
}
|
||||
|
||||
bump(version) {
|
||||
const { tagTemplate } = this.config.getContext();
|
||||
const context = Object.assign(this.config.getContext(), { version });
|
||||
const tagName = format(tagTemplate, context) || version;
|
||||
this.setContext({ version });
|
||||
this.config.setContext({ tagName });
|
||||
}
|
||||
|
||||
isRemoteName(remoteUrlOrName) {
|
||||
return remoteUrlOrName && !remoteUrlOrName.includes('/');
|
||||
}
|
||||
|
||||
async getRemoteUrl() {
|
||||
const remoteNameOrUrl = this.options.pushRepo || (await this.getRemote()) || 'origin';
|
||||
return this.isRemoteName(remoteNameOrUrl)
|
||||
? this.exec(`git remote get-url ${remoteNameOrUrl}`, { options }).catch(() =>
|
||||
this.exec(`git config --get remote.${remoteNameOrUrl}.url`, { options }).catch(() => null)
|
||||
)
|
||||
: remoteNameOrUrl;
|
||||
}
|
||||
|
||||
async getRemote() {
|
||||
const branchName = await this.getBranchName();
|
||||
return branchName ? await this.getRemoteForBranch(branchName) : null;
|
||||
}
|
||||
|
||||
getBranchName() {
|
||||
return this.exec('git rev-parse --abbrev-ref HEAD', { options }).catch(() => null);
|
||||
}
|
||||
|
||||
getRemoteForBranch(branch) {
|
||||
return this.exec(`git config --get branch.${branch}.remote`, { options }).catch(() => null);
|
||||
}
|
||||
|
||||
fetch(remoteUrl) {
|
||||
return this.exec('git fetch').catch(err => {
|
||||
this.debug(err);
|
||||
throw new Error(`Unable to fetch from ${remoteUrl}${EOL}${err.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
getLatestTagName() {
|
||||
const context = Object.assign({}, this.config.getContext(), { version: '*' });
|
||||
const match = format(this.options.tagMatch || this.options.tagName || '${version}', context);
|
||||
const exclude = this.options.tagExclude ? ` --exclude=${format(this.options.tagExclude, context)}` : '';
|
||||
return this.exec(`git describe --tags --match=${match} --abbrev=0${exclude}`, { options }).then(
|
||||
stdout => stdout || null,
|
||||
() => null
|
||||
);
|
||||
}
|
||||
|
||||
async getSecondLatestTagName(latestTag) {
|
||||
const sha = await this.exec(`git rev-list ${latestTag || '--skip=1'} --tags --max-count=1`, {
|
||||
options
|
||||
});
|
||||
return this.exec(`git describe --tags --abbrev=0 "${sha}^"`, { options }).catch(() => null);
|
||||
}
|
||||
}
|
||||
|
||||
export default GitBase;
|
||||
@@ -0,0 +1,25 @@
|
||||
import { map } from './map';
|
||||
export function pluck() {
|
||||
var properties = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
properties[_i] = arguments[_i];
|
||||
}
|
||||
var length = properties.length;
|
||||
if (length === 0) {
|
||||
throw new Error('list of properties cannot be empty.');
|
||||
}
|
||||
return map(function (x) {
|
||||
var currentProp = x;
|
||||
for (var i = 0; i < length; i++) {
|
||||
var p = currentProp === null || currentProp === void 0 ? void 0 : currentProp[properties[i]];
|
||||
if (typeof p !== 'undefined') {
|
||||
currentProp = p;
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
return currentProp;
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=pluck.js.map
|
||||
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
var isValue = require("../value/is");
|
||||
|
||||
// prettier-ignore
|
||||
var possibleTypes = { "object": true, "function": true, "undefined": true /* document.all */ };
|
||||
|
||||
module.exports = function (value) {
|
||||
if (!isValue(value)) return false;
|
||||
return hasOwnProperty.call(possibleTypes, typeof value);
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import { graphql } from "./graphql";
|
||||
export function withDefaults(request, newDefaults) {
|
||||
const newRequest = request.defaults(newDefaults);
|
||||
const newApi = (query, options) => {
|
||||
return graphql(newRequest, query, options);
|
||||
};
|
||||
return Object.assign(newApi, {
|
||||
defaults: withDefaults.bind(null, newRequest),
|
||||
endpoint: newRequest.endpoint,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { iterator as Symbol_iterator } from '../symbol/iterator';
|
||||
import { isFunction } from '../util/isFunction';
|
||||
import { executeSchedule } from '../util/executeSchedule';
|
||||
export function scheduleIterable(input, scheduler) {
|
||||
return new Observable((subscriber) => {
|
||||
let iterator;
|
||||
executeSchedule(subscriber, scheduler, () => {
|
||||
iterator = input[Symbol_iterator]();
|
||||
executeSchedule(subscriber, scheduler, () => {
|
||||
let value;
|
||||
let done;
|
||||
try {
|
||||
({ value, done } = iterator.next());
|
||||
}
|
||||
catch (err) {
|
||||
subscriber.error(err);
|
||||
return;
|
||||
}
|
||||
if (done) {
|
||||
subscriber.complete();
|
||||
}
|
||||
else {
|
||||
subscriber.next(value);
|
||||
}
|
||||
}, 0, true);
|
||||
});
|
||||
return () => isFunction(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return();
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=scheduleIterable.js.map
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Converts `iterator` to an array.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} iterator The iterator to convert.
|
||||
* @returns {Array} Returns the converted array.
|
||||
*/
|
||||
function iteratorToArray(iterator) {
|
||||
var data,
|
||||
result = [];
|
||||
|
||||
while (!(data = iterator.next()).done) {
|
||||
result.push(data.value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = iteratorToArray;
|
||||
@@ -0,0 +1,54 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.0.2](https://github.com/inspect-js/is-weakref/compare/v1.0.1...v1.0.2) - 2021-12-10
|
||||
|
||||
### Commits
|
||||
|
||||
- [actions] reuse common workflows [`2375b1f`](https://github.com/inspect-js/is-weakref/commit/2375b1f9798b08c7af98481bbb38b4105835dacf)
|
||||
- [meta] do not publish workflow files [`4c1be42`](https://github.com/inspect-js/is-weakref/commit/4c1be423afacabf2f3aa9e8bf02f668bdeaf3a20)
|
||||
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`7ec78ce`](https://github.com/inspect-js/is-weakref/commit/7ec78ce58c7553469eee97ae82fe147dfccde611)
|
||||
- [readme] update URLs [`6306f09`](https://github.com/inspect-js/is-weakref/commit/6306f09a7df388150fb1d0b855b6f9e60165a457)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `safe-publish-latest`, `tape` [`7a1601e`](https://github.com/inspect-js/is-weakref/commit/7a1601e93ae50a791751a96d33073f5e65f3d3c9)
|
||||
- [readme] add actions and codecov badges [`67ecd14`](https://github.com/inspect-js/is-weakref/commit/67ecd14b8b0192456932d1d54838accbf90ff5c0)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `auto-changelog`, `object-inspect`, `safe-publish-latest`, `tape` [`1a5013b`](https://github.com/inspect-js/is-weakref/commit/1a5013bddcb9edc23025571810f9a2eebda53683)
|
||||
- [actions] update codecov uploader [`b57b037`](https://github.com/inspect-js/is-weakref/commit/b57b037a547f3ecfa3d3f079a8015ec005c7181b)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`da49017`](https://github.com/inspect-js/is-weakref/commit/da49017800d628c9bcd2f094d49783d6ee649c50)
|
||||
- [meta] simplify "exports" [`9b88835`](https://github.com/inspect-js/is-weakref/commit/9b8883585506c135a3fcb9f55d0944a13b4eb3e6)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`c7e77f4`](https://github.com/inspect-js/is-weakref/commit/c7e77f495308f3385adfaa1f4ac78a2632e0bcde)
|
||||
- [Dev Deps] update `eslint` [`417b29e`](https://github.com/inspect-js/is-weakref/commit/417b29e7ceacebe24aef15422544443f4b59e181)
|
||||
- [meta] add `safe-publish-latest`; use `prepublishOnly` script for npm 7+ [`b1b99f4`](https://github.com/inspect-js/is-weakref/commit/b1b99f45e0977d10f8472e9272e48a696145c2b1)
|
||||
- [Deps] update `call-bind` [`aea342e`](https://github.com/inspect-js/is-weakref/commit/aea342e9e301deeb938e62b92a37cf991c5f7dbc)
|
||||
- [actions] update workflows [`786c2d3`](https://github.com/inspect-js/is-weakref/commit/786c2d3dd4486acec09786220d3dd9fd48e70e93)
|
||||
|
||||
## [v1.0.1](https://github.com/inspect-js/is-weakref/compare/v1.0.0...v1.0.1) - 2020-12-04
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] migrate tests to Github Actions [`05b4faa`](https://github.com/inspect-js/is-weakref/commit/05b4faa167c67f42c792e35c07adcb6b87e7dea0)
|
||||
- [Tests] run `nyc` on all tests [`8df2e4b`](https://github.com/inspect-js/is-weakref/commit/8df2e4bd66bb6b7d55f389f28e6bb167fe1deb5a)
|
||||
- [actions] add "Allow Edits" workflow [`4a716b8`](https://github.com/inspect-js/is-weakref/commit/4a716b8fcc025fe889a0f09ccaee7a9f748b1c66)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect` [`be23cf3`](https://github.com/inspect-js/is-weakref/commit/be23cf305f46db8b1c8a26d1c74b096fdba00056)
|
||||
- [Refactor] use `call-bind` instead of `es-abstract` [`a933a96`](https://github.com/inspect-js/is-weakref/commit/a933a9643ddf7cddfd9f9f3cf44d675cc4c86ce5)
|
||||
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`4473ed2`](https://github.com/inspect-js/is-weakref/commit/4473ed2e73fed47cd2fa42b8d9cac17e941d2c08)
|
||||
- [readme] remove travis badge [`bd3bfcd`](https://github.com/inspect-js/is-weakref/commit/bd3bfcd2c187099d2215232a7621fb960e1e2807)
|
||||
|
||||
## v1.0.0 - 2020-08-01
|
||||
|
||||
### Commits
|
||||
|
||||
- Initial commit [`dd86394`](https://github.com/inspect-js/is-weakref/commit/dd86394d7da000724c6e17c79077879c381e9ea3)
|
||||
- readme [`f4defca`](https://github.com/inspect-js/is-weakref/commit/f4defcac48d1d99b019b596ab26bd868de1adfe9)
|
||||
- Tests [`13d8139`](https://github.com/inspect-js/is-weakref/commit/13d8139dedf424239daf357261c39d3f8c33d662)
|
||||
- npm init [`55a2bb7`](https://github.com/inspect-js/is-weakref/commit/55a2bb7c53b893396a51da969e352702cafe9a0e)
|
||||
- Implementation [`1ec84e3`](https://github.com/inspect-js/is-weakref/commit/1ec84e36de4315d44c8da540faa27836832bb0f3)
|
||||
- [meta] add auto-changelog [`ab9ce44`](https://github.com/inspect-js/is-weakref/commit/ab9ce44be717312c5221bf3d2f3f6d2dd8c6ac88)
|
||||
- [actions] add automatic rebasing / merge commit blocking [`3d3f4d5`](https://github.com/inspect-js/is-weakref/commit/3d3f4d54bed6e455b2a0d0f20c87d454bf78af26)
|
||||
- [meta] add "funding"; create `FUNDING.yml` [`f35ef3d`](https://github.com/inspect-js/is-weakref/commit/f35ef3de16eb06447acf3c39bdc164ba0e7bdf45)
|
||||
- [Tests] add `npm run lint` [`af2123d`](https://github.com/inspect-js/is-weakref/commit/af2123d4754c14f7befa66ba01e1d72858723651)
|
||||
- [Tests] use shared travis-ci configs [`042b4de`](https://github.com/inspect-js/is-weakref/commit/042b4dec08d882ae9137f4ad05ae24a1457da0f8)
|
||||
- Only apps should have lockfiles [`fcae604`](https://github.com/inspect-js/is-weakref/commit/fcae604cb1422faae9311dd4219032895c0a9a2e)
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nonew": true,
|
||||
"sub": true,
|
||||
"validthis": true,
|
||||
"undef": true,
|
||||
"trailing": true,
|
||||
"boss": true,
|
||||
"eqnull": true,
|
||||
"strict": true,
|
||||
"immed": true,
|
||||
"expr": true,
|
||||
"latedef": "nofunc",
|
||||
"quotmark": "single",
|
||||
"indent": 2,
|
||||
"node": true
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const matcher_1 = require("./matcher");
|
||||
class PartialMatcher extends matcher_1.default {
|
||||
match(filepath) {
|
||||
const parts = filepath.split('/');
|
||||
const levels = parts.length;
|
||||
const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
|
||||
for (const pattern of patterns) {
|
||||
const section = pattern.sections[0];
|
||||
/**
|
||||
* In this case, the pattern has a globstar and we must read all directories unconditionally,
|
||||
* but only if the level has reached the end of the first group.
|
||||
*
|
||||
* fixtures/{a,b}/**
|
||||
* ^ true/false ^ always true
|
||||
*/
|
||||
if (!pattern.complete && levels > section.length) {
|
||||
return true;
|
||||
}
|
||||
const match = parts.every((part, index) => {
|
||||
const segment = pattern.segments[index];
|
||||
if (segment.dynamic && segment.patternRe.test(part)) {
|
||||
return true;
|
||||
}
|
||||
if (!segment.dynamic && segment.pattern === part) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (match) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports.default = PartialMatcher;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"regex.generated.d.ts","sourceRoot":"","sources":["../../../../../packages/icu-skeleton-parser/regex.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,QAA0C,CAAA"}
|
||||
@@ -0,0 +1,3 @@
|
||||
import Select from './Select.svelte';
|
||||
|
||||
export default Select;
|
||||
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.observable = void 0;
|
||||
exports.observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();
|
||||
//# sourceMappingURL=observable.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../../src/internal/operators/filter.ts"],"names":[],"mappings":";;;AACA,qCAAuC;AACvC,2DAAgE;AA0DhE,SAAgB,MAAM,CAAI,SAA+C,EAAE,OAAa;IACtF,OAAO,cAAO,CAAC,UAAC,MAAM,EAAE,UAAU;QAEhC,IAAI,KAAK,GAAG,CAAC,CAAC;QAId,MAAM,CAAC,SAAS,CAId,6CAAwB,CAAC,UAAU,EAAE,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAjE,CAAiE,CAAC,CACnH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAdD,wBAcC"}
|
||||
@@ -0,0 +1 @@
|
||||
John,25,xxx
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Scheduler } from '../Scheduler';
|
||||
export class AsyncScheduler extends Scheduler {
|
||||
constructor(SchedulerAction, now = Scheduler.now) {
|
||||
super(SchedulerAction, now);
|
||||
this.actions = [];
|
||||
this._active = false;
|
||||
}
|
||||
flush(action) {
|
||||
const { actions } = this;
|
||||
if (this._active) {
|
||||
actions.push(action);
|
||||
return;
|
||||
}
|
||||
let error;
|
||||
this._active = true;
|
||||
do {
|
||||
if ((error = action.execute(action.state, action.delay))) {
|
||||
break;
|
||||
}
|
||||
} while ((action = actions.shift()));
|
||||
this._active = false;
|
||||
if (error) {
|
||||
while ((action = actions.shift())) {
|
||||
action.unsubscribe();
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=AsyncScheduler.js.map
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "protocols",
|
||||
"version": "2.0.1",
|
||||
"description": "Get the protocols of an input url.",
|
||||
"main": "lib/index.js",
|
||||
"directories": {
|
||||
"example": "example",
|
||||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:IonicaBizau/protocols.git"
|
||||
},
|
||||
"keywords": [
|
||||
"protocols",
|
||||
"protocol",
|
||||
"url",
|
||||
"parse"
|
||||
],
|
||||
"author": "Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/protocols/issues"
|
||||
},
|
||||
"homepage": "https://github.com/IonicaBizau/protocols",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"tester": "^1.4.5"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"app/",
|
||||
"lib/",
|
||||
"dist/",
|
||||
"src/",
|
||||
"scripts/",
|
||||
"resources/",
|
||||
"menu/",
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"bloggify.js",
|
||||
"bloggify.json",
|
||||
"bloggify/"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
var createRange = require('./_createRange');
|
||||
|
||||
/**
|
||||
* This method is like `_.range` except that it populates values in
|
||||
* descending order.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Util
|
||||
* @param {number} [start=0] The start of the range.
|
||||
* @param {number} end The end of the range.
|
||||
* @param {number} [step=1] The value to increment or decrement by.
|
||||
* @returns {Array} Returns the range of numbers.
|
||||
* @see _.inRange, _.range
|
||||
* @example
|
||||
*
|
||||
* _.rangeRight(4);
|
||||
* // => [3, 2, 1, 0]
|
||||
*
|
||||
* _.rangeRight(-4);
|
||||
* // => [-3, -2, -1, 0]
|
||||
*
|
||||
* _.rangeRight(1, 5);
|
||||
* // => [4, 3, 2, 1]
|
||||
*
|
||||
* _.rangeRight(0, 20, 5);
|
||||
* // => [15, 10, 5, 0]
|
||||
*
|
||||
* _.rangeRight(0, -4, -1);
|
||||
* // => [-3, -2, -1, 0]
|
||||
*
|
||||
* _.rangeRight(1, 4, 0);
|
||||
* // => [1, 1, 1]
|
||||
*
|
||||
* _.rangeRight(0);
|
||||
* // => []
|
||||
*/
|
||||
var rangeRight = createRange(true);
|
||||
|
||||
module.exports = rangeRight;
|
||||
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var ToNumber = require('./ToNumber');
|
||||
|
||||
var $isNaN = require('../helpers/isNaN');
|
||||
var $isFinite = require('../helpers/isFinite');
|
||||
var $sign = require('../helpers/sign');
|
||||
|
||||
var abs = require('./abs');
|
||||
var floor = require('./floor');
|
||||
var modulo = require('./modulo');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-touint8
|
||||
|
||||
module.exports = function ToUint8(argument) {
|
||||
var number = ToNumber(argument);
|
||||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }
|
||||
var posInt = $sign(number) * floor(abs(number));
|
||||
return modulo(posInt, 0x100);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"QueueScheduler.js","sourceRoot":"","sources":["../../../../src/internal/scheduler/QueueScheduler.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;IAAoC,kCAAc;IAAlD;;IACA,CAAC;IAAD,qBAAC;AAAD,CAAC,AADD,CAAoC,cAAc,GACjD"}
|
||||
@@ -0,0 +1,9 @@
|
||||
export declare function string_literal(data: string): {
|
||||
type: string;
|
||||
value: string;
|
||||
};
|
||||
export declare function escape(data: string, { only_escape_at_symbol }?: {
|
||||
only_escape_at_symbol?: boolean;
|
||||
}): string;
|
||||
export declare function escape_html(html: any): string;
|
||||
export declare function escape_template(str: any): any;
|
||||
@@ -0,0 +1,6 @@
|
||||
import { operate } from '../util/lift';
|
||||
import { scanInternals } from './scanInternals';
|
||||
export function scan(accumulator, seed) {
|
||||
return operate(scanInternals(accumulator, seed, arguments.length >= 2, true));
|
||||
}
|
||||
//# sourceMappingURL=scan.js.map
|
||||
@@ -0,0 +1,15 @@
|
||||
var shuffleSelf = require('./_shuffleSelf'),
|
||||
values = require('./values');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.shuffle`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object} collection The collection to shuffle.
|
||||
* @returns {Array} Returns the new shuffled array.
|
||||
*/
|
||||
function baseShuffle(collection) {
|
||||
return shuffleSelf(values(collection));
|
||||
}
|
||||
|
||||
module.exports = baseShuffle;
|
||||
@@ -0,0 +1,5 @@
|
||||
// Deprecated
|
||||
|
||||
"use strict";
|
||||
|
||||
module.exports = function (obj) { return typeof obj === "function"; };
|
||||
@@ -0,0 +1,13 @@
|
||||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
@@ -0,0 +1,101 @@
|
||||
'use strict'
|
||||
|
||||
let CssSyntaxError = require('./css-syntax-error')
|
||||
let Declaration = require('./declaration')
|
||||
let LazyResult = require('./lazy-result')
|
||||
let Container = require('./container')
|
||||
let Processor = require('./processor')
|
||||
let stringify = require('./stringify')
|
||||
let fromJSON = require('./fromJSON')
|
||||
let Document = require('./document')
|
||||
let Warning = require('./warning')
|
||||
let Comment = require('./comment')
|
||||
let AtRule = require('./at-rule')
|
||||
let Result = require('./result.js')
|
||||
let Input = require('./input')
|
||||
let parse = require('./parse')
|
||||
let list = require('./list')
|
||||
let Rule = require('./rule')
|
||||
let Root = require('./root')
|
||||
let Node = require('./node')
|
||||
|
||||
function postcss(...plugins) {
|
||||
if (plugins.length === 1 && Array.isArray(plugins[0])) {
|
||||
plugins = plugins[0]
|
||||
}
|
||||
return new Processor(plugins)
|
||||
}
|
||||
|
||||
postcss.plugin = function plugin(name, initializer) {
|
||||
let warningPrinted = false
|
||||
function creator(...args) {
|
||||
// eslint-disable-next-line no-console
|
||||
if (console && console.warn && !warningPrinted) {
|
||||
warningPrinted = true
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
name +
|
||||
': postcss.plugin was deprecated. Migration guide:\n' +
|
||||
'https://evilmartians.com/chronicles/postcss-8-plugin-migration'
|
||||
)
|
||||
if (process.env.LANG && process.env.LANG.startsWith('cn')) {
|
||||
/* c8 ignore next 7 */
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
name +
|
||||
': 里面 postcss.plugin 被弃用. 迁移指南:\n' +
|
||||
'https://www.w3ctech.com/topic/2226'
|
||||
)
|
||||
}
|
||||
}
|
||||
let transformer = initializer(...args)
|
||||
transformer.postcssPlugin = name
|
||||
transformer.postcssVersion = new Processor().version
|
||||
return transformer
|
||||
}
|
||||
|
||||
let cache
|
||||
Object.defineProperty(creator, 'postcss', {
|
||||
get() {
|
||||
if (!cache) cache = creator()
|
||||
return cache
|
||||
}
|
||||
})
|
||||
|
||||
creator.process = function (css, processOpts, pluginOpts) {
|
||||
return postcss([creator(pluginOpts)]).process(css, processOpts)
|
||||
}
|
||||
|
||||
return creator
|
||||
}
|
||||
|
||||
postcss.stringify = stringify
|
||||
postcss.parse = parse
|
||||
postcss.fromJSON = fromJSON
|
||||
postcss.list = list
|
||||
|
||||
postcss.comment = defaults => new Comment(defaults)
|
||||
postcss.atRule = defaults => new AtRule(defaults)
|
||||
postcss.decl = defaults => new Declaration(defaults)
|
||||
postcss.rule = defaults => new Rule(defaults)
|
||||
postcss.root = defaults => new Root(defaults)
|
||||
postcss.document = defaults => new Document(defaults)
|
||||
|
||||
postcss.CssSyntaxError = CssSyntaxError
|
||||
postcss.Declaration = Declaration
|
||||
postcss.Container = Container
|
||||
postcss.Processor = Processor
|
||||
postcss.Document = Document
|
||||
postcss.Comment = Comment
|
||||
postcss.Warning = Warning
|
||||
postcss.AtRule = AtRule
|
||||
postcss.Result = Result
|
||||
postcss.Input = Input
|
||||
postcss.Rule = Rule
|
||||
postcss.Root = Root
|
||||
postcss.Node = Node
|
||||
|
||||
LazyResult.registerPostcss(postcss)
|
||||
|
||||
module.exports = postcss
|
||||
postcss.default = postcss
|
||||
@@ -0,0 +1 @@
|
||||
export * from '../types/runtime/motion/index';
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
||||
'use strict';
|
||||
|
||||
const {sep} = require('path');
|
||||
const {platform} = process;
|
||||
const os = require('os');
|
||||
|
||||
exports.EV_ALL = 'all';
|
||||
exports.EV_READY = 'ready';
|
||||
exports.EV_ADD = 'add';
|
||||
exports.EV_CHANGE = 'change';
|
||||
exports.EV_ADD_DIR = 'addDir';
|
||||
exports.EV_UNLINK = 'unlink';
|
||||
exports.EV_UNLINK_DIR = 'unlinkDir';
|
||||
exports.EV_RAW = 'raw';
|
||||
exports.EV_ERROR = 'error';
|
||||
|
||||
exports.STR_DATA = 'data';
|
||||
exports.STR_END = 'end';
|
||||
exports.STR_CLOSE = 'close';
|
||||
|
||||
exports.FSEVENT_CREATED = 'created';
|
||||
exports.FSEVENT_MODIFIED = 'modified';
|
||||
exports.FSEVENT_DELETED = 'deleted';
|
||||
exports.FSEVENT_MOVED = 'moved';
|
||||
exports.FSEVENT_CLONED = 'cloned';
|
||||
exports.FSEVENT_UNKNOWN = 'unknown';
|
||||
exports.FSEVENT_TYPE_FILE = 'file';
|
||||
exports.FSEVENT_TYPE_DIRECTORY = 'directory';
|
||||
exports.FSEVENT_TYPE_SYMLINK = 'symlink';
|
||||
|
||||
exports.KEY_LISTENERS = 'listeners';
|
||||
exports.KEY_ERR = 'errHandlers';
|
||||
exports.KEY_RAW = 'rawEmitters';
|
||||
exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW];
|
||||
|
||||
exports.DOT_SLASH = `.${sep}`;
|
||||
|
||||
exports.BACK_SLASH_RE = /\\/g;
|
||||
exports.DOUBLE_SLASH_RE = /\/\//;
|
||||
exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
|
||||
exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
||||
exports.REPLACER_RE = /^\.[/\\]/;
|
||||
|
||||
exports.SLASH = '/';
|
||||
exports.SLASH_SLASH = '//';
|
||||
exports.BRACE_START = '{';
|
||||
exports.BANG = '!';
|
||||
exports.ONE_DOT = '.';
|
||||
exports.TWO_DOTS = '..';
|
||||
exports.STAR = '*';
|
||||
exports.GLOBSTAR = '**';
|
||||
exports.ROOT_GLOBSTAR = '/**/*';
|
||||
exports.SLASH_GLOBSTAR = '/**';
|
||||
exports.DIR_SUFFIX = 'Dir';
|
||||
exports.ANYMATCH_OPTS = {dot: true};
|
||||
exports.STRING_TYPE = 'string';
|
||||
exports.FUNCTION_TYPE = 'function';
|
||||
exports.EMPTY_STR = '';
|
||||
exports.EMPTY_FN = () => {};
|
||||
exports.IDENTITY_FN = val => val;
|
||||
|
||||
exports.isWindows = platform === 'win32';
|
||||
exports.isMacos = platform === 'darwin';
|
||||
exports.isLinux = platform === 'linux';
|
||||
exports.isIBMi = os.type() === 'OS400';
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('size', require('../size'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(String, "raw", {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Subject } from './Subject';
|
||||
/**
|
||||
* A variant of Subject that only emits a value when it completes. It will emit
|
||||
* its latest value to all its observers on completion.
|
||||
*
|
||||
* @class AsyncSubject<T>
|
||||
*/
|
||||
export declare class AsyncSubject<T> extends Subject<T> {
|
||||
private _value;
|
||||
private _hasValue;
|
||||
private _isComplete;
|
||||
next(value: T): void;
|
||||
complete(): void;
|
||||
}
|
||||
//# sourceMappingURL=AsyncSubject.d.ts.map
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,64 @@
|
||||
import { Connectable, ObservableInput, SubjectLike } from '../types';
|
||||
import { Subject } from '../Subject';
|
||||
import { Subscription } from '../Subscription';
|
||||
import { Observable } from '../Observable';
|
||||
import { defer } from './defer';
|
||||
|
||||
export interface ConnectableConfig<T> {
|
||||
/**
|
||||
* A factory function used to create the Subject through which the source
|
||||
* is multicast. By default this creates a {@link Subject}.
|
||||
*/
|
||||
connector: () => SubjectLike<T>;
|
||||
/**
|
||||
* If true, the resulting observable will reset internal state upon disconnection
|
||||
* and return to a "cold" state. This allows the resulting observable to be
|
||||
* reconnected.
|
||||
* If false, upon disconnection, the connecting subject will remain the
|
||||
* connecting subject, meaning the resulting observable will not go "cold" again,
|
||||
* and subsequent repeats or resubscriptions will resubscribe to that same subject.
|
||||
*/
|
||||
resetOnDisconnect?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The default configuration for `connectable`.
|
||||
*/
|
||||
const DEFAULT_CONFIG: ConnectableConfig<unknown> = {
|
||||
connector: () => new Subject<unknown>(),
|
||||
resetOnDisconnect: true,
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates an observable that multicasts once `connect()` is called on it.
|
||||
*
|
||||
* @param source The observable source to make connectable.
|
||||
* @param config The configuration object for `connectable`.
|
||||
* @returns A "connectable" observable, that has a `connect()` method, that you must call to
|
||||
* connect the source to all consumers through the subject provided as the connector.
|
||||
*/
|
||||
export function connectable<T>(source: ObservableInput<T>, config: ConnectableConfig<T> = DEFAULT_CONFIG): Connectable<T> {
|
||||
// The subscription representing the connection.
|
||||
let connection: Subscription | null = null;
|
||||
const { connector, resetOnDisconnect = true } = config;
|
||||
let subject = connector();
|
||||
|
||||
const result: any = new Observable<T>((subscriber) => {
|
||||
return subject.subscribe(subscriber);
|
||||
});
|
||||
|
||||
// Define the `connect` function. This is what users must call
|
||||
// in order to "connect" the source to the subject that is
|
||||
// multicasting it.
|
||||
result.connect = () => {
|
||||
if (!connection || connection.closed) {
|
||||
connection = defer(() => source).subscribe(subject);
|
||||
if (resetOnDisconnect) {
|
||||
connection.add(() => (subject = connector()));
|
||||
}
|
||||
}
|
||||
return connection;
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
module.exports = globSync
|
||||
globSync.GlobSync = GlobSync
|
||||
|
||||
var rp = require('fs.realpath')
|
||||
var minimatch = require('minimatch')
|
||||
var Minimatch = minimatch.Minimatch
|
||||
var Glob = require('./glob.js').Glob
|
||||
var util = require('util')
|
||||
var path = require('path')
|
||||
var assert = require('assert')
|
||||
var isAbsolute = require('path-is-absolute')
|
||||
var common = require('./common.js')
|
||||
var setopts = common.setopts
|
||||
var ownProp = common.ownProp
|
||||
var childrenIgnored = common.childrenIgnored
|
||||
var isIgnored = common.isIgnored
|
||||
|
||||
function globSync (pattern, options) {
|
||||
if (typeof options === 'function' || arguments.length === 3)
|
||||
throw new TypeError('callback provided to sync glob\n'+
|
||||
'See: https://github.com/isaacs/node-glob/issues/167')
|
||||
|
||||
return new GlobSync(pattern, options).found
|
||||
}
|
||||
|
||||
function GlobSync (pattern, options) {
|
||||
if (!pattern)
|
||||
throw new Error('must provide pattern')
|
||||
|
||||
if (typeof options === 'function' || arguments.length === 3)
|
||||
throw new TypeError('callback provided to sync glob\n'+
|
||||
'See: https://github.com/isaacs/node-glob/issues/167')
|
||||
|
||||
if (!(this instanceof GlobSync))
|
||||
return new GlobSync(pattern, options)
|
||||
|
||||
setopts(this, pattern, options)
|
||||
|
||||
if (this.noprocess)
|
||||
return this
|
||||
|
||||
var n = this.minimatch.set.length
|
||||
this.matches = new Array(n)
|
||||
for (var i = 0; i < n; i ++) {
|
||||
this._process(this.minimatch.set[i], i, false)
|
||||
}
|
||||
this._finish()
|
||||
}
|
||||
|
||||
GlobSync.prototype._finish = function () {
|
||||
assert.ok(this instanceof GlobSync)
|
||||
if (this.realpath) {
|
||||
var self = this
|
||||
this.matches.forEach(function (matchset, index) {
|
||||
var set = self.matches[index] = Object.create(null)
|
||||
for (var p in matchset) {
|
||||
try {
|
||||
p = self._makeAbs(p)
|
||||
var real = rp.realpathSync(p, self.realpathCache)
|
||||
set[real] = true
|
||||
} catch (er) {
|
||||
if (er.syscall === 'stat')
|
||||
set[self._makeAbs(p)] = true
|
||||
else
|
||||
throw er
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
common.finish(this)
|
||||
}
|
||||
|
||||
|
||||
GlobSync.prototype._process = function (pattern, index, inGlobStar) {
|
||||
assert.ok(this instanceof GlobSync)
|
||||
|
||||
// Get the first [n] parts of pattern that are all strings.
|
||||
var n = 0
|
||||
while (typeof pattern[n] === 'string') {
|
||||
n ++
|
||||
}
|
||||
// now n is the index of the first one that is *not* a string.
|
||||
|
||||
// See if there's anything else
|
||||
var prefix
|
||||
switch (n) {
|
||||
// if not, then this is rather simple
|
||||
case pattern.length:
|
||||
this._processSimple(pattern.join('/'), index)
|
||||
return
|
||||
|
||||
case 0:
|
||||
// pattern *starts* with some non-trivial item.
|
||||
// going to readdir(cwd), but not include the prefix in matches.
|
||||
prefix = null
|
||||
break
|
||||
|
||||
default:
|
||||
// pattern has some string bits in the front.
|
||||
// whatever it starts with, whether that's 'absolute' like /foo/bar,
|
||||
// or 'relative' like '../baz'
|
||||
prefix = pattern.slice(0, n).join('/')
|
||||
break
|
||||
}
|
||||
|
||||
var remain = pattern.slice(n)
|
||||
|
||||
// get the list of entries.
|
||||
var read
|
||||
if (prefix === null)
|
||||
read = '.'
|
||||
else if (isAbsolute(prefix) ||
|
||||
isAbsolute(pattern.map(function (p) {
|
||||
return typeof p === 'string' ? p : '[*]'
|
||||
}).join('/'))) {
|
||||
if (!prefix || !isAbsolute(prefix))
|
||||
prefix = '/' + prefix
|
||||
read = prefix
|
||||
} else
|
||||
read = prefix
|
||||
|
||||
var abs = this._makeAbs(read)
|
||||
|
||||
//if ignored, skip processing
|
||||
if (childrenIgnored(this, read))
|
||||
return
|
||||
|
||||
var isGlobStar = remain[0] === minimatch.GLOBSTAR
|
||||
if (isGlobStar)
|
||||
this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
|
||||
else
|
||||
this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
|
||||
}
|
||||
|
||||
|
||||
GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
|
||||
var entries = this._readdir(abs, inGlobStar)
|
||||
|
||||
// if the abs isn't a dir, then nothing can match!
|
||||
if (!entries)
|
||||
return
|
||||
|
||||
// It will only match dot entries if it starts with a dot, or if
|
||||
// dot is set. Stuff like @(.foo|.bar) isn't allowed.
|
||||
var pn = remain[0]
|
||||
var negate = !!this.minimatch.negate
|
||||
var rawGlob = pn._glob
|
||||
var dotOk = this.dot || rawGlob.charAt(0) === '.'
|
||||
|
||||
var matchedEntries = []
|
||||
for (var i = 0; i < entries.length; i++) {
|
||||
var e = entries[i]
|
||||
if (e.charAt(0) !== '.' || dotOk) {
|
||||
var m
|
||||
if (negate && !prefix) {
|
||||
m = !e.match(pn)
|
||||
} else {
|
||||
m = e.match(pn)
|
||||
}
|
||||
if (m)
|
||||
matchedEntries.push(e)
|
||||
}
|
||||
}
|
||||
|
||||
var len = matchedEntries.length
|
||||
// If there are no matched entries, then nothing matches.
|
||||
if (len === 0)
|
||||
return
|
||||
|
||||
// if this is the last remaining pattern bit, then no need for
|
||||
// an additional stat *unless* the user has specified mark or
|
||||
// stat explicitly. We know they exist, since readdir returned
|
||||
// them.
|
||||
|
||||
if (remain.length === 1 && !this.mark && !this.stat) {
|
||||
if (!this.matches[index])
|
||||
this.matches[index] = Object.create(null)
|
||||
|
||||
for (var i = 0; i < len; i ++) {
|
||||
var e = matchedEntries[i]
|
||||
if (prefix) {
|
||||
if (prefix.slice(-1) !== '/')
|
||||
e = prefix + '/' + e
|
||||
else
|
||||
e = prefix + e
|
||||
}
|
||||
|
||||
if (e.charAt(0) === '/' && !this.nomount) {
|
||||
e = path.join(this.root, e)
|
||||
}
|
||||
this._emitMatch(index, e)
|
||||
}
|
||||
// This was the last one, and no stats were needed
|
||||
return
|
||||
}
|
||||
|
||||
// now test all matched entries as stand-ins for that part
|
||||
// of the pattern.
|
||||
remain.shift()
|
||||
for (var i = 0; i < len; i ++) {
|
||||
var e = matchedEntries[i]
|
||||
var newPattern
|
||||
if (prefix)
|
||||
newPattern = [prefix, e]
|
||||
else
|
||||
newPattern = [e]
|
||||
this._process(newPattern.concat(remain), index, inGlobStar)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GlobSync.prototype._emitMatch = function (index, e) {
|
||||
if (isIgnored(this, e))
|
||||
return
|
||||
|
||||
var abs = this._makeAbs(e)
|
||||
|
||||
if (this.mark)
|
||||
e = this._mark(e)
|
||||
|
||||
if (this.absolute) {
|
||||
e = abs
|
||||
}
|
||||
|
||||
if (this.matches[index][e])
|
||||
return
|
||||
|
||||
if (this.nodir) {
|
||||
var c = this.cache[abs]
|
||||
if (c === 'DIR' || Array.isArray(c))
|
||||
return
|
||||
}
|
||||
|
||||
this.matches[index][e] = true
|
||||
|
||||
if (this.stat)
|
||||
this._stat(e)
|
||||
}
|
||||
|
||||
|
||||
GlobSync.prototype._readdirInGlobStar = function (abs) {
|
||||
// follow all symlinked directories forever
|
||||
// just proceed as if this is a non-globstar situation
|
||||
if (this.follow)
|
||||
return this._readdir(abs, false)
|
||||
|
||||
var entries
|
||||
var lstat
|
||||
var stat
|
||||
try {
|
||||
lstat = this.fs.lstatSync(abs)
|
||||
} catch (er) {
|
||||
if (er.code === 'ENOENT') {
|
||||
// lstat failed, doesn't exist
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
var isSym = lstat && lstat.isSymbolicLink()
|
||||
this.symlinks[abs] = isSym
|
||||
|
||||
// If it's not a symlink or a dir, then it's definitely a regular file.
|
||||
// don't bother doing a readdir in that case.
|
||||
if (!isSym && lstat && !lstat.isDirectory())
|
||||
this.cache[abs] = 'FILE'
|
||||
else
|
||||
entries = this._readdir(abs, false)
|
||||
|
||||
return entries
|
||||
}
|
||||
|
||||
GlobSync.prototype._readdir = function (abs, inGlobStar) {
|
||||
var entries
|
||||
|
||||
if (inGlobStar && !ownProp(this.symlinks, abs))
|
||||
return this._readdirInGlobStar(abs)
|
||||
|
||||
if (ownProp(this.cache, abs)) {
|
||||
var c = this.cache[abs]
|
||||
if (!c || c === 'FILE')
|
||||
return null
|
||||
|
||||
if (Array.isArray(c))
|
||||
return c
|
||||
}
|
||||
|
||||
try {
|
||||
return this._readdirEntries(abs, this.fs.readdirSync(abs))
|
||||
} catch (er) {
|
||||
this._readdirError(abs, er)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
GlobSync.prototype._readdirEntries = function (abs, entries) {
|
||||
// if we haven't asked to stat everything, then just
|
||||
// assume that everything in there exists, so we can avoid
|
||||
// having to stat it a second time.
|
||||
if (!this.mark && !this.stat) {
|
||||
for (var i = 0; i < entries.length; i ++) {
|
||||
var e = entries[i]
|
||||
if (abs === '/')
|
||||
e = abs + e
|
||||
else
|
||||
e = abs + '/' + e
|
||||
this.cache[e] = true
|
||||
}
|
||||
}
|
||||
|
||||
this.cache[abs] = entries
|
||||
|
||||
// mark and cache dir-ness
|
||||
return entries
|
||||
}
|
||||
|
||||
GlobSync.prototype._readdirError = function (f, er) {
|
||||
// handle errors, and cache the information
|
||||
switch (er.code) {
|
||||
case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
|
||||
case 'ENOTDIR': // totally normal. means it *does* exist.
|
||||
var abs = this._makeAbs(f)
|
||||
this.cache[abs] = 'FILE'
|
||||
if (abs === this.cwdAbs) {
|
||||
var error = new Error(er.code + ' invalid cwd ' + this.cwd)
|
||||
error.path = this.cwd
|
||||
error.code = er.code
|
||||
throw error
|
||||
}
|
||||
break
|
||||
|
||||
case 'ENOENT': // not terribly unusual
|
||||
case 'ELOOP':
|
||||
case 'ENAMETOOLONG':
|
||||
case 'UNKNOWN':
|
||||
this.cache[this._makeAbs(f)] = false
|
||||
break
|
||||
|
||||
default: // some unusual error. Treat as failure.
|
||||
this.cache[this._makeAbs(f)] = false
|
||||
if (this.strict)
|
||||
throw er
|
||||
if (!this.silent)
|
||||
console.error('glob error', er)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
|
||||
|
||||
var entries = this._readdir(abs, inGlobStar)
|
||||
|
||||
// no entries means not a dir, so it can never have matches
|
||||
// foo.txt/** doesn't match foo.txt
|
||||
if (!entries)
|
||||
return
|
||||
|
||||
// test without the globstar, and with every child both below
|
||||
// and replacing the globstar.
|
||||
var remainWithoutGlobStar = remain.slice(1)
|
||||
var gspref = prefix ? [ prefix ] : []
|
||||
var noGlobStar = gspref.concat(remainWithoutGlobStar)
|
||||
|
||||
// the noGlobStar pattern exits the inGlobStar state
|
||||
this._process(noGlobStar, index, false)
|
||||
|
||||
var len = entries.length
|
||||
var isSym = this.symlinks[abs]
|
||||
|
||||
// If it's a symlink, and we're in a globstar, then stop
|
||||
if (isSym && inGlobStar)
|
||||
return
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
var e = entries[i]
|
||||
if (e.charAt(0) === '.' && !this.dot)
|
||||
continue
|
||||
|
||||
// these two cases enter the inGlobStar state
|
||||
var instead = gspref.concat(entries[i], remainWithoutGlobStar)
|
||||
this._process(instead, index, true)
|
||||
|
||||
var below = gspref.concat(entries[i], remain)
|
||||
this._process(below, index, true)
|
||||
}
|
||||
}
|
||||
|
||||
GlobSync.prototype._processSimple = function (prefix, index) {
|
||||
// XXX review this. Shouldn't it be doing the mounting etc
|
||||
// before doing stat? kinda weird?
|
||||
var exists = this._stat(prefix)
|
||||
|
||||
if (!this.matches[index])
|
||||
this.matches[index] = Object.create(null)
|
||||
|
||||
// If it doesn't exist, then just mark the lack of results
|
||||
if (!exists)
|
||||
return
|
||||
|
||||
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
||||
var trail = /[\/\\]$/.test(prefix)
|
||||
if (prefix.charAt(0) === '/') {
|
||||
prefix = path.join(this.root, prefix)
|
||||
} else {
|
||||
prefix = path.resolve(this.root, prefix)
|
||||
if (trail)
|
||||
prefix += '/'
|
||||
}
|
||||
}
|
||||
|
||||
if (process.platform === 'win32')
|
||||
prefix = prefix.replace(/\\/g, '/')
|
||||
|
||||
// Mark this as a match
|
||||
this._emitMatch(index, prefix)
|
||||
}
|
||||
|
||||
// Returns either 'DIR', 'FILE', or false
|
||||
GlobSync.prototype._stat = function (f) {
|
||||
var abs = this._makeAbs(f)
|
||||
var needDir = f.slice(-1) === '/'
|
||||
|
||||
if (f.length > this.maxLength)
|
||||
return false
|
||||
|
||||
if (!this.stat && ownProp(this.cache, abs)) {
|
||||
var c = this.cache[abs]
|
||||
|
||||
if (Array.isArray(c))
|
||||
c = 'DIR'
|
||||
|
||||
// It exists, but maybe not how we need it
|
||||
if (!needDir || c === 'DIR')
|
||||
return c
|
||||
|
||||
if (needDir && c === 'FILE')
|
||||
return false
|
||||
|
||||
// otherwise we have to stat, because maybe c=true
|
||||
// if we know it exists, but not what it is.
|
||||
}
|
||||
|
||||
var exists
|
||||
var stat = this.statCache[abs]
|
||||
if (!stat) {
|
||||
var lstat
|
||||
try {
|
||||
lstat = this.fs.lstatSync(abs)
|
||||
} catch (er) {
|
||||
if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
|
||||
this.statCache[abs] = false
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (lstat && lstat.isSymbolicLink()) {
|
||||
try {
|
||||
stat = this.fs.statSync(abs)
|
||||
} catch (er) {
|
||||
stat = lstat
|
||||
}
|
||||
} else {
|
||||
stat = lstat
|
||||
}
|
||||
}
|
||||
|
||||
this.statCache[abs] = stat
|
||||
|
||||
var c = true
|
||||
if (stat)
|
||||
c = stat.isDirectory() ? 'DIR' : 'FILE'
|
||||
|
||||
this.cache[abs] = this.cache[abs] || c
|
||||
|
||||
if (needDir && c === 'FILE')
|
||||
return false
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
GlobSync.prototype._mark = function (p) {
|
||||
return common.mark(this, p)
|
||||
}
|
||||
|
||||
GlobSync.prototype._makeAbs = function (f) {
|
||||
return common.makeAbs(this, f)
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { Subject } from '../Subject';
|
||||
import { multicast } from './multicast';
|
||||
import { ConnectableObservable } from '../observable/ConnectableObservable';
|
||||
import { MonoTypeOperatorFunction, OperatorFunction, UnaryFunction, ObservableInput, ObservedValueOf } from '../types';
|
||||
import { connect } from './connect';
|
||||
|
||||
/**
|
||||
* Returns a connectable observable that, when connected, will multicast
|
||||
* all values through a single underlying {@link Subject} instance.
|
||||
*
|
||||
* @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
|
||||
* `source.pipe(publish())` is equivalent to
|
||||
* `connectable(source, { connector: () => new Subject(), resetOnDisconnect: false })`.
|
||||
* If you're using {@link refCount} after `publish`, use {@link share} operator instead.
|
||||
* `source.pipe(publish(), refCount())` is equivalent to
|
||||
* `source.pipe(share({ resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }))`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export function publish<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
|
||||
|
||||
/**
|
||||
* Returns an observable, that when subscribed to, creates an underlying {@link Subject},
|
||||
* provides an observable view of it to a `selector` function, takes the observable result of
|
||||
* that selector function and subscribes to it, sending its values to the consumer, _then_ connects
|
||||
* the subject to the original source.
|
||||
*
|
||||
* @param selector A function used to setup multicasting prior to automatic connection.
|
||||
*
|
||||
* @deprecated Will be removed in v8. Use the {@link connect} operator instead.
|
||||
* `publish(selector)` is equivalent to `connect(selector)`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export function publish<T, O extends ObservableInput<any>>(selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
|
||||
|
||||
/**
|
||||
* Returns a ConnectableObservable, which is a variety of Observable that waits until its connect method is called
|
||||
* before it begins emitting items to those Observers that have subscribed to it.
|
||||
*
|
||||
* <span class="informal">Makes a cold Observable hot</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* Make `source$` hot by applying `publish` operator, then merge each inner observable into a single one
|
||||
* and subscribe
|
||||
*
|
||||
* ```ts
|
||||
* import { zip, interval, of, map, publish, merge, tap } from 'rxjs';
|
||||
*
|
||||
* const source$ = zip(interval(2000), of(1, 2, 3, 4, 5, 6, 7, 8, 9))
|
||||
* .pipe(map(([, number]) => number));
|
||||
*
|
||||
* source$
|
||||
* .pipe(
|
||||
* publish(multicasted$ =>
|
||||
* merge(
|
||||
* multicasted$.pipe(tap(x => console.log('Stream 1:', x))),
|
||||
* multicasted$.pipe(tap(x => console.log('Stream 2:', x))),
|
||||
* multicasted$.pipe(tap(x => console.log('Stream 3:', x)))
|
||||
* )
|
||||
* )
|
||||
* )
|
||||
* .subscribe();
|
||||
*
|
||||
* // Results every two seconds
|
||||
* // Stream 1: 1
|
||||
* // Stream 2: 1
|
||||
* // Stream 3: 1
|
||||
* // ...
|
||||
* // Stream 1: 9
|
||||
* // Stream 2: 9
|
||||
* // Stream 3: 9
|
||||
* ```
|
||||
*
|
||||
* @see {@link publishLast}
|
||||
* @see {@link publishReplay}
|
||||
* @see {@link publishBehavior}
|
||||
*
|
||||
* @param {Function} [selector] - Optional selector function which can use the multicasted source sequence as many times
|
||||
* as needed, without causing multiple subscriptions to the source sequence.
|
||||
* Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
|
||||
* @return A function that returns a ConnectableObservable that upon connection
|
||||
* causes the source Observable to emit items to its Observers.
|
||||
* @deprecated Will be removed in v8. Use the {@link connectable} observable, the {@link connect} operator or the
|
||||
* {@link share} operator instead. See the overloads below for equivalent replacement examples of this operator's
|
||||
* behaviors.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export function publish<T, R>(selector?: OperatorFunction<T, R>): MonoTypeOperatorFunction<T> | OperatorFunction<T, R> {
|
||||
return selector ? (source) => connect(selector)(source) : (source) => multicast(new Subject<T>())(source);
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
import Renderer from '../../Renderer';
|
||||
import Element from '../../../nodes/Element';
|
||||
import Wrapper from '../shared/Wrapper';
|
||||
import Block from '../../Block';
|
||||
import FragmentWrapper from '../Fragment';
|
||||
import AttributeWrapper from './Attribute';
|
||||
import StyleAttributeWrapper from './StyleAttribute';
|
||||
import SpreadAttributeWrapper from './SpreadAttribute';
|
||||
import Binding from './Binding';
|
||||
import { Identifier } from 'estree';
|
||||
import EventHandler from './EventHandler';
|
||||
interface BindingGroup {
|
||||
events: string[];
|
||||
bindings: Binding[];
|
||||
}
|
||||
export default class ElementWrapper extends Wrapper {
|
||||
node: Element;
|
||||
fragment: FragmentWrapper;
|
||||
attributes: Array<AttributeWrapper | StyleAttributeWrapper | SpreadAttributeWrapper>;
|
||||
bindings: Binding[];
|
||||
event_handlers: EventHandler[];
|
||||
class_dependencies: string[];
|
||||
has_dynamic_attribute: boolean;
|
||||
select_binding_dependencies?: Set<string>;
|
||||
has_dynamic_value: boolean;
|
||||
dynamic_value_condition: any;
|
||||
var: any;
|
||||
void: boolean;
|
||||
child_dynamic_element_block?: Block;
|
||||
child_dynamic_element?: ElementWrapper;
|
||||
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: Element, strip_whitespace: boolean, next_sibling: Wrapper);
|
||||
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
|
||||
render_dynamic_element(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
|
||||
is_dom_node(): boolean;
|
||||
render_element(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
|
||||
can_use_textcontent(): boolean;
|
||||
get_render_statement(block: Block): (import("estree").ClassExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ArrayExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ArrowFunctionExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").AssignmentExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").AwaitExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").BinaryExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SimpleCallExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").NewExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ChainExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ConditionalExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").FunctionExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (Identifier & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ImportExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SimpleLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").RegExpLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").BigIntLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").LogicalExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").MemberExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").MetaProperty & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ObjectExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SequenceExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").TaggedTemplateExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").TemplateLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ThisExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").UnaryExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").UpdateExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").YieldExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
});
|
||||
get_claim_statement(block: Block, nodes: Identifier): (import("estree").ClassExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ArrayExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ArrowFunctionExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").AssignmentExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").AwaitExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").BinaryExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SimpleCallExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").NewExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ChainExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ConditionalExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").FunctionExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (Identifier & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ImportExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SimpleLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").RegExpLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").BigIntLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").LogicalExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").MemberExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").MetaProperty & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ObjectExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SequenceExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").TaggedTemplateExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").TemplateLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ThisExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").UnaryExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").UpdateExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").YieldExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
});
|
||||
add_directives_in_order(block: Block): void;
|
||||
add_bindings(block: Block, binding_group: BindingGroup): void;
|
||||
add_this_binding(block: Block, this_binding: Binding): void;
|
||||
add_attributes(block: Block): void;
|
||||
add_spread_attributes(block: Block): void;
|
||||
add_dynamic_element_attributes(block: Block): void;
|
||||
add_transitions(block: Block): void;
|
||||
add_animation(block: Block): void;
|
||||
add_classes(block: Block): void;
|
||||
add_styles(block: Block): void;
|
||||
add_manual_style_scoping(block: Block): void;
|
||||
}
|
||||
export {};
|
||||
@@ -0,0 +1,10 @@
|
||||
import Renderer from '../Renderer';
|
||||
import Wrapper from './shared/Wrapper';
|
||||
import Block from '../Block';
|
||||
import DebugTag from '../../nodes/DebugTag';
|
||||
import { Identifier } from 'estree';
|
||||
export default class DebugTagWrapper extends Wrapper {
|
||||
node: DebugTag;
|
||||
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: DebugTag, _strip_whitespace: boolean, _next_sibling: Wrapper);
|
||||
render(block: Block, _parent_node: Identifier, _parent_nodes: Identifier): void;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"finalize.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/finalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAU7E"}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "slash",
|
||||
"version": "4.0.0",
|
||||
"description": "Convert Windows backslash paths to slash paths",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/slash",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"path",
|
||||
"seperator",
|
||||
"slash",
|
||||
"backslash",
|
||||
"windows",
|
||||
"convert"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^3.15.0",
|
||||
"tsd": "^0.14.0",
|
||||
"xo": "^0.38.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $String = GetIntrinsic('%String%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://262.ecma-international.org/9.0/#sec-tostring-applied-to-the-number-type
|
||||
|
||||
module.exports = function NumberToString(m) {
|
||||
if (Type(m) !== 'Number') {
|
||||
throw new $TypeError('Assertion failed: "m" must be a String');
|
||||
}
|
||||
|
||||
return $String(m);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/src/test.ts</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> / <a href="index.html">csv2json/src</a> test.ts
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line low'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import a from "./index";
|
||||
|
||||
|
||||
// a("sss","CCc");
|
||||
</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:20:20 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
export default function debounce(func, wait, immediate) {
|
||||
let timeout;
|
||||
|
||||
return function executedFunction() {
|
||||
let context = this;
|
||||
let args = arguments;
|
||||
|
||||
let later = function() {
|
||||
timeout = null;
|
||||
if (!immediate) func.apply(context, args);
|
||||
};
|
||||
|
||||
let callNow = immediate && !timeout;
|
||||
|
||||
clearTimeout(timeout);
|
||||
|
||||
timeout = setTimeout(later, wait);
|
||||
|
||||
if (callNow) func.apply(context, args);
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var isNaturalValue = require("./is-natural-number-value")
|
||||
, toShortString = require("../to-short-string-representation");
|
||||
|
||||
module.exports = function (arg) {
|
||||
var num = Number(arg);
|
||||
if (!isNaturalValue(arg)) throw new TypeError(toShortString(arg) + " is not a natural number");
|
||||
return num;
|
||||
};
|
||||
@@ -0,0 +1,87 @@
|
||||
// ES2015 Symbol polyfill for environments that do not (or partially) support it
|
||||
|
||||
"use strict";
|
||||
|
||||
var d = require("d")
|
||||
, validateSymbol = require("./validate-symbol")
|
||||
, NativeSymbol = require("ext/global-this").Symbol
|
||||
, generateName = require("./lib/private/generate-name")
|
||||
, setupStandardSymbols = require("./lib/private/setup/standard-symbols")
|
||||
, setupSymbolRegistry = require("./lib/private/setup/symbol-registry");
|
||||
|
||||
var create = Object.create
|
||||
, defineProperties = Object.defineProperties
|
||||
, defineProperty = Object.defineProperty;
|
||||
|
||||
var SymbolPolyfill, HiddenSymbol, isNativeSafe;
|
||||
|
||||
if (typeof NativeSymbol === "function") {
|
||||
try {
|
||||
String(NativeSymbol());
|
||||
isNativeSafe = true;
|
||||
} catch (ignore) {}
|
||||
} else {
|
||||
NativeSymbol = null;
|
||||
}
|
||||
|
||||
// Internal constructor (not one exposed) for creating Symbol instances.
|
||||
// This one is used to ensure that `someSymbol instanceof Symbol` always return false
|
||||
HiddenSymbol = function Symbol(description) {
|
||||
if (this instanceof HiddenSymbol) throw new TypeError("Symbol is not a constructor");
|
||||
return SymbolPolyfill(description);
|
||||
};
|
||||
|
||||
// Exposed `Symbol` constructor
|
||||
// (returns instances of HiddenSymbol)
|
||||
module.exports = SymbolPolyfill = function Symbol(description) {
|
||||
var symbol;
|
||||
if (this instanceof Symbol) throw new TypeError("Symbol is not a constructor");
|
||||
if (isNativeSafe) return NativeSymbol(description);
|
||||
symbol = create(HiddenSymbol.prototype);
|
||||
description = description === undefined ? "" : String(description);
|
||||
return defineProperties(symbol, {
|
||||
__description__: d("", description),
|
||||
__name__: d("", generateName(description))
|
||||
});
|
||||
};
|
||||
|
||||
setupStandardSymbols(SymbolPolyfill);
|
||||
setupSymbolRegistry(SymbolPolyfill);
|
||||
|
||||
// Internal tweaks for real symbol producer
|
||||
defineProperties(HiddenSymbol.prototype, {
|
||||
constructor: d(SymbolPolyfill),
|
||||
toString: d("", function () { return this.__name__; })
|
||||
});
|
||||
|
||||
// Proper implementation of methods exposed on Symbol.prototype
|
||||
// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype
|
||||
defineProperties(SymbolPolyfill.prototype, {
|
||||
toString: d(function () { return "Symbol (" + validateSymbol(this).__description__ + ")"; }),
|
||||
valueOf: d(function () { return validateSymbol(this); })
|
||||
});
|
||||
defineProperty(
|
||||
SymbolPolyfill.prototype,
|
||||
SymbolPolyfill.toPrimitive,
|
||||
d("", function () {
|
||||
var symbol = validateSymbol(this);
|
||||
if (typeof symbol === "symbol") return symbol;
|
||||
return symbol.toString();
|
||||
})
|
||||
);
|
||||
defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d("c", "Symbol"));
|
||||
|
||||
// Proper implementaton of toPrimitive and toStringTag for returned symbol instances
|
||||
defineProperty(
|
||||
HiddenSymbol.prototype, SymbolPolyfill.toStringTag,
|
||||
d("c", SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])
|
||||
);
|
||||
|
||||
// Note: It's important to define `toPrimitive` as last one, as some implementations
|
||||
// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols)
|
||||
// And that may invoke error in definition flow:
|
||||
// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149
|
||||
defineProperty(
|
||||
HiddenSymbol.prototype, SymbolPolyfill.toPrimitive,
|
||||
d("c", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])
|
||||
);
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
List of binary file extensions.
|
||||
|
||||
@example
|
||||
```
|
||||
import binaryExtensions = require('binary-extensions');
|
||||
|
||||
console.log(binaryExtensions);
|
||||
//=> ['3ds', '3g2', …]
|
||||
```
|
||||
*/
|
||||
declare const binaryExtensions: readonly string[];
|
||||
|
||||
export = binaryExtensions;
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var setHours = Date.prototype.setHours;
|
||||
|
||||
module.exports = function () {
|
||||
setHours.call(this, 0, 0, 0, 0);
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
type Dict<T> = Record<string, T>;
|
||||
type Arrayable<T> = T | T[];
|
||||
type Default = Dict<any>;
|
||||
|
||||
declare function mri<T=Default>(args?: string[], options?: mri.Options): mri.Argv<T>;
|
||||
|
||||
declare namespace mri {
|
||||
export interface Options {
|
||||
boolean?: Arrayable<string>;
|
||||
string?: Arrayable<string>;
|
||||
alias?: Dict<Arrayable<string>>;
|
||||
default?: Dict<any>;
|
||||
unknown?(flag: string): void;
|
||||
}
|
||||
|
||||
export type Argv<T=Default> = T & {
|
||||
_: string[];
|
||||
}
|
||||
}
|
||||
|
||||
export = mri;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pairwise.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/pairwise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAazD"}
|
||||
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var GetPrototypeFromConstructor = require('./GetPrototypeFromConstructor');
|
||||
var IsArray = require('./IsArray');
|
||||
var OrdinaryObjectCreate = require('./OrdinaryObjectCreate');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-ordinarycreatefromconstructor
|
||||
|
||||
module.exports = function OrdinaryCreateFromConstructor(constructor, intrinsicDefaultProto) {
|
||||
GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic
|
||||
var proto = GetPrototypeFromConstructor(constructor, intrinsicDefaultProto);
|
||||
var slots = arguments.length < 3 ? [] : arguments[2];
|
||||
if (!IsArray(slots)) {
|
||||
throw new $TypeError('Assertion failed: if provided, `internalSlotsList` must be a List');
|
||||
}
|
||||
return OrdinaryObjectCreate(proto, slots);
|
||||
};
|
||||
@@ -0,0 +1,171 @@
|
||||
/* global define */
|
||||
import { isArray } from '../utils';
|
||||
|
||||
let SourceNode;
|
||||
|
||||
try {
|
||||
/* istanbul ignore next */
|
||||
if (typeof define !== 'function' || !define.amd) {
|
||||
// We don't support this in AMD environments. For these environments, we asusme that
|
||||
// they are running on the browser and thus have no need for the source-map library.
|
||||
let SourceMap = require('source-map');
|
||||
SourceNode = SourceMap.SourceNode;
|
||||
}
|
||||
} catch (err) {
|
||||
/* NOP */
|
||||
}
|
||||
|
||||
/* istanbul ignore if: tested but not covered in istanbul due to dist build */
|
||||
if (!SourceNode) {
|
||||
SourceNode = function(line, column, srcFile, chunks) {
|
||||
this.src = '';
|
||||
if (chunks) {
|
||||
this.add(chunks);
|
||||
}
|
||||
};
|
||||
/* istanbul ignore next */
|
||||
SourceNode.prototype = {
|
||||
add: function(chunks) {
|
||||
if (isArray(chunks)) {
|
||||
chunks = chunks.join('');
|
||||
}
|
||||
this.src += chunks;
|
||||
},
|
||||
prepend: function(chunks) {
|
||||
if (isArray(chunks)) {
|
||||
chunks = chunks.join('');
|
||||
}
|
||||
this.src = chunks + this.src;
|
||||
},
|
||||
toStringWithSourceMap: function() {
|
||||
return { code: this.toString() };
|
||||
},
|
||||
toString: function() {
|
||||
return this.src;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function castChunk(chunk, codeGen, loc) {
|
||||
if (isArray(chunk)) {
|
||||
let ret = [];
|
||||
|
||||
for (let i = 0, len = chunk.length; i < len; i++) {
|
||||
ret.push(codeGen.wrap(chunk[i], loc));
|
||||
}
|
||||
return ret;
|
||||
} else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
|
||||
// Handle primitives that the SourceNode will throw up on
|
||||
return chunk + '';
|
||||
}
|
||||
return chunk;
|
||||
}
|
||||
|
||||
function CodeGen(srcFile) {
|
||||
this.srcFile = srcFile;
|
||||
this.source = [];
|
||||
}
|
||||
|
||||
CodeGen.prototype = {
|
||||
isEmpty() {
|
||||
return !this.source.length;
|
||||
},
|
||||
prepend: function(source, loc) {
|
||||
this.source.unshift(this.wrap(source, loc));
|
||||
},
|
||||
push: function(source, loc) {
|
||||
this.source.push(this.wrap(source, loc));
|
||||
},
|
||||
|
||||
merge: function() {
|
||||
let source = this.empty();
|
||||
this.each(function(line) {
|
||||
source.add([' ', line, '\n']);
|
||||
});
|
||||
return source;
|
||||
},
|
||||
|
||||
each: function(iter) {
|
||||
for (let i = 0, len = this.source.length; i < len; i++) {
|
||||
iter(this.source[i]);
|
||||
}
|
||||
},
|
||||
|
||||
empty: function() {
|
||||
let loc = this.currentLocation || { start: {} };
|
||||
return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
|
||||
},
|
||||
wrap: function(chunk, loc = this.currentLocation || { start: {} }) {
|
||||
if (chunk instanceof SourceNode) {
|
||||
return chunk;
|
||||
}
|
||||
|
||||
chunk = castChunk(chunk, this, loc);
|
||||
|
||||
return new SourceNode(
|
||||
loc.start.line,
|
||||
loc.start.column,
|
||||
this.srcFile,
|
||||
chunk
|
||||
);
|
||||
},
|
||||
|
||||
functionCall: function(fn, type, params) {
|
||||
params = this.generateList(params);
|
||||
return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
|
||||
},
|
||||
|
||||
quotedString: function(str) {
|
||||
return (
|
||||
'"' +
|
||||
(str + '')
|
||||
.replace(/\\/g, '\\\\')
|
||||
.replace(/"/g, '\\"')
|
||||
.replace(/\n/g, '\\n')
|
||||
.replace(/\r/g, '\\r')
|
||||
.replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
|
||||
.replace(/\u2029/g, '\\u2029') +
|
||||
'"'
|
||||
);
|
||||
},
|
||||
|
||||
objectLiteral: function(obj) {
|
||||
let pairs = [];
|
||||
|
||||
Object.keys(obj).forEach(key => {
|
||||
let value = castChunk(obj[key], this);
|
||||
if (value !== 'undefined') {
|
||||
pairs.push([this.quotedString(key), ':', value]);
|
||||
}
|
||||
});
|
||||
|
||||
let ret = this.generateList(pairs);
|
||||
ret.prepend('{');
|
||||
ret.add('}');
|
||||
return ret;
|
||||
},
|
||||
|
||||
generateList: function(entries) {
|
||||
let ret = this.empty();
|
||||
|
||||
for (let i = 0, len = entries.length; i < len; i++) {
|
||||
if (i) {
|
||||
ret.add(',');
|
||||
}
|
||||
|
||||
ret.add(castChunk(entries[i], this));
|
||||
}
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
generateArray: function(entries) {
|
||||
let ret = this.generateList(entries);
|
||||
ret.prepend('[');
|
||||
ret.add(']');
|
||||
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
export default CodeGen;
|
||||
@@ -0,0 +1,35 @@
|
||||
var baseIsEqual = require('./_baseIsEqual');
|
||||
|
||||
/**
|
||||
* Performs a deep comparison between two values to determine if they are
|
||||
* equivalent.
|
||||
*
|
||||
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
||||
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
||||
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
||||
* by their own, not inherited, enumerable properties. Functions and DOM
|
||||
* nodes are compared by strict equality, i.e. `===`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 0.1.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'a': 1 };
|
||||
* var other = { 'a': 1 };
|
||||
*
|
||||
* _.isEqual(object, other);
|
||||
* // => true
|
||||
*
|
||||
* object === other;
|
||||
* // => false
|
||||
*/
|
||||
function isEqual(value, other) {
|
||||
return baseIsEqual(value, other);
|
||||
}
|
||||
|
||||
module.exports = isEqual;
|
||||
@@ -0,0 +1,340 @@
|
||||
'use strict';
|
||||
|
||||
var parsePath = require('parse-path');
|
||||
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var parsePath__default = /*#__PURE__*/_interopDefaultLegacy(parsePath);
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
||||
const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain';
|
||||
const DATA_URL_DEFAULT_CHARSET = 'us-ascii';
|
||||
|
||||
const testParameter = (name, filters) => filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name);
|
||||
|
||||
const normalizeDataURL = (urlString, {stripHash}) => {
|
||||
const match = /^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(urlString);
|
||||
|
||||
if (!match) {
|
||||
throw new Error(`Invalid URL: ${urlString}`);
|
||||
}
|
||||
|
||||
let {type, data, hash} = match.groups;
|
||||
const mediaType = type.split(';');
|
||||
hash = stripHash ? '' : hash;
|
||||
|
||||
let isBase64 = false;
|
||||
if (mediaType[mediaType.length - 1] === 'base64') {
|
||||
mediaType.pop();
|
||||
isBase64 = true;
|
||||
}
|
||||
|
||||
// Lowercase MIME type
|
||||
const mimeType = (mediaType.shift() || '').toLowerCase();
|
||||
const attributes = mediaType
|
||||
.map(attribute => {
|
||||
let [key, value = ''] = attribute.split('=').map(string => string.trim());
|
||||
|
||||
// Lowercase `charset`
|
||||
if (key === 'charset') {
|
||||
value = value.toLowerCase();
|
||||
|
||||
if (value === DATA_URL_DEFAULT_CHARSET) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
return `${key}${value ? `=${value}` : ''}`;
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
const normalizedMediaType = [
|
||||
...attributes,
|
||||
];
|
||||
|
||||
if (isBase64) {
|
||||
normalizedMediaType.push('base64');
|
||||
}
|
||||
|
||||
if (normalizedMediaType.length > 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) {
|
||||
normalizedMediaType.unshift(mimeType);
|
||||
}
|
||||
|
||||
return `data:${normalizedMediaType.join(';')},${isBase64 ? data.trim() : data}${hash ? `#${hash}` : ''}`;
|
||||
};
|
||||
|
||||
function normalizeUrl(urlString, options) {
|
||||
options = {
|
||||
defaultProtocol: 'http:',
|
||||
normalizeProtocol: true,
|
||||
forceHttp: false,
|
||||
forceHttps: false,
|
||||
stripAuthentication: true,
|
||||
stripHash: false,
|
||||
stripTextFragment: true,
|
||||
stripWWW: true,
|
||||
removeQueryParameters: [/^utm_\w+/i],
|
||||
removeTrailingSlash: true,
|
||||
removeSingleSlash: true,
|
||||
removeDirectoryIndex: false,
|
||||
sortQueryParameters: true,
|
||||
...options,
|
||||
};
|
||||
|
||||
urlString = urlString.trim();
|
||||
|
||||
// Data URL
|
||||
if (/^data:/i.test(urlString)) {
|
||||
return normalizeDataURL(urlString, options);
|
||||
}
|
||||
|
||||
if (/^view-source:/i.test(urlString)) {
|
||||
throw new Error('`view-source:` is not supported as it is a non-standard protocol');
|
||||
}
|
||||
|
||||
const hasRelativeProtocol = urlString.startsWith('//');
|
||||
const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString);
|
||||
|
||||
// Prepend protocol
|
||||
if (!isRelativeUrl) {
|
||||
urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol);
|
||||
}
|
||||
|
||||
const urlObject = new URL(urlString);
|
||||
|
||||
if (options.forceHttp && options.forceHttps) {
|
||||
throw new Error('The `forceHttp` and `forceHttps` options cannot be used together');
|
||||
}
|
||||
|
||||
if (options.forceHttp && urlObject.protocol === 'https:') {
|
||||
urlObject.protocol = 'http:';
|
||||
}
|
||||
|
||||
if (options.forceHttps && urlObject.protocol === 'http:') {
|
||||
urlObject.protocol = 'https:';
|
||||
}
|
||||
|
||||
// Remove auth
|
||||
if (options.stripAuthentication) {
|
||||
urlObject.username = '';
|
||||
urlObject.password = '';
|
||||
}
|
||||
|
||||
// Remove hash
|
||||
if (options.stripHash) {
|
||||
urlObject.hash = '';
|
||||
} else if (options.stripTextFragment) {
|
||||
urlObject.hash = urlObject.hash.replace(/#?:~:text.*?$/i, '');
|
||||
}
|
||||
|
||||
// Remove duplicate slashes if not preceded by a protocol
|
||||
// NOTE: This could be implemented using a single negative lookbehind
|
||||
// regex, but we avoid that to maintain compatibility with older js engines
|
||||
// which do not have support for that feature.
|
||||
if (urlObject.pathname) {
|
||||
// TODO: Replace everything below with `urlObject.pathname = urlObject.pathname.replace(/(?<!\b[a-z][a-z\d+\-.]{1,50}:)\/{2,}/g, '/');` when Safari supports negative lookbehind.
|
||||
|
||||
// Split the string by occurrences of this protocol regex, and perform
|
||||
// duplicate-slash replacement on the strings between those occurrences
|
||||
// (if any).
|
||||
const protocolRegex = /\b[a-z][a-z\d+\-.]{1,50}:\/\//g;
|
||||
|
||||
let lastIndex = 0;
|
||||
let result = '';
|
||||
for (;;) {
|
||||
const match = protocolRegex.exec(urlObject.pathname);
|
||||
if (!match) {
|
||||
break;
|
||||
}
|
||||
|
||||
const protocol = match[0];
|
||||
const protocolAtIndex = match.index;
|
||||
const intermediate = urlObject.pathname.slice(lastIndex, protocolAtIndex);
|
||||
|
||||
result += intermediate.replace(/\/{2,}/g, '/');
|
||||
result += protocol;
|
||||
lastIndex = protocolAtIndex + protocol.length;
|
||||
}
|
||||
|
||||
const remnant = urlObject.pathname.slice(lastIndex, urlObject.pathname.length);
|
||||
result += remnant.replace(/\/{2,}/g, '/');
|
||||
|
||||
urlObject.pathname = result;
|
||||
}
|
||||
|
||||
// Decode URI octets
|
||||
if (urlObject.pathname) {
|
||||
try {
|
||||
urlObject.pathname = decodeURI(urlObject.pathname);
|
||||
} catch {}
|
||||
}
|
||||
|
||||
// Remove directory index
|
||||
if (options.removeDirectoryIndex === true) {
|
||||
options.removeDirectoryIndex = [/^index\.[a-z]+$/];
|
||||
}
|
||||
|
||||
if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) {
|
||||
let pathComponents = urlObject.pathname.split('/');
|
||||
const lastComponent = pathComponents[pathComponents.length - 1];
|
||||
|
||||
if (testParameter(lastComponent, options.removeDirectoryIndex)) {
|
||||
pathComponents = pathComponents.slice(0, -1);
|
||||
urlObject.pathname = pathComponents.slice(1).join('/') + '/';
|
||||
}
|
||||
}
|
||||
|
||||
if (urlObject.hostname) {
|
||||
// Remove trailing dot
|
||||
urlObject.hostname = urlObject.hostname.replace(/\.$/, '');
|
||||
|
||||
// Remove `www.`
|
||||
if (options.stripWWW && /^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(urlObject.hostname)) {
|
||||
// Each label should be max 63 at length (min: 1).
|
||||
// Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
|
||||
// Each TLD should be up to 63 characters long (min: 2).
|
||||
// It is technically possible to have a single character TLD, but none currently exist.
|
||||
urlObject.hostname = urlObject.hostname.replace(/^www\./, '');
|
||||
}
|
||||
}
|
||||
|
||||
// Remove query unwanted parameters
|
||||
if (Array.isArray(options.removeQueryParameters)) {
|
||||
// eslint-disable-next-line unicorn/no-useless-spread -- We are intentionally spreading to get a copy.
|
||||
for (const key of [...urlObject.searchParams.keys()]) {
|
||||
if (testParameter(key, options.removeQueryParameters)) {
|
||||
urlObject.searchParams.delete(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (options.removeQueryParameters === true) {
|
||||
urlObject.search = '';
|
||||
}
|
||||
|
||||
// Sort query parameters
|
||||
if (options.sortQueryParameters) {
|
||||
urlObject.searchParams.sort();
|
||||
|
||||
// Calling `.sort()` encodes the search parameters, so we need to decode them again.
|
||||
try {
|
||||
urlObject.search = decodeURIComponent(urlObject.search);
|
||||
} catch {}
|
||||
}
|
||||
|
||||
if (options.removeTrailingSlash) {
|
||||
urlObject.pathname = urlObject.pathname.replace(/\/$/, '');
|
||||
}
|
||||
|
||||
const oldUrlString = urlString;
|
||||
|
||||
// Take advantage of many of the Node `url` normalizations
|
||||
urlString = urlObject.toString();
|
||||
|
||||
if (!options.removeSingleSlash && urlObject.pathname === '/' && !oldUrlString.endsWith('/') && urlObject.hash === '') {
|
||||
urlString = urlString.replace(/\/$/, '');
|
||||
}
|
||||
|
||||
// Remove ending `/` unless removeSingleSlash is false
|
||||
if ((options.removeTrailingSlash || urlObject.pathname === '/') && urlObject.hash === '' && options.removeSingleSlash) {
|
||||
urlString = urlString.replace(/\/$/, '');
|
||||
}
|
||||
|
||||
// Restore relative protocol, if applicable
|
||||
if (hasRelativeProtocol && !options.normalizeProtocol) {
|
||||
urlString = urlString.replace(/^http:\/\//, '//');
|
||||
}
|
||||
|
||||
// Remove http/https
|
||||
if (options.stripProtocol) {
|
||||
urlString = urlString.replace(/^(?:https?:)?\/\//, '');
|
||||
}
|
||||
|
||||
return urlString;
|
||||
}
|
||||
|
||||
// Dependencies
|
||||
|
||||
/**
|
||||
* parseUrl
|
||||
* Parses the input url.
|
||||
*
|
||||
* **Note**: This *throws* if invalid urls are provided.
|
||||
*
|
||||
* @name parseUrl
|
||||
* @function
|
||||
* @param {String} url The input url.
|
||||
* @param {Boolean|Object} normalize Whether to normalize the url or not.
|
||||
* Default is `false`. If `true`, the url will
|
||||
* be normalized. If an object, it will be the
|
||||
* options object sent to [`normalize-url`](https://github.com/sindresorhus/normalize-url).
|
||||
*
|
||||
* For SSH urls, normalize won't work.
|
||||
*
|
||||
* @return {Object} An object containing the following fields:
|
||||
*
|
||||
* - `protocols` (Array): An array with the url protocols (usually it has one element).
|
||||
* - `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`.
|
||||
* - `port` (null|Number): The domain port.
|
||||
* - `resource` (String): The url domain (including subdomains).
|
||||
* - `user` (String): The authentication user (usually for ssh urls).
|
||||
* - `pathname` (String): The url pathname.
|
||||
* - `hash` (String): The url hash.
|
||||
* - `search` (String): The url querystring value.
|
||||
* - `href` (String): The input url.
|
||||
* - `query` (Object): The url querystring, parsed as object.
|
||||
* - `parse_failed` (Boolean): Whether the parsing failed or not.
|
||||
*/
|
||||
const parseUrl = (url, normalize = false) => {
|
||||
|
||||
// Constants
|
||||
const GIT_RE = /^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:]([\~,\.\w,\-,\_,\/]+?(?:\.git|\/)?)$/;
|
||||
|
||||
const throwErr = msg => {
|
||||
const err = new Error(msg);
|
||||
err.subject_url = url;
|
||||
throw err
|
||||
};
|
||||
|
||||
if (typeof url !== "string" || !url.trim()) {
|
||||
throwErr("Invalid url.");
|
||||
}
|
||||
|
||||
if (url.length > parseUrl.MAX_INPUT_LENGTH) {
|
||||
throwErr("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH.");
|
||||
}
|
||||
|
||||
if (normalize) {
|
||||
if (typeof normalize !== "object") {
|
||||
normalize = {
|
||||
stripHash: false
|
||||
};
|
||||
}
|
||||
url = normalizeUrl(url, normalize);
|
||||
}
|
||||
|
||||
const parsed = parsePath__default["default"](url);
|
||||
|
||||
// Potential git-ssh urls
|
||||
if (parsed.parse_failed) {
|
||||
const matched = parsed.href.match(GIT_RE);
|
||||
|
||||
if (matched) {
|
||||
parsed.protocols = ["ssh"];
|
||||
parsed.protocol = "ssh";
|
||||
parsed.resource = matched[2];
|
||||
parsed.host = matched[2];
|
||||
parsed.user = matched[1];
|
||||
parsed.pathname = `/${matched[3]}`;
|
||||
parsed.parse_failed = false;
|
||||
} else {
|
||||
throwErr("URL parsing failed.");
|
||||
}
|
||||
}
|
||||
|
||||
return parsed;
|
||||
};
|
||||
|
||||
parseUrl.MAX_INPUT_LENGTH = 2048;
|
||||
|
||||
module.exports = parseUrl;
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var assert = require("chai").assert
|
||||
, isToStringTagSupported = require("../../lib/is-to-string-tag-supported");
|
||||
|
||||
describe("lib/is-to-string-tag-supported", function () {
|
||||
it("Should return boolean", function () {
|
||||
assert(typeof isToStringTagSupported === "boolean");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"concatMapTo.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/concatMapTo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG9E,kGAAkG;AAClG,wBAAgB,WAAW,CAAC,CAAC,SAAS,eAAe,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,gBAAgB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9H,0JAA0J;AAC1J,wBAAgB,WAAW,CAAC,CAAC,SAAS,eAAe,CAAC,OAAO,CAAC,EAC5D,UAAU,EAAE,CAAC,EACb,cAAc,EAAE,SAAS,GACxB,gBAAgB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,0JAA0J;AAC1J,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,OAAO,CAAC,EAClE,UAAU,EAAE,CAAC,EACb,cAAc,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC,GAC3G,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
||||
@@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var gOPD = require('../');
|
||||
|
||||
test('gOPD', function (t) {
|
||||
t.test('supported', { skip: !gOPD }, function (st) {
|
||||
st.equal(typeof gOPD, 'function', 'is a function');
|
||||
|
||||
var obj = { x: 1 };
|
||||
st.ok('x' in obj, 'property exists');
|
||||
|
||||
var desc = gOPD(obj, 'x');
|
||||
st.deepEqual(
|
||||
desc,
|
||||
{
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: 1,
|
||||
writable: true
|
||||
},
|
||||
'descriptor is as expected'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('not supported', { skip: gOPD }, function (st) {
|
||||
st.notOk(gOPD, 'is falsy');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EmptyError.js","sourceRoot":"","sources":["../../../../src/internal/util/EmptyError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAwBtD,MAAM,CAAC,MAAM,UAAU,GAAmB,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,cAAc;IAC5F,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IACzB,IAAI,CAAC,OAAO,GAAG,yBAAyB,CAAC;AAC3C,CAAC,CAAC,CAAC"}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "ip",
|
||||
"version": "2.0.0",
|
||||
"author": "Fedor Indutny <fedor@indutny.com>",
|
||||
"homepage": "https://github.com/indutny/node-ip",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/indutny/node-ip.git"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"README.md"
|
||||
],
|
||||
"main": "lib/ip",
|
||||
"devDependencies": {
|
||||
"eslint": "^8.15.0",
|
||||
"mocha": "^10.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint lib/*.js test/*.js",
|
||||
"test": "npm run lint && mocha --reporter spec test/*-test.js",
|
||||
"fix": "npm run lint -- --fix"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { EMPTY_ARR } from "./constants";
|
||||
|
||||
/**
|
||||
* Assign properties from `props` to `obj`
|
||||
* @template O, P The obj and props types
|
||||
* @param {O} obj The object to copy properties to
|
||||
* @param {P} props The object to copy properties from
|
||||
* @returns {O & P}
|
||||
*/
|
||||
export function assign(obj, props) {
|
||||
// @ts-ignore We change the type of `obj` to be `O & P`
|
||||
for (let i in props) obj[i] = props[i];
|
||||
return /** @type {O & P} */ (obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a child node from its parent if attached. This is a workaround for
|
||||
* IE11 which doesn't support `Element.prototype.remove()`. Using this function
|
||||
* is smaller than including a dedicated polyfill.
|
||||
* @param {Node} node The node to remove
|
||||
*/
|
||||
export function removeNode(node) {
|
||||
let parentNode = node.parentNode;
|
||||
if (parentNode) parentNode.removeChild(node);
|
||||
}
|
||||
|
||||
export const slice = EMPTY_ARR.slice;
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "is-stream",
|
||||
"version": "3.0.0",
|
||||
"description": "Check if something is a Node.js stream",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is-stream",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"stream",
|
||||
"type",
|
||||
"streams",
|
||||
"writable",
|
||||
"readable",
|
||||
"duplex",
|
||||
"transform",
|
||||
"check",
|
||||
"detect",
|
||||
"is"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.4.13",
|
||||
"ava": "^3.15.0",
|
||||
"tempy": "^1.0.1",
|
||||
"tsd": "^0.17.0",
|
||||
"xo": "^0.44.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function forEach(array, callback) {
|
||||
for (var i = 0; i < array.length; i += 1) {
|
||||
callback(array[i], i, array); // eslint-disable-line callback-return
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
'use strict';
|
||||
|
||||
require('../auto');
|
||||
|
||||
var test = require('tape');
|
||||
var defineProperties = require('define-properties');
|
||||
var callBind = require('call-bind');
|
||||
|
||||
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
var functionsHaveNames = require('functions-have-names')();
|
||||
var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();
|
||||
var hasStrictMode = require('has-strict-mode')();
|
||||
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('shimmed', function (t) {
|
||||
var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags');
|
||||
|
||||
t.equal(descriptor.get.length, 0, 'RegExp#flags getter has a length of 0');
|
||||
|
||||
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
|
||||
st.equal(descriptor.get.name, functionsHaveConfigurableNames ? 'get flags' : 'flags', 'RegExp#flags getter has name "get flags" (or "flags" if function names are not configurable)');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
|
||||
et.equal(false, isEnumerable.call(RegExp.prototype, 'flags'), 'RegExp#flags is not enumerable');
|
||||
et.end();
|
||||
});
|
||||
|
||||
t.test('bad array/this value', { skip: !hasStrictMode }, function (st) {
|
||||
st['throws'](function () { return descriptor.get.call(undefined); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { return descriptor.get.call(null); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('has the correct descriptor', function (st) {
|
||||
st.equal(descriptor.configurable, true);
|
||||
st.equal(descriptor.enumerable, false);
|
||||
st.equal(typeof descriptor.get, 'function');
|
||||
st.equal(descriptor.set, undefined);
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(callBind(descriptor.get), t);
|
||||
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user