This commit is contained in:
2025-05-09 05:30:08 +02:00
parent 7bb10e7df4
commit 73367bad9e
5322 changed files with 1266973 additions and 313 deletions

View File

@@ -0,0 +1,47 @@
'use strict';
var loader = require('./lib/loader');
var dumper = require('./lib/dumper');
function renamed(from, to) {
return function () {
throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +
'Use yaml.' + to + ' instead, which is now safe by default.');
};
}
module.exports.Type = require('./lib/type');
module.exports.Schema = require('./lib/schema');
module.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe');
module.exports.JSON_SCHEMA = require('./lib/schema/json');
module.exports.CORE_SCHEMA = require('./lib/schema/core');
module.exports.DEFAULT_SCHEMA = require('./lib/schema/default');
module.exports.load = loader.load;
module.exports.loadAll = loader.loadAll;
module.exports.dump = dumper.dump;
module.exports.YAMLException = require('./lib/exception');
// Re-export all types in case user wants to create custom schema
module.exports.types = {
binary: require('./lib/type/binary'),
float: require('./lib/type/float'),
map: require('./lib/type/map'),
null: require('./lib/type/null'),
pairs: require('./lib/type/pairs'),
set: require('./lib/type/set'),
timestamp: require('./lib/type/timestamp'),
bool: require('./lib/type/bool'),
int: require('./lib/type/int'),
merge: require('./lib/type/merge'),
omap: require('./lib/type/omap'),
seq: require('./lib/type/seq'),
str: require('./lib/type/str')
};
// Removed functions from JS-YAML 3.0.x
module.exports.safeLoad = renamed('safeLoad', 'load');
module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll');
module.exports.safeDump = renamed('safeDump', 'dump');

View File

@@ -0,0 +1,23 @@
/**
* @fileoverview Types for this package.
*/
import type { Linter } from "eslint";
/**
* Infinite array type.
*/
export type InfiniteArray<T> = T | InfiniteArray<T>[];
/**
* The type of array element in the `extends` property after flattening.
*/
export type SimpleExtendsElement = string | Linter.Config;
/**
* The type of array element in the `extends` property before flattening.
*/
export type ExtendsElement = SimpleExtendsElement | InfiniteArray<Linter.Config>;
/**
* Config with extends. Valid only inside of `defineConfig()`.
*/
export interface ConfigWithExtends extends Linter.Config {
extends?: ExtendsElement[];
}
export type ConfigWithExtendsArray = InfiniteArray<ConfigWithExtends>[];

View File

