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,53 @@
var pump = require('./index')
var rs = require('fs').createReadStream('/dev/random')
var ws = require('fs').createWriteStream('/dev/null')
var toHex = function () {
var reverse = new (require('stream').Transform)()
reverse._transform = function (chunk, enc, callback) {
reverse.push(chunk.toString('hex'))
callback()
}
return reverse
}
var wsClosed = false
var rsClosed = false
var callbackCalled = false
var check = function () {
if (wsClosed && rsClosed && callbackCalled) {
console.log('test-node.js passes')
clearTimeout(timeout)
}
}
ws.on('close', function () {
wsClosed = true
check()
})
rs.on('close', function () {
rsClosed = true
check()
})
var res = pump(rs, toHex(), toHex(), toHex(), ws, function () {
callbackCalled = true
check()
})
if (res !== ws) {
throw new Error('should return last stream')
}
setTimeout(function () {
rs.destroy()
}, 1000)
var timeout = setTimeout(function () {
throw new Error('timeout')
}, 5000)

View File

@@ -0,0 +1,15 @@
# Installation
> `npm install --save @types/babel__template`
# Summary
This package contains type definitions for @babel/template (https://github.com/babel/babel/tree/master/packages/babel-template).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__template.
### Additional Details
* Last updated: Mon, 06 Nov 2023 22:41:04 GMT
* Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types)
# Credits
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), and [ExE Boss](https://github.com/ExE-Boss).

View File

@@ -0,0 +1,117 @@
"use strict";
/* eslint consistent-return: 0 -- no default case */
const messages = {
env: `
A config object is using the "env" key, which is not supported in flat config system.
Flat config uses "languageOptions.globals" to define global variables for your files.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
If you're not using "env" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
extends: `
A config object is using the "extends" key, which is not supported in flat config system.
Instead of "extends", you can include config objects that you'd like to extend from directly in the flat config array.
If you're using "extends" in your config file, please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#predefined-and-shareable-configs
If you're not using "extends" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
globals: `
A config object is using the "globals" key, which is not supported in flat config system.
Flat config uses "languageOptions.globals" to define global variables for your files.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
If you're not using "globals" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
ignorePatterns: `
A config object is using the "ignorePatterns" key, which is not supported in flat config system.
Flat config uses "ignores" to specify files to ignore.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
If you're not using "ignorePatterns" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
noInlineConfig: `
A config object is using the "noInlineConfig" key, which is not supported in flat config system.
Flat config uses "linterOptions.noInlineConfig" to specify files to ignore.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#linter-options
`,
overrides: `
A config object is using the "overrides" key, which is not supported in flat config system.
Flat config is an array that acts like the eslintrc "overrides" array.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#glob-based-configs
If you're not using "overrides" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
parser: `
A config object is using the "parser" key, which is not supported in flat config system.
Flat config uses "languageOptions.parser" to override the default parser.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#custom-parsers
If you're not using "parser" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
parserOptions: `
A config object is using the "parserOptions" key, which is not supported in flat config system.
Flat config uses "languageOptions.parserOptions" to specify parser options.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
If you're not using "parserOptions" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
`,
reportUnusedDisableDirectives: `
A config object is using the "reportUnusedDisableDirectives" key, which is not supported in flat config system.
Flat config uses "linterOptions.reportUnusedDisableDirectives" to specify files to ignore.
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#linter-options
`,
root: `
A config object is using the "root" key, which is not supported in flat config system.
Flat configs always act as if they are the root config file, so this key can be safely removed.
`,
};
module.exports = function ({ key }) {
return messages[key].trim();
};

View File

@@ -0,0 +1,15 @@
import * as React from "react";
import warning from "tiny-warning";
import { getRouterContext } from "./routerContext.js";
function useRouter(opts) {
const value = React.useContext(getRouterContext());
warning(
!(((opts == null ? void 0 : opts.warn) ?? true) && !value),
"useRouter must be used inside a <RouterProvider> component!"
);
return value;
}
export {
useRouter
};
//# sourceMappingURL=useRouter.js.map

View File

@@ -0,0 +1,24 @@
/**
* @license React
* react-dom-test-utils.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
var React = require("react"),
didWarnAboutUsingAct = !1;
exports.act = function (callback) {
!1 === didWarnAboutUsingAct &&
((didWarnAboutUsingAct = !0),
console.error(
"`ReactDOMTestUtils.act` is deprecated in favor of `React.act`. Import `act` from `react` instead of `react-dom/test-utils`. See https://react.dev/warnings/react-dom-test-utils for more info."
));
return React.act(callback);
};
})();

View File

@@ -0,0 +1,12 @@
import { produce } from 'immer';
const immerImpl = (initializer) => (set, get, store) => {
store.setState = (updater, replace, ...a) => {
const nextState = typeof updater === "function" ? produce(updater) : updater;
return set(nextState, replace, ...a);
};
return initializer(store.setState, get, store);
};
const immer = immerImpl;
export { immer };

View File

@@ -0,0 +1,9 @@
try {
var util = require('util');
/* istanbul ignore next */
if (typeof util.inherits !== 'function') throw '';
module.exports = util.inherits;
} catch (e) {
/* istanbul ignore next */
module.exports = require('./inherits_browser.js');
}

