new license file version [CI SKIP]

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

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isAfter;
var _toDate = _interopRequireDefault(require("./toDate"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function isAfter(date, options) {
// For backwards compatibility:
// isAfter(str [, date]), i.e. `options` could be used as argument for the legacy `date`
var comparisonDate = (options === null || options === void 0 ? void 0 : options.comparisonDate) || options || Date().toString();
var comparison = (0, _toDate.default)(comparisonDate);
var original = (0, _toDate.default)(date);
return !!(original && comparison && original > comparison);
}
module.exports = exports.default;
module.exports.default = exports.default;

View File

@@ -0,0 +1,23 @@
var nativeCreate = require('./_nativeCreate');
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
module.exports = hashSet;

View File

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

View File

@@ -0,0 +1 @@
{"name":"open","version":"8.4.2","files":{"license":{"checkedAt":1678883669302,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"xdg-open":{"checkedAt":1678883671437,"integrity":"sha512-NPQrxEItF5nq1ZL/06lvSOot8RY0eTU6U6nCkFKYVAbfFy6xfny1+YmjzyH0B9jfTYMPeHtxUlok0w7oDnOItA==","mode":493,"size":25778},"index.js":{"checkedAt":1678883671442,"integrity":"sha512-+adG7ZXz2Vcl18DXRTexUDOU2YFAx3GR2wZbqH05cak+5D8PiUXdb+yJ7DRzN1g3rkaWBbNaeHOAXJ28RtsBPQ==","mode":420,"size":7841},"package.json":{"checkedAt":1678883671442,"integrity":"sha512-6fLAmWjhIMEKLrybMwFrQ044VJz6Jl0LK8f6P9MSnk0E9fWhjLkNzbYMO/271So/oshGurpi236lUL689P+liQ==","mode":420,"size":983},"readme.md":{"checkedAt":1678883671442,"integrity":"sha512-1YZAJrbTu/mbNL21vlINLQklFL18+p2U+UuL14IuQaBOum3f5bLqbqi/EGKaqRCg0JE/9lfeT2V0s5LWNyt0Mg==","mode":420,"size":5663},"index.d.ts":{"checkedAt":1678883671449,"integrity":"sha512-sicGTbeDB3cEApkATqzPez76nTPnCDxGEL3vGkBPD5ysmWJyHNRorh2/zeThd7+kihzWTuX2p4mj3+O/kaDGkw==","mode":420,"size":4906}}}

View File

@@ -0,0 +1 @@
{"name":"fetch-blob","version":"3.2.0","files":{"LICENSE":{"checkedAt":1678883671426,"integrity":"sha512-NIg33Afj2LwbcAM7J8cz/zrtSzaruGm5u4+c10PeI0YZOKDDtjJiijuFPz/WpC9sZa0kDkAkYJWuB810YzEemQ==","mode":420,"size":1068},"streams.cjs":{"checkedAt":1678883671426,"integrity":"sha512-Ncgd3GxCn32XRfQdNRRpTWv45QukcDr+vc8JhLXBiMqLAyV4XtwzzhHWAFaHrM1DRME3pbLMNpUeEYIiUjBWBg==","mode":420,"size":1604},"file.js":{"checkedAt":1678883671426,"integrity":"sha512-1VOM6bBllMIf4HDQe+YVRaGiNX2mvEDdP7OSStvIe0p7foySilSAo9k/lICA9v+6dxfsXoWrYI0fQlR7DvlFYA==","mode":420,"size":1228},"from.js":{"checkedAt":1678883671426,"integrity":"sha512-2jyJnC29riBvc5uiFwkSlaYEOQq71wfgWk3sZ+vO0YZ2k+CS6l1AANetw/kBf/gQTwZVYQW14x1kxMDTpLBFcQ==","mode":420,"size":2648},"index.js":{"checkedAt":1678883671430,"integrity":"sha512-Id8B/EIHCRpZ6d62AsvExxd9uLa0D2UUvt7WNmLkBANEwyvQ173wHDRh+bTrnXmXPPa6Qs8+a+wfVnVaXYwfKw==","mode":420,"size":7432},"README.md":{"checkedAt":1678883671430,"integrity":"sha512-VNo2V4Iwj+lkDcFuq2tYhvDfujups1EWKMKmRFWQqFzHFxLmN6AnzjEcApGzzvSw/678XhQDX+fQJyjNTsieSQ==","mode":420,"size":5106},"package.json":{"checkedAt":1678883671430,"integrity":"sha512-Dl21IdB19mpnc6QaBDXk+KvlAY2owtZknIEtbLC4919Oa5EhVjxpwxvmH1PL/E4EmCA0mNoUpSEpqRDGqXZQ6Q==","mode":420,"size":1646},"file.d.ts":{"checkedAt":1678883671430,"integrity":"sha512-LF0GvxT7L3Av0NaagYM3jS8moiLIatc1SC+Zx0mCggCkLhgvHXBbbEd90Vs4qWUNR7MGHr+uhcneQv85WQgsnQ==","mode":420,"size":102},"from.d.ts":{"checkedAt":1678883671430,"integrity":"sha512-i0xupX0FB8TQ8+vsdZr/Zy9H0lOa8frloweeI1jT4zPXkBna0ozsaFBYSP2c3PhyIigqHmf5fcl7k+TxxcL3Cw==","mode":420,"size":819},"index.d.ts":{"checkedAt":1678883671430,"integrity":"sha512-3MRmKdSFdyU3DxduahArxVouwiKMoMd/VtV/XmGrQFWY7guxVOwd5rvrUwDdn3xvgtNbdAYEnpEiLjuwXKXHAg==","mode":420,"size":102}}}

View File

@@ -0,0 +1 @@
{"version":3,"file":"buffer.js","sourceRoot":"","sources":["../../../../src/internal/operators/buffer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAwCpD,MAAM,UAAU,MAAM,CAAI,eAAqC;IAC7D,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QAEpC,IAAI,aAAa,GAAQ,EAAE,CAAC;QAG5B,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EACV,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EACpC,GAAG,EAAE;YACH,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC/B,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC,CACF,CACF,CAAC;QAGF,SAAS,CAAC,eAAe,CAAC,CAAC,SAAS,CAClC,wBAAwB,CACtB,UAAU,EACV,GAAG,EAAE;YAEH,MAAM,CAAC,GAAG,aAAa,CAAC;YACxB,aAAa,GAAG,EAAE,CAAC;YACnB,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC,EACD,IAAI,CACL,CACF,CAAC;QAEF,OAAO,GAAG,EAAE;YAEV,aAAa,GAAG,IAAK,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Feross Aboukhadijeh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,63 @@
import { __extends } from "tslib";
import { Observable } from '../Observable';
import { Subscription } from '../Subscription';
import { refCount as higherOrderRefCount } from '../operators/refCount';
import { createOperatorSubscriber } from '../operators/OperatorSubscriber';
import { hasLift } from '../util/lift';
var ConnectableObservable = (function (_super) {
__extends(ConnectableObservable, _super);
function ConnectableObservable(source, subjectFactory) {
var _this = _super.call(this) || this;
_this.source = source;
_this.subjectFactory = subjectFactory;
_this._subject = null;
_this._refCount = 0;
_this._connection = null;
if (hasLift(source)) {
_this.lift = source.lift;
}
return _this;
}
ConnectableObservable.prototype._subscribe = function (subscriber) {
return this.getSubject().subscribe(subscriber);
};
ConnectableObservable.prototype.getSubject = function () {
var subject = this._subject;
if (!subject || subject.isStopped) {
this._subject = this.subjectFactory();
}
return this._subject;
};
ConnectableObservable.prototype._teardown = function () {
this._refCount = 0;
var _connection = this._connection;
this._subject = this._connection = null;
_connection === null || _connection === void 0 ? void 0 : _connection.unsubscribe();
};
ConnectableObservable.prototype.connect = function () {
var _this = this;
var connection = this._connection;
if (!connection) {
connection = this._connection = new Subscription();
var subject_1 = this.getSubject();
connection.add(this.source.subscribe(createOperatorSubscriber(subject_1, undefined, function () {
_this._teardown();
subject_1.complete();
}, function (err) {
_this._teardown();
subject_1.error(err);
}, function () { return _this._teardown(); })));
if (connection.closed) {
this._connection = null;
connection = Subscription.EMPTY;
}
}
return connection;
};
ConnectableObservable.prototype.refCount = function () {
return higherOrderRefCount()(this);
};
return ConnectableObservable;
}(Observable));
export { ConnectableObservable };
//# sourceMappingURL=ConnectableObservable.js.map

View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.empty = exports.EMPTY = void 0;
var Observable_1 = require("../Observable");
exports.EMPTY = new Observable_1.Observable(function (subscriber) { return subscriber.complete(); });
function empty(scheduler) {
return scheduler ? emptyScheduled(scheduler) : exports.EMPTY;
}
exports.empty = empty;
function emptyScheduled(scheduler) {
return new Observable_1.Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });
}
//# sourceMappingURL=empty.js.map

View File

@@ -0,0 +1 @@
{"name":"lines-and-columns","version":"1.2.4","files":{"LICENSE":{"checkedAt":1678883670654,"integrity":"sha512-m0aRS+mLrpg627RTRcS8Q1H7i/Ad0180SxqocFykZDIH4RS7ni2vODTxAt2cOC9YeYLsrcMp4TONveg/aJ4Egw==","mode":420,"size":1080},"build/index.js":{"checkedAt":1678883670654,"integrity":"sha512-cd+WO3KSInVKYtSH2e8a24MCnB4QKGtIW45G0DTICGoo6M/UIpOsS4OvF/xTeqVNgVljjO7eBrTGxLeEiVx5uQ==","mode":420,"size":2025},"package.json":{"checkedAt":1678883670654,"integrity":"sha512-OHotGjw9pIT0937BGqlWUBTsyNfL/+MXv6TqYgzodqzOWzzhZEa3kz1Fjo4sAdoefyo6TE9dgbP+B9JiwF4gmw==","mode":420,"size":1372},"build/index.d.ts":{"checkedAt":1678883670654,"integrity":"sha512-tzrftKMrRyF21MEwoGR7eLwu/fs3MeiRLgOcDIXeTbvjPhZk6tK/5+VFhLWcxycJoZ7pBhWG/n7c9w8B0NlFOA==","mode":420,"size":376},"README.md":{"checkedAt":1678883670654,"integrity":"sha512-9+KB1z93CQ4zdVa1F7R69eHfH+r3cvjjLfpEAsYHGeuiUgV17+8q6QjHnSj7onA9C70BbFmunR2fcldTBB2PBA==","mode":420,"size":533}}}

View File

@@ -0,0 +1 @@
{"version":3,"file":"elementAt.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/elementAt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAM5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAW/F"}

View File

@@ -0,0 +1,67 @@
{
"name": "side-channel",
"version": "1.0.4",
"description": "Store information about any JS value in a side channel. Uses WeakMap if available.",
"main": "index.js",
"exports": {
"./package.json": "./package.json",
".": [
{
"default": "./index.js"
},
"./index.js"
]
},
"scripts": {
"prepublish": "safe-publish-latest",
"lint": "eslint .",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "npx aud --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/side-channel.git"
},
"keywords": [
"weakmap",
"map",
"side",
"channel",
"metadata"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/side-channel/issues"
},
"homepage": "https://github.com/ljharb/side-channel#readme",
"devDependencies": {
"@ljharb/eslint-config": "^17.3.0",
"aud": "^1.1.3",
"auto-changelog": "^2.2.1",
"eslint": "^7.16.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^1.1.4",
"tape": "^5.0.1"
},
"dependencies": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
"object-inspect": "^1.9.0"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
}
}

View File

@@ -0,0 +1,2 @@
if(typeof cptable === 'undefined') cptable = {};
cptable[863] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();

View File

@@ -0,0 +1,17 @@
export default function incrementListIndex(current, dir, opt) {
const len = opt.choices.realLength;
const shouldLoop = 'loop' in opt ? Boolean(opt.loop) : true;
if (dir === 'up') {
if (current > 0) {
return current - 1;
}
return shouldLoop ? len - 1 : current;
}
if (dir === 'down') {
if (current < len - 1) {
return current + 1;
}
return shouldLoop ? 0 : current;
}
throw new Error('dir must be up or down');
}

View File

@@ -0,0 +1,60 @@
const SemVer = require('../classes/semver')
const Range = require('../classes/range')
const gt = require('../functions/gt')
const minVersion = (range, loose) => {
range = new Range(range, loose)
let minver = new SemVer('0.0.0')
if (range.test(minver)) {
return minver
}
minver = new SemVer('0.0.0-0')
if (range.test(minver)) {
return minver
}
minver = null
for (let i = 0; i < range.set.length; ++i) {
const comparators = range.set[i]
let setMin = null
comparators.forEach((comparator) => {
// Clone to avoid manipulating the comparator's semver object.
const compver = new SemVer(comparator.semver.version)
switch (comparator.operator) {
case '>':
if (compver.prerelease.length === 0) {
compver.patch++
} else {
compver.prerelease.push(0)
}
compver.raw = compver.format()
/* fallthrough */
case '':
case '>=':
if (!setMin || gt(compver, setMin)) {
setMin = compver
}
break
case '<':
case '<=':
/* Ignore maximum versions */
break
/* istanbul ignore next */
default:
throw new Error(`Unexpected operation: ${comparator.operator}`)
}
})
if (setMin && (!minver || gt(minver, setMin)))
minver = setMin
}
if (minver && range.test(minver)) {
return minver
}
return null
}
module.exports = minVersion

View File

@@ -0,0 +1,34 @@
var defaults = require('./'),
test = require('tap').test;
test("ensure options is an object", function(t) {
var options = defaults(false, { a : true });
t.ok(options.a);
t.end()
});
test("ensure defaults override keys", function(t) {
var result = defaults({}, { a: false, b: true });
t.ok(result.b, 'b merges over undefined');
t.equal(result.a, false, 'a merges over undefined');
t.end();
});
test("ensure defined keys are not overwritten", function(t) {
var result = defaults({ b: false }, { a: false, b: true });
t.equal(result.b, false, 'b not merged');
t.equal(result.a, false, 'a merges over undefined');
t.end();
});
test("ensure defaults clone nested objects", function(t) {
var d = { a: [1,2,3], b: { hello : 'world' } };
var result = defaults({}, d);
t.equal(result.a.length, 3, 'objects should be clones');
t.ok(result.a !== d.a, 'objects should be clones');
t.equal(Object.keys(result.b).length, 1, 'objects should be clones');
t.ok(result.b !== d.b, 'objects should be clones');
t.end();
});

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (C) 2015 Jordan Harband
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,9 @@
"use strict";
var isValue = require("./is-value");
module.exports = function (value) {
if (!isValue(value)) return false;
try { return !isNaN(value); }
catch (e) { return false; }
};

View File

@@ -0,0 +1 @@
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":2.11406,"109":4.46861,"110":1.88132,"111":0,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0,"13.1":0,"14.1":0,"15.1":0,"15.2-15.3":0.23662,"15.4":0,"15.5":0,"15.6":3.76263,"16.0":0,"16.1":0.46936,"16.2":0.93872,"16.3":0.70598,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0,"11.0-11.2":0,"11.3-11.4":0,"12.0-12.1":0,"12.2-12.5":0,"13.0-13.1":0,"13.2":0,"13.3":0,"13.4-13.7":0,"14.0-14.4":0,"14.5-14.8":0,"15.0-15.1":0,"15.2-15.3":2.80382,"15.4":0.93461,"15.5":0.93461,"15.6":6.54225,"16.0":0.93461,"16.1":29.90743,"16.2":21.49596,"16.3":20.56136,"16.4":0},P:{"4":0,"20":0,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0,"12.0":0,"13.0":0,"14.0":0,"15.0":0,"16.0":0,"17.0":0,"18.0":0,"19.0":0},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},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0},H:{"0":0},L:{"0":0.8426},R:{_:"0"},M:{"0":0},Q:{"13.1":0}};

View File

@@ -0,0 +1,44 @@
{
"Commands:": "Kommandoer:",
"Options:": "Alternativer:",
"Examples:": "Eksempler:",
"boolean": "boolsk",
"count": "antall",
"string": "streng",
"number": "nummer",
"array": "matrise",
"required": "obligatorisk",
"default": "standard",
"default:": "standard:",
"choices:": "valg:",
"generated-value": "generert-verdi",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s",
"other": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s",
"other": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s"
},
"Missing argument value: %s": {
"one": "Mangler argument verdi: %s",
"other": "Mangler argument verdier: %s"
},
"Missing required argument: %s": {
"one": "Mangler obligatorisk argument: %s",
"other": "Mangler obligatoriske argumenter: %s"
},
"Unknown argument: %s": {
"one": "Ukjent argument: %s",
"other": "Ukjente argumenter: %s"
},
"Invalid values:": "Ugyldige verdier:",
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s",
"Argument check failed: %s": "Argumentsjekk mislyktes: %s",
"Implications failed:": "Konsekvensene mislyktes:",
"Not enough arguments following: %s": "Ikke nok følgende argumenter: %s",
"Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s",
"Path to JSON config file": "Bane til JSON konfigurasjonsfil",
"Show help": "Vis hjelp",
"Show version number": "Vis versjonsnummer"
}

View File

@@ -0,0 +1,12 @@
"use strict";
var log = Math.log, sqrt = Math.sqrt;
module.exports = function (value) {
if (isNaN(value)) return NaN;
value = Number(value);
if (value < 1) return NaN;
if (value === 1) return 0;
if (value === Infinity) return value;
return log(value + sqrt(value * value - 1));
};

View File

@@ -0,0 +1,45 @@
{
"name": "reusify",
"version": "1.0.4",
"description": "Reuse objects and functions with style",
"main": "reusify.js",
"scripts": {
"lint": "standard",
"test": "tape test.js | faucet",
"istanbul": "istanbul cover tape test.js",
"coverage": "npm run istanbul; cat coverage/lcov.info | coveralls"
},
"pre-commit": [
"lint",
"test"
],
"repository": {
"type": "git",
"url": "git+https://github.com/mcollina/reusify.git"
},
"keywords": [
"reuse",
"object",
"performance",
"function",
"fast"
],
"author": "Matteo Collina <hello@matteocollina.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/mcollina/reusify/issues"
},
"homepage": "https://github.com/mcollina/reusify#readme",
"engines": {
"node": ">=0.10.0",
"iojs": ">=1.0.0"
},
"devDependencies": {
"coveralls": "^2.13.3",
"faucet": "0.0.1",
"istanbul": "^0.4.5",
"pre-commit": "^1.2.2",
"standard": "^10.0.3",
"tape": "^4.8.0"
}
}