@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _objectSpread2;
var _defineProperty = require("./defineProperty.js");
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) {
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
}
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
(0, _defineProperty.default)(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
//# sourceMappingURL=objectSpread2.js.map

View File

@@ -0,0 +1,180 @@
'use strict';
var _Object$setPrototypeO;
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var finished = require('./end-of-stream');
var kLastResolve = Symbol('lastResolve');
var kLastReject = Symbol('lastReject');
var kError = Symbol('error');
var kEnded = Symbol('ended');
var kLastPromise = Symbol('lastPromise');
var kHandlePromise = Symbol('handlePromise');
var kStream = Symbol('stream');
function createIterResult(value, done) {
return {
value: value,
done: done
};
}
function readAndResolve(iter) {
var resolve = iter[kLastResolve];
if (resolve !== null) {
var data = iter[kStream].read();
// we defer if data is null
// we can be expecting either 'end' or
// 'error'
if (data !== null) {
iter[kLastPromise] = null;
iter[kLastResolve] = null;
iter[kLastReject] = null;
resolve(createIterResult(data, false));
}
}
}
function onReadable(iter) {
// we wait for the next tick, because it might
// emit an error with process.nextTick
process.nextTick(readAndResolve, iter);
}
function wrapForNext(lastPromise, iter) {
return function (resolve, reject) {
lastPromise.then(function () {
if (iter[kEnded]) {
resolve(createIterResult(undefined, true));
return;
}
iter[kHandlePromise](resolve, reject);
}, reject);
};
}
var AsyncIteratorPrototype = Object.getPrototypeOf(function () {});
var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
get stream() {
return this[kStream];
},
next: function next() {
var _this = this;
// if we have detected an error in the meanwhile
// reject straight away
var error = this[kError];
if (error !== null) {
return Promise.reject(error);
}
if (this[kEnded]) {
return Promise.resolve(createIterResult(undefined, true));
}
if (this[kStream].destroyed) {
// We need to defer via nextTick because if .destroy(err) is
// called, the error will be emitted via nextTick, and
// we cannot guarantee that there is no error lingering around
// waiting to be emitted.
return new Promise(function (resolve, reject) {
process.nextTick(function () {
if (_this[kError]) {
reject(_this[kError]);
} else {
resolve(createIterResult(undefined, true));
}
});
});
}
// if we have multiple next() calls
// we will wait for the previous Promise to finish
// this logic is optimized to support for await loops,
// where next() is only called once at a time
var lastPromise = this[kLastPromise];
var promise;
if (lastPromise) {
promise = new Promise(wrapForNext(lastPromise, this));
} else {
// fast path needed to support multiple this.push()
// without triggering the next() queue
var data = this[kStream].read();
if (data !== null) {
return Promise.resolve(createIterResult(data, false));
}
promise = new Promise(this[kHandlePromise]);
}
this[kLastPromise] = promise;
return promise;
}
}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {
return this;
}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
var _this2 = this;
// destroy(err, cb) is a private API
// we can guarantee we have that here, because we control the
// Readable class this is attached to
return new Promise(function (resolve, reject) {
_this2[kStream].destroy(null, function (err) {
if (err) {
reject(err);
return;
}
resolve(createIterResult(undefined, true));
});
});
}), _Object$setPrototypeO), AsyncIteratorPrototype);
var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
var _Object$create;
var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
value: stream,
writable: true
}), _defineProperty(_Object$create, kLastResolve, {
value: null,
writable: true
}), _defineProperty(_Object$create, kLastReject, {
value: null,
writable: true
}), _defineProperty(_Object$create, kError, {
value: null,
writable: true
}), _defineProperty(_Object$create, kEnded, {
value: stream._readableState.endEmitted,
writable: true
}), _defineProperty(_Object$create, kHandlePromise, {
value: function value(resolve, reject) {
var data = iterator[kStream].read();
if (data) {
iterator[kLastPromise] = null;
iterator[kLastResolve] = null;
iterator[kLastReject] = null;
resolve(createIterResult(data, false));
} else {
iterator[kLastResolve] = resolve;
iterator[kLastReject] = reject;
}
},
writable: true
}), _Object$create));
iterator[kLastPromise] = null;
finished(stream, function (err) {
if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
var reject = iterator[kLastReject];
// reject if we are waiting for data in the Promise
// returned by next() and store the error
if (reject !== null) {
iterator[kLastPromise] = null;
iterator[kLastResolve] = null;
iterator[kLastReject] = null;
reject(err);
}
iterator[kError] = err;
return;
}
var resolve = iterator[kLastResolve];
if (resolve !== null) {
iterator[kLastPromise] = null;
iterator[kLastResolve] = null;
iterator[kLastReject] = null;
resolve(createIterResult(undefined, true));
}
iterator[kEnded] = true;
});
stream.on('readable', onReadable.bind(null, iterator));
return iterator;
};
module.exports = createReadableStreamAsyncIterator;

View File