View File

@@ -0,0 +1 @@
module.exports={C:{"5":0.0053,"43":0.0053,"52":0.04774,"55":0.01061,"56":0.01326,"72":0.00265,"113":0.0053,"115":0.17503,"125":0.00265,"127":0.0053,"128":0.02387,"131":0.00265,"132":0.0053,"133":0.0053,"134":0.00796,"135":0.17238,"136":0.54631,"137":0.0053,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 53 54 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 114 116 117 118 119 120 121 122 123 124 126 129 130 138 139 140 3.5 3.6"},D:{"38":0.00796,"39":0.0053,"40":0.0053,"41":0.00796,"42":0.0053,"43":0.0053,"44":0.0053,"45":0.0053,"46":0.0053,"47":0.0053,"48":0.00796,"49":0.01326,"50":0.00796,"51":0.0053,"52":0.0053,"53":0.00796,"54":0.0053,"55":0.00796,"56":0.0053,"57":0.0053,"58":0.00796,"59":0.0053,"60":0.0053,"62":0.00265,"63":0.00265,"66":0.00265,"69":0.01856,"70":0.01856,"71":0.00265,"73":0.00796,"74":0.0053,"75":0.0053,"77":0.01856,"78":0.00796,"79":0.06895,"80":0.00796,"81":0.00796,"83":0.02387,"84":0.00265,"85":0.0053,"86":0.02387,"87":0.06365,"88":0.0053,"89":0.0053,"90":0.0053,"91":0.01591,"92":0.01061,"93":0.0053,"94":0.00796,"95":0.0053,"96":0.0053,"97":0.01591,"98":0.06365,"99":0.01061,"100":0.01061,"101":0.02387,"102":0.00796,"103":0.04774,"104":0.04774,"105":0.00796,"106":0.01856,"107":0.02122,"108":0.03713,"109":1.07936,"110":0.01326,"111":0.03713,"112":0.03448,"113":0.00796,"114":0.05039,"115":0.02122,"116":0.0716,"117":0.00796,"118":0.02387,"119":0.02917,"120":0.03978,"121":0.03713,"122":0.05569,"123":0.1379,"124":0.08221,"125":0.2705,"126":0.0716,"127":0.07691,"128":0.08486,"129":0.04508,"130":0.09812,"131":0.21481,"132":0.23338,"133":4.35458,"134":8.10716,"135":0.01856,"136":0.01326,_:"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 61 64 65 67 68 72 76 137 138"},F:{"36":0.00265,"40":0.0053,"46":0.01591,"87":0.02917,"88":0.01061,"95":0.01591,"102":0.03978,"116":0.05834,"117":0.28642,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 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 79 80 81 82 83 84 85 86 89 90 91 92 93 94 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00796,"92":0.01856,"100":0.00265,"106":0.00265,"107":0.00265,"108":0.0053,"109":0.04243,"110":0.00265,"111":0.0053,"112":0.0053,"113":0.01326,"114":0.02122,"115":0.01061,"116":0.0053,"117":0.00796,"118":0.0053,"119":0.00796,"120":0.06365,"121":0.01061,"122":0.01326,"123":0.00796,"124":0.01061,"125":0.01061,"126":0.02387,"127":0.02917,"128":0.02122,"129":0.02122,"130":0.02387,"131":0.0716,"132":0.04774,"133":0.97328,"134":2.17729,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105"},E:{"14":0.01061,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1","13.1":0.01326,"14.1":0.02387,"15.1":0.0053,"15.2-15.3":0.00265,"15.4":0.00796,"15.5":0.01061,"15.6":0.07426,"16.0":0.01061,"16.1":0.01591,"16.2":0.01061,"16.3":0.02122,"16.4":0.00796,"16.5":0.01326,"16.6":0.08221,"17.0":0.0053,"17.1":0.04243,"17.2":0.00796,"17.3":0.01061,"17.4":0.02387,"17.5":0.04243,"17.6":0.10078,"18.0":0.02387,"18.1":0.05834,"18.2":0.02917,"18.3":0.49327,"18.4":0.00796},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00436,"5.0-5.1":0.00218,"6.0-6.1":0.00218,"7.0-7.1":0.01198,"8.1-8.4":0,"9.0-9.2":0.00327,"9.3":0.01742,"10.0-10.2":0.00109,"10.3":0.0392,"11.0-11.2":0.11433,"11.3-11.4":0.00436,"12.0-12.1":0.00436,"12.2-12.5":0.13175,"13.0-13.1":0.00218,"13.2":0.00762,"13.3":0.00544,"13.4-13.7":0.02504,"14.0-14.4":0.05009,"14.5-14.8":0.07295,"15.0-15.1":0.03702,"15.2-15.3":0.04464,"15.4":0.05771,"15.5":0.06206,"15.6-15.8":0.66418,"16.0":0.09473,"16.1":0.16659,"16.2":0.09473,"16.3":0.1655,"16.4":0.04464,"16.5":0.0784,"16.6-16.7":0.65112,"17.0":0.04791,"17.1":0.07731,"17.2":0.06968,"17.3":0.09146,"17.4":0.16006,"17.5":0.35822,"17.6-17.7":0.91788,"18.0":0.29943,"18.1":0.80138,"18.2":0.43117,"18.3":4.89318,"18.4":0.06751},P:{"4":0.06545,"21":0.02182,"22":0.03272,"23":0.04363,"24":0.04363,"25":0.05454,"26":0.09817,"27":1.73438,_:"20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0 19.0","7.2-7.4":0.03272,"17.0":0.01091},I:{"0":1.81969,"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.00164},K:{"0":1.12348,_:"10 11 12 11.1 11.5 12.1"},A:{"9":0.02085,"11":0.89674,_:"6 7 8 10 5.5"},S:{"2.5":0.02939,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.19102},Q:{"14.9":0.49225},O:{"0":1.78532},H:{"0":0.03},L:{"0":55.96607}};