View File

@@ -0,0 +1 @@
{"name":"color-name","version":"1.1.3","files":{"README.md":{"checkedAt":1678883669302,"integrity":"sha512-/hmGUPmp0gXgx/Ov5oGW6DAU3c4h4aLMa/bE1TkpZHPU7dCx5JFS9hoYM4/+919EWCaPtBhWzK+6pG/6xdx+Ng==","mode":438,"size":384},"LICENSE":{"checkedAt":1678883669302,"integrity":"sha512-/B1lNSwRTHWUyb7fW+QyujnUJv6vUL+PfFLTJ4EyPIS/yaaFMa77VYyX6+RucS4dNdhguh4aarSLSnm4lAklQA==","mode":438,"size":1085},"index.js":{"checkedAt":1678883669302,"integrity":"sha512-nek+57RYqda5dmQCKQmtJafLicLP3Y7hmqLhJlZrenqTCyQUOip2+D2/8Z8aZ7CnHek+irJIcgwu4kM5boaUUQ==","mode":438,"size":4617},"package.json":{"checkedAt":1678883670585,"integrity":"sha512-ipjakUwSET79Hv9i3IySvYIsp6pj7AniH+aZ0Tpb0naSYKJh6QfbwgdHQDFDZU8FSeTLhzFzJl0aBfmfEYq6mQ==","mode":438,"size":555},".npmignore":{"checkedAt":1678883670585,"integrity":"sha512-q5JiCpBBnkXLMcJtVtJ6WOrdZZViPL9A8CIH5LXDhziiHKpuJ8o40pKbUwCwxPnxhyWYDFabI9n0JriXtsc1Xg==","mode":438,"size":1388},"test.js":{"checkedAt":1678883670585,"integrity":"sha512-8m1bgUP6SYPGYEwjL5aLtSk1LsnXaK03b1wF+UNhCP5ezgXXq2GnK8oLkSoQWqlrYpXyt/BkbAgHAHARDnPNyQ==","mode":438,"size":171},".eslintrc.json":{"checkedAt":1678883670585,"integrity":"sha512-8aa5pZPOaN7RZPPqFTJEtYINcKrkuqA6AjJEs5ulQCevZ9SPGpPhq+ebJZlsm92YE3r3QvRqpWEDQoCVktOTeg==","mode":438,"size":1160}}}

View File

@@ -0,0 +1,22 @@
var getMapData = require('./_getMapData');
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
module.exports = mapCacheSet;

View File

@@ -0,0 +1,146 @@
"use strict";
var _parseUrl = require("url").parse;
/*
Customize the URL object that Node generates
because:
* necessary data for later
* urlObj.host is useless
* urlObj.hostname is too long
* urlObj.path is useless
* urlObj.pathname is too long
* urlObj.protocol is inaccurate; should be called "scheme"
* urlObj.search is mostly useless
*/
function clean(urlObj)
{
var scheme = urlObj.protocol;
if (scheme)
{
// Remove ":" suffix
if (scheme.indexOf(":") === scheme.length-1)
{
scheme = scheme.substr(0, scheme.length-1);
}
}
urlObj.host =
{
// TODO :: unescape(encodeURIComponent(s)) ? ... http://ecmanaut.blogspot.ca/2006/07/encoding-decoding-utf8-in-javascript.html
full: urlObj.hostname,
stripped: null
};
urlObj.path =
{
absolute:
{
array: null,
string: urlObj.pathname
},
relative:
{
array: null,
string: null
}
};
urlObj.query =
{
object: urlObj.query,
string:
{
full: null,
stripped: null
}
};
urlObj.extra =
{
hrefInfo:
{
minimumPathOnly: null,
minimumResourceOnly: null,
minimumQueryOnly: null,
minimumHashOnly: null,
empty: null,
separatorOnlyQuery: urlObj.search==="?"
},
portIsDefault: null,
relation:
{
maximumScheme: null,
maximumAuth: null,
maximumHost: null,
maximumPort: null,
maximumPath: null,
maximumResource: null,
maximumQuery: null,
maximumHash: null,
minimumScheme: null,
minimumAuth: null,
minimumHost: null,
minimumPort: null,
minimumPath: null,
minimumResource: null,
minimumQuery: null,
minimumHash: null,
overridesQuery: null
},
resourceIsIndex: null,
slashes: urlObj.slashes
};
urlObj.resource = null;
urlObj.scheme = scheme;
delete urlObj.hostname;
delete urlObj.pathname;
delete urlObj.protocol;
delete urlObj.search;
delete urlObj.slashes;
return urlObj;
}
function validScheme(url, options)
{
var valid = true;
options.rejectedSchemes.every( function(rejectedScheme)
{
valid = !(url.indexOf(rejectedScheme+":") === 0);
// Break loop
return valid;
});
return valid;
}
function parseUrlString(url, options)
{
if ( validScheme(url,options) )
{
return clean( _parseUrl(url, true, options.slashesDenoteHost) );
}
else
{
return {href:url, valid:false};
}
}
module.exports = parseUrlString;