@@ -0,0 +1 @@
module.exports={C:{"34":0.01305,"54":0.00186,"56":0.00186,"68":0.00186,"72":0.00186,"78":0.00186,"79":0.00186,"89":0.01864,"94":0.00186,"110":0.00186,"113":0.00186,"115":0.09134,"127":0.00559,"128":0.0205,"129":0.00186,"130":0.00186,"131":0.00186,"132":0.00186,"133":0.00559,"134":0.00559,"135":0.1398,"136":0.57411,"137":0.00746,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 55 57 58 59 60 61 62 63 64 65 66 67 69 70 71 73 74 75 76 77 80 81 82 83 84 85 86 87 88 90 91 92 93 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 111 112 114 116 117 118 119 120 121 122 123 124 125 126 138 139 140 3.5 3.6"},D:{"39":0.00186,"40":0.00186,"41":0.00186,"42":0.00186,"43":0.00186,"45":0.00186,"46":0.00186,"47":0.00559,"48":0.00186,"49":0.00746,"50":0.02237,"51":0.00186,"53":0.00186,"54":0.00186,"55":0.00186,"56":0.00373,"57":0.00186,"58":0.00559,"59":0.00186,"60":0.00186,"62":0.00186,"64":0.01864,"65":0.00559,"66":0.00186,"68":0.00373,"69":0.00186,"70":0.00186,"72":0.00186,"73":0.00373,"75":0.00932,"76":0.01491,"77":0.00559,"78":0.00186,"79":0.02796,"80":0.00559,"81":0.00932,"83":0.01118,"85":0.00186,"86":0.00373,"87":0.02796,"88":0.00746,"89":0.00559,"91":0.00186,"92":0.00373,"93":0.00746,"94":0.00932,"95":0.01678,"96":0.00373,"97":0.00186,"98":0.00746,"99":0.00932,"100":0.00559,"101":0.00186,"103":0.03169,"104":0.00746,"105":0.00373,"106":0.00559,"108":0.01118,"109":0.89845,"110":0.00932,"111":0.02796,"113":0.00373,"114":0.01118,"115":0.00186,"116":0.03728,"117":0.00186,"118":0.00559,"119":0.0671,"120":0.00932,"121":0.01305,"122":0.01491,"123":0.01118,"124":0.00746,"125":0.01678,"126":0.02796,"127":0.01678,"128":0.04287,"129":0.03542,"130":0.02796,"131":0.12489,"132":0.13421,"133":2.47166,"134":4.92655,"135":0.01864,"136":0.00559,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 44 52 61 63 67 71 74 84 90 102 107 112 137 138"},F:{"46":0.00186,"79":0.00186,"87":0.00186,"95":0.01678,"112":0.00373,"114":0.00186,"115":0.00186,"116":0.03169,"117":0.52006,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"14":0.00186,"17":0.00186,"18":0.01864,"84":0.00186,"89":0.00186,"90":0.00186,"92":0.02237,"100":0.00186,"109":0.00932,"112":0.00373,"122":0.00186,"124":0.00186,"125":0.00373,"126":0.00373,"127":0.00373,"128":0.00559,"129":0.00559,"130":0.01118,"131":0.02237,"132":0.04846,"133":0.59275,"134":1.39427,_:"12 13 15 16 79 80 81 83 85 86 87 88 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 113 114 115 116 117 118 119 120 121 123"},E:{"13":0.00373,"14":0.03355,_:"0 4 5 6 7 8 9 10 11 12 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 12.1 15.2-15.3 15.4 15.5 16.2 16.4 17.0 17.2","11.1":0.00186,"13.1":0.00746,"14.1":0.00746,"15.1":0.00186,"15.6":0.03355,"16.0":0.00186,"16.1":0.00373,"16.3":0.00186,"16.5":0.00373,"16.6":0.02982,"17.1":0.00186,"17.3":0.00186,"17.4":0.01491,"17.5":0.01118,"17.6":0.12302,"18.0":0.01118,"18.1":0.01305,"18.2":0.01305,"18.3":0.1864,"18.4":0.00746},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00345,"5.0-5.1":0,"6.0-6.1":0.01034,"7.0-7.1":0.00689,"8.1-8.4":0,"9.0-9.2":0.00517,"9.3":0.02412,"10.0-10.2":0.00172,"10.3":0.03963,"11.0-11.2":0.18266,"11.3-11.4":0.01206,"12.0-12.1":0.00689,"12.2-12.5":0.1706,"13.0-13.1":0.00345,"13.2":0.00517,"13.3":0.00689,"13.4-13.7":0.02412,"14.0-14.4":0.06031,"14.5-14.8":0.07237,"15.0-15.1":0.03963,"15.2-15.3":0.03963,"15.4":0.04825,"15.5":0.05514,"15.6-15.8":0.67894,"16.0":0.0965,"16.1":0.19817,"16.2":0.10339,"16.3":0.17921,"16.4":0.03963,"16.5":0.0741,"16.6-16.7":0.80474,"17.0":0.04825,"17.1":0.08616,"17.2":0.06548,"17.3":0.09133,"17.4":0.18266,"17.5":0.40668,"17.6-17.7":1.1804,"18.0":0.33086,"18.1":1.08217,"18.2":0.48422,"18.3":10.12038,"18.4":0.14992},P:{"4":0.03076,"20":0.01025,"21":0.01025,"22":0.07177,"23":0.01025,"24":0.05126,"25":0.08202,"26":0.08202,"27":0.70744,"5.0-5.4":0.01025,_:"6.2-6.4 8.2 10.1 11.1-11.2 12.0 13.0 15.0 16.0 18.0","7.2-7.4":0.10253,"9.2":0.01025,"14.0":0.04101,"17.0":0.03076,"19.0":0.01025},I:{"0":0.07307,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00008},K:{"0":0.36816,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00746,_:"6 7 8 9 10 5.5"},S:{"2.5":0.00814,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.0895},Q:{"14.9":0.00814},O:{"0":0.06509},H:{"0":0.12},L:{"0":66.80353}};