View File

@@ -0,0 +1,13 @@
import * as pdfjs from 'pdfjs-dist';
import Document from './Document.js';
import Outline from './Outline.js';
import Page from './Page.js';
import Thumbnail from './Thumbnail.js';
import useDocumentContext from './shared/hooks/useDocumentContext.js';
import useOutlineContext from './shared/hooks/useOutlineContext.js';
import usePageContext from './shared/hooks/usePageContext.js';
import PasswordResponses from './PasswordResponses.js';
import { displayWorkerWarning } from './shared/utils.js';
displayWorkerWarning();
pdfjs.GlobalWorkerOptions.workerSrc = 'pdf.worker.mjs';
export { pdfjs, Document, Outline, Page, Thumbnail, useDocumentContext, useOutlineContext, usePageContext, PasswordResponses, };

View File

@@ -0,0 +1 @@
module.exports={C:{"115":0.05039,"135":0.30653,"136":0.36531,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 137 138 139 140 3.5 3.6"},D:{"39":0.0084,"40":0.0168,"41":0.0042,"42":0.0042,"43":0.0084,"44":0.0042,"45":0.0084,"46":0.0084,"48":0.0042,"49":0.0084,"50":0.0042,"51":0.0042,"52":0.0168,"53":0.0042,"54":0.0042,"55":0.0084,"56":0.0168,"57":0.0126,"58":0.0042,"59":0.0042,"60":0.0084,"72":0.0042,"75":0.02939,"76":0.25614,"77":0.19315,"79":2.07431,"80":0.23514,"81":0.0042,"85":0.0042,"87":0.02519,"91":0.07138,"92":0.0042,"93":0.04619,"94":0.0042,"95":0.0168,"96":0.0042,"100":0.0042,"102":0.0042,"103":0.22675,"105":0.0084,"108":0.0168,"109":0.12177,"111":0.0126,"114":0.0084,"116":0.02519,"118":0.0042,"119":0.0084,"120":0.02939,"122":0.0042,"124":0.0042,"125":0.03359,"126":0.22675,"127":0.0042,"128":0.0126,"129":0.0042,"130":0.03359,"131":0.31912,"132":0.26034,"133":8.35601,"134":12.79855,"135":0.02939,"136":0.021,_:"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 47 61 62 63 64 65 66 67 68 69 70 71 73 74 78 83 84 86 88 89 90 97 98 99 101 104 106 107 110 112 113 115 117 121 123 137 138"},F:{"87":0.15536,"116":0.32332,"117":0.68444,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"109":0.0042,"122":0.0042,"124":0.0042,"125":0.0042,"129":0.0042,"130":0.0042,"131":0.0042,"132":0.07558,"133":1.73419,"134":4.98001,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 120 121 123 126 127 128"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.2 16.5 17.0","13.1":0.0042,"14.1":0.02519,"15.6":0.08818,"16.0":0.08818,"16.1":0.05459,"16.3":0.0126,"16.4":0.0042,"16.6":0.09658,"17.1":0.0168,"17.2":0.02519,"17.3":0.0042,"17.4":0.0126,"17.5":0.17216,"17.6":0.62565,"18.0":0.021,"18.1":0.10078,"18.2":0.0042,"18.3":1.39407,"18.4":0.02519},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0018,"5.0-5.1":0,"6.0-6.1":0.00539,"7.0-7.1":0.0036,"8.1-8.4":0,"9.0-9.2":0.0027,"9.3":0.01259,"10.0-10.2":0.0009,"10.3":0.02068,"11.0-11.2":0.09529,"11.3-11.4":0.00629,"12.0-12.1":0.0036,"12.2-12.5":0.089,"13.0-13.1":0.0018,"13.2":0.0027,"13.3":0.0036,"13.4-13.7":0.01259,"14.0-14.4":0.03147,"14.5-14.8":0.03776,"15.0-15.1":0.02068,"15.2-15.3":0.02068,"15.4":0.02517,"15.5":0.02877,"15.6-15.8":0.35421,"16.0":0.05034,"16.1":0.10339,"16.2":0.05394,"16.3":0.0935,"16.4":0.02068,"16.5":0.03866,"16.6-16.7":0.41983,"17.0":0.02517,"17.1":0.04495,"17.2":0.03416,"17.3":0.04765,"17.4":0.09529,"17.5":0.21216,"17.6-17.7":0.61582,"18.0":0.17261,"18.1":0.56457,"18.2":0.25262,"18.3":5.27983,"18.4":0.07821},P:{"4":0.09808,"21":0.0109,"22":0.07628,"23":0.0109,"24":0.11987,"25":0.11987,"26":0.05449,"27":2.07055,_:"20 8.2 9.2 10.1 12.0 13.0 14.0 15.0 17.0 18.0 19.0","5.0-5.4":0.0218,"6.2-6.4":0.10898,"7.2-7.4":0.07628,"11.1-11.2":0.0109,"16.0":0.0109},I:{"0":0.01158,"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.00001},K:{"0":2.281,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.464},Q:{"14.9":0.0232},O:{"0":0.3074},H:{"0":0.01},L:{"0":46.8348}};