View File

@@ -0,0 +1,10 @@
import { corePlugins } from '../src/corePlugins'
import fs from 'fs'
import path from 'path'
let corePluginList = Object.keys(corePlugins)
fs.writeFileSync(
path.join(process.cwd(), 'src', 'corePluginList.js'),
`export default ${JSON.stringify(corePluginList)}`
)

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('functionsIn', require('../functionsIn'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1 @@
{"version":3,"file":"NotificationFactories.js","sourceRoot":"","sources":["../../../src/internal/NotificationFactories.ts"],"names":[],"mappings":";;;AAOa,QAAA,qBAAqB,GAAG,CAAC,cAAM,OAAA,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,CAAyB,EAArE,CAAqE,CAAC,EAAE,CAAC;AAOrH,SAAgB,iBAAiB,CAAC,KAAU;IAC1C,OAAO,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAQ,CAAC;AAC1D,CAAC;AAFD,8CAEC;AAOD,SAAgB,gBAAgB,CAAI,KAAQ;IAC1C,OAAO,kBAAkB,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAwB,CAAC;AAC1E,CAAC;AAFD,4CAEC;AAQD,SAAgB,kBAAkB,CAAC,IAAqB,EAAE,KAAU,EAAE,KAAU;IAC9E,OAAO;QACL,IAAI,MAAA;QACJ,KAAK,OAAA;QACL,KAAK,OAAA;KACN,CAAC;AACJ,CAAC;AAND,gDAMC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"ProcessFork.js","sourceRoot":"","sources":["../src/ProcessFork.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA2D;AAC3D,sDAAwB;AAGxB,2CAA0D;AAI1D,wDAAkC;AAElC;IAAmC,iCAAS;IAuB1C,uBAAsB,SAAoB;QAA1C,YACE,kBAAM,SAAS,CAAC,SAKjB;QANqB,eAAS,GAAT,SAAS,CAAW;QAL1C,YAAM,GAAY,KAAK,CAAC;QAChB,eAAS,GAAwB,EAAE,CAAC;QACpC,eAAS,GAAW,EAAE,CAAC;QACvB,gBAAU,GAAY,KAAK,CAAC;QAIlC,KAAI,CAAC,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,SAAS,GAAG,kBAAkB,CAAC,EAAE;YACrG,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;SACvC,CAAC,CAAC;QACH,KAAI,CAAC,UAAU,EAAE,CAAC;;IACpB,CAAC;IA5BD,6BAAK,GAAL;QAAA,iBAWC;QAVC,OAAO,IAAI,kBAAC,CAAC,UAAC,OAAO,EAAE,MAAM;YAC3B,wBAAwB;YACxB,KAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC;YACpB,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAC9B,0CAA0C;YAC1C,4BAA4B;YAC5B,wBAAwB;YACxB,KAAK;QACP,CAAC,CAAC,CAAC;IACL,CAAC;IACD,+BAAO,GAAP;QACE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QACzB,OAAO,kBAAC,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC;IAcO,oCAAY,GAApB,UAAqB,KAAmB;QACtC,IAAM,KAAK,GAAK,wBAAW,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,KAAK,CAAC,aAAa,EAAC;YACtB,KAAK,CAAC,aAAa,GAAC;gBAClB,MAAM,EAAC,KAAK,CAAC,aAAa,CAAC,MAAM;gBACjC,KAAK,EAAC,KAAK,CAAC,aAAa,CAAC,KAAK;aAChC,CAAA;SACF;QACD,IAAI,KAAK,CAAC,cAAc,EAAC;YACvB,KAAK,CAAC,cAAc,GAAC;gBACnB,MAAM,EAAC,KAAK,CAAC,cAAc,CAAC,MAAM;gBAClC,KAAK,EAAC,KAAK,CAAC,cAAc,CAAC,KAAK;aACjC,CAAA;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACO,kCAAU,GAAlB;QAAA,iBAqCC;QApCC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAC;YAC1B,KAAI,CAAC,WAAW,EAAE,CAAC;QACrB,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YACrB,GAAG,EAAE,MAAM;YACX,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;SACtC,CAAC,CAAC;QAClB,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,GAAY;YAC3C,IAAI,GAAG,CAAC,GAAG,KAAK,QAAQ,EAAE;gBACxB,KAAI,CAAC,MAAM,GAAG,IAAI,CAAC;aACpB;iBAAM,IAAI,GAAG,CAAC,GAAG,KAAK,KAAK,EAAE;gBAC5B,IAAI,KAAI,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAAC;oBAC7C,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,GAAqB,CAAC,KAAK,CAAC,CAAC;iBACzD;aACF;iBAAK,IAAI,GAAG,CAAC,GAAG,KAAK,QAAQ,EAAE;gBAC9B,IAAI,KAAI,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAAC;oBAChD,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAqB,CAAC,KAAK,CAAC,CAAC;iBAC5D;aACF;iBAAK,IAAI,GAAG,CAAC,GAAG,KAAK,MAAM,EAAC;gBAE3B,sBAAsB;aACvB;QAEH,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,UAAC,IAAI;YACvC,0CAA0C;YAC1C,IAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC5B,oBAAoB;YACpB,KAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAEtB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,UAAC,IAAI;YACvC,0CAA0C;YAC1C,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;IAEL,CAAC;IACO,mCAAW,GAAnB;QACE,sDAAsD;QACtD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC3B;QACD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACtB,CAAC;IACO,iCAAS,GAAjB,UAAkB,IAAY;QAC5B,IAAM,GAAG,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACtC,IAAI,OAAO,KAAK,EAAE,EAAE;YAClB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;SACnC;aAAM;YACL,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;SACrB;QACD,IAAI,CAAC,SAAS,GAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3C,wBAAwB;QACxB,mCAAmC;QACnC,8BAA8B;QAC9B,gBAAgB;QAChB,MAAM;QACN,4CAA4C;QAC5C,oCAAoC;QACpC,SAAS;QACT,+BAA+B;QAC/B,eAAe;QACf,IAAI;QACJ,mDAAmD;IACrD,CAAC;IAED,+BAAO,GAAP,UAAQ,KAAa;QAArB,iBAUC;QATC,OAAO,IAAI,kBAAC,CAAC,UAAC,OAAO,EAAE,MAAM;YAC3B,sCAAsC;YACtC,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC;YACpB,6BAA6B;YAC7B,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;gBACnC,iCAAiC;gBACjC,KAAI,CAAC,WAAW,EAAE,CAAC;YACrB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IACH,oBAAC;AAAD,CAAC,AA/HD,CAAmC,qBAAS,GA+H3C;AA/HY,sCAAa;AA2Ib,QAAA,GAAG,GAAG,MAAM,CAAC"}

View File

@@ -0,0 +1 @@
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00234,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0.00234,"38":0,"39":0,"40":0.00234,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00234,"93":0,"94":0,"95":0,"96":0.00468,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0.00234,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0.08896,"110":0.0515,"111":0.00468,"112":0,"3.5":0,"3.6":0.00234},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0.00234,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0.00234,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00234,"39":0.00234,"40":0.00234,"41":0.00234,"42":0.00234,"43":0.01405,"44":0.00468,"45":0.00234,"46":0.00468,"47":0.00468,"48":0,"49":0.00468,"50":0,"51":0.00234,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0.00234,"75":0.00234,"76":0,"77":0,"78":0,"79":0.00234,"80":0.00234,"81":0.00936,"83":0,"84":0,"85":0,"86":0,"87":0.00936,"88":0,"89":0.00234,"90":0.00702,"91":0,"92":0,"93":0.00234,"94":0,"95":0,"96":0.01171,"97":0.01639,"98":0,"99":0.00234,"100":0.02341,"101":0.00234,"102":0.00234,"103":0.01639,"104":0.00936,"105":0.01639,"106":0.00234,"107":0.02107,"108":0.14046,"109":2.20288,"110":1.40928,"111":0.00234,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0.00234,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0.00234,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0.00234,"65":0,"66":0.00234,"67":0.05618,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.00234,"94":0.01405,"95":0.01171,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0.00234,"13":0.00234,"14":0.00234,"15":0,"16":0,"17":0,"18":0.00234,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00234,"93":0,"94":0,"95":0,"96":0.00234,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0.00468,"104":0.00234,"105":0,"106":0,"107":0.01873,"108":0.00936,"109":0.103,"110":0.13812},E:{"4":0,"5":0,"6":0,"7":0,"8":0.00234,"9":0.00702,"10":0,"11":0,"12":0,"13":0.00234,"14":0,"15":0.00234,_:"0","3.1":0,"3.2":0,"5.1":0.00234,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00468,"13.1":0.00936,"14.1":0.02575,"15.1":0,"15.2-15.3":0.00234,"15.4":0.00234,"15.5":0.01171,"15.6":0.0398,"16.0":0.01405,"16.1":0.00702,"16.2":0.03043,"16.3":0.01873,"16.4":0},G:{"8":0.0068,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00302,"5.0-5.1":0.00151,"6.0-6.1":0.00453,"7.0-7.1":0.03777,"8.1-8.4":0.03248,"9.0-9.2":0.00151,"9.3":0.04155,"10.0-10.2":0,"10.3":0.01133,"11.0-11.2":0.05439,"11.3-11.4":0.00076,"12.0-12.1":0.03022,"12.2-12.5":0.23871,"13.0-13.1":0.01058,"13.2":0.02795,"13.3":0.02342,"13.4-13.7":0.04532,"14.0-14.4":0.27421,"14.5-14.8":0.18583,"15.0-15.1":0.10047,"15.2-15.3":0.08007,"15.4":0.09443,"15.5":0.28856,"15.6":0.3981,"16.0":0.94954,"16.1":1.14217,"16.2":1.14746,"16.3":1.41261,"16.4":0},P:{"4":0.1651,"20":0.23734,"5.0-5.4":0.04128,"6.2-6.4":0,"7.2-7.4":0.06191,"8.2":0,"9.2":0.0516,"10.1":0,"11.1-11.2":0.07223,"12.0":0,"13.0":0.02064,"14.0":0.04128,"15.0":0.01032,"16.0":0.1651,"17.0":0.03096,"18.0":0.0516,"19.0":0.77393},I:{"0":0,"3":0,"4":0.02444,"2.1":0,"2.2":0.01629,"2.3":0.01222,"4.1":0.01222,"4.2-4.3":0.02852,"4.4":0,"4.4.3-4.4.4":0.07333},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0.00234,"7":0.00234,"8":0.02809,"9":0.00702,"10":0.00468,"11":0.01405,"5.5":0},N:{"10":0.02042,"11":0.01021},S:{"2.5":0.00766,_:"3.0-3.1"},J:{"7":0,"10":0.00766},O:{"0":2.32834},H:{"0":0.54383},L:{"0":82.56447},R:{_:"0"},M:{"0":0.03064},Q:{"13.1":0}};