View File

@@ -0,0 +1,40 @@
{
"name": "update-browserslist-db",
"version": "1.1.3",
"description": "CLI tool to update caniuse-lite to refresh target browsers from Browserslist config",
"keywords": [
"caniuse",
"browsers",
"target"
],
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"author": "Andrey Sitnik <andrey@sitnik.ru>",
"license": "MIT",
"repository": "browserslist/update-db",
"types": "./index.d.ts",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"dependencies": {
"escalade": "^3.2.0",
"picocolors": "^1.1.1"
},
"peerDependencies": {
"browserslist": ">= 4.21.0"
},
"bin": "cli.js"
}

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018 Lars-Magnus Skog
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 @@
{"version":3,"names":["REACT_ELEMENT_TYPE","_createRawReactElement","type","props","key","children","Symbol","defaultProps","childrenLength","arguments","length","childArray","Array","i","propName","$$typeof","undefined","ref","_owner"],"sources":["../../src/helpers/jsx.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nvar REACT_ELEMENT_TYPE: symbol | 0xeac7;\n\ninterface Props {\n children?: any;\n [propName: string]: any;\n}\n\ninterface ReactElement {\n $$typeof: typeof REACT_ELEMENT_TYPE;\n type: any;\n key: string | null;\n ref: null;\n props: Props;\n _owner: null;\n}\n\ntype ReactElementType = any;\ntype ReactKey = string | number | bigint;\ntype ReactNode =\n | ReactElement\n | string\n | number\n | Iterable<ReactNode>\n | boolean\n | null\n | undefined;\n\nexport default function _createRawReactElement(\n type: ReactElementType,\n props: Props,\n key?: ReactKey,\n children?: ReactNode[],\n): ReactElement {\n if (!REACT_ELEMENT_TYPE) {\n REACT_ELEMENT_TYPE =\n (typeof Symbol === \"function\" &&\n // \"for\" is a reserved keyword in ES3 so escaping it here for backward compatibility\n Symbol[\"for\"] &&\n Symbol[\"for\"](\"react.element\")) ||\n 0xeac7;\n }\n\n var defaultProps: Props = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we're going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = { children: void 0 };\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = new Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : \"\" + key,\n ref: null,\n props: props,\n _owner: null,\n };\n}\n"],"mappings":";;;;;;AAEA,IAAIA,kBAAmC;AA2BxB,SAASC,sBAAsBA,CAC5CC,IAAsB,EACtBC,KAAY,EACZC,GAAc,EACdC,QAAsB,EACR;EACd,IAAI,CAACL,kBAAkB,EAAE;IACvBA,kBAAkB,GACf,OAAOM,MAAM,KAAK,UAAU,IAE3BA,MAAM,CAAC,KAAK,CAAC,IACbA,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,IAChC,MAAM;EACV;EAEA,IAAIC,YAAmB,GAAGL,IAAI,IAAIA,IAAI,CAACK,YAAY;EACnD,IAAIC,cAAc,GAAGC,SAAS,CAACC,MAAM,GAAG,CAAC;EAEzC,IAAI,CAACP,KAAK,IAAIK,cAAc,KAAK,CAAC,EAAE;IAGlCL,KAAK,GAAG;MAAEE,QAAQ,EAAE,KAAK;IAAE,CAAC;EAC9B;EAEA,IAAIG,cAAc,KAAK,CAAC,EAAE;IACxBL,KAAK,CAACE,QAAQ,GAAGA,QAAQ;EAC3B,CAAC,MAAM,IAAIG,cAAc,GAAG,CAAC,EAAE;IAC7B,IAAIG,UAAU,GAAG,IAAIC,KAAK,CAACJ,cAAc,CAAC;IAC1C,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,cAAc,EAAEK,CAAC,EAAE,EAAE;MACvCF,UAAU,CAACE,CAAC,CAAC,GAAGJ,SAAS,CAACI,CAAC,GAAG,CAAC,CAAC;IAClC;IACAV,KAAK,CAACE,QAAQ,GAAGM,UAAU;EAC7B;EAEA,IAAIR,KAAK,IAAII,YAAY,EAAE;IACzB,KAAK,IAAIO,QAAQ,IAAIP,YAAY,EAAE;MACjC,IAAIJ,KAAK,CAACW,QAAQ,CAAC,KAAK,KAAK,CAAC,EAAE;QAC9BX,KAAK,CAACW,QAAQ,CAAC,GAAGP,YAAY,CAACO,QAAQ,CAAC;MAC1C;IACF;EACF,CAAC,MAAM,IAAI,CAACX,KAAK,EAAE;IACjBA,KAAK,GAAGI,YAAY,IAAI,CAAC,CAAC;EAC5B;EAEA,OAAO;IACLQ,QAAQ,EAAEf,kBAAkB;IAC5BE,IAAI,EAAEA,IAAI;IACVE,GAAG,EAAEA,GAAG,KAAKY,SAAS,GAAG,IAAI,GAAG,EAAE,GAAGZ,GAAG;IACxCa,GAAG,EAAE,IAAI;IACTd,KAAK,EAAEA,KAAK;IACZe,MAAM,EAAE;EACV,CAAC;AACH","ignoreList":[]}