View File

@@ -0,0 +1,120 @@
"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.allEvents = exports.changeEvents = exports.otherEvents = exports.transitionEvents = exports.animationEvents = exports.wheelEvents = exports.uiEvents = exports.pointerEvents = exports.touchEvents = exports.selectionEvents = exports.dragEvents = exports.mouseEvents = exports.mediaEvents = exports.keyboardEvents = exports.imageEvents = exports.formEvents = exports.focusEvents = exports.compositionEvents = exports.clipboardEvents = void 0;
// As defined on the list of supported events: https://reactjs.org/docs/events.html
exports.clipboardEvents = ['onCopy', 'onCut', 'onPaste'];
exports.compositionEvents = [
'onCompositionEnd',
'onCompositionStart',
'onCompositionUpdate',
];
exports.focusEvents = ['onFocus', 'onBlur'];
exports.formEvents = ['onInput', 'onInvalid', 'onReset', 'onSubmit'];
exports.imageEvents = ['onLoad', 'onError'];
exports.keyboardEvents = ['onKeyDown', 'onKeyPress', 'onKeyUp'];
exports.mediaEvents = [
'onAbort',
'onCanPlay',
'onCanPlayThrough',
'onDurationChange',
'onEmptied',
'onEncrypted',
'onEnded',
'onError',
'onLoadedData',
'onLoadedMetadata',
'onLoadStart',
'onPause',
'onPlay',
'onPlaying',
'onProgress',
'onRateChange',
'onSeeked',
'onSeeking',
'onStalled',
'onSuspend',
'onTimeUpdate',
'onVolumeChange',
'onWaiting',
];
exports.mouseEvents = [
'onClick',
'onContextMenu',
'onDoubleClick',
'onMouseDown',
'onMouseEnter',
'onMouseLeave',
'onMouseMove',
'onMouseOut',
'onMouseOver',
'onMouseUp',
];
exports.dragEvents = [
'onDrag',
'onDragEnd',
'onDragEnter',
'onDragExit',
'onDragLeave',
'onDragOver',
'onDragStart',
'onDrop',
];
exports.selectionEvents = ['onSelect'];
exports.touchEvents = ['onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart'];
exports.pointerEvents = [
'onPointerDown',
'onPointerMove',
'onPointerUp',
'onPointerCancel',
'onGotPointerCapture',
'onLostPointerCapture',
'onPointerEnter',
'onPointerLeave',
'onPointerOver',
'onPointerOut',
];
exports.uiEvents = ['onScroll'];
exports.wheelEvents = ['onWheel'];
exports.animationEvents = [
'onAnimationStart',
'onAnimationEnd',
'onAnimationIteration',
];
exports.transitionEvents = ['onTransitionEnd'];
exports.otherEvents = ['onToggle'];
exports.changeEvents = ['onChange'];
exports.allEvents = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], exports.clipboardEvents, true), exports.compositionEvents, true), exports.focusEvents, true), exports.formEvents, true), exports.imageEvents, true), exports.keyboardEvents, true), exports.mediaEvents, true), exports.mouseEvents, true), exports.dragEvents, true), exports.selectionEvents, true), exports.touchEvents, true), exports.pointerEvents, true), exports.uiEvents, true), exports.wheelEvents, true), exports.animationEvents, true), exports.transitionEvents, true), exports.changeEvents, true), exports.otherEvents, true);
/**
* Returns an object with on-event callback props curried with provided args.
* @param {Object} props Props passed to a component.
* @param {Function=} getArgs A function that returns argument(s) on-event callbacks
* shall be curried with.
*/
function makeEventProps(props, getArgs) {
var eventProps = {};
exports.allEvents.forEach(function (eventName) {
var eventHandler = props[eventName];
if (!eventHandler) {
return;
}
if (getArgs) {
eventProps[eventName] = (function (event) {
return eventHandler(event, getArgs(eventName));
});
}
else {
eventProps[eventName] = eventHandler;
}
});
return eventProps;
}
exports.default = makeEventProps;