View File

@@ -0,0 +1,917 @@
import postcss from 'postcss'
import selectorParser from 'postcss-selector-parser'
import parseObjectStyles from '../util/parseObjectStyles'
import isPlainObject from '../util/isPlainObject'
import prefixSelector from '../util/prefixSelector'
import { updateAllClasses, getMatchingTypes } from '../util/pluginUtils'
import log from '../util/log'
import * as sharedState from './sharedState'
import {
formatVariantSelector,
finalizeSelector,
eliminateIrrelevantSelectors,
} from '../util/formatVariantSelector'
import { asClass } from '../util/nameClass'
import { normalize } from '../util/dataTypes'
import { isValidVariantFormatString, parseVariant } from './setupContextUtils'
import isValidArbitraryValue from '../util/isSyntacticallyValidPropertyValue'
import { splitAtTopLevelOnly } from '../util/splitAtTopLevelOnly.js'
import { flagEnabled } from '../featureFlags'
let classNameParser = selectorParser((selectors) => {
return selectors.first.filter(({ type }) => type === 'class').pop().value
})
export function getClassNameFromSelector(selector) {
return classNameParser.transformSync(selector)
}
// Generate match permutations for a class candidate, like:
// ['ring-offset-blue', '100']
// ['ring-offset', 'blue-100']
// ['ring', 'offset-blue-100']
// Example with dynamic classes:
// ['grid-cols', '[[linename],1fr,auto]']
// ['grid', 'cols-[[linename],1fr,auto]']
function* candidatePermutations(candidate) {
let lastIndex = Infinity
while (lastIndex >= 0) {
let dashIdx
let wasSlash = false
if (lastIndex === Infinity && candidate.endsWith(']')) {
let bracketIdx = candidate.indexOf('[')
// If character before `[` isn't a dash or a slash, this isn't a dynamic class
// eg. string[]
if (candidate[bracketIdx - 1] === '-') {
dashIdx = bracketIdx - 1
} else if (candidate[bracketIdx - 1] === '/') {
dashIdx = bracketIdx - 1
wasSlash = true
} else {
dashIdx = -1
}
} else if (lastIndex === Infinity && candidate.includes('/')) {
dashIdx = candidate.lastIndexOf('/')
wasSlash = true
} else {
dashIdx = candidate.lastIndexOf('-', lastIndex)
}
if (dashIdx < 0) {
break
}
let prefix = candidate.slice(0, dashIdx)
let modifier = candidate.slice(wasSlash ? dashIdx : dashIdx + 1)
lastIndex = dashIdx - 1
// TODO: This feels a bit hacky
if (prefix === '' || modifier === '/') {
continue
}
yield [prefix, modifier]
}
}
function applyPrefix(matches, context) {
if (matches.length === 0 || context.tailwindConfig.prefix === '') {
return matches
}
for (let match of matches) {
let [meta] = match
if (meta.options.respectPrefix) {
let container = postcss.root({ nodes: [match[1].clone()] })
let classCandidate = match[1].raws.tailwind.classCandidate
container.walkRules((r) => {
// If this is a negative utility with a dash *before* the prefix we
// have to ensure that the generated selector matches the candidate
// Not doing this will cause `-tw-top-1` to generate the class `.tw--top-1`
// The disconnect between candidate <-> class can cause @apply to hard crash.
let shouldPrependNegative = classCandidate.startsWith('-')
r.selector = prefixSelector(
context.tailwindConfig.prefix,
r.selector,
shouldPrependNegative
)
})
match[1] = container.nodes[0]
}
}
return matches
}
function applyImportant(matches, classCandidate) {
if (matches.length === 0) {
return matches
}
let result = []
for (let [meta, rule] of matches) {
let container = postcss.root({ nodes: [rule.clone()] })
container.walkRules((r) => {
let ast = selectorParser().astSync(r.selector)
// Remove extraneous selectors that do not include the base candidate
ast.each((sel) => eliminateIrrelevantSelectors(sel, classCandidate))
// Update all instances of the base candidate to include the important marker
updateAllClasses(ast, (className) =>
className === classCandidate ? `!${className}` : className
)
r.selector = ast.toString()
r.walkDecls((d) => (d.important = true))
})
result.push([{ ...meta, important: true }, container.nodes[0]])
}
return result
}
// Takes a list of rule tuples and applies a variant like `hover`, sm`,
// whatever to it. We used to do some extra caching here to avoid generating
// a variant of the same rule more than once, but this was never hit because
// we cache at the entire selector level further up the tree.
//
// Technically you can get a cache hit if you have `hover:focus:text-center`
// and `focus:hover:text-center` in the same project, but it doesn't feel
// worth the complexity for that case.
function applyVariant(variant, matches, context) {
if (matches.length === 0) {
return matches
}
/** @type {{modifier: string | null, value: string | null}} */
let args = { modifier: null, value: sharedState.NONE }
// Retrieve "modifier"
{
let [baseVariant, ...modifiers] = splitAtTopLevelOnly(variant, '/')
// This is a hack to support variants with `/` in them, like `ar-1/10/20:text-red-500`
// In this case 1/10 is a value but /20 is a modifier
if (modifiers.length > 1) {
baseVariant = baseVariant + '/' + modifiers.slice(0, -1).join('/')
modifiers = modifiers.slice(-1)
}
if (modifiers.length && !context.variantMap.has(variant)) {
variant = baseVariant
args.modifier = modifiers[0]
if (!flagEnabled(context.tailwindConfig, 'generalizedModifiers')) {
return []
}
}
}
// Retrieve "arbitrary value"
if (variant.endsWith(']') && !variant.startsWith('[')) {
// We either have:
// @[200px]
// group-[:hover]
//
// But we don't want:
// @-[200px] (`-` is incorrect)
// group[:hover] (`-` is missing)
let match = /(.)(-?)\[(.*)\]/g.exec(variant)
if (match) {
let [, char, seperator, value] = match
// @-[200px] case
if (char === '@' && seperator === '-') return []
// group[:hover] case
if (char !== '@' && seperator === '') return []
variant = variant.replace(`${seperator}[${value}]`, '')
args.value = value
}
}
// Register arbitrary variants
if (isArbitraryValue(variant) && !context.variantMap.has(variant)) {
let selector = normalize(variant.slice(1, -1))
if (!isValidVariantFormatString(selector)) {
return []
}
let fn = parseVariant(selector)
let sort = context.offsets.recordVariant(variant)
context.variantMap.set(variant, [[sort, fn]])
}
if (context.variantMap.has(variant)) {
let isArbitraryVariant = isArbitraryValue(variant)
let variantFunctionTuples = context.variantMap.get(variant).slice()
let result = []
for (let [meta, rule] of matches) {
// Don't generate variants for user css
if (meta.layer === 'user') {
continue
}
let container = postcss.root({ nodes: [rule.clone()] })
for (let [variantSort, variantFunction, containerFromArray] of variantFunctionTuples) {
let clone = (containerFromArray ?? container).clone()
let collectedFormats = []
function prepareBackup() {
// Already prepared, chicken out
if (clone.raws.neededBackup) {
return
}
clone.raws.neededBackup = true
clone.walkRules((rule) => (rule.raws.originalSelector = rule.selector))
}
function modifySelectors(modifierFunction) {
prepareBackup()
clone.each((rule) => {
if (rule.type !== 'rule') {
return
}
rule.selectors = rule.selectors.map((selector) => {
return modifierFunction({
get className() {
return getClassNameFromSelector(selector)
},
selector,
})
})
})
return clone
}
let ruleWithVariant = variantFunction({
// Public API
get container() {
prepareBackup()
return clone
},
separator: context.tailwindConfig.separator,
modifySelectors,
// Private API for now
wrap(wrapper) {
let nodes = clone.nodes
clone.removeAll()
wrapper.append(nodes)
clone.append(wrapper)
},
format(selectorFormat) {
collectedFormats.push({
format: selectorFormat,
isArbitraryVariant,
})
},
args,
})
// It can happen that a list of format strings is returned from within the function. In that
// case, we have to process them as well. We can use the existing `variantSort`.
if (Array.isArray(ruleWithVariant)) {
for (let [idx, variantFunction] of ruleWithVariant.entries()) {
// This is a little bit scary since we are pushing to an array of items that we are
// currently looping over. However, you can also think of it like a processing queue
// where you keep handling jobs until everything is done and each job can queue more
// jobs if needed.
variantFunctionTuples.push([
context.offsets.applyParallelOffset(variantSort, idx),
variantFunction,
// If the clone has been modified we have to pass that back
// though so each rule can use the modified container
clone.clone(),
])
}
continue
}
if (typeof ruleWithVariant === 'string') {
collectedFormats.push({
format: ruleWithVariant,
isArbitraryVariant,
})
}
if (ruleWithVariant === null) {
continue
}
// We had to backup selectors, therefore we assume that somebody touched
// `container` or `modifySelectors`. Let's see if they did, so that we
// can restore the selectors, and collect the format strings.
if (clone.raws.neededBackup) {
delete clone.raws.neededBackup
clone.walkRules((rule) => {
let before = rule.raws.originalSelector
if (!before) return
delete rule.raws.originalSelector
if (before === rule.selector) return // No mutation happened
let modified = rule.selector
// Rebuild the base selector, this is what plugin authors would do
// as well. E.g.: `${variant}${separator}${className}`.
// However, plugin authors probably also prepend or append certain
// classes, pseudos, ids, ...
let rebuiltBase = selectorParser((selectors) => {
selectors.walkClasses((classNode) => {
classNode.value = `${variant}${context.tailwindConfig.separator}${classNode.value}`
})
}).processSync(before)
// Now that we know the original selector, the new selector, and
// the rebuild part in between, we can replace the part that plugin
// authors need to rebuild with `&`, and eventually store it in the
// collectedFormats. Similar to what `format('...')` would do.
//
// E.g.:
// variant: foo
// selector: .markdown > p
// modified (by plugin): .foo .foo\\:markdown > p
// rebuiltBase (internal): .foo\\:markdown > p
// format: .foo &
collectedFormats.push({
format: modified.replace(rebuiltBase, '&'),
isArbitraryVariant,
})
rule.selector = before
})
}
// This tracks the originating layer for the variant
// For example:
// .sm:underline {} is a variant of something in the utilities layer
// .sm:container {} is a variant of the container component
clone.nodes[0].raws.tailwind = { ...clone.nodes[0].raws.tailwind, parentLayer: meta.layer }
let withOffset = [
{
...meta,
sort: context.offsets.applyVariantOffset(
meta.sort,
variantSort,
Object.assign(args, context.variantOptions.get(variant))
),
collectedFormats: (meta.collectedFormats ?? []).concat(collectedFormats),
},
clone.nodes[0],
]
result.push(withOffset)
}
}
return result
}
return []
}
function parseRules(rule, cache, options = {}) {
// PostCSS node
if (!isPlainObject(rule) && !Array.isArray(rule)) {
return [[rule], options]
}
// Tuple
if (Array.isArray(rule)) {
return parseRules(rule[0], cache, rule[1])
}
// Simple object
if (!cache.has(rule)) {
cache.set(rule, parseObjectStyles(rule))
}
return [cache.get(rule), options]
}
const IS_VALID_PROPERTY_NAME = /^[a-z_-]/
function isValidPropName(name) {
return IS_VALID_PROPERTY_NAME.test(name)
}
/**
* @param {string} declaration
* @returns {boolean}
*/
function looksLikeUri(declaration) {
// Quick bailout for obvious non-urls
// This doesn't support schemes that don't use a leading // but that's unlikely to be a problem
if (!declaration.includes('://')) {
return false
}
try {
const url = new URL(declaration)
return url.scheme !== '' && url.host !== ''
} catch (err) {
// Definitely not a valid url
return false
}
}
function isParsableNode(node) {
let isParsable = true
node.walkDecls((decl) => {
if (!isParsableCssValue(decl.prop, decl.value)) {
isParsable = false
return false
}
})
return isParsable
}
function isParsableCssValue(property, value) {
// We don't want to to treat [https://example.com] as a custom property
// Even though, according to the CSS grammar, it's a totally valid CSS declaration
// So we short-circuit here by checking if the custom property looks like a url
if (looksLikeUri(`${property}:${value}`)) {
return false
}
try {
postcss.parse(`a{${property}:${value}}`).toResult()
return true
} catch (err) {
return false
}
}
function extractArbitraryProperty(classCandidate, context) {
let [, property, value] = classCandidate.match(/^\[([a-zA-Z0-9-_]+):(\S+)\]$/) ?? []
if (value === undefined) {
return null
}
if (!isValidPropName(property)) {
return null
}
if (!isValidArbitraryValue(value)) {
return null
}
let normalized = normalize(value)
if (!isParsableCssValue(property, normalized)) {
return null
}
let sort = context.offsets.arbitraryProperty()
return [
[
{ sort, layer: 'utilities' },
() => ({
[asClass(classCandidate)]: {
[property]: normalized,
},
}),
],
]
}
function* resolveMatchedPlugins(classCandidate, context) {
if (context.candidateRuleMap.has(classCandidate)) {
yield [context.candidateRuleMap.get(classCandidate), 'DEFAULT']
}
yield* (function* (arbitraryPropertyRule) {
if (arbitraryPropertyRule !== null) {
yield [arbitraryPropertyRule, 'DEFAULT']
}
})(extractArbitraryProperty(classCandidate, context))
let candidatePrefix = classCandidate
let negative = false
const twConfigPrefix = context.tailwindConfig.prefix
const twConfigPrefixLen = twConfigPrefix.length
const hasMatchingPrefix =
candidatePrefix.startsWith(twConfigPrefix) || candidatePrefix.startsWith(`-${twConfigPrefix}`)
if (candidatePrefix[twConfigPrefixLen] === '-' && hasMatchingPrefix) {
negative = true
candidatePrefix = twConfigPrefix + candidatePrefix.slice(twConfigPrefixLen + 1)
}
if (negative && context.candidateRuleMap.has(candidatePrefix)) {
yield [context.candidateRuleMap.get(candidatePrefix), '-DEFAULT']
}
for (let [prefix, modifier] of candidatePermutations(candidatePrefix)) {
if (context.candidateRuleMap.has(prefix)) {
yield [context.candidateRuleMap.get(prefix), negative ? `-${modifier}` : modifier]
}
}
}
function splitWithSeparator(input, separator) {
if (input === sharedState.NOT_ON_DEMAND) {
return [sharedState.NOT_ON_DEMAND]
}
return splitAtTopLevelOnly(input, separator)
}
function* recordCandidates(matches, classCandidate) {
for (const match of matches) {
match[1].raws.tailwind = {
...match[1].raws.tailwind,
classCandidate,
preserveSource: match[0].options?.preserveSource ?? false,
}
yield match
}
}
function* resolveMatches(candidate, context, original = candidate) {
let separator = context.tailwindConfig.separator
let [classCandidate, ...variants] = splitWithSeparator(candidate, separator).reverse()
let important = false
if (classCandidate.startsWith('!')) {
important = true
classCandidate = classCandidate.slice(1)
}
if (flagEnabled(context.tailwindConfig, 'variantGrouping')) {
if (classCandidate.startsWith('(') && classCandidate.endsWith(')')) {
let base = variants.slice().reverse().join(separator)
for (let part of splitAtTopLevelOnly(classCandidate.slice(1, -1), ',')) {
yield* resolveMatches(base + separator + part, context, original)
}
}
}
// TODO: Reintroduce this in ways that doesn't break on false positives
// function sortAgainst(toSort, against) {
// return toSort.slice().sort((a, z) => {
// return bigSign(against.get(a)[0] - against.get(z)[0])
// })
// }
// let sorted = sortAgainst(variants, context.variantMap)
// if (sorted.toString() !== variants.toString()) {
// let corrected = sorted.reverse().concat(classCandidate).join(':')
// throw new Error(`Class ${candidate} should be written as ${corrected}`)
// }
for (let matchedPlugins of resolveMatchedPlugins(classCandidate, context)) {
let matches = []
let typesByMatches = new Map()
let [plugins, modifier] = matchedPlugins
let isOnlyPlugin = plugins.length === 1
for (let [sort, plugin] of plugins) {
let matchesPerPlugin = []
if (typeof plugin === 'function') {
for (let ruleSet of [].concat(plugin(modifier, { isOnlyPlugin }))) {
let [rules, options] = parseRules(ruleSet, context.postCssNodeCache)
for (let rule of rules) {
matchesPerPlugin.push([{ ...sort, options: { ...sort.options, ...options } }, rule])
}
}
}
// Only process static plugins on exact matches
else if (modifier === 'DEFAULT' || modifier === '-DEFAULT') {
let ruleSet = plugin
let [rules, options] = parseRules(ruleSet, context.postCssNodeCache)
for (let rule of rules) {
matchesPerPlugin.push([{ ...sort, options: { ...sort.options, ...options } }, rule])
}
}
if (matchesPerPlugin.length > 0) {
let matchingTypes = Array.from(
getMatchingTypes(
sort.options?.types ?? [],
modifier,
sort.options ?? {},
context.tailwindConfig
)
).map(([_, type]) => type)
if (matchingTypes.length > 0) {
typesByMatches.set(matchesPerPlugin, matchingTypes)
}
matches.push(matchesPerPlugin)
}
}
if (isArbitraryValue(modifier)) {
if (matches.length > 1) {
// Partition plugins in 2 categories so that we can start searching in the plugins that
// don't have `any` as a type first.
let [withAny, withoutAny] = matches.reduce(
(group, plugin) => {
let hasAnyType = plugin.some(([{ options }]) =>
options.types.some(({ type }) => type === 'any')
)
if (hasAnyType) {
group[0].push(plugin)
} else {
group[1].push(plugin)
}
return group
},
[[], []]
)
function findFallback(matches) {
// If only a single plugin matches, let's take that one
if (matches.length === 1) {
return matches[0]
}
// Otherwise, find the plugin that creates a valid rule given the arbitrary value, and
// also has the correct type which preferOnConflicts the plugin in case of clashes.
return matches.find((rules) => {
let matchingTypes = typesByMatches.get(rules)
return rules.some(([{ options }, rule]) => {
if (!isParsableNode(rule)) {
return false
}
return options.types.some(
({ type, preferOnConflict }) => matchingTypes.includes(type) && preferOnConflict
)
})
})
}
// Try to find a fallback plugin, because we already know that multiple plugins matched for
// the given arbitrary value.
let fallback = findFallback(withoutAny) ?? findFallback(withAny)
if (fallback) {
matches = [fallback]
}
// We couldn't find a fallback plugin which means that there are now multiple plugins that
// generated css for the current candidate. This means that the result is ambiguous and this
// should not happen. We won't generate anything right now, so let's report this to the user
// by logging some options about what they can do.
else {
let typesPerPlugin = matches.map(
(match) => new Set([...(typesByMatches.get(match) ?? [])])
)
// Remove duplicates, so that we can detect proper unique types for each plugin.
for (let pluginTypes of typesPerPlugin) {
for (let type of pluginTypes) {
let removeFromOwnGroup = false
for (let otherGroup of typesPerPlugin) {
if (pluginTypes === otherGroup) continue
if (otherGroup.has(type)) {
otherGroup.delete(type)
removeFromOwnGroup = true
}
}
if (removeFromOwnGroup) pluginTypes.delete(type)
}
}
let messages = []
for (let [idx, group] of typesPerPlugin.entries()) {
for (let type of group) {
let rules = matches[idx]
.map(([, rule]) => rule)
.flat()
.map((rule) =>
rule
.toString()
.split('\n')
.slice(1, -1) // Remove selector and closing '}'
.map((line) => line.trim())
.map((x) => ` ${x}`) // Re-indent
.join('\n')
)
.join('\n\n')
messages.push(
` Use \`${candidate.replace('[', `[${type}:`)}\` for \`${rules.trim()}\``
)
break
}
}
log.warn([
`The class \`${candidate}\` is ambiguous and matches multiple utilities.`,
...messages,
`If this is content and not a class, replace it with \`${candidate
.replace('[', '&lsqb;')
.replace(']', '&rsqb;')}\` to silence this warning.`,
])
continue
}
}
matches = matches.map((list) => list.filter((match) => isParsableNode(match[1])))
}
matches = matches.flat()
matches = Array.from(recordCandidates(matches, classCandidate))
matches = applyPrefix(matches, context)
if (important) {
matches = applyImportant(matches, classCandidate)
}
for (let variant of variants) {
matches = applyVariant(variant, matches, context)
}
for (let match of matches) {
match[1].raws.tailwind = { ...match[1].raws.tailwind, candidate }
// Apply final format selector
match = applyFinalFormat(match, { context, candidate, original })
// Skip rules with invalid selectors
// This will cause the candidate to be added to the "not class"
// cache skipping it entirely for future builds
if (match === null) {
continue
}
yield match
}
}
}
function applyFinalFormat(match, { context, candidate, original }) {
if (!match[0].collectedFormats) {
return match
}
let isValid = true
let finalFormat
try {
finalFormat = formatVariantSelector(match[0].collectedFormats, {
context,
candidate,
})
} catch {
// The format selector we produced is invalid
// This could be because:
// - A bug exists
// - A plugin introduced an invalid variant selector (ex: `addVariant('foo', '&;foo')`)
// - The user used an invalid arbitrary variant (ex: `[&;foo]:underline`)
// Either way the build will fail because of this
// We would rather that the build pass "silently" given that this could
// happen because of picking up invalid things when scanning content
// So we'll throw out the candidate instead
return null
}
let container = postcss.root({ nodes: [match[1].clone()] })
container.walkRules((rule) => {
if (inKeyframes(rule)) {
return
}
try {
rule.selector = finalizeSelector(rule.selector, finalFormat, {
candidate: original,
context,
})
} catch {
// If this selector is invalid we also want to skip it
// But it's likely that being invalid here means there's a bug in a plugin rather than too loosely matching content
isValid = false
return false
}
})
if (!isValid) {
return null
}
match[1] = container.nodes[0]
return match
}
function inKeyframes(rule) {
return rule.parent && rule.parent.type === 'atrule' && rule.parent.name === 'keyframes'
}
function getImportantStrategy(important) {
if (important === true) {
return (rule) => {
if (inKeyframes(rule)) {
return
}
rule.walkDecls((d) => {
if (d.parent.type === 'rule' && !inKeyframes(d.parent)) {
d.important = true
}
})
}
}
if (typeof important === 'string') {
return (rule) => {
if (inKeyframes(rule)) {
return
}
rule.selectors = rule.selectors.map((selector) => {
return `${important} ${selector}`
})
}
}
}
function generateRules(candidates, context) {
let allRules = []
let strategy = getImportantStrategy(context.tailwindConfig.important)
for (let candidate of candidates) {
if (context.notClassCache.has(candidate)) {
continue
}
if (context.candidateRuleCache.has(candidate)) {
allRules = allRules.concat(Array.from(context.candidateRuleCache.get(candidate)))
continue
}
let matches = Array.from(resolveMatches(candidate, context))
if (matches.length === 0) {
context.notClassCache.add(candidate)
continue
}
context.classCache.set(candidate, matches)
let rules = context.candidateRuleCache.get(candidate) ?? new Set()
context.candidateRuleCache.set(candidate, rules)
for (const match of matches) {
let [{ sort, options }, rule] = match
if (options.respectImportant && strategy) {
let container = postcss.root({ nodes: [rule.clone()] })
container.walkRules(strategy)
rule = container.nodes[0]
}
let newEntry = [sort, rule]
rules.add(newEntry)
context.ruleCache.add(newEntry)
allRules.push(newEntry)
}
}
return allRules
}
function isArbitraryValue(input) {
return input.startsWith('[') && input.endsWith(']')
}
export { resolveMatches, generateRules }

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('repeat', require('../repeat'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1,24 @@
'use strict';
var numToStr = Number.prototype.toString;
var tryNumberObject = function tryNumberObject(value) {
try {
numToStr.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr = Object.prototype.toString;
var numClass = '[object Number]';
var hasToStringTag = require('has-tostringtag/shams')();
module.exports = function isNumberObject(value) {
if (typeof value === 'number') {
return true;
}
if (typeof value !== 'object') {
return false;
}
return hasToStringTag ? tryNumberObject(value) : toStr.call(value) === numClass;
};

View File

@@ -0,0 +1,470 @@
import type {ConditionalSimplifyDeep} from './conditional-simplify';
import type {OmitIndexSignature} from './omit-index-signature';
import type {PickIndexSignature} from './pick-index-signature';
import type {EnforceOptional} from './enforce-optional';
import type {Merge} from './merge';
import type {
ArrayTail,
FirstArrayElement,
IsBothExtends,
NonEmptyTuple,
UnknownArrayOrTuple,
UnknownRecord,
} from './internal';
/**
Deeply simplifies an object excluding iterables and functions. Used internally to improve the UX and accept both interfaces and type aliases as inputs.
*/
type SimplifyDeep<Type> = ConditionalSimplifyDeep<Type, Function | Iterable<unknown>, object>;
/**
Try to merge two record properties or return the source property value, preserving `undefined` properties values in both cases.
*/
type MergeDeepRecordProperty<
Destination,
Source,
Options extends MergeDeepInternalOptions,
> = undefined extends Source
? MergeDeepOrReturn<Source, Exclude<Destination, undefined>, Exclude<Source, undefined>, Options> | undefined
: MergeDeepOrReturn<Source, Destination, Source, Options>;
/**
Walk through the union of the keys of the two objects and test in which object the properties are defined.
- If the source does not contain the key, the value of the destination is returned.
- If the source contains the key and the destination does not contain the key, the value of the source is returned.
- If both contain the key, try to merge according to the chosen {@link MergeDeepOptions options} or return the source if unable to merge.
*/
type DoMergeDeepRecord<
Destination extends UnknownRecord,
Source extends UnknownRecord,
Options extends MergeDeepInternalOptions,
> = EnforceOptional<{
[Key in keyof Destination | keyof Source]: Key extends keyof Source
? Key extends keyof Destination
? MergeDeepRecordProperty<Destination[Key], Source[Key], Options>
: Source[Key]
: Key extends keyof Destination
? Destination[Key]
: never;
}>;
/**
Wrapper around {@link DoMergeDeepRecord} which preserves index signatures.
*/
type MergeDeepRecord<
Destination extends UnknownRecord,
Source extends UnknownRecord,
Options extends MergeDeepInternalOptions,
> = DoMergeDeepRecord<OmitIndexSignature<Destination>, OmitIndexSignature<Source>, Options>
& Merge<PickIndexSignature<Destination>, PickIndexSignature<Source>>;
/**
Pick the rest type.
@example
```
type Rest1 = PickRestType<[]>; // => []
type Rest2 = PickRestType<[string]>; // => []
type Rest3 = PickRestType<[...number[]]>; // => number[]
type Rest4 = PickRestType<[string, ...number[]]>; // => number[]
type Rest5 = PickRestType<string[]>; // => string[]
```
*/
type PickRestType<Type extends UnknownArrayOrTuple> = number extends Type['length']
? ArrayTail<Type> extends [] ? Type : PickRestType<ArrayTail<Type>>
: [];
/**
Omit the rest type.
@example
```
type Tuple1 = OmitRestType<[]>; // => []
type Tuple2 = OmitRestType<[string]>; // => [string]
type Tuple3 = OmitRestType<[...number[]]>; // => []
type Tuple4 = OmitRestType<[string, ...number[]]>; // => [string]
type Tuple5 = OmitRestType<[string, boolean[], ...number[]]>; // => [string, boolean[]]
type Tuple6 = OmitRestType<string[]>; // => []
```
*/
type OmitRestType<Type extends UnknownArrayOrTuple, Result extends UnknownArrayOrTuple = []> = number extends Type['length']
? ArrayTail<Type> extends [] ? Result : OmitRestType<ArrayTail<Type>, [...Result, FirstArrayElement<Type>]>
: Type;
// Utility to avoid picking two times the type.
type TypeNumberOrType<Type extends UnknownArrayOrTuple> = Type[number] extends never ? Type : Type[number];
// Pick the rest type (array) and try to get the intrinsic type or return the provided type.
type PickRestTypeFlat<Type extends UnknownArrayOrTuple> = TypeNumberOrType<PickRestType<Type>>;
/**
Try to merge two array/tuple elements or return the source element if the end of the destination is reached or vis-versa.
*/
type MergeDeepArrayOrTupleElements<
Destination,
Source,
Options extends MergeDeepInternalOptions,
> = Source extends []
? Destination
: Destination extends []
? Source
: MergeDeepOrReturn<Source, Destination, Source, Options>;
/**
Merge two tuples recursively.
*/
type DoMergeDeepTupleAndTupleRecursive<
Destination extends UnknownArrayOrTuple,
Source extends UnknownArrayOrTuple,
DestinationRestType,
SourceRestType,
Options extends MergeDeepInternalOptions,
> = Destination extends []
? Source extends []
? []
: MergeArrayTypeAndTuple<DestinationRestType, Source, Options>
: Source extends []
? MergeTupleAndArrayType<Destination, SourceRestType, Options>
: [
MergeDeepArrayOrTupleElements<FirstArrayElement<Destination>, FirstArrayElement<Source>, Options>,
...DoMergeDeepTupleAndTupleRecursive<ArrayTail<Destination>, ArrayTail<Source>, DestinationRestType, SourceRestType, Options>,
];
/**
Merge two tuples recursively taking into account a possible rest element.
*/
type MergeDeepTupleAndTupleRecursive<
Destination extends UnknownArrayOrTuple,
Source extends UnknownArrayOrTuple,
Options extends MergeDeepInternalOptions,
> = [
...DoMergeDeepTupleAndTupleRecursive<OmitRestType<Destination>, OmitRestType<Source>, PickRestTypeFlat<Destination>, PickRestTypeFlat<Source>, Options>,
...MergeDeepArrayOrTupleElements<PickRestType<Destination>, PickRestType<Source>, Options>,
];
/**
Merge an array type with a tuple recursively.
*/
type MergeTupleAndArrayType<
Tuple extends UnknownArrayOrTuple,
ArrayType,
Options extends MergeDeepInternalOptions,
> = Tuple extends []
? Tuple
: [
MergeDeepArrayOrTupleElements<FirstArrayElement<Tuple>, ArrayType, Options>,
...MergeTupleAndArrayType<ArrayTail<Tuple>, ArrayType, Options>,
];
/**
Merge an array into a tuple recursively taking into account a possible rest element.
*/
type MergeDeepTupleAndArrayRecursive<
Destination extends UnknownArrayOrTuple,
Source extends UnknownArrayOrTuple,
Options extends MergeDeepInternalOptions,
> = [
...MergeTupleAndArrayType<OmitRestType<Destination>, Source[number], Options>,
...MergeDeepArrayOrTupleElements<PickRestType<Destination>, PickRestType<Source>, Options>,
];
/**
Merge a tuple with an array type recursively.
*/
type MergeArrayTypeAndTuple<
ArrayType,
Tuple extends UnknownArrayOrTuple,
Options extends MergeDeepInternalOptions,
> = Tuple extends []
? Tuple
: [
MergeDeepArrayOrTupleElements<ArrayType, FirstArrayElement<Tuple>, Options>,
...MergeArrayTypeAndTuple<ArrayType, ArrayTail<Tuple>, Options>,
];
/**
Merge a tuple into an array recursively taking into account a possible rest element.
*/
type MergeDeepArrayAndTupleRecursive<
Destination extends UnknownArrayOrTuple,
Source extends UnknownArrayOrTuple,
Options extends MergeDeepInternalOptions,
> = [
...MergeArrayTypeAndTuple<Destination[number], OmitRestType<Source>, Options>,
...MergeDeepArrayOrTupleElements<PickRestType<Destination>, PickRestType<Source>, Options>,
];
/**
Merge mode for array/tuple elements.
*/
type ArrayMergeMode = 'spread' | 'replace';
/**
Test if it should spread top-level arrays.
*/
type ShouldSpread<Options extends MergeDeepInternalOptions> = Options['spreadTopLevelArrays'] extends false
? Options['arrayMergeMode'] extends 'spread' ? true : false
: true;
/**
Merge two arrays/tuples according to the chosen {@link MergeDeepOptions.arrayMergeMode arrayMergeMode} option.
*/
type DoMergeArrayOrTuple<
Destination extends UnknownArrayOrTuple,
Source extends UnknownArrayOrTuple,
Options extends MergeDeepInternalOptions,
> = ShouldSpread<Options> extends true
? Array<Exclude<Destination, undefined>[number] | Exclude<Source, undefined>[number]>
: Source; // 'replace'
/**
Merge two arrays recursively.
If the two arrays are multi-level, we merge deeply, otherwise we merge the first level only.
Note: The `[number]` accessor is used to test the type of the second level.
*/
type MergeDeepArrayRecursive<
Destination extends UnknownArrayOrTuple,
Source extends UnknownArrayOrTuple,
Options extends MergeDeepInternalOptions,
> = Destination[number] extends UnknownArrayOrTuple
? Source[number] extends UnknownArrayOrTuple
? Array<MergeDeepArrayOrTupleRecursive<Destination[number], Source[number], Options>>
: DoMergeArrayOrTuple<Destination, Source, Options>
: Destination[number] extends UnknownRecord
? Source[number] extends UnknownRecord
? Array<SimplifyDeep<MergeDeepRecord<Destination[number], Source[number], Options>>>
: DoMergeArrayOrTuple<Destination, Source, Options>
: DoMergeArrayOrTuple<Destination, Source, Options>;
/**
Merge two array/tuple recursively by selecting one of the four strategies according to the type of inputs.
- tuple/tuple
- tuple/array
- array/tuple
- array/array
*/
type MergeDeepArrayOrTupleRecursive<
Destination extends UnknownArrayOrTuple,
Source extends UnknownArrayOrTuple,
Options extends MergeDeepInternalOptions,
> = IsBothExtends<NonEmptyTuple, Destination, Source> extends true
? MergeDeepTupleAndTupleRecursive<Destination, Source, Options>
: Destination extends NonEmptyTuple
? MergeDeepTupleAndArrayRecursive<Destination, Source, Options>
: Source extends NonEmptyTuple
? MergeDeepArrayAndTupleRecursive<Destination, Source, Options>
: MergeDeepArrayRecursive<Destination, Source, Options>;
/**
Merge two array/tuple according to {@link MergeDeepOptions.recurseIntoArrays recurseIntoArrays} option.
*/
type MergeDeepArrayOrTuple<
Destination extends UnknownArrayOrTuple,
Source extends UnknownArrayOrTuple,
Options extends MergeDeepInternalOptions,
> = Options['recurseIntoArrays'] extends true
? MergeDeepArrayOrTupleRecursive<Destination, Source, Options>
: DoMergeArrayOrTuple<Destination, Source, Options>;
/**
Try to merge two objects or two arrays/tuples recursively into a new type or return the default value.
*/
type MergeDeepOrReturn<
DefaultType,
Destination,
Source,
Options extends MergeDeepInternalOptions,
> = SimplifyDeep<[undefined] extends [Destination | Source]
? DefaultType
: Destination extends UnknownRecord
? Source extends UnknownRecord
? MergeDeepRecord<Destination, Source, Options>
: DefaultType
: Destination extends UnknownArrayOrTuple
? Source extends UnknownArrayOrTuple
? MergeDeepArrayOrTuple<Destination, Source, Merge<Options, {spreadTopLevelArrays: false}>>
: DefaultType
: DefaultType>;
/**
MergeDeep options.
@see {@link MergeDeep}
*/
export type MergeDeepOptions = {
/**
Merge mode for array and tuple.
When we walk through the properties of the objects and the same key is found and both are array or tuple, a merge mode must be chosen:
- `replace`: Replaces the destination value by the source value. This is the default mode.
- `spread`: Spreads the destination and the source values.
See {@link MergeDeep} for usages and examples.
Note: Top-level arrays and tuples are always spread.
@default 'spread'
*/
arrayMergeMode?: ArrayMergeMode;
/**
Whether to affect the individual elements of arrays and tuples.
If this option is set to `true` the following rules are applied:
- If the source does not contain the key, the value of the destination is returned.
- If the source contains the key and the destination does not contain the key, the value of the source is returned.
- If both contain the key, try to merge according to the chosen {@link MergeDeepOptions.arrayMergeMode arrayMergeMode} or return the source if unable to merge.
@default false
*/
recurseIntoArrays?: boolean;
};
/**
Internal options.
*/
type MergeDeepInternalOptions = Merge<MergeDeepOptions, {spreadTopLevelArrays?: boolean}>;
/**
Merge default and internal options with user provided options.
*/
type DefaultMergeDeepOptions<Options extends MergeDeepOptions> = Merge<{
arrayMergeMode: 'replace';
recurseIntoArrays: false;
spreadTopLevelArrays: true;
}, Options>;
/**
This utility selects the correct entry point with the corresponding default options. This avoids re-merging the options at each iteration.
*/
type MergeDeepWithDefaultOptions<Destination, Source, Options extends MergeDeepOptions> = SimplifyDeep<
[undefined] extends [Destination | Source]
? never
: Destination extends UnknownRecord
? Source extends UnknownRecord
? MergeDeepRecord<Destination, Source, DefaultMergeDeepOptions<Options>>
: never
: Destination extends UnknownArrayOrTuple
? Source extends UnknownArrayOrTuple
? MergeDeepArrayOrTuple<Destination, Source, DefaultMergeDeepOptions<Options>>
: never
: never
>;
/**
Merge two objects or two arrays/tuples recursively into a new type.
- Properties that only exist in one object are copied into the new object.
- Properties that exist in both objects are merged if possible or replaced by the one of the source if not.
- Top-level arrays and tuples are always spread.
- By default, inner arrays and tuples are replaced. See {@link MergeDeepOptions.arrayMergeMode arrayMergeMode} option to change this behaviour.
- By default, individual array/tuple elements are not affected. See {@link MergeDeepOptions.recurseIntoArrays recurseIntoArrays} option to change this behaviour.
@example
```
import type {MergeDeep} from 'type-fest';
type Foo = {
life: number;
items: string[];
a: {b: string; c: boolean; d: number[]};
};
interface Bar {
name: string;
items: number[];
a: {b: number; d: boolean[]};
}
type FooBar = MergeDeep<Foo, Bar>;
// {
// life: number;
// name: string;
// items: number[];
// a: {b: number; c: boolean; d: boolean[]};
// }
type FooBar = MergeDeep<Foo, Bar, {arrayMergeMode: 'spread'}>;
// {
// life: number;
// name: string;
// items: (string | number)[];
// a: {b: number; c: boolean; d: (number | boolean)[]};
// }
```
@example
```
import type {MergeDeep} from 'type-fest';
// Merge two arrays
type ArrayMerge = MergeDeep<string[], number[]>; // => (string | number)[]
// Merge two tuples
type TupleMerge = MergeDeep<[1, 2, 3], ['a', 'b']>; // => (1 | 2 | 3 | 'a' | 'b')[]
// Merge an array into a tuple
type TupleArrayMerge = MergeDeep<[1, 2, 3], string[]>; // => (string | 1 | 2 | 3)[]
// Merge a tuple into an array
type ArrayTupleMerge = MergeDeep<number[], ['a', 'b']>; // => (number | 'b' | 'a')[]
```
@example
```
import type {MergeDeep, MergeDeepOptions} from 'type-fest';
type Foo = {foo: 'foo'; fooBar: string[]};
type Bar = {bar: 'bar'; fooBar: number[]};
type FooBar = MergeDeep<Foo, Bar>;
// { foo: "foo"; bar: "bar"; fooBar: number[]}
type FooBarSpread = MergeDeep<Foo, Bar, {arrayMergeMode: 'spread'}>;
// { foo: "foo"; bar: "bar"; fooBar: (string | number)[]}
type FooBarArray = MergeDeep<Foo[], Bar[]>;
// (Foo | Bar)[]
type FooBarArrayDeep = MergeDeep<Foo[], Bar[], {recurseIntoArrays: true}>;
// FooBar[]
type FooBarArraySpreadDeep = MergeDeep<Foo[], Bar[], {recurseIntoArrays: true; arrayMergeMode: 'spread'}>;
// FooBarSpread[]
type FooBarTupleDeep = MergeDeep<[Foo, true, 42], [Bar, 'life'], {recurseIntoArrays: true}>;
// [FooBar, 'life', 42]
type FooBarTupleWithArrayDeep = MergeDeep<[Foo[], true], [Bar[], 'life', 42], {recurseIntoArrays: true}>;
// [FooBar[], 'life', 42]
```
@example
```
import type {MergeDeep, MergeDeepOptions} from 'type-fest';
function mergeDeep<Destination, Source, Options extends MergeDeepOptions = {}>(
destination: Destination,
source: Source,
options?: Options,
): MergeDeep<Destination, Source, Options> {
// Make your implementation ...
}
```
@experimental This type is marked as experimental because it depends on {@link ConditionalSimplifyDeep} which itself is experimental.
@see {@link MergeDeepOptions}
@category Array
@category Object
@category Utilities
*/
export type MergeDeep<Destination, Source, Options extends MergeDeepOptions = {}> = MergeDeepWithDefaultOptions<
SimplifyDeep<Destination>,
SimplifyDeep<Source>,
Options
>;

View File

@@ -0,0 +1,57 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $TypeError = GetIntrinsic('%TypeError%');
var $preventExtensions = GetIntrinsic('%Object.preventExtensions%', true);
var $gOPD = require('gopd');
var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true);
var forEach = require('../helpers/forEach');
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
var Type = require('./Type');
// https://262.ecma-international.org/6.0/#sec-setintegritylevel
module.exports = function SetIntegrityLevel(O, level) {
if (Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (level !== 'sealed' && level !== 'frozen') {
throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`');
}
if (!$preventExtensions) {
throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support');
}
var status = $preventExtensions(O);
if (!status) {
return false;
}
if (!$gOPN) {
throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support');
}
var theKeys = $gOPN(O);
if (level === 'sealed') {
forEach(theKeys, function (k) {
DefinePropertyOrThrow(O, k, { configurable: false });
});
} else if (level === 'frozen') {
forEach(theKeys, function (k) {
var currentDesc = $gOPD(O, k);
if (typeof currentDesc !== 'undefined') {
var desc;
if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) {
desc = { configurable: false };
} else {
desc = { configurable: false, writable: false };
}
DefinePropertyOrThrow(O, k, desc);
}
});
}
return true;
};

View File

@@ -0,0 +1 @@
module.exports={C:{"2":0,"3":0,"4":0.00327,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0.00327,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.02618,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.08837,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.00327,"103":0,"104":0.00655,"105":0.01309,"106":0.01637,"107":0.00982,"108":0.01309,"109":0.18002,"110":0.05237,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00327,"39":0,"40":0,"41":0,"42":0,"43":0.00327,"44":0.00327,"45":0.00327,"46":0,"47":0,"48":0,"49":0.00655,"50":0.00327,"51":0,"52":0,"53":0.00655,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0.00327,"71":0.00982,"72":0,"73":0.00327,"74":0.00327,"75":0,"76":0,"77":0.01637,"78":0,"79":0.16038,"80":0.00327,"81":0.00327,"83":0.00982,"84":0.00327,"85":0.00655,"86":0.01309,"87":0.04582,"88":0.00982,"89":0.00327,"90":0.00327,"91":0.00655,"92":0.06546,"93":0,"94":0,"95":0.00327,"96":0.00327,"97":0.00655,"98":0.02291,"99":0.00655,"100":0.01964,"101":0.00982,"102":0.00982,"103":0.01637,"104":0.01309,"105":0.01964,"106":0.05237,"107":0.04582,"108":0.17674,"109":5.92086,"110":1.44012,"111":0,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00327,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.00327,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.04582,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0.00327,"75":0,"76":0,"77":0,"78":0,"79":0.02618,"80":0,"81":0,"82":0,"83":0,"84":0.00655,"85":0.01637,"86":0.00327,"87":0,"88":0,"89":0.00655,"90":0,"91":0,"92":0,"93":0.036,"94":0.4844,"95":0.23238,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"79":0,"80":0,"81":0,"83":0,"84":0.00327,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.00327,"103":0,"104":0,"105":0,"106":0.00327,"107":0.01309,"108":0.00655,"109":0.18983,"110":0.12765},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.00982,"15":0.00982,_:"0","3.1":0,"3.2":0,"5.1":0.02618,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0,"13.1":0.00982,"14.1":0.02291,"15.1":0.00327,"15.2-15.3":0.00655,"15.4":0.00982,"15.5":0.01309,"15.6":0.06546,"16.0":0.00982,"16.1":0.03273,"16.2":0.05237,"16.3":0.03928,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.01076,"6.0-6.1":0.00134,"7.0-7.1":0.01748,"8.1-8.4":0.00807,"9.0-9.2":0.00269,"9.3":0.02421,"10.0-10.2":0,"10.3":0.08338,"11.0-11.2":0.0121,"11.3-11.4":0.00269,"12.0-12.1":0.00672,"12.2-12.5":0.41557,"13.0-13.1":0.03766,"13.2":0.00269,"13.3":0.01614,"13.4-13.7":0.04842,"14.0-14.4":0.14121,"14.5-14.8":0.34564,"15.0-15.1":0.08876,"15.2-15.3":0.10087,"15.4":0.17618,"15.5":0.3416,"15.6":0.8688,"16.0":1.96355,"16.1":2.84177,"16.2":3.11748,"16.3":1.73895,"16.4":0.01883},P:{"4":0.28451,"20":0.98563,"5.0-5.4":0,"6.2-6.4":0.02032,"7.2-7.4":0.08129,"8.2":0,"9.2":0.01016,"10.1":0,"11.1-11.2":0.03048,"12.0":0.01016,"13.0":0.06097,"14.0":0.07113,"15.0":0.07113,"16.0":0.1321,"17.0":0.10161,"18.0":0.20322,"19.0":2.774},I:{"0":0,"3":0,"4":0.00443,"2.1":0,"2.2":0,"2.3":0.01107,"4.1":0.00443,"4.2-4.3":0.01329,"4.4":0,"4.4.3-4.4.4":0.05315},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.01309,"9":0.00327,"10":0.00327,"11":0.01637,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0.00673,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.15472},H:{"0":0.56681},L:{"0":68.68436},R:{_:"0"},M:{"0":0.30944},Q:{"13.1":0}};

View File

@@ -0,0 +1,5 @@
'use strict';
// TODO: remove, semver-major
module.exports = require('gopd');

View File

@@ -0,0 +1,68 @@
{
"name": "wmf",
"version": "1.0.2",
"author": "sheetjs",
"description": "Windows MetaFile (WMF) parser",
"keywords": [
"wmf",
"image",
"office",
"word"
],
"bin": {
},
"main": "./dist/wmf.node.js",
"unpkg": "./dist/wmf.js",
"jsdelivr": "./dist/wmf.js",
"types": "types",
"browser": {
"buffer": false,
"crypto": false,
"stream": false,
"process": false,
"fs": false
},
"dependencies": {
},
"devDependencies": {
"source-map-loader": "^0.2.4",
"uglifyjs-webpack-plugin": "^2.2.0"
},
"repository": {
"type": "git",
"url": "git://github.com/SheetJS/js-wmf.git"
},
"scripts": {
},
"config": {
"blanket": {
"pattern": "wmf.js"
}
},
"alex": {
"allow": [
"special",
"simple",
"just",
"crash",
"wtf",
"holes"
]
},
"homepage": "https://sheetjs.com/",
"files": [
"LICENSE",
"README.md",
"dist/wmf.js",
"dist/wmf.node.js",
"dist/wmf.js.map",
"dist/wmf.node.js.map"
],
"bugs": {
"url": "https://github.com/SheetJS/js-wmf/issues"
},
"license": "Apache-2.0",
"engines": {
"node": ">=0.8"
}
}

View File

@@ -0,0 +1,15 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
trim_trailing_whitespace = true
[{*.md,*.yml}]
indent_size = 2
indent_style = space

View File

@@ -0,0 +1 @@
{"name":"shebang-regex","version":"3.0.0","files":{"license":{"checkedAt":1678883669272,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"package.json":{"checkedAt":1678883670657,"integrity":"sha512-YcMsdpd0Uz9MzIL8P+je+7/CpLAPiEr51CjCiTccspqfRWkXJKQAEfC0WLwDj7/DZwcQenVr6z3ikfxcWoMRyg==","mode":420,"size":582},"index.d.ts":{"checkedAt":1678883670657,"integrity":"sha512-BDr9qQ6LOLFvg2BBf6B8OLunV+pt1WvgQiIN2kMfm6jC8Ue6gtJu9FEGpQyJS4jwsUMC3DMf+m2vugN8BrLn9w==","mode":420,"size":446},"index.js":{"checkedAt":1678883670657,"integrity":"sha512-TVoLqbMi/bAJL7HfLHmpuypxwwPt+TIuZEtdaVF7H3URLrcQ9owSWjS0o5QqK1lGsFW0swKVnuyL0hxTKn+kuA==","mode":420,"size":42},"readme.md":{"checkedAt":1678883670657,"integrity":"sha512-zP99xK1x8D5a0KczeLDc4iykLpNrYX8dT42TZjAzNWWt5LoyK5yjj/B+vhxETiZvzdw6xaXqTWrsjoM4NA2NQQ==","mode":420,"size":649}}}

View File

@@ -0,0 +1,18 @@
const { dirname, resolve } = require('path');
const { readdirSync, statSync } = require('fs');
module.exports = function (start, callback) {
let dir = resolve('.', start);
let tmp, stats = statSync(dir);
if (!stats.isDirectory()) {
dir = dirname(dir);
}
while (true) {
tmp = callback(dir, readdirSync(dir));
if (tmp) return resolve(dir, tmp);
dir = dirname(tmp = dir);
if (tmp === dir) break;
}
}

View File

@@ -0,0 +1,69 @@
# Plain Object
A _plain object_
- Inherits directly from `Object.prototype` or `null`
- Is not a constructor's `prototype` property
## `plain-object/is`
Confirms if given object is a _plain object_
```javascript
const isPlainObject = require("type/plain-object/is");
isPlainObject({}); // true
isPlainObject(Object.create(null)); // true
isPlainObject([]); // false
```
## `plain-object/ensure`
If given argument is a plain object it is returned back. Otherwise `TypeError` is thrown.
```javascript
const ensurePlainObject = require("type/plain-object/ensure");
ensurePlainObject({}); // {}
ensurePlainObject("foo"); // Thrown TypeError: foo is not a plain object
```
### Confirming on keys
Keys can be validated by passing `allowedKeys` option. Note that in this case:
- Error message lists up to three invalid keys
```javascript
const allowedKeys = ["foo"];
ensurePlainObject({}, { allowedKeys }); // {}
ensurePlainObject({ foo: "bar" }, { allowedKeys }); // { foo: 'bar' }
/*
Below invocation with crash with:
TypeError: [object Object] is not a valid plain object.
Following keys are unexpected: lorem, ipsum
*/
ensurePlainObject({ foo: "bar", lorem: 1, ipsum: 2 }, { allowedKeys });
```
### Confirming on property values
Property values can be validated by passing `ensurePropertyValue` option. Note that in this case:
- A newly created instance of plain object with coerced values is returned
- Error message lists up to three keys that contain invalid values
```javascript
const ensureString = require("type/string/ensure");
ensurePlainObject({ foo: 12 }, { ensurePropertyValue: ensureString }); // { foo: '12' }
/*
Below invocation with crash with:
TypeError: [object Object] is not a valid plain object.
Valuees for following keys are invalid: lorem, ipsum
*/
ensurePlainObject({ foo: 23, lorem: {}, ipsum: {} }, { ensurePropertyValue: ensureString });
```

View File

@@ -0,0 +1,30 @@
import { createErrorClass } from './createErrorClass';
export interface ArgumentOutOfRangeError extends Error {}
export interface ArgumentOutOfRangeErrorCtor {
/**
* @deprecated Internal implementation detail. Do not construct error instances.
* Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269
*/
new (): ArgumentOutOfRangeError;
}
/**
* An error thrown when an element was queried at a certain index of an
* Observable, but no such index or position exists in that sequence.
*
* @see {@link elementAt}
* @see {@link take}
* @see {@link takeLast}
*
* @class ArgumentOutOfRangeError
*/
export const ArgumentOutOfRangeError: ArgumentOutOfRangeErrorCtor = createErrorClass(
(_super) =>
function ArgumentOutOfRangeErrorImpl(this: any) {
_super(this);
this.name = 'ArgumentOutOfRangeError';
this.message = 'argument out of range';
}
);

View File

@@ -0,0 +1 @@
{"version":3,"file":"publishBehavior.js","sourceRoot":"","sources":["../../../../src/internal/operators/publishBehavior.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAiB5E,MAAM,UAAU,eAAe,CAAI,YAAe;IAEhD,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,MAAM,OAAO,GAAG,IAAI,eAAe,CAAI,YAAY,CAAC,CAAC;QACrD,OAAO,IAAI,qBAAqB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC,CAAC;AACJ,CAAC"}

View File

@@ -0,0 +1,163 @@
'use strict';
const { readCAFileSync } = require('@pnpm/network.ca-file');
const fs = require('fs');
const path = require('path');
const {ConfigChain} = require('config-chain');
const envKeyToSetting = require('./envKeyToSetting');
const util = require('./util');
class Conf extends ConfigChain {
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L203-L217
constructor(base, types) {
super(base);
this.root = base;
this._parseField = util.parseField.bind(null, types || require('./types'));
}
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L326-L338
add(data, marker) {
try {
for (const x of Object.keys(data)) {
data[x] = this._parseField(data[x], x);
}
} catch (error) {
throw error;
}
return super.add(data, marker);
}
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L306-L319
addFile(file, name) {
name = name || file;
const marker = {__source__: name};
this.sources[name] = {path: file, type: 'ini'};
this.push(marker);
this._await();
try {
const contents = fs.readFileSync(file, 'utf8');
this.addString(contents, file, 'ini', marker);
} catch (error) {
if (error.code === 'ENOENT') {
this.add({}, marker);
} else {
return `Issue while reading "${file}". ${error.message}`
}
}
}
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L341-L357
addEnv(env) {
env = env || process.env;
const conf = {};
Object.keys(env)
.filter(x => /^npm_config_/i.test(x))
.forEach(x => {
if (!env[x]) {
return;
}
conf[envKeyToSetting(x.substr(11))] = env[x];
});
return super.addEnv('', conf, 'env');
}
// https://github.com/npm/cli/blob/latest/lib/config/load-prefix.js
loadPrefix() {
const cli = this.list[0];
Object.defineProperty(this, 'prefix', {
enumerable: true,
set: prefix => {
const g = this.get('global');
this[g ? 'globalPrefix' : 'localPrefix'] = prefix;
},
get: () => {
const g = this.get('global');
return g ? this.globalPrefix : this.localPrefix;
}
});
Object.defineProperty(this, 'globalPrefix', {
enumerable: true,
set: prefix => {
this.set('prefix', prefix);
},
get: () => {
return path.resolve(this.get('prefix'));
}
});
let p;
Object.defineProperty(this, 'localPrefix', {
enumerable: true,
set: prefix => {
p = prefix;
},
get: () => {
return p;
}
});
if (Object.prototype.hasOwnProperty.call(cli, 'prefix')) {
p = path.resolve(cli.prefix);
} else {
try {
const prefix = util.findPrefix(process.cwd());
p = prefix;
} catch (error) {
throw error;
}
}
return p;
}
// https://github.com/npm/cli/blob/latest/lib/config/load-cafile.js
loadCAFile(file) {
if (!file) {
return;
}
const ca = readCAFileSync(file);
if (ca) {
this.set('ca', ca);
}
}
// https://github.com/npm/cli/blob/latest/lib/config/set-user.js
loadUser() {
const defConf = this.root;
if (this.get('global')) {
return;
}
if (process.env.SUDO_UID) {
defConf.user = Number(process.env.SUDO_UID);
return;
}
const prefix = path.resolve(this.get('prefix'));
try {
const stats = fs.statSync(prefix);
defConf.user = stats.uid;
} catch (error) {
if (error.code === 'ENOENT') {
return;
}
throw error;
}
}
}
module.exports = Conf;

View File

@@ -0,0 +1,28 @@
language: node_js
sudo: false
node_js:
- 9
- 8
- 7
- 6
- 5
- 4
- 4.0
- iojs-v3
- iojs-v2
- iojs-v1
- 0.12
- 0.10
cache:
directories:
- node_modules
after_script:
- npm run coverage
notifications:
email:
on_success: never
on_failure: always

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 JD Ballard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.