View File

@@ -0,0 +1,55 @@
import * as React from "react";
function useStableCallback(fn) {
const fnRef = React.useRef(fn);
fnRef.current = fn;
const ref = React.useRef((...args) => fnRef.current(...args));
return ref.current;
}
const useLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
function usePrevious(value) {
const ref = React.useRef({
value,
prev: null
});
const current = ref.current.value;
if (value !== current) {
ref.current = {
value,
prev: current
};
}
return ref.current.prev;
}
function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, options = {}) {
const isIntersectionObserverAvailable = React.useRef(
typeof IntersectionObserver === "function"
);
const observerRef = React.useRef(null);
React.useEffect(() => {
if (!ref.current || !isIntersectionObserverAvailable.current || options.disabled) {
return;
}
observerRef.current = new IntersectionObserver(([entry]) => {
callback(entry);
}, intersectionObserverOptions);
observerRef.current.observe(ref.current);
return () => {
var _a;
(_a = observerRef.current) == null ? void 0 : _a.disconnect();
};
}, [callback, intersectionObserverOptions, options.disabled, ref]);
return observerRef.current;
}
function useForwardedRef(ref) {
const innerRef = React.useRef(null);
React.useImperativeHandle(ref, () => innerRef.current, []);
return innerRef;
}
export {
useForwardedRef,
useIntersectionObserver,
useLayoutEffect,
usePrevious,
useStableCallback
};
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1,259 @@
/**
* @fileoverview Rule to disallow returning values from setters
* @author Milos Djermanovic
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const { findVariable } = require("@eslint-community/eslint-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Determines whether the given identifier node is a reference to a global variable.
* @param {ASTNode} node `Identifier` node to check.
* @param {Scope} scope Scope to which the node belongs.
* @returns {boolean} True if the identifier is a reference to a global variable.
*/
function isGlobalReference(node, scope) {
const variable = findVariable(scope, node);
return (
variable !== null &&
variable.scope.type === "global" &&
variable.defs.length === 0
);
}
/**
* Determines whether the given node is an argument of the specified global method call, at the given `index` position.
* E.g., for given `index === 1`, this function checks for `objectName.methodName(foo, node)`, where objectName is a global variable.
* @param {ASTNode} node The node to check.
* @param {Scope} scope Scope to which the node belongs.
* @param {string} objectName Name of the global object.
* @param {string} methodName Name of the method.
* @param {number} index The given position.
* @returns {boolean} `true` if the node is argument at the given position.
*/
function isArgumentOfGlobalMethodCall(
node,
scope,
objectName,
methodName,
index,
) {
const callNode = node.parent;
return (
callNode.type === "CallExpression" &&
callNode.arguments[index] === node &&
astUtils.isSpecificMemberAccess(
callNode.callee,
objectName,
methodName,
) &&
isGlobalReference(
astUtils.skipChainExpression(callNode.callee).object,
scope,
)
);
}
/**
* Determines whether the given node is used as a property descriptor.
* @param {ASTNode} node The node to check.
* @param {Scope} scope Scope to which the node belongs.
* @returns {boolean} `true` if the node is a property descriptor.
*/
function isPropertyDescriptor(node, scope) {
if (
isArgumentOfGlobalMethodCall(
node,
scope,
"Object",
"defineProperty",
2,
) ||
isArgumentOfGlobalMethodCall(
node,
scope,
"Reflect",
"defineProperty",
2,
)
) {
return true;
}
const parent = node.parent;
if (parent.type === "Property" && parent.value === node) {
const grandparent = parent.parent;
if (
grandparent.type === "ObjectExpression" &&
(isArgumentOfGlobalMethodCall(
grandparent,
scope,
"Object",
"create",
1,
) ||
isArgumentOfGlobalMethodCall(
grandparent,
scope,
"Object",
"defineProperties",
1,
))
) {
return true;
}
}
return false;
}
/**
* Determines whether the given function node is used as a setter function.
* @param {ASTNode} node The node to check.
* @param {Scope} scope Scope to which the node belongs.
* @returns {boolean} `true` if the node is a setter.
*/
function isSetter(node, scope) {
const parent = node.parent;
if (
(parent.type === "Property" || parent.type === "MethodDefinition") &&
parent.kind === "set" &&
parent.value === node
) {
// Setter in an object literal or in a class
return true;
}
if (
parent.type === "Property" &&
parent.value === node &&
astUtils.getStaticPropertyName(parent) === "set" &&
parent.parent.type === "ObjectExpression" &&
isPropertyDescriptor(parent.parent, scope)
) {
// Setter in a property descriptor
return true;
}
return false;
}
/**
* Finds function's outer scope.
* @param {Scope} scope Function's own scope.
* @returns {Scope} Function's outer scope.
*/
function getOuterScope(scope) {
const upper = scope.upper;
if (upper.type === "function-expression-name") {
return upper.upper;
}
return upper;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow returning values from setters",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-setter-return",
},
schema: [],
messages: {
returnsValue: "Setter cannot return a value.",
},
},
create(context) {
let funcInfo = null;
const sourceCode = context.sourceCode;
/**
* Creates and pushes to the stack a function info object for the given function node.
* @param {ASTNode} node The function node.
* @returns {void}
*/
function enterFunction(node) {
const outerScope = getOuterScope(sourceCode.getScope(node));
funcInfo = {
upper: funcInfo,
isSetter: isSetter(node, outerScope),
};
}
/**
* Pops the current function info object from the stack.
* @returns {void}
*/
function exitFunction() {
funcInfo = funcInfo.upper;
}
/**
* Reports the given node.
* @param {ASTNode} node Node to report.
* @returns {void}
*/
function report(node) {
context.report({ node, messageId: "returnsValue" });
}
return {
/*
* Function declarations cannot be setters, but we still have to track them in the `funcInfo` stack to avoid
* false positives, because a ReturnStatement node can belong to a function declaration inside a setter.
*
* Note: A previously declared function can be referenced and actually used as a setter in a property descriptor,
* but that's out of scope for this rule.
*/
FunctionDeclaration: enterFunction,
FunctionExpression: enterFunction,
ArrowFunctionExpression(node) {
enterFunction(node);
if (funcInfo.isSetter && node.expression) {
// { set: foo => bar } property descriptor. Report implicit return 'bar' as the equivalent for a return statement.
report(node.body);
}
},
"FunctionDeclaration:exit": exitFunction,
"FunctionExpression:exit": exitFunction,
"ArrowFunctionExpression:exit": exitFunction,
ReturnStatement(node) {
// Global returns (e.g., at the top level of a Node module) don't have `funcInfo`.
if (funcInfo && funcInfo.isSetter && node.argument) {
report(node);
}
},
};
},
};

