update
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* @fileoverview Types for the plugin-kit package.
|
||||
* @author Nicholas C. Zakas
|
||||
*/
|
||||
export type StringConfig = Record<string, string | null>;
|
||||
export type BooleanConfig = Record<string, boolean>;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_inherit","require","inheritTrailingComments","child","parent","inherit"],"sources":["../../src/comments/inheritTrailingComments.ts"],"sourcesContent":["import inherit from \"../utils/inherit.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function inheritTrailingComments(\n child: t.Node,\n parent: t.Node,\n): void {\n inherit(\"trailingComments\", child, parent);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGe,SAASC,uBAAuBA,CAC7CC,KAAa,EACbC,MAAc,EACR;EACN,IAAAC,gBAAO,EAAC,kBAAkB,EAAEF,KAAK,EAAEC,MAAM,CAAC;AAC5C","ignoreList":[]}
|
||||
Binary file not shown.
@@ -0,0 +1,148 @@
|
||||
# Punycode.js [](https://www.npmjs.com/package/punycode) [](https://www.jsdelivr.com/package/npm/punycode)
|
||||
|
||||
Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891).
|
||||
|
||||
This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm:
|
||||
|
||||
* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C)
|
||||
* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c)
|
||||
* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c)
|
||||
* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287)
|
||||
* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072))
|
||||
|
||||
This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated).
|
||||
|
||||
This project provides a CommonJS module that uses ES2015+ features and JavaScript module, which work in modern Node.js versions and browsers. For the old Punycode.js version that offers the same functionality in a UMD build with support for older pre-ES2015 runtimes, including Rhino, Ringo, and Narwhal, see [v1.4.1](https://github.com/mathiasbynens/punycode.js/releases/tag/v1.4.1).
|
||||
|
||||
## Installation
|
||||
|
||||
Via [npm](https://www.npmjs.com/):
|
||||
|
||||
```bash
|
||||
npm install punycode --save
|
||||
```
|
||||
|
||||
In [Node.js](https://nodejs.org/):
|
||||
|
||||
> ⚠️ Note that userland modules don't hide core modules.
|
||||
> For example, `require('punycode')` still imports the deprecated core module even if you executed `npm install punycode`.
|
||||
> Use `require('punycode/')` to import userland modules rather than core modules.
|
||||
|
||||
```js
|
||||
const punycode = require('punycode/');
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `punycode.decode(string)`
|
||||
|
||||
Converts a Punycode string of ASCII symbols to a string of Unicode symbols.
|
||||
|
||||
```js
|
||||
// decode domain name parts
|
||||
punycode.decode('maana-pta'); // 'mañana'
|
||||
punycode.decode('--dqo34k'); // '☃-⌘'
|
||||
```
|
||||
|
||||
### `punycode.encode(string)`
|
||||
|
||||
Converts a string of Unicode symbols to a Punycode string of ASCII symbols.
|
||||
|
||||
```js
|
||||
// encode domain name parts
|
||||
punycode.encode('mañana'); // 'maana-pta'
|
||||
punycode.encode('☃-⌘'); // '--dqo34k'
|
||||
```
|
||||
|
||||
### `punycode.toUnicode(input)`
|
||||
|
||||
Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode.
|
||||
|
||||
```js
|
||||
// decode domain names
|
||||
punycode.toUnicode('xn--maana-pta.com');
|
||||
// → 'mañana.com'
|
||||
punycode.toUnicode('xn----dqo34k.com');
|
||||
// → '☃-⌘.com'
|
||||
|
||||
// decode email addresses
|
||||
punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');
|
||||
// → 'джумла@джpумлатест.bрфa'
|
||||
```
|
||||
|
||||
### `punycode.toASCII(input)`
|
||||
|
||||
Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII.
|
||||
|
||||
```js
|
||||
// encode domain names
|
||||
punycode.toASCII('mañana.com');
|
||||
// → 'xn--maana-pta.com'
|
||||
punycode.toASCII('☃-⌘.com');
|
||||
// → 'xn----dqo34k.com'
|
||||
|
||||
// encode email addresses
|
||||
punycode.toASCII('джумла@джpумлатест.bрфa');
|
||||
// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'
|
||||
```
|
||||
|
||||
### `punycode.ucs2`
|
||||
|
||||
#### `punycode.ucs2.decode(string)`
|
||||
|
||||
Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16.
|
||||
|
||||
```js
|
||||
punycode.ucs2.decode('abc');
|
||||
// → [0x61, 0x62, 0x63]
|
||||
// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE:
|
||||
punycode.ucs2.decode('\uD834\uDF06');
|
||||
// → [0x1D306]
|
||||
```
|
||||
|
||||
#### `punycode.ucs2.encode(codePoints)`
|
||||
|
||||
Creates a string based on an array of numeric code point values.
|
||||
|
||||
```js
|
||||
punycode.ucs2.encode([0x61, 0x62, 0x63]);
|
||||
// → 'abc'
|
||||
punycode.ucs2.encode([0x1D306]);
|
||||
// → '\uD834\uDF06'
|
||||
```
|
||||
|
||||
### `punycode.version`
|
||||
|
||||
A string representing the current Punycode.js version number.
|
||||
|
||||
## For maintainers
|
||||
|
||||
### How to publish a new release
|
||||
|
||||
1. On the `main` branch, bump the version number in `package.json`:
|
||||
|
||||
```sh
|
||||
npm version patch -m 'Release v%s'
|
||||
```
|
||||
|
||||
Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/).
|
||||
|
||||
Note that this produces a Git commit + tag.
|
||||
|
||||
1. Push the release commit and tag:
|
||||
|
||||
```sh
|
||||
git push && git push --tags
|
||||
```
|
||||
|
||||
Our CI then automatically publishes the new release to npm, under both the [`punycode`](https://www.npmjs.com/package/punycode) and [`punycode.js`](https://www.npmjs.com/package/punycode.js) names.
|
||||
|
||||
## Author
|
||||
|
||||
| [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||
|---|
|
||||
| [Mathias Bynens](https://mathiasbynens.be/) |
|
||||
|
||||
## License
|
||||
|
||||
Punycode.js is available under the [MIT](https://mths.be/mit) license.
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"A B","2":"K D E F mC"},B:{"1":"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:{"1":"0 9 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","2":"1 2 3 4 5 6 7 8 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 qC rC"},D:{"1":"0 6 7 8 9 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 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","2":"1 2 3 4 5 J PB K D E F A B C L M G N O P QB"},E:{"1":"B C L M G 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","2":"J PB K D E F A sC SC tC uC vC wC TC"},F:{"1":"0 1 2 3 4 5 6 7 8 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 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","2":"F B C 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"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","2":"E SC 9C lC AD BD CD DD ED FD GD HD"},H:{"2":"WD"},I:{"1":"I bD cD","2":"LC J XD YD ZD aD lC"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"1":"A B"},O:{"1":"HC"},P:{"1":"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:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:2,C:"User Timing API",D:true};
|
||||
@@ -0,0 +1,288 @@
|
||||
/**
|
||||
* Error to represent when a method is missing on an impl.
|
||||
*/
|
||||
export class NoSuchMethodError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} methodName The name of the method that was missing.
|
||||
*/
|
||||
constructor(methodName: string);
|
||||
}
|
||||
/**
|
||||
* Error to represent when a method is not supported on an impl. This happens
|
||||
* when a method on `Hfs` is called with one name and the corresponding method
|
||||
* on the impl has a different name. (Example: `text()` and `bytes()`.)
|
||||
*/
|
||||
export class MethodNotSupportedError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} methodName The name of the method that was missing.
|
||||
*/
|
||||
constructor(methodName: string);
|
||||
}
|
||||
/**
|
||||
* Error to represent when an impl is already set.
|
||||
*/
|
||||
export class ImplAlreadySetError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
*/
|
||||
constructor();
|
||||
}
|
||||
/**
|
||||
* A class representing a log entry.
|
||||
*/
|
||||
export class LogEntry {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} type The type of log entry.
|
||||
* @param {any} [data] The data associated with the log entry.
|
||||
*/
|
||||
constructor(type: string, data?: any);
|
||||
/**
|
||||
* The type of log entry.
|
||||
* @type {string}
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The data associated with the log entry.
|
||||
* @type {any}
|
||||
*/
|
||||
data: any;
|
||||
/**
|
||||
* The time at which the log entry was created.
|
||||
* @type {number}
|
||||
*/
|
||||
timestamp: number;
|
||||
}
|
||||
/**
|
||||
* A class representing a file system utility library.
|
||||
* @implements {HfsImpl}
|
||||
*/
|
||||
export class Hfs implements HfsImpl {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {object} options The options for the instance.
|
||||
* @param {HfsImpl} options.impl The implementation to use.
|
||||
*/
|
||||
constructor({ impl }: {
|
||||
impl: HfsImpl;
|
||||
});
|
||||
/**
|
||||
* Starts a new log with the given name.
|
||||
* @param {string} name The name of the log to start;
|
||||
* @returns {void}
|
||||
* @throws {Error} When the log already exists.
|
||||
* @throws {TypeError} When the name is not a non-empty string.
|
||||
*/
|
||||
logStart(name: string): void;
|
||||
/**
|
||||
* Ends a log with the given name and returns the entries.
|
||||
* @param {string} name The name of the log to end.
|
||||
* @returns {Array<LogEntry>} The entries in the log.
|
||||
* @throws {Error} When the log does not exist.
|
||||
*/
|
||||
logEnd(name: string): Array<LogEntry>;
|
||||
/**
|
||||
* Determines if the current implementation is the base implementation.
|
||||
* @returns {boolean} True if the current implementation is the base implementation.
|
||||
*/
|
||||
isBaseImpl(): boolean;
|
||||
/**
|
||||
* Sets the implementation for this instance.
|
||||
* @param {object} impl The implementation to use.
|
||||
* @returns {void}
|
||||
*/
|
||||
setImpl(impl: object): void;
|
||||
/**
|
||||
* Resets the implementation for this instance back to its original.
|
||||
* @returns {void}
|
||||
*/
|
||||
resetImpl(): void;
|
||||
/**
|
||||
* Reads the given file and returns the contents as text. Assumes UTF-8 encoding.
|
||||
* @param {string|URL} filePath The file to read.
|
||||
* @returns {Promise<string|undefined>} The contents of the file.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {TypeError} When the file path is not a non-empty string.
|
||||
*/
|
||||
text(filePath: string | URL): Promise<string | undefined>;
|
||||
/**
|
||||
* Reads the given file and returns the contents as JSON. Assumes UTF-8 encoding.
|
||||
* @param {string|URL} filePath The file to read.
|
||||
* @returns {Promise<any|undefined>} The contents of the file as JSON.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {SyntaxError} When the file contents are not valid JSON.
|
||||
* @throws {TypeError} When the file path is not a non-empty string.
|
||||
*/
|
||||
json(filePath: string | URL): Promise<any | undefined>;
|
||||
/**
|
||||
* Reads the given file and returns the contents as an ArrayBuffer.
|
||||
* @param {string|URL} filePath The file to read.
|
||||
* @returns {Promise<ArrayBuffer|undefined>} The contents of the file as an ArrayBuffer.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {TypeError} When the file path is not a non-empty string.
|
||||
* @deprecated Use bytes() instead.
|
||||
*/
|
||||
arrayBuffer(filePath: string | URL): Promise<ArrayBuffer | undefined>;
|
||||
/**
|
||||
* Reads the given file and returns the contents as an Uint8Array.
|
||||
* @param {string|URL} filePath The file to read.
|
||||
* @returns {Promise<Uint8Array|undefined>} The contents of the file as an Uint8Array.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {TypeError} When the file path is not a non-empty string.
|
||||
*/
|
||||
bytes(filePath: string | URL): Promise<Uint8Array | undefined>;
|
||||
/**
|
||||
* Writes the given data to the given file. Creates any necessary directories along the way.
|
||||
* If the data is a string, UTF-8 encoding is used.
|
||||
* @param {string|URL} filePath The file to write.
|
||||
* @param {string|ArrayBuffer|ArrayBufferView} contents The data to write.
|
||||
* @returns {Promise<void>} A promise that resolves when the file is written.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {TypeError} When the file path is not a non-empty string.
|
||||
*/
|
||||
write(filePath: string | URL, contents: string | ArrayBuffer | ArrayBufferView): Promise<void>;
|
||||
/**
|
||||
* Appends the given data to the given file. Creates any necessary directories along the way.
|
||||
* If the data is a string, UTF-8 encoding is used.
|
||||
* @param {string|URL} filePath The file to append to.
|
||||
* @param {string|ArrayBuffer|ArrayBufferView} contents The data to append.
|
||||
* @returns {Promise<void>} A promise that resolves when the file is appended to.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {TypeError} When the file path is not a non-empty string.
|
||||
* @throws {TypeError} When the file contents are not a string or ArrayBuffer.
|
||||
* @throws {Error} When the file cannot be appended to.
|
||||
*/
|
||||
append(filePath: string | URL, contents: string | ArrayBuffer | ArrayBufferView): Promise<void>;
|
||||
/**
|
||||
* Determines if the given file exists.
|
||||
* @param {string|URL} filePath The file to check.
|
||||
* @returns {Promise<boolean>} True if the file exists.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {TypeError} When the file path is not a non-empty string.
|
||||
*/
|
||||
isFile(filePath: string | URL): Promise<boolean>;
|
||||
/**
|
||||
* Determines if the given directory exists.
|
||||
* @param {string|URL} dirPath The directory to check.
|
||||
* @returns {Promise<boolean>} True if the directory exists.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {TypeError} When the directory path is not a non-empty string.
|
||||
*/
|
||||
isDirectory(dirPath: string | URL): Promise<boolean>;
|
||||
/**
|
||||
* Creates the given directory.
|
||||
* @param {string|URL} dirPath The directory to create.
|
||||
* @returns {Promise<void>} A promise that resolves when the directory is created.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {TypeError} When the directory path is not a non-empty string.
|
||||
*/
|
||||
createDirectory(dirPath: string | URL): Promise<void>;
|
||||
/**
|
||||
* Deletes the given file or empty directory.
|
||||
* @param {string|URL} filePath The file to delete.
|
||||
* @returns {Promise<boolean>} A promise that resolves when the file or
|
||||
* directory is deleted, true if the file or directory is deleted, false
|
||||
* if the file or directory does not exist.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {TypeError} When the file path is not a non-empty string.
|
||||
*/
|
||||
delete(filePath: string | URL): Promise<boolean>;
|
||||
/**
|
||||
* Deletes the given file or directory recursively.
|
||||
* @param {string|URL} dirPath The directory to delete.
|
||||
* @returns {Promise<boolean>} A promise that resolves when the file or
|
||||
* directory is deleted, true if the file or directory is deleted, false
|
||||
* if the file or directory does not exist.
|
||||
* @throws {NoSuchMethodError} When the method does not exist on the current implementation.
|
||||
* @throws {TypeError} When the directory path is not a non-empty string.
|
||||
*/
|
||||
deleteAll(dirPath: string | URL): Promise<boolean>;
|
||||
/**
|
||||
* Returns a list of directory entries for the given path.
|
||||
* @param {string|URL} dirPath The path to the directory to read.
|
||||
* @returns {AsyncIterable<HfsDirectoryEntry>} A promise that resolves with the
|
||||
* directory entries.
|
||||
* @throws {TypeError} If the directory path is not a string or URL.
|
||||
* @throws {Error} If the directory cannot be read.
|
||||
*/
|
||||
list(dirPath: string | URL): AsyncIterable<HfsDirectoryEntry>;
|
||||
/**
|
||||
* Walks a directory using a depth-first traversal and returns the entries
|
||||
* from the traversal.
|
||||
* @param {string|URL} dirPath The path to the directory to walk.
|
||||
* @param {Object} [options] The options for the walk.
|
||||
* @param {(entry:HfsWalkEntry) => Promise<boolean>|boolean} [options.directoryFilter] A filter function to determine
|
||||
* if a directory's entries should be included in the walk.
|
||||
* @param {(entry:HfsWalkEntry) => Promise<boolean>|boolean} [options.entryFilter] A filter function to determine if
|
||||
* an entry should be included in the walk.
|
||||
* @returns {AsyncIterable<HfsWalkEntry>} A promise that resolves with the
|
||||
* directory entries.
|
||||
* @throws {TypeError} If the directory path is not a string or URL.
|
||||
* @throws {Error} If the directory cannot be read.
|
||||
*/
|
||||
walk(dirPath: string | URL, { directoryFilter, entryFilter }?: {
|
||||
directoryFilter?: (entry: HfsWalkEntry) => Promise<boolean> | boolean;
|
||||
entryFilter?: (entry: HfsWalkEntry) => Promise<boolean> | boolean;
|
||||
}): AsyncIterable<HfsWalkEntry>;
|
||||
/**
|
||||
* Returns the size of the given file.
|
||||
* @param {string|URL} filePath The path to the file to read.
|
||||
* @returns {Promise<number>} A promise that resolves with the size of the file.
|
||||
* @throws {TypeError} If the file path is not a string or URL.
|
||||
* @throws {Error} If the file cannot be read.
|
||||
*/
|
||||
size(filePath: string | URL): Promise<number>;
|
||||
/**
|
||||
* Returns the last modified timestamp of the given file or directory.
|
||||
* @param {string|URL} fileOrDirPath The path to the file or directory.
|
||||
* @returns {Promise<Date|undefined>} A promise that resolves with the last modified date
|
||||
* or undefined if the file or directory does not exist.
|
||||
* @throws {TypeError} If the path is not a string or URL.
|
||||
*/
|
||||
lastModified(fileOrDirPath: string | URL): Promise<Date | undefined>;
|
||||
/**
|
||||
* Copys a file from one location to another.
|
||||
* @param {string|URL} source The path to the file to copy.
|
||||
* @param {string|URL} destination The path to the new file.
|
||||
* @returns {Promise<void>} A promise that resolves when the file is copied.
|
||||
* @throws {TypeError} If the file path is not a string or URL.
|
||||
* @throws {Error} If the file cannot be copied.
|
||||
*/
|
||||
copy(source: string | URL, destination: string | URL): Promise<void>;
|
||||
/**
|
||||
* Copies a file or directory from one location to another.
|
||||
* @param {string|URL} source The path to the file or directory to copy.
|
||||
* @param {string|URL} destination The path to copy the file or directory to.
|
||||
* @returns {Promise<void>} A promise that resolves when the file or directory is
|
||||
* copied.
|
||||
* @throws {TypeError} If the directory path is not a string or URL.
|
||||
* @throws {Error} If the directory cannot be copied.
|
||||
*/
|
||||
copyAll(source: string | URL, destination: string | URL): Promise<void>;
|
||||
/**
|
||||
* Moves a file from the source path to the destination path.
|
||||
* @param {string|URL} source The location of the file to move.
|
||||
* @param {string|URL} destination The destination of the file to move.
|
||||
* @returns {Promise<void>} A promise that resolves when the move is complete.
|
||||
* @throws {TypeError} If the file or directory paths are not strings.
|
||||
* @throws {Error} If the file or directory cannot be moved.
|
||||
*/
|
||||
move(source: string | URL, destination: string | URL): Promise<void>;
|
||||
/**
|
||||
* Moves a file or directory from one location to another.
|
||||
* @param {string|URL} source The path to the file or directory to move.
|
||||
* @param {string|URL} destination The path to move the file or directory to.
|
||||
* @returns {Promise<void>} A promise that resolves when the file or directory is
|
||||
* moved.
|
||||
* @throws {TypeError} If the source is not a string or URL.
|
||||
* @throws {TypeError} If the destination is not a string or URL.
|
||||
* @throws {Error} If the file or directory cannot be moved.
|
||||
*/
|
||||
moveAll(source: string | URL, destination: string | URL): Promise<void>;
|
||||
#private;
|
||||
}
|
||||
export type HfsImpl = import("@humanfs/types").HfsImpl;
|
||||
export type HfsDirectoryEntry = import("@humanfs/types").HfsDirectoryEntry;
|
||||
export type HfsWalkEntry = import("@humanfs/types").HfsWalkEntry;
|
||||
@@ -0,0 +1,27 @@
|
||||
if (typeof Object.create === 'function') {
|
||||
// implementation from standard node.js 'util' module
|
||||
module.exports = function inherits(ctor, superCtor) {
|
||||
if (superCtor) {
|
||||
ctor.super_ = superCtor
|
||||
ctor.prototype = Object.create(superCtor.prototype, {
|
||||
constructor: {
|
||||
value: ctor,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
} else {
|
||||
// old school shim for old browsers
|
||||
module.exports = function inherits(ctor, superCtor) {
|
||||
if (superCtor) {
|
||||
ctor.super_ = superCtor
|
||||
var TempCtor = function () {}
|
||||
TempCtor.prototype = superCtor.prototype
|
||||
ctor.prototype = new TempCtor()
|
||||
ctor.prototype.constructor = ctor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_removalHooks","require","_cache","_replacement","_index","_t","_modification","_context","getBindingIdentifiers","remove","_this$opts","_assertUnremoved","call","resync","_callRemovalHooks","_markRemoved","opts","noScope","_removeFromScope","shareCommentsWithSiblings","_remove","bindings","node","Object","keys","forEach","name","scope","removeBinding","parentPath","fn","hooks","Array","isArray","container","splice","key","updateSiblingKeys","_replaceWith","_traverseFlags","SHOULD_SKIP","REMOVED","parent","getCachedPaths","hub","delete","removed","buildCodeFrameError"],"sources":["../../src/path/removal.ts"],"sourcesContent":["// This file contains methods responsible for removing a node.\n\nimport { hooks } from \"./lib/removal-hooks.ts\";\nimport { getCachedPaths } from \"../cache.ts\";\nimport { _replaceWith } from \"./replacement.ts\";\nimport type NodePath from \"./index.ts\";\nimport { REMOVED, SHOULD_SKIP } from \"./index.ts\";\nimport { getBindingIdentifiers } from \"@babel/types\";\nimport { updateSiblingKeys } from \"./modification.ts\";\nimport { resync } from \"./context.ts\";\n\nexport function remove(this: NodePath) {\n _assertUnremoved.call(this);\n\n resync.call(this);\n\n if (_callRemovalHooks.call(this)) {\n _markRemoved.call(this);\n return;\n }\n\n if (!this.opts?.noScope) {\n _removeFromScope.call(this);\n }\n\n this.shareCommentsWithSiblings();\n _remove.call(this);\n _markRemoved.call(this);\n}\n\nexport function _removeFromScope(this: NodePath) {\n const bindings = getBindingIdentifiers(this.node, false, false, true);\n Object.keys(bindings).forEach(name => this.scope.removeBinding(name));\n}\n\nexport function _callRemovalHooks(this: NodePath) {\n if (this.parentPath) {\n for (const fn of hooks) {\n if (fn(this, this.parentPath)) return true;\n }\n }\n}\n\nexport function _remove(this: NodePath) {\n if (Array.isArray(this.container)) {\n this.container.splice(this.key as number, 1);\n updateSiblingKeys.call(this, this.key as number, -1);\n } else {\n _replaceWith.call(this, null);\n }\n}\n\nexport function _markRemoved(this: NodePath) {\n // this.shouldSkip = true; this.removed = true;\n this._traverseFlags |= SHOULD_SKIP | REMOVED;\n if (this.parent) {\n getCachedPaths(this.hub, this.parent).delete(this.node);\n }\n this.node = null;\n}\n\nexport function _assertUnremoved(this: NodePath) {\n if (this.removed) {\n throw this.buildCodeFrameError(\n \"NodePath has been removed so is read-only.\",\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAsC;EAF7BO;AAAqB,IAAAH,EAAA;AAIvB,SAASI,MAAMA,CAAA,EAAiB;EAAA,IAAAC,UAAA;EACrCC,gBAAgB,CAACC,IAAI,CAAC,IAAI,CAAC;EAE3BC,eAAM,CAACD,IAAI,CAAC,IAAI,CAAC;EAEjB,IAAIE,iBAAiB,CAACF,IAAI,CAAC,IAAI,CAAC,EAAE;IAChCG,YAAY,CAACH,IAAI,CAAC,IAAI,CAAC;IACvB;EACF;EAEA,IAAI,GAAAF,UAAA,GAAC,IAAI,CAACM,IAAI,aAATN,UAAA,CAAWO,OAAO,GAAE;IACvBC,gBAAgB,CAACN,IAAI,CAAC,IAAI,CAAC;EAC7B;EAEA,IAAI,CAACO,yBAAyB,CAAC,CAAC;EAChCC,OAAO,CAACR,IAAI,CAAC,IAAI,CAAC;EAClBG,YAAY,CAACH,IAAI,CAAC,IAAI,CAAC;AACzB;AAEO,SAASM,gBAAgBA,CAAA,EAAiB;EAC/C,MAAMG,QAAQ,GAAGb,qBAAqB,CAAC,IAAI,CAACc,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC;EACrEC,MAAM,CAACC,IAAI,CAACH,QAAQ,CAAC,CAACI,OAAO,CAACC,IAAI,IAAI,IAAI,CAACC,KAAK,CAACC,aAAa,CAACF,IAAI,CAAC,CAAC;AACvE;AAEO,SAASZ,iBAAiBA,CAAA,EAAiB;EAChD,IAAI,IAAI,CAACe,UAAU,EAAE;IACnB,KAAK,MAAMC,EAAE,IAAIC,mBAAK,EAAE;MACtB,IAAID,EAAE,CAAC,IAAI,EAAE,IAAI,CAACD,UAAU,CAAC,EAAE,OAAO,IAAI;IAC5C;EACF;AACF;AAEO,SAAST,OAAOA,CAAA,EAAiB;EACtC,IAAIY,KAAK,CAACC,OAAO,CAAC,IAAI,CAACC,SAAS,CAAC,EAAE;IACjC,IAAI,CAACA,SAAS,CAACC,MAAM,CAAC,IAAI,CAACC,GAAG,EAAY,CAAC,CAAC;IAC5CC,+BAAiB,CAACzB,IAAI,CAAC,IAAI,EAAE,IAAI,CAACwB,GAAG,EAAY,CAAC,CAAC,CAAC;EACtD,CAAC,MAAM;IACLE,yBAAY,CAAC1B,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;EAC/B;AACF;AAEO,SAASG,YAAYA,CAAA,EAAiB;EAE3C,IAAI,CAACwB,cAAc,IAAIC,kBAAW,GAAGC,cAAO;EAC5C,IAAI,IAAI,CAACC,MAAM,EAAE;IACf,IAAAC,qBAAc,EAAC,IAAI,CAACC,GAAG,EAAE,IAAI,CAACF,MAAM,CAAC,CAACG,MAAM,CAAC,IAAI,CAACvB,IAAI,CAAC;EACzD;EACA,IAAI,CAACA,IAAI,GAAG,IAAI;AAClB;AAEO,SAASX,gBAAgBA,CAAA,EAAiB;EAC/C,IAAI,IAAI,CAACmC,OAAO,EAAE;IAChB,MAAM,IAAI,CAACC,mBAAmB,CAC5B,4CACF,CAAC;EACH;AACF","ignoreList":[]}
|
||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Feross Aboukhadijeh, and other contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,25 @@
|
||||
(MIT License)
|
||||
|
||||
Copyright (c) 2013 [Ramesh Nair](http://www.hiddentao.com/)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @fileoverview `ConfigArray` class.
|
||||
* @author Toru Nagashima <https://github.com/mysticatea>
|
||||
*/
|
||||
|
||||
import { ConfigArray, getUsedExtractedConfigs } from "./config-array.js";
|
||||
import { ConfigDependency } from "./config-dependency.js";
|
||||
import { ExtractedConfig } from "./extracted-config.js";
|
||||
import { IgnorePattern } from "./ignore-pattern.js";
|
||||
import { OverrideTester } from "./override-tester.js";
|
||||
|
||||
export {
|
||||
ConfigArray,
|
||||
ConfigDependency,
|
||||
ExtractedConfig,
|
||||
IgnorePattern,
|
||||
OverrideTester,
|
||||
getUsedExtractedConfigs
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./cjs/react-dom.react-server.production.js');
|
||||
} else {
|
||||
module.exports = require('./cjs/react-dom.react-server.development.js');
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"2":"0 9 C L M G N O P Q 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","450":"H R S T U V W X"},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:{"2":"0 1 2 3 4 5 6 7 8 9 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 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","450":"H R S T U V W X"},E:{"2":"J PB K D E F A B C L M G sC SC tC uC 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"},F:{"2":"0 1 2 3 4 5 6 7 8 F B C 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 wB xB yB zB 0B 1B 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 4C 5C 6C 7C FC kC 8C GC","450":"2B 3B 4B 5B 6B 7B 8B 9B AC"},G:{"2":"E SC 9C lC AD BD CD 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"},H:{"2":"WD"},I:{"2":"LC J I XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"2":"A B C H FC kC GC"},L:{"257":"I"},M:{"2":"EC"},N:{"2":"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:{"1":"pD"},S:{"2":"qD rD"}},B:7,C:"Web NFC",D:true};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Copyright 2009-2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE.txt or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;
|
||||
exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
|
||||
exports.SourceNode = require('./lib/source-node').SourceNode;
|
||||
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
* react-router v7.5.0
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
import {
|
||||
FrameworkContext,
|
||||
RemixErrorBoundary,
|
||||
RouterProvider,
|
||||
createBrowserHistory,
|
||||
createClientRoutes,
|
||||
createClientRoutesWithHMRRevalidationOptOut,
|
||||
createRouter,
|
||||
decodeViaTurboStream,
|
||||
deserializeErrors,
|
||||
getPatchRoutesOnNavigationFunction,
|
||||
getSingleFetchDataStrategy,
|
||||
invariant,
|
||||
mapRouteProperties,
|
||||
matchRoutes,
|
||||
shouldHydrateRouteLoader,
|
||||
useFogOFWarDiscovery
|
||||
} from "./chunk-KNED5TY2.mjs";
|
||||
|
||||
// lib/dom-export/dom-router-provider.tsx
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
function RouterProvider2(props) {
|
||||
return /* @__PURE__ */ React.createElement(RouterProvider, { flushSync: ReactDOM.flushSync, ...props });
|
||||
}
|
||||
|
||||
// lib/dom-export/hydrated-router.tsx
|
||||
import * as React2 from "react";
|
||||
var ssrInfo = null;
|
||||
var router = null;
|
||||
function initSsrInfo() {
|
||||
if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {
|
||||
if (window.__reactRouterManifest.sri === true) {
|
||||
const importMap = document.querySelector("script[rr-importmap]");
|
||||
if (importMap?.textContent) {
|
||||
try {
|
||||
window.__reactRouterManifest.sri = JSON.parse(
|
||||
importMap.textContent
|
||||
).integrity;
|
||||
} catch (err) {
|
||||
console.error("Failed to parse import map", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
ssrInfo = {
|
||||
context: window.__reactRouterContext,
|
||||
manifest: window.__reactRouterManifest,
|
||||
routeModules: window.__reactRouterRouteModules,
|
||||
stateDecodingPromise: void 0,
|
||||
router: void 0,
|
||||
routerInitialized: false
|
||||
};
|
||||
}
|
||||
}
|
||||
function createHydratedRouter({
|
||||
unstable_getContext
|
||||
}) {
|
||||
initSsrInfo();
|
||||
if (!ssrInfo) {
|
||||
throw new Error(
|
||||
"You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`"
|
||||
);
|
||||
}
|
||||
let localSsrInfo = ssrInfo;
|
||||
if (!ssrInfo.stateDecodingPromise) {
|
||||
let stream = ssrInfo.context.stream;
|
||||
invariant(stream, "No stream found for single fetch decoding");
|
||||
ssrInfo.context.stream = void 0;
|
||||
ssrInfo.stateDecodingPromise = decodeViaTurboStream(stream, window).then((value) => {
|
||||
ssrInfo.context.state = value.value;
|
||||
localSsrInfo.stateDecodingPromise.value = true;
|
||||
}).catch((e) => {
|
||||
localSsrInfo.stateDecodingPromise.error = e;
|
||||
});
|
||||
}
|
||||
if (ssrInfo.stateDecodingPromise.error) {
|
||||
throw ssrInfo.stateDecodingPromise.error;
|
||||
}
|
||||
if (!ssrInfo.stateDecodingPromise.value) {
|
||||
throw ssrInfo.stateDecodingPromise;
|
||||
}
|
||||
let routes = createClientRoutes(
|
||||
ssrInfo.manifest.routes,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.state,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
let hydrationData = void 0;
|
||||
let loaderData = ssrInfo.context.state.loaderData;
|
||||
if (ssrInfo.context.isSpaMode) {
|
||||
if (ssrInfo.manifest.routes.root?.hasLoader && loaderData && "root" in loaderData) {
|
||||
hydrationData = {
|
||||
loaderData: {
|
||||
root: loaderData.root
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
hydrationData = {
|
||||
...ssrInfo.context.state,
|
||||
loaderData: { ...loaderData }
|
||||
};
|
||||
let initialMatches = matchRoutes(
|
||||
routes,
|
||||
window.location,
|
||||
window.__reactRouterContext?.basename
|
||||
);
|
||||
if (initialMatches) {
|
||||
for (let match of initialMatches) {
|
||||
let routeId = match.route.id;
|
||||
let route = ssrInfo.routeModules[routeId];
|
||||
let manifestRoute = ssrInfo.manifest.routes[routeId];
|
||||
if (route && manifestRoute && shouldHydrateRouteLoader(
|
||||
manifestRoute,
|
||||
route,
|
||||
ssrInfo.context.isSpaMode
|
||||
) && (route.HydrateFallback || !manifestRoute.hasLoader)) {
|
||||
delete hydrationData.loaderData[routeId];
|
||||
} else if (manifestRoute && !manifestRoute.hasLoader) {
|
||||
hydrationData.loaderData[routeId] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hydrationData && hydrationData.errors) {
|
||||
hydrationData.errors = deserializeErrors(hydrationData.errors);
|
||||
}
|
||||
}
|
||||
let router2 = createRouter({
|
||||
routes,
|
||||
history: createBrowserHistory(),
|
||||
basename: ssrInfo.context.basename,
|
||||
unstable_getContext,
|
||||
hydrationData,
|
||||
mapRouteProperties,
|
||||
future: {
|
||||
unstable_middleware: ssrInfo.context.future.unstable_middleware
|
||||
},
|
||||
dataStrategy: getSingleFetchDataStrategy(
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.basename,
|
||||
() => router2
|
||||
),
|
||||
patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction(
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.isSpaMode,
|
||||
ssrInfo.context.basename
|
||||
)
|
||||
});
|
||||
ssrInfo.router = router2;
|
||||
if (router2.state.initialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
router2.initialize();
|
||||
}
|
||||
router2.createRoutesForHMR = /* spacer so ts-ignore does not affect the right hand of the assignment */
|
||||
createClientRoutesWithHMRRevalidationOptOut;
|
||||
window.__reactRouterDataRouter = router2;
|
||||
return router2;
|
||||
}
|
||||
function HydratedRouter(props) {
|
||||
if (!router) {
|
||||
router = createHydratedRouter({
|
||||
unstable_getContext: props.unstable_getContext
|
||||
});
|
||||
}
|
||||
let [criticalCss, setCriticalCss] = React2.useState(
|
||||
process.env.NODE_ENV === "development" ? ssrInfo?.context.criticalCss : void 0
|
||||
);
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
if (ssrInfo) {
|
||||
window.__reactRouterClearCriticalCss = () => setCriticalCss(void 0);
|
||||
}
|
||||
}
|
||||
let [location, setLocation] = React2.useState(router.state.location);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
ssrInfo.router.initialize();
|
||||
}
|
||||
}, []);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router) {
|
||||
return ssrInfo.router.subscribe((newState) => {
|
||||
if (newState.location !== location) {
|
||||
setLocation(newState.location);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [location]);
|
||||
invariant(ssrInfo, "ssrInfo unavailable for HydratedRouter");
|
||||
useFogOFWarDiscovery(
|
||||
router,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
return (
|
||||
// This fragment is important to ensure we match the <ServerRouter> JSX
|
||||
// structure so that useId values hydrate correctly
|
||||
/* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
||||
FrameworkContext.Provider,
|
||||
{
|
||||
value: {
|
||||
manifest: ssrInfo.manifest,
|
||||
routeModules: ssrInfo.routeModules,
|
||||
future: ssrInfo.context.future,
|
||||
criticalCss,
|
||||
ssr: ssrInfo.context.ssr,
|
||||
isSpaMode: ssrInfo.context.isSpaMode
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ React2.createElement(RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(RouterProvider2, { router }))
|
||||
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
|
||||
);
|
||||
}
|
||||
export {
|
||||
HydratedRouter,
|
||||
RouterProvider2 as RouterProvider
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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","2":"C L M G N O P Q H R S T U V W X Y Z a b c d e"},C:{"1":"0 9 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","2":"1 2 3 4 5 6 7 8 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 qC rC"},D:{"1":"0 9 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","2":"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 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"},E:{"1":"G 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","2":"J PB K D E F A B C L M sC SC tC uC vC wC TC FC GC xC yC"},F:{"1":"0 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","2":"1 2 3 4 5 6 7 8 F B C 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 wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 JC KC nD","2":"J dD eD fD gD hD TC iD jD kD lD mD IC"},Q:{"16":"oD"},R:{"16":"pD"},S:{"2":"qD","16":"rD"}},B:5,C:"WebAssembly Reference Types",D:true};
|
||||
Reference in New Issue
Block a user