docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Type Check & Test (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:25:58 +08:00
1 parent f954252a34
commit e311ca3275
35554 files changed
+6229626 -4

No files matched your search

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"K D E F A wC"},B:{"1":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB 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 UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC 0C 1C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 E F A B C L M G N O P aB AB BB CB DB EB FB 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 UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"J ZB K D"},E:{"2":"J ZB K D E F A B C L 2C ZC 3C 4C 5C 6C aC NC OC","194":"M G 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P aB AB BB CB DB EB FB 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 EC FC GC HC IC JC KC LC Q H R WC 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 FD GD HD ID NC uC JD OC"},G:{"2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD","194":"aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"1":"J I mD nD","2":"TC iD jD kD lD vC"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"B","2":"A"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:5,C:"Resource Hints: prefetch",D:true};
@@ -0,0 +1,21 @@
/**
* @param {ImageReference} node
* @param {Parents | undefined} _
* @param {State} state
* @param {Info} info
* @returns {string}
*/
export function imageReference(node: ImageReference, _: Parents | undefined, state: State, info: Info): string;
export namespace imageReference {
export { imageReferencePeek as peek };
}
import type { ImageReference } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
/**
* @returns {string}
*/
declare function imageReferencePeek(): string;
export {};
//# sourceMappingURL=image-reference.d.ts.map
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImplicitLibVariable = void 0;
const ESLintScopeVariable_1 = require("./ESLintScopeVariable");
/**
* An variable implicitly defined by the TS Lib
*/
class ImplicitLibVariable extends ESLintScopeVariable_1.ESLintScopeVariable {
/**
* `true` if the variable is valid in a type context, false otherwise
*/
isTypeVariable;
/**
* `true` if the variable is valid in a value context, false otherwise
*/
isValueVariable;
constructor(scope, name, { eslintImplicitGlobalSetting, isTypeVariable, isValueVariable, writeable, }) {
super(name, scope);
this.isTypeVariable = isTypeVariable ?? false;
this.isValueVariable = isValueVariable ?? false;
this.writeable = writeable ?? false;
this.eslintImplicitGlobalSetting =
eslintImplicitGlobalSetting ?? 'readonly';
}
}
exports.ImplicitLibVariable = ImplicitLibVariable;
@@ -0,0 +1 @@
{"version":3,"file":"buildClassElementMetadataFromMaybeClassElementMetadata.spec.d.ts","sourceRoot":"","sources":["../../../../src/metadata/calculations/buildClassElementMetadataFromMaybeClassElementMetadata.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,52 @@
import type * as core from "./core.cjs";
import * as schemas from "./schemas.cjs";
import { $ZodTuple } from "./schemas.cjs";
import type * as util from "./util.cjs";
export interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> {
type: "function";
input: In;
output: Out;
}
export type $ZodFunctionArgs = schemas.$ZodType<unknown[], unknown[]>;
export type $ZodFunctionIn = $ZodFunctionArgs;
export type $ZodFunctionOut = schemas.$ZodType;
export type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.output<Args>) => core.input<Returns>;
export type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.output<Args>) => util.MaybeAsync<core.input<Returns>>;
export type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.input<Args>) => core.output<Returns>;
export type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.input<Args>) => util.MaybeAsync<core.output<Returns>>;
export declare class $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> {
def: $ZodFunctionDef<Args, Returns>;
/** @deprecated */
_def: $ZodFunctionDef<Args, Returns>;
_input: $InferInnerFunctionType<Args, Returns>;
_output: $InferOuterFunctionType<Args, Returns>;
constructor(def: $ZodFunctionDef<Args, Returns>);
implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
input<const Items extends util.TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<schemas.$ZodTuple<Items, Rest>, Returns>;
input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
output<NewReturns extends schemas.$ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
}
export interface $ZodFunctionParams<I extends $ZodFunctionIn, O extends schemas.$ZodType> {
input?: I;
output?: O;
}
declare function _function(): $ZodFunction;
declare function _function<const In extends Array<schemas.$ZodType> = Array<schemas.$ZodType>>(params: {
input: In;
}): $ZodFunction<$ZodTuple<In, null>, $ZodFunctionOut>;
declare function _function<const In extends Array<schemas.$ZodType> = Array<schemas.$ZodType>, const Out extends $ZodFunctionOut = $ZodFunctionOut>(params: {
input: In;
output: Out;
}): $ZodFunction<$ZodTuple<In, null>, Out>;
declare function _function<const In extends $ZodFunctionIn = $ZodFunctionIn>(params: {
input: In;
}): $ZodFunction<In, $ZodFunctionOut>;
declare function _function<const Out extends $ZodFunctionOut = $ZodFunctionOut>(params: {
output: Out;
}): $ZodFunction<$ZodFunctionIn, Out>;
declare function _function<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends schemas.$ZodType = schemas.$ZodType>(params?: {
input: In;
output: Out;
}): $ZodFunction<In, Out>;
export { _function as function };
@@ -0,0 +1,24 @@
/**
* Splits the `@prefix` from remaining `Spec.lines[].token.description` into the `tag` token,
* and populates `spec.tag`
*/
export default function tagTokenizer() {
return (spec) => {
const { tokens } = spec.source[0];
const match = tokens.description.match(/\s*(@(\S+))(\s*)/);
if (match === null) {
spec.problems.push({
code: 'spec:tag:prefix',
message: 'tag should start with "@" symbol',
line: spec.source[0].number,
critical: true,
});
return spec;
}
tokens.tag = match[1];
tokens.postTag = match[3];
tokens.description = tokens.description.slice(match[0].length);
spec.tag = match[2];
return spec;
};
}
@@ -0,0 +1,26 @@
function asyncGeneratorStep(n, t, e, r, o, a, c) {
try {
var i = n[a](c),
u = i.value;
} catch (n) {
return void e(n);
}
i.done ? t(u) : Promise.resolve(u).then(r, o);
}
function _asyncToGenerator(n) {
return function () {
var t = this,
e = arguments;
return new Promise(function (r, o) {
var a = n.apply(t, e);
function _next(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
}
function _throw(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
}
_next(void 0);
});
};
}
module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,5 @@
import checkPrivateRedeclaration from "./checkPrivateRedeclaration.js";
function _classPrivateMethodInitSpec(e, a) {
checkPrivateRedeclaration(e, a), a.add(e);
}
export { _classPrivateMethodInitSpec as default };
@@ -0,0 +1,38 @@
{
"name": "semver",
"version": "6.3.1",
"description": "The semantic version parser used by npm.",
"main": "semver.js",
"scripts": {
"test": "tap test/ --100 --timeout=30",
"lint": "echo linting disabled",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"snap": "tap test/ --100 --timeout=30",
"posttest": "npm run lint"
},
"devDependencies": {
"@npmcli/template-oss": "4.17.0",
"tap": "^12.7.0"
},
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/npm/node-semver.git"
},
"bin": {
"semver": "./bin/semver.js"
},
"files": [
"bin",
"range.bnf",
"semver.js"
],
"author": "GitHub Inc.",
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"content": "./scripts/template-oss",
"version": "4.17.0"
}
}
@@ -0,0 +1,243 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { ZodNullable, ZodOptional } from "zod/v3";
import { util } from "../helpers/util.js";
const nested = z.object({
name: z.string(),
age: z.number(),
outer: z.object({
inner: z.string(),
}),
array: z.array(z.object({ asdf: z.string() })),
});
test("shallow inference", () => {
const shallow = nested.partial();
type shallow = z.infer<typeof shallow>;
type correct = {
name?: string | undefined;
age?: number | undefined;
outer?: { inner: string } | undefined;
array?: { asdf: string }[];
};
util.assertEqual<shallow, correct>(true);
});
test("shallow partial parse", () => {
const shallow = nested.partial();
shallow.parse({});
shallow.parse({
name: "asdf",
age: 23143,
});
});
test("deep partial inference", () => {
const deep = nested.deepPartial();
const asdf = deep.shape.array.unwrap().element.shape.asdf.unwrap();
asdf.parse("asdf");
type deep = z.infer<typeof deep>;
type correct = {
array?: { asdf?: string }[];
name?: string | undefined;
age?: number | undefined;
outer?: { inner?: string | undefined } | undefined;
};
util.assertEqual<deep, correct>(true);
});
test("deep partial parse", () => {
const deep = nested.deepPartial();
expect(deep.shape.name instanceof z.ZodOptional).toBe(true);
expect(deep.shape.outer instanceof z.ZodOptional).toBe(true);
expect(deep.shape.outer._def.innerType instanceof z.ZodObject).toBe(true);
expect(deep.shape.outer._def.innerType.shape.inner instanceof z.ZodOptional).toBe(true);
expect(deep.shape.outer._def.innerType.shape.inner._def.innerType instanceof z.ZodString).toBe(true);
});
test("deep partial runtime tests", () => {
const deep = nested.deepPartial();
deep.parse({});
deep.parse({
outer: {},
});
deep.parse({
name: "asdf",
age: 23143,
outer: {
inner: "adsf",
},
});
});
test("deep partial optional/nullable", () => {
const schema = z
.object({
name: z.string().optional(),
age: z.number().nullable(),
})
.deepPartial();
expect(schema.shape.name.unwrap()).toBeInstanceOf(ZodOptional);
expect(schema.shape.age.unwrap()).toBeInstanceOf(ZodNullable);
});
test("deep partial tuple", () => {
const schema = z
.object({
tuple: z.tuple([
z.object({
name: z.string().optional(),
age: z.number().nullable(),
}),
]),
})
.deepPartial();
expect(schema.shape.tuple.unwrap().items[0].shape.name).toBeInstanceOf(ZodOptional);
});
test("deep partial inference", () => {
const mySchema = z.object({
name: z.string(),
array: z.array(z.object({ asdf: z.string() })),
tuple: z.tuple([z.object({ value: z.string() })]),
});
const partialed = mySchema.deepPartial();
type partialed = z.infer<typeof partialed>;
type expected = {
name?: string | undefined;
array?:
| {
asdf?: string | undefined;
}[]
| undefined;
tuple?: [{ value?: string }] | undefined;
};
util.assertEqual<expected, partialed>(true);
});
test("required", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
nullableField: z.number().nullable(),
nullishField: z.string().nullish(),
});
const requiredObject = object.required();
expect(requiredObject.shape.name).toBeInstanceOf(z.ZodString);
expect(requiredObject.shape.age).toBeInstanceOf(z.ZodNumber);
expect(requiredObject.shape.field).toBeInstanceOf(z.ZodDefault);
expect(requiredObject.shape.nullableField).toBeInstanceOf(z.ZodNullable);
expect(requiredObject.shape.nullishField).toBeInstanceOf(z.ZodNullable);
});
test("required inference", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
nullableField: z.number().nullable(),
nullishField: z.string().nullish(),
});
const requiredObject = object.required();
type required = z.infer<typeof requiredObject>;
type expected = {
name: string;
age: number;
field: string;
nullableField: number | null;
nullishField: string | null;
};
util.assertEqual<expected, required>(true);
});
test("required with mask", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string().optional(),
});
const requiredObject = object.required({ age: true });
expect(requiredObject.shape.name).toBeInstanceOf(z.ZodString);
expect(requiredObject.shape.age).toBeInstanceOf(z.ZodNumber);
expect(requiredObject.shape.field).toBeInstanceOf(z.ZodDefault);
expect(requiredObject.shape.country).toBeInstanceOf(z.ZodOptional);
});
test("required with mask -- ignore falsy values", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string().optional(),
});
// @ts-expect-error
const requiredObject = object.required({ age: true, country: false });
expect(requiredObject.shape.name).toBeInstanceOf(z.ZodString);
expect(requiredObject.shape.age).toBeInstanceOf(z.ZodNumber);
expect(requiredObject.shape.field).toBeInstanceOf(z.ZodDefault);
expect(requiredObject.shape.country).toBeInstanceOf(z.ZodOptional);
});
test("partial with mask", async () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string(),
});
const masked = object.partial({ age: true, field: true, name: true }).strict();
expect(masked.shape.name).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.age).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.field).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.country).toBeInstanceOf(z.ZodString);
masked.parse({ country: "US" });
await masked.parseAsync({ country: "US" });
});
test("partial with mask -- ignore falsy values", async () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string(),
});
// @ts-expect-error
const masked = object.partial({ name: true, country: false }).strict();
expect(masked.shape.name).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.age).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.field).toBeInstanceOf(z.ZodDefault);
expect(masked.shape.country).toBeInstanceOf(z.ZodString);
masked.parse({ country: "US" });
await masked.parseAsync({ country: "US" });
});
test("deeppartial array", () => {
const schema = z.object({ array: z.string().array().min(42) }).deepPartial();
// works as expected
schema.parse({});
// should be false, but is true
expect(schema.safeParse({ array: [] }).success).toBe(false);
});
@@ -0,0 +1,5 @@
'use strict'
const compareBuild = require('./compare-build')
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
module.exports = rsort
@@ -0,0 +1,19 @@
import { StringReplacer } from '../interfaces';
declare class ImportPathResolver {
source: string;
readonly sourcePath: string;
constructor(source: string, sourcePath: string);
get sourceDir(): string;
replaceSourceImportPaths(replacer: StringReplacer): this;
resolveFullImportPaths(ext?: string): this;
private resolveFullPath;
static newStringRegex(): RegExp;
static newImportStatementRegex(flags?: string): RegExp;
static resolveFullImportPaths(code: string, path: string, ext?: string): string;
static replaceSourceImportPaths(code: string, path: string, replacer: StringReplacer): string;
}
export declare const resolveFullImportPaths: typeof ImportPathResolver.resolveFullImportPaths;
export declare const newImportStatementRegex: typeof ImportPathResolver.newImportStatementRegex;
export declare const replaceSourceImportPaths: typeof ImportPathResolver.replaceSourceImportPaths;
export declare const newStringRegex: typeof ImportPathResolver.newStringRegex;
export {};
@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS = void 0;
var _utils = require("./utils.js");
const PLACEHOLDERS = exports.PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
const PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS_ALIAS = {
Declaration: ["Statement"],
Pattern: ["PatternLike", "LVal"]
};
for (const type of PLACEHOLDERS) {
const alias = _utils.ALIAS_KEYS[type];
if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
}
const PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_FLIPPED_ALIAS = {};
Object.keys(PLACEHOLDERS_ALIAS).forEach(type => {
PLACEHOLDERS_ALIAS[type].forEach(alias => {
if (!hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
}
PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
});
});
//# sourceMappingURL=placeholders.js.map
@@ -0,0 +1,349 @@
var fs = require('fs');
var getHomedir = require('./homedir');
var path = require('path');
var caller = require('./caller');
var nodeModulesPaths = require('./node-modules-paths');
var normalizeOptions = require('./normalize-options');
var isCore = require('is-core-module');
var realpathFS = process.platform !== 'win32' && fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
var homedir = getHomedir();
var defaultPaths = function () {
return [
path.join(homedir, '.node_modules'),
path.join(homedir, '.node_libraries')
];
};
var defaultIsFile = function isFile(file, cb) {
fs.stat(file, function (err, stat) {
if (!err) {
return cb(null, stat.isFile() || stat.isFIFO());
}
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
return cb(err);
});
};
var defaultIsDir = function isDirectory(dir, cb) {
fs.stat(dir, function (err, stat) {
if (!err) {
return cb(null, stat.isDirectory());
}
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
return cb(err);
});
};
var defaultRealpath = function realpath(x, cb) {
realpathFS(x, function (realpathErr, realPath) {
if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr);
else cb(null, realpathErr ? x : realPath);
});
};
var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) {
if (!opts || !opts.preserveSymlinks) {
realpath(x, cb);
} else {
cb(null, x);
}
};
var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) {
readFile(pkgfile, function (readFileErr, body) {
if (readFileErr) cb(readFileErr);
else {
try {
var pkg = JSON.parse(body);
cb(null, pkg);
} catch (jsonErr) {
cb(jsonErr);
}
}
});
};
var getPackageCandidates = function getPackageCandidates(x, start, opts) {
var dirs = nodeModulesPaths(start, opts, x);
for (var i = 0; i < dirs.length; i++) {
dirs[i] = path.join(dirs[i], x);
}
return dirs;
};
module.exports = function resolve(x, options, callback) {
var cb = callback;
var opts = options;
if (typeof options === 'function') {
cb = opts;
opts = {};
}
if (typeof x !== 'string') {
var err = new TypeError('Path must be a string.');
return process.nextTick(function () {
cb(err);
});
}
opts = normalizeOptions(x, opts);
var isFile = opts.isFile || defaultIsFile;
var isDirectory = opts.isDirectory || defaultIsDir;
var readFile = opts.readFile || fs.readFile;
var realpath = opts.realpath || defaultRealpath;
var readPackage = opts.readPackage || defaultReadPackage;
if (opts.readFile && opts.readPackage) {
var conflictErr = new TypeError('`readFile` and `readPackage` are mutually exclusive.');
return process.nextTick(function () {
cb(conflictErr);
});
}
var packageIterator = opts.packageIterator;
var extensions = opts.extensions || ['.js'];
var includeCoreModules = opts.includeCoreModules !== false;
var basedir = opts.basedir || path.dirname(caller());
var parent = opts.filename || basedir;
opts.paths = opts.paths || defaultPaths();
// ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
var absoluteStart = path.resolve(basedir);
maybeRealpath(
realpath,
absoluteStart,
opts,
function (err, realStart) {
if (err) cb(err);
else validateBasedir(realStart);
}
);
function validateBasedir(basedir) {
if (opts.basedir) {
var dirError = new TypeError('Provided basedir "' + basedir + '" is not a directory' + (opts.preserveSymlinks ? '' : ', or a symlink to a directory'));
dirError.code = 'INVALID_BASEDIR';
isDirectory(basedir, function (err, result) {
if (err) return cb(err);
if (!result) { return cb(dirError); }
validBasedir(basedir);
});
} else {
validBasedir(basedir);
}
}
var res;
function validBasedir(basedir) {
if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
res = path.resolve(basedir, x);
if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
if ((/\/$/).test(x) && res === basedir) {
loadAsDirectory(res, opts.package, onfile);
} else loadAsFile(res, opts.package, onfile);
} else if (includeCoreModules && isCore(x)) {
return cb(null, x);
} else loadNodeModules(x, basedir, function (err, n, pkg) {
if (err) cb(err);
else if (n) {
return maybeRealpath(realpath, n, opts, function (err, realN) {
if (err) {
cb(err);
} else {
cb(null, realN, pkg);
}
});
} else {
var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
moduleError.code = 'MODULE_NOT_FOUND';
cb(moduleError);
}
});
}
function onfile(err, m, pkg) {
if (err) cb(err);
else if (m) cb(null, m, pkg);
else loadAsDirectory(res, function (err, d, pkg) {
if (err) cb(err);
else if (d) {
maybeRealpath(realpath, d, opts, function (err, realD) {
if (err) {
cb(err);
} else {
cb(null, realD, pkg);
}
});
} else {
var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
moduleError.code = 'MODULE_NOT_FOUND';
cb(moduleError);
}
});
}
function loadAsFile(x, thePackage, callback) {
var loadAsFilePackage = thePackage;
var cb = callback;
if (typeof loadAsFilePackage === 'function') {
cb = loadAsFilePackage;
loadAsFilePackage = undefined;
}
var exts = [''].concat(extensions);
load(exts, x, loadAsFilePackage);
function load(exts, x, loadPackage) {
if (exts.length === 0) return cb(null, undefined, loadPackage);
var file = x + exts[0];
var pkg = loadPackage;
if (pkg) onpkg(null, pkg);
else loadpkg(path.dirname(file), onpkg);
function onpkg(err, pkg_, dir) {
pkg = pkg_;
if (err) return cb(err);
if (dir && pkg && opts.pathFilter) {
var rfile = path.relative(dir, file);
var rel = rfile.slice(0, rfile.length - exts[0].length);
var r = opts.pathFilter(pkg, x, rel);
if (r) return load(
[''].concat(extensions.slice()),
path.resolve(dir, r),
pkg
);
}
isFile(file, onex);
}
function onex(err, ex) {
if (err) return cb(err);
if (ex) return cb(null, file, pkg);
load(exts.slice(1), x, pkg);
}
}
}
function loadpkg(dir, cb) {
if (dir === '' || dir === '/') return cb(null);
if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
return cb(null);
}
if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null);
maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) {
if (unwrapErr) return loadpkg(path.dirname(dir), cb);
var pkgfile = path.join(pkgdir, 'package.json');
isFile(pkgfile, function (err, ex) {
// on err, ex is false
if (!ex) return loadpkg(path.dirname(dir), cb);
readPackage(readFile, pkgfile, function (err, pkgParam) {
if (err && !(err instanceof SyntaxError)) cb(err);
var pkg = pkgParam;
if (pkg && opts.packageFilter) {
pkg = opts.packageFilter(pkg, pkgfile, dir);
}
cb(null, pkg, dir);
});
});
});
}
function loadAsDirectory(x, loadAsDirectoryPackage, callback) {
var cb = callback;
var fpkg = loadAsDirectoryPackage;
if (typeof fpkg === 'function') {
cb = fpkg;
fpkg = opts.package;
}
maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) {
if (unwrapErr) return loadAsDirectory(path.dirname(x), fpkg, cb);
var pkgfile = path.join(pkgdir, 'package.json');
isFile(pkgfile, function (err, ex) {
if (err) return cb(err);
if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb);
readPackage(readFile, pkgfile, function (err, pkgParam) {
if (err) return cb(err);
var pkg = pkgParam;
if (pkg && opts.packageFilter) {
pkg = opts.packageFilter(pkg, pkgfile, pkgdir);
}
if (pkg && pkg.main) {
if (typeof pkg.main !== 'string') {
var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
mainError.code = 'INVALID_PACKAGE_MAIN';
return cb(mainError);
}
if (pkg.main === '.' || pkg.main === './') {
pkg.main = 'index';
}
loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {
if (err) return cb(err);
if (m) return cb(null, m, pkg);
if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb);
var dir = path.resolve(x, pkg.main);
loadAsDirectory(dir, pkg, function (err, n, pkg) {
if (err) return cb(err);
if (n) return cb(null, n, pkg);
loadAsFile(path.join(x, 'index'), pkg, function (err, m, pkg) {
if (err) return cb(err);
if (m) return cb(null, m, pkg);
var incorrectMainError = new Error("Cannot find module '" + path.resolve(x, pkg.main) + "'. Please verify that the package.json has a valid \"main\" entry");
incorrectMainError.code = 'INCORRECT_PACKAGE_MAIN';
return cb(incorrectMainError);
});
});
});
return;
}
loadAsFile(path.join(x, '/index'), pkg, cb);
});
});
});
}
function processDirs(cb, dirs) {
if (dirs.length === 0) return cb(null, undefined);
var dir = dirs[0];
isDirectory(path.dirname(dir), isdir);
function isdir(err, isdir) {
if (err) return cb(err);
if (!isdir) return processDirs(cb, dirs.slice(1));
loadAsFile(dir, opts.package, onfile);
}
function onfile(err, m, pkg) {
if (err) return cb(err);
if (m) return cb(null, m, pkg);
loadAsDirectory(dir, opts.package, ondir);
}
function ondir(err, n, pkg) {
if (err) return cb(err);
if (n) return cb(null, n, pkg);
processDirs(cb, dirs.slice(1));
}
}
function loadNodeModules(x, start, cb) {
var thunk = function () { return getPackageCandidates(x, start, opts); };
processDirs(
cb,
packageIterator ? packageIterator(x, start, thunk, opts) : thunk()
);
}
};
@@ -0,0 +1,60 @@
'use strict';var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor);
var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}
var DEFAULT_MAX = 10;
var DEFAULT_IGNORE_TYPE_IMPORTS = false;
var TYPE_IMPORT = 'type';
var countDependencies = function countDependencies(dependencies, lastNode, context) {var _ref =
context.options[0] || { max: DEFAULT_MAX },max = _ref.max;
if (dependencies.size > max) {
context.report(lastNode, 'Maximum number of dependencies (' + String(max) + ') exceeded.');
}
};
module.exports = {
meta: {
type: 'suggestion',
docs: {
category: 'Style guide',
description: 'Enforce the maximum number of dependencies a module can have.',
url: (0, _docsUrl2['default'])('max-dependencies') },
schema: [
{
type: 'object',
properties: {
max: { type: 'number' },
ignoreTypeImports: { type: 'boolean' } },
additionalProperties: false }] },
create: function () {function create(context) {var _ref2 =
context.options[0] || {},_ref2$ignoreTypeImpor = _ref2.ignoreTypeImports,ignoreTypeImports = _ref2$ignoreTypeImpor === undefined ? DEFAULT_IGNORE_TYPE_IMPORTS : _ref2$ignoreTypeImpor;
var dependencies = new Set(); // keep track of dependencies
var lastNode = void 0; // keep track of the last node to report on
return Object.assign({
'Program:exit': function () {function ProgramExit() {
countDependencies(dependencies, lastNode, context);
}return ProgramExit;}() },
(0, _moduleVisitor2['default'])(
function (source, _ref3) {var importKind = _ref3.importKind;
if (importKind !== TYPE_IMPORT || !ignoreTypeImports) {
dependencies.add(source.value);
}
lastNode = source;
},
{ commonjs: true }));
}return create;}() };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9tYXgtZGVwZW5kZW5jaWVzLmpzIl0sIm5hbWVzIjpbIkRFRkFVTFRfTUFYIiwiREVGQVVMVF9JR05PUkVfVFlQRV9JTVBPUlRTIiwiVFlQRV9JTVBPUlQiLCJjb3VudERlcGVuZGVuY2llcyIsImRlcGVuZGVuY2llcyIsImxhc3ROb2RlIiwiY29udGV4dCIsIm9wdGlvbnMiLCJtYXgiLCJzaXplIiwicmVwb3J0IiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJ1cmwiLCJzY2hlbWEiLCJwcm9wZXJ0aWVzIiwiaWdub3JlVHlwZUltcG9ydHMiLCJhZGRpdGlvbmFsUHJvcGVydGllcyIsImNyZWF0ZSIsIlNldCIsInNvdXJjZSIsImltcG9ydEtpbmQiLCJhZGQiLCJ2YWx1ZSIsImNvbW1vbmpzIl0sIm1hcHBpbmdzIjoiYUFBQSxrRTtBQUNBLHFDOztBQUVBLElBQU1BLGNBQWMsRUFBcEI7QUFDQSxJQUFNQyw4QkFBOEIsS0FBcEM7QUFDQSxJQUFNQyxjQUFjLE1BQXBCOztBQUVBLElBQU1DLG9CQUFvQixTQUFwQkEsaUJBQW9CLENBQUNDLFlBQUQsRUFBZUMsUUFBZixFQUF5QkMsT0FBekIsRUFBcUM7QUFDN0NBLFVBQVFDLE9BQVIsQ0FBZ0IsQ0FBaEIsS0FBc0IsRUFBRUMsS0FBS1IsV0FBUCxFQUR1QixDQUNyRFEsR0FEcUQsUUFDckRBLEdBRHFEOztBQUc3RCxNQUFJSixhQUFhSyxJQUFiLEdBQW9CRCxHQUF4QixFQUE2QjtBQUMzQkYsWUFBUUksTUFBUixDQUFlTCxRQUFmLDhDQUE0REcsR0FBNUQ7QUFDRDtBQUNGLENBTkQ7O0FBUUFHLE9BQU9DLE9BQVAsR0FBaUI7QUFDZkMsUUFBTTtBQUNKQyxVQUFNLFlBREY7QUFFSkMsVUFBTTtBQUNKQyxnQkFBVSxhQUROO0FBRUpDLG1CQUFhLCtEQUZUO0FBR0pDLFdBQUssMEJBQVEsa0JBQVIsQ0FIRCxFQUZGOzs7QUFRSkMsWUFBUTtBQUNOO0FBQ0VMLFlBQU0sUUFEUjtBQUVFTSxrQkFBWTtBQUNWWixhQUFLLEVBQUVNLE1BQU0sUUFBUixFQURLO0FBRVZPLDJCQUFtQixFQUFFUCxNQUFNLFNBQVIsRUFGVCxFQUZkOztBQU1FUSw0QkFBc0IsS0FOeEIsRUFETSxDQVJKLEVBRFM7Ozs7O0FBcUJmQyxRQXJCZSwrQkFxQlJqQixPQXJCUSxFQXFCQzs7O0FBR1ZBLGNBQVFDLE9BQVIsQ0FBZ0IsQ0FBaEIsS0FBc0IsRUFIWiwrQkFFWmMsaUJBRlksQ0FFWkEsaUJBRlkseUNBRVFwQiwyQkFGUjs7QUFLZCxVQUFNRyxlQUFlLElBQUlvQixHQUFKLEVBQXJCLENBTGMsQ0FLa0I7QUFDaEMsVUFBSW5CLGlCQUFKLENBTmMsQ0FNQTs7QUFFZDtBQUNFLHNCQURGLHNDQUNtQjtBQUNmRiw4QkFBa0JDLFlBQWxCLEVBQWdDQyxRQUFoQyxFQUEwQ0MsT0FBMUM7QUFDRCxXQUhIO0FBSUs7QUFDRCxnQkFBQ21CLE1BQUQsU0FBNEIsS0FBakJDLFVBQWlCLFNBQWpCQSxVQUFpQjtBQUMxQixZQUFJQSxlQUFleEIsV0FBZixJQUE4QixDQUFDbUIsaUJBQW5DLEVBQXNEO0FBQ3BEakIsdUJBQWF1QixHQUFiLENBQWlCRixPQUFPRyxLQUF4QjtBQUNEO0FBQ0R2QixtQkFBV29CLE1BQVg7QUFDRCxPQU5BO0FBT0QsUUFBRUksVUFBVSxJQUFaLEVBUEMsQ0FKTDs7O0FBY0QsS0EzQ2MsbUJBQWpCIiwiZmlsZSI6Im1heC1kZXBlbmRlbmNpZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgbW9kdWxlVmlzaXRvciBmcm9tICdlc2xpbnQtbW9kdWxlLXV0aWxzL21vZHVsZVZpc2l0b3InO1xuaW1wb3J0IGRvY3NVcmwgZnJvbSAnLi4vZG9jc1VybCc7XG5cbmNvbnN0IERFRkFVTFRfTUFYID0gMTA7XG5jb25zdCBERUZBVUxUX0lHTk9SRV9UWVBFX0lNUE9SVFMgPSBmYWxzZTtcbmNvbnN0IFRZUEVfSU1QT1JUID0gJ3R5cGUnO1xuXG5jb25zdCBjb3VudERlcGVuZGVuY2llcyA9IChkZXBlbmRlbmNpZXMsIGxhc3ROb2RlLCBjb250ZXh0KSA9PiB7XG4gIGNvbnN0IHsgbWF4IH0gPSBjb250ZXh0Lm9wdGlvbnNbMF0gfHwgeyBtYXg6IERFRkFVTFRfTUFYIH07XG5cbiAgaWYgKGRlcGVuZGVuY2llcy5zaXplID4gbWF4KSB7XG4gICAgY29udGV4dC5yZXBvcnQobGFzdE5vZGUsIGBNYXhpbXVtIG51bWJlciBvZiBkZXBlbmRlbmNpZXMgKCR7bWF4fSkgZXhjZWVkZWQuYCk7XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzID0ge1xuICBtZXRhOiB7XG4gICAgdHlwZTogJ3N1Z2dlc3Rpb24nLFxuICAgIGRvY3M6IHtcbiAgICAgIGNhdGVnb3J5OiAnU3R5bGUgZ3VpZGUnLFxuICAgICAgZGVzY3JpcHRpb246ICdFbmZvcmNlIHRoZSBtYXhpbXVtIG51bWJlciBvZiBkZXBlbmRlbmNpZXMgYSBtb2R1bGUgY2FuIGhhdmUuJyxcbiAgICAgIHVybDogZG9jc1VybCgnbWF4LWRlcGVuZGVuY2llcycpLFxuICAgIH0sXG5cbiAgICBzY2hlbWE6IFtcbiAgICAgIHtcbiAgICAgICAgdHlwZTogJ29iamVjdCcsXG4gICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICBtYXg6IHsgdHlwZTogJ251bWJlcicgfSxcbiAgICAgICAgICBpZ25vcmVUeXBlSW1wb3J0czogeyB0eXBlOiAnYm9vbGVhbicgfSxcbiAgICAgICAgfSxcbiAgICAgICAgYWRkaXRpb25hbFByb3BlcnRpZXM6IGZhbHNlLFxuICAgICAgfSxcbiAgICBdLFxuICB9LFxuXG4gIGNyZWF0ZShjb250ZXh0KSB7XG4gICAgY29uc3Qge1xuICAgICAgaWdub3JlVHlwZUltcG9ydHMgPSBERUZBVUxUX0lHTk9SRV9UWVBFX0lNUE9SVFMsXG4gICAgfSA9IGNvbnRleHQub3B0aW9uc1swXSB8fCB7fTtcblxuICAgIGNvbnN0IGRlcGVuZGVuY2llcyA9IG5ldyBTZXQoKTsgLy8ga2VlcCB0cmFjayBvZiBkZXBlbmRlbmNpZXNcbiAgICBsZXQgbGFzdE5vZGU7IC8vIGtlZXAgdHJhY2sgb2YgdGhlIGxhc3Qgbm9kZSB0byByZXBvcnQgb25cblxuICAgIHJldHVybiB7XG4gICAgICAnUHJvZ3JhbTpleGl0JygpIHtcbiAgICAgICAgY291bnREZXBlbmRlbmNpZXMoZGVwZW5kZW5jaWVzLCBsYXN0Tm9kZSwgY29udGV4dCk7XG4gICAgICB9LFxuICAgICAgLi4ubW9kdWxlVmlzaXRvcihcbiAgICAgICAgKHNvdXJjZSwgeyBpbXBvcnRLaW5kIH0pID0+IHtcbiAgICAgICAgICBpZiAoaW1wb3J0S2luZCAhPT0gVFlQRV9JTVBPUlQgfHwgIWlnbm9yZVR5cGVJbXBvcnRzKSB7XG4gICAgICAgICAgICBkZXBlbmRlbmNpZXMuYWRkKHNvdXJjZS52YWx1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGxhc3ROb2RlID0gc291cmNlO1xuICAgICAgICB9LFxuICAgICAgICB7IGNvbW1vbmpzOiB0cnVlIH0sXG4gICAgICApLFxuICAgIH07XG4gIH0sXG59O1xuIl19
@@ -0,0 +1 @@
{"name":"esbuild","version":"0.27.2","requiresBuild":true,"files":{"bin/esbuild":{"checkedAt":1794532095795,"integrity":"sha512-ZZ4AjYaUxxILiOJcP903pimKY+31h9TdF4I3am+N0YoWrRjI9vQKvBDeEKaJTf4bqUySE9jO/5BdIBvKPOf26Q==","mode":493,"size":9350},"install.js":{"checkedAt":1794532095795,"integrity":"sha512-A/MhGi5PLSIIiCZ3UmEEpyMjR76/MtEQoZ/ObaKJxJmAm7IJaIjXnVkcwnlnKc0dQ3KfIJME3hEwu4h6ClXGBw==","mode":420,"size":11160},"lib/main.js":{"checkedAt":1794532095795,"integrity":"sha512-vva8tlKtG8axHlRBeh2gvn8KdlCjxSzGDRVXJ6OiO1li86m/TfYO373dADC7/Y4rZEsKAH+LfPk8wwMSMyt+ZA==","mode":420,"size":88698},"package.json":{"checkedAt":1794532095796,"integrity":"sha512-n04Kye7NDajXhIpNHCjto+7lsdJIu9hzpLCDxM1XmTfl7OOQ0qpw7IblVBS1h40k3GwdfH++bFE2sS9IR1MqoQ==","mode":420,"size":1463},"LICENSE.md":{"checkedAt":1794532095796,"integrity":"sha512-oQ9lr3GFGv53nYkl4A1WgBdsYLdqABglgLT15u2KH3GyGBkTT0Aa1apEyikCaWk8KOERe9SHT8f7hVezAfkAxw==","mode":420,"size":1069},"README.md":{"checkedAt":1794532095796,"integrity":"sha512-d8nFKDXLOjrfvX2ysOMMH70lmd6JzrJCMUDtSrlqRENr7wchIAA9o1hMX6i1xG+1AX6+N2fbGqAKklwnjx8wxA==","mode":420,"size":175},"lib/main.d.ts":{"checkedAt":1794532095796,"integrity":"sha512-FeSWlW7AN+XuVP71W7gp0y2UDV2Pc+ymmI1rno1Ck85r/om8ZTRz6gdrNG8Et2NPNrvObieLCRs1k0YsKrZsng==","mode":420,"size":23392}},"sideEffects":{"linux-x64-node-v24-0cdd5bac43a049cb85d5b16f1d9bc6dd7bdff90d":{"LICENSE.md":{"checkedAt":1794532128928,"integrity":"sha512-oQ9lr3GFGv53nYkl4A1WgBdsYLdqABglgLT15u2KH3GyGBkTT0Aa1apEyikCaWk8KOERe9SHT8f7hVezAfkAxw==","mode":33188,"size":1069},"README.md":{"checkedAt":1794532128928,"integrity":"sha512-d8nFKDXLOjrfvX2ysOMMH70lmd6JzrJCMUDtSrlqRENr7wchIAA9o1hMX6i1xG+1AX6+N2fbGqAKklwnjx8wxA==","mode":33188,"size":175},"bin/esbuild":{"checkedAt":1794532091250,"integrity":"sha512-NO0ILqkicL8EfezS/We49ImRfQxt9sBPGYp68p0BmCzCeYXNjylJ3lTihu+H5PoBRD6u/yy8+QvvS6m4+2OX6Q==","mode":33261,"size":11100344},"install.js":{"checkedAt":1794532128967,"integrity":"sha512-A/MhGi5PLSIIiCZ3UmEEpyMjR76/MtEQoZ/ObaKJxJmAm7IJaIjXnVkcwnlnKc0dQ3KfIJME3hEwu4h6ClXGBw==","mode":33188,"size":11160},"lib/main.d.ts":{"checkedAt":1794532128967,"integrity":"sha512-FeSWlW7AN+XuVP71W7gp0y2UDV2Pc+ymmI1rno1Ck85r/om8ZTRz6gdrNG8Et2NPNrvObieLCRs1k0YsKrZsng==","mode":33188,"size":23392},"lib/main.js":{"checkedAt":1794532095795,"integrity":"sha512-vva8tlKtG8axHlRBeh2gvn8KdlCjxSzGDRVXJ6OiO1li86m/TfYO373dADC7/Y4rZEsKAH+LfPk8wwMSMyt+ZA==","mode":33188,"size":88698},"node_modules/.bin/esbuild":{"checkedAt":1794532128968,"integrity":"sha512-29N4SaeraPcNUUwte/KkloNqU9dNiz7KaNjnxQuF1wxrxclYZMv00o7Wu2PP3muBR0wFDa1UbALkoeA3KQazEw==","mode":33261,"size":280},"package.json":{"checkedAt":1794532095796,"integrity":"sha512-n04Kye7NDajXhIpNHCjto+7lsdJIu9hzpLCDxM1XmTfl7OOQ0qpw7IblVBS1h40k3GwdfH++bFE2sS9IR1MqoQ==","mode":33188,"size":1463}}}}
@@ -0,0 +1,315 @@
var path = require('path');
var test = require('tape');
var resolve = require('../');
test('mock', function (t) {
t.plan(8);
var files = {};
files[path.resolve('/foo/bar/baz.js')] = 'beep';
var dirs = {};
dirs[path.resolve('/foo/bar')] = true;
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
},
realpath: function (file, cb) {
cb(null, file);
}
};
}
resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg, undefined);
});
resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg, undefined);
});
resolve('baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
resolve('../baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
});
test('mock from package', function (t) {
t.plan(8);
var files = {};
files[path.resolve('/foo/bar/baz.js')] = 'beep';
var dirs = {};
dirs[path.resolve('/foo/bar')] = true;
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, file));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
'package': { main: 'bar' },
readFile: function (file, cb) {
cb(null, files[file]);
},
realpath: function (file, cb) {
cb(null, file);
}
};
}
resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg && pkg.main, 'bar');
});
resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg && pkg.main, 'bar');
});
resolve('baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
resolve('../baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
});
test('mock package', function (t) {
t.plan(2);
var files = {};
files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep';
files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({
main: './baz.js'
});
var dirs = {};
dirs[path.resolve('/foo')] = true;
dirs[path.resolve('/foo/node_modules')] = true;
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
},
realpath: function (file, cb) {
cb(null, file);
}
};
}
resolve('bar', opts('/foo'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/node_modules/bar/baz.js'));
t.equal(pkg && pkg.main, './baz.js');
});
});
test('mock package from package', function (t) {
t.plan(2);
var files = {};
files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep';
files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({
main: './baz.js'
});
var dirs = {};
dirs[path.resolve('/foo')] = true;
dirs[path.resolve('/foo/node_modules')] = true;
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
'package': { main: 'bar' },
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
},
realpath: function (file, cb) {
cb(null, file);
}
};
}
resolve('bar', opts('/foo'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/node_modules/bar/baz.js'));
t.equal(pkg && pkg.main, './baz.js');
});
});
test('symlinked', function (t) {
t.plan(4);
var files = {};
files[path.resolve('/foo/bar/baz.js')] = 'beep';
files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep';
var dirs = {};
dirs[path.resolve('/foo/bar')] = true;
dirs[path.resolve('/foo/bar/symlinked')] = true;
function opts(basedir) {
return {
preserveSymlinks: false,
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
},
realpath: function (file, cb) {
var resolved = path.resolve(file);
if (resolved.indexOf('symlinked') >= 0) {
cb(null, resolved);
return;
}
var ext = path.extname(resolved);
if (ext) {
var dir = path.dirname(resolved);
var base = path.basename(resolved);
cb(null, path.join(dir, 'symlinked', base));
} else {
cb(null, path.join(resolved, 'symlinked'));
}
}
};
}
resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/symlinked/baz.js'));
t.equal(pkg, undefined);
});
resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/symlinked/baz.js'));
t.equal(pkg, undefined);
});
});
test('readPackage', function (t) {
t.plan(3);
var files = {};
files[path.resolve('/foo/node_modules/bar/something-else.js')] = 'beep';
files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({
main: './baz.js'
});
files[path.resolve('/foo/node_modules/bar/baz.js')] = 'boop';
var dirs = {};
dirs[path.resolve('/foo')] = true;
dirs[path.resolve('/foo/node_modules')] = true;
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
isDirectory: function (dir, cb) {
cb(null, !!dirs[path.resolve(dir)]);
},
'package': { main: 'bar' },
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
},
realpath: function (file, cb) {
cb(null, file);
}
};
}
t.test('with readFile', function (st) {
st.plan(3);
resolve('bar', opts('/foo'), function (err, res, pkg) {
st.error(err);
st.equal(res, path.resolve('/foo/node_modules/bar/baz.js'));
st.equal(pkg && pkg.main, './baz.js');
});
});
var readPackage = function (readFile, file, cb) {
var barPackage = path.join('bar', 'package.json');
if (file.slice(-barPackage.length) === barPackage) {
cb(null, { main: './something-else.js' });
} else {
cb(null, JSON.parse(files[path.resolve(file)]));
}
};
t.test('with readPackage', function (st) {
st.plan(3);
var options = opts('/foo');
delete options.readFile;
options.readPackage = readPackage;
resolve('bar', options, function (err, res, pkg) {
st.error(err);
st.equal(res, path.resolve('/foo/node_modules/bar/something-else.js'));
st.equal(pkg && pkg.main, './something-else.js');
});
});
t.test('with readFile and readPackage', function (st) {
st.plan(1);
var options = opts('/foo');
options.readPackage = readPackage;
resolve('bar', options, function (err) {
st.throws(function () { throw err; }, TypeError, 'errors when both readFile and readPackage are provided');
});
});
});
@@ -0,0 +1,426 @@
// A derivative work based on:
// <https://github.com/browserify/path-browserify>.
// Which is licensed:
//
// MIT License
//
// Copyright (c) 2013 James Halliday
//
// 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.
// A derivative work based on:
//
// Parts of that are extracted from Node’s internal `path` module:
// <https://github.com/nodejs/node/blob/master/lib/path.js>.
// Which is licensed:
//
// Copyright Joyent, Inc. and other Node 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.
export const minpath = {basename, dirname, extname, join, sep: '/'}
/* eslint-disable max-depth, complexity */
/**
* Get the basename from a path.
*
* @param {string} path
* File path.
* @param {string | null | undefined} [extname]
* Extension to strip.
* @returns {string}
* Stem or basename.
*/
function basename(path, extname) {
if (extname !== undefined && typeof extname !== 'string') {
throw new TypeError('"ext" argument must be a string')
}
assertPath(path)
let start = 0
let end = -1
let index = path.length
/** @type {boolean | undefined} */
let seenNonSlash
if (
extname === undefined ||
extname.length === 0 ||
extname.length > path.length
) {
while (index--) {
if (path.codePointAt(index) === 47 /* `/` */) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now.
if (seenNonSlash) {
start = index + 1
break
}
} else if (end < 0) {
// We saw the first non-path separator, mark this as the end of our
// path component.
seenNonSlash = true
end = index + 1
}
}
return end < 0 ? '' : path.slice(start, end)
}
if (extname === path) {
return ''
}
let firstNonSlashEnd = -1
let extnameIndex = extname.length - 1
while (index--) {
if (path.codePointAt(index) === 47 /* `/` */) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now.
if (seenNonSlash) {
start = index + 1
break
}
} else {
if (firstNonSlashEnd < 0) {
// We saw the first non-path separator, remember this index in case
// we need it if the extension ends up not matching.
seenNonSlash = true
firstNonSlashEnd = index + 1
}
if (extnameIndex > -1) {
// Try to match the explicit extension.
if (path.codePointAt(index) === extname.codePointAt(extnameIndex--)) {
if (extnameIndex < 0) {
// We matched the extension, so mark this as the end of our path
// component
end = index
}
} else {
// Extension does not match, so our result is the entire path
// component
extnameIndex = -1
end = firstNonSlashEnd
}
}
}
}
if (start === end) {
end = firstNonSlashEnd
} else if (end < 0) {
end = path.length
}
return path.slice(start, end)
}
/**
* Get the dirname from a path.
*
* @param {string} path
* File path.
* @returns {string}
* File path.
*/
function dirname(path) {
assertPath(path)
if (path.length === 0) {
return '.'
}
let end = -1
let index = path.length
/** @type {boolean | undefined} */
let unmatchedSlash
// Prefix `--` is important to not run on `0`.
while (--index) {
if (path.codePointAt(index) === 47 /* `/` */) {
if (unmatchedSlash) {
end = index
break
}
} else if (!unmatchedSlash) {
// We saw the first non-path separator
unmatchedSlash = true
}
}
return end < 0
? path.codePointAt(0) === 47 /* `/` */
? '/'
: '.'
: end === 1 && path.codePointAt(0) === 47 /* `/` */
? '//'
: path.slice(0, end)
}
/**
* Get an extname from a path.
*
* @param {string} path
* File path.
* @returns {string}
* Extname.
*/
function extname(path) {
assertPath(path)
let index = path.length
let end = -1
let startPart = 0
let startDot = -1
// Track the state of characters (if any) we see before our first dot and
// after any path separator we find.
let preDotState = 0
/** @type {boolean | undefined} */
let unmatchedSlash
while (index--) {
const code = path.codePointAt(index)
if (code === 47 /* `/` */) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now.
if (unmatchedSlash) {
startPart = index + 1
break
}
continue
}
if (end < 0) {
// We saw the first non-path separator, mark this as the end of our
// extension.
unmatchedSlash = true
end = index + 1
}
if (code === 46 /* `.` */) {
// If this is our first dot, mark it as the start of our extension.
if (startDot < 0) {
startDot = index
} else if (preDotState !== 1) {
preDotState = 1
}
} else if (startDot > -1) {
// We saw a non-dot and non-path separator before our dot, so we should
// have a good chance at having a non-empty extension.
preDotState = -1
}
}
if (
startDot < 0 ||
end < 0 ||
// We saw a non-dot character immediately before the dot.
preDotState === 0 ||
// The (right-most) trimmed path component is exactly `..`.
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
) {
return ''
}
return path.slice(startDot, end)
}
/**
* Join segments from a path.
*
* @param {Array<string>} segments
* Path segments.
* @returns {string}
* File path.
*/
function join(...segments) {
let index = -1
/** @type {string | undefined} */
let joined
while (++index < segments.length) {
assertPath(segments[index])
if (segments[index]) {
joined =
joined === undefined ? segments[index] : joined + '/' + segments[index]
}
}
return joined === undefined ? '.' : normalize(joined)
}
/**
* Normalize a basic file path.
*
* @param {string} path
* File path.
* @returns {string}
* File path.
*/
// Note: `normalize` is not exposed as `path.normalize`, so some code is
// manually removed from it.
function normalize(path) {
assertPath(path)
const absolute = path.codePointAt(0) === 47 /* `/` */
// Normalize the path according to POSIX rules.
let value = normalizeString(path, !absolute)
if (value.length === 0 && !absolute) {
value = '.'
}
if (value.length > 0 && path.codePointAt(path.length - 1) === 47 /* / */) {
value += '/'
}
return absolute ? '/' + value : value
}
/**
* Resolve `.` and `..` elements in a path with directory names.
*
* @param {string} path
* File path.
* @param {boolean} allowAboveRoot
* Whether `..` can move above root.
* @returns {string}
* File path.
*/
function normalizeString(path, allowAboveRoot) {
let result = ''
let lastSegmentLength = 0
let lastSlash = -1
let dots = 0
let index = -1
/** @type {number | undefined} */
let code
/** @type {number} */
let lastSlashIndex
while (++index <= path.length) {
if (index < path.length) {
code = path.codePointAt(index)
} else if (code === 47 /* `/` */) {
break
} else {
code = 47 /* `/` */
}
if (code === 47 /* `/` */) {
if (lastSlash === index - 1 || dots === 1) {
// Empty.
} else if (lastSlash !== index - 1 && dots === 2) {
if (
result.length < 2 ||
lastSegmentLength !== 2 ||
result.codePointAt(result.length - 1) !== 46 /* `.` */ ||
result.codePointAt(result.length - 2) !== 46 /* `.` */
) {
if (result.length > 2) {
lastSlashIndex = result.lastIndexOf('/')
if (lastSlashIndex !== result.length - 1) {
if (lastSlashIndex < 0) {
result = ''
lastSegmentLength = 0
} else {
result = result.slice(0, lastSlashIndex)
lastSegmentLength = result.length - 1 - result.lastIndexOf('/')
}
lastSlash = index
dots = 0
continue
}
} else if (result.length > 0) {
result = ''
lastSegmentLength = 0
lastSlash = index
dots = 0
continue
}
}
if (allowAboveRoot) {
result = result.length > 0 ? result + '/..' : '..'
lastSegmentLength = 2
}
} else {
if (result.length > 0) {
result += '/' + path.slice(lastSlash + 1, index)
} else {
result = path.slice(lastSlash + 1, index)
}
lastSegmentLength = index - lastSlash - 1
}
lastSlash = index
dots = 0
} else if (code === 46 /* `.` */ && dots > -1) {
dots++
} else {
dots = -1
}
}
return result
}
/**
* Make sure `path` is a string.
*
* @param {string} path
* File path.
* @returns {asserts path is string}
* Nothing.
*/
function assertPath(path) {
if (typeof path !== 'string') {
throw new TypeError(
'Path must be a string. Received ' + JSON.stringify(path)
)
}
}
/* eslint-enable max-depth, complexity */
@@ -0,0 +1,829 @@
export default `flf2a$ 8 6 17 -1 11
nancyj-fancy.flf
named after the login of a woman who asked me to make her a
sig. this is the font that came out of it. this is my first
attempt at a figlet font, so leave me alone.
vampyr@acs.bu.edu
Modified to make tabs blanks by Paul Burton <solution@earthlink.net>
$$ @
$$ @
$$ @
$$ @
$$ @
$$ @
$$ @
$$ @@
dP @
88 @
88 @
dP @
@
oo @
@
@@
dP dP @
dP dP @
@
@
@
@
@
@@
@
dP dP @
8888888 @
88 88 @
8888888 @
dP dP @
@
@@
# # @
.d8888P' @
Y8#oo#o. @
# #88 @
\`88888P' @
# # @
@
@@
d8P dP @
8 8 d8' @
Y8P d8' @
d8' d8P @
d8' 8 8 @
88 Y8P @
@
@@
d88b @
8\`'8 @
d8b @
d8P\`8b @
d8' \`8bP @
\`888P'\`YP @
@
@@
d8 @
88 @
.P @
@
@
@
@
@@
a88P @
d8' @
88 @
88 @
Y8. @
Y88b @
@
@@
Y88o @
\`8b @
88 @
88 @
.8P @
d88Y @
@
@@
dP @
8b. 88 .d8 @
\`8b88d8' @
.8P88Y8. @
8P' 88 \`Y8 @
dP @
@
@@
@
dP @
88 @
88888888 @
88 @
dP @
@
@@
@
@
@
@
dP @
88 @
.P @
@@
@
@
@
88888888 @
@
@
@
@@
@
@
@
@
dP @
88 @
@
@@
d8' @
d8' @
d8' @
d8' @
d8' @
88 @
@
@@
a8888a @
d8' ..8b @
88 .P 88 @
88 d' 88 @
Y8'' .8P @
Y8888P @
@
@@
d88 @
88 @
88 @
88 @
88 @
d88P @
@
@@
d8888b. @
\`88 @
.aaadP' @
88' @
88. @
Y88888P @
@
@@
d8888b. @
\`88 @
aaad8' @
\`88 @
.88 @
d88888P @
@
@@
dP dP @
88 88 @
88aaa88 @
88 @
88 @
dP @
@
@@
888888P @
88' @
88baaa. @
\`88 @
88 @
d88888P @
@
@@
.d8888P @
88' @
88baaa. @
88\` \`88 @
8b. .d8 @
\`Y888P' @
@
@@
d88888P @
d8' @
d8' @
d8' @
d8' @
d8' @
@
@@
.d888b. @
Y8' \`8P @
d8bad8b @
88\` \`88 @
8b. .88 @
Y88888P @
@
@@
.d888b. @
Y8' \`88 @
\`8bad88 @
\`88 @
d. .88 @
\`8888P @
@
@@
dP @
88 @
@
@
dP @
88 @
@
@@
dP @
88 @
@
@
dP @
88 @
.P @
@@
d8 @
d8' @
d8' @
Y8. @
Y8. @
Y8 @
@
@@
@
@
aaaaaaaa @
@
88888888 @
@
@
@@
8b @
\`8b @
\`8b @
.8P @
.8P @
8P @
@
@@
.d8888ba @
\`8' \`8b @
.d8' @
d8P' @
"" @
oo @
@
@@
a88888b. @
d8' \`88 @
88 d8P 88 @
88 Yo8b88 @
Y8. @
Y88888P' @
@
@@
MMP"""""""MM @
M' .mmmm MM @
M \`M @
M MMMMM MM @
M MMMMM MM @
M MMMMM MM @
MMMMMMMMMMMM @
@@
M#"""""""'M$ @
## mmmm. \`M @
#' .M @
M# MMMb.'YM @
M# MMMM' M @
M# .;M @
M#########M$ @
@@
MM'""""'YMM @
M' .mmm. \`M @
M MMMMMooM @
M MMMMMMMM @
M. \`MMM' .M @
MM. .dM @
MMMMMMMMMMM @
@@
M""""""'YMM @
M mmmm. \`M @
M MMMMM M @
M MMMMM M @
M MMMM' .M @
M .MM @
MMMMMMMMMMM @
@@
MM""""""""\`M @
MM mmmmmmmM @
M\` MMMM @
MM MMMMMMMM @
MM MMMMMMMM @
MM .M @
MMMMMMMMMMMM @
@@
MM""""""""\`M @
MM mmmmmmmM @
M' MMMM @
MM MMMMMMMM @
MM MMMMMMMM @
MM MMMMMMMM @
MMMMMMMMMMMM @
@@
MM'"""""\`MM @
M' .mmm. \`M @
M MMMMMMMM @
M MMM \`M @
M. \`MMM' .M @
MM. .MM @
MMMMMMMMMMM @
@@
M""MMMMM""MM @
M MMMMM MM @
M \`M @
M MMMMM MM @
M MMMMM MM @
M MMMMM MM @
MMMMMMMMMMMM @
@@
M""M @
M M @
M M @
M M @
M M @
M M @
MMMM @
@@
MMMMMMMM""M @
MMMMMMMM M @
MMMMMMMM M @
MMMMMMMM M @
M. \`MMM' .M @
MM. .MM @
MMMMMMMMMMM @
@@
M""MMMMM""M @
M MMMM' .M @
M .MM @
M MMMb. YM @
M MMMMb M @
M MMMMM M @
MMMMMMMMMMM @
@@
M""MMMMMMMM @
M MMMMMMMM @
M MMMMMMMM @
M MMMMMMMM @
M MMMMMMMM @
M M @
MMMMMMMMMMM @
@@
M"""""\`'"""\`YM @
M mm. mm. M @
M MMM MMM M @
M MMM MMM M @
M MMM MMM M @
M MMM MMM M @
MMMMMMMMMMMMMM @
@@
M"""""""\`YM @
M mmmm. M @
M MMMMM M @
M MMMMM M @
M MMMMM M @
M MMMMM M @
MMMMMMMMMMM @
@@
MMP"""""YMM @
M' .mmm. \`M @
M MMMMM M @
M MMMMM M @
M. \`MMM' .M @
MMb dMM @
MMMMMMMMMMM @
@@
MM"""""""\`YM @
MM mmmmm M @
M' .M @
MM MMMMMMMM @
MM MMMMMMMM @
MM MMMMMMMM @
MMMMMMMMMMMM @
@@
MM'"""""\`MMM @
M .mmm, MM @
M MMMMM MM @
M MM M MM @
M \`MM MM @
MM. .. \`M @
MMMMMMMMMMMM @
@@
MM"""""""\`MM @
MM mmmm, M @
M' .M @
MM MMMb. "M @
MM MMMMM M @
MM MMMMM M @
MMMMMMMMMMMM @
@@
MP""""""\`MM @
M mmmmm..M @
M. \`YM @
MMMMMMM. M @
M. .MMM' M @
Mb. .dM @
MMMMMMMMMMM @
@@
M""""""""M @
Mmmm mmmM @
MMMM MMMM @
MMMM MMMM @
MMMM MMMM @
MMMM MMMM @
MMMMMMMMMM @
@@
M""MMMMM""M @
M MMMMM M @
M MMMMM M @
M MMMMM M @
M \`MMM' M @
Mb dM @
MMMMMMMMMMM @
@@
M""MMMMM""M @
M MMMMM M @
M MMMMP M @
M MMMM' .M @
M MMP' .MM @
M .dMMM @
MMMMMMMMMMM @
@@
M""MMM""MMM""M @
M MMM MMM M @
M MMP MMP M @
M MM' MM' .M @
M \`' . '' .MM @
M .d .dMMM @
MMMMMMMMMMMMMM @
@@
M""MMMM""M @
M \`MM' M @
MM. .MM @
M .mm. M @
M MMMM M @
M MMMM M @
MMMMMMMMMM @
@@
M""MMMM""M @
M. \`MM' .M @
MM. .MM @
MMMb dMMM @
MMMM MMMM @
MMMM MMMM @
MMMMMMMMMM @
@@
M""""""""\`M @
Mmmmmm .M @
MMMMP .MMM @
MMP .MMMMM @
M' .MMMMMMM @
M M @
MMMMMMMMMMM @
@@
8888P @
88 @
88 @
88 @
88 @
88888 @
@
@@
Yb @
\`Yb @
\`Yb @
\`Yb @
\`Yb @
88 @
@
@@
d8888 @
88 @
88 @
88 @
88 @
88888 @
@
@@
db @
d8'\`8b @
\`" "' @
@
@
@
@
@@
@
@
@
@
@
@
oooooooooooo @
@@
dP @
88 @
Y. @
@
@
@
@
@@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`88888P8 @
@
@@
dP @
88 @
88d888b. @
88' \`88 @
88. .88 @
88Y8888' @
@
@@
@
@
.d8888b. @
88' \`"" @
88. ... @
\`88888P' @
@
@@
dP @
88 @
.d888b88 @
88' \`88 @
88. .88 @
\`88888P8 @
@
@@
@
@
.d8888b. @
88ooood8 @
88. ... @
\`88888P' @
@
@@
.8888b @
88 " @
88aaa @
88 @
88 @
dP @
@
@@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`8888P88 @
.88 @
d8888P @@
dP @
88 @
88d888b. @
88' \`88 @
88 88 @
dP dP @
@
@@
oo @
@
dP @
88 @
88 @
dP @
@
@@
oo @
@
dP @
88 @
88 @
88 @
88 @
dP @@
dP @
88 @
88 .dP @
88888" @
88 \`8b. @
dP \`YP @
@
@@
dP @
88 @
88 @
88 @
88 @
dP @
@
@@
@
@
88d8b.d8b. @
88'\`88'\`88 @
88 88 88 @
dP dP dP @
@
@@
@
@
88d888b. @
88' \`88 @
88 88 @
dP dP @
@
@@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`88888P' @
@
@@
@
@
88d888b. @
88' \`88 @
88. .88 @
88Y888P' @
88 @
dP @@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`8888P88 @
88 @
dP @@
@
@
88d888b. @
88' \`88 @
88 @
dP @
@
@@
@
@
.d8888b. @
Y8ooooo. @
88 @
\`88888P' @
@
@@
dP @
88 @
d8888P @
88 @
88 @
dP @
@
@@
@
@
dP dP @
88 88 @
88. .88 @
\`88888P' @
@
@@
@
@
dP .dP @
88 d8' @
88 .88' @
8888P' @
@
@@
@
@
dP dP dP @
88 88 88 @
88.88b.88' @
8888P Y8P @
@
@@
@
@
dP. .dP @
\`8bd8' @
.d88b. @
dP' \`dP @
@
@@
@
@
dP dP @
88 88 @
88. .88 @
\`8888P88 @
.88 @
d8888P @@
@
@
d888888b @
.d8P' @
.Y8P @
d888888P @
@
@@
.d88P @
8: @
.oY8. @
d8 @
8: @
\`Y88b @
@
@@
dP @
88 @
"' @
dP @
88 @
"' @
@
@@
d88b. @
:8 @
.8Yo. @
8b @
:8 @
Y88P' @
@
@@
.oo. .d @
dP" "d8P @
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,20 @@
import {TokenType as tt} from "../parser/tokenizer/types";
import Transformer from "./Transformer";
export default class NumericSeparatorTransformer extends Transformer {
constructor( tokens) {
super();this.tokens = tokens;;
}
process() {
if (this.tokens.matches1(tt.num)) {
const code = this.tokens.currentTokenCode();
if (code.includes("_")) {
this.tokens.replaceToken(code.replace(/_/g, ""));
return true;
}
}
return false;
}
}
@@ -0,0 +1,58 @@
let comparisonMap = {
atrule: ['name', 'params'],
rule: ['selector'],
}
let types = new Set(Object.keys(comparisonMap))
export default function collapseAdjacentRules() {
function collapseRulesIn(root) {
let currentRule = null
root.each((node) => {
if (!types.has(node.type)) {
currentRule = null
return
}
if (currentRule === null) {
currentRule = node
return
}
let properties = comparisonMap[node.type]
if (node.type === 'atrule' && node.name === 'font-face') {
currentRule = node
} else if (
properties.every(
(property) =>
(node[property] ?? '').replace(/\s+/g, ' ') ===
(currentRule[property] ?? '').replace(/\s+/g, ' ')
)
) {
// An AtRule may not have children (for example if we encounter duplicate @import url(…) rules)
if (node.nodes) {
currentRule.append(node.nodes)
}
node.remove()
} else {
currentRule = node
}
})
// After we've collapsed adjacent rules & at-rules, we need to collapse
// adjacent rules & at-rules that are children of at-rules.
// We do not care about nesting rules because Tailwind CSS
// explicitly does not handle rule nesting on its own as
// the user is expected to use a nesting plugin
root.each((node) => {
if (node.type === 'atrule') {
collapseRulesIn(node)
}
})
}
return (root) => {
collapseRulesIn(root)
}
}
@@ -0,0 +1,71 @@
'use strict';
import utils from './../utils.js';
class InterceptorManager {
constructor() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
use(fulfilled, rejected, options) {
this.handlers.push({
fulfilled,
rejected,
synchronous: options ? options.synchronous : false,
runWhen: options ? options.runWhen : null
});
return this.handlers.length - 1;
}
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*
* @returns {void}
*/
eject(id) {
if (this.handlers[id]) {
this.handlers[id] = null;
}
}
/**
* Clear all interceptors from the stack
*
* @returns {void}
*/
clear() {
if (this.handlers) {
this.handlers = [];
}
}
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*
* @returns {void}
*/
forEach(fn) {
utils.forEach(this.handlers, function forEachHandler(h) {
if (h !== null) {
fn(h);
}
});
}
}
export default InterceptorManager;
@@ -0,0 +1 @@
{"version":3,"file":"updateMetadataOptional.d.ts","sourceRoot":"","sources":["../../../../src/metadata/actions/updateMetadataOptional.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAE9F,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,2BAA2B,GAAG,gCAAgC,GACvE,2BAA2B,GAAG,gCAAgC,CAWhE"}
@@ -0,0 +1,93 @@
import { Decimal } from 'decimal.js';
/**
* https://tc39.es/ecma262/#sec-tostring
*/
export declare function ToString(o: unknown): string;
/**
* https://tc39.es/ecma262/#sec-tonumber
* @param val
*/
export declare function ToNumber(arg: any): Decimal;
/**
* https://tc39.es/ecma262/#sec-timeclip
* @param time
*/
export declare function TimeClip(time: Decimal): Decimal;
/**
* https://tc39.es/ecma262/#sec-toobject
* @param arg
*/
export declare function ToObject<T>(arg: T): T extends null ? never : T extends undefined ? never : T;
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-samevalue
* @param x
* @param y
*/
export declare function SameValue(x: any, y: any): boolean;
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-arraycreate
* @param len
*/
export declare function ArrayCreate<T = any>(len: number): T[];
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-hasownproperty
* @param o
* @param prop
*/
export declare function HasOwnProperty(o: object, prop: string): boolean;
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type
* @param x
*/
export declare function Type(x: any): 'Null' | 'Undefined' | 'Object' | 'Number' | 'Boolean' | 'String' | 'Symbol' | 'BigInt' | undefined;
/**
* https://tc39.es/ecma262/#eqn-Day
* @param t
*/
export declare function Day(t: number): number;
/**
* https://tc39.es/ecma262/#sec-week-day
* @param t
*/
export declare function WeekDay(t: number): number;
/**
* https://tc39.es/ecma262/#sec-year-number
* @param y
*/
export declare function DayFromYear(y: number): number;
/**
* https://tc39.es/ecma262/#sec-year-number
* @param y
*/
export declare function TimeFromYear(y: number): number;
/**
* https://tc39.es/ecma262/#sec-year-number
* @param t
*/
export declare function YearFromTime(t: number): number;
export declare function DaysInYear(y: number): 365 | 366;
export declare function DayWithinYear(t: number): number;
export declare function InLeapYear(t: number): 0 | 1;
/**
* https://tc39.es/ecma262/#sec-month-number
* @param t
*/
export declare function MonthFromTime(t: number): 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
export declare function DateFromTime(t: number): number;
export declare function HourFromTime(t: number): number;
export declare function MinFromTime(t: number): number;
export declare function SecFromTime(t: number): number;
/**
* The abstract operation OrdinaryHasInstance implements
* the default algorithm for determining if an object O
* inherits from the instance object inheritance path
* provided by constructor C.
* @param C class
* @param O object
* @param internalSlots internalSlots
*/
export declare function OrdinaryHasInstance(C: Object, O: any, internalSlots?: {
boundTargetFunction: any;
}): boolean;
export declare function msFromTime(t: number): number;
export declare function ToPrimitive<T extends 'string' | 'number' = 'string' | 'number'>(input: any, preferredType: T): string | number | boolean | undefined | null;
@@ -0,0 +1,33 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _charcodes = require('./charcodes');
// https://tc39.github.io/ecma262/#sec-white-space
const WHITESPACE_CHARS = [
0x0009,
0x000b,
0x000c,
_charcodes.charCodes.space,
_charcodes.charCodes.nonBreakingSpace,
_charcodes.charCodes.oghamSpaceMark,
0x2000, // EN QUAD
0x2001, // EM QUAD
0x2002, // EN SPACE
0x2003, // EM SPACE
0x2004, // THREE-PER-EM SPACE
0x2005, // FOUR-PER-EM SPACE
0x2006, // SIX-PER-EM SPACE
0x2007, // FIGURE SPACE
0x2008, // PUNCTUATION SPACE
0x2009, // THIN SPACE
0x200a, // HAIR SPACE
0x202f, // NARROW NO-BREAK SPACE
0x205f, // MEDIUM MATHEMATICAL SPACE
0x3000, // IDEOGRAPHIC SPACE
0xfeff, // ZERO WIDTH NO-BREAK SPACE
]; exports.WHITESPACE_CHARS = WHITESPACE_CHARS;
const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; exports.skipWhiteSpace = skipWhiteSpace;
const IS_WHITESPACE = new Uint8Array(65536); exports.IS_WHITESPACE = IS_WHITESPACE;
for (const char of exports.WHITESPACE_CHARS) {
exports.IS_WHITESPACE[char] = 1;
}
@@ -0,0 +1,28 @@
import { OneBotAction } from '../../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
export declare const GetFilesetIdPayloadSchema: import("@sinclair/typebox").TObject<{
share_code: import("@sinclair/typebox").TString;
}>;
export type GetFilesetIdPayload = Static<typeof GetFilesetIdPayloadSchema>;
export declare class GetFilesetId extends OneBotAction<GetFilesetIdPayload, {
fileset_id: string;
}> {
actionName: "get_fileset_id";
payloadSchema: import("@sinclair/typebox").TObject<{
share_code: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TObject<{
fileset_id: import("@sinclair/typebox").TString;
}>;
actionSummary: string;
actionTags: string[];
payloadExample: {
share_code: string;
};
returnExample: {
fileset_id: string;
};
_handle(payload: GetFilesetIdPayload): Promise<{
fileset_id: string;
}>;
}
@@ -0,0 +1,67 @@
var objectAssign = require('object-assign')
function arrayRemove (arr, item) {
var idx = arr.indexOf(item)
if (~idx) arr.splice(idx, 1)
}
function FileAppender (strategy, req) {
this.strategy = strategy
this.req = req
switch (strategy) {
case 'NONE': break
case 'VALUE': break
case 'ARRAY': req.files = []; break
case 'OBJECT': req.files = Object.create(null); break
default: throw new Error('Unknown file strategy: ' + strategy)
}
}
FileAppender.prototype.insertPlaceholder = function (file) {
var placeholder = {
fieldname: file.fieldname
}
switch (this.strategy) {
case 'NONE': break
case 'VALUE': break
case 'ARRAY': this.req.files.push(placeholder); break
case 'OBJECT':
if (this.req.files[file.fieldname]) {
this.req.files[file.fieldname].push(placeholder)
} else {
this.req.files[file.fieldname] = [placeholder]
}
break
}
return placeholder
}
FileAppender.prototype.removePlaceholder = function (placeholder) {
switch (this.strategy) {
case 'NONE': break
case 'VALUE': break
case 'ARRAY': arrayRemove(this.req.files, placeholder); break
case 'OBJECT':
if (this.req.files[placeholder.fieldname].length === 1) {
delete this.req.files[placeholder.fieldname]
} else {
arrayRemove(this.req.files[placeholder.fieldname], placeholder)
}
break
}
}
FileAppender.prototype.replacePlaceholder = function (placeholder, file) {
if (this.strategy === 'VALUE') {
this.req.file = file
return
}
delete placeholder.fieldname
objectAssign(placeholder, file)
}
module.exports = FileAppender
@@ -0,0 +1,83 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const { ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getScope } = require("../util/eslint-compat")
const {
iterateProcessGetBuiltinModuleReferences,
} = require("../util/iterate-process-get-builtin-module-references")
/**
* @typedef TraceMap
* @property {import('@eslint-community/eslint-utils').TraceMap<boolean>} globals
* @property {import('@eslint-community/eslint-utils').TraceMap<boolean>} modules
*/
/**
* Verifier for `prefer-global/*` rules.
*/
class Verifier {
/**
* Initialize this instance.
* @param {import('eslint').Rule.RuleContext} context The rule context to report.
* @param {TraceMap} traceMap The track map.
*/
constructor(context, traceMap) {
this.context = context
this.traceMap = traceMap
this.verify =
context.options[0] === "never"
? this.verifyToPreferModules
: this.verifyToPreferGlobals
}
/**
* Verify the code to suggest the use of globals.
* @returns {void}
*/
verifyToPreferGlobals() {
const { context, traceMap } = this
const scope = getScope(context)
const tracker = new ReferenceTracker(scope, {
mode: "legacy",
})
for (const { node } of [
...tracker.iterateCjsReferences(traceMap.modules),
...iterateProcessGetBuiltinModuleReferences(
tracker,
traceMap.modules
),
...tracker.iterateEsmReferences(traceMap.modules),
]) {
context.report({ node, messageId: "preferGlobal" })
}
}
/**
* Verify the code to suggest the use of modules.
* @returns {void}
*/
verifyToPreferModules() {
const { context, traceMap } = this
const scope = getScope(context)
const tracker = new ReferenceTracker(scope)
for (const { node } of tracker.iterateGlobalReferences(
traceMap.globals
)) {
context.report({ node, messageId: "preferModule" })
}
}
}
/**
* @param {import('eslint').Rule.RuleContext} context
* @param {TraceMap} traceMap
* @returns {void}
*/
module.exports = function checkForPreferGlobal(context, traceMap) {
new Verifier(context, traceMap).verify()
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=MaybeClassMetadata.js.map
@@ -0,0 +1,10 @@
"use client";
import {
Form,
FormContext
} from "./chunk-SLABUSGS.mjs";
import "./chunk-BSTJ7ZCN.mjs";
export {
Form,
FormContext
};
@@ -0,0 +1,3 @@
var l=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,u=e=>!e||typeof e!="object"||Object.keys(e).length===0,x=(e,o)=>JSON.stringify(e)===JSON.stringify(o),A=e=>typeof e=="boolean";function i(e,o){e.forEach(function(r){Array.isArray(r)?i(r,o):o.push(r);});}function y(e){let o=[];return i(e,o),o}var a=(...e)=>y(e).filter(Boolean),p=(e,o)=>{let r={},c=Object.keys(e),f=Object.keys(o);for(let t of c)if(f.includes(t)){let s=e[t],n=o[t];Array.isArray(s)||Array.isArray(n)?r[t]=a(n,s):typeof s=="object"&&typeof n=="object"?r[t]=p(s,n):r[t]=n+" "+s;}else r[t]=e[t];for(let t of f)c.includes(t)||(r[t]=o[t]);return r},g=e=>!e||typeof e!="string"?e:e.replace(/\s+/g," ").trim();
export { l as a, u as b, x as c, A as d, y as e, a as f, p as g, g as h };
@@ -0,0 +1,6 @@
"use strict";
const isLeapYear$1 = require("./isLeapYear-CZo5eAQg.js");
function isLeapYear(date) {
return isLeapYear$1.isLeapYear(date.getFullYear());
}
module.exports = isLeapYear;
@@ -0,0 +1,209 @@
/**
* @fileOverview Enforce a defaultProps definition for every prop that is not a required prop.
* @author Vitor Balocco
*/
'use strict';
const entries = require('object.entries');
const values = require('object.values');
const Components = require('../util/Components');
const docsUrl = require('../util/docsUrl');
const astUtil = require('../util/ast');
const report = require('../util/report');
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
const messages = {
noDefaultWithRequired: 'propType "{{name}}" is required and should not have a defaultProps declaration.',
shouldHaveDefault: 'propType "{{name}}" is not required, but has no corresponding defaultProps declaration.',
noDefaultPropsWithFunction: 'Don’t use defaultProps with function components.',
shouldAssignObjectDefault: 'propType "{{name}}" is not required, but has no corresponding default argument value.',
destructureInSignature: 'Must destructure props in the function signature to initialize an optional prop.',
};
function isPropWithNoDefaulVal(prop) {
if (prop.type === 'RestElement' || prop.type === 'ExperimentalRestProperty') {
return false;
}
return prop.value.type !== 'AssignmentPattern';
}
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Enforce a defaultProps definition for every prop that is not a required prop',
category: 'Best Practices',
url: docsUrl('require-default-props'),
},
messages,
schema: [{
type: 'object',
properties: {
forbidDefaultForRequired: {
type: 'boolean',
},
classes: {
enum: ['defaultProps', 'ignore'],
},
functions: {
enum: ['defaultArguments', 'defaultProps', 'ignore'],
},
/**
* @deprecated
*/
ignoreFunctionalComponents: {
type: 'boolean',
},
},
additionalProperties: false,
}],
},
create: Components.detect((context, components) => {
const configuration = context.options[0] || {};
const forbidDefaultForRequired = configuration.forbidDefaultForRequired || false;
const classes = configuration.classes || 'defaultProps';
/**
* @todo
* - Remove ignoreFunctionalComponents
* - Change default to 'defaultArguments'
*/
const functions = configuration.ignoreFunctionalComponents
? 'ignore'
: configuration.functions || 'defaultProps';
/**
* Reports all propTypes passed in that don't have a defaultProps counterpart.
* @param {Object[]} propTypes List of propTypes to check.
* @param {Object} defaultProps Object of defaultProps to check. Keys are the props names.
* @return {void}
*/
function reportPropTypesWithoutDefault(propTypes, defaultProps) {
entries(propTypes).forEach((propType) => {
const propName = propType[0];
const prop = propType[1];
if (!prop.node) {
return;
}
if (prop.isRequired) {
if (forbidDefaultForRequired && defaultProps[propName]) {
report(context, messages.noDefaultWithRequired, 'noDefaultWithRequired', {
node: prop.node,
data: { name: propName },
});
}
return;
}
if (defaultProps[propName]) {
return;
}
report(context, messages.shouldHaveDefault, 'shouldHaveDefault', {
node: prop.node,
data: { name: propName },
});
});
}
/**
* If functions option is 'defaultArguments', reports defaultProps is used and all params that doesn't initialized.
* @param {Object} componentNode Node of component.
* @param {Object[]} declaredPropTypes List of propTypes to check `isRequired`.
* @param {Object} defaultProps Object of defaultProps to check used.
*/
function reportFunctionComponent(componentNode, declaredPropTypes, defaultProps) {
if (defaultProps) {
report(context, messages.noDefaultPropsWithFunction, 'noDefaultPropsWithFunction', {
node: componentNode,
});
}
const props = componentNode.params[0];
const propTypes = declaredPropTypes;
if (!props) {
return;
}
if (props.type === 'Identifier') {
const hasOptionalProp = values(propTypes).some((propType) => !propType.isRequired);
if (hasOptionalProp) {
report(context, messages.destructureInSignature, 'destructureInSignature', {
node: props,
});
}
} else if (props.type === 'ObjectPattern') {
// Filter required props with default value and report error
props.properties.filter((prop) => {
const propName = prop && prop.key && prop.key.name;
const isPropRequired = propTypes[propName] && propTypes[propName].isRequired;
return propTypes[propName] && isPropRequired && !isPropWithNoDefaulVal(prop);
}).forEach((prop) => {
report(context, messages.noDefaultWithRequired, 'noDefaultWithRequired', {
node: prop,
data: { name: prop.key.name },
});
});
// Filter non required props with no default value and report error
props.properties.filter((prop) => {
const propName = prop && prop.key && prop.key.name;
const isPropRequired = propTypes[propName] && propTypes[propName].isRequired;
return propTypes[propName] && !isPropRequired && isPropWithNoDefaulVal(prop);
}).forEach((prop) => {
report(context, messages.shouldAssignObjectDefault, 'shouldAssignObjectDefault', {
node: prop,
data: { name: prop.key.name },
});
});
}
}
// --------------------------------------------------------------------------
// Public API
// --------------------------------------------------------------------------
return {
'Program:exit'() {
const list = components.list();
values(list).filter((component) => {
if (functions === 'ignore' && astUtil.isFunctionLike(component.node)) {
return false;
}
if (classes === 'ignore' && astUtil.isClass(component.node)) {
return false;
}
// If this defaultProps is "unresolved", then we should ignore this component and not report
// any errors for it, to avoid false-positives with e.g. external defaultProps declarations or spread operators.
if (component.defaultProps === 'unresolved') {
return false;
}
return component.declaredPropTypes !== undefined;
}).forEach((component) => {
if (functions === 'defaultArguments' && astUtil.isFunctionLike(component.node)) {
reportFunctionComponent(
component.node,
component.declaredPropTypes,
component.defaultProps
);
} else {
reportPropTypesWithoutDefault(
component.declaredPropTypes,
component.defaultProps || {}
);
}
});
},
};
}),
};
@@ -0,0 +1,46 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Number.EPSILON` property.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-number-epsilon.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' property is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
Number: {
EPSILON: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,118 @@
/**
* @fileoverview `Map` to load rules lazily.
* @author Toru Nagashima <https://github.com/mysticatea>
*/
"use strict";
const debug = require("debug")("eslint:rules");
/** @typedef {import("../../types").Rule.RuleModule} Rule */
/**
* The `Map` object that loads each rule when it's accessed.
* @example
* const rules = new LazyLoadingRuleMap([
* ["eqeqeq", () => require("eqeqeq")],
* ["semi", () => require("semi")],
* ["no-unused-vars", () => require("no-unused-vars")]
* ]);
*
* rules.get("semi"); // call `() => require("semi")` here.
*
* @extends {Map<string, Rule>}
*/
class LazyLoadingRuleMap extends Map {
/**
* Initialize this map.
* @param {Array<[string, function(): Rule]>} loaders The rule loaders.
*/
constructor(loaders) {
let remaining = loaders.length;
super(
debug.enabled
? loaders.map(([ruleId, load]) => {
let cache = null;
return [
ruleId,
() => {
if (!cache) {
debug(
"Loading rule %o (remaining=%d)",
ruleId,
--remaining,
);
cache = load();
}
return cache;
},
];
})
: loaders,
);
// `super(...iterable)` uses `this.set()`, so disable it here.
Object.defineProperty(LazyLoadingRuleMap.prototype, "set", {
configurable: true,
value: void 0,
});
}
/**
* Get a rule.
* Each rule will be loaded on the first access.
* @param {string} ruleId The rule ID to get.
* @returns {Rule|undefined} The rule.
*/
get(ruleId) {
const load = super.get(ruleId);
return load && load();
}
/**
* Iterate rules.
* @returns {IterableIterator<Rule>} Rules.
*/
*values() {
for (const load of super.values()) {
yield load();
}
}
/**
* Iterate rules.
* @returns {IterableIterator<[string, Rule]>} Rules.
*/
*entries() {
for (const [ruleId, load] of super.entries()) {
yield [ruleId, load()];
}
}
/**
* Call a function with each rule.
* @param {Function} callbackFn The callback function.
* @param {any} [thisArg] The object to pass to `this` of the callback function.
* @returns {void}
*/
forEach(callbackFn, thisArg) {
for (const [ruleId, load] of super.entries()) {
callbackFn.call(thisArg, load(), ruleId, this);
}
}
}
// Forbid mutation.
Object.defineProperties(LazyLoadingRuleMap.prototype, {
clear: { configurable: true, value: void 0 },
delete: { configurable: true, value: void 0 },
[Symbol.iterator]: {
configurable: true,
writable: true,
value: LazyLoadingRuleMap.prototype.entries,
},
});
module.exports = { LazyLoadingRuleMap };
@@ -0,0 +1,68 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var callBound = require('call-bound');
var inspect = require('object-inspect');
var $TypeError = require('es-errors/type');
var $Map = GetIntrinsic('%Map%', true);
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
var $mapGet = callBound('Map.prototype.get', true);
/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
var $mapSet = callBound('Map.prototype.set', true);
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
var $mapHas = callBound('Map.prototype.has', true);
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
var $mapDelete = callBound('Map.prototype.delete', true);
/** @type {<K, V>(thisArg: Map<K, V>) => number} */
var $mapSize = callBound('Map.prototype.size', true);
/** @type {import('.')} */
module.exports = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {
/** @typedef {ReturnType<typeof getSideChannelMap>} Channel */
/** @typedef {Parameters<Channel['get']>[0]} K */
/** @typedef {Parameters<Channel['set']>[1]} V */
/** @type {Map<K, V> | undefined} */ var $m;
/** @type {Channel} */
var channel = {
assert: function (key) {
if (!channel.has(key)) {
throw new $TypeError('Side channel does not contain ' + inspect(key));
}
},
'delete': function (key) {
if ($m) {
var result = $mapDelete($m, key);
if ($mapSize($m) === 0) {
$m = void undefined;
}
return result;
}
return false;
},
get: function (key) { // eslint-disable-line consistent-return
if ($m) {
return $mapGet($m, key);
}
},
has: function (key) {
if ($m) {
return $mapHas($m, key);
}
return false;
},
set: function (key, value) {
if (!$m) {
// @ts-expect-error TS can't handle narrowing a variable inside a closure
$m = new $Map();
}
$mapSet($m, key, value);
}
};
// @ts-expect-error TODO: figure out why TS is erroring here
return channel;
};
@@ -0,0 +1 @@
{"name":"iterator.prototype","version":"1.1.5","requiresBuild":false,"files":{".eslintrc":{"checkedAt":1794532098589,"integrity":"sha512-avVQBvEjZuAALik4d1n8WoPRiLLkkHk3sctxqfukG6S1H8uf6yDPtpr43KHC/m5Kvg+S4XoW8YPm8lL0Q1Uecg==","mode":420,"size":138},"LICENSE":{"checkedAt":1794532098590,"integrity":"sha512-zSWZlPMHqdrYcu0iKn0DZJ7EU8PHWsyOsYC+m2L4TRgwzvU+9Xsi8DCgqVoMt3xcoyvGCZp05dGObt+3xshLBw==","mode":420,"size":1071},"index.js":{"checkedAt":1794532098590,"integrity":"sha512-g+lUrGI54n9C6FG11T6EKjnoprKgxLYOmacEbrVaPxJ3ID8Scnhu8wWDl0Mq1uJa2HjOf4RXx8pike0VsHkMdA==","mode":420,"size":794},"test/index.js":{"checkedAt":1794532098590,"integrity":"sha512-Amk1JrW1jq6mFquBPLP1uSjpwaQ20mvMsHEDWb10nQGmyYyw2JC9DCr9l6+BG5vFtkaIzniQKvwMSqW2OpDfXA==","mode":420,"size":1400},"package.json":{"checkedAt":1794532098590,"integrity":"sha512-FZgcJCMxsfgR4qTbnd7d9Sx/9z/KG3BZl+/1SdRS4BP9Wf0ACYJusRWVo9mrYUWU7Y5KHeG/3AaOFCS7xmD2NQ==","mode":420,"size":2043},"CHANGELOG.md":{"checkedAt":1794532098590,"integrity":"sha512-nnbE1nni+IxiKSfUBYgS26gfEuJjPrCzNj6czPBA7rCVhlgL897Ybe0zZj11LxgcbDQvbjwuxAD/vpC5aOCb4A==","mode":420,"size":4900},"README.md":{"checkedAt":1794532098590,"integrity":"sha512-2etwAvlOxa07EkMUqcJB7tgqgpUUjKSz2B7N5Ren24EOzoxUpOG/qTALdU9FBjj/Jjo9Tlsl35ulR6d7H2NMwg==","mode":420,"size":1651},".github/FUNDING.yml":{"checkedAt":1794532098590,"integrity":"sha512-V9GKrK+Thtt33nqPwyfqegQ7iW6CBcQrKDJjlm7C1HH4I6zSxny/LbMzT4q5sJOT4MYEhVVTqFKT7RPRNCn8sw==","mode":420,"size":564}}}
@@ -0,0 +1,54 @@
{
"name": "p-locate",
"version": "5.0.0",
"description": "Get the first fulfilled promise that satisfies the provided testing function",
"license": "MIT",
"repository": "sindresorhus/p-locate",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"promise",
"locate",
"find",
"finder",
"search",
"searcher",
"test",
"array",
"collection",
"iterable",
"iterator",
"race",
"fulfilled",
"fastest",
"async",
"await",
"promises",
"bluebird"
],
"dependencies": {
"p-limit": "^3.0.2"
},
"devDependencies": {
"ava": "^2.4.0",
"delay": "^4.1.0",
"in-range": "^2.0.0",
"time-span": "^4.0.0",
"tsd": "^0.13.1",
"xo": "^0.32.1"
}
}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Khaled Al-Ansari
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,8 @@
export { default as Kbd, KbdProps } from './kbd.js';
export { KbdKey } from './utils.js';
export { useKbd } from './use-kbd.js';
import '@heroui/system-rsc';
import 'react';
import 'tailwind-variants';
import '@heroui/theme';
import '@heroui/react-utils';
@@ -0,0 +1,10 @@
import type { TSESLint } from '@typescript-eslint/utils';
export type MessageIds = 'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax';
export type Options = [
{
builtinGlobals?: boolean;
ignoreDeclarationMerge?: boolean;
}
];
declare const _default: TSESLint.RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener>;
export default _default;
@@ -0,0 +1,4 @@
export type Options = [('method' | 'property')?];
export type MessageIds = 'errorMethod' | 'errorProperty';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1,11 @@
import { PluginFunc } from 'dayjs/esm'
declare module 'dayjs/esm' {
interface ConfigTypeMap {
bigIntSupport: BigInt
}
export function unix(t: BigInt): Dayjs
}
declare const plugin: PluginFunc
export = plugin
@@ -0,0 +1 @@
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["compile.js"],"names":[],"mappings":"AA6DA;;;GAGG;AACH,kCAHW,cAAc,GAAG,IAAI,GAAG,SAAS,GAC/B,OAAO,CAgkCnB;;YA/lCa,OAAO,GAAG,SAAS;cACnB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;;oCAVtB,sBAAsB;6BAAtB,sBAAsB"}
@@ -0,0 +1,20 @@
'use strict';
var define = require('define-properties');
var getPolyfill = require('./polyfill');
var $IteratorPrototype = require('../Iterator.prototype/implementation');
var $Iterator = require('./implementation');
module.exports = function shimIteratorPrototypeCtor() {
var polyfill = getPolyfill();
define(
$IteratorPrototype,
{ constructor: $Iterator },
{ constructor: function () { return $Iterator.constructor !== polyfill; } }
);
return polyfill;
};
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Cody Olsen
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,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cacheNonRootPlanServiceNode = cacheNonRootPlanServiceNode;
const LazyPlanServiceNode_1 = require("../models/LazyPlanServiceNode");
function cacheNonRootPlanServiceNode(getPlanOptions, operations, planServiceNode, context) {
if (getPlanOptions !== undefined &&
((LazyPlanServiceNode_1.LazyPlanServiceNode.is(planServiceNode) &&
!planServiceNode.isExpanded()) ||
planServiceNode.isContextFree)) {
const planResult = {
tree: {
root: planServiceNode,
},
};
operations.setPlan(getPlanOptions, planResult);
}
else {
operations.setNonCachedServiceNode(planServiceNode, context);
}
}
//# sourceMappingURL=cacheNonRootPlanServiceNode.js.map
@@ -0,0 +1 @@
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/types/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,SAAS,CAAC,YAAY,SAAS,WAAW,IACpD,YAAY,CAAC,YAAY,CAAC,SAAS,IAAI,GACnC,OAAO,CAAC,MAAM,YAAY,EAAE,MAAM,CAAC,GACnC,MAAM,CAAC;AAEb,MAAM,MAAM,aAAa,CAAC,YAAY,SAAS,WAAW,IACxD,OAAO,CAAC,WAAW,CAAC,GAAG;IACrB,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,KAAK,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,IAAI,CAAC;CACd,CAAC;AAEJ,MAAM,MAAM,UAAU,CAAC,YAAY,SAAS,WAAW,IACrD,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,OAAO,EAAE,CAAC;AAEd,MAAM,MAAM,YAAY,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW,IACnE,gBAAgB,GAChB,iBAAiB,GACjB,mBAAmB,GACnB,aAAa,CAAC,YAAY,CAAC,CAAC;AAEhC,MAAM,MAAM,GAAG,GAAG,YAAY,CAAC;AAE/B,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,EAAE;QACF,GAAG,EAAE,GAAG,CAAC;QACT,IAAI,EAAE,iBAAiB,CAAC;QACxB,IAAI,CAAC,EAAE,gBAAgB,EAAE,CAAC;QAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,GAAG,eAAe,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC;IAC9B,CAAC,GAAG,EAAE,iBAAiB,GAAG,KAAK,GAAG,SAAS,CAAC;CAC7C,CAAC,CAAC"}
@@ -0,0 +1,338 @@
import { __awaiter } from "tslib";
import { isClassProvider, isFactoryProvider, isNormalToken, isTokenProvider, isValueProvider } from "./providers";
import { isProvider } from "./providers/provider";
import { isConstructorToken, isTokenDescriptor, isTransformDescriptor } from "./providers/injection-token";
import Registry from "./registry";
import Lifecycle from "./types/lifecycle";
import ResolutionContext from "./resolution-context";
import { formatErrorCtor } from "./error-helpers";
import { DelayedConstructor } from "./lazy-helpers";
import { isDisposable } from "./types/disposable";
import Interceptors from "./interceptors";
export const typeInfo = new Map();
class InternalDependencyContainer {
constructor(parent) {
this.parent = parent;
this._registry = new Registry();
this.interceptors = new Interceptors();
this.disposed = false;
this.disposables = new Set();
}
register(token, providerOrConstructor, options = { lifecycle: Lifecycle.Transient }) {
this.ensureNotDisposed();
let provider;
if (!isProvider(providerOrConstructor)) {
provider = { useClass: providerOrConstructor };
}
else {
provider = providerOrConstructor;
}
if (isTokenProvider(provider)) {
const path = [token];
let tokenProvider = provider;
while (tokenProvider != null) {
const currentToken = tokenProvider.useToken;
if (path.includes(currentToken)) {
throw new Error(`Token registration cycle detected! ${[...path, currentToken].join(" -> ")}`);
}
path.push(currentToken);
const registration = this._registry.get(currentToken);
if (registration && isTokenProvider(registration.provider)) {
tokenProvider = registration.provider;
}
else {
tokenProvider = null;
}
}
}
if (options.lifecycle === Lifecycle.Singleton ||
options.lifecycle == Lifecycle.ContainerScoped ||
options.lifecycle == Lifecycle.ResolutionScoped) {
if (isValueProvider(provider) || isFactoryProvider(provider)) {
throw new Error(`Cannot use lifecycle "${Lifecycle[options.lifecycle]}" with ValueProviders or FactoryProviders`);
}
}
this._registry.set(token, { provider, options });
return this;
}
registerType(from, to) {
this.ensureNotDisposed();
if (isNormalToken(to)) {
return this.register(from, {
useToken: to
});
}
return this.register(from, {
useClass: to
});
}
registerInstance(token, instance) {
this.ensureNotDisposed();
return this.register(token, {
useValue: instance
});
}
registerSingleton(from, to) {
this.ensureNotDisposed();
if (isNormalToken(from)) {
if (isNormalToken(to)) {
return this.register(from, {
useToken: to
}, { lifecycle: Lifecycle.Singleton });
}
else if (to) {
return this.register(from, {
useClass: to
}, { lifecycle: Lifecycle.Singleton });
}
throw new Error('Cannot register a type name as a singleton without a "to" token');
}
let useClass = from;
if (to && !isNormalToken(to)) {
useClass = to;
}
return this.register(from, {
useClass
}, { lifecycle: Lifecycle.Singleton });
}
resolve(token, context = new ResolutionContext(), isOptional = false) {
this.ensureNotDisposed();
const registration = this.getRegistration(token);
if (!registration && isNormalToken(token)) {
if (isOptional) {
return undefined;
}
throw new Error(`Attempted to resolve unregistered dependency token: "${token.toString()}"`);
}
this.executePreResolutionInterceptor(token, "Single");
if (registration) {
const result = this.resolveRegistration(registration, context);
this.executePostResolutionInterceptor(token, result, "Single");
return result;
}
if (isConstructorToken(token)) {
const result = this.construct(token, context);
this.executePostResolutionInterceptor(token, result, "Single");
return result;
}
throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.");
}
executePreResolutionInterceptor(token, resolutionType) {
if (this.interceptors.preResolution.has(token)) {
const remainingInterceptors = [];
for (const interceptor of this.interceptors.preResolution.getAll(token)) {
if (interceptor.options.frequency != "Once") {
remainingInterceptors.push(interceptor);
}
interceptor.callback(token, resolutionType);
}
this.interceptors.preResolution.setAll(token, remainingInterceptors);
}
}
executePostResolutionInterceptor(token, result, resolutionType) {
if (this.interceptors.postResolution.has(token)) {
const remainingInterceptors = [];
for (const interceptor of this.interceptors.postResolution.getAll(token)) {
if (interceptor.options.frequency != "Once") {
remainingInterceptors.push(interceptor);
}
interceptor.callback(token, result, resolutionType);
}
this.interceptors.postResolution.setAll(token, remainingInterceptors);
}
}
resolveRegistration(registration, context) {
this.ensureNotDisposed();
if (registration.options.lifecycle === Lifecycle.ResolutionScoped &&
context.scopedResolutions.has(registration)) {
return context.scopedResolutions.get(registration);
}
const isSingleton = registration.options.lifecycle === Lifecycle.Singleton;
const isContainerScoped = registration.options.lifecycle === Lifecycle.ContainerScoped;
const returnInstance = isSingleton || isContainerScoped;
let resolved;
if (isValueProvider(registration.provider)) {
resolved = registration.provider.useValue;
}
else if (isTokenProvider(registration.provider)) {
resolved = returnInstance
? registration.instance ||
(registration.instance = this.resolve(registration.provider.useToken, context))
: this.resolve(registration.provider.useToken, context);
}
else if (isClassProvider(registration.provider)) {
resolved = returnInstance
? registration.instance ||
(registration.instance = this.construct(registration.provider.useClass, context))
: this.construct(registration.provider.useClass, context);
}
else if (isFactoryProvider(registration.provider)) {
resolved = registration.provider.useFactory(this);
}
else {
resolved = this.construct(registration.provider, context);
}
if (registration.options.lifecycle === Lifecycle.ResolutionScoped) {
context.scopedResolutions.set(registration, resolved);
}
return resolved;
}
resolveAll(token, context = new ResolutionContext(), isOptional = false) {
this.ensureNotDisposed();
const registrations = this.getAllRegistrations(token);
if (!registrations && isNormalToken(token)) {
if (isOptional) {
return [];
}
throw new Error(`Attempted to resolve unregistered dependency token: "${token.toString()}"`);
}
this.executePreResolutionInterceptor(token, "All");
if (registrations) {
const result = registrations.map(item => this.resolveRegistration(item, context));
this.executePostResolutionInterceptor(token, result, "All");
return result;
}
const result = [this.construct(token, context)];
this.executePostResolutionInterceptor(token, result, "All");
return result;
}
isRegistered(token, recursive = false) {
this.ensureNotDisposed();
return (this._registry.has(token) ||
(recursive &&
(this.parent || false) &&
this.parent.isRegistered(token, true)));
}
reset() {
this.ensureNotDisposed();
this._registry.clear();
this.interceptors.preResolution.clear();
this.interceptors.postResolution.clear();
}
clearInstances() {
this.ensureNotDisposed();
for (const [token, registrations] of this._registry.entries()) {
this._registry.setAll(token, registrations
.filter(registration => !isValueProvider(registration.provider))
.map(registration => {
registration.instance = undefined;
return registration;
}));
}
}
createChildContainer() {
this.ensureNotDisposed();
const childContainer = new InternalDependencyContainer(this);
for (const [token, registrations] of this._registry.entries()) {
if (registrations.some(({ options }) => options.lifecycle === Lifecycle.ContainerScoped)) {
childContainer._registry.setAll(token, registrations.map(registration => {
if (registration.options.lifecycle === Lifecycle.ContainerScoped) {
return {
provider: registration.provider,
options: registration.options
};
}
return registration;
}));
}
}
return childContainer;
}
beforeResolution(token, callback, options = { frequency: "Always" }) {
this.interceptors.preResolution.set(token, {
callback: callback,
options: options
});
}
afterResolution(token, callback, options = { frequency: "Always" }) {
this.interceptors.postResolution.set(token, {
callback: callback,
options: options
});
}
dispose() {
return __awaiter(this, void 0, void 0, function* () {
this.disposed = true;
const promises = [];
this.disposables.forEach(disposable => {
const maybePromise = disposable.dispose();
if (maybePromise) {
promises.push(maybePromise);
}
});
yield Promise.all(promises);
});
}
getRegistration(token) {
if (this.isRegistered(token)) {
return this._registry.get(token);
}
if (this.parent) {
return this.parent.getRegistration(token);
}
return null;
}
getAllRegistrations(token) {
if (this.isRegistered(token)) {
return this._registry.getAll(token);
}
if (this.parent) {
return this.parent.getAllRegistrations(token);
}
return null;
}
construct(ctor, context) {
if (ctor instanceof DelayedConstructor) {
return ctor.createProxy((target) => this.resolve(target, context));
}
const instance = (() => {
const paramInfo = typeInfo.get(ctor);
if (!paramInfo || paramInfo.length === 0) {
if (ctor.length === 0) {
return new ctor();
}
else {
throw new Error(`TypeInfo not known for "${ctor.name}"`);
}
}
const params = paramInfo.map(this.resolveParams(context, ctor));
return new ctor(...params);
})();
if (isDisposable(instance)) {
this.disposables.add(instance);
}
return instance;
}
resolveParams(context, ctor) {
return (param, idx) => {
try {
if (isTokenDescriptor(param)) {
if (isTransformDescriptor(param)) {
return param.multiple
? this.resolve(param.transform).transform(this.resolveAll(param.token, new ResolutionContext(), param.isOptional), ...param.transformArgs)
: this.resolve(param.transform).transform(this.resolve(param.token, context, param.isOptional), ...param.transformArgs);
}
else {
return param.multiple
? this.resolveAll(param.token, new ResolutionContext(), param.isOptional)
: this.resolve(param.token, context, param.isOptional);
}
}
else if (isTransformDescriptor(param)) {
return this.resolve(param.transform, context).transform(this.resolve(param.token, context), ...param.transformArgs);
}
return this.resolve(param, context);
}
catch (e) {
throw new Error(formatErrorCtor(ctor, idx, e));
}
};
}
ensureNotDisposed() {
if (this.disposed) {
throw new Error("This container has been disposed, you cannot interact with a disposed container");
}
}
}
export const instance = new InternalDependencyContainer();
export default instance;
@@ -0,0 +1,125 @@
# camelcase-keys
> Convert object keys to camel case using [`camelcase`](https://github.com/sindresorhus/camelcase)
## Install
```
$ npm install camelcase-keys
```
## Usage
```js
const camelcaseKeys = require('camelcase-keys');
// Convert an object
camelcaseKeys({'foo-bar': true});
//=> {fooBar: true}
// Convert an array of objects
camelcaseKeys([{'foo-bar': true}, {'bar-foo': false}]);
//=> [{fooBar: true}, {barFoo: false}]
camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true});
//=> {fooBar: true, nested: {unicornRainbow: true}}
camelcaseKeys({a_b: 1, a_c: {c_d: 1, c_e: {e_f: 1}}}, {deep: true, stopPaths: ['a_c.c_e']}),
//=> {aB: 1, aC: {cD: 1, cE: {e_f: 1}}}
// Convert object keys to pascal case
camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true, pascalCase: true});
//=> {FooBar: true, Nested: {UnicornRainbow: true}}
```
```js
const camelcaseKeys = require('camelcase-keys');
const argv = require('minimist')(process.argv.slice(2));
//=> {_: [], 'foo-bar': true}
camelcaseKeys(argv);
//=> {_: [], fooBar: true}
```
## API
### camelcaseKeys(input, options?)
#### input
Type: `object | object[]`
An object or array of objects to camel-case.
#### options
Type: `object`
##### exclude
Type: `Array<string | RegExp>`\
Default: `[]`
Exclude keys from being camel-cased.
##### stopPaths
Type: `string[]`\
Default: `[]`
Exclude children at the given object paths in dot-notation from being camel-cased. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`.
```js
camelcaseKeys({
a_b: 1,
a_c: {
c_d: 1,
c_e: {
e_f: 1
}
}
}, {
deep: true,
stopPaths: [
'a_c.c_e'
]
}),
/*
{
aB: 1,
aC: {
cD: 1,
cE: {
e_f: 1
}
}
}
*/
```
##### deep
Type: `boolean`\
Default: `false`
Recurse nested objects and objects in arrays.
##### pascalCase
Type: `boolean`\
Default: `false`
Uppercase the first character as in `bye-bye` → `ByeBye`.
## camelcase-keys for enterprise
Available as part of the Tidelift Subscription.
The maintainers of camelcase-keys and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-camelcase-keys?utm_source=npm-camelcase-keys&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Related
- [snakecase-keys](https://github.com/bendrucker/snakecase-keys)
- [kebabcase-keys](https://github.com/mattiloh/kebabcase-keys)
@@ -0,0 +1 @@
{"name":"@formatjs/icu-skeleton-parser","version":"1.8.16","requiresBuild":false,"files":{"date-time.js":{"checkedAt":1794532106179,"integrity":"sha512-h+wIJGBa5e1m01HvM7kXoe6zFAucmDA687zRWUV/6nPrZ3UjmIYqeK6EJXxlQ0OMZ/pw9x/6/iU66u5ScijSfw==","mode":420,"size":5011},"lib/date-time.js":{"checkedAt":1794532106180,"integrity":"sha512-/3XZnPLRu3XBmEReC5oJYJtMqil96zTZHZcGNt837GwdML63Pk8yAsXb+hNk9Y0tYeWiK3nNirpUuYJbP8PWMQ==","mode":420,"size":4886},"index.js":{"checkedAt":1794532106180,"integrity":"sha512-0pAHmOtRjnnctMyLYZIS9VIMJqq/a9ms5HR6jVqPOGihsCmOx1ccMxT0P71Q//JfX+ZF6I65pInFkpnqUKJpvQ==","mode":420,"size":216},"lib/index.js":{"checkedAt":1794532106180,"integrity":"sha512-pxhfBiltViYEknt1oDKK2ob0ePndXiLdBq255X0jsL3iAc6Ub79/zLImnd6BpHk0HkF5EcXHpbd30NbzmJE5dQ==","mode":420,"size":55},"lib/number.js":{"checkedAt":1794532106180,"integrity":"sha512-HElnjt8Ua9pRmfvsJTNHS5s4EQkX4DJzonS1Jy1CCGFPoJsU2BQGkosV3JDYoH2CDbEG77Q5kjIBJrjkKsGKWA==","mode":420,"size":11952},"number.js":{"checkedAt":1794532106180,"integrity":"sha512-fCcnDqqiGYYDWBBXn9EyCVa57q2O8Y2rdWWRrBuI5ZmDGLtU/8RYYZZ/iWWnz9HpQ36Iia2KSdELpAxF6rXCnA==","mode":420,"size":12312},"lib/regex.generated.js":{"checkedAt":1794532106181,"integrity":"sha512-8MXAgPvqta54H2oLzzdnmN/aF1L3SSY0YpBzgCYRimNuPGSenPJJRNYhOLDnSQEfMa14XPyqvT1v64LuLSBA2g==","mode":420,"size":104},"regex.generated.js":{"checkedAt":1794532106181,"integrity":"sha512-c0obwTBJU0y7Fi5TG5QH2pc9Ezu2V8xH3MQ97zfmyVBD256CSbXWYKVZPfrxXcaapVI1agqunGUPexafw7CBZA==","mode":420,"size":214},"package.json":{"checkedAt":1794532106181,"integrity":"sha512-ji7p6Ndszlko5ejUdOsfa2/Eh8dB9ZySaQawG9w4nEjTOM/eEjFZXch0GNuYZYACNUrEQvts23QDrG/RDlcUfg==","mode":420,"size":398},"LICENSE.md":{"checkedAt":1794532106181,"integrity":"sha512-ccP4x15RKluRGK98bepkv531ywxfbjzAORRpvAUP4HZUQ21686RCj2i8Yze08vlAxp0uyVnbIalgS4SBbLEVrA==","mode":420,"size":1065},"README.md":{"checkedAt":1794532106181,"integrity":"sha512-FRJ1bbZYcI8eFZm6RhPjtVMEFbqeTNUHrSeYW9f119IcHoRZS5aBUPb4musyTGt1vSbd6YTG0T/7+MfywDPF5g==","mode":420,"size":22},"date-time.d.ts":{"checkedAt":1794532106181,"integrity":"sha512-caLeSDgjDx//0EX8wbXtmG3HC5AXmxwJ/fbYn9YZfxXHyJYYAvIIRwRSNe3JBx6I5pYUcpRp8Z1VZyYCmMYIig==","mode":420,"size":288},"lib/date-time.d.ts":{"checkedAt":1794532106181,"integrity":"sha512-caLeSDgjDx//0EX8wbXtmG3HC5AXmxwJ/fbYn9YZfxXHyJYYAvIIRwRSNe3JBx6I5pYUcpRp8Z1VZyYCmMYIig==","mode":420,"size":288},"index.d.ts":{"checkedAt":1794532106180,"integrity":"sha512-pxhfBiltViYEknt1oDKK2ob0ePndXiLdBq255X0jsL3iAc6Ub79/zLImnd6BpHk0HkF5EcXHpbd30NbzmJE5dQ==","mode":420,"size":55},"lib/index.d.ts":{"checkedAt":1794532106180,"integrity":"sha512-pxhfBiltViYEknt1oDKK2ob0ePndXiLdBq255X0jsL3iAc6Ub79/zLImnd6BpHk0HkF5EcXHpbd30NbzmJE5dQ==","mode":420,"size":55},"lib/number.d.ts":{"checkedAt":1794532106181,"integrity":"sha512-Ok1oqUA9DBa3DjNGNznzw08W4NhgB18iHQdNvbS7zVZuvSkM5GJqYc31UGyEXlM+TDiurxQgTTzX3eYOfuqE3g==","mode":420,"size":585},"number.d.ts":{"checkedAt":1794532106181,"integrity":"sha512-Ok1oqUA9DBa3DjNGNznzw08W4NhgB18iHQdNvbS7zVZuvSkM5GJqYc31UGyEXlM+TDiurxQgTTzX3eYOfuqE3g==","mode":420,"size":585},"lib/regex.generated.d.ts":{"checkedAt":1794532106182,"integrity":"sha512-RpJooFWIDg/PFGa5YOVj2FxX2ycnfHOxJQ3Shp5cryM1MC0Om2NRHMecqnzFB0sAMBodss0X7uY/MXzCoM2q3Q==","mode":420,"size":48},"regex.generated.d.ts":{"checkedAt":1794532106182,"integrity":"sha512-RpJooFWIDg/PFGa5YOVj2FxX2ycnfHOxJQ3Shp5cryM1MC0Om2NRHMecqnzFB0sAMBodss0X7uY/MXzCoM2q3Q==","mode":420,"size":48}}}
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isValidES3Identifier;
var _isValidIdentifier = require("./isValidIdentifier.js");
const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
function isValidES3Identifier(name) {
return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
}
//# sourceMappingURL=isValidES3Identifier.js.map
@@ -0,0 +1,101 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
type FunctionNode = TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression;
/**
* Gets the location of the given function node for reporting.
*
* - `function foo() {}`
* ^^^^^^^^^^^^
* - `(function foo() {})`
* ^^^^^^^^^^^^
* - `(function() {})`
* ^^^^^^^^
* - `function* foo() {}`
* ^^^^^^^^^^^^^
* - `(function* foo() {})`
* ^^^^^^^^^^^^^
* - `(function*() {})`
* ^^^^^^^^^
* - `() => {}`
* ^^
* - `async () => {}`
* ^^
* - `({ foo: function foo() {} })`
* ^^^^^^^^^^^^^^^^^
* - `({ foo: function() {} })`
* ^^^^^^^^^^^^^
* - `({ ['foo']: function() {} })`
* ^^^^^^^^^^^^^^^^^
* - `({ [foo]: function() {} })`
* ^^^^^^^^^^^^^^^
* - `({ foo() {} })`
* ^^^
* - `({ foo: function* foo() {} })`
* ^^^^^^^^^^^^^^^^^^
* - `({ foo: function*() {} })`
* ^^^^^^^^^^^^^^
* - `({ ['foo']: function*() {} })`
* ^^^^^^^^^^^^^^^^^^
* - `({ [foo]: function*() {} })`
* ^^^^^^^^^^^^^^^^
* - `({ *foo() {} })`
* ^^^^
* - `({ foo: async function foo() {} })`
* ^^^^^^^^^^^^^^^^^^^^^^^
* - `({ foo: async function() {} })`
* ^^^^^^^^^^^^^^^^^^^
* - `({ ['foo']: async function() {} })`
* ^^^^^^^^^^^^^^^^^^^^^^^
* - `({ [foo]: async function() {} })`
* ^^^^^^^^^^^^^^^^^^^^^
* - `({ async foo() {} })`
* ^^^^^^^^^
* - `({ get foo() {} })`
* ^^^^^^^
* - `({ set foo(a) {} })`
* ^^^^^^^
* - `class A { constructor() {} }`
* ^^^^^^^^^^^
* - `class A { foo() {} }`
* ^^^
* - `class A { *foo() {} }`
* ^^^^
* - `class A { async foo() {} }`
* ^^^^^^^^^
* - `class A { ['foo']() {} }`
* ^^^^^^^
* - `class A { *['foo']() {} }`
* ^^^^^^^^
* - `class A { async ['foo']() {} }`
* ^^^^^^^^^^^^^
* - `class A { [foo]() {} }`
* ^^^^^
* - `class A { *[foo]() {} }`
* ^^^^^^
* - `class A { async [foo]() {} }`
* ^^^^^^^^^^^
* - `class A { get foo() {} }`
* ^^^^^^^
* - `class A { set foo(a) {} }`
* ^^^^^^^
* - `class A { static foo() {} }`
* ^^^^^^^^^^
* - `class A { static *foo() {} }`
* ^^^^^^^^^^^
* - `class A { static async foo() {} }`
* ^^^^^^^^^^^^^^^^
* - `class A { static get foo() {} }`
* ^^^^^^^^^^^^^^
* - `class A { static set foo(a) {} }`
* ^^^^^^^^^^^^^^
* - `class A { foo = function() {} }`
* ^^^^^^^^^^^^^^
* - `class A { static foo = function() {} }`
* ^^^^^^^^^^^^^^^^^^^^^
* - `class A { foo = (a, b) => {} }`
* ^^^^^^
* @param node The function node to get.
* @param sourceCode The source code object to get tokens.
* @returns The location of the function node for reporting.
*/
export declare function getFunctionHeadLoc(node: FunctionNode, sourceCode: TSESLint.SourceCode): TSESTree.SourceLocation;
export {};
@@ -0,0 +1,8 @@
import arrayWithHoles from "./arrayWithHoles.js";
import iterableToArrayLimit from "./iterableToArrayLimit.js";
import unsupportedIterableToArray from "./unsupportedIterableToArray.js";
import nonIterableRest from "./nonIterableRest.js";
function _slicedToArray(r, e) {
return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();
}
export { _slicedToArray as default };
@@ -0,0 +1,4 @@
export {
gfmTaskListItemFromMarkdown,
gfmTaskListItemToMarkdown
} from './lib/index.js'
@@ -0,0 +1 @@
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/toggle/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useToggle} from './useToggle';\nexport type {AriaToggleProps} from '@react-types/checkbox';\nexport type {ToggleAria} from './useToggle';\n"],"names":[],"version":3,"file":"main.js.map"}
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getImplicitRoleForUl;
/**
* Returns the implicit role for a ul tag.
*/
function getImplicitRoleForUl() {
return 'list';
}
module.exports = exports.default;
@@ -0,0 +1,623 @@
flf2a$ 6 6 9 -1 10
Cyrillic font by Tracy Schuhwerk (Tracy.Schuhwerk@sdrc.com).
November 15th, 1993 Version 1.0
I sacrificed the following symbols for Cyrillic letters:
"\" (slash)
"/" (back slash)
"|" (pipe)
"~" (tilde)
"`" (single quote)
">" (greater than)
@
@
@
@
@
@@
@
# @
# @
# @
@
# @@
@
# # @
# # @
@
@
@@
@
# # @
### @
# # @
### @
# # @@
@
## @
## @
### @
## @
## @@
@
# # @
# @
# @
# @
# # @@
@
# @
# @
## @
# # @
### @@
@
# @
# @
# @
@
@@
@
# @
# @
# @
# @
# @@
@
# @
# @
# @
# @
# @@
@
# @
### @
# @
### @
# @@
@
@
# @
### @
# @
@@
@
@
@
@
# @
# @@
@
@
@
### @
@
@@
@
@
@
@
@
# @@
@
# @
# @
## @
# # @
## @@
@
### @
# # @
# # @
# # @
### @@
@
# @
## @
# @
# @
### @@
@
### @
# @
### @
# @
### @@
@
### @
# @
## @
# @
### @@
@
# # @
# # @
### @
# @
# @@
@
### @
# @
### @
# @
### @@
@
### @
# @
### @
# # @
### @@
@
### @
# @
# @
# @
# @@
@
### @
# # @
### @
# # @
### @@
@
### @
# # @
### @
# @
### @@
@
@
# @
@
# @
@@
@
@
# @
@
# @
# @@
@
# @
# @
# @
# @
# @@
@
@
### @
@
### @
@@
@
# # # @
# ## @
# # # @
## # @
# # @@
@
### @
# @
## @
@
# @@
@
### @
# # @
# @
### @
@@
@
# @
# # @
##### @
# # @
# # @@
@
#### @
# @
#### @
# # @
##### @@
@
# # @
# # @
#### @
# @
# @@
@
##### @
# # @
# # @
#### @
# # @@
@
##### @
# @
#### @
# @
##### @@
@
# @
### @
# # # @
### @
# @@
@
##### @
# # @
# @
# @
# @@
@
# # @
# # @
# @
# # @
# # @@
@
# # @
# ## @
# # # @
## # @
# # @@
@
# # # @
### @
# @
### @
# # # @@
@
# # @
# # @
### @
# # @
# # @@
@
##### @
# # @
# # @
# # @
# # @@
@
# # @
## ## @
# # # @
# # @
# # @@
@
# # @
# # @
##### @
# # @
# # @@
@
### @
# # @
# # @
# # @
### @@
@
##### @
# # @
# # @
# # @
# # @@
@
# # @
# # @
# # @
##### @
# @@
@
#### @
# # @
#### @
# @
# @@
@
#### @
# @
# @
# @
#### @@
@
##### @
# @
# @
# @
# @@
@
# # @
# # @
# @
# @
# @@
@
#### @
# # @
#### @
# # @
#### @@
@
# # @
# # # @
# # # @
# # # @
### @@
@
# # @
# # # @
# # # @
# # # @
##### @@
@
#### @
# # @
#### @
# # @
# # @@
@
#### @
# @
### @
# @
#### @@
@
## @
# @
# @
# @
## @@
@
## @
# @
## @
# # @
## @@
@
## @
# @
# @
# @
## @@
@
# @
# # @
@
@
@@
@
@
@
@
@
### @@
@
# ## @
# # # @
### # @
# # # @
# ## @@
@
# @
# # @
##### @
# # @
# # @@
@
#### @
# @
#### @
# # @
##### @@
@
# # @
# # @
#### @
# @
# @@
@
##### @
# # @
# # @
#### @
# # @@
@
##### @
# @
#### @
# @
##### @@
@
# @
### @
# # # @
### @
# @@
@
##### @
# # @
# @
# @
# @@
@
# # @
# # @
# @
# # @
# # @@
@
# # @
# ## @
# # # @
## # @
# # @@
@
# # # @
### @
# @
### @
# # # @@
@
# # @
# # @
### @
# # @
# # @@
@
##### @
# # @
# # @
# # @
# # @@
@
# # @
## ## @
# # # @
# # @
# # @@
@
# # @
# # @
##### @
# # @
# # @@
@
### @
# # @
# # @
# # @
### @@
@
##### @
# # @
# # @
# # @
# # @@
@
# # @
# # @
# # @
##### @
# @@
@
#### @
# # @
#### @
# @
# @@
@
#### @
# @
# @
# @
#### @@
@
##### @
# @
# @
# @
# @@
@
# # @
# # @
# @
# @
# @@
@
#### @
# # @
#### @
# # @
#### @@
@
# # @
# # # @
# # # @
# # # @
### @@
@
# # @
# # # @
# # # @
# # # @
##### @@
@
#### @
# # @
#### @
# # @
# # @@
@
#### @
# @
### @
# @
#### @@
@
## @
# @
## @
# @
## @@
@
# # @
# # @
## # @
# # # @
## # @@
@
## @
# @
## @
# @
## @@
@
#### @
# @
##### @
# @
#### @@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@@ -0,0 +1,57 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const getESLintCoreRule_1 = require("../util/getESLintCoreRule");
const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-useless-constructor');
/**
* Check if method with accessibility is not useless
*/
function checkAccessibility(node) {
switch (node.accessibility) {
case 'protected':
case 'private':
return false;
case 'public':
if (node.parent.parent.superClass) {
return false;
}
break;
}
return true;
}
/**
* Check if method is not useless due to typescript parameter properties and decorators
*/
function checkParams(node) {
return !node.value.params.some(param => param.type === utils_1.AST_NODE_TYPES.TSParameterProperty ||
param.decorators.length);
}
exports.default = (0, util_1.createRule)({
name: 'no-useless-constructor',
meta: {
type: 'problem',
// defaultOptions, -- base rule does not use defaultOptions
docs: {
description: 'Disallow unnecessary constructors',
extendsBaseRule: true,
recommended: 'strict',
},
hasSuggestions: baseRule.meta.hasSuggestions,
messages: baseRule.meta.messages,
schema: baseRule.meta.schema,
},
defaultOptions: [],
create(context) {
const rules = baseRule.create(context);
return {
MethodDefinition(node) {
if (node.value.type === utils_1.AST_NODE_TYPES.FunctionExpression &&
checkAccessibility(node) &&
checkParams(node)) {
rules.MethodDefinition(node);
}
},
};
},
});
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"K D E F A wC"},B:{"1":"C L M G N O P","2":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB 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 UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC 0C 1C"},D:{"2":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB 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 UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC"},E:{"2":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G N O P aB AB BB CB DB EB FB 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 EC FC GC HC IC JC KC LC Q H R WC 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 FD GD HD ID NC uC JD OC"},G:{"2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"2":"TC J I iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"2":"A B C H NC uC OC"},L:{"2":"I"},M:{"2":"MC"},N:{"1":"B","2":"A"},O:{"2":"PC"},P:{"2":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"2":"zD"},R:{"2":"0D"},S:{"2":"1D 2D"}},B:7,C:"Resource Hints: Lazyload",D:true};
@@ -0,0 +1,23 @@
export * from './BotOfflineEvent';
export * from './OB11BaseNoticeEvent';
export * from './OB11FriendAddNoticeEvent';
export * from './OB11FriendRecallNoticeEvent';
export * from './OB11GroupAdminNoticeEvent';
export * from './OB11GroupBanEvent';
export * from './OB11GroupCardEvent';
export * from './OB11GroupDecreaseEvent';
export * from './OB11GroupEssenceEvent';
export * from './OB11GroupGrayTipEvent';
export * from './OB11GroupIncreaseEvent';
export * from './OB11GroupNameEvent';
export * from './OB11GroupNoticeEvent';
export * from './OB11GroupRecallNoticeEvent';
export * from './OB11GroupTitleEvent';
export * from './OB11GroupUploadNoticeEvent';
export * from './OB11InputStatusEvent';
export * from './OB11MsgEmojiLikeEvent';
export * from './OB11OnlineFileNoticeEvent';
export * from './OB11OnlineFileReceiveEvent';
export * from './OB11OnlineFileSendEvent';
export * from './OB11PokeEvent';
export * from './OB11ProfileLikeEvent';
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;IAOsB;AAFvB,4FAA4F;AAC5F,0EAA0E;AAC1E,MAAM,uCAAiB,CAAA,kDAAA,CAAA,GAAA,sCAAI,CAAC,CAAC,qBAAqB,cAA3B,6DAAA,kDAA+B,CAAA,GAAA,yCAAc;AAE7D,SAAS,0CAAmC,EAAM;IACvD,MAAM,MAAM,CAAA,GAAA,mBAAK,EAAwB;IACzC,qCAAe;QACb,IAAI,OAAO,GAAG;IAChB,GAAG;QAAC;KAAG;IACP,aAAa;IACb,OAAO,CAAA,GAAA,wBAAU,EAAK,CAAC,GAAG;QACxB,MAAM,IAAI,IAAI,OAAO;QACrB,OAAO,cAAA,wBAAA,KAAO;IAChB,GAAG,EAAE;AACP","sources":["packages/@react-aria/utils/src/useEffectEvent.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React, {useCallback, useRef} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\n\n// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,\n// before all layout effects, but is available only in React 18 and later.\nconst useEarlyEffect = React['useInsertionEffect'] ?? useLayoutEffect;\n\nexport function useEffectEvent<T extends Function>(fn?: T): T {\n const ref = useRef<T | null | undefined>(null);\n useEarlyEffect(() => {\n ref.current = fn;\n }, [fn]);\n // @ts-ignore\n return useCallback<T>((...args) => {\n const f = ref.current!;\n return f?.(...args);\n }, []);\n}\n"],"names":[],"version":3,"file":"useEffectEvent.main.js.map"}
@@ -0,0 +1,347 @@
/**
* @fileoverview A rule to suggest using template literals instead of string concatenation.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks whether or not a given node is a concatenation.
* @param {ASTNode} node A node to check.
* @returns {boolean} `true` if the node is a concatenation.
*/
function isConcatenation(node) {
return node.type === "BinaryExpression" && node.operator === "+";
}
/**
* Gets the top binary expression node for concatenation in parents of a given node.
* @param {ASTNode} node A node to get.
* @returns {ASTNode} the top binary expression node in parents of a given node.
*/
function getTopConcatBinaryExpression(node) {
let currentNode = node;
while (isConcatenation(currentNode.parent)) {
currentNode = currentNode.parent;
}
return currentNode;
}
/**
* Checks whether or not a node contains a string literal with an octal or non-octal decimal escape sequence
* @param {ASTNode} node A node to check
* @returns {boolean} `true` if at least one string literal within the node contains
* an octal or non-octal decimal escape sequence
*/
function hasOctalOrNonOctalDecimalEscapeSequence(node) {
if (isConcatenation(node)) {
return (
hasOctalOrNonOctalDecimalEscapeSequence(node.left) ||
hasOctalOrNonOctalDecimalEscapeSequence(node.right)
);
}
// No need to check TemplateLiterals – would throw parsing error
if (node.type === "Literal" && typeof node.value === "string") {
return astUtils.hasOctalOrNonOctalDecimalEscapeSequence(node.raw);
}
return false;
}
/**
* Checks whether or not a given binary expression has string literals.
* @param {ASTNode} node A node to check.
* @returns {boolean} `true` if the node has string literals.
*/
function hasStringLiteral(node) {
if (isConcatenation(node)) {
// `left` is deeper than `right` normally.
return hasStringLiteral(node.right) || hasStringLiteral(node.left);
}
return astUtils.isStringLiteral(node);
}
/**
* Checks whether or not a given binary expression has non string literals.
* @param {ASTNode} node A node to check.
* @returns {boolean} `true` if the node has non string literals.
*/
function hasNonStringLiteral(node) {
if (isConcatenation(node)) {
// `left` is deeper than `right` normally.
return (
hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left)
);
}
return !astUtils.isStringLiteral(node);
}
/**
* Determines whether a given node will start with a template curly expression (`${}`) when being converted to a template literal.
* @param {ASTNode} node The node that will be fixed to a template literal
* @returns {boolean} `true` if the node will start with a template curly.
*/
function startsWithTemplateCurly(node) {
if (node.type === "BinaryExpression") {
return startsWithTemplateCurly(node.left);
}
if (node.type === "TemplateLiteral") {
return (
node.expressions.length &&
node.quasis.length &&
node.quasis[0].range[0] === node.quasis[0].range[1]
);
}
return node.type !== "Literal" || typeof node.value !== "string";
}
/**
* Determines whether a given node end with a template curly expression (`${}`) when being converted to a template literal.
* @param {ASTNode} node The node that will be fixed to a template literal
* @returns {boolean} `true` if the node will end with a template curly.
*/
function endsWithTemplateCurly(node) {
if (node.type === "BinaryExpression") {
return startsWithTemplateCurly(node.right);
}
if (node.type === "TemplateLiteral") {
return (
node.expressions.length &&
node.quasis.length &&
node.quasis.at(-1).range[0] === node.quasis.at(-1).range[1]
);
}
return node.type !== "Literal" || typeof node.value !== "string";
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Require template literals instead of string concatenation",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/prefer-template",
},
schema: [],
fixable: "code",
messages: {
unexpectedStringConcatenation: "Unexpected string concatenation.",
},
},
create(context) {
const sourceCode = context.sourceCode;
let done = Object.create(null);
/**
* Gets the non-token text between two nodes, ignoring any other tokens that appear between the two tokens.
* @param {ASTNode} node1 The first node
* @param {ASTNode} node2 The second node
* @returns {string} The text between the nodes, excluding other tokens
*/
function getTextBetween(node1, node2) {
const allTokens = [node1]
.concat(sourceCode.getTokensBetween(node1, node2))
.concat(node2);
const sourceText = sourceCode.getText();
return allTokens
.slice(0, -1)
.reduce(
(accumulator, token, index) =>
accumulator +
sourceText.slice(
token.range[1],
allTokens[index + 1].range[0],
),
"",
);
}
/**
* Returns a template literal form of the given node.
* @param {ASTNode} currentNode A node that should be converted to a template literal
* @param {string} textBeforeNode Text that should appear before the node
* @param {string} textAfterNode Text that should appear after the node
* @returns {string} A string form of this node, represented as a template literal
*/
function getTemplateLiteral(
currentNode,
textBeforeNode,
textAfterNode,
) {
if (
currentNode.type === "Literal" &&
typeof currentNode.value === "string"
) {
/*
* If the current node is a string literal, escape any instances of ${ or ` to prevent them from being interpreted
* as a template placeholder. However, if the code already contains a backslash before the ${ or `
* for some reason, don't add another backslash, because that would change the meaning of the code (it would cause
* an actual backslash character to appear before the dollar sign).
*/
return `\`${currentNode.raw
.slice(1, -1)
.replace(/\\*(\$\{|`)/gu, matched => {
if (matched.lastIndexOf("\\") % 2) {
return `\\${matched}`;
}
return matched;
// Unescape any quotes that appear in the original Literal that no longer need to be escaped.
})
.replace(
new RegExp(`\\\\${currentNode.raw[0]}`, "gu"),
currentNode.raw[0],
)}\``;
}
if (currentNode.type === "TemplateLiteral") {
return sourceCode.getText(currentNode);
}
if (isConcatenation(currentNode) && hasStringLiteral(currentNode)) {
const plusSign = sourceCode.getFirstTokenBetween(
currentNode.left,
currentNode.right,
token => token.value === "+",
);
const textBeforePlus = getTextBetween(
currentNode.left,
plusSign,
);
const textAfterPlus = getTextBetween(
plusSign,
currentNode.right,
);
const leftEndsWithCurly = endsWithTemplateCurly(
currentNode.left,
);
const rightStartsWithCurly = startsWithTemplateCurly(
currentNode.right,
);
if (leftEndsWithCurly) {
// If the left side of the expression ends with a template curly, add the extra text to the end of the curly bracket.
// `foo${bar}` /* comment */ + 'baz' --> `foo${bar /* comment */ }${baz}`
return (
getTemplateLiteral(
currentNode.left,
textBeforeNode,
textBeforePlus + textAfterPlus,
).slice(0, -1) +
getTemplateLiteral(
currentNode.right,
null,
textAfterNode,
).slice(1)
);
}
if (rightStartsWithCurly) {
// Otherwise, if the right side of the expression starts with a template curly, add the text there.
// 'foo' /* comment */ + `${bar}baz` --> `foo${ /* comment */ bar}baz`
return (
getTemplateLiteral(
currentNode.left,
textBeforeNode,
null,
).slice(0, -1) +
getTemplateLiteral(
currentNode.right,
textBeforePlus + textAfterPlus,
textAfterNode,
).slice(1)
);
}
/*
* Otherwise, these nodes should not be combined into a template curly, since there is nowhere to put
* the text between them.
*/
return `${getTemplateLiteral(currentNode.left, textBeforeNode, null)}${textBeforePlus}+${textAfterPlus}${getTemplateLiteral(currentNode.right, textAfterNode, null)}`;
}
return `\`\${${textBeforeNode || ""}${sourceCode.getText(currentNode)}${textAfterNode || ""}}\``;
}
/**
* Returns a fixer object that converts a non-string binary expression to a template literal
* @param {SourceCodeFixer} fixer The fixer object
* @param {ASTNode} node A node that should be converted to a template literal
* @returns {Object} A fix for this binary expression
*/
function fixNonStringBinaryExpression(fixer, node) {
const topBinaryExpr = getTopConcatBinaryExpression(node.parent);
if (hasOctalOrNonOctalDecimalEscapeSequence(topBinaryExpr)) {
return null;
}
return fixer.replaceText(
topBinaryExpr,
getTemplateLiteral(topBinaryExpr, null, null),
);
}
/**
* Reports if a given node is string concatenation with non string literals.
* @param {ASTNode} node A node to check.
* @returns {void}
*/
function checkForStringConcat(node) {
if (
!astUtils.isStringLiteral(node) ||
!isConcatenation(node.parent)
) {
return;
}
const topBinaryExpr = getTopConcatBinaryExpression(node.parent);
// Checks whether or not this node had been checked already.
if (done[topBinaryExpr.range[0]]) {
return;
}
done[topBinaryExpr.range[0]] = true;
if (hasNonStringLiteral(topBinaryExpr)) {
context.report({
node: topBinaryExpr,
messageId: "unexpectedStringConcatenation",
fix: fixer => fixNonStringBinaryExpression(fixer, node),
});
}
}
return {
Program() {
done = Object.create(null);
},
Literal: checkForStringConcat,
TemplateLiteral: checkForStringConcat,
};
},
};
@@ -0,0 +1,110 @@
import { ParserPlugin } from '@babel/parser';
import { Config } from 'prettier';
export type ImportOrderParserPlugin =
| Extract<ParserPlugin, string>
| `[${string},${string}]`;
export interface PluginConfig {
/**
* A collection of Regular expressions in string format.
*
* ```
* "importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
* ```
*
* _Default behavior:_ The plugin moves the third party imports to the top which are not part of the `importOrder` list.
* To move the third party imports at desired place, you can use `<THIRD_PARTY_MODULES>` to assign third party imports to the appropriate position:
*
* ```
* "importOrder": ["^@core/(.*)$", "<THIRD_PARTY_MODULES>", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
* ```
*/
importOrder: string[];
/**
* A boolean value to enable or disable the new line separation
* between sorted import declarations group. The separation takes place according to the `importOrder`.
*
* @default false
*/
importOrderSeparation?: boolean;
/**
* A boolean value to enable or disable sorting of the specifiers in an import declarations.
*
* @default false
*/
importOrderSortSpecifiers?: boolean;
/**
* A boolean value to enable or disable sorting the namespace specifiers to the top of the import group.
*
* @default false
*/
importOrderGroupNamespaceSpecifiers?: boolean;
/**
* A boolean value to enable case-insensitivity in the sorting algorithm
used to order imports within each match group.
*
* For example, when false (or not specified):
*
* ```js
* import ExampleView from './ExampleView';
* import ExamplesList from './ExamplesList';
* ```
*
* compared with `"importOrderCaseInsensitive": true`:
*
* ```js
* import ExamplesList from './ExamplesList';
* import ExampleView from './ExampleView';
* ```
*
* @default false
*/
importOrderCaseInsensitive?: boolean;
/**
* Previously known as `experimentalBabelParserPluginsList`.
*
* A collection of plugins for babel parser. The plugin passes this list to babel parser, so it can understand the syntaxes
* used in the file being formatted. The plugin uses prettier itself to figure out the parser it needs to use but if that fails,
* you can use this field to enforce the usage of the plugins' babel parser needs.
*
* **To pass the plugins to babel parser**:
*
* ```
* "importOrderParserPlugins" : ["classProperties", "decorators-legacy"]
* ```
*
* **To pass the options to the babel parser plugins**: Since prettier options are limited to string, you can pass plugins
* with options as a JSON string of the plugin array:
* `"[\"plugin-name\", { \"pluginOption\": true }]"`.
*
* ```
* "importOrderParserPlugins" : ["classProperties", "[\"decorators\", { \"decoratorsBeforeExport\": true }]"]
* ```
*
* **To disable default plugins for babel parser, pass an empty array**:
*
* @default ["typescript", "jsx"]
*/
importOrderParserPlugins?: ImportOrderParserPlugin[];
/**
* The import attributes/assertions syntax to use. "with" for import "..." with { type: "json" },
* "assert" for import "..." assert { type: "json" }, and "with-legacy" for import "..." with type: "json".
*
* ```
* "importOrderImportAttributesKeyword": 'with',
* ```
*
* _Default behavior:_ When not specified, @babel/generator will try to match the style in the input code based on the AST shape.
*/
importOrderImportAttributesKeyword?: 'assert' | 'with' | 'with-legacy';
}
export type PrettierConfig = PluginConfig & Config;
@@ -0,0 +1,30 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
default: () => src_default
});
module.exports = __toCommonJS(src_exports);
var import_framer_motion = require("framer-motion");
var src_default = import_framer_motion.domAnimation;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
@@ -0,0 +1,126 @@
export declare enum QuoteType {
NoValue = 0,
Unquoted = 1,
Single = 2,
Double = 3
}
export interface Callbacks {
onattribdata(start: number, endIndex: number): void;
onattribentity(codepoint: number): void;
onattribend(quote: QuoteType, endIndex: number): void;
onattribname(start: number, endIndex: number): void;
oncdata(start: number, endIndex: number, endOffset: number): void;
onclosetag(start: number, endIndex: number): void;
oncomment(start: number, endIndex: number, endOffset: number): void;
ondeclaration(start: number, endIndex: number): void;
onend(): void;
onopentagend(endIndex: number): void;
onopentagname(start: number, endIndex: number): void;
onprocessinginstruction(start: number, endIndex: number): void;
onselfclosingtag(endIndex: number): void;
ontext(start: number, endIndex: number): void;
ontextentity(codepoint: number, endIndex: number): void;
}
export default class Tokenizer {
private readonly cbs;
/** The current state the tokenizer is in. */
private state;
/** The read buffer. */
private buffer;
/** The beginning of the section that is currently being read. */
private sectionStart;
/** The index within the buffer that we are currently looking at. */
private index;
/** The start of the last entity. */
private entityStart;
/** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
private baseState;
/** For special parsing behavior inside of script and style tags. */
private isSpecial;
/** Indicates whether the tokenizer has been paused. */
running: boolean;
/** The offset of the current buffer. */
private offset;
private readonly xmlMode;
private readonly decodeEntities;
private readonly entityDecoder;
constructor({ xmlMode, decodeEntities, }: {
xmlMode?: boolean;
decodeEntities?: boolean;
}, cbs: Callbacks);
reset(): void;
write(chunk: string): void;
end(): void;
pause(): void;
resume(): void;
private stateText;
private currentSequence;
private sequenceIndex;
private stateSpecialStartSequence;
/** Look for an end tag. For <title> tags, also decode entities. */
private stateInSpecialTag;
private stateCDATASequence;
/**
* When we wait for one specific character, we can speed things up
* by skipping through the buffer until we find it.
*
* @returns Whether the character was found.
*/
private fastForwardTo;
/**
* Comments and CDATA end with `-->` and `]]>`.
*
* Their common qualities are:
* - Their end sequences have a distinct character they start with.
* - That character is then repeated, so we have to check multiple repeats.
* - All characters but the start character of the sequence can be skipped.
*/
private stateInCommentLike;
/**
* HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.
*
* XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).
* We allow anything that wouldn't end the tag.
*/
private isTagStartChar;
private startSpecial;
private stateBeforeTagName;
private stateInTagName;
private stateBeforeClosingTagName;
private stateInClosingTagName;
private stateAfterClosingTagName;
private stateBeforeAttributeName;
private stateInSelfClosingTag;
private stateInAttributeName;
private stateAfterAttributeName;
private stateBeforeAttributeValue;
private handleInAttributeValue;
private stateInAttributeValueDoubleQuotes;
private stateInAttributeValueSingleQuotes;
private stateInAttributeValueNoQuotes;
private stateBeforeDeclaration;
private stateInDeclaration;
private stateInProcessingInstruction;
private stateBeforeComment;
private stateInSpecialComment;
private stateBeforeSpecialS;
private stateBeforeSpecialT;
private startEntity;
private stateInEntity;
/**
* Remove data that has already been consumed from the buffer.
*/
private cleanup;
private shouldContinue;
/**
* Iterates through the buffer, calling the function corresponding to the current state.
*
* States that are more likely to be hit are higher up, as a performance improvement.
*/
private parse;
private finish;
/** Handle any trailing data. */
private handleTrailingData;
private emitCodePoint;
}
//# sourceMappingURL=Tokenizer.d.ts.map
@@ -0,0 +1,23 @@
import get from './get.js';
/**
* The base implementation of `_.at` without support for individual paths.
*
* @private
* @param {Object} object The object to iterate over.
* @param {string[]} paths The property paths to pick.
* @returns {Array} Returns the picked elements.
*/
function baseAt(object, paths) {
var index = -1,
length = paths.length,
result = Array(length),
skip = object == null;
while (++index < length) {
result[index] = skip ? undefined : get(object, paths[index]);
}
return result;
}
export default baseAt;
@@ -0,0 +1,8 @@
import { c as MS_IN_SECOND } from "./constants-BuFquuHl.mjs";
import addMilliseconds from "./addMilliseconds.mjs";
function addSeconds(date, seconds) {
return addMilliseconds(date, seconds * MS_IN_SECOND);
}
export {
addSeconds as default
};
@@ -0,0 +1,46 @@
/**
* @author Yosuke Ota <https://github.com/ota-meshi>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Object.hasOwn` method.",
category: "ES2022",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-object-hasown.html",
},
fixable: null,
messages: {
forbidden: "ES2022 '{{name}}' method is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
Object: {
hasOwn: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1 @@
{"name":"lodash.clonedeep","version":"4.5.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532112083,"integrity":"sha512-PDBH5yS6d8NyF7px/FJOoXdQnTM91zGNIHi8o1KufBZoBNenj8nx6uniy5W6FxGcME8yFECWU9k7+eLrxKCnTQ==","mode":420,"size":752},"README.md":{"checkedAt":1794532112084,"integrity":"sha512-jtE/QiP0gYgEpoOURkoWd29rV6ddtD5vmnKFvvxiegzYh9uYtGgbxzCj1E7Qm5iI9o2AVoqhQA6TXdhF0TJWOg==","mode":420,"size":474},"LICENSE":{"checkedAt":1794532112084,"integrity":"sha512-t/YCqTo2Om0BuHE/C+C/HnDEMbbFc+Iw7HdZ5m3+Ixv6eAFUYHuaWfDgMyL3zt9X0qvXoIPA8u8qq8i8IVvbMg==","mode":420,"size":1951},"index.js":{"checkedAt":1794532112084,"integrity":"sha512-FxXlpirT1QScmmEbnfvCb5B906a9A/li68KY9cdABfI4QbWE+EzifsT5U5QEnYg8hFiR8Cx+Tx9wuU2mbfFtXA==","mode":420,"size":45025}}}
@@ -0,0 +1,5 @@
export declare class AddressError extends Error {
parseMessage?: string;
constructor(message: string, parseMessage?: string);
}
//# sourceMappingURL=address-error.d.ts.map
@@ -0,0 +1,19 @@
/// <reference lib="es2020.bigint"/>
/**
Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
@category Basic
*/
export type TypedArray =
| Int8Array
| Uint8Array
| Uint8ClampedArray
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Float32Array
| Float64Array
| BigInt64Array
| BigUint64Array;
@@ -0,0 +1,11 @@
export default function escapeStringRegexp(string) {
if (typeof string !== 'string') {
throw new TypeError('Expected a string');
}
// Escape characters with special meaning either inside or outside character sets.
// Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
return string
.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
.replace(/-/g, '\\x2d');
}
@@ -0,0 +1,14 @@
import type { BasicTarget } from '../utils/domTarget';
export type KeyType = number | string;
export type KeyPredicate = (event: KeyboardEvent) => KeyType | boolean | undefined;
export type KeyFilter = KeyType | KeyType[] | ((event: KeyboardEvent) => boolean);
export type KeyEvent = 'keydown' | 'keyup';
export type Target = BasicTarget<HTMLElement | Document | Window>;
export type Options = {
events?: KeyEvent[];
target?: Target;
exactMatch?: boolean;
useCapture?: boolean;
};
declare function useKeyPress(keyFilter: KeyFilter, eventHandler: (event: KeyboardEvent, key: KeyType) => void, option?: Options): void;
export default useKeyPress;
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.curryLazyBuildPlanServiceNodeFromClassElementMetadata = curryLazyBuildPlanServiceNodeFromClassElementMetadata;
const InversifyCoreError_1 = require("../../error/models/InversifyCoreError");
const InversifyCoreErrorKind_1 = require("../../error/models/InversifyCoreErrorKind");
const curryBuildPlanServiceNodeFromClassElementMetadata_1 = require("./curryBuildPlanServiceNodeFromClassElementMetadata");
function curryLazyBuildPlanServiceNodeFromClassElementMetadata(buildServiceNodeBindings) {
const buildPlanServiceNodeFromClassElementMetadata = (0, curryBuildPlanServiceNodeFromClassElementMetadata_1.curryBuildPlanServiceNodeFromClassElementMetadata)(buildServiceNodeBindings);
return (params, bindingConstraintsList, elementMetadata) => {
try {
return buildPlanServiceNodeFromClassElementMetadata(params, bindingConstraintsList, elementMetadata);
}
catch (error) {
if (InversifyCoreError_1.InversifyCoreError.isErrorOfKind(error, InversifyCoreErrorKind_1.InversifyCoreErrorKind.planning)) {
return undefined;
}
throw error;
}
};
}
//# sourceMappingURL=curryLazyBuildPlanServiceNodeFromClassElementMetadata.js.map
@@ -0,0 +1,37 @@
# strip-ansi
> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
> [!NOTE]
> Node.js has this built-in now with [`stripVTControlCharacters`](https://nodejs.org/api/util.html#utilstripvtcontrolcharactersstr). The benefit of this package is consistent behavior across Node.js versions and faster improvements. The Node.js version is actually based on this package.
## Install
```sh
npm install strip-ansi
```
## Usage
```js
import stripAnsi from 'strip-ansi';
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'
```
## Related
- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
@@ -0,0 +1,116 @@
import Dispatcher from "./dispatcher";
export default RetryHandler;
declare class RetryHandler implements Dispatcher.DispatchHandlers {
constructor(
options: Dispatcher.DispatchOptions & {
retryOptions?: RetryHandler.RetryOptions;
},
retryHandlers: RetryHandler.RetryHandlers
);
}
declare namespace RetryHandler {
export type RetryState = { counter: number; };
export type RetryContext = {
state: RetryState;
opts: Dispatcher.DispatchOptions & {
retryOptions?: RetryHandler.RetryOptions;
};
}
export type OnRetryCallback = (result?: Error | null) => void;
export type RetryCallback = (
err: Error,
context: {
state: RetryState;
opts: Dispatcher.DispatchOptions & {
retryOptions?: RetryHandler.RetryOptions;
};
},
callback: OnRetryCallback
) => number | null;
export interface RetryOptions {
/**
* Callback to be invoked on every retry iteration.
* It receives the error, current state of the retry object and the options object
* passed when instantiating the retry handler.
*
* @type {RetryCallback}
* @memberof RetryOptions
*/
retry?: RetryCallback;
/**
* Maximum number of retries to allow.
*
* @type {number}
* @memberof RetryOptions
* @default 5
*/
maxRetries?: number;
/**
* Max number of milliseconds allow between retries
*
* @type {number}
* @memberof RetryOptions
* @default 30000
*/
maxTimeout?: number;
/**
* Initial number of milliseconds to wait before retrying for the first time.
*
* @type {number}
* @memberof RetryOptions
* @default 500
*/
minTimeout?: number;
/**
* Factior to multiply the timeout factor between retries.
*
* @type {number}
* @memberof RetryOptions
* @default 2
*/
timeoutFactor?: number;
/**
* It enables to automatically infer timeout between retries based on the `Retry-After` header.
*
* @type {boolean}
* @memberof RetryOptions
* @default true
*/
retryAfter?: boolean;
/**
* HTTP methods to retry.
*
* @type {Dispatcher.HttpMethod[]}
* @memberof RetryOptions
* @default ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
*/
methods?: Dispatcher.HttpMethod[];
/**
* Error codes to be retried. e.g. `ECONNRESET`, `ENOTFOUND`, `ETIMEDOUT`, `ECONNREFUSED`, etc.
*
* @type {string[]}
* @default ['ECONNRESET','ECONNREFUSED','ENOTFOUND','ENETDOWN','ENETUNREACH','EHOSTDOWN','EHOSTUNREACH','EPIPE']
*/
errorCodes?: string[];
/**
* HTTP status codes to be retried.
*
* @type {number[]}
* @memberof RetryOptions
* @default [500, 502, 503, 504, 429],
*/
statusCodes?: number[];
}
export interface RetryHandlers {
dispatch: Dispatcher["dispatch"];
handler: Dispatcher.DispatchHandlers;
}
}
@@ -0,0 +1,3 @@
import CryptoJS = require("./index");
export = CryptoJS.HmacSHA224;
@@ -0,0 +1,3 @@
# @react-aria/label
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1,84 @@
'use strict';
const {
VOID, PRIMITIVE, ARRAY, OBJECT, DATE, REGEXP, MAP, SET, ERROR, BIGINT
} = require('./types.js');
const env = typeof self === 'object' ? self : globalThis;
const deserializer = ($, _) => {
const as = (out, index) => {
$.set(index, out);
return out;
};
const unpair = index => {
if ($.has(index))
return $.get(index);
const [type, value] = _[index];
switch (type) {
case PRIMITIVE:
case VOID:
return as(value, index);
case ARRAY: {
const arr = as([], index);
for (const index of value)
arr.push(unpair(index));
return arr;
}
case OBJECT: {
const object = as({}, index);
for (const [key, index] of value)
object[unpair(key)] = unpair(index);
return object;
}
case DATE:
return as(new Date(value), index);
case REGEXP: {
const {source, flags} = value;
return as(new RegExp(source, flags), index);
}
case MAP: {
const map = as(new Map, index);
for (const [key, index] of value)
map.set(unpair(key), unpair(index));
return map;
}
case SET: {
const set = as(new Set, index);
for (const index of value)
set.add(unpair(index));
return set;
}
case ERROR: {
const {name, message} = value;
return as(new env[name](message), index);
}
case BIGINT:
return as(BigInt(value), index);
case 'BigInt':
return as(Object(BigInt(value)), index);
case 'ArrayBuffer':
return as(new Uint8Array(value).buffer, value);
case 'DataView': {
const { buffer } = new Uint8Array(value);
return as(new DataView(buffer), value);
}
}
return as(new env[type](value), index);
};
return unpair;
};
/**
* @typedef {Array<string,any>} Record a type representation
*/
/**
* Returns a deserialized value from a serialized array of Records.
* @param {Record[]} serialized a previously serialized value.
* @returns {any}
*/
const deserialize = serialized => deserializer(new Map, serialized)(0);
exports.deserialize = deserialize;
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;AAeM,SAAS,0CAAe,KAAgC;IAC7D,0BAA0B;IAC1B,IAAI,AAAC,MAAuB,WAAW,KAAK,MAAM,MAAM,SAAS,EAC/D,OAAO;IAGT,oIAAoI;IACpI,oIAAoI;IACpI,qCAAqC;IACrC,IAAI,CAAA,GAAA,mCAAQ,OAAO,AAAC,MAAuB,WAAW,EACpD,OAAO,MAAM,IAAI,KAAK,WAAW,MAAM,OAAO,KAAK;IAGrD,OAAO,MAAM,MAAM,KAAK,KAAK,CAAC,AAAC,MAAuB,WAAW;AACnE;AAEO,SAAS,0CAAsB,KAAmB;IACvD,yEAAyE;IACzE,uFAAuF;IACvF,kGAAkG;IAClG,mHAAmH;IACnH,oHAAoH;IACpH,8DAA8D;IAC9D,OACE,AAAC,CAAC,CAAA,GAAA,mCAAQ,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,MAAM,KAAK,KACtD,MAAM,KAAK,KAAK,KACf,MAAM,MAAM,KAAK,KACjB,MAAM,QAAQ,KAAK,KACnB,MAAM,MAAM,KAAK,KACjB,MAAM,WAAW,KAAK;AAG5B","sources":["packages/@react-aria/utils/src/isVirtualEvent.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isAndroid} from './platform';\n\n// Original licensing for the following method can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/blob/3c713d513195a53788b3f8bb4b70279d68b15bcc/packages/react-interactions/events/src/dom/shared/index.js#L74-L87\n\n// Keyboards, Assistive Technologies, and element.click() all produce a \"virtual\"\n// click event. This is a method of inferring such clicks. Every browser except\n// IE 11 only sets a zero value of \"detail\" for click events that are \"virtual\".\n// However, IE 11 uses a zero value for all click events. For IE 11 we rely on\n// the quirk that it produces click events that are of type PointerEvent, and\n// where only the \"virtual\" click lacks a pointerType field.\n\nexport function isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n // JAWS/NVDA with Firefox.\n if ((event as PointerEvent).pointerType === '' && event.isTrusted) {\n return true;\n }\n\n // Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead\n // If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check\n // to detect TalkBack virtual clicks.\n if (isAndroid() && (event as PointerEvent).pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n\n return event.detail === 0 && !(event as PointerEvent).pointerType;\n}\n\nexport function isVirtualPointerEvent(event: PointerEvent): boolean {\n // If the pointer size is zero, then we assume it's from a screen reader.\n // Android TalkBack double tap will sometimes return a event with width and height of 1\n // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.\n // Cannot use \"event.pressure === 0\" as the sole check due to Safari pointer events always returning pressure === 0\n // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush\n // Talkback double tap from Windows Firefox touch screen press\n return (\n (!isAndroid() && event.width === 0 && event.height === 0) ||\n (event.width === 1 &&\n event.height === 1 &&\n event.pressure === 0 &&\n event.detail === 0 &&\n event.pointerType === 'mouse'\n )\n );\n}\n"],"names":[],"version":3,"file":"isVirtualEvent.main.js.map"}
@@ -0,0 +1,65 @@
{
"name": "eslint-import-resolver-typescript",
"version": "3.10.1",
"type": "module",
"description": "This plugin adds `TypeScript` support to `eslint-plugin-import`",
"repository": "https://github.com/import-js/eslint-import-resolver-typescript",
"author": "Alex Gorbatchev <alex.gorbatchev@gmail.com>",
"contributors": [
"JounQin <admin@1stg.me> (https://www.1stG.me)"
],
"funding": "https://opencollective.com/eslint-import-resolver-typescript",
"license": "ISC",
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
"main": "lib/index.cjs",
"types": "lib/index.d.ts",
"module": "lib/index.js",
"exports": {
".": {
"types": "./lib/index.d.ts",
"es2020": "./lib/index.es2020.mjs",
"fesm2020": "./lib/index.es2020.mjs",
"import": "./lib/index.js",
"require": "./lib/index.cjs"
},
"./package.json": "./package.json"
},
"es2020": "lib/index.es2020.mjs",
"fesm2020": "lib/index.es2020.mjs",
"files": [
"lib",
"shim.d.ts",
"!**/*.tsbuildinfo"
],
"keywords": [
"typescript",
"eslint",
"import",
"resolver",
"plugin"
],
"peerDependencies": {
"eslint": "*",
"eslint-plugin-import": "*",
"eslint-plugin-import-x": "*"
},
"peerDependenciesMeta": {
"eslint-plugin-import": {
"optional": true
},
"eslint-plugin-import-x": {
"optional": true
}
},
"dependencies": {
"@nolyfill/is-core-module": "1.0.39",
"debug": "^4.4.0",
"get-tsconfig": "^4.10.0",
"is-bun-module": "^2.0.0",
"stable-hash": "^0.0.5",
"tinyglobby": "^0.2.13",
"unrs-resolver": "^1.6.2"
}
}
@@ -0,0 +1,144 @@
# file-selector
> A small package for converting a [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent) or [file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file) to a list of File objects.
[![npm](https://img.shields.io/npm/v/file-selector.svg?style=flat-square)](https://www.npmjs.com/package/file-selector)
![Tests](https://img.shields.io/github/actions/workflow/status/react-dropzone/file-selector/test.yml?branch=master&style=flat-square&label=tests)
[![codecov](https://img.shields.io/coveralls/github/react-dropzone/file-selector/master?style=flat-square)](https://coveralls.io/github/react-dropzone/file-selector?branch=master)
[![Open Collective Backers](https://img.shields.io/opencollective/backers/react-dropzone.svg?style=flat-square)](#backers)
[![Open Collective Sponsors](https://img.shields.io/opencollective/sponsors/react-dropzone.svg?style=flat-square)](#sponsors)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=flat-square)](https://github.com/react-dropzone/.github/blob/main/CODE_OF_CONDUCT.md)
# Table of Contents
* [Installation](#installation)
* [Usage](#usage)
* [Browser Support](#browser-support)
* [Contribute](#contribute)
* [Credits](#credits)
* [Support](#support)
* [License](#license)
## Installation
You can install this package from [NPM](https://www.npmjs.com):
```bash
npm add file-selector
```
### CDN
For CDN, you can use [unpkg](https://unpkg.com):
[https://unpkg.com/file-selector/dist/bundles/file-selector.umd.min.js](https://unpkg.com/file-selector/dist/bundles/file-selector.umd.min.js)
The global namespace for file-selector is `fileSelector`:
```js
const {fromEvent} = fileSelector;
document.addEventListener('drop', async evt => {
const files = await fromEvent(evt);
console.log(files);
});
```
## Usage
### ES6
Convert a [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent) to File objects:
```ts
import {fromEvent} from 'file-selector';
document.addEventListener('drop', async evt => {
const files = await fromEvent(evt);
console.log(files);
});
```
Convert a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) for an input type file to File objects:
```ts
import {fromEvent} from 'file-selector';
const input = document.getElementById('myInput');
input.addEventListener('change', async evt => {
const files = await fromEvent(evt);
console.log(files);
});
```
Convert [FileSystemFileHandle](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle) items to File objects:
```ts
import {fromEvent} from 'file-selector';
// Open file picker
const handles = await window.showOpenFilePicker({multiple: true});
// Get the files
const files = await fromEvent(handles);
console.log(files);
```
**NOTE** The above is experimental and subject to change.
### CommonJS
Convert a `DragEvent` to File objects:
```ts
const {fromEvent} = require('file-selector');
document.addEventListener('drop', async evt => {
const files = await fromEvent(evt);
console.log(files);
});
```
## Browser Support
Most browser support basic File selection with drag 'n' drop or file input:
* [File API](https://developer.mozilla.org/en-US/docs/Web/API/File#Browser_compatibility)
* [Drag Event](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent#Browser_compatibility)
* [DataTransfer](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer#Browser_compatibility)
* [`<input type="file">`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Browser_compatibility)
For folder drop we use the [FileSystem API](https://developer.mozilla.org/en-US/docs/Web/API/FileSystem) which has very limited support:
* [DataTransferItem.getAsFile()](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsFile#Browser_compatibility)
* [DataTransferItem.webkitGetAsEntry()](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#Browser_compatibility)
* [FileSystemEntry](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry#Browser_compatibility)
* [FileSystemFileEntry.file()](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry/file#Browser_compatibility)
* [FileSystemDirectoryEntry.createReader()](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader#Browser_compatibility)
* [FileSystemDirectoryReader.readEntries()](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries#Browser_compatibility)
## Contribute
Checkout the organization [CONTRIBUTING.md](https://github.com/react-dropzone/.github/blob/main/CONTRIBUTING.md).
## Credits
* [html5-file-selector](https://github.com/quarklemotion/html5-file-selector)
## Support
### Backers
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/react-dropzone#backer)]
<a href="https://opencollective.com/react-dropzone/backer/0/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/backer/1/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/backer/2/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/backer/3/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/backer/4/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/backer/5/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/backer/6/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/backer/7/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/backer/8/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/backer/9/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/backer/10/website" target="_blank"><img src="https://opencollective.com/react-dropzone/backer/10/avatar.svg"></a>
### Sponsors
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/react-dropzone#sponsor)]
<a href="https://opencollective.com/react-dropzone/sponsor/0/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/sponsor/1/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/sponsor/2/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/sponsor/3/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/sponsor/4/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/sponsor/5/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/sponsor/6/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/sponsor/7/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/sponsor/8/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/sponsor/9/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/react-dropzone/sponsor/10/website" target="_blank"><img src="https://opencollective.com/react-dropzone/sponsor/10/avatar.svg"></a>
## License
MIT
@@ -0,0 +1,27 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
group_name: import("@sinclair/typebox").TString;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TNull;
type ReturnType = Static<typeof ReturnSchema>;
export default class SetGroupName extends OneBotAction<PayloadType, ReturnType> {
actionName: "set_group_name";
payloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
group_name: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TNull;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
group_id: string;
group_name: string;
};
returnExample: null;
_handle(payload: PayloadType): Promise<null>;
}
export {};
@@ -0,0 +1,396 @@
'use strict'
const { Buffer } = require('buffer')
const symbol = Symbol.for('BufferList')
function BufferList (buf) {
if (!(this instanceof BufferList)) {
return new BufferList(buf)
}
BufferList._init.call(this, buf)
}
BufferList._init = function _init (buf) {
Object.defineProperty(this, symbol, { value: true })
this._bufs = []
this.length = 0
if (buf) {
this.append(buf)
}
}
BufferList.prototype._new = function _new (buf) {
return new BufferList(buf)
}
BufferList.prototype._offset = function _offset (offset) {
if (offset === 0) {
return [0, 0]
}
let tot = 0
for (let i = 0; i < this._bufs.length; i++) {
const _t = tot + this._bufs[i].length
if (offset < _t || i === this._bufs.length - 1) {
return [i, offset - tot]
}
tot = _t
}
}
BufferList.prototype._reverseOffset = function (blOffset) {
const bufferId = blOffset[0]
let offset = blOffset[1]
for (let i = 0; i < bufferId; i++) {
offset += this._bufs[i].length
}
return offset
}
BufferList.prototype.get = function get (index) {
if (index > this.length || index < 0) {
return undefined
}
const offset = this._offset(index)
return this._bufs[offset[0]][offset[1]]
}
BufferList.prototype.slice = function slice (start, end) {
if (typeof start === 'number' && start < 0) {
start += this.length
}
if (typeof end === 'number' && end < 0) {
end += this.length
}
return this.copy(null, 0, start, end)
}
BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {
if (typeof srcStart !== 'number' || srcStart < 0) {
srcStart = 0
}
if (typeof srcEnd !== 'number' || srcEnd > this.length) {
srcEnd = this.length
}
if (srcStart >= this.length) {
return dst || Buffer.alloc(0)
}
if (srcEnd <= 0) {
return dst || Buffer.alloc(0)
}
const copy = !!dst
const off = this._offset(srcStart)
const len = srcEnd - srcStart
let bytes = len
let bufoff = (copy && dstStart) || 0
let start = off[1]
// copy/slice everything
if (srcStart === 0 && srcEnd === this.length) {
if (!copy) {
// slice, but full concat if multiple buffers
return this._bufs.length === 1
? this._bufs[0]
: Buffer.concat(this._bufs, this.length)
}
// copy, need to copy individual buffers
for (let i = 0; i < this._bufs.length; i++) {
this._bufs[i].copy(dst, bufoff)
bufoff += this._bufs[i].length
}
return dst
}
// easy, cheap case where it's a subset of one of the buffers
if (bytes <= this._bufs[off[0]].length - start) {
return copy
? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
: this._bufs[off[0]].slice(start, start + bytes)
}
if (!copy) {
// a slice, we need something to copy in to
dst = Buffer.allocUnsafe(len)
}
for (let i = off[0]; i < this._bufs.length; i++) {
const l = this._bufs[i].length - start
if (bytes > l) {
this._bufs[i].copy(dst, bufoff, start)
bufoff += l
} else {
this._bufs[i].copy(dst, bufoff, start, start + bytes)
bufoff += l
break
}
bytes -= l
if (start) {
start = 0
}
}
// safeguard so that we don't return uninitialized memory
if (dst.length > bufoff) return dst.slice(0, bufoff)
return dst
}
BufferList.prototype.shallowSlice = function shallowSlice (start, end) {
start = start || 0
end = typeof end !== 'number' ? this.length : end
if (start < 0) {
start += this.length
}
if (end < 0) {
end += this.length
}
if (start === end) {
return this._new()
}
const startOffset = this._offset(start)
const endOffset = this._offset(end)
const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)
if (endOffset[1] === 0) {
buffers.pop()
} else {
buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1])
}
if (startOffset[1] !== 0) {
buffers[0] = buffers[0].slice(startOffset[1])
}
return this._new(buffers)
}
BufferList.prototype.toString = function toString (encoding, start, end) {
return this.slice(start, end).toString(encoding)
}
BufferList.prototype.consume = function consume (bytes) {
// first, normalize the argument, in accordance with how Buffer does it
bytes = Math.trunc(bytes)
// do nothing if not a positive number
if (Number.isNaN(bytes) || bytes <= 0) return this
while (this._bufs.length) {
if (bytes >= this._bufs[0].length) {
bytes -= this._bufs[0].length
this.length -= this._bufs[0].length
this._bufs.shift()
} else {
this._bufs[0] = this._bufs[0].slice(bytes)
this.length -= bytes
break
}
}
return this
}
BufferList.prototype.duplicate = function duplicate () {
const copy = this._new()
for (let i = 0; i < this._bufs.length; i++) {
copy.append(this._bufs[i])
}
return copy
}
BufferList.prototype.append = function append (buf) {
if (buf == null) {
return this
}
if (buf.buffer) {
// append a view of the underlying ArrayBuffer
this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength))
} else if (Array.isArray(buf)) {
for (let i = 0; i < buf.length; i++) {
this.append(buf[i])
}
} else if (this._isBufferList(buf)) {
// unwrap argument into individual BufferLists
for (let i = 0; i < buf._bufs.length; i++) {
this.append(buf._bufs[i])
}
} else {
// coerce number arguments to strings, since Buffer(number) does
// uninitialized memory allocation
if (typeof buf === 'number') {
buf = buf.toString()
}
this._appendBuffer(Buffer.from(buf))
}
return this
}
BufferList.prototype._appendBuffer = function appendBuffer (buf) {
this._bufs.push(buf)
this.length += buf.length
}
BufferList.prototype.indexOf = function (search, offset, encoding) {
if (encoding === undefined && typeof offset === 'string') {
encoding = offset
offset = undefined
}
if (typeof search === 'function' || Array.isArray(search)) {
throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.')
} else if (typeof search === 'number') {
search = Buffer.from([search])
} else if (typeof search === 'string') {
search = Buffer.from(search, encoding)
} else if (this._isBufferList(search)) {
search = search.slice()
} else if (Array.isArray(search.buffer)) {
search = Buffer.from(search.buffer, search.byteOffset, search.byteLength)
} else if (!Buffer.isBuffer(search)) {
search = Buffer.from(search)
}
offset = Number(offset || 0)
if (isNaN(offset)) {
offset = 0
}
if (offset < 0) {
offset = this.length + offset
}
if (offset < 0) {
offset = 0
}
if (search.length === 0) {
return offset > this.length ? this.length : offset
}
const blOffset = this._offset(offset)
let blIndex = blOffset[0] // index of which internal buffer we're working on
let buffOffset = blOffset[1] // offset of the internal buffer we're working on
// scan over each buffer
for (; blIndex < this._bufs.length; blIndex++) {
const buff = this._bufs[blIndex]
while (buffOffset < buff.length) {
const availableWindow = buff.length - buffOffset
if (availableWindow >= search.length) {
const nativeSearchResult = buff.indexOf(search, buffOffset)
if (nativeSearchResult !== -1) {
return this._reverseOffset([blIndex, nativeSearchResult])
}
buffOffset = buff.length - search.length + 1 // end of native search window
} else {
const revOffset = this._reverseOffset([blIndex, buffOffset])
if (this._match(revOffset, search)) {
return revOffset
}
buffOffset++
}
}
buffOffset = 0
}
return -1
}
BufferList.prototype._match = function (offset, search) {
if (this.length - offset < search.length) {
return false
}
for (let searchOffset = 0; searchOffset < search.length; searchOffset++) {
if (this.get(offset + searchOffset) !== search[searchOffset]) {
return false
}
}
return true
}
;(function () {
const methods = {
readDoubleBE: 8,
readDoubleLE: 8,
readFloatBE: 4,
readFloatLE: 4,
readInt32BE: 4,
readInt32LE: 4,
readUInt32BE: 4,
readUInt32LE: 4,
readInt16BE: 2,
readInt16LE: 2,
readUInt16BE: 2,
readUInt16LE: 2,
readInt8: 1,
readUInt8: 1,
readIntBE: null,
readIntLE: null,
readUIntBE: null,
readUIntLE: null
}
for (const m in methods) {
(function (m) {
if (methods[m] === null) {
BufferList.prototype[m] = function (offset, byteLength) {
return this.slice(offset, offset + byteLength)[m](0, byteLength)
}
} else {
BufferList.prototype[m] = function (offset = 0) {
return this.slice(offset, offset + methods[m])[m](0)
}
}
}(m))
}
}())
// Used internally by the class and also as an indicator of this object being
// a `BufferList`. It's not possible to use `instanceof BufferList` in a browser
// environment because there could be multiple different copies of the
// BufferList class and some `BufferList`s might be `BufferList`s.
BufferList.prototype._isBufferList = function _isBufferList (b) {
return b instanceof BufferList || BufferList.isBufferList(b)
}
BufferList.isBufferList = function isBufferList (b) {
return b != null && b[symbol]
}
module.exports = BufferList
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.id_x509CRL = exports.id_crlTypes = exports.CRLBag = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const types_1 = require("./types");
class CRLBag {
constructor(params = {}) {
this.crlId = "";
this.crltValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
exports.CRLBag = CRLBag;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], CRLBag.prototype, "crlId", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any, context: 0 })
], CRLBag.prototype, "crltValue", void 0);
exports.id_crlTypes = `${types_1.id_pkcs_9}.23`;
exports.id_x509CRL = `${exports.id_crlTypes}.1`;
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = buildMatchMemberExpression;
var _matchesPattern = require("./matchesPattern.js");
function buildMatchMemberExpression(match, allowPartial) {
const parts = match.split(".");
return member => (0, _matchesPattern.default)(member, parts, allowPartial);
}
//# sourceMappingURL=buildMatchMemberExpression.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAYlD,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
@@ -0,0 +1,91 @@
/* eslint-disable jest/no-conditional-expect */
import React, { useEffect, useRef } from 'react';
import renderer from 'react-test-renderer';
import { render, fireEvent, screen } from '@testing-library/react';
// import userEvent from '@testing-library/user-event';
// import '@testing-library/jest-dom';
import CodeMirror, { ReactCodeMirrorRef } from '..';
it('CodeMirror', async () => {
const component = renderer.create(<CodeMirror />);
let tree = component.toJSON();
if (tree && !Array.isArray(tree)) {
expect(tree.type).toEqual('div');
expect(tree.props.className).toEqual('cm-theme-light');
}
});
it('CodeMirror onChange', async () => {
const handleChange = jest.fn((value) => {
expect(value).toEqual('# title');
return Array.isArray(value) ? value.join() : value;
});
render(<CodeMirror autoFocus value="console.log('Hello world!')" onChange={handleChange} />);
const input = await screen.findByRole<HTMLInputElement>('textbox'); // findByRole('textbox');
fireEvent.change(input, { target: { textContent: '# title' } });
const elm = screen.queryByText('# title');
expect(elm?.innerHTML).toEqual('# title');
});
it('CodeMirror onUpdate', async () => {
render(
<CodeMirror
value="console.log('Hello world!')"
autoFocus
onUpdate={(viewUpdate) => {
expect(viewUpdate.state.doc.length).toEqual(27);
}}
/>,
);
});
it('CodeMirror ref', async () => {
function Demo() {
const ref = useRef<ReactCodeMirrorRef>(null);
useEffect(() => {
expect(Object.keys(ref.current!)).toEqual(['editor', 'state', 'view']);
}, [ref]);
return <CodeMirror ref={ref} value="console.log('Hello world!')" />;
}
render(<Demo />);
});
it('CodeMirror theme', async () => {
const component = renderer.create(<CodeMirror theme="dark" />);
let tree = component.toJSON();
if (tree && !Array.isArray(tree)) {
expect(tree.type).toEqual('div');
expect(tree.props.className).toEqual('cm-theme-dark');
}
});
it('CodeMirror className', async () => {
const component = renderer.create(<CodeMirror className="test" />);
let tree = component.toJSON();
if (tree && !Array.isArray(tree)) {
expect(tree.type).toEqual('div');
expect(tree.props.className).toEqual('cm-theme-light test');
}
});
it('CodeMirror placeholder', async () => {
render(<CodeMirror placeholder="Hello World" className="test" />);
const elm = screen.queryByText('Hello World');
expect(elm!.style['pointerEvents']).toEqual('none');
expect(elm!.className).toEqual('cm-placeholder');
});
it('CodeMirror editable', async () => {
render(<CodeMirror editable={false} className="test" />);
const text = screen.getByRole('textbox');
expect(text.className).toEqual('cm-content');
expect(text.tagName).toEqual('DIV');
});
it("CodeMirror doesn't echo changes", async () => {
const handleChange = jest.fn();
const { rerender } = render(<CodeMirror value="value a" onChange={handleChange} />);
rerender(<CodeMirror value="value b" onChange={handleChange} />);
expect(handleChange).not.toHaveBeenCalled();
});
@@ -0,0 +1,5 @@
export type Check = import("./lib/index.js").Check;
export type Test = import("./lib/index.js").Test;
export type TestFunction = import("./lib/index.js").TestFunction;
export { is, convert } from "./lib/index.js";
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,29 @@
"use client";
import {
checkbox_group_default
} from "./chunk-D7WRZFSP.mjs";
import {
checkbox_default
} from "./chunk-4MFDKOXF.mjs";
import {
CheckboxIcon
} from "./chunk-5E6Z6LLK.mjs";
import {
useCheckboxGroup
} from "./chunk-LPCF7J76.mjs";
import {
useCheckbox
} from "./chunk-5JTA22ZA.mjs";
import {
CheckboxGroupProvider,
useCheckboxGroupContext
} from "./chunk-LK575OWX.mjs";
export {
checkbox_default as Checkbox,
checkbox_group_default as CheckboxGroup,
CheckboxGroupProvider,
CheckboxIcon,
useCheckbox,
useCheckboxGroup,
useCheckboxGroupContext
};
@@ -0,0 +1,70 @@
'use strict';
var path = require('path');
var isNegated = require('is-negated-glob');
var isAbsolute = require('is-absolute');
module.exports = function(glob, options) {
// default options
var opts = options || {};
// ensure cwd is absolute
var cwd = path.resolve(opts.cwd ? opts.cwd : process.cwd());
cwd = unixify(cwd);
var rootDir = opts.root;
// if `options.root` is defined, ensure it's absolute
if (rootDir) {
rootDir = unixify(rootDir);
if (process.platform === 'win32' || !isAbsolute(rootDir)) {
rootDir = unixify(path.resolve(rootDir));
}
}
// trim starting ./ from glob patterns
if (glob.slice(0, 2) === './') {
glob = glob.slice(2);
}
// when the glob pattern is only a . use an empty string
if (glob.length === 1 && glob === '.') {
glob = '';
}
// store last character before glob is modified
var suffix = glob.slice(-1);
// check to see if glob is negated (and not a leading negated-extglob)
var ing = isNegated(glob);
glob = ing.pattern;
// make glob absolute
if (rootDir && glob.charAt(0) === '/') {
glob = join(rootDir, glob);
} else if (!isAbsolute(glob) || glob.slice(0, 1) === '\\') {
glob = join(cwd, glob);
}
// if glob had a trailing `/`, re-add it now in case it was removed
if (suffix === '/' && glob.slice(-1) !== '/') {
glob += '/';
}
// re-add leading `!` if it was removed
return ing.negated ? '!' + glob : glob;
};
function unixify(filepath) {
return filepath.replace(/\\/g, '/');
}
function join(dir, glob) {
if (dir.charAt(dir.length - 1) === '/') {
dir = dir.slice(0, -1);
}
if (glob.charAt(0) === '/') {
glob = glob.slice(1);
}
if (!glob) return dir;
return dir + '/' + glob;
}
@@ -0,0 +1,2 @@
import type { TSESTree } from '@typescript-eslint/utils';
export declare function skipChainExpression<T extends TSESTree.Node>(node: T): T | TSESTree.ChainElement;
@@ -0,0 +1,64 @@
# yocto-queue [![](https://badgen.net/bundlephobia/minzip/yocto-queue)](https://bundlephobia.com/result?p=yocto-queue)
> Tiny queue data structure
You should use this package instead of an array if you do a lot of `Array#push()` and `Array#shift()` on large arrays, since `Array#shift()` has [linear time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(N)%E2%80%94Linear%20Time) *O(n)* while `Queue#dequeue()` has [constant time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(1)%20%E2%80%94%20Constant%20Time) *O(1)*. That makes a huge difference for large arrays.
> A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is an ordered list of elements where an element is inserted at the end of the queue and is removed from the front of the queue. A queue works based on the first-in, first-out ([FIFO](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics))) principle.
## Install
```
$ npm install yocto-queue
```
## Usage
```js
const Queue = require('yocto-queue');
const queue = new Queue();
queue.enqueue('🦄');
queue.enqueue('🌈');
console.log(queue.size);
//=> 2
console.log(...queue);
//=> '🦄 🌈'
console.log(queue.dequeue());
//=> '🦄'
console.log(queue.dequeue());
//=> '🌈'
```
## API
### `queue = new Queue()`
The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow.
#### `.enqueue(value)`
Add a value to the queue.
#### `.dequeue()`
Remove the next value in the queue.
Returns the removed value or `undefined` if the queue is empty.
#### `.clear()`
Clear the queue.
#### `.size`
The size of the queue.
## Related
- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple “Least Recently Used” (LRU) cache
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from '../types.js';
import 'react';
declare const DeleteDocumentBulkIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { DeleteDocumentBulkIcon };
@@ -0,0 +1,47 @@
'use strict';
const path = require('path');
const Module = require('module');
const fs = require('fs');
const resolveFrom = (fromDir, moduleId, silent) => {
if (typeof fromDir !== 'string') {
throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``);
}
if (typeof moduleId !== 'string') {
throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
}
try {
fromDir = fs.realpathSync(fromDir);
} catch (err) {
if (err.code === 'ENOENT') {
fromDir = path.resolve(fromDir);
} else if (silent) {
return null;
} else {
throw err;
}
}
const fromFile = path.join(fromDir, 'noop.js');
const resolveFileName = () => Module._resolveFilename(moduleId, {
id: fromFile,
filename: fromFile,
paths: Module._nodeModulePaths(fromDir)
});
if (silent) {
try {
return resolveFileName();
} catch (err) {
return null;
}
}
return resolveFileName();
};
module.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId);
module.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true);
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('unionBy', require('../unionBy'));
func.placeholder = require('./placeholder');
module.exports = func;
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more