View File

@@ -0,0 +1,160 @@
import LinkService from './LinkService.js';
import type { EventProps } from 'make-event-props';
import type { ClassName, DocumentCallback, ExternalLinkRel, ExternalLinkTarget, File, ImageResourcesPath, NodeOrRenderer, OnDocumentLoadError, OnDocumentLoadProgress, OnDocumentLoadSuccess, OnError, OnItemClickArgs, OnPasswordCallback, Options, PasswordResponse, RenderMode, ScrollPageIntoViewArgs } from './shared/types.js';
type OnItemClick = (args: OnItemClickArgs) => void;
type OnPassword = (callback: OnPasswordCallback, reason: PasswordResponse) => void;
type OnSourceError = OnError;
type OnSourceSuccess = () => void;
export type DocumentProps = {
children?: React.ReactNode;
/**
* Class name(s) that will be added to rendered element along with the default `react-pdf__Document`.
*
* @example 'custom-class-name-1 custom-class-name-2'
* @example ['custom-class-name-1', 'custom-class-name-2']
*/
className?: ClassName;
/**
* What the component should display in case of an error.
*
* @default 'Failed to load PDF file.'
* @example 'An error occurred!'
* @example <p>An error occurred!</p>
* @example {this.renderError}
*/
error?: NodeOrRenderer;
/**
* Link rel for links rendered in annotations.
*
* @default 'noopener noreferrer nofollow'
*/
externalLinkRel?: ExternalLinkRel;
/**
* Link target for external links rendered in annotations.
*/
externalLinkTarget?: ExternalLinkTarget;
/**
* What PDF should be displayed.
*
* Its value can be an URL, a file (imported using `import … from …` or from file input form element), or an object with parameters (`url` - URL; `data` - data, preferably Uint8Array; `range` - PDFDataRangeTransport.
*
* **Warning**: Since equality check (`===`) is used to determine if `file` object has changed, it must be memoized by setting it in component's state, `useMemo` or other similar technique.
*
* @example 'https://example.com/sample.pdf'
* @example importedPdf
* @example { url: 'https://example.com/sample.pdf' }
*/
file?: File;
/**
* The path used to prefix the src attributes of annotation SVGs.
*
* @default ''
* @example '/public/images/'
*/
imageResourcesPath?: ImageResourcesPath;
/**
* A prop that behaves like [ref](https://reactjs.org/docs/refs-and-the-dom.html), but it's passed to main `<div>` rendered by `<Document>` component.
*
* @example (ref) => { this.myDocument = ref; }
* @example this.ref
* @example ref
*/
inputRef?: React.Ref<HTMLDivElement | null>;
/**
* What the component should display while loading.
*
* @default 'Loading PDF…'
* @example 'Please wait!'
* @example <p>Please wait!</p>
* @example {this.renderLoader}
*/
loading?: NodeOrRenderer;
/**
* What the component should display in case of no data.
*
* @default 'No PDF file specified.'
* @example 'Please select a file.'
* @example <p>Please select a file.</p>
* @example {this.renderNoData}
*/
noData?: NodeOrRenderer;
/**
* Function called when an outline item or a thumbnail has been clicked. Usually, you would like to use this callback to move the user wherever they requested to.
*
* @example ({ dest, pageIndex, pageNumber }) => alert('Clicked an item from page ' + pageNumber + '!')
*/
onItemClick?: OnItemClick;
/**
* Function called in case of an error while loading a document.
*
* @example (error) => alert('Error while loading document! ' + error.message)
*/
onLoadError?: OnDocumentLoadError;
/**
* Function called, potentially multiple times, as the loading progresses.
*
* @example ({ loaded, total }) => alert('Loading a document: ' + (loaded / total) * 100 + '%')
*/
onLoadProgress?: OnDocumentLoadProgress;
/**
* Function called when the document is successfully loaded.
*
* @example (pdf) => alert('Loaded a file with ' + pdf.numPages + ' pages!')
*/
onLoadSuccess?: OnDocumentLoadSuccess;
/**
* Function called when a password-protected PDF is loaded.
*
* @example (callback) => callback('s3cr3t_p4ssw0rd')
*/
onPassword?: OnPassword;
/**
* Function called in case of an error while retrieving document source from `file` prop.
*
* @example (error) => alert('Error while retrieving document source! ' + error.message)
*/
onSourceError?: OnSourceError;
/**
* Function called when document source is successfully retrieved from `file` prop.
*
* @example () => alert('Document source retrieved!')
*/
onSourceSuccess?: OnSourceSuccess;
/**
* An object in which additional parameters to be passed to PDF.js can be defined. Most notably:
* - `cMapUrl`;
* - `httpHeaders` - custom request headers, e.g. for authorization);
* - `withCredentials` - a boolean to indicate whether or not to include cookies in the request (defaults to `false`)
*
* For a full list of possible parameters, check [PDF.js documentation on DocumentInitParameters](https://mozilla.github.io/pdf.js/api/draft/module-pdfjsLib.html#~DocumentInitParameters).
*
* **Note**: Make sure to define options object outside of your React component, and use `useMemo` if you can't.
*
* @example { cMapUrl: '/cmaps/' }
*/
options?: Options;
/**
* Rendering mode of the document. Can be `"canvas"`, `"custom"` or `"none"``. If set to `"custom"`, `customRenderer` must also be provided.
*
* @default 'canvas'
* @example 'custom'
*/
renderMode?: RenderMode;
/**
* Rotation of the document in degrees. If provided, will change rotation globally, even for the pages which were given `rotate` prop of their own. `90` = rotated to the right, `180` = upside down, `270` = rotated to the left.
*
* @example 90
*/
rotate?: number | null;
} & EventProps<DocumentCallback | false | undefined>;
/**
* Loads a document passed using `file` prop.
*/
declare const Document: React.ForwardRefExoticComponent<DocumentProps & React.RefAttributes<{
linkService: React.RefObject<LinkService>;
pages: React.RefObject<HTMLDivElement[]>;
viewer: React.RefObject<{
scrollPageIntoView: (args: ScrollPageIntoViewArgs) => void;
}>;
}>>;
export default Document;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"E F A B","2":"K D mC"},B:{"2":"0 9 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC"},D:{"1":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB","2":"0 9 VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC"},E:{"1":"PB K tC","2":"D E F A B C L M G vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","16":"uC","129":"J sC SC"},F:{"1":"F B C G N O P 4C 5C 6C 7C FC kC 8C GC","2":"0 1 2 3 4 5 6 7 8 QB RB SB TB UB VB WB XB YB ZB 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 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"1":"9C lC AD BD CD","2":"E DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","129":"SC"},H:{"1":"WD"},I:{"1":"LC J XD YD ZD aD lC bD","2":"I cD"},J:{"1":"D A"},K:{"1":"A B C FC kC GC","2":"H"},L:{"2":"I"},M:{"2":"EC"},N:{"1":"A B"},O:{"2":"HC"},P:{"2":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"2":"oD"},R:{"2":"pD"},S:{"2":"qD rD"}},B:4,C:"display: run-in",D:true};