new license file version [CI SKIP]
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
'use strict'
|
||||
|
||||
var reusify = require('../')
|
||||
var fib = require('./fib')
|
||||
var instance = reusify(MyObject)
|
||||
var max = 100000000
|
||||
var start = Date.now()
|
||||
|
||||
function reuseNoCodeFunction () {
|
||||
var obj = instance.get()
|
||||
obj.num = 100
|
||||
obj.func()
|
||||
obj.num = 0
|
||||
instance.release(obj)
|
||||
}
|
||||
|
||||
function MyObject () {
|
||||
this.next = null
|
||||
var that = this
|
||||
this.num = 0
|
||||
this.func = function () {
|
||||
/* eslint no-constant-condition: "off" */
|
||||
if (null) {
|
||||
// do nothing
|
||||
} else {
|
||||
fib(that.num)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < max; i++) {
|
||||
reuseNoCodeFunction()
|
||||
}
|
||||
|
||||
var time = Date.now() - start
|
||||
console.log('Total time', time)
|
||||
console.log('Total iterations', max)
|
||||
console.log('Iteration/s', max / time * 1000)
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CurrencyDigits.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ecma402-abstract/NumberFormat/CurrencyDigits.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,cAAc,CAC5B,CAAC,EAAE,MAAM,EACT,EAAC,kBAAkB,EAAC,EAAE;IAAC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAC,GACjE,MAAM,CAIR"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"78":0.10454,"91":0.00581,"102":0.00581,"107":0.00581,"108":0.2207,"109":5.5176,"110":0.85378,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 92 93 94 95 96 97 98 99 100 101 103 104 105 106 111 112 3.5 3.6"},D:{"75":0.78989,"76":0.11616,"79":0.02323,"81":0.00581,"83":0.02323,"87":0.08712,"88":0.02323,"93":0.18005,"94":0.01162,"95":0.04066,"99":0.01162,"100":0.01162,"101":0.03485,"102":1.07448,"103":0.17424,"104":0.02323,"105":0.35429,"106":0.02904,"107":0.08712,"108":2.01538,"109":12.90538,"110":7.30646,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 77 78 80 84 85 86 89 90 91 92 96 97 98 111 112 113"},F:{"93":0.05227,"94":0.22651,"95":0.08712,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 9.5-9.6 10.5 10.6 11.1 11.5 11.6 12.1","10.0-10.1":0},B:{"89":0.01162,"103":0.02904,"104":0.13358,"105":0.01162,"106":0.04646,"107":0.02904,"108":0.1452,"109":4.12368,"110":8.26478,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 90 91 92 93 94 95 96 97 98 99 100 101 102"},E:{"4":0,"13":0.01742,"14":0.19166,"15":0.06389,_:"0 5 6 7 8 9 10 11 12 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 16.4","12.1":0.02323,"13.1":0.34267,"14.1":0.57499,"15.1":0.37171,"15.2-15.3":0.12778,"15.4":0.11616,"15.5":1.58558,"15.6":2.06184,"16.0":0.15682,"16.1":0.48206,"16.2":3.53707,"16.3":1.62043},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.05498,"11.0-11.2":0.00239,"11.3-11.4":0.00956,"12.0-12.1":0.00239,"12.2-12.5":0.32034,"13.0-13.1":0,"13.2":0,"13.3":0,"13.4-13.7":0.04303,"14.0-14.4":0.05498,"14.5-14.8":0.5594,"15.0-15.1":0.08367,"15.2-15.3":0.1267,"15.4":0.16734,"15.5":0.34903,"15.6":2.51971,"16.0":1.74993,"16.1":7.49458,"16.2":6.07934,"16.3":3.50464,"16.4":0.01912},P:{"4":0.06522,"20":0.72829,"5.0-5.4":0.04075,"6.2-6.4":0.08151,"7.2-7.4":0.60112,"8.2":0.01016,"9.2":0.04075,"10.1":0.01011,"11.1-11.2":0.14264,"12.0":0.04075,"13.0":0.12226,"14.0":0.01087,"15.0":0.08151,"16.0":0.04348,"17.0":0.26088,"18.0":0.03261,"19.0":1.15222},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.01677},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"11":0.04066,_:"6 7 8 9 10 5.5"},N:{"10":0.03712,"11":0.07423},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.00419},H:{"0":0.01985},L:{"0":16.57858},R:{_:"0"},M:{"0":0.81344},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-hasproperty
|
||||
|
||||
module.exports = function HasProperty(O, P) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: `O` must be an Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: `P` must be a Property Key');
|
||||
}
|
||||
return P in O;
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
var $taSome = callBound('TypedArray.prototype.some', true);
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
var isTypedArray = require('is-typed-array');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-validatetypedarray
|
||||
|
||||
module.exports = function ValidateTypedArray(O) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: O must be an Object');
|
||||
}
|
||||
if (!isTypedArray(O)) {
|
||||
throw new $TypeError('Assertion failed: O must be a TypedArray');
|
||||
}
|
||||
|
||||
// without `.some` (like in node 0.10), there's no way to check buffer detachment, but also no way to be detached
|
||||
if ($taSome) {
|
||||
$taSome(O, function () { return true; });
|
||||
}
|
||||
|
||||
return O.buffer;
|
||||
};
|
||||
@@ -0,0 +1,151 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var updateDb = require('update-browserslist-db')
|
||||
var fs = require('fs')
|
||||
|
||||
var browserslist = require('./')
|
||||
var pkg = require('./package.json')
|
||||
|
||||
var args = process.argv.slice(2)
|
||||
|
||||
var USAGE =
|
||||
'Usage:\n' +
|
||||
' npx browserslist\n' +
|
||||
' npx browserslist "QUERIES"\n' +
|
||||
' npx browserslist --json "QUERIES"\n' +
|
||||
' npx browserslist --config="path/to/browserlist/file"\n' +
|
||||
' npx browserslist --coverage "QUERIES"\n' +
|
||||
' npx browserslist --coverage=US "QUERIES"\n' +
|
||||
' npx browserslist --coverage=US,RU,global "QUERIES"\n' +
|
||||
' npx browserslist --env="environment name defined in config"\n' +
|
||||
' npx browserslist --stats="path/to/browserlist/stats/file"\n' +
|
||||
' npx browserslist --mobile-to-desktop\n' +
|
||||
' npx browserslist --ignore-unknown-versions\n'
|
||||
|
||||
function isArg(arg) {
|
||||
return args.some(function (str) {
|
||||
return str === arg || str.indexOf(arg + '=') === 0
|
||||
})
|
||||
}
|
||||
|
||||
function error(msg) {
|
||||
process.stderr.write('browserslist: ' + msg + '\n')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
if (isArg('--help') || isArg('-h')) {
|
||||
process.stdout.write(pkg.description + '.\n\n' + USAGE + '\n')
|
||||
} else if (isArg('--version') || isArg('-v')) {
|
||||
process.stdout.write('browserslist ' + pkg.version + '\n')
|
||||
} else if (isArg('--update-db')) {
|
||||
/* c8 ignore next 3 */
|
||||
updateDb(function (str) {
|
||||
process.stdout.write(str)
|
||||
})
|
||||
} else {
|
||||
var mode = 'browsers'
|
||||
var opts = {}
|
||||
var queries
|
||||
var areas
|
||||
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
if (args[i][0] !== '-') {
|
||||
queries = args[i].replace(/^["']|["']$/g, '')
|
||||
continue
|
||||
}
|
||||
|
||||
var arg = args[i].split('=')
|
||||
var name = arg[0]
|
||||
var value = arg[1]
|
||||
|
||||
if (value) value = value.replace(/^["']|["']$/g, '')
|
||||
|
||||
if (name === '--config' || name === '-b') {
|
||||
opts.config = value
|
||||
} else if (name === '--env' || name === '-e') {
|
||||
opts.env = value
|
||||
} else if (name === '--stats' || name === '-s') {
|
||||
opts.stats = value
|
||||
} else if (name === '--coverage' || name === '-c') {
|
||||
if (mode !== 'json') mode = 'coverage'
|
||||
if (value) {
|
||||
areas = value.split(',')
|
||||
} else {
|
||||
areas = ['global']
|
||||
}
|
||||
} else if (name === '--json') {
|
||||
mode = 'json'
|
||||
} else if (name === '--mobile-to-desktop') {
|
||||
/* c8 ignore next */
|
||||
opts.mobileToDesktop = true
|
||||
} else if (name === '--ignore-unknown-versions') {
|
||||
/* c8 ignore next */
|
||||
opts.ignoreUnknownVersions = true
|
||||
} else {
|
||||
error('Unknown arguments ' + args[i] + '.\n\n' + USAGE)
|
||||
}
|
||||
}
|
||||
|
||||
var browsers
|
||||
try {
|
||||
browsers = browserslist(queries, opts)
|
||||
} catch (e) {
|
||||
if (e.name === 'BrowserslistError') {
|
||||
error(e.message)
|
||||
} /* c8 ignore start */ else {
|
||||
throw e
|
||||
} /* c8 ignore end */
|
||||
}
|
||||
|
||||
var coverage
|
||||
if (mode === 'browsers') {
|
||||
browsers.forEach(function (browser) {
|
||||
process.stdout.write(browser + '\n')
|
||||
})
|
||||
} else if (areas) {
|
||||
coverage = areas.map(function (area) {
|
||||
var stats
|
||||
if (area !== 'global') {
|
||||
stats = area
|
||||
} else if (opts.stats) {
|
||||
stats = JSON.parse(fs.readFileSync(opts.stats))
|
||||
}
|
||||
var result = browserslist.coverage(browsers, stats)
|
||||
var round = Math.round(result * 100) / 100.0
|
||||
|
||||
return [area, round]
|
||||
})
|
||||
|
||||
if (mode === 'coverage') {
|
||||
var prefix = 'These browsers account for '
|
||||
process.stdout.write(prefix)
|
||||
coverage.forEach(function (data, index) {
|
||||
var area = data[0]
|
||||
var round = data[1]
|
||||
var end = 'globally'
|
||||
if (area && area !== 'global') {
|
||||
end = 'in the ' + area.toUpperCase()
|
||||
} else if (opts.stats) {
|
||||
end = 'in custom statistics'
|
||||
}
|
||||
|
||||
if (index !== 0) {
|
||||
process.stdout.write(prefix.replace(/./g, ' '))
|
||||
}
|
||||
|
||||
process.stdout.write(round + '% of all users ' + end + '\n')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (mode === 'json') {
|
||||
var data = { browsers: browsers }
|
||||
if (coverage) {
|
||||
data.coverage = coverage.reduce(function (object, j) {
|
||||
object[j[0]] = j[1]
|
||||
return object
|
||||
}, {})
|
||||
}
|
||||
process.stdout.write(JSON.stringify(data, null, ' ') + '\n')
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"is-bigint","version":"1.0.4","files":{".eslintignore":{"checkedAt":1678883671537,"integrity":"sha512-VLhEcqup3IHXtZJPt07ZYoA9JNRjy1jhU/NU41Yw4E8mEyea/z+6bw5hL3lhCO09pji9E0BH2Q3aDXdc3i9zBg==","mode":420,"size":10},".nycrc":{"checkedAt":1678883669555,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},".eslintrc":{"checkedAt":1678883671772,"integrity":"sha512-1+bgwGqKBU/zgckKmlV27oW10HwkTderUlvBDRjP/d796z1Jf7s5moxbujht7nPiANkQt/WHenX5OUN9WBS8IA==","mode":420,"size":155},"LICENSE":{"checkedAt":1678883671772,"integrity":"sha512-2OWQhRmHTKt3rYbHOrwTDQOhnQEL6mjR3H1mMql4QfQcDa0rpjgTAf2zpWl5RLE5AzLmekxiNW5px+HAcw0n0Q==","mode":420,"size":1071},"index.js":{"checkedAt":1678883671772,"integrity":"sha512-I6AGIAWwpHHbq9r+BrgmOCr90wY/eT362BDx1KqPWC56m5+VlS5ptv/M6ReCYJOM0tblx6okuXaozsXhDcONEA==","mode":420,"size":737},"test/index.js":{"checkedAt":1678883671772,"integrity":"sha512-ZzTVNYFbv/3W6XuJF7Ag+XqHSRzCQQplR24lRqAGT2+ElHO/3Vtten7A1Y9BpWIlTBjIpxyXv0h+vVpVy4182Q==","mode":420,"size":2252},"package.json":{"checkedAt":1678883671772,"integrity":"sha512-4PRMrT0/ECtiz1aJpyDG0jevlG9ge85Nt21aU+KSmp3zkOEM97f4hsbNBIqv5mR40wsaPknd/cK5L7BA4muumg==","mode":420,"size":1540},"README.md":{"checkedAt":1678883671774,"integrity":"sha512-3XZWsZKRoFXGvvz4SGC9eXjMxp4sX9+dtHOKweIe3tByY+s/CjxqX3JHeYtSoM7TZ5xnkQYGFnA9QfBBsJT4jw==","mode":420,"size":1623},"CHANGELOG.md":{"checkedAt":1678883671774,"integrity":"sha512-h2GkrfzBuFhbf6YvKTUCKJQnHlm3/t3sQs4LU592sUR08EH5GNaphywqb7gKxyIiuaK9aIl0PfXS4ZcN1krKQw==","mode":420,"size":6674},".github/FUNDING.yml":{"checkedAt":1678883671774,"integrity":"sha512-1o4XBlZQMLt7dAg0jfHm+tNirwwixjPf0gPQ5HI17wn4ipR2sMyVR622xYqNBVvjk7SAdXeCsAYAfKsq3HJPqw==","mode":420,"size":580}}}
|
||||
@@ -0,0 +1,14 @@
|
||||
var baseSetToString = require('./_baseSetToString'),
|
||||
shortOut = require('./_shortOut');
|
||||
|
||||
/**
|
||||
* Sets the `toString` method of `func` to return `string`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to modify.
|
||||
* @param {Function} string The `toString` result.
|
||||
* @returns {Function} Returns `func`.
|
||||
*/
|
||||
var setToString = shortOut(baseSetToString);
|
||||
|
||||
module.exports = setToString;
|
||||
@@ -0,0 +1,53 @@
|
||||
'use strict';
|
||||
|
||||
var ee = require('../');
|
||||
|
||||
module.exports = function (t, a) {
|
||||
var x = {}, y = {}, z = {}, count, count2, count3, pipe;
|
||||
|
||||
ee(x);
|
||||
x = Object.create(x);
|
||||
ee(y);
|
||||
ee(z);
|
||||
|
||||
count = 0;
|
||||
count2 = 0;
|
||||
count3 = 0;
|
||||
x.on('foo', function () {
|
||||
++count;
|
||||
});
|
||||
y.on('foo', function () {
|
||||
++count2;
|
||||
});
|
||||
z.on('foo', function () {
|
||||
++count3;
|
||||
});
|
||||
|
||||
x.emit('foo');
|
||||
a(count, 1, "Pre pipe, x");
|
||||
a(count2, 0, "Pre pipe, y");
|
||||
a(count3, 0, "Pre pipe, z");
|
||||
|
||||
pipe = t(x, y);
|
||||
x.emit('foo');
|
||||
a(count, 2, "Post pipe, x");
|
||||
a(count2, 1, "Post pipe, y");
|
||||
a(count3, 0, "Post pipe, z");
|
||||
|
||||
y.emit('foo');
|
||||
a(count, 2, "Post pipe, on y, x");
|
||||
a(count2, 2, "Post pipe, on y, y");
|
||||
a(count3, 0, "Post pipe, on y, z");
|
||||
|
||||
t(x, z);
|
||||
x.emit('foo');
|
||||
a(count, 3, "Post pipe z, x");
|
||||
a(count2, 3, "Post pipe z, y");
|
||||
a(count3, 1, "Post pipe z, z");
|
||||
|
||||
pipe.close();
|
||||
x.emit('foo');
|
||||
a(count, 4, "Close pipe y, x");
|
||||
a(count2, 3, "Close pipe y, y");
|
||||
a(count3, 2, "Close pipe y, z");
|
||||
};
|
||||
@@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
var has = require('has');
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Type = require('./Type');
|
||||
var ToBoolean = require('./ToBoolean');
|
||||
var IsCallable = require('./IsCallable');
|
||||
|
||||
// https://262.ecma-international.org/5.1/#sec-8.10.5
|
||||
|
||||
module.exports = function ToPropertyDescriptor(Obj) {
|
||||
if (Type(Obj) !== 'Object') {
|
||||
throw new $TypeError('ToPropertyDescriptor requires an object');
|
||||
}
|
||||
|
||||
var desc = {};
|
||||
if (has(Obj, 'enumerable')) {
|
||||
desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);
|
||||
}
|
||||
if (has(Obj, 'configurable')) {
|
||||
desc['[[Configurable]]'] = ToBoolean(Obj.configurable);
|
||||
}
|
||||
if (has(Obj, 'value')) {
|
||||
desc['[[Value]]'] = Obj.value;
|
||||
}
|
||||
if (has(Obj, 'writable')) {
|
||||
desc['[[Writable]]'] = ToBoolean(Obj.writable);
|
||||
}
|
||||
if (has(Obj, 'get')) {
|
||||
var getter = Obj.get;
|
||||
if (typeof getter !== 'undefined' && !IsCallable(getter)) {
|
||||
throw new $TypeError('getter must be a function');
|
||||
}
|
||||
desc['[[Get]]'] = getter;
|
||||
}
|
||||
if (has(Obj, 'set')) {
|
||||
var setter = Obj.set;
|
||||
if (typeof setter !== 'undefined' && !IsCallable(setter)) {
|
||||
throw new $TypeError('setter must be a function');
|
||||
}
|
||||
desc['[[Set]]'] = setter;
|
||||
}
|
||||
|
||||
if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
|
||||
throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
|
||||
}
|
||||
return desc;
|
||||
};
|
||||
@@ -0,0 +1,210 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/bin/benchmark.js</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/bin</a> benchmark.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>0/29</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/2</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/5</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>0/29</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>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-no"> </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-no"> </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">#!/usr/bin/env node
|
||||
var path = <span class="cstat-no" title="statement not covered" >process.argv[2];</span>
|
||||
var fs = <span class="cstat-no" title="statement not covered" >require('fs');</span>
|
||||
<span class="cstat-no" title="statement not covered" >if (!fs.existsSync(path)) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > console.log("Run: benchmark [csvpath]");</span>
|
||||
<span class="cstat-no" title="statement not covered" > console.log("File not found: ", path);</span>
|
||||
<span class="cstat-no" title="statement not covered" > process.exit(1);</span>
|
||||
}
|
||||
function <span class="fstat-no" title="function not covered" >testCSVLine(</span>coreNum, checkType, cb){
|
||||
<span class="cstat-no" title="statement not covered" > console.log("WorkerNum:", coreNum, "Check Type: ", checkType);</span>
|
||||
var Converter = <span class="cstat-no" title="statement not covered" >require("../libs/core/Converter");</span>
|
||||
var rs = <span class="cstat-no" title="statement not covered" >fs.createReadStream(path);</span>
|
||||
var converter = <span class="cstat-no" title="statement not covered" >new Converter({</span>
|
||||
workerNum: coreNum,
|
||||
checkType: checkType,
|
||||
constructResult: false
|
||||
// fork:true
|
||||
});
|
||||
var totalLines = <span class="cstat-no" title="statement not covered" >0;</span>
|
||||
var secLines = <span class="cstat-no" title="statement not covered" >0;</span>
|
||||
<span class="cstat-no" title="statement not covered" > converter.on("data", <span class="fstat-no" title="function not covered" >fu</span>nction() {</span>
|
||||
<span class="cstat-no" title="statement not covered" > totalLines++;</span>
|
||||
<span class="cstat-no" title="statement not covered" > secLines++;</span>
|
||||
});
|
||||
<span class="cstat-no" title="statement not covered" > converter.on("end", <span class="fstat-no" title="function not covered" >fu</span>nction() {</span>
|
||||
<span class="cstat-no" title="statement not covered" > clearInterval(timer);</span>
|
||||
<span class="cstat-no" title="statement not covered" > console.log("");</span>
|
||||
var t = <span class="cstat-no" title="statement not covered" >new Date() - start;</span>
|
||||
<span class="cstat-no" title="statement not covered" > console.log("Time elapsed: ", t, " ms");</span>
|
||||
<span class="cstat-no" title="statement not covered" > console.log("Total lines: " + totalLines);</span>
|
||||
<span class="cstat-no" title="statement not covered" > console.log("Average Speed: " + Math.round(totalLines / t * 1000) + " Lines / Sec");</span>
|
||||
<span class="cstat-no" title="statement not covered" > cb();</span>
|
||||
});
|
||||
var timer = <span class="cstat-no" title="statement not covered" >setInterval(<span class="fstat-no" title="function not covered" >fu</span>nction() {</span>
|
||||
<span class="cstat-no" title="statement not covered" > process.stdout.write("\r" + secLines + " CSV Lines/Sec");</span>
|
||||
<span class="cstat-no" title="statement not covered" > secLines = 0;</span>
|
||||
}, 1000);
|
||||
var start = <span class="cstat-no" title="statement not covered" >new Date();</span>
|
||||
|
||||
var stream = <span class="cstat-no" title="statement not covered" >rs.pipe(converter);</span>
|
||||
}
|
||||
|
||||
// testCSVLine(1,false,false,function(){
|
||||
<span class="cstat-no" title="statement not covered" > testCSVLine(4,true,<span class="fstat-no" title="function not covered" >fu</span>nction(){</span>
|
||||
|
||||
});
|
||||
// });
|
||||
</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:36:07 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 @@
|
||||
export { envReplace } from './env-replace';
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"max-statements": [2, 15],
|
||||
},
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "test/**",
|
||||
"rules": {
|
||||
"eqeqeq": [2, "always", { "null": "ignore" }],
|
||||
"func-style": 0,
|
||||
"max-params": 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
1.0.1 / 2021-11-14
|
||||
==================
|
||||
|
||||
* pref: enable strict mode
|
||||
|
||||
1.0.0 / 2018-07-09
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
@@ -0,0 +1,11 @@
|
||||
var getNative = require('./_getNative');
|
||||
|
||||
var defineProperty = (function() {
|
||||
try {
|
||||
var func = getNative(Object, 'defineProperty');
|
||||
func({}, '', {});
|
||||
return func;
|
||||
} catch (e) {}
|
||||
}());
|
||||
|
||||
module.exports = defineProperty;
|
||||
@@ -0,0 +1,11 @@
|
||||
import { noop } from './utils';
|
||||
import { AnimationConfig } from '../animate';
|
||||
declare type PositionRect = DOMRect | ClientRect;
|
||||
declare type AnimationFn = (node: Element, { from, to }: {
|
||||
from: PositionRect;
|
||||
to: PositionRect;
|
||||
}, params: any) => AnimationConfig;
|
||||
export declare function create_animation(node: Element & ElementCSSInlineStyle, from: PositionRect, fn: AnimationFn, params: any): typeof noop;
|
||||
export declare function fix_position(node: Element & ElementCSSInlineStyle): void;
|
||||
export declare function add_transform(node: Element & ElementCSSInlineStyle, a: PositionRect): void;
|
||||
export {};
|
||||
@@ -0,0 +1,151 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = normalizeEmail;
|
||||
|
||||
var _merge = _interopRequireDefault(require("./util/merge"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var default_normalize_email_options = {
|
||||
// The following options apply to all email addresses
|
||||
// Lowercases the local part of the email address.
|
||||
// Please note this may violate RFC 5321 as per http://stackoverflow.com/a/9808332/192024).
|
||||
// The domain is always lowercased, as per RFC 1035
|
||||
all_lowercase: true,
|
||||
// The following conversions are specific to GMail
|
||||
// Lowercases the local part of the GMail address (known to be case-insensitive)
|
||||
gmail_lowercase: true,
|
||||
// Removes dots from the local part of the email address, as that's ignored by GMail
|
||||
gmail_remove_dots: true,
|
||||
// Removes the subaddress (e.g. "+foo") from the email address
|
||||
gmail_remove_subaddress: true,
|
||||
// Conversts the googlemail.com domain to gmail.com
|
||||
gmail_convert_googlemaildotcom: true,
|
||||
// The following conversions are specific to Outlook.com / Windows Live / Hotmail
|
||||
// Lowercases the local part of the Outlook.com address (known to be case-insensitive)
|
||||
outlookdotcom_lowercase: true,
|
||||
// Removes the subaddress (e.g. "+foo") from the email address
|
||||
outlookdotcom_remove_subaddress: true,
|
||||
// The following conversions are specific to Yahoo
|
||||
// Lowercases the local part of the Yahoo address (known to be case-insensitive)
|
||||
yahoo_lowercase: true,
|
||||
// Removes the subaddress (e.g. "-foo") from the email address
|
||||
yahoo_remove_subaddress: true,
|
||||
// The following conversions are specific to Yandex
|
||||
// Lowercases the local part of the Yandex address (known to be case-insensitive)
|
||||
yandex_lowercase: true,
|
||||
// The following conversions are specific to iCloud
|
||||
// Lowercases the local part of the iCloud address (known to be case-insensitive)
|
||||
icloud_lowercase: true,
|
||||
// Removes the subaddress (e.g. "+foo") from the email address
|
||||
icloud_remove_subaddress: true
|
||||
}; // List of domains used by iCloud
|
||||
|
||||
var icloud_domains = ['icloud.com', 'me.com']; // List of domains used by Outlook.com and its predecessors
|
||||
// This list is likely incomplete.
|
||||
// Partial reference:
|
||||
// https://blogs.office.com/2013/04/17/outlook-com-gets-two-step-verification-sign-in-by-alias-and-new-international-domains/
|
||||
|
||||
var outlookdotcom_domains = ['hotmail.at', 'hotmail.be', 'hotmail.ca', 'hotmail.cl', 'hotmail.co.il', 'hotmail.co.nz', 'hotmail.co.th', 'hotmail.co.uk', 'hotmail.com', 'hotmail.com.ar', 'hotmail.com.au', 'hotmail.com.br', 'hotmail.com.gr', 'hotmail.com.mx', 'hotmail.com.pe', 'hotmail.com.tr', 'hotmail.com.vn', 'hotmail.cz', 'hotmail.de', 'hotmail.dk', 'hotmail.es', 'hotmail.fr', 'hotmail.hu', 'hotmail.id', 'hotmail.ie', 'hotmail.in', 'hotmail.it', 'hotmail.jp', 'hotmail.kr', 'hotmail.lv', 'hotmail.my', 'hotmail.ph', 'hotmail.pt', 'hotmail.sa', 'hotmail.sg', 'hotmail.sk', 'live.be', 'live.co.uk', 'live.com', 'live.com.ar', 'live.com.mx', 'live.de', 'live.es', 'live.eu', 'live.fr', 'live.it', 'live.nl', 'msn.com', 'outlook.at', 'outlook.be', 'outlook.cl', 'outlook.co.il', 'outlook.co.nz', 'outlook.co.th', 'outlook.com', 'outlook.com.ar', 'outlook.com.au', 'outlook.com.br', 'outlook.com.gr', 'outlook.com.pe', 'outlook.com.tr', 'outlook.com.vn', 'outlook.cz', 'outlook.de', 'outlook.dk', 'outlook.es', 'outlook.fr', 'outlook.hu', 'outlook.id', 'outlook.ie', 'outlook.in', 'outlook.it', 'outlook.jp', 'outlook.kr', 'outlook.lv', 'outlook.my', 'outlook.ph', 'outlook.pt', 'outlook.sa', 'outlook.sg', 'outlook.sk', 'passport.com']; // List of domains used by Yahoo Mail
|
||||
// This list is likely incomplete
|
||||
|
||||
var yahoo_domains = ['rocketmail.com', 'yahoo.ca', 'yahoo.co.uk', 'yahoo.com', 'yahoo.de', 'yahoo.fr', 'yahoo.in', 'yahoo.it', 'ymail.com']; // List of domains used by yandex.ru
|
||||
|
||||
var yandex_domains = ['yandex.ru', 'yandex.ua', 'yandex.kz', 'yandex.com', 'yandex.by', 'ya.ru']; // replace single dots, but not multiple consecutive dots
|
||||
|
||||
function dotsReplacer(match) {
|
||||
if (match.length > 1) {
|
||||
return match;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function normalizeEmail(email, options) {
|
||||
options = (0, _merge.default)(options, default_normalize_email_options);
|
||||
var raw_parts = email.split('@');
|
||||
var domain = raw_parts.pop();
|
||||
var user = raw_parts.join('@');
|
||||
var parts = [user, domain]; // The domain is always lowercased, as it's case-insensitive per RFC 1035
|
||||
|
||||
parts[1] = parts[1].toLowerCase();
|
||||
|
||||
if (parts[1] === 'gmail.com' || parts[1] === 'googlemail.com') {
|
||||
// Address is GMail
|
||||
if (options.gmail_remove_subaddress) {
|
||||
parts[0] = parts[0].split('+')[0];
|
||||
}
|
||||
|
||||
if (options.gmail_remove_dots) {
|
||||
// this does not replace consecutive dots like example..email@gmail.com
|
||||
parts[0] = parts[0].replace(/\.+/g, dotsReplacer);
|
||||
}
|
||||
|
||||
if (!parts[0].length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.all_lowercase || options.gmail_lowercase) {
|
||||
parts[0] = parts[0].toLowerCase();
|
||||
}
|
||||
|
||||
parts[1] = options.gmail_convert_googlemaildotcom ? 'gmail.com' : parts[1];
|
||||
} else if (icloud_domains.indexOf(parts[1]) >= 0) {
|
||||
// Address is iCloud
|
||||
if (options.icloud_remove_subaddress) {
|
||||
parts[0] = parts[0].split('+')[0];
|
||||
}
|
||||
|
||||
if (!parts[0].length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.all_lowercase || options.icloud_lowercase) {
|
||||
parts[0] = parts[0].toLowerCase();
|
||||
}
|
||||
} else if (outlookdotcom_domains.indexOf(parts[1]) >= 0) {
|
||||
// Address is Outlook.com
|
||||
if (options.outlookdotcom_remove_subaddress) {
|
||||
parts[0] = parts[0].split('+')[0];
|
||||
}
|
||||
|
||||
if (!parts[0].length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.all_lowercase || options.outlookdotcom_lowercase) {
|
||||
parts[0] = parts[0].toLowerCase();
|
||||
}
|
||||
} else if (yahoo_domains.indexOf(parts[1]) >= 0) {
|
||||
// Address is Yahoo
|
||||
if (options.yahoo_remove_subaddress) {
|
||||
var components = parts[0].split('-');
|
||||
parts[0] = components.length > 1 ? components.slice(0, -1).join('-') : components[0];
|
||||
}
|
||||
|
||||
if (!parts[0].length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.all_lowercase || options.yahoo_lowercase) {
|
||||
parts[0] = parts[0].toLowerCase();
|
||||
}
|
||||
} else if (yandex_domains.indexOf(parts[1]) >= 0) {
|
||||
if (options.all_lowercase || options.yandex_lowercase) {
|
||||
parts[0] = parts[0].toLowerCase();
|
||||
}
|
||||
|
||||
parts[1] = 'yandex.ru'; // all yandex domains are equal, 1st preferred
|
||||
} else if (options.all_lowercase) {
|
||||
// Any other address
|
||||
parts[0] = parts[0].toLowerCase();
|
||||
}
|
||||
|
||||
return parts.join('@');
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,537 @@
|
||||
import './env';
|
||||
|
||||
const template = /*html*/ `
|
||||
<style>
|
||||
:host {
|
||||
position: fixed;
|
||||
z-index: 99999;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
margin: 0;
|
||||
background: rgba(0, 0, 0, 0.66);
|
||||
--monospace: 'SFMono-Regular', Consolas,
|
||||
'Liberation Mono', Menlo, Courier, monospace;
|
||||
--red: #ff5555;
|
||||
--yellow: #e2aa53;
|
||||
--purple: #cfa4ff;
|
||||
--cyan: #2dd9da;
|
||||
--dim: #c9c9c9;
|
||||
}
|
||||
|
||||
.window {
|
||||
font-family: var(--monospace);
|
||||
line-height: 1.5;
|
||||
width: 800px;
|
||||
color: #d8d8d8;
|
||||
margin: 30px auto;
|
||||
padding: 25px 40px;
|
||||
position: relative;
|
||||
background: #181818;
|
||||
border-radius: 6px 6px 8px 8px;
|
||||
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
|
||||
overflow: hidden;
|
||||
border-top: 8px solid var(--red);
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: var(--monospace);
|
||||
font-size: 16px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1em;
|
||||
overflow-x: scroll;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
pre::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.message {
|
||||
line-height: 1.3;
|
||||
font-weight: 600;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.message-body {
|
||||
color: var(--red);
|
||||
}
|
||||
|
||||
.plugin {
|
||||
color: var(--purple);
|
||||
}
|
||||
|
||||
.file {
|
||||
color: var(--cyan);
|
||||
margin-bottom: 0;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.frame {
|
||||
color: var(--yellow);
|
||||
}
|
||||
|
||||
.stack {
|
||||
font-size: 13px;
|
||||
color: var(--dim);
|
||||
}
|
||||
|
||||
.tip {
|
||||
font-size: 13px;
|
||||
color: #999;
|
||||
border-top: 1px dotted #999;
|
||||
padding-top: 13px;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 13px;
|
||||
font-family: var(--monospace);
|
||||
color: var(--yellow);
|
||||
}
|
||||
|
||||
.file-link {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<div class="window">
|
||||
<pre class="message"><span class="plugin"></span><span class="message-body"></span></pre>
|
||||
<pre class="file"></pre>
|
||||
<pre class="frame"></pre>
|
||||
<pre class="stack"></pre>
|
||||
<div class="tip">
|
||||
Click outside or fix the code to dismiss.<br>
|
||||
You can also disable this overlay with
|
||||
<code>hmr: { overlay: false }</code> in <code>vite.config.js.</code>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
const fileRE = /(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g;
|
||||
const codeframeRE = /^(?:>?\s+\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm;
|
||||
class ErrorOverlay extends HTMLElement {
|
||||
constructor(err) {
|
||||
var _a;
|
||||
super();
|
||||
this.root = this.attachShadow({ mode: 'open' });
|
||||
this.root.innerHTML = template;
|
||||
codeframeRE.lastIndex = 0;
|
||||
const hasFrame = err.frame && codeframeRE.test(err.frame);
|
||||
const message = hasFrame
|
||||
? err.message.replace(codeframeRE, '')
|
||||
: err.message;
|
||||
if (err.plugin) {
|
||||
this.text('.plugin', `[plugin:${err.plugin}] `);
|
||||
}
|
||||
this.text('.message-body', message.trim());
|
||||
const [file] = (((_a = err.loc) === null || _a === void 0 ? void 0 : _a.file) || err.id || 'unknown file').split(`?`);
|
||||
if (err.loc) {
|
||||
this.text('.file', `${file}:${err.loc.line}:${err.loc.column}`, true);
|
||||
}
|
||||
else if (err.id) {
|
||||
this.text('.file', file);
|
||||
}
|
||||
if (hasFrame) {
|
||||
this.text('.frame', err.frame.trim());
|
||||
}
|
||||
this.text('.stack', err.stack, true);
|
||||
this.root.querySelector('.window').addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
});
|
||||
this.addEventListener('click', () => {
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
text(selector, text, linkFiles = false) {
|
||||
const el = this.root.querySelector(selector);
|
||||
if (!linkFiles) {
|
||||
el.textContent = text;
|
||||
}
|
||||
else {
|
||||
let curIndex = 0;
|
||||
let match;
|
||||
while ((match = fileRE.exec(text))) {
|
||||
const { 0: file, index } = match;
|
||||
if (index != null) {
|
||||
const frag = text.slice(curIndex, index);
|
||||
el.appendChild(document.createTextNode(frag));
|
||||
const link = document.createElement('a');
|
||||
link.textContent = file;
|
||||
link.className = 'file-link';
|
||||
link.onclick = () => {
|
||||
fetch('/__open-in-editor?file=' + encodeURIComponent(file));
|
||||
};
|
||||
el.appendChild(link);
|
||||
curIndex += frag.length + file.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
close() {
|
||||
var _a;
|
||||
(_a = this.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this);
|
||||
}
|
||||
}
|
||||
const overlayId = 'vite-error-overlay';
|
||||
customElements.define(overlayId, ErrorOverlay);
|
||||
|
||||
console.log('[vite] connecting...');
|
||||
// use server configuration, then fallback to inference
|
||||
const socketProtocol = __HMR_PROTOCOL__ || (location.protocol === 'https:' ? 'wss' : 'ws');
|
||||
const socketHost = `${__HMR_HOSTNAME__ || location.hostname}:${__HMR_PORT__}`;
|
||||
const socket = new WebSocket(`${socketProtocol}://${socketHost}`, 'vite-hmr');
|
||||
const base = __BASE__ || '/';
|
||||
function warnFailedFetch(err, path) {
|
||||
if (!err.message.match('fetch')) {
|
||||
console.error(err);
|
||||
}
|
||||
console.error(`[hmr] Failed to reload ${path}. ` +
|
||||
`This could be due to syntax errors or importing non-existent ` +
|
||||
`modules. (see errors above)`);
|
||||
}
|
||||
// Listen for messages
|
||||
socket.addEventListener('message', async ({ data }) => {
|
||||
handleMessage(JSON.parse(data));
|
||||
});
|
||||
let isFirstUpdate = true;
|
||||
async function handleMessage(payload) {
|
||||
switch (payload.type) {
|
||||
case 'connected':
|
||||
console.log(`[vite] connected.`);
|
||||
// proxy(nginx, docker) hmr ws maybe caused timeout,
|
||||
// so send ping package let ws keep alive.
|
||||
setInterval(() => socket.send('ping'), __HMR_TIMEOUT__);
|
||||
break;
|
||||
case 'update':
|
||||
// if this is the first update and there's already an error overlay, it
|
||||
// means the page opened with existing server compile error and the whole
|
||||
// module script failed to load (since one of the nested imports is 500).
|
||||
// in this case a normal update won't work and a full reload is needed.
|
||||
if (isFirstUpdate && hasErrorOverlay()) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
clearErrorOverlay();
|
||||
isFirstUpdate = false;
|
||||
}
|
||||
payload.updates.forEach((update) => {
|
||||
if (update.type === 'js-update') {
|
||||
queueUpdate(fetchUpdate(update));
|
||||
}
|
||||
else {
|
||||
// css-update
|
||||
// this is only sent when a css file referenced with <link> is updated
|
||||
let { path, timestamp } = update;
|
||||
path = path.replace(/\?.*/, '');
|
||||
// can't use querySelector with `[href*=]` here since the link may be
|
||||
// using relative paths so we need to use link.href to grab the full
|
||||
// URL for the include check.
|
||||
const el = [].slice.call(document.querySelectorAll(`link`)).find((e) => e.href.includes(path));
|
||||
if (el) {
|
||||
const newPath = `${path}${path.includes('?') ? '&' : '?'}t=${timestamp}`;
|
||||
el.href = new URL(newPath, el.href).href;
|
||||
}
|
||||
console.log(`[vite] css hot updated: ${path}`);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'custom': {
|
||||
const cbs = customListenersMap.get(payload.event);
|
||||
if (cbs) {
|
||||
cbs.forEach((cb) => cb(payload.data));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'full-reload':
|
||||
if (payload.path && payload.path.endsWith('.html')) {
|
||||
// if html file is edited, only reload the page if the browser is
|
||||
// currently on that page.
|
||||
const pagePath = location.pathname;
|
||||
const payloadPath = base + payload.path.slice(1);
|
||||
if (pagePath === payloadPath ||
|
||||
(pagePath.endsWith('/') && pagePath + 'index.html' === payloadPath)) {
|
||||
location.reload();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else {
|
||||
location.reload();
|
||||
}
|
||||
break;
|
||||
case 'prune':
|
||||
// After an HMR update, some modules are no longer imported on the page
|
||||
// but they may have left behind side effects that need to be cleaned up
|
||||
// (.e.g style injections)
|
||||
// TODO Trigger their dispose callbacks.
|
||||
payload.paths.forEach((path) => {
|
||||
const fn = pruneMap.get(path);
|
||||
if (fn) {
|
||||
fn(dataMap.get(path));
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'error': {
|
||||
const err = payload.err;
|
||||
if (enableOverlay) {
|
||||
createErrorOverlay(err);
|
||||
}
|
||||
else {
|
||||
console.error(`[vite] Internal Server Error\n${err.stack}`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
const check = payload;
|
||||
return check;
|
||||
}
|
||||
}
|
||||
}
|
||||
const enableOverlay = __HMR_ENABLE_OVERLAY__;
|
||||
function createErrorOverlay(err) {
|
||||
if (!enableOverlay)
|
||||
return;
|
||||
clearErrorOverlay();
|
||||
document.body.appendChild(new ErrorOverlay(err));
|
||||
}
|
||||
function clearErrorOverlay() {
|
||||
document
|
||||
.querySelectorAll(overlayId)
|
||||
.forEach((n) => n.close());
|
||||
}
|
||||
function hasErrorOverlay() {
|
||||
return document.querySelectorAll(overlayId).length;
|
||||
}
|
||||
let pending = false;
|
||||
let queued = [];
|
||||
/**
|
||||
* buffer multiple hot updates triggered by the same src change
|
||||
* so that they are invoked in the same order they were sent.
|
||||
* (otherwise the order may be inconsistent because of the http request round trip)
|
||||
*/
|
||||
async function queueUpdate(p) {
|
||||
queued.push(p);
|
||||
if (!pending) {
|
||||
pending = true;
|
||||
await Promise.resolve();
|
||||
pending = false;
|
||||
const loading = [...queued];
|
||||
queued = [];
|
||||
(await Promise.all(loading)).forEach((fn) => fn && fn());
|
||||
}
|
||||
}
|
||||
async function waitForSuccessfulPing(ms = 1000) {
|
||||
while (true) {
|
||||
try {
|
||||
await fetch(`${base}__vite_ping`);
|
||||
break;
|
||||
}
|
||||
catch (e) {
|
||||
await new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
}
|
||||
}
|
||||
// ping server
|
||||
socket.addEventListener('close', async ({ wasClean }) => {
|
||||
if (wasClean)
|
||||
return;
|
||||
console.log(`[vite] server connection lost. polling for restart...`);
|
||||
await waitForSuccessfulPing();
|
||||
location.reload();
|
||||
});
|
||||
const sheetsMap = new Map();
|
||||
function updateStyle(id, content) {
|
||||
let style = sheetsMap.get(id);
|
||||
{
|
||||
if (style && !(style instanceof HTMLStyleElement)) {
|
||||
removeStyle(id);
|
||||
style = undefined;
|
||||
}
|
||||
if (!style) {
|
||||
style = document.createElement('style');
|
||||
style.setAttribute('type', 'text/css');
|
||||
style.innerHTML = content;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
else {
|
||||
style.innerHTML = content;
|
||||
}
|
||||
}
|
||||
sheetsMap.set(id, style);
|
||||
}
|
||||
function removeStyle(id) {
|
||||
let style = sheetsMap.get(id);
|
||||
if (style) {
|
||||
if (style instanceof CSSStyleSheet) {
|
||||
// @ts-ignore
|
||||
document.adoptedStyleSheets.indexOf(style);
|
||||
// @ts-ignore
|
||||
document.adoptedStyleSheets = document.adoptedStyleSheets.filter((s) => s !== style);
|
||||
}
|
||||
else {
|
||||
document.head.removeChild(style);
|
||||
}
|
||||
sheetsMap.delete(id);
|
||||
}
|
||||
}
|
||||
async function fetchUpdate({ path, acceptedPath, timestamp }) {
|
||||
const mod = hotModulesMap.get(path);
|
||||
if (!mod) {
|
||||
// In a code-splitting project,
|
||||
// it is common that the hot-updating module is not loaded yet.
|
||||
// https://github.com/vitejs/vite/issues/721
|
||||
return;
|
||||
}
|
||||
const moduleMap = new Map();
|
||||
const isSelfUpdate = path === acceptedPath;
|
||||
// make sure we only import each dep once
|
||||
const modulesToUpdate = new Set();
|
||||
if (isSelfUpdate) {
|
||||
// self update - only update self
|
||||
modulesToUpdate.add(path);
|
||||
}
|
||||
else {
|
||||
// dep update
|
||||
for (const { deps } of mod.callbacks) {
|
||||
deps.forEach((dep) => {
|
||||
if (acceptedPath === dep) {
|
||||
modulesToUpdate.add(dep);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// determine the qualified callbacks before we re-import the modules
|
||||
const qualifiedCallbacks = mod.callbacks.filter(({ deps }) => {
|
||||
return deps.some((dep) => modulesToUpdate.has(dep));
|
||||
});
|
||||
await Promise.all(Array.from(modulesToUpdate).map(async (dep) => {
|
||||
const disposer = disposeMap.get(dep);
|
||||
if (disposer)
|
||||
await disposer(dataMap.get(dep));
|
||||
const [path, query] = dep.split(`?`);
|
||||
try {
|
||||
const newMod = await import(
|
||||
/* @vite-ignore */
|
||||
base +
|
||||
path.slice(1) +
|
||||
`?import&t=${timestamp}${query ? `&${query}` : ''}`);
|
||||
moduleMap.set(dep, newMod);
|
||||
}
|
||||
catch (e) {
|
||||
warnFailedFetch(e, dep);
|
||||
}
|
||||
}));
|
||||
return () => {
|
||||
for (const { deps, fn } of qualifiedCallbacks) {
|
||||
fn(deps.map((dep) => moduleMap.get(dep)));
|
||||
}
|
||||
const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
|
||||
console.log(`[vite] hot updated: ${loggedPath}`);
|
||||
};
|
||||
}
|
||||
const hotModulesMap = new Map();
|
||||
const disposeMap = new Map();
|
||||
const pruneMap = new Map();
|
||||
const dataMap = new Map();
|
||||
const customListenersMap = new Map();
|
||||
const ctxToListenersMap = new Map();
|
||||
const createHotContext = (ownerPath) => {
|
||||
if (!dataMap.has(ownerPath)) {
|
||||
dataMap.set(ownerPath, {});
|
||||
}
|
||||
// when a file is hot updated, a new context is created
|
||||
// clear its stale callbacks
|
||||
const mod = hotModulesMap.get(ownerPath);
|
||||
if (mod) {
|
||||
mod.callbacks = [];
|
||||
}
|
||||
// clear stale custom event listeners
|
||||
const staleListeners = ctxToListenersMap.get(ownerPath);
|
||||
if (staleListeners) {
|
||||
for (const [event, staleFns] of staleListeners) {
|
||||
const listeners = customListenersMap.get(event);
|
||||
if (listeners) {
|
||||
customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l)));
|
||||
}
|
||||
}
|
||||
}
|
||||
const newListeners = new Map();
|
||||
ctxToListenersMap.set(ownerPath, newListeners);
|
||||
function acceptDeps(deps, callback = () => { }) {
|
||||
const mod = hotModulesMap.get(ownerPath) || {
|
||||
id: ownerPath,
|
||||
callbacks: []
|
||||
};
|
||||
mod.callbacks.push({
|
||||
deps,
|
||||
fn: callback
|
||||
});
|
||||
hotModulesMap.set(ownerPath, mod);
|
||||
}
|
||||
const hot = {
|
||||
get data() {
|
||||
return dataMap.get(ownerPath);
|
||||
},
|
||||
accept(deps, callback) {
|
||||
if (typeof deps === 'function' || !deps) {
|
||||
// self-accept: hot.accept(() => {})
|
||||
acceptDeps([ownerPath], ([mod]) => deps && deps(mod));
|
||||
}
|
||||
else if (typeof deps === 'string') {
|
||||
// explicit deps
|
||||
acceptDeps([deps], ([mod]) => callback && callback(mod));
|
||||
}
|
||||
else if (Array.isArray(deps)) {
|
||||
acceptDeps(deps, callback);
|
||||
}
|
||||
else {
|
||||
throw new Error(`invalid hot.accept() usage.`);
|
||||
}
|
||||
},
|
||||
acceptDeps() {
|
||||
throw new Error(`hot.acceptDeps() is deprecated. ` +
|
||||
`Use hot.accept() with the same signature instead.`);
|
||||
},
|
||||
dispose(cb) {
|
||||
disposeMap.set(ownerPath, cb);
|
||||
},
|
||||
prune(cb) {
|
||||
pruneMap.set(ownerPath, cb);
|
||||
},
|
||||
// TODO
|
||||
decline() { },
|
||||
invalidate() {
|
||||
// TODO should tell the server to re-perform hmr propagation
|
||||
// from this module as root
|
||||
location.reload();
|
||||
},
|
||||
// custom events
|
||||
on(event, cb) {
|
||||
const addToMap = (map) => {
|
||||
const existing = map.get(event) || [];
|
||||
existing.push(cb);
|
||||
map.set(event, existing);
|
||||
};
|
||||
addToMap(customListenersMap);
|
||||
addToMap(newListeners);
|
||||
}
|
||||
};
|
||||
return hot;
|
||||
};
|
||||
/**
|
||||
* urls here are dynamic import() urls that couldn't be statically analyzed
|
||||
*/
|
||||
function injectQuery(url, queryToInject) {
|
||||
// skip urls that won't be handled by vite
|
||||
if (!url.startsWith('.') && !url.startsWith('/')) {
|
||||
return url;
|
||||
}
|
||||
// can't use pathname from URL since it may be relative like ../
|
||||
const pathname = url.replace(/#.*$/, '').replace(/\?.*$/, '');
|
||||
const { search, hash } = new URL(url, 'http://vitejs.dev');
|
||||
return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${hash || ''}`;
|
||||
}
|
||||
|
||||
export { createHotContext, injectQuery, removeStyle, updateStyle };
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","8":"J CC","129":"D","257":"E"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB EC FC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"1":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e PC QC RC SC qB AC TC rB"},G:{"1":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"1":"oC"},I:{"1":"tB I f pC qC rC sC BC tC uC"},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:2,C:"CSS min/max-width/height"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"windowTime.js","sourceRoot":"","sources":["../../../../src/internal/operators/windowTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAgG1D,MAAM,UAAU,UAAU,CAAI,cAAsB;;IAAE,mBAAmB;SAAnB,UAAmB,EAAnB,qBAAmB,EAAnB,IAAmB;QAAnB,kCAAmB;;IACvE,IAAM,SAAS,GAAG,MAAA,YAAY,CAAC,SAAS,CAAC,mCAAI,cAAc,CAAC;IAC5D,IAAM,sBAAsB,GAAG,MAAC,SAAS,CAAC,CAAC,CAAY,mCAAI,IAAI,CAAC;IAChE,IAAM,aAAa,GAAI,SAAS,CAAC,CAAC,CAAY,IAAI,QAAQ,CAAC;IAE3D,OAAO,OAAO,CAAC,UAAC,MAAM,EAAE,UAAU;QAEhC,IAAI,aAAa,GAA6B,EAAE,CAAC;QAGjD,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,IAAM,WAAW,GAAG,UAAC,MAAkD;YAC7D,IAAA,MAAM,GAAW,MAAM,OAAjB,EAAE,IAAI,GAAK,MAAM,KAAX,CAAY;YAChC,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YACjC,cAAc,IAAI,WAAW,EAAE,CAAC;QAClC,CAAC,CAAC;QAMF,IAAM,WAAW,GAAG;YAClB,IAAI,aAAa,EAAE;gBACjB,IAAM,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;gBAChC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACrB,IAAM,QAAM,GAAG,IAAI,OAAO,EAAK,CAAC;gBAChC,IAAM,QAAM,GAAG;oBACb,MAAM,UAAA;oBACN,IAAI,MAAA;oBACJ,IAAI,EAAE,CAAC;iBACR,CAAC;gBACF,aAAa,CAAC,IAAI,CAAC,QAAM,CAAC,CAAC;gBAC3B,UAAU,CAAC,IAAI,CAAC,QAAM,CAAC,YAAY,EAAE,CAAC,CAAC;gBACvC,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,cAAM,OAAA,WAAW,CAAC,QAAM,CAAC,EAAnB,CAAmB,EAAE,cAAc,CAAC,CAAC;aAC7E;QACH,CAAC,CAAC;QAEF,IAAI,sBAAsB,KAAK,IAAI,IAAI,sBAAsB,IAAI,CAAC,EAAE;YAIlE,eAAe,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC;SACnF;aAAM;YACL,cAAc,GAAG,IAAI,CAAC;SACvB;QAED,WAAW,EAAE,CAAC;QAQd,IAAM,IAAI,GAAG,UAAC,EAAqC,IAAK,OAAA,aAAc,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,EAAlC,CAAkC,CAAC;QAM3F,IAAM,SAAS,GAAG,UAAC,EAAqC;YACtD,IAAI,CAAC,UAAC,EAAU;oBAAR,MAAM,YAAA;gBAAO,OAAA,EAAE,CAAC,MAAM,CAAC;YAAV,CAAU,CAAC,CAAC;YACjC,EAAE,CAAC,UAAU,CAAC,CAAC;YACf,UAAU,CAAC,WAAW,EAAE,CAAC;QAC3B,CAAC,CAAC;QAEF,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EACV,UAAC,KAAQ;YAEP,IAAI,CAAC,UAAC,MAAM;gBACV,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAE1B,aAAa,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC;QACL,CAAC,EAED,cAAM,OAAA,SAAS,CAAC,UAAC,QAAQ,IAAK,OAAA,QAAQ,CAAC,QAAQ,EAAE,EAAnB,CAAmB,CAAC,EAA5C,CAA4C,EAElD,UAAC,GAAG,IAAK,OAAA,SAAS,CAAC,UAAC,QAAQ,IAAK,OAAA,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EAAnB,CAAmB,CAAC,EAA5C,CAA4C,CACtD,CACF,CAAC;QAKF,OAAO;YAEL,aAAa,GAAG,IAAK,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1,76 @@
|
||||
# supports-color [](https://travis-ci.org/chalk/supports-color)
|
||||
|
||||
> Detect whether a terminal supports color
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install supports-color
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const supportsColor = require('supports-color');
|
||||
|
||||
if (supportsColor.stdout) {
|
||||
console.log('Terminal stdout supports color');
|
||||
}
|
||||
|
||||
if (supportsColor.stdout.has256) {
|
||||
console.log('Terminal stdout supports 256 colors');
|
||||
}
|
||||
|
||||
if (supportsColor.stderr.has16m) {
|
||||
console.log('Terminal stderr supports 16 million colors (truecolor)');
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
|
||||
|
||||
The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
|
||||
|
||||
- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
|
||||
- `.level = 2` and `.has256 = true`: 256 color support
|
||||
- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
It obeys the `--color` and `--no-color` CLI flags.
|
||||
|
||||
For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
|
||||
|
||||
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-supports-color?utm_source=npm-supports-color&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./es2016');
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"not.js","sourceRoot":"","sources":["../../../../src/internal/util/not.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAI,IAA0C,EAAE,OAAY;IAC7E,OAAO,UAAC,KAAQ,EAAE,KAAa,IAAK,OAAA,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,EAAjC,CAAiC,CAAC;AACxE,CAAC"}
|
||||
@@ -0,0 +1,33 @@
|
||||
var wrapSingle = require('../wrap-for-optimizing').single;
|
||||
|
||||
var Token = require('../../tokenizer/token');
|
||||
|
||||
function deep(property) {
|
||||
var cloned = shallow(property);
|
||||
for (var i = property.components.length - 1; i >= 0; i--) {
|
||||
var component = shallow(property.components[i]);
|
||||
component.value = property.components[i].value.slice(0);
|
||||
cloned.components.unshift(component);
|
||||
}
|
||||
|
||||
cloned.dirty = true;
|
||||
cloned.value = property.value.slice(0);
|
||||
|
||||
return cloned;
|
||||
}
|
||||
|
||||
function shallow(property) {
|
||||
var cloned = wrapSingle([
|
||||
Token.PROPERTY,
|
||||
[Token.PROPERTY_NAME, property.name]
|
||||
]);
|
||||
cloned.important = property.important;
|
||||
cloned.hack = property.hack;
|
||||
cloned.unused = false;
|
||||
return cloned;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
deep: deep,
|
||||
shallow: shallow
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
import { operate } from '../util/lift';
|
||||
import { noop } from '../util/noop';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
import { innerFrom } from '../observable/innerFrom';
|
||||
export function buffer(closingNotifier) {
|
||||
return operate((source, subscriber) => {
|
||||
let currentBuffer = [];
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => currentBuffer.push(value), () => {
|
||||
subscriber.next(currentBuffer);
|
||||
subscriber.complete();
|
||||
}));
|
||||
innerFrom(closingNotifier).subscribe(createOperatorSubscriber(subscriber, () => {
|
||||
const b = currentBuffer;
|
||||
currentBuffer = [];
|
||||
subscriber.next(b);
|
||||
}, noop));
|
||||
return () => {
|
||||
currentBuffer = null;
|
||||
};
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=buffer.js.map
|
||||
@@ -0,0 +1,54 @@
|
||||
import type {PascalCase} from './pascal-case';
|
||||
|
||||
/**
|
||||
Convert object properties to pascal case recursively.
|
||||
|
||||
This can be useful when, for example, converting some API types from a different style.
|
||||
|
||||
@see PascalCase
|
||||
@see PascalCasedProperties
|
||||
|
||||
@example
|
||||
```
|
||||
import type {PascalCasedPropertiesDeep} from 'type-fest';
|
||||
|
||||
interface User {
|
||||
userId: number;
|
||||
userName: string;
|
||||
}
|
||||
|
||||
interface UserWithFriends {
|
||||
userInfo: User;
|
||||
userFriends: User[];
|
||||
}
|
||||
|
||||
const result: PascalCasedPropertiesDeep<UserWithFriends> = {
|
||||
UserInfo: {
|
||||
UserId: 1,
|
||||
UserName: 'Tom',
|
||||
},
|
||||
UserFriends: [
|
||||
{
|
||||
UserId: 2,
|
||||
UserName: 'Jerry',
|
||||
},
|
||||
{
|
||||
UserId: 3,
|
||||
UserName: 'Spike',
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
@category Change case
|
||||
@category Template literal
|
||||
@category Object
|
||||
*/
|
||||
export type PascalCasedPropertiesDeep<Value> = Value extends Function | Date | RegExp
|
||||
? Value
|
||||
: Value extends Array<infer U>
|
||||
? Array<PascalCasedPropertiesDeep<U>>
|
||||
: Value extends Set<infer U>
|
||||
? Set<PascalCasedPropertiesDeep<U>> : {
|
||||
[K in keyof Value as PascalCase<K>]: PascalCasedPropertiesDeep<Value[K]>;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"2":"C K L G M N O","164":"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":"8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB 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 DC tB I v J D E F A B C K L G M N O w g x y z EC FC"},D:{"2":"I v J D E F A B C K L G M N O w g x","164":"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"2":"I v J HC zB IC","164":"D E F A B C K L G JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"2":"F PC QC RC SC","129":"B C qB AC TC rB","164":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e"},G:{"2":"zB UC BC VC WC","164":"E XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"132":"oC"},I:{"2":"tB I pC qC rC sC BC","164":"f tC uC"},J:{"2":"D","164":"A"},K:{"2":"A","129":"B C qB AC rB","164":"h"},L:{"164":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"164":"vC"},P:{"164":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"164":"1B"},R:{"164":"9C"},S:{"1":"AD BD"}},B:4,C:"CSS box-decoration-break"};
|
||||
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var implementation = require('./implementation');
|
||||
|
||||
module.exports = function getPolyfill() {
|
||||
if (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) {
|
||||
return implementation;
|
||||
}
|
||||
return global;
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Commands:": "Kommandos:",
|
||||
"Options:": "Optionen:",
|
||||
"Examples:": "Beispiele:",
|
||||
"boolean": "boolean",
|
||||
"count": "Zähler",
|
||||
"string": "string",
|
||||
"number": "Zahl",
|
||||
"array": "array",
|
||||
"required": "erforderlich",
|
||||
"default": "Standard",
|
||||
"default:": "Standard:",
|
||||
"choices:": "Möglichkeiten:",
|
||||
"aliases:": "Aliase:",
|
||||
"generated-value": "Generierter-Wert",
|
||||
"Not enough non-option arguments: got %s, need at least %s": {
|
||||
"one": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt",
|
||||
"other": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt"
|
||||
},
|
||||
"Too many non-option arguments: got %s, maximum of %s": {
|
||||
"one": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt",
|
||||
"other": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt"
|
||||
},
|
||||
"Missing argument value: %s": {
|
||||
"one": "Fehlender Argumentwert: %s",
|
||||
"other": "Fehlende Argumentwerte: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Fehlendes Argument: %s",
|
||||
"other": "Fehlende Argumente: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Unbekanntes Argument: %s",
|
||||
"other": "Unbekannte Argumente: %s"
|
||||
},
|
||||
"Invalid values:": "Unzulässige Werte:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s",
|
||||
"Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s",
|
||||
"Implications failed:": "Fehlende abhängige Argumente:",
|
||||
"Not enough arguments following: %s": "Nicht genügend Argumente nach: %s",
|
||||
"Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s",
|
||||
"Path to JSON config file": "Pfad zur JSON-Config Datei",
|
||||
"Show help": "Hilfe anzeigen",
|
||||
"Show version number": "Version anzeigen",
|
||||
"Did you mean %s?": "Meintest du %s?"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { zip as zipStatic } from '../observable/zip';
|
||||
import { operate } from '../util/lift';
|
||||
export function zip(...sources) {
|
||||
return operate((source, subscriber) => {
|
||||
zipStatic(source, ...sources).subscribe(subscriber);
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=zip.js.map
|
||||
@@ -0,0 +1,26 @@
|
||||
/** Used to compose unicode character classes. */
|
||||
var rsAstralRange = '\\ud800-\\udfff',
|
||||
rsComboMarksRange = '\\u0300-\\u036f',
|
||||
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
|
||||
rsComboSymbolsRange = '\\u20d0-\\u20ff',
|
||||
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
|
||||
rsVarRange = '\\ufe0e\\ufe0f';
|
||||
|
||||
/** Used to compose unicode capture groups. */
|
||||
var rsZWJ = '\\u200d';
|
||||
|
||||
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
||||
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
|
||||
|
||||
/**
|
||||
* Checks if `string` contains Unicode symbols.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to inspect.
|
||||
* @returns {boolean} Returns `true` if a symbol is found, else `false`.
|
||||
*/
|
||||
function hasUnicode(string) {
|
||||
return reHasUnicode.test(string);
|
||||
}
|
||||
|
||||
module.exports = hasUnicode;
|
||||
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>getAllConfigs
|
||||
});
|
||||
const _defaultConfigStubJs = /*#__PURE__*/ _interopRequireDefault(require("../../stubs/defaultConfig.stub.js"));
|
||||
const _featureFlags = require("../featureFlags");
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function getAllConfigs(config) {
|
||||
var _config_presets;
|
||||
const configs = ((_config_presets = config === null || config === void 0 ? void 0 : config.presets) !== null && _config_presets !== void 0 ? _config_presets : [
|
||||
_defaultConfigStubJs.default
|
||||
]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset));
|
||||
const features = {
|
||||
// Add experimental configs here...
|
||||
respectDefaultRingColorOpacity: {
|
||||
theme: {
|
||||
ringColor: ({ theme })=>({
|
||||
DEFAULT: "#3b82f67f",
|
||||
...theme("colors")
|
||||
})
|
||||
}
|
||||
},
|
||||
disableColorOpacityUtilitiesByDefault: {
|
||||
corePlugins: {
|
||||
backgroundOpacity: false,
|
||||
borderOpacity: false,
|
||||
divideOpacity: false,
|
||||
placeholderOpacity: false,
|
||||
ringOpacity: false,
|
||||
textOpacity: false
|
||||
}
|
||||
}
|
||||
};
|
||||
const experimentals = Object.keys(features).filter((feature)=>(0, _featureFlags.flagEnabled)(config, feature)).map((feature)=>features[feature]);
|
||||
return [
|
||||
config,
|
||||
...experimentals,
|
||||
...configs
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import assertString from './util/assertString';
|
||||
var issn = '^\\d{4}-?\\d{3}[\\dX]$';
|
||||
export default function isISSN(str) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
assertString(str);
|
||||
var testIssn = issn;
|
||||
testIssn = options.require_hyphen ? testIssn.replace('?', '') : testIssn;
|
||||
testIssn = options.case_sensitive ? new RegExp(testIssn) : new RegExp(testIssn, 'i');
|
||||
|
||||
if (!testIssn.test(str)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var digits = str.replace('-', '').toUpperCase();
|
||||
var checksum = 0;
|
||||
|
||||
for (var i = 0; i < digits.length; i++) {
|
||||
var digit = digits[i];
|
||||
checksum += (digit === 'X' ? 10 : +digit) * (8 - i);
|
||||
}
|
||||
|
||||
return checksum % 11 === 0;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import { Readable } from 'stream';
|
||||
|
||||
declare namespace getRawBody {
|
||||
export type Encoding = string | true;
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* The expected length of the stream.
|
||||
*/
|
||||
length?: number | string | null;
|
||||
/**
|
||||
* The byte limit of the body. This is the number of bytes or any string
|
||||
* format supported by `bytes`, for example `1000`, `'500kb'` or `'3mb'`.
|
||||
*/
|
||||
limit?: number | string | null;
|
||||
/**
|
||||
* The encoding to use to decode the body into a string. By default, a
|
||||
* `Buffer` instance will be returned when no encoding is specified. Most
|
||||
* likely, you want `utf-8`, so setting encoding to `true` will decode as
|
||||
* `utf-8`. You can use any type of encoding supported by `iconv-lite`.
|
||||
*/
|
||||
encoding?: Encoding | null;
|
||||
}
|
||||
|
||||
export interface RawBodyError extends Error {
|
||||
/**
|
||||
* The limit in bytes.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* The expected length of the stream.
|
||||
*/
|
||||
length?: number;
|
||||
expected?: number;
|
||||
/**
|
||||
* The received bytes.
|
||||
*/
|
||||
received?: number;
|
||||
/**
|
||||
* The encoding.
|
||||
*/
|
||||
encoding?: string;
|
||||
/**
|
||||
* The corresponding status code for the error.
|
||||
*/
|
||||
status: number;
|
||||
statusCode: number;
|
||||
/**
|
||||
* The error type.
|
||||
*/
|
||||
type: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the entire buffer of a stream either as a `Buffer` or a string.
|
||||
* Validates the stream's length against an expected length and maximum
|
||||
* limit. Ideal for parsing request bodies.
|
||||
*/
|
||||
declare function getRawBody(
|
||||
stream: Readable,
|
||||
callback: (err: getRawBody.RawBodyError, body: Buffer) => void
|
||||
): void;
|
||||
|
||||
declare function getRawBody(
|
||||
stream: Readable,
|
||||
options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding,
|
||||
callback: (err: getRawBody.RawBodyError, body: string) => void
|
||||
): void;
|
||||
|
||||
declare function getRawBody(
|
||||
stream: Readable,
|
||||
options: getRawBody.Options,
|
||||
callback: (err: getRawBody.RawBodyError, body: Buffer) => void
|
||||
): void;
|
||||
|
||||
declare function getRawBody(
|
||||
stream: Readable,
|
||||
options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding
|
||||
): Promise<string>;
|
||||
|
||||
declare function getRawBody(
|
||||
stream: Readable,
|
||||
options?: getRawBody.Options
|
||||
): Promise<Buffer>;
|
||||
|
||||
export = getRawBody;
|
||||
@@ -0,0 +1,517 @@
|
||||
# 6.0.11
|
||||
|
||||
- Fixed: parse attribute case insensitivity flag
|
||||
|
||||
# 6.0.10
|
||||
|
||||
- Fixed: `isPseudoElement()` supports `:first-letter` and `:first-line`
|
||||
|
||||
# 6.0.9
|
||||
|
||||
- Fixed: `Combinator.raws` property type
|
||||
|
||||
# 6.0.8
|
||||
|
||||
- Fixed: reduced size
|
||||
|
||||
# 6.0.7
|
||||
|
||||
- Fixed: parse animation percents
|
||||
|
||||
# 6.0.6
|
||||
|
||||
- Fixed: parse quoted attributes containing a newline correctly
|
||||
|
||||
# 6.0.5
|
||||
|
||||
- Perf: rework unesc for a 63+% performance boost
|
||||
|
||||
# 6.0.4
|
||||
|
||||
- Fixed: ts errors
|
||||
|
||||
# 6.0.3
|
||||
|
||||
- Fixed: replace node built-in "util" module with "util-deprecate"
|
||||
- Fixed: handle uppercase pseudo elements
|
||||
- Fixed: do not create invalid combinator before comment
|
||||
|
||||
# 6.0.2
|
||||
|
||||
- Fixed an issue with parsing and stringifying an empty attribute value
|
||||
|
||||
# 6.0.1
|
||||
|
||||
- Fixed an issue with unicode surrogate pair parsing
|
||||
|
||||
# 6.0.0
|
||||
|
||||
- Updated: `cssesc` to 3.0.0 (major)
|
||||
- Fixed: Issues with escaped `id` and `class` selectors
|
||||
|
||||
# 5.0.0
|
||||
|
||||
- Allow escaped dot within class name.
|
||||
- Update PostCSS to 7.0.7 (patch)
|
||||
|
||||
# 5.0.0-rc.4
|
||||
|
||||
- Fixed an issue where comments immediately after an insensitive (in attribute)
|
||||
were not parsed correctly.
|
||||
- Updated `cssesc` to 2.0.0 (major).
|
||||
- Removed outdated integration tests.
|
||||
- Added tests for custom selectors, tags with attributes, the universal
|
||||
selector with pseudos, and tokens after combinators.
|
||||
|
||||
# 5.0.0-rc.1
|
||||
|
||||
To ease adoption of the v5.0 release, we have relaxed the node version
|
||||
check performed by npm at installation time to allow for node 4, which
|
||||
remains officially unsupported, but likely to continue working for the
|
||||
time being.
|
||||
|
||||
# 5.0.0-rc.0
|
||||
|
||||
This release has **BREAKING CHANGES** that were required to fix regressions
|
||||
in 4.0.0 and to make the Combinator Node API consistent for all combinator
|
||||
types. Please read carefully.
|
||||
|
||||
## Summary of Changes
|
||||
|
||||
* The way a descendent combinator that isn't a single space character (E.g. `.a .b`) is stored in the AST has changed.
|
||||
* Named Combinators (E.g. `.a /for/ .b`) are now properly parsed as a combinator.
|
||||
* It is now possible to look up a node based on the source location of a character in that node and to query nodes if they contain some character.
|
||||
* Several bug fixes that caused the parser to hang and run out of memory when a `/` was encountered have been fixed.
|
||||
* The minimum supported version of Node is now `v6.0.0`.
|
||||
|
||||
### Changes to the Descendent Combinator
|
||||
|
||||
In prior releases, the value of a descendant combinator with multiple spaces included all the spaces.
|
||||
|
||||
* `.a .b`: Extra spaces are now stored as space before.
|
||||
- Old & Busted:
|
||||
- `combinator.value === " "`
|
||||
- New hotness:
|
||||
- `combinator.value === " " && combinator.spaces.before === " "`
|
||||
* `.a /*comment*/.b`: A comment at the end of the combinator causes extra space to become after space.
|
||||
- Old & Busted:
|
||||
- `combinator.value === " "`
|
||||
- `combinator.raws.value === " /*comment/"`
|
||||
- New hotness:
|
||||
- `combinator.value === " "`
|
||||
- `combinator.spaces.after === " "`
|
||||
- `combinator.raws.spaces.after === " /*comment*/"`
|
||||
* `.a<newline>.b`: whitespace that doesn't start or end with a single space character is stored as a raw value.
|
||||
- Old & Busted:
|
||||
- `combinator.value === "\n"`
|
||||
- `combinator.raws.value === undefined`
|
||||
- New hotness:
|
||||
- `combinator.value === " "`
|
||||
- `combinator.raws.value === "\n"`
|
||||
|
||||
### Support for "Named Combinators"
|
||||
|
||||
Although, nonstandard and unlikely to ever become a standard, combinators like `/deep/` and `/for/` are now properly supported.
|
||||
|
||||
Because they've been taken off the standardization track, there is no spec-official name for combinators of the form `/<ident>/`. However, I talked to [Tab Atkins](https://twitter.com/tabatkins) and we agreed to call them "named combinators" so now they are called that.
|
||||
|
||||
Before this release such named combinators were parsed without intention and generated three nodes of type `"tag"` where the first and last nodes had a value of `"/"`.
|
||||
|
||||
* `.a /for/ .b` is parsed as a combinator.
|
||||
- Old & Busted:
|
||||
- `root.nodes[0].nodes[1].type === "tag"`
|
||||
- `root.nodes[0].nodes[1].value === "/"`
|
||||
- New hotness:
|
||||
- `root.nodes[0].nodes[1].type === "combinator"`
|
||||
- `root.nodes[0].nodes[1].value === "/for/"`
|
||||
* `.a /F\6fR/ .b` escapes are handled and uppercase is normalized.
|
||||
- Old & Busted:
|
||||
- `root.nodes[0].nodes[2].type === "tag"`
|
||||
- `root.nodes[0].nodes[2].value === "F\\6fR"`
|
||||
- New hotness:
|
||||
- `root.nodes[0].nodes[1].type === "combinator"`
|
||||
- `root.nodes[0].nodes[1].value === "/for/"`
|
||||
- `root.nodes[0].nodes[1].raws.value === "/F\\6fR/"`
|
||||
|
||||
### Source position checks and lookups
|
||||
|
||||
A new API was added to look up a node based on the source location.
|
||||
|
||||
```js
|
||||
const selectorParser = require("postcss-selector-parser");
|
||||
// You can find the most specific node for any given character
|
||||
let combinator = selectorParser.astSync(".a > .b").atPosition(1,4);
|
||||
combinator.toString() === " > ";
|
||||
// You can check if a node includes a specific character
|
||||
// Whitespace surrounding the node that is owned by that node
|
||||
// is included in the check.
|
||||
[2,3,4,5,6].map(column => combinator.isAtPosition(1, column));
|
||||
// => [false, true, true, true, false]
|
||||
```
|
||||
|
||||
# 4.0.0
|
||||
|
||||
This release has **BREAKING CHANGES** that were required to fix bugs regarding values with escape sequences. Please read carefully.
|
||||
|
||||
* **Identifiers with escapes** - CSS escape sequences are now hidden from the public API by default.
|
||||
The normal value of a node like a class name or ID, or an aspect of a node such as attribute
|
||||
selector's value, is unescaped. Escapes representing Non-ascii characters are unescaped into
|
||||
unicode characters. For example: `bu\tton, .\31 00, #i\2764\FE0Fu, [attr="value is \"quoted\""]`
|
||||
will parse respectively to the values `button`, `100`, `i❤️u`, `value is "quoted"`.
|
||||
The original escape sequences for these values can be found in the corresponding property name
|
||||
in `node.raws`. Where possible, deprecation warnings were added, but the nature
|
||||
of escape handling makes it impossible to detect what is escaped or not. Our expectation is
|
||||
that most users are neither expecting nor handling escape sequences in their use of this library,
|
||||
and so for them, this is a bug fix. Users who are taking care to handle escapes correctly can
|
||||
now update their code to remove the escape handling and let us do it for them.
|
||||
|
||||
* **Mutating values with escapes** - When you make an update to a node property that has escape handling
|
||||
The value is assumed to be unescaped, and any special characters are escaped automatically and
|
||||
the corresponding `raws` value is immediately updated. This can result in changes to the original
|
||||
escape format. Where the exact value of the escape sequence is important there are methods that
|
||||
allow both values to be set in conjunction. There are a number of new convenience methods for
|
||||
manipulating values that involve escapes, especially for attributes values where the quote mark
|
||||
is involved. See https://github.com/postcss/postcss-selector-parser/pull/133 for an extensive
|
||||
write-up on these changes.
|
||||
|
||||
|
||||
**Upgrade/API Example**
|
||||
|
||||
In `3.x` there was no unescape handling and internal consistency of several properties was the caller's job to maintain. It was very easy for the developer
|
||||
to create a CSS file that did not parse correctly when some types of values
|
||||
were in use.
|
||||
|
||||
```js
|
||||
const selectorParser = require("postcss-selector-parser");
|
||||
let attr = selectorParser.attribute({attribute: "id", operator: "=", value: "a-value"});
|
||||
attr.value; // => "a-value"
|
||||
attr.toString(); // => [id=a-value]
|
||||
// Add quotes to an attribute's value.
|
||||
// All these values have to be set by the caller to be consistent:
|
||||
// no internal consistency is maintained.
|
||||
attr.raws.unquoted = attr.value
|
||||
attr.value = "'" + attr.value + "'";
|
||||
attr.value; // => "'a-value'"
|
||||
attr.quoted = true;
|
||||
attr.toString(); // => "[id='a-value']"
|
||||
```
|
||||
|
||||
In `4.0` there is a convenient API for setting and mutating values
|
||||
that may need escaping. Especially for attributes.
|
||||
|
||||
```js
|
||||
const selectorParser = require("postcss-selector-parser");
|
||||
|
||||
// The constructor requires you specify the exact escape sequence
|
||||
let className = selectorParser.className({value: "illegal class name", raws: {value: "illegal\\ class\\ name"}});
|
||||
className.toString(); // => '.illegal\\ class\\ name'
|
||||
|
||||
// So it's better to set the value as a property
|
||||
className = selectorParser.className();
|
||||
// Most properties that deal with identifiers work like this
|
||||
className.value = "escape for me";
|
||||
className.value; // => 'escape for me'
|
||||
className.toString(); // => '.escape\\ for\\ me'
|
||||
|
||||
// emoji and all non-ascii are escaped to ensure it works in every css file.
|
||||
className.value = "😱🦄😍";
|
||||
className.value; // => '😱🦄😍'
|
||||
className.toString(); // => '.\\1F631\\1F984\\1F60D'
|
||||
|
||||
// you can control the escape sequence if you want, or do bad bad things
|
||||
className.setPropertyAndEscape('value', 'xxxx', 'yyyy');
|
||||
className.value; // => "xxxx"
|
||||
className.toString(); // => ".yyyy"
|
||||
|
||||
// Pass a value directly through to the css output without escaping it.
|
||||
className.setPropertyWithoutEscape('value', '$REPLACE_ME$');
|
||||
className.value; // => "$REPLACE_ME$"
|
||||
className.toString(); // => ".$REPLACE_ME$"
|
||||
|
||||
// The biggest changes are to the Attribute class
|
||||
// passing quoteMark explicitly is required to avoid a deprecation warning.
|
||||
let attr = selectorParser.attribute({attribute: "id", operator: "=", value: "a-value", quoteMark: null});
|
||||
attr.toString(); // => "[id=a-value]"
|
||||
// Get the value with quotes on it and any necessary escapes.
|
||||
// This is the same as reading attr.value in 3.x.
|
||||
attr.getQuotedValue(); // => "a-value";
|
||||
attr.quoteMark; // => null
|
||||
|
||||
// Add quotes to an attribute's value.
|
||||
attr.quoteMark = "'"; // This is all that's required.
|
||||
attr.toString(); // => "[id='a-value']"
|
||||
attr.quoted; // => true
|
||||
// The value is still the same, only the quotes have changed.
|
||||
attr.value; // => a-value
|
||||
attr.getQuotedValue(); // => "'a-value'";
|
||||
|
||||
// deprecated assignment, no warning because there's no escapes
|
||||
attr.value = "new-value";
|
||||
// no quote mark is needed so it is removed
|
||||
attr.getQuotedValue(); // => "new-value";
|
||||
|
||||
// deprecated assignment,
|
||||
attr.value = "\"a 'single quoted' value\"";
|
||||
// > (node:27859) DeprecationWarning: Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead.
|
||||
attr.getQuotedValue(); // => '"a \'single quoted\' value"';
|
||||
// quote mark inferred from first and last characters.
|
||||
attr.quoteMark; // => '"'
|
||||
|
||||
// setValue takes options to make manipulating the value simple.
|
||||
attr.setValue('foo', {smart: true});
|
||||
// foo doesn't require any escapes or quotes.
|
||||
attr.toString(); // => '[id=foo]'
|
||||
attr.quoteMark; // => null
|
||||
|
||||
// An explicit quote mark can be specified
|
||||
attr.setValue('foo', {quoteMark: '"'});
|
||||
attr.toString(); // => '[id="foo"]'
|
||||
|
||||
// preserves quote mark by default
|
||||
attr.setValue('bar');
|
||||
attr.toString(); // => '[id="bar"]'
|
||||
attr.quoteMark = null;
|
||||
attr.toString(); // => '[id=bar]'
|
||||
|
||||
// with no arguments, it preserves quote mark even when it's not a great idea
|
||||
attr.setValue('a value \n that should be quoted');
|
||||
attr.toString(); // => '[id=a\\ value\\ \\A\\ that\\ should\\ be\\ quoted]'
|
||||
|
||||
// smart preservation with a specified default
|
||||
attr.setValue('a value \n that should be quoted', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"});
|
||||
// => "[id='a value \\A that should be quoted']"
|
||||
attr.quoteMark = '"';
|
||||
// => '[id="a value \\A that should be quoted"]'
|
||||
|
||||
// this keeps double quotes because it wants to quote the value and the existing value has double quotes.
|
||||
attr.setValue('this should be quoted', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"});
|
||||
// => '[id="this should be quoted"]'
|
||||
|
||||
// picks single quotes because the value has double quotes
|
||||
attr.setValue('a "double quoted" value', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"});
|
||||
// => "[id='a "double quoted" value']"
|
||||
|
||||
// setPropertyAndEscape lets you do anything you want. Even things that are a bad idea and illegal.
|
||||
attr.setPropertyAndEscape('value', 'xxxx', 'the password is 42');
|
||||
attr.value; // => "xxxx"
|
||||
attr.toString(); // => "[id=the password is 42]"
|
||||
|
||||
// Pass a value directly through to the css output without escaping it.
|
||||
attr.setPropertyWithoutEscape('value', '$REPLACEMENT$');
|
||||
attr.value; // => "$REPLACEMENT$"
|
||||
attr.toString(); // => "[id=$REPLACEMENT$]"
|
||||
```
|
||||
|
||||
# 3.1.2
|
||||
|
||||
* Fix: Removed dot-prop dependency since it's no longer written in es5.
|
||||
|
||||
# 3.1.1
|
||||
|
||||
* Fix: typescript definitions weren't in the published package.
|
||||
|
||||
# 3.1.0
|
||||
|
||||
* Fixed numerous bugs in attribute nodes relating to the handling of comments
|
||||
and whitespace. There's significant changes to `attrNode.spaces` and `attrNode.raws` since the `3.0.0` release.
|
||||
* Added `Attribute#offsetOf(part)` to get the offset location of
|
||||
attribute parts like `"operator"` and `"value"`. This is most
|
||||
often added to `Attribute#sourceIndex` for error reporting.
|
||||
|
||||
# 3.0.0
|
||||
|
||||
## Breaking changes
|
||||
|
||||
* Some tweaks to the tokenizer/attribute selector parsing mean that whitespace
|
||||
locations might be slightly different to the 2.x code.
|
||||
* Better attribute selector parsing with more validation; postcss-selector-parser
|
||||
no longer uses regular expressions to parse attribute selectors.
|
||||
* Added an async API (thanks to @jacobp100); the default `process` API is now
|
||||
async, and the sync API is now accessed through `processSync` instead.
|
||||
* `process()` and `processSync()` now return a string instead of the Processor
|
||||
instance.
|
||||
* Tweaks handling of Less interpolation (thanks to @jwilsson).
|
||||
* Removes support for Node 0.12.
|
||||
|
||||
## Other changes
|
||||
|
||||
* `ast()` and `astSync()` methods have been added to the `Processor`. These
|
||||
return the `Root` node of the selectors after processing them.
|
||||
* `transform()` and `transformSync()` methods have been added to the
|
||||
`Processor`. These return the value returned by the processor callback
|
||||
after processing the selectors.
|
||||
* Set the parent when inserting a node (thanks to @chriseppstein).
|
||||
* Correctly adjust indices when using insertBefore/insertAfter (thanks to @tivac).
|
||||
* Fixes handling of namespaces with qualified tag selectors.
|
||||
* `process`, `ast` and `transform` (and their sync variants) now accept a
|
||||
`postcss` rule node. When provided, better errors are generated and selector
|
||||
processing is automatically set back to the rule selector (unless the `updateSelector` option is set to `false`.)
|
||||
* Now more memory efficient when tokenizing selectors.
|
||||
|
||||
### Upgrade hints
|
||||
|
||||
The pattern of:
|
||||
|
||||
`rule.selector = processor.process(rule.selector).result.toString();`
|
||||
|
||||
is now:
|
||||
|
||||
`processor.processSync(rule)`
|
||||
|
||||
# 2.2.3
|
||||
|
||||
* Resolves an issue where the parser would not reduce multiple spaces between an
|
||||
ampersand and another simple selector in lossy mode (thanks to @adam-26).
|
||||
|
||||
# 2.2.2
|
||||
|
||||
* No longer hangs on an unescaped semicolon; instead the parser will throw
|
||||
an exception for these cases.
|
||||
|
||||
# 2.2.1
|
||||
|
||||
* Allows a consumer to specify whitespace tokens when creating a new Node
|
||||
(thanks to @Semigradsky).
|
||||
|
||||
# 2.2.0
|
||||
|
||||
* Added a new option to normalize whitespace when parsing the selector string
|
||||
(thanks to @adam-26).
|
||||
|
||||
# 2.1.1
|
||||
|
||||
* Better unquoted value handling within attribute selectors
|
||||
(thanks to @evilebottnawi).
|
||||
|
||||
# 2.1.0
|
||||
|
||||
* Added: Use string constants for all node types & expose them on the main
|
||||
parser instance (thanks to @Aweary).
|
||||
|
||||
# 2.0.0
|
||||
|
||||
This release contains the following breaking changes:
|
||||
|
||||
* Renamed all `eachInside` iterators to `walk`. For example, `eachTag` is now
|
||||
`walkTags`, and `eachInside` is now `walk`.
|
||||
* Renamed `Node#removeSelf()` to `Node#remove()`.
|
||||
* Renamed `Container#remove()` to `Container#removeChild()`.
|
||||
* Renamed `Node#raw` to `Node#raws` (thanks to @davidtheclark).
|
||||
* Now parses `&` as the *nesting* selector, rather than a *tag* selector.
|
||||
* Fixes misinterpretation of Sass interpolation (e.g. `#{foo}`) as an
|
||||
id selector (thanks to @davidtheclark).
|
||||
|
||||
and;
|
||||
|
||||
* Fixes parsing of attribute selectors with equals signs in them
|
||||
(e.g. `[data-attr="foo=bar"]`) (thanks to @montmanu).
|
||||
* Adds `quoted` and `raw.unquoted` properties to attribute nodes
|
||||
(thanks to @davidtheclark).
|
||||
|
||||
# 1.3.3
|
||||
|
||||
* Fixes an infinite loop on `)` and `]` tokens when they had no opening pairs.
|
||||
Now postcss-selector-parser will throw when it encounters these lone tokens.
|
||||
|
||||
# 1.3.2
|
||||
|
||||
* Now uses plain integers rather than `str.charCodeAt(0)` for compiled builds.
|
||||
|
||||
# 1.3.1
|
||||
|
||||
* Update flatten to v1.x (thanks to @shinnn).
|
||||
|
||||
# 1.3.0
|
||||
|
||||
* Adds a new node type, `String`, to fix a crash on selectors such as
|
||||
`foo:bar("test")`.
|
||||
|
||||
# 1.2.1
|
||||
|
||||
* Fixes a crash when the parser encountered a trailing combinator.
|
||||
|
||||
# 1.2.0
|
||||
|
||||
* A more descriptive error is thrown when the parser expects to find a
|
||||
pseudo-class/pseudo-element (thanks to @ashelley).
|
||||
* Adds support for line/column locations for selector nodes, as well as a
|
||||
`Node#sourceIndex` method (thanks to @davidtheclark).
|
||||
|
||||
# 1.1.4
|
||||
|
||||
* Fixes a crash when a selector started with a `>` combinator. The module will
|
||||
now no longer throw if a selector has a leading/trailing combinator node.
|
||||
|
||||
# 1.1.3
|
||||
|
||||
* Fixes a crash on `@` tokens.
|
||||
|
||||
# 1.1.2
|
||||
|
||||
* Fixes an infinite loop caused by using parentheses in a non-pseudo element
|
||||
context.
|
||||
|
||||
# 1.1.1
|
||||
|
||||
* Fixes a crash when a backslash ended a selector string.
|
||||
|
||||
# 1.1.0
|
||||
|
||||
* Adds support for replacing multiple nodes at once with `replaceWith`
|
||||
(thanks to @jonathantneal).
|
||||
* Parser no longer throws on sequential IDs and trailing commas, to support
|
||||
parsing of selector hacks.
|
||||
|
||||
# 1.0.1
|
||||
|
||||
* Fixes using `insertAfter` and `insertBefore` during iteration.
|
||||
|
||||
# 1.0.0
|
||||
|
||||
* Adds `clone` and `replaceWith` methods to nodes.
|
||||
* Adds `insertBefore` and `insertAfter` to containers.
|
||||
* Stabilises API.
|
||||
|
||||
# 0.0.5
|
||||
|
||||
* Fixes crash on extra whitespace inside a pseudo selector's parentheses.
|
||||
* Adds sort function to the container class.
|
||||
* Enables the parser to pass its input through without transforming.
|
||||
* Iteration-safe `each` and `eachInside`.
|
||||
|
||||
# 0.0.4
|
||||
|
||||
* Tidy up redundant duplication.
|
||||
* Fixes a bug where the parser would loop infinitely on universal selectors
|
||||
inside pseudo selectors.
|
||||
* Adds `length` getter and `eachInside`, `map`, `reduce` to the container class.
|
||||
* When a selector has been removed from the tree, the root node will no longer
|
||||
cast it to a string.
|
||||
* Adds node type iterators to the container class (e.g. `eachComment`).
|
||||
* Adds filter function to the container class.
|
||||
* Adds split function to the container class.
|
||||
* Create new node types by doing `parser.id(opts)` etc.
|
||||
* Adds support for pseudo classes anywhere in the selector.
|
||||
|
||||
# 0.0.3
|
||||
|
||||
* Adds `next` and `prev` to the node class.
|
||||
* Adds `first` and `last` getters to the container class.
|
||||
* Adds `every` and `some` iterators to the container class.
|
||||
* Add `empty` alias for `removeAll`.
|
||||
* Combinators are now types of node.
|
||||
* Fixes the at method so that it is not an alias for `index`.
|
||||
* Tidy up creation of new nodes in the parser.
|
||||
* Refactors how namespaces are handled for consistency & less redundant code.
|
||||
* Refactors AST to use `nodes` exclusively, and eliminates excessive nesting.
|
||||
* Fixes nested pseudo parsing.
|
||||
* Fixes whitespace parsing.
|
||||
|
||||
# 0.0.2
|
||||
|
||||
* Adds support for namespace selectors.
|
||||
* Adds support for selectors joined by escaped spaces - such as `.\31\ 0`.
|
||||
|
||||
# 0.0.1
|
||||
|
||||
* Initial release.
|
||||
@@ -0,0 +1,10 @@
|
||||
import assertString from './util/assertString';
|
||||
export default function matches(str, pattern, modifiers) {
|
||||
assertString(str);
|
||||
|
||||
if (Object.prototype.toString.call(pattern) !== '[object RegExp]') {
|
||||
pattern = new RegExp(pattern, modifiers);
|
||||
}
|
||||
|
||||
return !!str.match(pattern);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
import { Subject } from '../Subject';
|
||||
import { Observable } from '../Observable';
|
||||
import { ConnectableObservable } from '../observable/ConnectableObservable';
|
||||
import { OperatorFunction, UnaryFunction, ObservedValueOf, ObservableInput } from '../types';
|
||||
/**
|
||||
* An operator that creates a {@link ConnectableObservable}, that when connected,
|
||||
* with the `connect` method, will use the provided subject to multicast the values
|
||||
* from the source to all consumers.
|
||||
*
|
||||
* @param subject The subject to multicast through.
|
||||
* @return A function that returns a {@link ConnectableObservable}
|
||||
* @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
|
||||
* If you're using {@link refCount} after `multicast`, use the {@link share} operator instead.
|
||||
* `multicast(subject), refCount()` is equivalent to
|
||||
* `share({ connector: () => subject, resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false })`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export declare function multicast<T>(subject: Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
|
||||
/**
|
||||
* Because this is deprecated in favor of the {@link connect} operator, and was otherwise poorly documented,
|
||||
* rather than duplicate the effort of documenting the same behavior, please see documentation for the
|
||||
* {@link connect} operator.
|
||||
*
|
||||
* @param subject The subject used to multicast.
|
||||
* @param selector A setup function to setup the multicast
|
||||
* @return A function that returns an observable that mirrors the observable returned by the selector.
|
||||
* @deprecated Will be removed in v8. Use the {@link connect} operator instead.
|
||||
* `multicast(subject, selector)` is equivalent to
|
||||
* `connect(selector, { connector: () => subject })`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export declare function multicast<T, O extends ObservableInput<any>>(subject: Subject<T>, selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
|
||||
/**
|
||||
* An operator that creates a {@link ConnectableObservable}, that when connected,
|
||||
* with the `connect` method, will use the provided subject to multicast the values
|
||||
* from the source to all consumers.
|
||||
*
|
||||
* @param subjectFactory A factory that will be called to create the subject. Passing a function here
|
||||
* will cause the underlying subject to be "reset" on error, completion, or refCounted unsubscription of
|
||||
* the source.
|
||||
* @return A function that returns a {@link ConnectableObservable}
|
||||
* @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
|
||||
* If you're using {@link refCount} after `multicast`, use the {@link share} operator instead.
|
||||
* `multicast(() => new BehaviorSubject('test')), refCount()` is equivalent to
|
||||
* `share({ connector: () => new BehaviorSubject('test') })`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export declare function multicast<T>(subjectFactory: () => Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
|
||||
/**
|
||||
* Because this is deprecated in favor of the {@link connect} operator, and was otherwise poorly documented,
|
||||
* rather than duplicate the effort of documenting the same behavior, please see documentation for the
|
||||
* {@link connect} operator.
|
||||
*
|
||||
* @param subjectFactory A factory that creates the subject used to multicast.
|
||||
* @param selector A function to setup the multicast and select the output.
|
||||
* @return A function that returns an observable that mirrors the observable returned by the selector.
|
||||
* @deprecated Will be removed in v8. Use the {@link connect} operator instead.
|
||||
* `multicast(subjectFactory, selector)` is equivalent to
|
||||
* `connect(selector, { connector: subjectFactory })`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export declare function multicast<T, O extends ObservableInput<any>>(subjectFactory: () => Subject<T>, selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
|
||||
//# sourceMappingURL=multicast.d.ts.map
|
||||
@@ -0,0 +1,8 @@
|
||||
export type ResponseDistanceDonation = {
|
||||
runner: any;
|
||||
amountPerDistance: number;
|
||||
id: number;
|
||||
donor: string;
|
||||
amount: number;
|
||||
paidAmount: number;
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
# escape-string-regexp
|
||||
|
||||
> Escape RegExp special characters
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install escape-string-regexp
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import escapeStringRegexp from 'escape-string-regexp';
|
||||
|
||||
const escapedString = escapeStringRegexp('How much $ for a 🦄?');
|
||||
//=> 'How much \\$ for a 🦄\\?'
|
||||
|
||||
new RegExp(escapedString);
|
||||
```
|
||||
|
||||
You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-escape-string-regexp?utm_source=npm-escape-string-regexp&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sequenceEqual.js","sourceRoot":"","sources":["../../../../src/internal/operators/sequenceEqual.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AA2DpD,MAAM,UAAU,aAAa,CAC3B,SAA6B,EAC7B,aAAsC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC;IAEvD,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QAEpC,MAAM,MAAM,GAAG,WAAW,EAAK,CAAC;QAEhC,MAAM,MAAM,GAAG,WAAW,EAAK,CAAC;QAGhC,MAAM,IAAI,GAAG,CAAC,OAAgB,EAAE,EAAE;YAChC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACzB,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC,CAAC;QAOF,MAAM,gBAAgB,GAAG,CAAC,SAA2B,EAAE,UAA4B,EAAE,EAAE;YACrF,MAAM,uBAAuB,GAAG,wBAAwB,CACtD,UAAU,EACV,CAAC,CAAI,EAAE,EAAE;gBACP,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;gBACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;oBAOvB,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBACnD;qBAAM;oBAIL,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,EAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;iBAChD;YACH,CAAC,EACD,GAAG,EAAE;gBAEH,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC;gBAC1B,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;gBAKxC,QAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;gBAEtC,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,WAAW,EAAE,CAAC;YACzC,CAAC,CACF,CAAC;YAEF,OAAO,uBAAuB,CAAC;QACjC,CAAC,CAAC;QAGF,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QACnD,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC;AAgBD,SAAS,WAAW;IAClB,OAAO;QACL,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,KAAK;KAChB,CAAC;AACJ,CAAC"}
|
||||
@@ -0,0 +1,33 @@
|
||||
# shebang-regex [](https://travis-ci.org/sindresorhus/shebang-regex)
|
||||
|
||||
> Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install shebang-regex
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const shebangRegex = require('shebang-regex');
|
||||
|
||||
const string = '#!/usr/bin/env node\nconsole.log("unicorns");';
|
||||
|
||||
shebangRegex.test(string);
|
||||
//=> true
|
||||
|
||||
shebangRegex.exec(string)[0];
|
||||
//=> '#!/usr/bin/env node'
|
||||
|
||||
shebangRegex.exec(string)[1];
|
||||
//=> '/usr/bin/env node'
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
Reference in New Issue
Block a user