View File

@@ -0,0 +1,196 @@
/**
* @fileoverview Counts the cyclomatic complexity of each function of the script. See http://en.wikipedia.org/wiki/Cyclomatic_complexity.
* Counts the number of if, conditional, for, while, try, switch/case,
* @author Patrick Brosset
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const { upperCaseFirst } = require("../shared/string-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
const THRESHOLD_DEFAULT = 20;
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [THRESHOLD_DEFAULT],
docs: {
description:
"Enforce a maximum cyclomatic complexity allowed in a program",
recommended: false,
url: "https://eslint.org/docs/latest/rules/complexity",
},
schema: [
{
oneOf: [
{
type: "integer",
minimum: 0,
},
{
type: "object",
properties: {
maximum: {
type: "integer",
minimum: 0,
},
max: {
type: "integer",
minimum: 0,
},
variant: {
enum: ["classic", "modified"],
},
},
additionalProperties: false,
},
],
},
],
messages: {
complex:
"{{name}} has a complexity of {{complexity}}. Maximum allowed is {{max}}.",
},
},
create(context) {
const option = context.options[0];
let threshold = THRESHOLD_DEFAULT;
let VARIANT = "classic";
if (typeof option === "object") {
if (
Object.hasOwn(option, "maximum") ||
Object.hasOwn(option, "max")
) {
threshold = option.maximum || option.max;
}
if (Object.hasOwn(option, "variant")) {
VARIANT = option.variant;
}
} else if (typeof option === "number") {
threshold = option;
}
const IS_MODIFIED_COMPLEXITY = VARIANT === "modified";
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
// Using a stack to store complexity per code path
const complexities = [];
/**
* Increase the complexity of the code path in context
* @returns {void}
* @private
*/
function increaseComplexity() {
complexities[complexities.length - 1]++;
}
//--------------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------------
return {
onCodePathStart() {
// The initial complexity is 1, representing one execution path in the CodePath
complexities.push(1);
},
// Each branching in the code adds 1 to the complexity
CatchClause: increaseComplexity,
ConditionalExpression: increaseComplexity,
LogicalExpression: increaseComplexity,
ForStatement: increaseComplexity,
ForInStatement: increaseComplexity,
ForOfStatement: increaseComplexity,
IfStatement: increaseComplexity,
WhileStatement: increaseComplexity,
DoWhileStatement: increaseComplexity,
AssignmentPattern: increaseComplexity,
// Avoid `default`
"SwitchCase[test]": () =>
IS_MODIFIED_COMPLEXITY || increaseComplexity(),
SwitchStatement: () =>
IS_MODIFIED_COMPLEXITY && increaseComplexity(),
// Logical assignment operators have short-circuiting behavior
AssignmentExpression(node) {
if (astUtils.isLogicalAssignmentOperator(node.operator)) {
increaseComplexity();
}
},
MemberExpression(node) {
if (node.optional === true) {
increaseComplexity();
}
},
CallExpression(node) {
if (node.optional === true) {
increaseComplexity();
}
},
onCodePathEnd(codePath, node) {
const complexity = complexities.pop();
/*
* This rule only evaluates complexity of functions, so "program" is excluded.
* Class field initializers and class static blocks are implicit functions. Therefore,
* they shouldn't contribute to the enclosing function's complexity, but their
* own complexity should be evaluated.
*/
if (
codePath.origin !== "function" &&
codePath.origin !== "class-field-initializer" &&
codePath.origin !== "class-static-block"
) {
return;
}
if (complexity > threshold) {
let name;
if (codePath.origin === "class-field-initializer") {
name = "class field initializer";
} else if (codePath.origin === "class-static-block") {
name = "class static block";
} else {
name = astUtils.getFunctionNameWithKind(node);
}
context.report({
node,
messageId: "complex",
data: {
name: upperCaseFirst(name),
complexity,
max: threshold,
},
});
}
},
};
},
};

