update
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = pathToPattern;
|
||||
function _path() {
|
||||
const data = require("path");
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
const sep = `\\${_path().sep}`;
|
||||
const endSep = `(?:${sep}|$)`;
|
||||
const substitution = `[^${sep}]+`;
|
||||
const starPat = `(?:${substitution}${sep})`;
|
||||
const starPatLast = `(?:${substitution}${endSep})`;
|
||||
const starStarPat = `${starPat}*?`;
|
||||
const starStarPatLast = `${starPat}*?${starPatLast}?`;
|
||||
function escapeRegExp(string) {
|
||||
return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
|
||||
}
|
||||
function pathToPattern(pattern, dirname) {
|
||||
const parts = _path().resolve(dirname, pattern).split(_path().sep);
|
||||
return new RegExp(["^", ...parts.map((part, i) => {
|
||||
const last = i === parts.length - 1;
|
||||
if (part === "**") return last ? starStarPatLast : starStarPat;
|
||||
if (part === "*") return last ? starPatLast : starPat;
|
||||
if (part.indexOf("*.") === 0) {
|
||||
return substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep);
|
||||
}
|
||||
return escapeRegExp(part) + (last ? endSep : sep);
|
||||
})].join(""));
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=pattern-to-regex.js.map
|
||||
@@ -0,0 +1,324 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v4.39.0
|
||||
Wed, 02 Apr 2025 04:49:00 GMT - commit 5c001245779063abac3899aa9d25294ab003581b
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
|
||||
Released under the MIT License.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
|
||||
const rollup = require('./rollup.js');
|
||||
const path = require('node:path');
|
||||
const process = require('node:process');
|
||||
const index = require('./index.js');
|
||||
const node_os = require('node:os');
|
||||
require('./parseAst.js');
|
||||
require('../native.js');
|
||||
require('path');
|
||||
require('node:perf_hooks');
|
||||
require('node:fs/promises');
|
||||
require('util');
|
||||
require('fs');
|
||||
require('stream');
|
||||
require('os');
|
||||
require('./fsevents-importer.js');
|
||||
require('events');
|
||||
|
||||
class FileWatcher {
|
||||
constructor(task, chokidarOptions) {
|
||||
this.transformWatchers = new Map();
|
||||
this.chokidarOptions = chokidarOptions;
|
||||
this.task = task;
|
||||
this.watcher = this.createWatcher(null);
|
||||
}
|
||||
close() {
|
||||
this.watcher.close();
|
||||
for (const watcher of this.transformWatchers.values()) {
|
||||
watcher.close();
|
||||
}
|
||||
}
|
||||
unwatch(id) {
|
||||
this.watcher.unwatch(id);
|
||||
const transformWatcher = this.transformWatchers.get(id);
|
||||
if (transformWatcher) {
|
||||
this.transformWatchers.delete(id);
|
||||
transformWatcher.close();
|
||||
}
|
||||
}
|
||||
watch(id, isTransformDependency) {
|
||||
if (isTransformDependency) {
|
||||
const watcher = this.transformWatchers.get(id) ?? this.createWatcher(id);
|
||||
watcher.add(id);
|
||||
this.transformWatchers.set(id, watcher);
|
||||
}
|
||||
else {
|
||||
this.watcher.add(id);
|
||||
}
|
||||
}
|
||||
createWatcher(transformWatcherId) {
|
||||
const task = this.task;
|
||||
const isLinux = node_os.platform() === 'linux';
|
||||
const isFreeBSD = node_os.platform() === 'freebsd';
|
||||
const isTransformDependency = transformWatcherId !== null;
|
||||
const handleChange = (id, event) => {
|
||||
const changedId = transformWatcherId || id;
|
||||
if (isLinux || isFreeBSD) {
|
||||
// unwatching and watching fixes an issue with chokidar where on certain systems,
|
||||
// a file that was unlinked and immediately recreated would create a change event
|
||||
// but then no longer any further events
|
||||
watcher.unwatch(changedId);
|
||||
watcher.add(changedId);
|
||||
}
|
||||
task.invalidate(changedId, { event, isTransformDependency });
|
||||
};
|
||||
const watcher = index.chokidar
|
||||
.watch([], this.chokidarOptions)
|
||||
.on('add', id => handleChange(id, 'create'))
|
||||
.on('change', id => handleChange(id, 'update'))
|
||||
.on('unlink', id => handleChange(id, 'delete'));
|
||||
return watcher;
|
||||
}
|
||||
}
|
||||
|
||||
const eventsRewrites = {
|
||||
create: {
|
||||
create: 'buggy',
|
||||
delete: null, //delete file from map
|
||||
update: 'create'
|
||||
},
|
||||
delete: {
|
||||
create: 'update',
|
||||
delete: 'buggy',
|
||||
update: 'buggy'
|
||||
},
|
||||
update: {
|
||||
create: 'buggy',
|
||||
delete: 'delete',
|
||||
update: 'update'
|
||||
}
|
||||
};
|
||||
class Watcher {
|
||||
constructor(optionsList, emitter) {
|
||||
this.buildDelay = 0;
|
||||
this.buildTimeout = null;
|
||||
this.closed = false;
|
||||
this.invalidatedIds = new Map();
|
||||
this.rerun = false;
|
||||
this.running = true;
|
||||
this.emitter = emitter;
|
||||
emitter.close = this.close.bind(this);
|
||||
this.tasks = optionsList.map(options => new Task(this, options));
|
||||
for (const { watch } of optionsList) {
|
||||
if (watch && typeof watch.buildDelay === 'number') {
|
||||
this.buildDelay = Math.max(this.buildDelay, watch.buildDelay);
|
||||
}
|
||||
}
|
||||
process.nextTick(() => this.run());
|
||||
}
|
||||
async close() {
|
||||
if (this.closed)
|
||||
return;
|
||||
this.closed = true;
|
||||
if (this.buildTimeout)
|
||||
clearTimeout(this.buildTimeout);
|
||||
for (const task of this.tasks) {
|
||||
task.close();
|
||||
}
|
||||
await this.emitter.emit('close');
|
||||
this.emitter.removeAllListeners();
|
||||
}
|
||||
invalidate(file) {
|
||||
if (file) {
|
||||
const previousEvent = this.invalidatedIds.get(file.id);
|
||||
const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event;
|
||||
if (event === 'buggy') {
|
||||
//TODO: throws or warn? Currently just ignore, uses new event
|
||||
this.invalidatedIds.set(file.id, file.event);
|
||||
}
|
||||
else if (event === null) {
|
||||
this.invalidatedIds.delete(file.id);
|
||||
}
|
||||
else {
|
||||
this.invalidatedIds.set(file.id, event);
|
||||
}
|
||||
}
|
||||
if (this.running) {
|
||||
this.rerun = true;
|
||||
return;
|
||||
}
|
||||
if (this.buildTimeout)
|
||||
clearTimeout(this.buildTimeout);
|
||||
this.buildTimeout = setTimeout(async () => {
|
||||
this.buildTimeout = null;
|
||||
try {
|
||||
await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event })));
|
||||
this.invalidatedIds.clear();
|
||||
await this.emitter.emit('restart');
|
||||
this.emitter.removeListenersForCurrentRun();
|
||||
this.run();
|
||||
}
|
||||
catch (error) {
|
||||
this.invalidatedIds.clear();
|
||||
await this.emitter.emit('event', {
|
||||
code: 'ERROR',
|
||||
error,
|
||||
result: null
|
||||
});
|
||||
await this.emitter.emit('event', {
|
||||
code: 'END'
|
||||
});
|
||||
}
|
||||
}, this.buildDelay);
|
||||
}
|
||||
async run() {
|
||||
this.running = true;
|
||||
await this.emitter.emit('event', {
|
||||
code: 'START'
|
||||
});
|
||||
for (const task of this.tasks) {
|
||||
await task.run();
|
||||
}
|
||||
this.running = false;
|
||||
await this.emitter.emit('event', {
|
||||
code: 'END'
|
||||
});
|
||||
if (this.rerun) {
|
||||
this.rerun = false;
|
||||
this.invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
class Task {
|
||||
constructor(watcher, options) {
|
||||
this.cache = { modules: [] };
|
||||
this.watchFiles = [];
|
||||
this.closed = false;
|
||||
this.invalidated = true;
|
||||
this.watched = new Set();
|
||||
this.watcher = watcher;
|
||||
this.options = options;
|
||||
this.skipWrite = Boolean(options.watch && options.watch.skipWrite);
|
||||
this.outputs = this.options.output;
|
||||
this.outputFiles = this.outputs.map(output => {
|
||||
if (output.file || output.dir)
|
||||
return path.resolve(output.file || output.dir);
|
||||
return undefined;
|
||||
});
|
||||
this.watchOptions = this.options.watch || {};
|
||||
this.filter = rollup.createFilter(this.watchOptions.include, this.watchOptions.exclude);
|
||||
this.fileWatcher = new FileWatcher(this, {
|
||||
...this.watchOptions.chokidar,
|
||||
disableGlobbing: true,
|
||||
ignoreInitial: true
|
||||
});
|
||||
}
|
||||
close() {
|
||||
this.closed = true;
|
||||
this.fileWatcher.close();
|
||||
}
|
||||
invalidate(id, details) {
|
||||
this.invalidated = true;
|
||||
if (details.isTransformDependency) {
|
||||
for (const module of this.cache.modules) {
|
||||
if (!module.transformDependencies.includes(id))
|
||||
continue;
|
||||
// effective invalidation
|
||||
module.originalCode = null;
|
||||
}
|
||||
}
|
||||
this.watcher.invalidate({ event: details.event, id });
|
||||
this.watchOptions.onInvalidate?.(id);
|
||||
}
|
||||
async run() {
|
||||
if (!this.invalidated)
|
||||
return;
|
||||
this.invalidated = false;
|
||||
const options = {
|
||||
...this.options,
|
||||
cache: this.cache
|
||||
};
|
||||
const start = Date.now();
|
||||
await this.watcher.emitter.emit('event', {
|
||||
code: 'BUNDLE_START',
|
||||
input: this.options.input,
|
||||
output: this.outputFiles
|
||||
});
|
||||
let result = null;
|
||||
try {
|
||||
result = await rollup.rollupInternal(options, this.watcher.emitter);
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
this.updateWatchedFiles(result);
|
||||
if (!this.skipWrite) {
|
||||
await Promise.all(this.outputs.map(output => result.write(output)));
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
this.updateWatchedFiles(result);
|
||||
}
|
||||
await this.watcher.emitter.emit('event', {
|
||||
code: 'BUNDLE_END',
|
||||
duration: Date.now() - start,
|
||||
input: this.options.input,
|
||||
output: this.outputFiles,
|
||||
result
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
if (!this.closed) {
|
||||
if (Array.isArray(error.watchFiles)) {
|
||||
for (const id of error.watchFiles) {
|
||||
this.watchFile(id);
|
||||
}
|
||||
}
|
||||
if (error.id) {
|
||||
this.cache.modules = this.cache.modules.filter(module => module.id !== error.id);
|
||||
}
|
||||
}
|
||||
await this.watcher.emitter.emit('event', {
|
||||
code: 'ERROR',
|
||||
error,
|
||||
result
|
||||
});
|
||||
}
|
||||
}
|
||||
updateWatchedFiles(result) {
|
||||
const previouslyWatched = this.watched;
|
||||
this.watched = new Set();
|
||||
this.watchFiles = result.watchFiles;
|
||||
this.cache = result.cache;
|
||||
for (const id of this.watchFiles) {
|
||||
this.watchFile(id);
|
||||
}
|
||||
for (const module of this.cache.modules) {
|
||||
for (const depId of module.transformDependencies) {
|
||||
this.watchFile(depId, true);
|
||||
}
|
||||
}
|
||||
for (const id of previouslyWatched) {
|
||||
if (!this.watched.has(id)) {
|
||||
this.fileWatcher.unwatch(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
watchFile(id, isTransformDependency = false) {
|
||||
if (!this.filter(id))
|
||||
return;
|
||||
this.watched.add(id);
|
||||
if (this.outputFiles.includes(id)) {
|
||||
throw new Error('Cannot import the generated bundle');
|
||||
}
|
||||
// this is necessary to ensure that any 'renamed' files
|
||||
// continue to be watched following an error
|
||||
this.fileWatcher.watch(id, isTransformDependency);
|
||||
}
|
||||
}
|
||||
|
||||
exports.Task = Task;
|
||||
exports.Watcher = Watcher;
|
||||
//# sourceMappingURL=watch.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_identifier","require","_keyword"],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier.ts\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]}
|
||||
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"name": "@tanstack/react-router",
|
||||
"version": "1.114.34",
|
||||
"description": "Modern and scalable routing for React applications",
|
||||
"author": "Tanner Linsley",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/TanStack/router.git",
|
||||
"directory": "packages/react-router"
|
||||
},
|
||||
"homepage": "https://tanstack.com/router",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/tannerlinsley"
|
||||
},
|
||||
"keywords": [
|
||||
"react",
|
||||
"location",
|
||||
"router",
|
||||
"routing",
|
||||
"async",
|
||||
"async router",
|
||||
"typescript"
|
||||
],
|
||||
"type": "module",
|
||||
"types": "dist/esm/index.d.ts",
|
||||
"main": "dist/cjs/index.cjs",
|
||||
"module": "dist/esm/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/cjs/index.d.cts",
|
||||
"default": "./dist/cjs/index.cjs"
|
||||
}
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist",
|
||||
"src"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-store": "^0.7.0",
|
||||
"jsesc": "^3.1.0",
|
||||
"tiny-invariant": "^1.3.3",
|
||||
"tiny-warning": "^1.0.3",
|
||||
"@tanstack/history": "1.114.29",
|
||||
"@tanstack/router-core": "1.114.33"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/jest-dom": "^6.6.3",
|
||||
"@testing-library/react": "^16.2.0",
|
||||
"@types/jsesc": "^3.0.3",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"combinate": "^1.1.11",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=18.0.0 || >=19.0.0",
|
||||
"react-dom": ">=18.0.0 || >=19.0.0"
|
||||
},
|
||||
"scripts": {}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
const { EOL } = require('os')
|
||||
|
||||
const getFirstRegexpMatchOrDefault = (text, regexp, defaultValue) => {
|
||||
regexp.lastIndex = 0 // https://stackoverflow.com/a/11477448/4536543
|
||||
let match = regexp.exec(text)
|
||||
if (match !== null) {
|
||||
return match[1]
|
||||
} else {
|
||||
return defaultValue
|
||||
}
|
||||
}
|
||||
|
||||
const DEFAULT_INDENT = ' '
|
||||
const INDENT_REGEXP = /^([ \t]+)[^\s]/m
|
||||
|
||||
module.exports.detectIndent = text =>
|
||||
getFirstRegexpMatchOrDefault(text, INDENT_REGEXP, DEFAULT_INDENT)
|
||||
module.exports.DEFAULT_INDENT = DEFAULT_INDENT
|
||||
|
||||
const DEFAULT_EOL = EOL
|
||||
const EOL_REGEXP = /(\r\n|\n|\r)/g
|
||||
|
||||
module.exports.detectEOL = text =>
|
||||
getFirstRegexpMatchOrDefault(text, EOL_REGEXP, DEFAULT_EOL)
|
||||
module.exports.DEFAULT_EOL = DEFAULT_EOL
|
||||
@@ -0,0 +1,10 @@
|
||||
import { DeferredPromise } from '@tanstack/router-core';
|
||||
import * as React from 'react';
|
||||
export type AwaitOptions<T> = {
|
||||
promise: Promise<T>;
|
||||
};
|
||||
export declare function useAwaited<T>({ promise: _promise, }: AwaitOptions<T>): [T, DeferredPromise<T>];
|
||||
export declare function Await<T>(props: AwaitOptions<T> & {
|
||||
fallback?: React.ReactNode;
|
||||
children: (result: T) => React.ReactNode;
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"useLoaderDeps.cjs","sources":["../../src/useLoaderDeps.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseLoaderDeps,\n StrictOrFrom,\n UseLoaderDepsResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDepsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TSelected,\n TStructuralSharing,\n> {\n select?: (\n deps: ResolveUseLoaderDeps<TRouter, TFrom>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n}\n\nexport type UseLoaderDepsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TSelected,\n TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom> &\n UseLoaderDepsBaseOptions<TRouter, TFrom, TSelected, TStructuralSharing> &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseLoaderDepsRoute<out TId> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseLoaderDepsBaseOptions<TRouter, TId, TSelected, TStructuralSharing> &\n StructuralSharingOption<TRouter, TSelected, false>,\n) => UseLoaderDepsResult<TRouter, TId, TSelected>\n\nexport function useLoaderDeps<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts: UseLoaderDepsOptions<TRouter, TFrom, TSelected, TStructuralSharing>,\n): UseLoaderDepsResult<TRouter, TFrom, TSelected> {\n const { select, ...rest } = opts\n return useMatch({\n ...rest,\n select: (s) => {\n return select ? select(s.loaderDeps) : s.loaderDeps\n },\n }) as UseLoaderDepsResult<TRouter, TFrom, TSelected>\n}\n"],"names":["useMatch"],"mappings":";;;AA0CO,SAAS,cAMd,MACgD;AAChD,QAAM,EAAE,QAAQ,GAAG,KAAA,IAAS;AAC5B,SAAOA,kBAAS;AAAA,IACd,GAAG;AAAA,IACH,QAAQ,CAAC,MAAM;AACb,aAAO,SAAS,OAAO,EAAE,UAAU,IAAI,EAAE;AAAA,IAAA;AAAA,EAC3C,CACD;AACH;;"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A mC","164":"B"},B:{"1":"0 9 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","36":"C L M G N O P"},C:{"1":"0 9 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":"nC LC J PB K D E F A B C L M G N O qC rC","36":"1 2 3 4 5 6 7 8 P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB"},D:{"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 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 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"},E:{"1":"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 G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC"},F:{"1":"0 6 7 8 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":"1 2 3 4 5 F B C G N O P QB 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"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 SD UC VC HC TD IC WC XC YC"},H:{"2":"WD"},I:{"2":"LC J I 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","36":"B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD","16":"J"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:5,C:"Screen Orientation",D:true};
|
||||
@@ -0,0 +1,43 @@
|
||||
export declare const PDF_ROLE_TO_HTML_ROLE: {
|
||||
Document: null;
|
||||
DocumentFragment: null;
|
||||
Part: string;
|
||||
Sect: string;
|
||||
Div: string;
|
||||
Aside: string;
|
||||
NonStruct: string;
|
||||
P: null;
|
||||
H: string;
|
||||
Title: null;
|
||||
FENote: string;
|
||||
Sub: string;
|
||||
Lbl: null;
|
||||
Span: null;
|
||||
Em: null;
|
||||
Strong: null;
|
||||
Link: string;
|
||||
Annot: string;
|
||||
Form: string;
|
||||
Ruby: null;
|
||||
RB: null;
|
||||
RT: null;
|
||||
RP: null;
|
||||
Warichu: null;
|
||||
WT: null;
|
||||
WP: null;
|
||||
L: string;
|
||||
LI: string;
|
||||
LBody: null;
|
||||
Table: string;
|
||||
TR: string;
|
||||
TH: string;
|
||||
TD: string;
|
||||
THead: string;
|
||||
TBody: null;
|
||||
TFoot: null;
|
||||
Caption: null;
|
||||
Figure: string;
|
||||
Formula: null;
|
||||
Artifact: null;
|
||||
};
|
||||
export declare const HEADING_PATTERN: RegExp;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,108 @@
|
||||
{{# def.definitions }}
|
||||
{{# def.errors }}
|
||||
{{# def.missing }}
|
||||
{{# def.setupKeyword }}
|
||||
{{# def.$data }}
|
||||
|
||||
{{ var $vSchema = 'schema' + $lvl; }}
|
||||
|
||||
{{## def.setupLoop:
|
||||
{{? !$isData }}
|
||||
var {{=$vSchema}} = validate.schema{{=$schemaPath}};
|
||||
{{?}}
|
||||
|
||||
{{
|
||||
var $i = 'i' + $lvl
|
||||
, $propertyPath = 'schema' + $lvl + '[' + $i + ']'
|
||||
, $missingProperty = '\' + ' + $propertyPath + ' + \'';
|
||||
if (it.opts._errorDataPathProperty) {
|
||||
it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
|
||||
}
|
||||
}}
|
||||
#}}
|
||||
|
||||
|
||||
{{## def.isRequiredOwnProperty:
|
||||
Object.prototype.hasOwnProperty.call({{=$data}}, {{=$vSchema}}[{{=$i}}])
|
||||
#}}
|
||||
|
||||
|
||||
{{? !$isData }}
|
||||
{{? $schema.length < it.opts.loopRequired &&
|
||||
it.schema.properties && Object.keys(it.schema.properties).length }}
|
||||
{{ var $required = []; }}
|
||||
{{~ $schema:$property }}
|
||||
{{ var $propertySch = it.schema.properties[$property]; }}
|
||||
{{? !($propertySch && {{# def.nonEmptySchema:$propertySch}}) }}
|
||||
{{ $required[$required.length] = $property; }}
|
||||
{{?}}
|
||||
{{~}}
|
||||
{{??}}
|
||||
{{ var $required = $schema; }}
|
||||
{{?}}
|
||||
{{?}}
|
||||
|
||||
|
||||
{{? $isData || $required.length }}
|
||||
{{
|
||||
var $currentErrorPath = it.errorPath
|
||||
, $loopRequired = $isData || $required.length >= it.opts.loopRequired
|
||||
, $ownProperties = it.opts.ownProperties;
|
||||
}}
|
||||
|
||||
{{? $breakOnError }}
|
||||
var missing{{=$lvl}};
|
||||
{{? $loopRequired }}
|
||||
{{# def.setupLoop }}
|
||||
var {{=$valid}} = true;
|
||||
|
||||
{{?$isData}}{{# def.check$dataIsArray }}{{?}}
|
||||
|
||||
for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) {
|
||||
{{=$valid}} = {{=$data}}[{{=$vSchema}}[{{=$i}}]] !== undefined
|
||||
{{? $ownProperties }}
|
||||
&& {{# def.isRequiredOwnProperty }}
|
||||
{{?}};
|
||||
if (!{{=$valid}}) break;
|
||||
}
|
||||
|
||||
{{? $isData }} } {{?}}
|
||||
|
||||
{{# def.checkError:'required' }}
|
||||
else {
|
||||
{{??}}
|
||||
if ({{# def.checkMissingProperty:$required }}) {
|
||||
{{# def.errorMissingProperty:'required' }}
|
||||
} else {
|
||||
{{?}}
|
||||
{{??}}
|
||||
{{? $loopRequired }}
|
||||
{{# def.setupLoop }}
|
||||
{{? $isData }}
|
||||
if ({{=$vSchema}} && !Array.isArray({{=$vSchema}})) {
|
||||
{{# def.addError:'required' }}
|
||||
} else if ({{=$vSchema}} !== undefined) {
|
||||
{{?}}
|
||||
|
||||
for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) {
|
||||
if ({{=$data}}[{{=$vSchema}}[{{=$i}}]] === undefined
|
||||
{{? $ownProperties }}
|
||||
|| !{{# def.isRequiredOwnProperty }}
|
||||
{{?}}) {
|
||||
{{# def.addError:'required' }}
|
||||
}
|
||||
}
|
||||
|
||||
{{? $isData }} } {{?}}
|
||||
{{??}}
|
||||
{{~ $required:$propertyKey }}
|
||||
{{# def.allErrorsMissingProperty:'required' }}
|
||||
{{~}}
|
||||
{{?}}
|
||||
{{?}}
|
||||
|
||||
{{ it.errorPath = $currentErrorPath; }}
|
||||
|
||||
{{?? $breakOnError }}
|
||||
if (true) {
|
||||
{{?}}
|
||||
@@ -0,0 +1,239 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.parse = parse;
|
||||
exports.serialize = serialize;
|
||||
/**
|
||||
* RegExp to match cookie-name in RFC 6265 sec 4.1.1
|
||||
* This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
|
||||
* which has been replaced by the token definition in RFC 7230 appendix B.
|
||||
*
|
||||
* cookie-name = token
|
||||
* token = 1*tchar
|
||||
* tchar = "!" / "#" / "$" / "%" / "&" / "'" /
|
||||
* "*" / "+" / "-" / "." / "^" / "_" /
|
||||
* "`" / "|" / "~" / DIGIT / ALPHA
|
||||
*
|
||||
* Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191
|
||||
* Allow same range as cookie value, except `=`, which delimits end of name.
|
||||
*/
|
||||
const cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/;
|
||||
/**
|
||||
* RegExp to match cookie-value in RFC 6265 sec 4.1.1
|
||||
*
|
||||
* cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
|
||||
* cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
|
||||
* ; US-ASCII characters excluding CTLs,
|
||||
* ; whitespace DQUOTE, comma, semicolon,
|
||||
* ; and backslash
|
||||
*
|
||||
* Allowing more characters: https://github.com/jshttp/cookie/issues/191
|
||||
* Comma, backslash, and DQUOTE are not part of the parsing algorithm.
|
||||
*/
|
||||
const cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/;
|
||||
/**
|
||||
* RegExp to match domain-value in RFC 6265 sec 4.1.1
|
||||
*
|
||||
* domain-value = <subdomain>
|
||||
* ; defined in [RFC1034], Section 3.5, as
|
||||
* ; enhanced by [RFC1123], Section 2.1
|
||||
* <subdomain> = <label> | <subdomain> "." <label>
|
||||
* <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]
|
||||
* Labels must be 63 characters or less.
|
||||
* 'let-dig' not 'letter' in the first char, per RFC1123
|
||||
* <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>
|
||||
* <let-dig-hyp> = <let-dig> | "-"
|
||||
* <let-dig> = <letter> | <digit>
|
||||
* <letter> = any one of the 52 alphabetic characters A through Z in
|
||||
* upper case and a through z in lower case
|
||||
* <digit> = any one of the ten digits 0 through 9
|
||||
*
|
||||
* Keep support for leading dot: https://github.com/jshttp/cookie/issues/173
|
||||
*
|
||||
* > (Note that a leading %x2E ("."), if present, is ignored even though that
|
||||
* character is not permitted, but a trailing %x2E ("."), if present, will
|
||||
* cause the user agent to ignore the attribute.)
|
||||
*/
|
||||
const domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
|
||||
/**
|
||||
* RegExp to match path-value in RFC 6265 sec 4.1.1
|
||||
*
|
||||
* path-value = <any CHAR except CTLs or ";">
|
||||
* CHAR = %x01-7F
|
||||
* ; defined in RFC 5234 appendix B.1
|
||||
*/
|
||||
const pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
|
||||
const __toString = Object.prototype.toString;
|
||||
const NullObject = /* @__PURE__ */ (() => {
|
||||
const C = function () { };
|
||||
C.prototype = Object.create(null);
|
||||
return C;
|
||||
})();
|
||||
/**
|
||||
* Parse a cookie header.
|
||||
*
|
||||
* Parse the given cookie header string into an object
|
||||
* The object has the various cookies as keys(names) => values
|
||||
*/
|
||||
function parse(str, options) {
|
||||
const obj = new NullObject();
|
||||
const len = str.length;
|
||||
// RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.
|
||||
if (len < 2)
|
||||
return obj;
|
||||
const dec = options?.decode || decode;
|
||||
let index = 0;
|
||||
do {
|
||||
const eqIdx = str.indexOf("=", index);
|
||||
if (eqIdx === -1)
|
||||
break; // No more cookie pairs.
|
||||
const colonIdx = str.indexOf(";", index);
|
||||
const endIdx = colonIdx === -1 ? len : colonIdx;
|
||||
if (eqIdx > endIdx) {
|
||||
// backtrack on prior semicolon
|
||||
index = str.lastIndexOf(";", eqIdx - 1) + 1;
|
||||
continue;
|
||||
}
|
||||
const keyStartIdx = startIndex(str, index, eqIdx);
|
||||
const keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
|
||||
const key = str.slice(keyStartIdx, keyEndIdx);
|
||||
// only assign once
|
||||
if (obj[key] === undefined) {
|
||||
let valStartIdx = startIndex(str, eqIdx + 1, endIdx);
|
||||
let valEndIdx = endIndex(str, endIdx, valStartIdx);
|
||||
const value = dec(str.slice(valStartIdx, valEndIdx));
|
||||
obj[key] = value;
|
||||
}
|
||||
index = endIdx + 1;
|
||||
} while (index < len);
|
||||
return obj;
|
||||
}
|
||||
function startIndex(str, index, max) {
|
||||
do {
|
||||
const code = str.charCodeAt(index);
|
||||
if (code !== 0x20 /* */ && code !== 0x09 /* \t */)
|
||||
return index;
|
||||
} while (++index < max);
|
||||
return max;
|
||||
}
|
||||
function endIndex(str, index, min) {
|
||||
while (index > min) {
|
||||
const code = str.charCodeAt(--index);
|
||||
if (code !== 0x20 /* */ && code !== 0x09 /* \t */)
|
||||
return index + 1;
|
||||
}
|
||||
return min;
|
||||
}
|
||||
/**
|
||||
* Serialize data into a cookie header.
|
||||
*
|
||||
* Serialize a name value pair into a cookie string suitable for
|
||||
* http headers. An optional options object specifies cookie parameters.
|
||||
*
|
||||
* serialize('foo', 'bar', { httpOnly: true })
|
||||
* => "foo=bar; httpOnly"
|
||||
*/
|
||||
function serialize(name, val, options) {
|
||||
const enc = options?.encode || encodeURIComponent;
|
||||
if (!cookieNameRegExp.test(name)) {
|
||||
throw new TypeError(`argument name is invalid: ${name}`);
|
||||
}
|
||||
const value = enc(val);
|
||||
if (!cookieValueRegExp.test(value)) {
|
||||
throw new TypeError(`argument val is invalid: ${val}`);
|
||||
}
|
||||
let str = name + "=" + value;
|
||||
if (!options)
|
||||
return str;
|
||||
if (options.maxAge !== undefined) {
|
||||
if (!Number.isInteger(options.maxAge)) {
|
||||
throw new TypeError(`option maxAge is invalid: ${options.maxAge}`);
|
||||
}
|
||||
str += "; Max-Age=" + options.maxAge;
|
||||
}
|
||||
if (options.domain) {
|
||||
if (!domainValueRegExp.test(options.domain)) {
|
||||
throw new TypeError(`option domain is invalid: ${options.domain}`);
|
||||
}
|
||||
str += "; Domain=" + options.domain;
|
||||
}
|
||||
if (options.path) {
|
||||
if (!pathValueRegExp.test(options.path)) {
|
||||
throw new TypeError(`option path is invalid: ${options.path}`);
|
||||
}
|
||||
str += "; Path=" + options.path;
|
||||
}
|
||||
if (options.expires) {
|
||||
if (!isDate(options.expires) ||
|
||||
!Number.isFinite(options.expires.valueOf())) {
|
||||
throw new TypeError(`option expires is invalid: ${options.expires}`);
|
||||
}
|
||||
str += "; Expires=" + options.expires.toUTCString();
|
||||
}
|
||||
if (options.httpOnly) {
|
||||
str += "; HttpOnly";
|
||||
}
|
||||
if (options.secure) {
|
||||
str += "; Secure";
|
||||
}
|
||||
if (options.partitioned) {
|
||||
str += "; Partitioned";
|
||||
}
|
||||
if (options.priority) {
|
||||
const priority = typeof options.priority === "string"
|
||||
? options.priority.toLowerCase()
|
||||
: undefined;
|
||||
switch (priority) {
|
||||
case "low":
|
||||
str += "; Priority=Low";
|
||||
break;
|
||||
case "medium":
|
||||
str += "; Priority=Medium";
|
||||
break;
|
||||
case "high":
|
||||
str += "; Priority=High";
|
||||
break;
|
||||
default:
|
||||
throw new TypeError(`option priority is invalid: ${options.priority}`);
|
||||
}
|
||||
}
|
||||
if (options.sameSite) {
|
||||
const sameSite = typeof options.sameSite === "string"
|
||||
? options.sameSite.toLowerCase()
|
||||
: options.sameSite;
|
||||
switch (sameSite) {
|
||||
case true:
|
||||
case "strict":
|
||||
str += "; SameSite=Strict";
|
||||
break;
|
||||
case "lax":
|
||||
str += "; SameSite=Lax";
|
||||
break;
|
||||
case "none":
|
||||
str += "; SameSite=None";
|
||||
break;
|
||||
default:
|
||||
throw new TypeError(`option sameSite is invalid: ${options.sameSite}`);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
/**
|
||||
* URL-decode string value. Optimized to skip native call when no %.
|
||||
*/
|
||||
function decode(str) {
|
||||
if (str.indexOf("%") === -1)
|
||||
return str;
|
||||
try {
|
||||
return decodeURIComponent(str);
|
||||
}
|
||||
catch (e) {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Determine if value is a Date.
|
||||
*/
|
||||
function isDate(val) {
|
||||
return __toString.call(val) === "[object Date]";
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1,20 @@
|
||||
import { RouteIds } from './routeInfo.js';
|
||||
import { RegisteredRouter } from './router.js';
|
||||
export type NotFoundError = {
|
||||
/**
|
||||
@deprecated
|
||||
Use `routeId: rootRouteId` instead
|
||||
*/
|
||||
global?: boolean;
|
||||
/**
|
||||
@private
|
||||
Do not use this. It's used internally to indicate a path matching error
|
||||
*/
|
||||
_global?: boolean;
|
||||
data?: any;
|
||||
throw?: boolean;
|
||||
routeId?: RouteIds<RegisteredRouter['routeTree']>;
|
||||
headers?: HeadersInit;
|
||||
};
|
||||
export declare function notFound(options?: NotFoundError): NotFoundError;
|
||||
export declare function isNotFound(obj: any): obj is NotFoundError;
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"type": "module",
|
||||
"main": "index.cjs",
|
||||
"module": "index.js",
|
||||
"react-native": {
|
||||
"./index.js": "./index.native.js"
|
||||
},
|
||||
"browser": {
|
||||
"./index.js": "./index.browser.js",
|
||||
"./index.cjs": "./index.browser.cjs"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import type { Draft } from 'immer';
|
||||
import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
|
||||
type Immer = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [...Mps, ['zustand/immer', never]], Mcs>) => StateCreator<T, Mps, [['zustand/immer', never], ...Mcs]>;
|
||||
declare module '../vanilla' {
|
||||
interface StoreMutators<S, A> {
|
||||
['zustand/immer']: WithImmer<S>;
|
||||
}
|
||||
}
|
||||
type Write<T, U> = Omit<T, keyof U> & U;
|
||||
type SkipTwo<T> = T extends {
|
||||
length: 0;
|
||||
} ? [] : T extends {
|
||||
length: 1;
|
||||
} ? [] : T extends {
|
||||
length: 0 | 1;
|
||||
} ? [] : T extends [unknown, unknown, ...infer A] ? A : T extends [unknown, unknown?, ...infer A] ? A : T extends [unknown?, unknown?, ...infer A] ? A : never;
|
||||
type SetStateType<T extends unknown[]> = Exclude<T[0], (...args: any[]) => any>;
|
||||
type WithImmer<S> = Write<S, StoreImmer<S>>;
|
||||
type StoreImmer<S> = S extends {
|
||||
setState: infer SetState;
|
||||
} ? SetState extends {
|
||||
(...a: infer A1): infer Sr1;
|
||||
(...a: infer A2): infer Sr2;
|
||||
} ? {
|
||||
setState(nextStateOrUpdater: SetStateType<A2> | Partial<SetStateType<A2>> | ((state: Draft<SetStateType<A2>>) => void), shouldReplace?: false, ...a: SkipTwo<A1>): Sr1;
|
||||
setState(nextStateOrUpdater: SetStateType<A2> | ((state: Draft<SetStateType<A2>>) => void), shouldReplace: true, ...a: SkipTwo<A2>): Sr2;
|
||||
} : never : never;
|
||||
export declare const immer: Immer;
|
||||
export {};
|
||||
@@ -0,0 +1,251 @@
|
||||
/**
|
||||
* @fileoverview Disallows or enforces spaces inside computed properties.
|
||||
* @author Jamund Ferguson
|
||||
* @deprecated in ESLint v8.53.0
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const astUtils = require("./utils/ast-utils");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
deprecated: {
|
||||
message: "Formatting rules are being moved out of ESLint core.",
|
||||
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
||||
deprecatedSince: "8.53.0",
|
||||
availableUntil: "10.0.0",
|
||||
replacedBy: [
|
||||
{
|
||||
message:
|
||||
"ESLint Stylistic now maintains deprecated stylistic core rules.",
|
||||
url: "https://eslint.style/guide/migration",
|
||||
plugin: {
|
||||
name: "@stylistic/eslint-plugin-js",
|
||||
url: "https://eslint.style/packages/js",
|
||||
},
|
||||
rule: {
|
||||
name: "computed-property-spacing",
|
||||
url: "https://eslint.style/rules/js/computed-property-spacing",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
type: "layout",
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Enforce consistent spacing inside computed property brackets",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/computed-property-spacing",
|
||||
},
|
||||
|
||||
fixable: "whitespace",
|
||||
|
||||
schema: [
|
||||
{
|
||||
enum: ["always", "never"],
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
enforceForClassMembers: {
|
||||
type: "boolean",
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
|
||||
messages: {
|
||||
unexpectedSpaceBefore:
|
||||
"There should be no space before '{{tokenValue}}'.",
|
||||
unexpectedSpaceAfter:
|
||||
"There should be no space after '{{tokenValue}}'.",
|
||||
|
||||
missingSpaceBefore: "A space is required before '{{tokenValue}}'.",
|
||||
missingSpaceAfter: "A space is required after '{{tokenValue}}'.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
const propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never"
|
||||
const enforceForClassMembers =
|
||||
!context.options[1] || context.options[1].enforceForClassMembers;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Reports that there shouldn't be a space after the first token
|
||||
* @param {ASTNode} node The node to report in the event of an error.
|
||||
* @param {Token} token The token to use for the report.
|
||||
* @param {Token} tokenAfter The token after `token`.
|
||||
* @returns {void}
|
||||
*/
|
||||
function reportNoBeginningSpace(node, token, tokenAfter) {
|
||||
context.report({
|
||||
node,
|
||||
loc: { start: token.loc.end, end: tokenAfter.loc.start },
|
||||
messageId: "unexpectedSpaceAfter",
|
||||
data: {
|
||||
tokenValue: token.value,
|
||||
},
|
||||
fix(fixer) {
|
||||
return fixer.removeRange([
|
||||
token.range[1],
|
||||
tokenAfter.range[0],
|
||||
]);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports that there shouldn't be a space before the last token
|
||||
* @param {ASTNode} node The node to report in the event of an error.
|
||||
* @param {Token} token The token to use for the report.
|
||||
* @param {Token} tokenBefore The token before `token`.
|
||||
* @returns {void}
|
||||
*/
|
||||
function reportNoEndingSpace(node, token, tokenBefore) {
|
||||
context.report({
|
||||
node,
|
||||
loc: { start: tokenBefore.loc.end, end: token.loc.start },
|
||||
messageId: "unexpectedSpaceBefore",
|
||||
data: {
|
||||
tokenValue: token.value,
|
||||
},
|
||||
fix(fixer) {
|
||||
return fixer.removeRange([
|
||||
tokenBefore.range[1],
|
||||
token.range[0],
|
||||
]);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports that there should be a space after the first token
|
||||
* @param {ASTNode} node The node to report in the event of an error.
|
||||
* @param {Token} token The token to use for the report.
|
||||
* @returns {void}
|
||||
*/
|
||||
function reportRequiredBeginningSpace(node, token) {
|
||||
context.report({
|
||||
node,
|
||||
loc: token.loc,
|
||||
messageId: "missingSpaceAfter",
|
||||
data: {
|
||||
tokenValue: token.value,
|
||||
},
|
||||
fix(fixer) {
|
||||
return fixer.insertTextAfter(token, " ");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports that there should be a space before the last token
|
||||
* @param {ASTNode} node The node to report in the event of an error.
|
||||
* @param {Token} token The token to use for the report.
|
||||
* @returns {void}
|
||||
*/
|
||||
function reportRequiredEndingSpace(node, token) {
|
||||
context.report({
|
||||
node,
|
||||
loc: token.loc,
|
||||
messageId: "missingSpaceBefore",
|
||||
data: {
|
||||
tokenValue: token.value,
|
||||
},
|
||||
fix(fixer) {
|
||||
return fixer.insertTextBefore(token, " ");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a function that checks the spacing of a node on the property name
|
||||
* that was passed in.
|
||||
* @param {string} propertyName The property on the node to check for spacing
|
||||
* @returns {Function} A function that will check spacing on a node
|
||||
*/
|
||||
function checkSpacing(propertyName) {
|
||||
return function (node) {
|
||||
if (!node.computed) {
|
||||
return;
|
||||
}
|
||||
|
||||
const property = node[propertyName];
|
||||
|
||||
const before = sourceCode.getTokenBefore(
|
||||
property,
|
||||
astUtils.isOpeningBracketToken,
|
||||
),
|
||||
first = sourceCode.getTokenAfter(before, {
|
||||
includeComments: true,
|
||||
}),
|
||||
after = sourceCode.getTokenAfter(
|
||||
property,
|
||||
astUtils.isClosingBracketToken,
|
||||
),
|
||||
last = sourceCode.getTokenBefore(after, {
|
||||
includeComments: true,
|
||||
});
|
||||
|
||||
if (astUtils.isTokenOnSameLine(before, first)) {
|
||||
if (propertyNameMustBeSpaced) {
|
||||
if (
|
||||
!sourceCode.isSpaceBetweenTokens(before, first) &&
|
||||
astUtils.isTokenOnSameLine(before, first)
|
||||
) {
|
||||
reportRequiredBeginningSpace(node, before);
|
||||
}
|
||||
} else {
|
||||
if (sourceCode.isSpaceBetweenTokens(before, first)) {
|
||||
reportNoBeginningSpace(node, before, first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (astUtils.isTokenOnSameLine(last, after)) {
|
||||
if (propertyNameMustBeSpaced) {
|
||||
if (
|
||||
!sourceCode.isSpaceBetweenTokens(last, after) &&
|
||||
astUtils.isTokenOnSameLine(last, after)
|
||||
) {
|
||||
reportRequiredEndingSpace(node, after);
|
||||
}
|
||||
} else {
|
||||
if (sourceCode.isSpaceBetweenTokens(last, after)) {
|
||||
reportNoEndingSpace(node, after, last);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Public
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
const listeners = {
|
||||
Property: checkSpacing("key"),
|
||||
MemberExpression: checkSpacing("property"),
|
||||
};
|
||||
|
||||
if (enforceForClassMembers) {
|
||||
listeners.MethodDefinition = listeners.PropertyDefinition =
|
||||
listeners.Property;
|
||||
}
|
||||
|
||||
return listeners;
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"B","2":"K D E F A 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 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 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 rC","2":"nC LC qC"},D:{"1":"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 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":"J PB K D E F A B C L M G 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","2":"sC SC"},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":"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:{"1":"LC J I XD YD ZD aD lC bD cD"},J:{"1":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"1":"B","2":"A"},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:7,C:"CSS pointer-events (for HTML)",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
import{a}from"./chunk-HTB5LLOP.mjs";export{a as default};
|
||||
@@ -0,0 +1,32 @@
|
||||
import * as React from "react";
|
||||
import { useRouter } from "./useRouter.js";
|
||||
function useNavigate(_defaultOpts) {
|
||||
const { navigate } = useRouter();
|
||||
return React.useCallback(
|
||||
(options) => {
|
||||
return navigate({
|
||||
from: _defaultOpts == null ? void 0 : _defaultOpts.from,
|
||||
...options
|
||||
});
|
||||
},
|
||||
[_defaultOpts == null ? void 0 : _defaultOpts.from, navigate]
|
||||
);
|
||||
}
|
||||
function Navigate(props) {
|
||||
const router = useRouter();
|
||||
const previousPropsRef = React.useRef(null);
|
||||
React.useEffect(() => {
|
||||
if (previousPropsRef.current !== props) {
|
||||
router.navigate({
|
||||
...props
|
||||
});
|
||||
previousPropsRef.current = props;
|
||||
}
|
||||
}, [router, props]);
|
||||
return null;
|
||||
}
|
||||
export {
|
||||
Navigate,
|
||||
useNavigate
|
||||
};
|
||||
//# sourceMappingURL=useNavigate.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"MB NB OB I","2":"0 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","194":"9","260":"AB BB CB DB EB FB GB HB IB JB KB LB"},C:{"1":"OB I PC EC QC RC oC pC","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 qC rC","260":"JB KB LB MB NB"},D:{"1":"MB NB OB I PC EC QC RC","2":"0 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 f g h i j k l m n o p q r s t u v w x y z","194":"9","260":"AB BB CB DB EB FB GB HB IB JB KB LB"},E:{"1":"KC gC hC iC jC 3C","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","260":"ZC aC 1C JC bC cC dC eC fC 2C"},F:{"1":"0","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 OC S T U V W X Y Z a b c d e f g h i j k l m 4C 5C 6C 7C FC kC 8C GC","194":"n o","260":"p q r s t u v w x y z"},G:{"1":"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 SD UC VC HC TD IC WC XC YC","260":"ZC aC UD JC bC cC dC eC fC VD"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"2":"A B C FC kC GC","260":"H"},L:{"1":"I"},M:{"260":"EC"},N:{"2":"A B"},O:{"2":"HC"},P:{"2":"1 2 3 4 5 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD","260":"6 7 8"},Q:{"2":"oD"},R:{"2":"pD"},S:{"2":"qD rD"}},B:5,C:"CSS Relative color syntax",D:true};
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { ParsedHistoryState } from '@tanstack/history'
|
||||
import type { AnySchema } from './validators'
|
||||
|
||||
export interface ParsedLocation<TSearchObj extends AnySchema = {}> {
|
||||
href: string
|
||||
pathname: string
|
||||
search: TSearchObj
|
||||
searchStr: string
|
||||
state: ParsedHistoryState
|
||||
hash: string
|
||||
maskedLocation?: ParsedLocation<TSearchObj>
|
||||
unmaskOnReload?: boolean
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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","2":"C L M G N O P"},C:{"1":"0 9 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 qC rC","194":"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"},D:{"1":"0 9 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 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","322":"vB MC wB NC xB yB zB 0B 1B 2B 3B"},E:{"1":"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 G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC","516":"XC YC ZC aC 1C"},F:{"1":"0 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":"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 4C 5C 6C 7C FC kC 8C GC","322":"iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB"},G:{"1":"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 SD UC VC HC TD IC WC","516":"XC YC ZC aC UD"},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 TC iD jD kD lD mD IC JC KC nD","2":"J dD eD fD gD hD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"194":"qD rD"}},B:1,C:"OffscreenCanvas",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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","2":"C L"},C:{"1":"0 9 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 bB cB dB eB fB gB hB iB jB qC rC"},D:{"1":"0 9 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 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"},E:{"1":"B C L M G 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","2":"J PB K D E F A sC SC tC uC vC wC"},F:{"1":"0 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":"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 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"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","2":"E SC 9C lC AD BD CD DD ED FD GD"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D","16":"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 eD fD gD hD TC iD jD kD lD mD IC JC KC nD","2":"J dD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:6,C:"Object.entries",D:true};
|
||||
Reference in New Issue
Block a user