View File

@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const React = require("react");
const Asset = require("./Asset.cjs");
const useRouterState = require("./useRouterState.cjs");
const useRouter = require("./useRouter.cjs");
const Scripts = () => {
const router = useRouter.useRouter();
const assetScripts = useRouterState.useRouterState({
select: (state) => {
var _a;
const assetScripts2 = [];
const manifest = (_a = router.ssr) == null ? void 0 : _a.manifest;
if (!manifest) {
return [];
}
state.matches.map((match) => router.looseRoutesById[match.routeId]).forEach(
(route) => {
var _a2, _b;
return (_b = (_a2 = manifest.routes[route.id]) == null ? void 0 : _a2.assets) == null ? void 0 : _b.filter((d) => d.tag === "script").forEach((asset) => {
assetScripts2.push({
tag: "script",
attrs: asset.attrs,
children: asset.children
});
});
}
);
return assetScripts2;
},
structuralSharing: true
});
const { scripts } = useRouterState.useRouterState({
select: (state) => ({
scripts: state.matches.map((match) => match.scripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({
tag: "script",
attrs: {
...script,
suppressHydrationWarning: true
},
children
}))
})
});
const allScripts = [...scripts, ...assetScripts];
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: allScripts.map((asset, i) => /* @__PURE__ */ React.createElement(Asset.Asset, { ...asset, key: `tsr-scripts-${asset.tag}-${i}` })) });
};
exports.Scripts = Scripts;
//# sourceMappingURL=Scripts.cjs.map

View File

@@ -0,0 +1,12 @@
import { URISchemeHandler, URIComponents } from "../uri";
export interface MailtoHeaders {
[hfname: string]: string;
}
export interface MailtoComponents extends URIComponents {
to: Array<string>;
headers?: MailtoHeaders;
subject?: string;
body?: string;
}
declare const handler: URISchemeHandler<MailtoComponents>;
export default handler;