docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1 @@
{"version":3,"file":"monitor-off.js","sources":["../../../src/icons/monitor-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MonitorOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgMTdINGEyIDIgMCAwIDEtMi0yVjVjMC0xLjUgMS0yIDEtMiIgLz4KICA8cGF0aCBkPSJNMjIgMTVWNWEyIDIgMCAwIDAtMi0ySDkiIC8+CiAgPHBhdGggZD0iTTggMjFoOCIgLz4KICA8cGF0aCBkPSJNMTIgMTd2NCIgLz4KICA8cGF0aCBkPSJtMiAyIDIwIDIwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/monitor-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MonitorOff = createLucideIcon('MonitorOff', [\n ['path', { d: 'M17 17H4a2 2 0 0 1-2-2V5c0-1.5 1-2 1-2', key: 'k0q8oc' }],\n ['path', { d: 'M22 15V5a2 2 0 0 0-2-2H9', key: 'cp1ac0' }],\n ['path', { d: 'M8 21h8', key: '1ev6f3' }],\n ['path', { d: 'M12 17v4', key: '1riwvh' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n]);\n\nexport default MonitorOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,47 @@
import type {
CodeKeywordDefinition,
ErrorObject,
KeywordErrorDefinition,
AnySchema,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, not, Name} from "../../compile/codegen"
import {alwaysValidSchema, Type} from "../../compile/util"
export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {limit: number}, AnySchema>
const error: KeywordErrorDefinition = {
message: ({params: {len}}) => str`must NOT have more than ${len} items`,
params: ({params: {len}}) => _`{limit: ${len}}`,
}
const def: CodeKeywordDefinition = {
keyword: "unevaluatedItems",
type: "array",
schemaType: ["boolean", "object"],
error,
code(cxt: KeywordCxt) {
const {gen, schema, data, it} = cxt
const items = it.items || 0
if (items === true) return
const len = gen.const("len", _`${data}.length`)
if (schema === false) {
cxt.setParams({len: items})
cxt.fail(_`${len} > ${items}`)
} else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) {
const valid = gen.var("valid", _`${len} <= ${items}`)
gen.if(not(valid), () => validateItems(valid, items))
cxt.ok(valid)
}
it.items = true
function validateItems(valid: Name, from: Name | number): void {
gen.forRange("i", from, len, (i) => {
cxt.subschema({keyword: "unevaluatedItems", dataProp: i, dataPropType: Type.Num}, valid)
if (!it.allErrors) gen.if(not(valid), () => gen.break())
})
}
},
}
export default def
@@ -0,0 +1,41 @@
import Client from './client'
import TPoolStats from './pool-stats'
import { URL } from 'node:url'
import Dispatcher from './dispatcher'
export default Pool
type PoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
declare class Pool extends Dispatcher {
constructor (url: string | URL, options?: Pool.Options)
/** `true` after `pool.close()` has been called. */
closed: boolean
/** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
destroyed: boolean
/** Aggregate stats for a Pool. */
readonly stats: TPoolStats
// Override dispatcher APIs.
override connect (
options: PoolConnectOptions
): Promise<Dispatcher.ConnectData>
override connect (
options: PoolConnectOptions,
callback: (err: Error | null, data: Dispatcher.ConnectData) => void
): void
}
declare namespace Pool {
export type PoolStats = TPoolStats
export interface Options extends Client.Options {
/** Default: `(origin, opts) => new Client(origin, opts)`. */
factory?(origin: URL, opts: object): Dispatcher;
/** The max number of clients to create. `null` if no limit. Default `null`. */
connections?: number | null;
/** The amount of time before a client is removed from the pool and closed. `null` if no time limit. Default `null` */
clientTtl?: number | null;
interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options['interceptors']
}
}
@@ -0,0 +1,892 @@
export {
Format,
FormatDefinition,
AsyncFormatDefinition,
KeywordDefinition,
KeywordErrorDefinition,
CodeKeywordDefinition,
MacroKeywordDefinition,
FuncKeywordDefinition,
Vocabulary,
Schema,
SchemaObject,
AnySchemaObject,
AsyncSchema,
AnySchema,
ValidateFunction,
AsyncValidateFunction,
AnyValidateFunction,
ErrorObject,
ErrorNoParams,
} from "./types"
export {SchemaCxt, SchemaObjCxt} from "./compile"
export interface Plugin<Opts> {
(ajv: Ajv, options?: Opts): Ajv
[prop: string]: any
}
export {KeywordCxt} from "./compile/validate"
export {DefinedError} from "./vocabularies/errors"
export {JSONType} from "./compile/rules"
export {JSONSchemaType} from "./types/json-schema"
export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema"
export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen"
import type {
Schema,
AnySchema,
AnySchemaObject,
SchemaObject,
AsyncSchema,
Vocabulary,
KeywordDefinition,
AddedKeywordDefinition,
AnyValidateFunction,
ValidateFunction,
AsyncValidateFunction,
ErrorObject,
Format,
AddedFormat,
RegExpEngine,
UriResolver,
} from "./types"
import type {JSONSchemaType} from "./types/json-schema"
import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema"
import ValidationError from "./runtime/validation_error"
import MissingRefError from "./compile/ref_error"
import {getRules, ValidationRules, Rule, RuleGroup, JSONType} from "./compile/rules"
import {SchemaEnv, compileSchema, resolveSchema} from "./compile"
import {Code, ValueScope} from "./compile/codegen"
import {normalizeId, getSchemaRefs} from "./compile/resolve"
import {getJSONTypes} from "./compile/validate/dataType"
import {eachItem} from "./compile/util"
import * as $dataRefSchema from "./refs/data.json"
import DefaultUriResolver from "./runtime/uri"
const defaultRegExp: RegExpEngine = (str, flags) => new RegExp(str, flags)
defaultRegExp.code = "new RegExp"
const META_IGNORE_OPTIONS: (keyof Options)[] = ["removeAdditional", "useDefaults", "coerceTypes"]
const EXT_SCOPE_NAMES = new Set([
"validate",
"serialize",
"parse",
"wrapper",
"root",
"schema",
"keyword",
"pattern",
"formats",
"validate$data",
"func",
"obj",
"Error",
])
export type Options = CurrentOptions & DeprecatedOptions
export interface CurrentOptions {
// strict mode options (NEW)
strict?: boolean | "log"
strictSchema?: boolean | "log"
strictNumbers?: boolean | "log"
strictTypes?: boolean | "log"
strictTuples?: boolean | "log"
strictRequired?: boolean | "log"
allowMatchingProperties?: boolean // disables a strict mode restriction
allowUnionTypes?: boolean
validateFormats?: boolean
// validation and reporting options:
$data?: boolean
allErrors?: boolean
verbose?: boolean
discriminator?: boolean
unicodeRegExp?: boolean
timestamp?: "string" | "date" // JTD only
parseDate?: boolean // JTD only
allowDate?: boolean // JTD only
specialNumbers?: "fast" | "null" // JTD only
$comment?:
| true
| ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown)
formats?: {[Name in string]?: Format}
keywords?: Vocabulary
schemas?: AnySchema[] | {[Key in string]?: AnySchema}
logger?: Logger | false
loadSchema?: (uri: string) => Promise<AnySchemaObject>
// options to modify validated data:
removeAdditional?: boolean | "all" | "failing"
useDefaults?: boolean | "empty"
coerceTypes?: boolean | "array"
// advanced options:
next?: boolean // NEW
unevaluated?: boolean // NEW
dynamicRef?: boolean // NEW
schemaId?: "id" | "$id"
jtd?: boolean // NEW
meta?: SchemaObject | boolean
defaultMeta?: string | AnySchemaObject
validateSchema?: boolean | "log"
addUsedSchema?: boolean
inlineRefs?: boolean | number
passContext?: boolean
loopRequired?: number
loopEnum?: number // NEW
ownProperties?: boolean
multipleOfPrecision?: number
int32range?: boolean // JTD only
messages?: boolean
code?: CodeOptions // NEW
uriResolver?: UriResolver
}
export interface CodeOptions {
es5?: boolean
esm?: boolean
lines?: boolean
optimize?: boolean | number
formats?: Code // code to require (or construct) map of available formats - for standalone code
source?: boolean
process?: (code: string, schema?: SchemaEnv) => string
regExp?: RegExpEngine
}
interface InstanceCodeOptions extends CodeOptions {
regExp: RegExpEngine
optimize: number
}
interface DeprecatedOptions {
/** @deprecated */
ignoreKeywordsWithRef?: boolean
/** @deprecated */
jsPropertySyntax?: boolean // added instead of jsonPointers
/** @deprecated */
unicode?: boolean
}
interface RemovedOptions {
format?: boolean
errorDataPath?: "object" | "property"
nullable?: boolean // "nullable" keyword is supported by default
jsonPointers?: boolean
extendRefs?: true | "ignore" | "fail"
missingRefs?: true | "ignore" | "fail"
processCode?: (code: string, schema?: SchemaEnv) => string
sourceCode?: boolean
strictDefaults?: boolean
strictKeywords?: boolean
uniqueItems?: boolean
unknownFormats?: true | string[] | "ignore"
cache?: any
serialize?: (schema: AnySchema) => unknown
ajvErrors?: boolean
}
type OptionsInfo<T extends RemovedOptions | DeprecatedOptions> = {
[K in keyof T]-?: string | undefined
}
const removedOptions: OptionsInfo<RemovedOptions> = {
errorDataPath: "",
format: "`validateFormats: false` can be used instead.",
nullable: '"nullable" keyword is supported by default.',
jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
sourceCode: "Use option `code: {source: true}`",
strictDefaults: "It is default now, see option `strict`.",
strictKeywords: "It is default now, see option `strict`.",
uniqueItems: '"uniqueItems" keyword is always validated.',
unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
cache: "Map is used as cache, schema object as key.",
serialize: "Map is used as cache, schema object as key.",
ajvErrors: "It is default now.",
}
const deprecatedOptions: OptionsInfo<DeprecatedOptions> = {
ignoreKeywordsWithRef: "",
jsPropertySyntax: "",
unicode: '"minLength"/"maxLength" account for unicode characters by default.',
}
type RequiredInstanceOptions = {
[K in
| "strictSchema"
| "strictNumbers"
| "strictTypes"
| "strictTuples"
| "strictRequired"
| "inlineRefs"
| "loopRequired"
| "loopEnum"
| "meta"
| "messages"
| "schemaId"
| "addUsedSchema"
| "validateSchema"
| "validateFormats"
| "int32range"
| "unicodeRegExp"
| "uriResolver"]: NonNullable<Options[K]>
} & {code: InstanceCodeOptions}
export type InstanceOptions = Options & RequiredInstanceOptions
const MAX_EXPRESSION = 200
// eslint-disable-next-line complexity
function requiredOptions(o: Options): RequiredInstanceOptions {
const s = o.strict
const _optz = o.code?.optimize
const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0
const regExp = o.code?.regExp ?? defaultRegExp
const uriResolver = o.uriResolver ?? DefaultUriResolver
return {
strictSchema: o.strictSchema ?? s ?? true,
strictNumbers: o.strictNumbers ?? s ?? true,
strictTypes: o.strictTypes ?? s ?? "log",
strictTuples: o.strictTuples ?? s ?? "log",
strictRequired: o.strictRequired ?? s ?? false,
code: o.code ? {...o.code, optimize, regExp} : {optimize, regExp},
loopRequired: o.loopRequired ?? MAX_EXPRESSION,
loopEnum: o.loopEnum ?? MAX_EXPRESSION,
meta: o.meta ?? true,
messages: o.messages ?? true,
inlineRefs: o.inlineRefs ?? true,
schemaId: o.schemaId ?? "$id",
addUsedSchema: o.addUsedSchema ?? true,
validateSchema: o.validateSchema ?? true,
validateFormats: o.validateFormats ?? true,
unicodeRegExp: o.unicodeRegExp ?? true,
int32range: o.int32range ?? true,
uriResolver: uriResolver,
}
}
export interface Logger {
log(...args: unknown[]): unknown
warn(...args: unknown[]): unknown
error(...args: unknown[]): unknown
}
export default class Ajv {
opts: InstanceOptions
errors?: ErrorObject[] | null // errors from the last validation
logger: Logger
// shared external scope values for compiled functions
readonly scope: ValueScope
readonly schemas: {[Key in string]?: SchemaEnv} = {}
readonly refs: {[Ref in string]?: SchemaEnv | string} = {}
readonly formats: {[Name in string]?: AddedFormat} = Object.create(null)
readonly RULES: ValidationRules
readonly _compilations: Set<SchemaEnv> = new Set()
private readonly _loading: {[Ref in string]?: Promise<AnySchemaObject>} = {}
private readonly _cache: Map<AnySchema, SchemaEnv> = new Map()
private readonly _metaOpts: InstanceOptions
static ValidationError = ValidationError
static MissingRefError = MissingRefError
constructor(opts: Options = {}) {
opts = this.opts = {...opts, ...requiredOptions(opts)}
const {es5, lines} = this.opts.code
this.scope = new ValueScope({scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines})
this.logger = getLogger(opts.logger)
const formatOpt = opts.validateFormats
opts.validateFormats = false
this.RULES = getRules()
checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED")
checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn")
this._metaOpts = getMetaSchemaOptions.call(this)
if (opts.formats) addInitialFormats.call(this)
this._addVocabularies()
this._addDefaultMetaSchema()
if (opts.keywords) addInitialKeywords.call(this, opts.keywords)
if (typeof opts.meta == "object") this.addMetaSchema(opts.meta)
addInitialSchemas.call(this)
opts.validateFormats = formatOpt
}
_addVocabularies(): void {
this.addKeyword("$async")
}
_addDefaultMetaSchema(): void {
const {$data, meta, schemaId} = this.opts
let _dataRefSchema: SchemaObject = $dataRefSchema
if (schemaId === "id") {
_dataRefSchema = {...$dataRefSchema}
_dataRefSchema.id = _dataRefSchema.$id
delete _dataRefSchema.$id
}
if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false)
}
defaultMeta(): string | AnySchemaObject | undefined {
const {meta, schemaId} = this.opts
return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined)
}
// Validate data using schema
// AnySchema will be compiled and cached using schema itself as a key for Map
validate(schema: Schema | string, data: unknown): boolean
validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise<unknown>
validate<T>(schema: Schema | JSONSchemaType<T> | string, data: unknown): data is T
// Separated for type inference to work
// eslint-disable-next-line @typescript-eslint/unified-signatures
validate<T>(schema: JTDSchemaType<T>, data: unknown): data is T
// This overload is only intended for typescript inference, the first
// argument prevents manual type annotation from matching this overload
// eslint-disable-next-line @typescript-eslint/no-unused-vars
validate<N extends never, T extends SomeJTDSchemaType>(
schema: T,
data: unknown
): data is JTDDataType<T>
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
validate<T>(schema: AsyncSchema, data: unknown | T): Promise<T>
validate<T>(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise<T>
validate<T>(
schemaKeyRef: AnySchema | string, // key, ref or schema object
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
data: unknown | T // to be validated
): boolean | Promise<T> {
let v: AnyValidateFunction | undefined
if (typeof schemaKeyRef == "string") {
v = this.getSchema<T>(schemaKeyRef)
if (!v) throw new Error(`no schema with key or ref "${schemaKeyRef}"`)
} else {
v = this.compile<T>(schemaKeyRef)
}
const valid = v(data)
if (!("$async" in v)) this.errors = v.errors
return valid
}
// Create validation function for passed schema
// _meta: true if schema is a meta-schema. Used internally to compile meta schemas of user-defined keywords.
compile<T = unknown>(schema: Schema | JSONSchemaType<T>, _meta?: boolean): ValidateFunction<T>
// Separated for type inference to work
// eslint-disable-next-line @typescript-eslint/unified-signatures
compile<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): ValidateFunction<T>
// This overload is only intended for typescript inference, the first
// argument prevents manual type annotation from matching this overload
// eslint-disable-next-line @typescript-eslint/no-unused-vars
compile<N extends never, T extends SomeJTDSchemaType>(
schema: T,
_meta?: boolean
): ValidateFunction<JTDDataType<T>>
compile<T = unknown>(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction<T>
compile<T = unknown>(schema: AnySchema, _meta?: boolean): AnyValidateFunction<T>
compile<T = unknown>(schema: AnySchema, _meta?: boolean): AnyValidateFunction<T> {
const sch = this._addSchema(schema, _meta)
return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction<T>
}
// Creates validating function for passed schema with asynchronous loading of missing schemas.
// `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.
// TODO allow passing schema URI
// meta - optional true to compile meta-schema
compileAsync<T = unknown>(
schema: SchemaObject | JSONSchemaType<T>,
_meta?: boolean
): Promise<ValidateFunction<T>>
// Separated for type inference to work
// eslint-disable-next-line @typescript-eslint/unified-signatures
compileAsync<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): Promise<ValidateFunction<T>>
compileAsync<T = unknown>(schema: AsyncSchema, meta?: boolean): Promise<AsyncValidateFunction<T>>
// eslint-disable-next-line @typescript-eslint/unified-signatures
compileAsync<T = unknown>(
schema: AnySchemaObject,
meta?: boolean
): Promise<AnyValidateFunction<T>>
compileAsync<T = unknown>(
schema: AnySchemaObject,
meta?: boolean
): Promise<AnyValidateFunction<T>> {
if (typeof this.opts.loadSchema != "function") {
throw new Error("options.loadSchema should be a function")
}
const {loadSchema} = this.opts
return runCompileAsync.call(this, schema, meta)
async function runCompileAsync(
this: Ajv,
_schema: AnySchemaObject,
_meta?: boolean
): Promise<AnyValidateFunction> {
await loadMetaSchema.call(this, _schema.$schema)
const sch = this._addSchema(_schema, _meta)
return sch.validate || _compileAsync.call(this, sch)
}
async function loadMetaSchema(this: Ajv, $ref?: string): Promise<void> {
if ($ref && !this.getSchema($ref)) {
await runCompileAsync.call(this, {$ref}, true)
}
}
async function _compileAsync(this: Ajv, sch: SchemaEnv): Promise<AnyValidateFunction> {
try {
return this._compileSchemaEnv(sch)
} catch (e) {
if (!(e instanceof MissingRefError)) throw e
checkLoaded.call(this, e)
await loadMissingSchema.call(this, e.missingSchema)
return _compileAsync.call(this, sch)
}
}
function checkLoaded(this: Ajv, {missingSchema: ref, missingRef}: MissingRefError): void {
if (this.refs[ref]) {
throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`)
}
}
async function loadMissingSchema(this: Ajv, ref: string): Promise<void> {
const _schema = await _loadSchema.call(this, ref)
if (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema)
if (!this.refs[ref]) this.addSchema(_schema, ref, meta)
}
async function _loadSchema(this: Ajv, ref: string): Promise<AnySchemaObject> {
const p = this._loading[ref]
if (p) return p
try {
return await (this._loading[ref] = loadSchema(ref))
} finally {
delete this._loading[ref]
}
}
}
// Adds schema to the instance
addSchema(
schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored
key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
_meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
_validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.
): Ajv {
if (Array.isArray(schema)) {
for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema)
return this
}
let id: string | undefined
if (typeof schema === "object") {
const {schemaId} = this.opts
id = schema[schemaId]
if (id !== undefined && typeof id != "string") {
throw new Error(`schema ${schemaId} must be string`)
}
}
key = normalizeId(key || id)
this._checkUnique(key)
this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true)
return this
}
// Add schema that will be used to validate other schemas
// options in META_IGNORE_OPTIONS are alway set to false
addMetaSchema(
schema: AnySchemaObject,
key?: string, // schema key
_validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema
): Ajv {
this.addSchema(schema, key, true, _validateSchema)
return this
}
// Validate schema against its meta-schema
validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise<unknown> {
if (typeof schema == "boolean") return true
let $schema: string | AnySchemaObject | undefined
$schema = schema.$schema
if ($schema !== undefined && typeof $schema != "string") {
throw new Error("$schema must be a string")
}
$schema = $schema || this.opts.defaultMeta || this.defaultMeta()
if (!$schema) {
this.logger.warn("meta-schema not available")
this.errors = null
return true
}
const valid = this.validate($schema, schema)
if (!valid && throwOrLogError) {
const message = "schema is invalid: " + this.errorsText()
if (this.opts.validateSchema === "log") this.logger.error(message)
else throw new Error(message)
}
return valid
}
// Get compiled schema by `key` or `ref`.
// (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
getSchema<T = unknown>(keyRef: string): AnyValidateFunction<T> | undefined {
let sch
while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch
if (sch === undefined) {
const {schemaId} = this.opts
const root = new SchemaEnv({schema: {}, schemaId})
sch = resolveSchema.call(this, root, keyRef)
if (!sch) return
this.refs[keyRef] = sch
}
return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction<T> | undefined
}
// Remove cached schema(s).
// If no parameter is passed all schemas but meta-schemas are removed.
// If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
// Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv {
if (schemaKeyRef instanceof RegExp) {
this._removeAllSchemas(this.schemas, schemaKeyRef)
this._removeAllSchemas(this.refs, schemaKeyRef)
return this
}
switch (typeof schemaKeyRef) {
case "undefined":
this._removeAllSchemas(this.schemas)
this._removeAllSchemas(this.refs)
this._cache.clear()
return this
case "string": {
const sch = getSchEnv.call(this, schemaKeyRef)
if (typeof sch == "object") this._cache.delete(sch.schema)
delete this.schemas[schemaKeyRef]
delete this.refs[schemaKeyRef]
return this
}
case "object": {
const cacheKey = schemaKeyRef
this._cache.delete(cacheKey)
let id = schemaKeyRef[this.opts.schemaId]
if (id) {
id = normalizeId(id)
delete this.schemas[id]
delete this.refs[id]
}
return this
}
default:
throw new Error("ajv.removeSchema: invalid parameter")
}
}
// add "vocabulary" - a collection of keywords
addVocabulary(definitions: Vocabulary): Ajv {
for (const def of definitions) this.addKeyword(def)
return this
}
addKeyword(
kwdOrDef: string | KeywordDefinition,
def?: KeywordDefinition // deprecated
): Ajv {
let keyword: string | string[]
if (typeof kwdOrDef == "string") {
keyword = kwdOrDef
if (typeof def == "object") {
this.logger.warn("these parameters are deprecated, see docs for addKeyword")
def.keyword = keyword
}
} else if (typeof kwdOrDef == "object" && def === undefined) {
def = kwdOrDef
keyword = def.keyword
if (Array.isArray(keyword) && !keyword.length) {
throw new Error("addKeywords: keyword must be string or non-empty array")
}
} else {
throw new Error("invalid addKeywords parameters")
}
checkKeyword.call(this, keyword, def)
if (!def) {
eachItem(keyword, (kwd) => addRule.call(this, kwd))
return this
}
keywordMetaschema.call(this, def)
const definition: AddedKeywordDefinition = {
...def,
type: getJSONTypes(def.type),
schemaType: getJSONTypes(def.schemaType),
}
eachItem(
keyword,
definition.type.length === 0
? (k) => addRule.call(this, k, definition)
: (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))
)
return this
}
getKeyword(keyword: string): AddedKeywordDefinition | boolean {
const rule = this.RULES.all[keyword]
return typeof rule == "object" ? rule.definition : !!rule
}
// Remove keyword
removeKeyword(keyword: string): Ajv {
// TODO return type should be Ajv
const {RULES} = this
delete RULES.keywords[keyword]
delete RULES.all[keyword]
for (const group of RULES.rules) {
const i = group.rules.findIndex((rule) => rule.keyword === keyword)
if (i >= 0) group.rules.splice(i, 1)
}
return this
}
// Add format
addFormat(name: string, format: Format): Ajv {
if (typeof format == "string") format = new RegExp(format)
this.formats[name] = format
return this
}
errorsText(
errors: ErrorObject[] | null | undefined = this.errors, // optional array of validation errors
{separator = ", ", dataVar = "data"}: ErrorsTextOptions = {} // optional options with properties `separator` and `dataVar`
): string {
if (!errors || errors.length === 0) return "No errors"
return errors
.map((e) => `${dataVar}${e.instancePath} ${e.message}`)
.reduce((text, msg) => text + separator + msg)
}
$dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject {
const rules = this.RULES.all
metaSchema = JSON.parse(JSON.stringify(metaSchema))
for (const jsonPointer of keywordsJsonPointers) {
const segments = jsonPointer.split("/").slice(1) // first segment is an empty string
let keywords = metaSchema
for (const seg of segments) keywords = keywords[seg] as AnySchemaObject
for (const key in rules) {
const rule = rules[key]
if (typeof rule != "object") continue
const {$data} = rule.definition
const schema = keywords[key] as AnySchemaObject | undefined
if ($data && schema) keywords[key] = schemaOrData(schema)
}
}
return metaSchema
}
private _removeAllSchemas(schemas: {[Ref in string]?: SchemaEnv | string}, regex?: RegExp): void {
for (const keyRef in schemas) {
const sch = schemas[keyRef]
if (!regex || regex.test(keyRef)) {
if (typeof sch == "string") {
delete schemas[keyRef]
} else if (sch && !sch.meta) {
this._cache.delete(sch.schema)
delete schemas[keyRef]
}
}
}
}
_addSchema(
schema: AnySchema,
meta?: boolean,
baseId?: string,
validateSchema = this.opts.validateSchema,
addSchema = this.opts.addUsedSchema
): SchemaEnv {
let id: string | undefined
const {schemaId} = this.opts
if (typeof schema == "object") {
id = schema[schemaId]
} else {
if (this.opts.jtd) throw new Error("schema must be object")
else if (typeof schema != "boolean") throw new Error("schema must be object or boolean")
}
let sch = this._cache.get(schema)
if (sch !== undefined) return sch
baseId = normalizeId(id || baseId)
const localRefs = getSchemaRefs.call(this, schema, baseId)
sch = new SchemaEnv({schema, schemaId, meta, baseId, localRefs})
this._cache.set(sch.schema, sch)
if (addSchema && !baseId.startsWith("#")) {
// TODO atm it is allowed to overwrite schemas without id (instead of not adding them)
if (baseId) this._checkUnique(baseId)
this.refs[baseId] = sch
}
if (validateSchema) this.validateSchema(schema, true)
return sch
}
private _checkUnique(id: string): void {
if (this.schemas[id] || this.refs[id]) {
throw new Error(`schema with key or id "${id}" already exists`)
}
}
private _compileSchemaEnv(sch: SchemaEnv): AnyValidateFunction {
if (sch.meta) this._compileMetaSchema(sch)
else compileSchema.call(this, sch)
/* istanbul ignore if */
if (!sch.validate) throw new Error("ajv implementation error")
return sch.validate
}
private _compileMetaSchema(sch: SchemaEnv): void {
const currentOpts = this.opts
this.opts = this._metaOpts
try {
compileSchema.call(this, sch)
} finally {
this.opts = currentOpts
}
}
}
export interface ErrorsTextOptions {
separator?: string
dataVar?: string
}
function checkOptions(
this: Ajv,
checkOpts: OptionsInfo<RemovedOptions | DeprecatedOptions>,
options: Options & RemovedOptions,
msg: string,
log: "warn" | "error" = "error"
): void {
for (const key in checkOpts) {
const opt = key as keyof typeof checkOpts
if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`)
}
}
function getSchEnv(this: Ajv, keyRef: string): SchemaEnv | string | undefined {
keyRef = normalizeId(keyRef) // TODO tests fail without this line
return this.schemas[keyRef] || this.refs[keyRef]
}
function addInitialSchemas(this: Ajv): void {
const optsSchemas = this.opts.schemas
if (!optsSchemas) return
if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas)
else for (const key in optsSchemas) this.addSchema(optsSchemas[key] as AnySchema, key)
}
function addInitialFormats(this: Ajv): void {
for (const name in this.opts.formats) {
const format = this.opts.formats[name]
if (format) this.addFormat(name, format)
}
}
function addInitialKeywords(
this: Ajv,
defs: Vocabulary | {[K in string]?: KeywordDefinition}
): void {
if (Array.isArray(defs)) {
this.addVocabulary(defs)
return
}
this.logger.warn("keywords option as map is deprecated, pass array")
for (const keyword in defs) {
const def = defs[keyword] as KeywordDefinition
if (!def.keyword) def.keyword = keyword
this.addKeyword(def)
}
}
function getMetaSchemaOptions(this: Ajv): InstanceOptions {
const metaOpts = {...this.opts}
for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt]
return metaOpts
}
const noLogs = {log() {}, warn() {}, error() {}}
function getLogger(logger?: Partial<Logger> | false): Logger {
if (logger === false) return noLogs
if (logger === undefined) return console
if (logger.log && logger.warn && logger.error) return logger as Logger
throw new Error("logger must implement log, warn and error methods")
}
const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i
function checkKeyword(this: Ajv, keyword: string | string[], def?: KeywordDefinition): void {
const {RULES} = this
eachItem(keyword, (kwd) => {
if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`)
if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`)
})
if (!def) return
if (def.$data && !("code" in def || "validate" in def)) {
throw new Error('$data keyword must have "code" or "validate" function')
}
}
function addRule(
this: Ajv,
keyword: string,
definition?: AddedKeywordDefinition,
dataType?: JSONType
): void {
const post = definition?.post
if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"')
const {RULES} = this
let ruleGroup = post ? RULES.post : RULES.rules.find(({type: t}) => t === dataType)
if (!ruleGroup) {
ruleGroup = {type: dataType, rules: []}
RULES.rules.push(ruleGroup)
}
RULES.keywords[keyword] = true
if (!definition) return
const rule: Rule = {
keyword,
definition: {
...definition,
type: getJSONTypes(definition.type),
schemaType: getJSONTypes(definition.schemaType),
},
}
if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before)
else ruleGroup.rules.push(rule)
RULES.all[keyword] = rule
definition.implements?.forEach((kwd) => this.addKeyword(kwd))
}
function addBeforeRule(this: Ajv, ruleGroup: RuleGroup, rule: Rule, before: string): void {
const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before)
if (i >= 0) {
ruleGroup.rules.splice(i, 0, rule)
} else {
ruleGroup.rules.push(rule)
this.logger.warn(`rule ${before} is not defined`)
}
}
function keywordMetaschema(this: Ajv, def: KeywordDefinition): void {
let {metaSchema} = def
if (metaSchema === undefined) return
if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema)
def.validateSchema = this.compile(metaSchema, true)
}
const $dataRef = {
$ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
}
function schemaOrData(schema: AnySchema): AnySchemaObject {
return {anyOf: [schema, $dataRef]}
}
@@ -0,0 +1 @@
{"version":3,"file":"createMcpHandler-D4NN8WsG.d.mts","names":[],"sources":["../../core-internal/src/auth/errors.ts","../../core-internal/src/errors/sdkErrors.ts","../../core-internal/src/shared/authUtils.ts","../../core-internal/src/types/schemas.ts","../../core-internal/src/types/types.ts","../../core-internal/src/wire/codec.ts","../../core-internal/src/shared/inboundClassification.ts","../../core-internal/src/util/standardSchema.ts","../../core-internal/src/shared/elicitation.ts","../../core-internal/src/shared/inputRequired.ts","../../core-internal/src/types/enums.ts","../../core-internal/src/types/errors.ts","../../core-internal/src/types/guards.ts","../../core-internal/src/types/specTypeSchema.ts","../../core-internal/src/shared/transport.ts","../../core-internal/src/shared/protocol.ts","../../core-internal/src/shared/mediaType.ts","../../core-internal/src/shared/metadataUtils.ts","../../core-internal/src/shared/protocolEras.ts","../../core-internal/src/shared/resultCacheHints.ts","../../core-internal/src/shared/stdio.ts","../../core-internal/src/shared/uriTemplate.ts","../../core-internal/src/util/inMemory.ts","../../core-internal/src/wire/preload.ts","../src/server/scopeChallenge.ts","../src/server/server.ts","../src/server/mcp.ts","../src/server/perRequestTransport.ts","../src/server/serverEventBus.ts","../src/server/createMcpHandler.ts"],"sourcesContent":[],"mappings":";;;;;;;;;aAOY,cAAA;EAAA;AA8GZ;;;EAkBkF,cAAA,GAAA,iBAAA;EAA0C;;;;EAsC1F,aAAA,GAAA,gBAAA;EAAqB;;;;;;ACnKvD;AA6GA;EAsC8B,kBAAA,GAAA,qBAAA;EAjCT;;;EAa0F,oBAAA,GAAA,wBAAA;EAoBjF;;;EAtCK,YAAA,GAAA,eAAA;EAoDlB;AAsBjB;;EAUsB,YAAA,GAAA,eAAA;EAAqC;;;EAVjB,WAAA,GAAA,cAAA;;;;ECvL1B,sBAAA,GAAA,yBAAgD;EAwBhD;;;EAIO,uBAAA,GAAA,2BAAA;EACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cF8EX,UAAA,SAAmB,KAAA;iBA4BF;;UAvBT,MAAA,CAAO,WAAA;;;;;;;;;;kFAasD,+BAA6B,aAAa;oBAU9F;;;;sBAYN;;;;gCAgBU,qBAAqB;;;;;;;;;;AAtKvD;AA8GA;AA4B8B,aCvIlB,YAAA;EDgHS;EAa6D,YAAA,GAAA,eAAA;EAA0C;EAAb,gBAAA,GAAA,mBAAA;EAUjF;EAYN,cAAA,GAAA,iBAAA;EAgBU;EAAqB,sBAAA,GAAA,0BAAA;EAxDvB;EAAK,cAAA,GAAA,iBAAA;;;;EC3GzB,UAAA,GAAA,aAAY;EA6GX;EAsCiB,aAAA,GAAA,gBAAA;EAjCT;;;;;EAoCH,qBAAA,GAAA,yBAAA;EAzCY;;AAoD9B;AAsBA;;;;;EAAkC,2BAAA,GAAA,gCAAA;EAAQ;;;;ACvL1C;AAwBA;;;EAIuB,sBAAA,GAAA,0BAAA;EACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cDgFX,QAAA,SAAiB,KAAA;iBAsCA;;UAjCT,MAAA,CAAO,WAAA;;;;;;;;;;kFAasD,+BAA6B,aAAa;;;;;;;;;;;oBAoB9F,qEAGZ;;;;;UAWD,gBAAA;;;;;;;;;;;;;;;;;;;;;cAsBJ,YAAA,SAAqB,QAAA;iBAKP;;;;oBAKL,qCAAqC,4BAA4B;;;;;;;;;;;;ADpMvF;AA8GA;;AAKqB,iBEhHL,wBAAA,CFgHY,GAAA,EEhHkB,GFgHlB,GAAA,MAAA,CAAA,EEhHiC,GFgHjC;;;;;;;;;;;AChHhB,iBCwBI,oBAAA,CDxBQ;EAAA,iBAAA;EAAA;CAAA,EAAA;EA6GX,iBAAS,ECjFC,GDiFD,GAAA,MAAA;EAsCQ,kBAAA,ECtHN,GDsHM,GAAA,MAAA;CAjCT,CAAA,EAAA,OAAO;AAAA;;;;;;;ADrH5B;AA8GA,KImEK,iBJnEmB,CAAA,GAAA,CAAA,GImEI,GJnEJ,SAAA,MAAA,GAAA,CImEwB,GJnExB,SAAA,KAAA,EAAA,GAAA,QA4BM,MIuCoD,CJvCpD,GIuCwD,iBJvCxD,CIuC0E,CJvC1E,CIuC4E,CJvC5E,CAAA,CAAA,EAvBT,GAAA,KAAO,CAAA,GI8D+F,GJ9D/F;KIgEvB,SAAA,GJnD6E,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,MAAA,GAAA,IAAA,GAAA,SAAA;KIoD7E,OJpDuH,CAAA,GAAA,CAAA,GIoD1G,GJpD0G,SIoDhG,SJpDgG,GIqDtH,GJrDsH,GIsDtH,GJtDsH,SIsD5G,KJtD4G,CAAA,KAAA,EAAA,CAAA,GIuDpH,KJvDoH,CIuD9G,OJvD8G,CIuDtG,CJvDsG,CAAA,CAAA,GIwDpH,GJxDoH,SIwD1G,GJxD0G,CAAA,KAAA,EAAA,CAAA,GIyDlH,GJzDkH,CIyD9G,OJzD8G,CIyDtG,CJzDsG,CAAA,CAAA,GI0DlH,GJ1DkH,SI0DxG,GJ1DwG,CAAA,KAAA,EAAA,EAAA,KAAA,EAAA,CAAA,GI2DhH,GJ3DgH,CI2D5G,OJ3D4G,CI2DpG,CJ3DoG,CAAA,EI2DhG,OJ3DgG,CI2DxF,CJ3DwF,CAAA,CAAA,GI4DhH,GJ5DgH,SAAA,MAAA,GAAA,QAAb,MI6DnF,GJ7DmF,GI6D/E,OJ7D+E,CI6DvE,GJ7DuE,CI6DrE,CJ7DqE,CAAA,CAAA,EAUjF,GIoDhB,GJpDgB;KIsDzB,KJ1CmB,CAAA,eI0CE,CAAA,CAAE,UJ1CJ,CAAA,GI0CkB,OJ1ClB,CI0C0B,CAAA,CAAE,KJ1C5B,CI0CkC,MJ1ClC,CAAA,CAAA;;;;;;;;ACnJxB;AA6GA,KG0FK,iBAAA,GH1FiB,YAAA;;;;;;KGiGjB,aH3DyB,CAAA,GAAA,CAAA,GG2DN,GH3DM,SAAA,OAAA,GAAA,QAGZ,MGwDwC,GHxDxC,IGwD6C,CHxD7C,SGwDuD,iBHxDvD,GAAA,KAAA,GGwDmF,CHxDnF,GGwDuF,GHxDvF,CGwDyF,CHxDzF,CAAA,EAzCY,GAAA,KAAA;AAAK,KGoGvB,aAAA,GAAgB,KHpGO,CAAA,OGoGM,mBHpGN,CAAA;AAoDlB,KGiDL,MAAA,GAAS,KHjDY,CAAA,OGiDC,YHjDD,CAAA;AAsBpB,KG4BD,SAAA,GAAU,KH5BI,CAAA,OG4BS,aH5BT,CAAA;;AAUJ,KGoBV,0BAAA,GAA6B,KHpBnB,CAAA,OGoBgC,gCHpBhC,CAAA;AAAqC,KGqB/C,WAAA,GAAc,KHrBiC,CAAA,OGqBpB,iBHrBoB,CAAA;AAA4B,KGsB3E,YAAA,GAAe,KHtB4D,CAAA,OGsB/C,kBHtB+C,CAAA;AAVrD,KGiCtB,QAAA,GAAS,aHjCa,CGiCC,KHjCD,CAAA,OGiCc,YHjCd,CAAA,CAAA;AAAQ,KGkC9B,SAAA,GAAY,KHlCkB,CAAA,OGkCL,eHlCK,CAAA;KGmC9B,cAAA,GAAiB,aAAa;KAC9B,mBAAA,GAAsB,aAAa;KACnC,oBAAA,GAAuB,aAAa;AF5NhC,KE+NJ,qBAAA,GAAwB,IF/NI,CE+NC,KF/NK,CAAA,OE+NQ,2BF/NU,CAAA,EAAA,QAAA,CAAA,GAAA;EAwBhD,MAAA,EEuM0F,QFvM1F;CACZ;AACA,KEsMQ,eAAA,GAAkB,qBFtM1B,GEsMkD,oBFtMlD;AAEmB,KEqMX,cAAA,GAAiB,cFrMN,GEqMuB,mBFrMvB,GEqM6C,qBFrM7C,GEqMqE,oBFrMrE;AACC,KEqMZ,aAAA,GAAgB,KFrMJ,CAAA,OEqMiB,uBFrMjB,CAAA;AAAG,KEsMf,kBAAA,GAAqB,KFtMN,CAAA,OEsMmB,yBFtMnB,CAAA;;;;;;;;;;KEgNf,mBAAA;KAYA,WAAA,GAAc,cAAc,aAAa;KAGzC,2BAAA,GAA8B,aAAa;KAC3C,qBAAA,GAAwB,aAAa;KAGrC,IAAA,GAAO,aAAa;KACpB,KAAA,GAAQ,aAAa;KACrB,YAAA,GAAe,aAAa;KAC5B,WAAA,GAAc,aAAa;KAC3B,IAAA,GAAO,aAAa;KAGpB,cAAA,GAAiB,aAAa;;;;;;;;KAQ9B,kLine truncated
@@ -0,0 +1,20 @@
import { expect, test } from "vitest";
test("coalesce", () => {
expect(true).toBe(true);
});
// test("nonoptional with default", () => {
// const schema = z.string().optional().coalesce("hi");
// expectTypeOf<typeof schema._input>().toEqualTypeOf<string | undefined>();
// expectTypeOf<typeof schema._output>().toEqualTypeOf<string>();
// expect(schema.parse(undefined)).toBe("hi");
// });
// test("nonoptional in object", () => {
// const schema = z.object({ hi: z.string().optional().nonoptional("hi") });
// expectTypeOf<typeof schema._input>().toEqualTypeOf<{ hi: string | undefined }>();
// expectTypeOf<typeof schema._output>().toEqualTypeOf<{ hi: string }>();
// expect(schema.parse(undefined)).toBe("hi");
// });
@@ -0,0 +1 @@
{"version":3,"file":"shield.js","sources":["../../../src/icons/shield.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Shield\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgMTNjMCA1LTMuNSA3LjUtNy42NiA4Ljk1YTEgMSAwIDAgMS0uNjctLjAxQzcuNSAyMC41IDQgMTggNCAxM1Y2YTEgMSAwIDAgMSAxLTFjMiAwIDQuNS0xLjIgNi4yNC0yLjcyYTEuMTcgMS4xNyAwIDAgMSAxLjUyIDBDMTQuNTEgMy44MSAxNyA1IDE5IDVhMSAxIDAgMCAxIDEgMXoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/shield\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Shield = createLucideIcon('Shield', [\n [\n 'path',\n {\n d: 'M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z',\n key: 'oel41y',\n },\n ],\n]);\n\nexport default Shield;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,725 @@
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import errno
import filecmp
import os.path
import re
import shlex
import subprocess
import sys
import tempfile
from collections.abc import MutableSet
# A minimal memoizing decorator. It'll blow up if the args aren't immutable,
# among other "problems".
class memoize:
def __init__(self, func):
self.func = func
self.cache = {}
def __call__(self, *args):
try:
return self.cache[args]
except KeyError:
result = self.func(*args)
self.cache[args] = result
return result
class GypError(Exception):
"""Error class representing an error, which is to be presented
to the user. The main entry point will catch and display this.
"""
def ExceptionAppend(e, msg):
"""Append a message to the given exception's message."""
if not e.args:
e.args = (msg,)
elif len(e.args) == 1:
e.args = (str(e.args[0]) + " " + msg,)
else:
e.args = (str(e.args[0]) + " " + msg,) + e.args[1:]
def FindQualifiedTargets(target, qualified_list):
"""
Given a list of qualified targets, return the qualified targets for the
specified |target|.
"""
return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target]
def ParseQualifiedTarget(target):
# Splits a qualified target into a build file, target name and toolset.
# NOTE: rsplit is used to disambiguate the Windows drive letter separator.
target_split = target.rsplit(":", 1)
if len(target_split) == 2:
[build_file, target] = target_split
else:
build_file = None
target_split = target.rsplit("#", 1)
if len(target_split) == 2:
[target, toolset] = target_split
else:
toolset = None
return [build_file, target, toolset]
def ResolveTarget(build_file, target, toolset):
# This function resolves a target into a canonical form:
# - a fully defined build file, either absolute or relative to the current
# directory
# - a target name
# - a toolset
#
# build_file is the file relative to which 'target' is defined.
# target is the qualified target.
# toolset is the default toolset for that target.
[parsed_build_file, target, parsed_toolset] = ParseQualifiedTarget(target)
if parsed_build_file:
if build_file:
# If a relative path, parsed_build_file is relative to the directory
# containing build_file. If build_file is not in the current directory,
# parsed_build_file is not a usable path as-is. Resolve it by
# interpreting it as relative to build_file. If parsed_build_file is
# absolute, it is usable as a path regardless of the current directory,
# and os.path.join will return it as-is.
build_file = os.path.normpath(
os.path.join(os.path.dirname(build_file), parsed_build_file)
)
# Further (to handle cases like ../cwd), make it relative to cwd)
if not os.path.isabs(build_file):
build_file = RelativePath(build_file, ".")
else:
build_file = parsed_build_file
if parsed_toolset:
toolset = parsed_toolset
return [build_file, target, toolset]
def BuildFile(fully_qualified_target):
# Extracts the build file from the fully qualified target.
return ParseQualifiedTarget(fully_qualified_target)[0]
def GetEnvironFallback(var_list, default):
"""Look up a key in the environment, with fallback to secondary keys
and finally falling back to a default value."""
for var in var_list:
if var in os.environ:
return os.environ[var]
return default
def QualifiedTarget(build_file, target, toolset):
# "Qualified" means the file that a target was defined in and the target
# name, separated by a colon, suffixed by a # and the toolset name:
# /path/to/file.gyp:target_name#toolset
fully_qualified = build_file + ":" + target
if toolset:
fully_qualified = fully_qualified + "#" + toolset
return fully_qualified
@memoize
def RelativePath(path, relative_to, follow_path_symlink=True):
# Assuming both |path| and |relative_to| are relative to the current
# directory, returns a relative path that identifies path relative to
# relative_to.
# If |follow_symlink_path| is true (default) and |path| is a symlink, then
# this method returns a path to the real file represented by |path|. If it is
# false, this method returns a path to the symlink. If |path| is not a
# symlink, this option has no effect.
# Convert to normalized (and therefore absolute paths).
path = os.path.realpath(path) if follow_path_symlink else os.path.abspath(path)
relative_to = os.path.realpath(relative_to)
# On Windows, we can't create a relative path to a different drive, so just
# use the absolute path.
if sys.platform == "win32" and (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path
# Split the paths into components.
path_split = path.split(os.path.sep)
relative_to_split = relative_to.split(os.path.sep)
# Determine how much of the prefix the two paths share.
prefix_len = len(os.path.commonprefix([path_split, relative_to_split]))
# Put enough ".." components to back up out of relative_to to the common
# prefix, and then append the part of path_split after the common prefix.
relative_split = [os.path.pardir] * (
len(relative_to_split) - prefix_len
) + path_split[prefix_len:]
if len(relative_split) == 0:
# The paths were the same.
return ""
# Turn it back into a string and we're done.
return os.path.join(*relative_split)
@memoize
def InvertRelativePath(path, toplevel_dir=None):
"""Given a path like foo/bar that is relative to toplevel_dir, return
the inverse relative path back to the toplevel_dir.
E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path)))
should always produce the empty string, unless the path contains symlinks.
"""
if not path:
return path
toplevel_dir = "." if toplevel_dir is None else toplevel_dir
return RelativePath(toplevel_dir, os.path.join(toplevel_dir, path))
def FixIfRelativePath(path, relative_to):
# Like RelativePath but returns |path| unchanged if it is absolute.
if os.path.isabs(path):
return path
return RelativePath(path, relative_to)
def UnrelativePath(path, relative_to):
# Assuming that |relative_to| is relative to the current directory, and |path|
# is a path relative to the dirname of |relative_to|, returns a path that
# identifies |path| relative to the current directory.
rel_dir = os.path.dirname(relative_to)
return os.path.normpath(os.path.join(rel_dir, path))
# re objects used by EncodePOSIXShellArgument. See IEEE 1003.1 XCU.2.2 at
# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_02
# and the documentation for various shells.
# _quote is a pattern that should match any argument that needs to be quoted
# with double-quotes by EncodePOSIXShellArgument. It matches the following
# characters appearing anywhere in an argument:
# \t, \n, space parameter separators
# # comments
# $ expansions (quoted to always expand within one argument)
# % called out by IEEE 1003.1 XCU.2.2
# & job control
# ' quoting
# (, ) subshell execution
# *, ?, [ pathname expansion
# ; command delimiter
# <, >, | redirection
# = assignment
# {, } brace expansion (bash)
# ~ tilde expansion
# It also matches the empty string, because "" (or '') is the only way to
# represent an empty string literal argument to a POSIX shell.
#
# This does not match the characters in _escape, because those need to be
# backslash-escaped regardless of whether they appear in a double-quoted
# string.
_quote = re.compile("[\t\n #$%&'()*;<=>?[{|}~]|^$")
# _escape is a pattern that should match any character that needs to be
# escaped with a backslash, whether or not the argument matched the _quote
# pattern. _escape is used with re.sub to backslash anything in _escape's
# first match group, hence the (parentheses) in the regular expression.
#
# _escape matches the following characters appearing anywhere in an argument:
# " to prevent POSIX shells from interpreting this character for quoting
# \ to prevent POSIX shells from interpreting this character for escaping
# ` to prevent POSIX shells from interpreting this character for command
# substitution
# Missing from this list is $, because the desired behavior of
# EncodePOSIXShellArgument is to permit parameter (variable) expansion.
#
# Also missing from this list is !, which bash will interpret as the history
# expansion character when history is enabled. bash does not enable history
# by default in non-interactive shells, so this is not thought to be a problem.
# ! was omitted from this list because bash interprets "\!" as a literal string
# including the backslash character (avoiding history expansion but retaining
# the backslash), which would not be correct for argument encoding. Handling
# this case properly would also be problematic because bash allows the history
# character to be changed with the histchars shell variable. Fortunately,
# as history is not enabled in non-interactive shells and
# EncodePOSIXShellArgument is only expected to encode for non-interactive
# shells, there is no room for error here by ignoring !.
_escape = re.compile(r'(["\\`])')
def EncodePOSIXShellArgument(argument):
"""Encodes |argument| suitably for consumption by POSIX shells.
argument may be quoted and escaped as necessary to ensure that POSIX shells
treat the returned value as a literal representing the argument passed to
this function. Parameter (variable) expansions beginning with $ are allowed
to remain intact without escaping the $, to allow the argument to contain
references to variables to be expanded by the shell.
"""
if not isinstance(argument, str):
argument = str(argument)
quote = '"' if _quote.search(argument) else ""
encoded = quote + re.sub(_escape, r"\\\1", argument) + quote
return encoded
def EncodePOSIXShellList(list):
"""Encodes |list| suitably for consumption by POSIX shells.
Returns EncodePOSIXShellArgument for each item in list, and joins them
together using the space character as an argument separator.
"""
encoded_arguments = []
for argument in list:
encoded_arguments.append(EncodePOSIXShellArgument(argument))
return " ".join(encoded_arguments)
def DeepDependencyTargets(target_dicts, roots):
"""Returns the recursive list of target dependencies."""
dependencies = set()
pending = set(roots)
while pending:
# Pluck out one.
r = pending.pop()
# Skip if visited already.
if r in dependencies:
continue
# Add it.
dependencies.add(r)
# Add its children.
spec = target_dicts[r]
pending.update(set(spec.get("dependencies", [])))
pending.update(set(spec.get("dependencies_original", [])))
return list(dependencies - set(roots))
def BuildFileTargets(target_list, build_file):
"""From a target_list, returns the subset from the specified build_file."""
return [p for p in target_list if BuildFile(p) == build_file]
def AllTargets(target_list, target_dicts, build_file):
"""Returns all targets (direct and dependencies) for the specified build_file."""
bftargets = BuildFileTargets(target_list, build_file)
deptargets = DeepDependencyTargets(target_dicts, bftargets)
return bftargets + deptargets
def WriteOnDiff(filename):
"""Write to a file only if the new contents differ.
Arguments:
filename: name of the file to potentially write to.
Returns:
A file like object which will write to temporary file and only overwrite
the target if it differs (on close).
"""
class Writer:
"""Wrapper around file which only covers the target if it differs."""
def __init__(self):
# On Cygwin remove the "dir" argument
# `C:` prefixed paths are treated as relative,
# consequently ending up with current dir "/cygdrive/c/..."
# being prefixed to those, which was
# obviously a non-existent path,
# for example: "/cygdrive/c/<some folder>/C:\<my win style abs path>".
# For more details see:
# https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp
base_temp_dir = "" if IsCygwin() else os.path.dirname(filename)
# Pick temporary file.
tmp_fd, self.tmp_path = tempfile.mkstemp(
suffix=".tmp",
prefix=os.path.split(filename)[1] + ".gyp.",
dir=base_temp_dir,
)
try:
self.tmp_file = os.fdopen(tmp_fd, "wb")
except Exception:
# Don't leave turds behind.
os.unlink(self.tmp_path)
raise
def __getattr__(self, attrname):
# Delegate everything else to self.tmp_file
return getattr(self.tmp_file, attrname)
def close(self):
try:
# Close tmp file.
self.tmp_file.close()
# Determine if different.
same = False
try:
same = filecmp.cmp(self.tmp_path, filename, False)
except OSError as e:
if e.errno != errno.ENOENT:
raise
if same:
# The new file is identical to the old one, just get rid of the new
# one.
os.unlink(self.tmp_path)
else:
# The new file is different from the old one,
# or there is no old one.
# Rename the new file to the permanent name.
#
# tempfile.mkstemp uses an overly restrictive mode, resulting in a
# file that can only be read by the owner, regardless of the umask.
# There's no reason to not respect the umask here,
# which means that an extra hoop is required
# to fetch it and reset the new file's mode.
#
# No way to get the umask without setting a new one? Set a safe one
# and then set it back to the old value.
umask = os.umask(0o77)
os.umask(umask)
os.chmod(self.tmp_path, 0o666 & ~umask)
if sys.platform == "win32" and os.path.exists(filename):
# NOTE: on windows (but not cygwin) rename will not replace an
# existing file, so it must be preceded with a remove.
# Sadly there is no way to make the switch atomic.
os.remove(filename)
os.rename(self.tmp_path, filename)
except Exception:
# Don't leave turds behind.
os.unlink(self.tmp_path)
raise
def write(self, s):
self.tmp_file.write(s.encode("utf-8"))
return Writer()
def EnsureDirExists(path):
"""Make sure the directory for |path| exists."""
try:
os.makedirs(os.path.dirname(path))
except OSError:
pass
def GetCompilerPredefines(): # -> dict
cmd = []
defines = {}
# shlex.split() will eat '\' in posix mode, but
# setting posix=False will preserve extra '"' cause CreateProcess fail on Windows
# this makes '\' in %CC_target% and %CFLAGS% work
def replace_sep(s):
return s.replace(os.sep, "/") if os.sep != "/" else s
if CC := os.environ.get("CC_target") or os.environ.get("CC"):
cmd += shlex.split(replace_sep(CC))
if CFLAGS := os.environ.get("CFLAGS"):
cmd += shlex.split(replace_sep(CFLAGS))
elif CXX := os.environ.get("CXX_target") or os.environ.get("CXX"):
cmd += shlex.split(replace_sep(CXX))
if CXXFLAGS := os.environ.get("CXXFLAGS"):
cmd += shlex.split(replace_sep(CXXFLAGS))
else:
return defines
if sys.platform == "win32":
fd, input = tempfile.mkstemp(suffix=".c")
real_cmd = [*cmd, "-dM", "-E", "-x", "c", input]
try:
os.close(fd)
stdout = subprocess.run(
real_cmd, shell=True, capture_output=True, check=True
).stdout
except subprocess.CalledProcessError as e:
print(
"Warning: failed to get compiler predefines\n"
"cmd: %s\n"
"status: %d" % (e.cmd, e.returncode),
file=sys.stderr,
)
return defines
finally:
os.unlink(input)
else:
input = "/dev/null"
real_cmd = [*cmd, "-dM", "-E", "-x", "c", input]
try:
stdout = subprocess.run(
real_cmd, shell=False, capture_output=True, check=True
).stdout
except subprocess.CalledProcessError as e:
print(
"Warning: failed to get compiler predefines\n"
"cmd: %s\n"
"status: %d" % (e.cmd, e.returncode),
file=sys.stderr,
)
return defines
lines = stdout.decode("utf-8").replace("\r\n", "\n").split("\n")
for line in lines:
if (line or "").startswith("#define "):
_, key, *value = line.split(" ")
defines[key] = " ".join(value)
return defines
def GetFlavorByPlatform():
"""Returns |params.flavor| if it's set, the system's default flavor else."""
flavors = {
"cygwin": "win",
"win32": "win",
"darwin": "mac",
}
if sys.platform in flavors:
return flavors[sys.platform]
if sys.platform.startswith("sunos"):
return "solaris"
if sys.platform.startswith(("dragonfly", "freebsd")):
return "freebsd"
if sys.platform.startswith("openbsd"):
return "openbsd"
if sys.platform.startswith("netbsd"):
return "netbsd"
if sys.platform.startswith("aix"):
return "aix"
if sys.platform.startswith(("os390", "zos")):
return "zos"
if sys.platform == "os400":
return "os400"
return "linux"
def GetFlavor(params):
if "flavor" in params:
return params["flavor"]
defines = GetCompilerPredefines()
if "__EMSCRIPTEN__" in defines:
return "emscripten"
if "__wasm__" in defines:
return "wasi" if "__wasi__" in defines else "wasm"
return GetFlavorByPlatform()
def CopyTool(flavor, out_path, generator_flags={}):
"""Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it
to |out_path|."""
# aix and solaris just need flock emulation. mac and win use more complicated
# support scripts.
prefix = {
"aix": "flock",
"os400": "flock",
"solaris": "flock",
"mac": "mac",
"ios": "mac",
"win": "win",
}.get(flavor, None)
if not prefix:
return
# Slurp input file.
source_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "%s_tool.py" % prefix
)
with open(source_path) as source_file:
source = source_file.readlines()
# Set custom header flags.
header = "# Generated by gyp. Do not edit.\n"
mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None)
if flavor == "mac" and mac_toolchain_dir:
header += "import os;\nos.environ['DEVELOPER_DIR']='%s'\n" % mac_toolchain_dir
# Add header and write it out.
tool_path = os.path.join(out_path, "gyp-%s-tool" % prefix)
with open(tool_path, "w") as tool_file:
tool_file.write("".join([source[0], header] + source[1:]))
# Make file executable.
os.chmod(tool_path, 0o755)
# From Alex Martelli,
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560
# ASPN: Python Cookbook: Remove duplicates from a sequence
# First comment, dated 2001/10/13.
# (Also in the printed Python Cookbook.)
def uniquer(seq, idfun=lambda x: x):
seen = {}
result = []
for item in seq:
marker = idfun(item)
if marker in seen:
continue
seen[marker] = 1
result.append(item)
return result
# Based on http://code.activestate.com/recipes/576694/.
class OrderedSet(MutableSet): # noqa: PLW1641
# TODO (cclauss): Fix eq-without-hash ruff rule PLW1641
def __init__(self, iterable=None):
self.end = end = []
end += [None, end, end] # sentinel node for doubly linked list
self.map = {} # key --> [key, prev, next]
if iterable is not None:
self |= iterable
def __len__(self):
return len(self.map)
def __contains__(self, key):
return key in self.map
def add(self, key):
if key not in self.map:
end = self.end
curr = end[1]
curr[2] = end[1] = self.map[key] = [key, curr, end]
def discard(self, key):
if key in self.map:
key, prev_item, next_item = self.map.pop(key)
prev_item[2] = next_item
next_item[1] = prev_item
def __iter__(self):
end = self.end
curr = end[2]
while curr is not end:
yield curr[0]
curr = curr[2]
def __reversed__(self):
end = self.end
curr = end[1]
while curr is not end:
yield curr[0]
curr = curr[1]
# The second argument is an addition that causes a pylint warning.
def pop(self, last=True): # pylint: disable=W0221
if not self:
raise KeyError("set is empty")
key = self.end[1][0] if last else self.end[2][0]
self.discard(key)
return key
def __repr__(self):
if not self:
return f"{self.__class__.__name__}()"
return f"{self.__class__.__name__}({list(self)!r})"
def __eq__(self, other):
if isinstance(other, OrderedSet):
return len(self) == len(other) and list(self) == list(other)
return set(self) == set(other)
# Extensions to the recipe.
def update(self, iterable):
for i in iterable:
if i not in self:
self.add(i)
class CycleError(Exception):
"""An exception raised when an unexpected cycle is detected."""
def __init__(self, nodes):
self.nodes = nodes
def __str__(self):
return "CycleError: cycle involving: " + str(self.nodes)
def TopologicallySorted(graph, get_edges):
r"""Topologically sort based on a user provided edge definition.
Args:
graph: A list of node names.
get_edges: A function mapping from node name to a hashable collection
of node names which this node has outgoing edges to.
Returns:
A list containing all of the node in graph in topological order.
It is assumed that calling get_edges once for each node and caching is
cheaper than repeatedly calling get_edges.
Raises:
CycleError in the event of a cycle.
Example:
graph = {'a': '$(b) $(c)', 'b': 'hi', 'c': '$(b)'}
def GetEdges(node):
return re.findall(r'\$\(([^))]\)', graph[node])
print TopologicallySorted(graph.keys(), GetEdges)
==>
['a', 'c', b']
"""
get_edges = memoize(get_edges)
visited = set()
visiting = set()
ordered_nodes = []
def Visit(node):
if node in visiting:
raise CycleError(visiting)
if node in visited:
return
visited.add(node)
visiting.add(node)
for neighbor in get_edges(node):
Visit(neighbor)
visiting.remove(node)
ordered_nodes.insert(0, node)
for node in sorted(graph):
Visit(node)
return ordered_nodes
def CrossCompileRequested():
# TODO: figure out how to not build extra host objects in the
# non-cross-compile case when this is enabled, and enable unconditionally.
return (
os.environ.get("GYP_CROSSCOMPILE")
or os.environ.get("AR_host")
or os.environ.get("CC_host")
or os.environ.get("CXX_host")
or os.environ.get("AR_target")
or os.environ.get("CC_target")
or os.environ.get("CXX_target")
)
def IsCygwin():
try:
out = subprocess.Popen(
"uname", stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
stdout = out.communicate()[0].decode("utf-8")
return "CYGWIN" in str(stdout)
except Exception:
return False
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SquareM = createLucideIcon("SquareM", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M8 16V8l4 4 4-4v8", key: "141u4e" }]
]);
export { SquareM as default };
//# sourceMappingURL=square-m.js.map
@@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = pathToPattern;
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
const sep = `\\${_path().sep}`;
const endSep = `(?:${sep}|$)`;
const substitution = `[^${sep}]+`;
const starPat = `(?:${substitution}${sep})`;
const starPatLast = `(?:${substitution}${endSep})`;
const starStarPat = `${starPat}*?`;
const starStarPatLast = `${starPat}*?${starPatLast}?`;
function escapeRegExp(string) {
return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
}
function pathToPattern(pattern, dirname) {
const parts = _path().resolve(dirname, pattern).split(_path().sep);
return new RegExp(["^", ...parts.map((part, i) => {
const last = i === parts.length - 1;
if (part === "**") return last ? starStarPatLast : starStarPat;
if (part === "*") return last ? starPatLast : starPat;
if (part.startsWith("*.")) {
return substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep);
}
return escapeRegExp(part) + (last ? endSep : sep);
})].join(""));
}
0 && 0;
//# sourceMappingURL=pattern-to-regex.js.map
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './panel-bottom-dashed.js';
//# sourceMappingURL=panel-bottom-inactive.js.map
@@ -0,0 +1,294 @@
import * as core from "./core.js";
import type * as errors from "./errors.js";
import type * as schemas from "./schemas.js";
import * as util from "./util.js";
export interface $ZodCheckDef {
check: string;
error?: errors.$ZodErrorMap<never> | undefined;
/** If true, no later checks will be executed if this check fails. Default `false`. */
abort?: boolean | undefined;
/** If provided, the check runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
when?: ((payload: schemas.ParsePayload) => boolean) | undefined;
}
export interface $ZodCheckInternals<T> {
def: $ZodCheckDef;
/** The set of issues this check might throw. */
issc?: errors.$ZodIssueBase;
check(payload: schemas.ParsePayload<T>): util.MaybeAsync<void>;
onattach: ((schema: schemas.$ZodType) => void)[];
}
export interface $ZodCheck<in T = never> {
_zod: $ZodCheckInternals<T>;
}
export declare const $ZodCheck: core.$constructor<$ZodCheck<any>>;
export interface $ZodCheckLessThanDef extends $ZodCheckDef {
check: "less_than";
value: util.Numeric;
inclusive: boolean;
}
export interface $ZodCheckLessThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {
def: $ZodCheckLessThanDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckLessThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {
_zod: $ZodCheckLessThanInternals<T>;
}
export declare const $ZodCheckLessThan: core.$constructor<$ZodCheckLessThan>;
export interface $ZodCheckGreaterThanDef extends $ZodCheckDef {
check: "greater_than";
value: util.Numeric;
inclusive: boolean;
}
export interface $ZodCheckGreaterThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {
def: $ZodCheckGreaterThanDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckGreaterThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {
_zod: $ZodCheckGreaterThanInternals<T>;
}
export declare const $ZodCheckGreaterThan: core.$constructor<$ZodCheckGreaterThan>;
export interface $ZodCheckMultipleOfDef<T extends number | bigint = number | bigint> extends $ZodCheckDef {
check: "multiple_of";
value: T;
}
export interface $ZodCheckMultipleOfInternals<T extends number | bigint = number | bigint> extends $ZodCheckInternals<T> {
def: $ZodCheckMultipleOfDef<T>;
issc: errors.$ZodIssueNotMultipleOf;
}
export interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint> extends $ZodCheck<T> {
_zod: $ZodCheckMultipleOfInternals<T>;
}
export declare const $ZodCheckMultipleOf: core.$constructor<$ZodCheckMultipleOf<number | bigint>>;
export type $ZodNumberFormats = "int32" | "uint32" | "float32" | "float64" | "safeint";
export interface $ZodCheckNumberFormatDef<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheckDef {
check: "number_format";
format: Format;
}
export interface $ZodCheckNumberFormatInternals<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheckInternals<number> {
def: $ZodCheckNumberFormatDef<Format>;
issc: errors.$ZodIssueInvalidType | errors.$ZodIssueTooBig<"number"> | errors.$ZodIssueTooSmall<"number">;
}
export interface $ZodCheckNumberFormat<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheck<number> {
_zod: $ZodCheckNumberFormatInternals<Format>;
}
export declare const $ZodCheckNumberFormat: core.$constructor<$ZodCheckNumberFormat>;
export type $ZodBigIntFormats = "int64" | "uint64";
export interface $ZodCheckBigIntFormatDef<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheckDef {
check: "bigint_format";
format: Format;
}
export interface $ZodCheckBigIntFormatInternals<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheckInternals<bigint> {
def: $ZodCheckBigIntFormatDef<Format>;
issc: errors.$ZodIssueTooBig<"bigint"> | errors.$ZodIssueTooSmall<"bigint">;
}
export interface $ZodCheckBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheck<bigint> {
_zod: $ZodCheckBigIntFormatInternals<Format>;
}
export declare const $ZodCheckBigIntFormat: core.$constructor<$ZodCheckBigIntFormat>;
export interface $ZodCheckMaxSizeDef extends $ZodCheckDef {
check: "max_size";
maximum: number;
}
export interface $ZodCheckMaxSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckMaxSizeDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckMaxSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckMaxSizeInternals<T>;
}
export declare const $ZodCheckMaxSize: core.$constructor<$ZodCheckMaxSize>;
export interface $ZodCheckMinSizeDef extends $ZodCheckDef {
check: "min_size";
minimum: number;
}
export interface $ZodCheckMinSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckMinSizeDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckMinSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckMinSizeInternals<T>;
}
export declare const $ZodCheckMinSize: core.$constructor<$ZodCheckMinSize>;
export interface $ZodCheckSizeEqualsDef extends $ZodCheckDef {
check: "size_equals";
size: number;
}
export interface $ZodCheckSizeEqualsInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckSizeEqualsDef;
issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckSizeEquals<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckSizeEqualsInternals<T>;
}
export declare const $ZodCheckSizeEquals: core.$constructor<$ZodCheckSizeEquals>;
export interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
check: "max_length";
maximum: number;
}
export interface $ZodCheckMaxLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckMaxLengthDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckMaxLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckMaxLengthInternals<T>;
}
export declare const $ZodCheckMaxLength: core.$constructor<$ZodCheckMaxLength>;
export interface $ZodCheckMinLengthDef extends $ZodCheckDef {
check: "min_length";
minimum: number;
}
export interface $ZodCheckMinLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckMinLengthDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckMinLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckMinLengthInternals<T>;
}
export declare const $ZodCheckMinLength: core.$constructor<$ZodCheckMinLength>;
export interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
check: "length_equals";
length: number;
}
export interface $ZodCheckLengthEqualsInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckLengthEqualsDef;
issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckLengthEquals<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckLengthEqualsInternals<T>;
}
export declare const $ZodCheckLengthEquals: core.$constructor<$ZodCheckLengthEquals>;
export type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "credit_card" | "iban" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
export interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
check: "string_format";
format: Format;
pattern?: RegExp | undefined;
}
export interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
def: $ZodCheckStringFormatDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckStringFormat extends $ZodCheck<string> {
_zod: $ZodCheckStringFormatInternals;
}
export declare const $ZodCheckStringFormat: core.$constructor<$ZodCheckStringFormat>;
export interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
format: "regex";
pattern: RegExp;
}
export interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
def: $ZodCheckRegexDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckRegex extends $ZodCheck<string> {
_zod: $ZodCheckRegexInternals;
}
export declare const $ZodCheckRegex: core.$constructor<$ZodCheckRegex>;
export interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {
}
export interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
def: $ZodCheckLowerCaseDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckLowerCase extends $ZodCheck<string> {
_zod: $ZodCheckLowerCaseInternals;
}
export declare const $ZodCheckLowerCase: core.$constructor<$ZodCheckLowerCase>;
export interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {
}
export interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
def: $ZodCheckUpperCaseDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckUpperCase extends $ZodCheck<string> {
_zod: $ZodCheckUpperCaseInternals;
}
export declare const $ZodCheckUpperCase: core.$constructor<$ZodCheckUpperCase>;
export interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
includes: string;
position?: number | undefined;
}
export interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
def: $ZodCheckIncludesDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckIncludes extends $ZodCheck<string> {
_zod: $ZodCheckIncludesInternals;
}
export declare const $ZodCheckIncludes: core.$constructor<$ZodCheckIncludes>;
export interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
prefix: string;
}
export interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
def: $ZodCheckStartsWithDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckStartsWith extends $ZodCheck<string> {
_zod: $ZodCheckStartsWithInternals;
}
export declare const $ZodCheckStartsWith: core.$constructor<$ZodCheckStartsWith>;
export interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
suffix: string;
}
export interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
def: $ZodCheckEndsWithDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
_zod: $ZodCheckEndsWithInternals;
}
export declare const $ZodCheckEndsWith: core.$constructor<$ZodCheckEndsWith>;
export interface $ZodCheckPropertyDef extends $ZodCheckDef {
check: "property";
property: string;
schema: schemas.$ZodType;
}
export interface $ZodCheckPropertyInternals<T extends object = object> extends $ZodCheckInternals<T> {
def: $ZodCheckPropertyDef;
issc: errors.$ZodIssue;
}
export interface $ZodCheckProperty<T extends object = object> extends $ZodCheck<T> {
_zod: $ZodCheckPropertyInternals<T>;
}
export declare const $ZodCheckProperty: core.$constructor<$ZodCheckProperty>;
export interface $ZodCheckPropertiesDef<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckDef {
check: "properties";
shape: Shape;
}
export type $ZodCheckPropertiesInput<Shape extends schemas.$ZodShape = schemas.$ZodShape> = {
-readonly [k in keyof Shape]: util.Widen<core.input<Shape[k]>>;
};
export interface $ZodCheckPropertiesInternals<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckInternals<$ZodCheckPropertiesInput<Shape>> {
def: $ZodCheckPropertiesDef<Shape>;
issc: errors.$ZodIssue;
}
export interface $ZodCheckProperties<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheck<$ZodCheckPropertiesInput<Shape>> {
_zod: $ZodCheckPropertiesInternals<Shape>;
[Symbol.iterator](): Iterator<this>;
}
export declare const $ZodCheckProperties: core.$constructor<$ZodCheckProperties>;
export interface $ZodCheckMimeTypeDef extends $ZodCheckDef {
check: "mime_type";
mime: util.MimeTypes[];
}
export interface $ZodCheckMimeTypeInternals<T extends schemas.File = schemas.File> extends $ZodCheckInternals<T> {
def: $ZodCheckMimeTypeDef;
issc: errors.$ZodIssueInvalidValue;
}
export interface $ZodCheckMimeType<T extends schemas.File = schemas.File> extends $ZodCheck<T> {
_zod: $ZodCheckMimeTypeInternals<T>;
}
export declare const $ZodCheckMimeType: core.$constructor<$ZodCheckMimeType>;
export interface $ZodCheckOverwriteDef<T = unknown> extends $ZodCheckDef {
check: "overwrite";
tx(value: T): T;
}
export interface $ZodCheckOverwriteInternals<T = unknown> extends $ZodCheckInternals<T> {
def: $ZodCheckOverwriteDef<T>;
issc: never;
}
export interface $ZodCheckOverwrite<T = unknown> extends $ZodCheck<T> {
_zod: $ZodCheckOverwriteInternals<T>;
}
export declare const $ZodCheckOverwrite: core.$constructor<$ZodCheckOverwrite>;
export type $ZodChecks = $ZodCheckLessThan | $ZodCheckGreaterThan | $ZodCheckMultipleOf | $ZodCheckNumberFormat | $ZodCheckBigIntFormat | $ZodCheckMaxSize | $ZodCheckMinSize | $ZodCheckSizeEquals | $ZodCheckMaxLength | $ZodCheckMinLength | $ZodCheckLengthEquals | $ZodCheckStringFormat | $ZodCheckProperty | $ZodCheckMimeType | $ZodCheckOverwrite;
export type $ZodStringFormatChecks = $ZodCheckRegex | $ZodCheckLowerCase | $ZodCheckUpperCase | $ZodCheckIncludes | $ZodCheckStartsWith | $ZodCheckEndsWith | schemas.$ZodStringFormatTypes;
@@ -0,0 +1,45 @@
import { COLUMN } from './sourcemap-segment';
import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment';
export default function maybeSort(
mappings: SourceMapSegment[][],
owned: boolean,
): SourceMapSegment[][] {
const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
if (unsortedIndex === mappings.length) return mappings;
// If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If
// not, we do not want to modify the consumer's input array.
if (!owned) mappings = mappings.slice();
for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {
mappings[i] = sortSegments(mappings[i], owned);
}
return mappings;
}
function nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number {
for (let i = start; i < mappings.length; i++) {
if (!isSorted(mappings[i])) return i;
}
return mappings.length;
}
function isSorted(line: SourceMapSegment[]): boolean {
for (let j = 1; j < line.length; j++) {
if (line[j][COLUMN] < line[j - 1][COLUMN]) {
return false;
}
}
return true;
}
function sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] {
if (!owned) line = line.slice();
return line.sort(sortComparator);
}
export function sortComparator<T extends SourceMapSegment | ReverseSegment>(a: T, b: T): number {
return a[COLUMN] - b[COLUMN];
}
@@ -0,0 +1,19 @@
import type { GenMapping } from '@jridgewell/gen-mapping';
import type { DecodedSourceMap, EncodedSourceMap, Options } from './types.cts';
/**
* A SourceMap v3 compatible sourcemap, which only includes fields that were
* provided to it.
*/
export = class SourceMap {
file?: string | null;
mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings'];
sourceRoot?: string;
names: string[];
sources: (string | null)[];
sourcesContent?: (string | null)[];
version: 3;
ignoreList: number[] | undefined;
constructor(map: GenMapping, options: Options);
toString(): string;
}
//# sourceMappingURL=source-map.d.ts.map
@@ -0,0 +1,36 @@
import { TLSSocket, ConnectionOptions } from 'node:tls'
import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from 'node:net'
export default buildConnector
declare function buildConnector (options?: buildConnector.BuildOptions): buildConnector.connector
declare namespace buildConnector {
export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & {
allowH2?: boolean;
maxCachedSessions?: number | null;
socketPath?: string | null;
timeout?: number | null;
port?: number;
keepAlive?: boolean | null;
keepAliveInitialDelay?: number | null;
typeOfService?: number | null;
}
export interface Options {
hostname: string
host?: string
protocol: string
port: string
servername?: string
localAddress?: string | null
socketPath?: string | null
httpSocket?: Socket
}
export type Callback = (...args: CallbackArgs) => void
type CallbackArgs = [null, Socket | TLSSocket] | [Error, null]
export interface connector {
(options: buildConnector.Options, callback: buildConnector.Callback): void
}
}
@@ -0,0 +1,12 @@
import Ajv, { AnySchema, AnyValidateFunction, ErrorObject } from "../core";
export default class AjvPack {
readonly ajv: Ajv;
errors?: ErrorObject[] | null;
constructor(ajv: Ajv);
validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise<unknown>;
compile<T = unknown>(schema: AnySchema, meta?: boolean): AnyValidateFunction<T>;
getSchema<T = unknown>(keyRef: string): AnyValidateFunction<T> | undefined;
private getStandalone;
addSchema(...args: Parameters<typeof Ajv.prototype.addSchema>): AjvPack;
addKeyword(...args: Parameters<typeof Ajv.prototype.addKeyword>): AjvPack;
}
@@ -0,0 +1,39 @@
'use strict'
const u = require('universalify').fromPromise
const fs = require('../fs')
const path = require('path')
const mkdir = require('../mkdirs')
const remove = require('../remove')
const emptyDir = u(async function emptyDir (dir) {
let items
try {
items = await fs.readdir(dir)
} catch {
return mkdir.mkdirs(dir)
}
return Promise.all(items.map(item => remove.remove(path.join(dir, item))))
})
function emptyDirSync (dir) {
let items
try {
items = fs.readdirSync(dir)
} catch {
return mkdir.mkdirsSync(dir)
}
items.forEach(item => {
item = path.join(dir, item)
remove.removeSync(item)
})
}
module.exports = {
emptyDirSync,
emptydirSync: emptyDirSync,
emptyDir,
emptydir: emptyDir
}
@@ -0,0 +1,81 @@
import {IS_IDENTIFIER_CHAR, IS_IDENTIFIER_START} from "../parser/util/identifier";
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar
// Hard-code a list of reserved words rather than trying to use keywords or contextual keywords
// from the parser, since currently there are various exceptions, like `package` being reserved
// but unused and various contextual keywords being reserved. Note that we assume that all code
// compiled by Sucrase is in a module, so strict mode words and await are all considered reserved
// here.
const RESERVED_WORDS = new Set([
// Reserved keywords as of ECMAScript 2015
"break",
"case",
"catch",
"class",
"const",
"continue",
"debugger",
"default",
"delete",
"do",
"else",
"export",
"extends",
"finally",
"for",
"function",
"if",
"import",
"in",
"instanceof",
"new",
"return",
"super",
"switch",
"this",
"throw",
"try",
"typeof",
"var",
"void",
"while",
"with",
"yield",
// Future reserved keywords
"enum",
"implements",
"interface",
"let",
"package",
"private",
"protected",
"public",
"static",
"await",
// Literals that cannot be used as identifiers
"false",
"null",
"true",
]);
/**
* Determine if the given name is a legal variable name.
*
* This is needed when transforming TypeScript enums; if an enum key is a valid
* variable name, it might be referenced later in the enum, so we need to
* declare a variable.
*/
export default function isIdentifier(name) {
if (name.length === 0) {
return false;
}
if (!IS_IDENTIFIER_START[name.charCodeAt(0)]) {
return false;
}
for (let i = 1; i < name.length; i++) {
if (!IS_IDENTIFIER_CHAR[name.charCodeAt(i)]) {
return false;
}
}
return !RESERVED_WORDS.has(name);
}
@@ -0,0 +1,5 @@
/**
* Generated bundle index. Do not edit.
*/
export * from './index';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZHN0YWNrLWFuZ3VsYXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9hbmd1bGFyL3Byb2plY3RzL2xpYi9zcmMvZ3JpZHN0YWNrLWFuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
@@ -0,0 +1,3 @@
const require_cfWorkerProvider = require('../cfWorkerProvider-B3dvjU3F.cjs');
exports.CfWorkerJsonSchemaValidator = require_cfWorkerProvider.CfWorkerJsonSchemaValidator;
@@ -0,0 +1 @@
{"version":3,"file":"store.js","sources":["../../src/store.ts"],"sourcesContent":["import { createAtom, toObserver } from './atom'\nimport type { Atom, Observer, Subscription } from './types'\n\nexport class Store<T> {\n private atom: Atom<T>\n constructor(getValue: (prev?: NoInfer<T>) => T)\n constructor(initialValue: T)\n constructor(valueOrFn: T | ((prev?: T) => T)) {\n // createAtom has overloads that return ReadonlyAtom<T> for functions and Atom<T> for values\n // Store always needs Atom<T> for setState, so we assert the return type\n this.atom = createAtom(\n valueOrFn as T | ((prev?: NoInfer<T>) => T),\n ) as Atom<T>\n }\n public setState(updater: (prev: T) => T) {\n this.atom.set(updater)\n }\n public get state() {\n return this.atom.get()\n }\n public get() {\n return this.state\n }\n public subscribe(\n observerOrFn: Observer<T> | ((value: T) => void),\n ): Subscription {\n return this.atom.subscribe(toObserver(observerOrFn))\n }\n}\n\nexport class ReadonlyStore<T> implements Omit<Store<T>, 'setState'> {\n private atom: Atom<T>\n constructor(getValue: (prev?: NoInfer<T>) => T)\n constructor(initialValue: T)\n constructor(valueOrFn: T | ((prev?: T) => T)) {\n // createAtom has overloads that return ReadonlyAtom<T> for functions and Atom<T> for values\n // Store always needs Atom<T> for setState, so we assert the return type\n this.atom = createAtom(\n valueOrFn as T | ((prev?: NoInfer<T>) => T),\n ) as Atom<T>\n }\n public get state() {\n return this.atom.get()\n }\n public get() {\n return this.state\n }\n public subscribe(\n observerOrFn: Observer<T> | ((value: T) => void),\n ): Subscription {\n return this.atom.subscribe(toObserver(observerOrFn))\n }\n}\n\nexport function createStore<T>(\n getValue: (prev?: NoInfer<T>) => T,\n): ReadonlyStore<T>\nexport function createStore<T>(initialValue: T): Store<T>\nexport function createStore<T>(\n valueOrFn: T | ((prev?: T) => T),\n): Store<T> | ReadonlyStore<T> {\n if (typeof valueOrFn === 'function') {\n return new ReadonlyStore(valueOrFn as (prev?: NoInfer<T>) => T)\n }\n return new Store(valueOrFn)\n}\n"],"names":[],"mappings":";AAGO,MAAM,MAAS;AAAA,EAIpB,YAAY,WAAkC;AAG5C,SAAK,OAAO;AAAA,MACV;AAAA,IAAA;AAAA,EAEJ;AAAA,EACO,SAAS,SAAyB;AACvC,SAAK,KAAK,IAAI,OAAO;AAAA,EACvB;AAAA,EACA,IAAW,QAAQ;AACjB,WAAO,KAAK,KAAK,IAAA;AAAA,EACnB;AAAA,EACO,MAAM;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EACO,UACL,cACc;AACd,WAAO,KAAK,KAAK,UAAU,WAAW,YAAY,CAAC;AAAA,EACrD;AACF;AAEO,MAAM,cAAuD;AAAA,EAIlE,YAAY,WAAkC;AAG5C,SAAK,OAAO;AAAA,MACV;AAAA,IAAA;AAAA,EAEJ;AAAA,EACA,IAAW,QAAQ;AACjB,WAAO,KAAK,KAAK,IAAA;AAAA,EACnB;AAAA,EACO,MAAM;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EACO,UACL,cACc;AACd,WAAO,KAAK,KAAK,UAAU,WAAW,YAAY,CAAC;AAAA,EACrD;AACF;AAMO,SAAS,YACd,WAC6B;AAC7B,MAAI,OAAO,cAAc,YAAY;AACnC,WAAO,IAAI,cAAc,SAAqC;AAAA,EAChE;AACA,SAAO,IAAI,MAAM,SAAS;AAC5B;"}
@@ -0,0 +1,30 @@
type indexBrowserType = typeof import("./index-browser");
type indexType = typeof import("./index");
// Kind of gross, but essentially asserting that the exports of this module are the same as the
// exports of index-browser, since this file may be replaced at bundle time with index-browser.
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
({}) as any as indexBrowserType as indexType;
export { findPackageData } from "./package.ts";
export {
findConfigUpwards,
findRelativeConfig,
findRootConfig,
loadConfig,
resolveShowConfigPath,
ROOT_CONFIG_FILENAMES,
} from "./configuration.ts";
export type {
ConfigFile,
IgnoreFile,
RelativeConfig,
FilePackageData,
} from "./types.ts";
export {
loadPlugin,
loadPreset,
resolvePlugin,
resolvePreset,
} from "./plugins.ts";
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const MousePointer2 = createLucideIcon("MousePointer2", [
[
"path",
{
d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",
key: "edeuup"
}
]
]);
export { MousePointer2 as default };
//# sourceMappingURL=mouse-pointer-2.js.map
@@ -0,0 +1,15 @@
export { c as configDefaults, a as coverageConfigDefaults, d as defaultExclude, b as defaultInclude } from './chunks/defaults.9aQKnqFk.js';
export { mergeConfig } from 'vite';
export { d as defaultBrowserPort } from './chunks/constants.CPYnjOGj.js';
import 'node:os';
import './chunks/env.D4Lgay0q.js';
import 'std-env';
function defineConfig(config) {
return config;
}
function defineProject(config) {
return config;
}
export { defineConfig, defineProject };
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CableCar = createLucideIcon("CableCar", [
["path", { d: "M10 3h.01", key: "lbucoy" }],
["path", { d: "M14 2h.01", key: "1k8aa1" }],
["path", { d: "m2 9 20-5", key: "1kz0j5" }],
["path", { d: "M12 12V6.5", key: "1vbrij" }],
["rect", { width: "16", height: "10", x: "4", y: "12", rx: "3", key: "if91er" }],
["path", { d: "M9 12v5", key: "3anwtq" }],
["path", { d: "M15 12v5", key: "5xh3zn" }],
["path", { d: "M4 17h16", key: "g4d7ey" }]
]);
export { CableCar as default };
//# sourceMappingURL=cable-car.js.map
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSymbolFromDefaultLibrary = isSymbolFromDefaultLibrary;
function isSymbolFromDefaultLibrary(program, symbol) {
if (!symbol) {
return false;
}
const declarations = symbol.getDeclarations() ?? [];
for (const declaration of declarations) {
const sourceFile = declaration.getSourceFile();
if (program.isSourceFileDefaultLibrary(sourceFile)) {
return true;
}
}
return false;
}
@@ -0,0 +1 @@
module.exports={C:{"48":0.01044,"115":0.04698,"120":0.07308,"121":0.12006,"147":0.03654,"152":0.01044,"154":0.20358,"155":0.01044,"156":0.21402,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 148 149 150 151 153 157 158 159 160 3.5 3.6"},D:{"71":0.0261,"79":0.08352,"83":0.0261,"101":0.03654,"103":0.01044,"104":0.01044,"105":0.01044,"106":0.01044,"107":0.01044,"108":0.0261,"109":2.08278,"110":0.01044,"111":0.03654,"112":0.08352,"115":0.0261,"116":0.01044,"117":0.01044,"118":0.10962,"119":0.1566,"120":0.261,"123":0.01044,"124":0.04698,"131":0.04698,"133":0.0261,"134":0.0261,"135":0.98136,"139":0.03654,"141":0.01044,"142":0.03654,"144":0.01044,"145":0.0261,"146":0.04698,"147":0.0261,"148":0.14616,"149":0.32364,"150":0.90828,"151":1.81656,"152":9.0306,"153":9.95454,"154":1.83222,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 72 73 74 75 76 77 78 80 81 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 102 113 114 121 122 125 126 127 128 129 130 132 136 137 138 140 143 155 156 157"},F:{"133":0.0261,"135":0.08352,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 134 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"90":0.01044,"109":0.01044,"119":0.05742,"120":0.1305,"124":0.0261,"137":0.01044,"145":0.09396,"151":0.03654,"152":0.74124,"153":1.24236,"154":0.0261,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 122 123 125 126 127 128 129 130 131 132 133 134 135 136 138 139 140 141 142 143 144 146 147 148 149 150"},E:{"27":0.05742,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.4 16.5 17.0 17.1 17.2 17.3 17.6 18.0 18.1 18.2 18.4 18.5-18.7 26.0 26.4 27.1 27.2 TP","15.6":0.01044,"16.3":0.01044,"16.6":0.05742,"17.4":0.01044,"17.5":0.01044,"18.3":0.01044,"26.1":0.0261,"26.2":0.01044,"26.3":0.01044,"26.5":0.03654,"26.6":0.10962},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00081,"5.0-5.1":0.00081,"6.0-6.1":0,"7.0-7.1":0.00162,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00808,"11.0-11.2":0.00081,"11.3-11.4":0.00162,"12.0-12.1":0,"12.2-12.5":0.02102,"13.0-13.1":0,"13.2":0.00404,"13.3":0,"13.4-13.7":0.00081,"14.0-14.4":0.00323,"14.5-14.8":0.00485,"15.0-15.1":0.00485,"15.2-15.3":0.00323,"15.4":0.00404,"15.5":0.00485,"15.6-15.8":0.10508,"16.0":0.00808,"16.1":0.01455,"16.2":0.00808,"16.3":0.01778,"16.4":0.00404,"16.5":0.00647,"16.6-16.7":0.1463,"17.0":0.00566,"17.1":0.00808,"17.2":0.00808,"17.3":0.01212,"17.4":0.01697,"17.5":0.03314,"17.6-17.7":0.08568,"18.0":0.01778,"18.1":0.03557,"18.2":0.0485,"18.3":0.08406,"18.4":0.05254,"18.5-18.7":1.08554,"26.0":0.05254,"26.1":0.05335,"26.2":0.13903,"26.3":0.15034,"26.4":0.10993,"26.5":0.73636,"26.6":4.54344,"27.0":0.34838,"27.1":0,"27.2":0.00889},P:{"4":0.03957,"24":0.00989,"27":0.03957,"28":0.1187,"29":0.06924,"30":3.27423,_:"20 21 22 23 25 26 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.00989},I:{"0":0.13375,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00005},K:{"0":1.35752,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":33.00602},R:{_:"0"},M:{"0":0.4063},Q:{"14.9":0.1673},O:{"0":1.22368},H:{all:0}};
@@ -0,0 +1,12 @@
import * as React from 'react';
interface PresenceProps {
children: React.ReactElement | ((props: {
present: boolean;
}) => React.ReactElement);
present: boolean;
}
declare const Presence: React.FC<PresenceProps>;
declare const Root: React.FC<PresenceProps>;
export { Presence, type PresenceProps, Root };
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"DB _ML _CD","2":"_pJ _BD","322":"_IH CB"},C:{"1":"I _uD","2":"_LS jB _L","578":"kB lB"},D:{"1":"_ML _EF","2":"_xF _BD","322":"_1N"},E:{"1":"_YQ","2":"_cD","194":"_BJ _oE"},F:{"1":"_NQ _h","2":"0 _8 _VC _O","322":"_jG _DH _bI"},G:{"1":"_gL","2":"_YC","194":"_yK _oE"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"2":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:5,C:"CSS Text Box",D:true};
@@ -0,0 +1,24 @@
(The MIT License)
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2014-2017 Douglas Christopher Wilson <doug@somethingdoug.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,34 @@
import { distance } from 'fastest-levenshtein';
const getUsedThreshold = (password, entry, threshold) => {
const isPasswordToShort = password.length <= entry.length;
const isThresholdLongerThanPassword = password.length <= threshold;
const shouldUsePasswordLength = isPasswordToShort || isThresholdLongerThanPassword;
// if password is too small use the password length divided by 4 while the threshold needs to be at least 1
return shouldUsePasswordLength ? Math.ceil(password.length / 4) : threshold;
};
const findLevenshteinDistance = (password, rankedDictionary, threshold) => {
let foundDistance = 0;
const found = Object.keys(rankedDictionary).find(entry => {
const usedThreshold = getUsedThreshold(password, entry, threshold);
if (Math.abs(password.length - entry.length) > usedThreshold) {
return false;
}
const foundEntryDistance = distance(password, entry);
const isInThreshold = foundEntryDistance <= usedThreshold;
if (isInThreshold) {
foundDistance = foundEntryDistance;
}
return isInThreshold;
});
if (found) {
return {
levenshteinDistance: foundDistance,
levenshteinDistanceEntry: found
};
}
return {};
};
export { findLevenshteinDistance as default };
//# sourceMappingURL=levenshtein.mjs.map
@@ -0,0 +1,6 @@
export { RouterServer } from './RouterServer.cjs';
export { defaultRenderHandler } from './defaultRenderHandler.cjs';
export { defaultStreamHandler } from './defaultStreamHandler.cjs';
export { renderRouterToStream } from './renderRouterToStream.cjs';
export { renderRouterToString } from './renderRouterToString.cjs';
export * from '@tanstack/router-core/ssr/server';
@@ -0,0 +1,42 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
interface WrappingFixerParams {
/**
* Descendant of `node` we want to preserve.
* Use this to replace some code with another.
* By default it's the node we are modifying (so nothing is removed).
* You can pass multiple nodes as an array.
*/
innerNode?: TSESTree.Node | TSESTree.Node[];
/** The node we want to modify. */
node: TSESTree.Node;
/** Source code. */
sourceCode: Readonly<TSESLint.SourceCode>;
/**
* The function which gets the code of the `innerNode` and returns some code around it.
* Receives multiple arguments if there are multiple innerNodes.
* E.g. ``code => `${code} != null` ``
*/
wrap?: (...code: string[]) => string;
}
/**
* Wraps node with some code. Adds parentheses as necessary.
* @returns Fixer which adds the specified code and parens if necessary.
*/
export declare function getWrappingFixer(params: WrappingFixerParams): (fixer: TSESLint.RuleFixer) => TSESLint.RuleFix;
/**
* If the node to be moved and the destination node require parentheses, include parentheses in the node to be moved.
* @param sourceCode Source code of current file
* @param nodeToMove Nodes that need to be moved
* @param destinationNode Final destination node with nodeToMove
* @returns If parentheses are required, code for the nodeToMove node is returned with parentheses at both ends of the code.
*/
export declare function getMovedNodeCode(params: {
destinationNode: TSESTree.Node;
nodeToMove: TSESTree.Node;
sourceCode: Readonly<TSESLint.SourceCode>;
}): string;
/**
* Check if a node will always have the same precedence if its parent changes.
*/
export declare function isStrongPrecedenceNode(innerNode: TSESTree.Node): boolean;
export {};
@@ -0,0 +1 @@
{"version":3,"file":"book-key.js","sources":["../../../src/icons/book-key.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BookKey\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTkgMyAxIDEiIC8+CiAgPHBhdGggZD0ibTIwIDItNC41IDQuNSIgLz4KICA8cGF0aCBkPSJNMjAgOHYxM2ExIDEgMCAwIDEtMSAxSDYuNWExIDEgMCAwIDEgMC01SDIwIiAvPgogIDxwYXRoIGQ9Ik00IDE5LjV2LTE1QTIuNSAyLjUgMCAwIDEgNi41IDJIMTQiIC8+CiAgPGNpcmNsZSBjeD0iMTQiIGN5PSI4IiByPSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/book-key\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst BookKey = createLucideIcon('BookKey', [\n ['path', { d: 'm19 3 1 1', key: 'ze14oc' }],\n ['path', { d: 'm20 2-4.5 4.5', key: '1sppr8' }],\n ['path', { d: 'M20 8v13a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20', key: '1ocbpn' }],\n ['path', { d: 'M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H14', key: '1gfsgw' }],\n ['circle', { cx: '14', cy: '8', r: '2', key: 'u49eql' }],\n]);\n\nexport default BookKey;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACnE,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,105 @@
'use strict'
const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require('node:zlib')
const { isValidClientWindowBits } = require('./util')
const { MessageSizeExceededError } = require('../../core/errors')
const tail = Buffer.from([0x00, 0x00, 0xff, 0xff])
const kBuffer = Symbol('kBuffer')
const kLength = Symbol('kLength')
class PerMessageDeflate {
/** @type {import('node:zlib').InflateRaw} */
#inflate
#options = {}
#maxPayloadSize = 0
/**
* @param {Map<string, string>} extensions
*/
constructor (extensions, options) {
this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')
this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')
this.#maxPayloadSize = options.maxPayloadSize
}
/**
* Decompress a compressed payload.
* @param {Buffer} chunk Compressed data
* @param {boolean} fin Final fragment flag
* @param {Function} callback Callback function
*/
decompress (chunk, fin, callback) {
// An endpoint uses the following algorithm to decompress a message.
// 1. Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the
// payload of the message.
// 2. Decompress the resulting data using DEFLATE.
if (!this.#inflate) {
let windowBits = Z_DEFAULT_WINDOWBITS
if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS
if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {
callback(new Error('Invalid server_max_window_bits'))
return
}
windowBits = Number.parseInt(this.#options.serverMaxWindowBits)
}
try {
this.#inflate = createInflateRaw({ windowBits })
} catch (err) {
callback(err)
return
}
this.#inflate[kBuffer] = []
this.#inflate[kLength] = 0
this.#inflate.on('data', (data) => {
this.#inflate[kLength] += data.length
if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {
callback(new MessageSizeExceededError())
// The inflater may still hold buffered input that can emit a late
// zlib error. Remove the data listener, then deterministically stop
// the stream so a subsequent 'error' cannot fire without a listener
// (which would terminate the process as an unhandled error event).
this.#inflate.removeAllListeners()
this.#inflate.destroy()
this.#inflate = null
return
}
this.#inflate[kBuffer].push(data)
})
this.#inflate.on('error', (err) => {
this.#inflate = null
callback(err)
})
}
this.#inflate.write(chunk)
if (fin) {
this.#inflate.write(tail)
}
this.#inflate.flush(() => {
if (!this.#inflate) {
return
}
const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])
this.#inflate[kBuffer].length = 0
this.#inflate[kLength] = 0
callback(null, full)
})
}
}
module.exports = { PerMessageDeflate }
@@ -0,0 +1,135 @@
'use strict'
// Extracted from node/lib/internal/fixed_queue.js
// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
const kSize = 2048
const kMask = kSize - 1
// The FixedQueue is implemented as a singly-linked list of fixed-size
// circular buffers. It looks something like this:
//
// head tail
// | |
// v v
// +-----------+ <-----\ +-----------+ <------\ +-----------+
// | [null] | \----- | next | \------- | next |
// +-----------+ +-----------+ +-----------+
// | item | <-- bottom | item | <-- bottom | undefined |
// | item | | item | | undefined |
// | item | | item | | undefined |
// | item | | item | | undefined |
// | item | | item | bottom --> | item |
// | item | | item | | item |
// | ... | | ... | | ... |
// | item | | item | | item |
// | item | | item | | item |
// | undefined | <-- top | item | | item |
// | undefined | | item | | item |
// | undefined | | undefined | <-- top top --> | undefined |
// +-----------+ +-----------+ +-----------+
//
// Or, if there is only one circular buffer, it looks something
// like either of these:
//
// head tail head tail
// | | | |
// v v v v
// +-----------+ +-----------+
// | [null] | | [null] |
// +-----------+ +-----------+
// | undefined | | item |
// | undefined | | item |
// | item | <-- bottom top --> | undefined |
// | item | | undefined |
// | undefined | <-- top bottom --> | item |
// | undefined | | item |
// +-----------+ +-----------+
//
// Adding a value means moving `top` forward by one, removing means
// moving `bottom` forward by one. After reaching the end, the queue
// wraps around.
//
// When `top === bottom` the current queue is empty and when
// `top + 1 === bottom` it's full. This wastes a single space of storage
// but allows much quicker checks.
/**
* @type {FixedCircularBuffer}
* @template T
*/
class FixedCircularBuffer {
/** @type {number} */
bottom = 0
/** @type {number} */
top = 0
/** @type {Array<T|undefined>} */
list = new Array(kSize).fill(undefined)
/** @type {T|null} */
next = null
/** @returns {boolean} */
isEmpty () {
return this.top === this.bottom
}
/** @returns {boolean} */
isFull () {
return ((this.top + 1) & kMask) === this.bottom
}
/**
* @param {T} data
* @returns {void}
*/
push (data) {
this.list[this.top] = data
this.top = (this.top + 1) & kMask
}
/** @returns {T|null} */
shift () {
const nextItem = this.list[this.bottom]
if (nextItem === undefined) { return null }
this.list[this.bottom] = undefined
this.bottom = (this.bottom + 1) & kMask
return nextItem
}
}
/**
* @template T
*/
module.exports = class FixedQueue {
constructor () {
/** @type {FixedCircularBuffer<T>} */
this.head = this.tail = new FixedCircularBuffer()
}
/** @returns {boolean} */
isEmpty () {
return this.head.isEmpty()
}
/** @param {T} data */
push (data) {
if (this.head.isFull()) {
// Head is full: Creates a new queue, sets the old queue's `.next` to it,
// and sets it as the new main queue.
this.head = this.head.next = new FixedCircularBuffer()
}
this.head.push(data)
}
/** @returns {T|null} */
shift () {
const tail = this.tail
const next = tail.shift()
if (tail.isEmpty() && tail.next !== null) {
// If there is another queue, it forms the new tail.
this.tail = tail.next
tail.next = null
}
return next
}
}
@@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-dom-test-utils.production.js');
} else {
module.exports = require('./cjs/react-dom-test-utils.development.js');
}
@@ -0,0 +1,125 @@
type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type;
type UnionToIntersection<U> = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never;
export type SomeJSONSchema = UncheckedJSONSchemaType<Known, true>;
type UncheckedPartialSchema<T> = Partial<UncheckedJSONSchemaType<T, true>>;
export type PartialSchema<T> = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema<T>>;
type JSONType<T extends string, IsPartial extends boolean> = IsPartial extends true ? T | undefined : T;
interface NumberKeywords {
minimum?: number;
maximum?: number;
exclusiveMinimum?: number;
exclusiveMaximum?: number;
multipleOf?: number;
format?: string;
}
interface StringKeywords {
minLength?: number;
maxLength?: number;
pattern?: string;
format?: string;
}
type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (// these two unions allow arbitrary unions of types
{
anyOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
} | {
oneOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
} | ({
type: readonly (T extends number ? JSONType<"number" | "integer", IsPartial> : T extends string ? JSONType<"string", IsPartial> : T extends boolean ? JSONType<"boolean", IsPartial> : never)[];
} & UnionToIntersection<T extends number ? NumberKeywords : T extends string ? StringKeywords : T extends boolean ? {} : never>) | ((T extends number ? {
type: JSONType<"number" | "integer", IsPartial>;
} & NumberKeywords : T extends string ? {
type: JSONType<"string", IsPartial>;
} & StringKeywords : T extends boolean ? {
type: JSONType<"boolean", IsPartial>;
} : T extends readonly [any, ...any[]] ? {
type: JSONType<"array", IsPartial>;
items: {
readonly [K in keyof T]-?: UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>;
} & {
length: T["length"];
};
minItems: T["length"];
} & ({
maxItems: T["length"];
} | {
additionalItems: false;
}) : T extends readonly any[] ? {
type: JSONType<"array", IsPartial>;
items: UncheckedJSONSchemaType<T[0], false>;
contains?: UncheckedPartialSchema<T[0]>;
minItems?: number;
maxItems?: number;
minContains?: number;
maxContains?: number;
uniqueItems?: true;
additionalItems?: never;
} : T extends Record<string, any> ? {
type: JSONType<"object", IsPartial>;
additionalProperties?: boolean | UncheckedJSONSchemaType<T[string], false>;
unevaluatedProperties?: boolean | UncheckedJSONSchemaType<T[string], false>;
properties?: IsPartial extends true ? Partial<UncheckedPropertiesSchema<T>> : UncheckedPropertiesSchema<T>;
patternProperties?: Record<string, UncheckedJSONSchemaType<T[string], false>>;
propertyNames?: Omit<UncheckedJSONSchemaType<string, false>, "type"> & {
type?: "string";
};
dependencies?: {
[K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema<T>;
};
dependentRequired?: {
[K in keyof T]?: readonly (keyof T)[];
};
dependentSchemas?: {
[K in keyof T]?: UncheckedPartialSchema<T>;
};
minProperties?: number;
maxProperties?: number;
} & (IsPartial extends true ? {
required: readonly (keyof T)[];
} : [UncheckedRequiredMembers<T>] extends [never] ? {
required?: readonly UncheckedRequiredMembers<T>[];
} : {
required: readonly UncheckedRequiredMembers<T>[];
}) : T extends null ? {
type: JSONType<"null", IsPartial>;
nullable: true;
} : never) & {
allOf?: readonly UncheckedPartialSchema<T>[];
anyOf?: readonly UncheckedPartialSchema<T>[];
oneOf?: readonly UncheckedPartialSchema<T>[];
if?: UncheckedPartialSchema<T>;
then?: UncheckedPartialSchema<T>;
else?: UncheckedPartialSchema<T>;
not?: UncheckedPartialSchema<T>;
})) & {
[keyword: string]: any;
$id?: string;
$ref?: string;
$defs?: Record<string, UncheckedJSONSchemaType<Known, true>>;
definitions?: Record<string, UncheckedJSONSchemaType<Known, true>>;
};
export type JSONSchemaType<T> = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType<T, false>>;
type Known = {
[key: string]: Known;
} | [Known, ...Known[]] | Known[] | number | string | boolean | null;
type UncheckedPropertiesSchema<T> = {
[K in keyof T]-?: (UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>) | {
$ref: string;
};
};
export type PropertiesSchema<T> = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema<T>>;
type UncheckedRequiredMembers<T> = {
[K in keyof T]-?: undefined extends T[K] ? never : K;
}[keyof T];
export type RequiredMembers<T> = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers<T>>;
type Nullable<T> = undefined extends T ? {
nullable: true;
const?: null;
enum?: readonly (T | null)[];
default?: T | null;
} : {
nullable?: false;
const?: T;
enum?: readonly T[];
default?: T;
};
export {};
@@ -0,0 +1 @@
{"version":3,"names":["_fs","data","require","_path","_debug","_convertSourceMap","debug","buildDebug","findUpSync","name","cwd","stopAt","directory","path","resolve","root","parse","isAbsoluteName","isAbsolute","filePath","join","stats","fs","statSync","isFile","_","dirname","getInputMapPath","filename","inputMapURL","inputFileDir","inputMapPath","relativeToInputFileDir","relative","startsWith","inputPackageJSONPath","inputFileRoot","relativeInputMapPath","readInputSourceMapFile","inputMapContent","readFileSync","convertSourceMap","fromJSON"],"sources":["../../src/transformation/read-input-source-map-file.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport buildDebug from \"debug\";\nimport convertSourceMap from \"convert-source-map\";\nimport type { SourceMapConverter } from \"convert-source-map\";\n\nconst debug = buildDebug(\"babel:transform:file\");\n\n// Revised from https://github.com/sindresorhus/find-up-simple/blob/f10133c55dcbf36f84a246c6f1bbfed178dcb774/index.js#L36\n// for Node.js 6 compatibility\nfunction findUpSync(\n name: string,\n {\n cwd,\n stopAt,\n }: {\n cwd?: string;\n stopAt?: string;\n } = {},\n) {\n let directory = path.resolve(cwd || \"\");\n const { root } = path.parse(directory);\n stopAt = path.resolve(directory, stopAt || root);\n const isAbsoluteName = path.isAbsolute(name);\n\n while (directory) {\n const filePath = isAbsoluteName ? name : path.join(directory, name);\n\n try {\n const stats = fs.statSync(filePath);\n if (stats.isFile()) {\n return filePath;\n }\n } catch (_) {}\n\n if (directory === stopAt || directory === root) {\n break;\n }\n\n directory = path.dirname(directory);\n }\n}\n\nfunction getInputMapPath(\n filename: string,\n root: string,\n inputMapURL: string,\n): string | null {\n const inputFileDir = path.dirname(filename);\n const inputMapPath = path.resolve(inputFileDir, inputMapURL);\n const relativeToInputFileDir = path.relative(inputFileDir, inputMapPath);\n\n if (\n relativeToInputFileDir.startsWith(\"..\") ||\n path.isAbsolute(relativeToInputFileDir)\n ) {\n const inputPackageJSONPath = findUpSync(\"package.json\", {\n cwd: inputFileDir,\n stopAt: root,\n });\n const inputFileRoot = inputPackageJSONPath\n ? path.dirname(inputPackageJSONPath)\n : root;\n const relativeInputMapPath = path.relative(inputFileRoot, inputMapPath);\n if (\n relativeInputMapPath.startsWith(\"..\") ||\n path.isAbsolute(relativeInputMapPath)\n ) {\n debug(\n `discarding input sourcemap \"${inputMapPath}\" outside of package root \"${inputFileRoot}\"`,\n );\n return null;\n }\n }\n return inputMapPath;\n}\n\nexport default function readInputSourceMapFile(\n filename: string,\n root: string,\n inputMapURL: string,\n): SourceMapConverter | null {\n const inputMapPath = getInputMapPath(filename, root, inputMapURL);\n if (inputMapPath) {\n const inputMapContent = fs.readFileSync(inputMapPath, \"utf8\");\n return convertSourceMap.fromJSON(inputMapContent);\n }\n return null;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,MAAMK,KAAK,GAAGC,OAASA,CAAC,CAAC,sBAAsB,CAAC;AAIhD,SAASC,UAAUA,CACjBC,IAAY,EACZ;EACEC,GAAG;EACHC;AAIF,CAAC,GAAG,CAAC,CAAC,EACN;EACA,IAAIC,SAAS,GAAGC,MAAGA,CAAC,CAACC,OAAO,CAACJ,GAAG,IAAI,EAAE,CAAC;EACvC,MAAM;IAAEK;EAAK,CAAC,GAAGF,MAAGA,CAAC,CAACG,KAAK,CAACJ,SAAS,CAAC;EACtCD,MAAM,GAAGE,MAAGA,CAAC,CAACC,OAAO,CAACF,SAAS,EAAED,MAAM,IAAII,IAAI,CAAC;EAChD,MAAME,cAAc,GAAGJ,MAAGA,CAAC,CAACK,UAAU,CAACT,IAAI,CAAC;EAE5C,OAAOG,SAAS,EAAE;IAChB,MAAMO,QAAQ,GAAGF,cAAc,GAAGR,IAAI,GAAGI,MAAGA,CAAC,CAACO,IAAI,CAACR,SAAS,EAAEH,IAAI,CAAC;IAEnE,IAAI;MACF,MAAMY,KAAK,GAAGC,IAACA,CAAC,CAACC,QAAQ,CAACJ,QAAQ,CAAC;MACnC,IAAIE,KAAK,CAACG,MAAM,CAAC,CAAC,EAAE;QAClB,OAAOL,QAAQ;MACjB;IACF,CAAC,CAAC,OAAOM,CAAC,EAAE,CAAC;IAEb,IAAIb,SAAS,KAAKD,MAAM,IAAIC,SAAS,KAAKG,IAAI,EAAE;MAC9C;IACF;IAEAH,SAAS,GAAGC,MAAGA,CAAC,CAACa,OAAO,CAACd,SAAS,CAAC;EACrC;AACF;AAEA,SAASe,eAAeA,CACtBC,QAAgB,EAChBb,IAAY,EACZc,WAAmB,EACJ;EACf,MAAMC,YAAY,GAAGjB,MAAGA,CAAC,CAACa,OAAO,CAACE,QAAQ,CAAC;EAC3C,MAAMG,YAAY,GAAGlB,MAAGA,CAAC,CAACC,OAAO,CAACgB,YAAY,EAAED,WAAW,CAAC;EAC5D,MAAMG,sBAAsB,GAAGnB,MAAGA,CAAC,CAACoB,QAAQ,CAACH,YAAY,EAAEC,YAAY,CAAC;EAExE,IACEC,sBAAsB,CAACE,UAAU,CAAC,IAAI,CAAC,IACvCrB,MAAGA,CAAC,CAACK,UAAU,CAACc,sBAAsB,CAAC,EACvC;IACA,MAAMG,oBAAoB,GAAG3B,UAAU,CAAC,cAAc,EAAE;MACtDE,GAAG,EAAEoB,YAAY;MACjBnB,MAAM,EAAEI;IACV,CAAC,CAAC;IACF,MAAMqB,aAAa,GAAGD,oBAAoB,GACtCtB,MAAGA,CAAC,CAACa,OAAO,CAACS,oBAAoB,CAACLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"shimsBrowser.cjs","names":[],"sources":["../src/shimsBrowser.ts"],"sourcesContent":["/**\n * Browser runtime shims for server package\n *\n * This file is selected via package.json export conditions when bundling for\n * browsers. It binds the same platform choices as the workerd shim (the\n * cfWorker validator, the process stub) WITHOUT the module-scope\n * `preloadSchemas()` call: in a browser, module evaluation is page load —\n * boot latency — so schema construction stays lazy, exactly like Node.\n */\nexport { CfWorkerJsonSchemaValidator as DefaultJsonSchemaValidator } from '@modelcontextprotocol/core-internal/validators/cfWorker';\n\n/**\n * Stub process object for non-Node.js environments.\n * StdioServerTransport is not supported in Cloudflare Workers/browser environments.\n */\nfunction notSupported(): never {\n throw new Error('StdioServerTransport is not supported in this environment. Use StreamableHTTPServerTransport instead.');\n}\n\nexport const process = {\n get stdin(): never {\n return notSupported();\n },\n get stdout(): never {\n return notSupported();\n }\n};\n"],"mappings":";;;;;;;AAeA,SAAS,eAAsB;AAC3B,OAAM,IAAI,MAAM,wGAAwG;;AAG5H,MAAa,UAAU;CACnB,IAAI,QAAe;AACf,SAAO,cAAc;;CAEzB,IAAI,SAAgB;AAChB,SAAO,cAAc;;CAE5B"}
@@ -0,0 +1,34 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2015_core = void 0;
const base_config_1 = require("./base-config");
exports.es2015_core = {
libs: [],
variables: [
['Array', base_config_1.TYPE],
['ArrayConstructor', base_config_1.TYPE],
['DateConstructor', base_config_1.TYPE],
['Function', base_config_1.TYPE],
['Math', base_config_1.TYPE],
['NumberConstructor', base_config_1.TYPE],
['ObjectConstructor', base_config_1.TYPE],
['ReadonlyArray', base_config_1.TYPE],
['RegExp', base_config_1.TYPE],
['RegExpConstructor', base_config_1.TYPE],
['String', base_config_1.TYPE],
['StringConstructor', base_config_1.TYPE],
['Int8Array', base_config_1.TYPE],
['Uint8Array', base_config_1.TYPE],
['Uint8ClampedArray', base_config_1.TYPE],
['Int16Array', base_config_1.TYPE],
['Uint16Array', base_config_1.TYPE],
['Int32Array', base_config_1.TYPE],
['Uint32Array', base_config_1.TYPE],
['Float32Array', base_config_1.TYPE],
['Float64Array', base_config_1.TYPE],
],
};
@@ -0,0 +1,14 @@
import tempAdjacencyGraphs from './adjacencyGraphs.json.mjs';
import diceware from './diceware.json.mjs';
import passwords from './passwords.json.mjs';
// This file is auto generated by data-scripts/_helpers/runtime.ts
const dictionary = {
'diceware-common': diceware,
'passwords-common': passwords
};
// reinit the variable because the typescript compile will otherwise just reexport the json file which will break as it's a json file
const adjacencyGraphs = tempAdjacencyGraphs;
export { adjacencyGraphs, dictionary };
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
module.exports={C:{"47":0.00401,"52":0.01202,"56":0.00401,"66":0.00401,"72":0.00401,"115":0.52078,"120":0.48873,"121":0.96144,"123":0.01202,"124":0.01202,"125":0.00401,"127":0.00401,"130":0.00401,"132":0.00401,"134":0.00401,"136":0.00401,"138":0.01202,"140":0.04006,"142":0.00401,"143":0.00401,"144":0.00401,"146":0.01202,"147":0.00401,"148":0.00401,"149":0.00801,"150":0.01602,"151":0.00801,"152":0.02003,"153":0.02804,"154":0.15623,"155":0.43265,"156":0.34452,"157":0.01202,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 48 49 50 51 53 54 55 57 58 59 60 61 62 63 64 65 67 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 126 128 129 131 133 135 137 139 141 145 158 159 160 3.5 3.6"},D:{"49":0.01602,"50":0.00401,"51":0.00401,"52":0.00401,"53":0.00401,"56":0.02404,"58":0.00401,"60":0.00401,"61":0.00401,"62":0.00401,"63":0.00401,"64":0.00801,"65":0.00401,"66":0.00401,"68":0.00801,"69":0.00801,"70":0.00801,"71":0.02003,"72":0.00801,"73":0.00401,"74":0.00801,"75":0.00801,"76":0.00401,"77":0.00401,"78":0.00401,"79":0.02404,"80":0.00401,"81":0.01602,"83":0.03605,"84":0.00401,"85":0.01202,"86":0.01202,"87":0.03205,"88":0.00401,"89":0.00401,"90":0.00401,"91":0.00801,"93":0.00401,"95":0.02804,"96":0.00801,"97":0.00801,"98":0.02404,"100":0.00401,"101":0.05608,"102":0.00401,"103":0.18428,"104":0.17626,"105":0.17626,"106":0.19229,"107":0.17626,"108":0.18828,"109":3.41712,"110":0.18828,"111":0.18027,"112":0.16825,"113":0.00801,"114":0.00801,"116":0.36855,"117":0.17626,"118":0.80921,"119":1.00551,"120":1.15773,"121":0.01602,"122":0.03205,"123":0.02003,"124":0.18828,"125":0.00801,"126":0.01602,"127":0.00401,"128":0.02003,"129":0.01202,"130":0.01602,"131":0.37656,"132":0.02404,"133":0.47271,"134":0.18828,"135":0.14422,"136":0.19629,"137":0.16024,"138":0.22434,"139":0.15623,"140":0.17626,"141":0.16825,"142":0.52879,"143":0.02804,"144":0.09614,"145":0.0641,"146":0.49674,"147":0.04407,"148":0.14822,"149":0.2684,"150":0.24437,"151":1.39008,"152":5.93289,"153":4.36253,"154":1.10165,"155":0.01602,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 54 55 57 59 67 92 94 99 115 156 157"},F:{"25":0.00401,"46":0.00401,"54":0.00401,"55":0.00401,"56":0.00401,"64":0.00401,"79":0.01202,"85":0.00401,"86":0.00401,"95":0.08413,"100":0.00801,"101":0.02404,"102":0.00801,"105":0.00401,"106":0.01202,"107":0.00801,"114":0.00401,"115":0.00401,"116":0.00401,"119":0.00401,"122":0.00401,"124":0.00401,"131":0.00401,"133":0.01602,"134":0.11617,"135":0.75713,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 57 58 60 62 63 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 87 88 89 90 91 92 93 94 96 97 98 99 103 104 108 109 110 111 112 113 117 118 120 121 123 125 126 127 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00401,"92":0.02804,"100":0.00401,"109":0.02804,"114":0.00401,"119":0.47271,"120":0.48072,"122":0.01202,"123":0.00401,"124":0.00401,"131":0.00401,"132":0.00401,"139":0.00401,"140":0.00801,"141":0.00401,"142":0.00801,"143":0.00801,"144":0.00801,"145":0.00801,"146":0.00801,"147":0.01202,"148":0.01602,"149":0.02404,"150":0.08813,"151":0.08012,"152":0.67301,"153":0.68102,"154":0.21632,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 121 125 126 127 128 129 130 133 134 135 136 137 138"},E:{"27":0.04407,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.5 16.0 16.2 16.4 16.5 17.0 17.2 18.2 18.4 27.1 TP","13.1":0.00401,"14.1":0.00401,"15.4":0.00401,"15.6":0.04807,"16.1":0.00401,"16.3":0.00401,"16.6":0.02404,"17.1":0.03605,"17.3":0.00401,"17.4":0.00801,"17.5":0.00401,"17.6":0.02003,"18.0":0.01202,"18.1":0.00401,"18.3":0.00801,"18.5-18.7":0.01202,"26.0":0.02003,"26.1":0.00801,"26.2":0.01602,"26.3":0.01602,"26.4":0.01602,"26.5":0.08012,"26.6":0.34452,"27.2":0.00401},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00065,"5.0-5.1":0.00065,"6.0-6.1":0,"7.0-7.1":0.0013,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00648,"11.0-11.2":0.00065,"11.3-11.4":0.0013,"12.0-12.1":0,"12.2-12.5":0.01685,"13.0-13.1":0,"13.2":0.00324,"13.3":0,"13.4-13.7":0.00065,"14.0-14.4":0.00259,"14.5-14.8":0.00389,"15.0-15.1":0.00389,"15.2-15.3":0.00259,"15.4":0.00324,"15.5":0.00389,"15.6-15.8":0.08423,"16.0":0.00648,"16.1":0.01166,"16.2":0.00648,"16.3":0.01425,"16.4":0.00324,"16.5":0.00518,"16.6-16.7":0.11728,"17.0":0.00454,"17.1":0.00648,"17.2":0.00648,"17.3":0.00972,"17.4":0.01361,"17.5":0.02657,"17.6-17.7":0.06868,"18.0":0.01425,"18.1":0.02851,"18.2":0.03888,"18.3":0.06739,"18.4":0.04212,"18.5-18.7":0.8702,"26.0":0.04212,"26.1":0.04276,"26.2":0.11145,"26.3":0.12052,"26.4":0.0881Line truncated
@@ -0,0 +1,13 @@
"use strict";
const { stringifyValueForError } = require("./shared");
module.exports = function ({ ruleId, value }) {
return `
Configuration for rule "${ruleId}" is invalid. Expected severity of "off", 0, "warn", 1, "error", or 2.
You passed '${stringifyValueForError(value, 4)}'.
See https://eslint.org/docs/latest/use/configure/rules#use-configuration-files for configuring rules.
`.trimStart();
};
@@ -0,0 +1 @@
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AACjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAQT"}
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const rxEscapable =
// eslint-disable-next-line no-control-regex, no-misleading-character-class
/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
const escaped = {
"\b": "\\b",
"\t": "\\t",
"\n": "\\n",
"\f": "\\f",
"\r": "\\r",
'"': '\\"',
"\\": "\\\\",
};
function quote(s) {
rxEscapable.lastIndex = 0;
return ('"' +
(rxEscapable.test(s)
? s.replace(rxEscapable, (a) => {
const c = escaped[a];
return typeof c === "string"
? c
: "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
})
: s) +
'"');
}
exports.default = quote;
quote.code = 'require("ajv/dist/runtime/quote").default';
//# sourceMappingURL=quote.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_GI","2":"_0 _VG s","194":"t u v","516":"_QC w x _aI"},C:{"1":"_jG _ZF _p","2":"_bB _jF y _L","322":"0 z"},D:{"1":"_2G","2":"_OR s","194":"t u v","516":"_QC w x _aI"},E:{"1":"K _hM _AO","2":"_cD sC","516":"tC VD _gM"},F:{"1":"_OK","2":"_8 _aF _O","194":"_eI","516":"_BG p"},G:{"1":"_hM _NM","2":"_YC sC","516":"tC yD _gM"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"1":"_NB","2":"_MK","516":"_GH"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:5,C:"CSS Nesting",D:true};
@@ -0,0 +1,31 @@
import { complex } from './index.mjs';
import { floatRegex } from '../utils/float-regex.mjs';
/**
* Properties that should default to 1 or 100%
*/
const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]);
function applyDefaultFilter(v) {
const [name, value] = v.slice(0, -1).split("(");
if (name === "drop-shadow")
return v;
const [number] = value.match(floatRegex) || [];
if (!number)
return v;
const unit = value.replace(number, "");
let defaultValue = maxDefaults.has(name) ? 1 : 0;
if (number !== value)
defaultValue *= 100;
return name + "(" + defaultValue + unit + ")";
}
const functionRegex = /\b([a-z-]*)\(.*?\)/gu;
const filter = {
...complex,
getAnimatableNone: (v) => {
const functions = v.match(functionRegex);
return functions ? functions.map(applyDefaultFilter).join(" ") : v;
},
};
export { filter };
//# sourceMappingURL=filter.mjs.map
@@ -0,0 +1,68 @@
{
"name": "yallist",
"version": "5.0.0",
"description": "Yet Another Linked List",
"files": [
"dist"
],
"devDependencies": {
"prettier": "^3.2.5",
"tap": "^18.7.2",
"tshy": "^1.13.1",
"typedoc": "^0.25.13"
},
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"prepare": "tshy",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "tap",
"snap": "tap",
"format": "prettier --write . --loglevel warn --ignore-path ../../.prettierignore --cache",
"typedoc": "typedoc"
},
"repository": {
"type": "git",
"url": "git+https://github.com/isaacs/yallist.git"
},
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"license": "BlueOak-1.0.0",
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"type": "module",
"prettier": {
"semi": false,
"printWidth": 70,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
},
"engines": {
"node": ">=18"
}
}
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _superPropBase;
var _getPrototypeOf = require("./getPrototypeOf.js");
function _superPropBase(object, property) {
while (!Object.prototype.hasOwnProperty.call(object, property)) {
object = (0, _getPrototypeOf.default)(object);
if (object === null) break;
}
return object;
}
//# sourceMappingURL=superPropBase.js.map
@@ -0,0 +1,603 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference lib="es2015.symbol" />
interface SymbolConstructor {
/**
* A method that returns the default iterator for an object. Called by the semantics of the
* for-of statement.
*/
readonly iterator: unique symbol;
}
interface IteratorYieldResult<TYield> {
done?: false;
value: TYield;
}
interface IteratorReturnResult<TReturn> {
done: true;
value: TReturn;
}
type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;
interface Iterator<T, TReturn = any, TNext = any> {
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
next(...[value]: [] | [TNext]): IteratorResult<T, TReturn>;
return?(value?: TReturn): IteratorResult<T, TReturn>;
throw?(e?: any): IteratorResult<T, TReturn>;
}
interface Iterable<T, TReturn = any, TNext = any> {
[Symbol.iterator](): Iterator<T, TReturn, TNext>;
}
/**
* Describes a user-defined {@link Iterator} that is also iterable.
*/
interface IterableIterator<T, TReturn = any, TNext = any> extends Iterator<T, TReturn, TNext> {
[Symbol.iterator](): IterableIterator<T, TReturn, TNext>;
}
/**
* Describes an {@link Iterator} produced by the runtime that inherits from the intrinsic `Iterator.prototype`.
*/
interface IteratorObject<T, TReturn = unknown, TNext = unknown> extends Iterator<T, TReturn, TNext> {
[Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
}
/**
* Defines the `TReturn` type used for built-in iterators produced by `Array`, `Map`, `Set`, and others.
* This is `undefined` when `strictBuiltInIteratorReturn` is `true`; otherwise, this is `any`.
*/
type BuiltinIteratorReturn = intrinsic;
interface ArrayIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): ArrayIterator<T>;
}
interface Array<T> {
/** Iterator */
[Symbol.iterator](): ArrayIterator<T>;
/**
* Returns an iterable of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, T]>;
/**
* Returns an iterable of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an iterable of values in the array
*/
values(): ArrayIterator<T>;
}
interface ArrayConstructor {
/**
* Creates an array from an iterable object.
* @param iterable An iterable object to convert to an array.
*/
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
/**
* Creates an array from an iterable object.
* @param iterable An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
}
interface ReadonlyArray<T> {
/** Iterator of values in the array. */
[Symbol.iterator](): ArrayIterator<T>;
/**
* Returns an iterable of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, T]>;
/**
* Returns an iterable of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an iterable of values in the array
*/
values(): ArrayIterator<T>;
}
interface IArguments {
/** Iterator */
[Symbol.iterator](): ArrayIterator<any>;
}
interface MapIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): MapIterator<T>;
}
interface Map<K, V> {
/** Returns an iterable of entries in the map. */
[Symbol.iterator](): MapIterator<[K, V]>;
/**
* Returns an iterable of key, value pairs for every entry in the map.
*/
entries(): MapIterator<[K, V]>;
/**
* Returns an iterable of keys in the map
*/
keys(): MapIterator<K>;
/**
* Returns an iterable of values in the map
*/
values(): MapIterator<V>;
}
interface ReadonlyMap<K, V> {
/** Returns an iterable of entries in the map. */
[Symbol.iterator](): MapIterator<[K, V]>;
/**
* Returns an iterable of key, value pairs for every entry in the map.
*/
entries(): MapIterator<[K, V]>;
/**
* Returns an iterable of keys in the map
*/
keys(): MapIterator<K>;
/**
* Returns an iterable of values in the map
*/
values(): MapIterator<V>;
}
interface MapConstructor {
new (): Map<any, any>;
new <K, V>(iterable?: Iterable<readonly [K, V]> | null): Map<K, V>;
}
interface WeakMap<K extends WeakKey, V> {}
interface WeakMapConstructor {
new <K extends WeakKey = WeakKey, V = any>(iterable?: Iterable<readonly [K, V]> | null): WeakMap<K, V>;
}
interface SetIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): SetIterator<T>;
}
interface Set<T> {
/** Iterates over values in the set. */
[Symbol.iterator](): SetIterator<T>;
/**
* Returns an iterable of [v,v] pairs for every value `v` in the set.
*/
entries(): SetIterator<[T, T]>;
/**
* Despite its name, returns an iterable of the values in the set.
*/
keys(): SetIterator<T>;
/**
* Returns an iterable of values in the set.
*/
values(): SetIterator<T>;
}
interface ReadonlySet<T> {
/** Iterates over values in the set. */
[Symbol.iterator](): SetIterator<T>;
/**
* Returns an iterable of [v,v] pairs for every value `v` in the set.
*/
entries(): SetIterator<[T, T]>;
/**
* Despite its name, returns an iterable of the values in the set.
*/
keys(): SetIterator<T>;
/**
* Returns an iterable of values in the set.
*/
values(): SetIterator<T>;
}
interface SetConstructor {
new <T>(iterable?: Iterable<T> | null): Set<T>;
}
interface WeakSet<T extends WeakKey> {}
interface WeakSetConstructor {
new <T extends WeakKey = WeakKey>(iterable: Iterable<T>): WeakSet<T>;
}
interface Promise<T> {}
interface PromiseConstructor {
/**
* Creates a Promise that is resolved with an array of results when all of the provided Promises
* resolve, or rejected when any Promise is rejected.
* @param values An iterable of Promises.
* @returns A new Promise.
*/
all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
/**
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
* or rejected.
* @param values An iterable of Promises.
* @returns A new Promise.
*/
race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
}
interface StringIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): StringIterator<T>;
}
interface String {
/** Iterator */
[Symbol.iterator](): StringIterator<string>;
}
interface Int8Array<TArrayBuffer extends ArrayBufferLike> {
[Symbol.iterator](): ArrayIterator<number>;
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, number]>;
/**
* Returns an list of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the array
*/
values(): ArrayIterator<number>;
}
interface Int8ArrayConstructor {
new (elements: Iterable<number>): Int8Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
*/
from(elements: Iterable<number>): Int8Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Int8Array<ArrayBuffer>;
}
interface Uint8Array<TArrayBuffer extends ArrayBufferLike> {
[Symbol.iterator](): ArrayIterator<number>;
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, number]>;
/**
* Returns an list of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the array
*/
values(): ArrayIterator<number>;
}
interface Uint8ArrayConstructor {
new (elements: Iterable<number>): Uint8Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
*/
from(elements: Iterable<number>): Uint8Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Uint8Array<ArrayBuffer>;
}
interface Uint8ClampedArray<TArrayBuffer extends ArrayBufferLike> {
[Symbol.iterator](): ArrayIterator<number>;
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, number]>;
/**
* Returns an list of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the array
*/
values(): ArrayIterator<number>;
}
interface Uint8ClampedArrayConstructor {
new (elements: Iterable<number>): Uint8ClampedArray<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
*/
from(elements: Iterable<number>): Uint8ClampedArray<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray<ArrayBuffer>;
}
interface Int16Array<TArrayBuffer extends ArrayBufferLike> {
[Symbol.iterator](): ArrayIterator<number>;
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, number]>;
/**
* Returns an list of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the array
*/
values(): ArrayIterator<number>;
}
interface Int16ArrayConstructor {
new (elements: Iterable<number>): Int16Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
*/
from(elements: Iterable<number>): Int16Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Int16Array<ArrayBuffer>;
}
interface Uint16Array<TArrayBuffer extends ArrayBufferLike> {
[Symbol.iterator](): ArrayIterator<number>;
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, number]>;
/**
* Returns an list of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the array
*/
values(): ArrayIterator<number>;
}
interface Uint16ArrayConstructor {
new (elements: Iterable<number>): Uint16Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
*/
from(elements: Iterable<number>): Uint16Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Uint16Array<ArrayBuffer>;
}
interface Int32Array<TArrayBuffer extends ArrayBufferLike> {
[Symbol.iterator](): ArrayIterator<number>;
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, number]>;
/**
* Returns an list of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the array
*/
values(): ArrayIterator<number>;
}
interface Int32ArrayConstructor {
new (elements: Iterable<number>): Int32Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
*/
from(elements: Iterable<number>): Int32Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Int32Array<ArrayBuffer>;
}
interface Uint32Array<TArrayBuffer extends ArrayBufferLike> {
[Symbol.iterator](): ArrayIterator<number>;
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, number]>;
/**
* Returns an list of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the array
*/
values(): ArrayIterator<number>;
}
interface Uint32ArrayConstructor {
new (elements: Iterable<number>): Uint32Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
*/
from(elements: Iterable<number>): Uint32Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Uint32Array<ArrayBuffer>;
}
interface Float32Array<TArrayBuffer extends ArrayBufferLike> {
[Symbol.iterator](): ArrayIterator<number>;
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, number]>;
/**
* Returns an list of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the array
*/
values(): ArrayIterator<number>;
}
interface Float32ArrayConstructor {
new (elements: Iterable<number>): Float32Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
*/
from(elements: Iterable<number>): Float32Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Float32Array<ArrayBuffer>;
}
interface Float64Array<TArrayBuffer extends ArrayBufferLike> {
[Symbol.iterator](): ArrayIterator<number>;
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): ArrayIterator<[number, number]>;
/**
* Returns an list of keys in the array
*/
keys(): ArrayIterator<number>;
/**
* Returns an list of values in the array
*/
values(): ArrayIterator<number>;
}
interface Float64ArrayConstructor {
new (elements: Iterable<number>): Float64Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
*/
from(elements: Iterable<number>): Float64Array<ArrayBuffer>;
/**
* Creates an array from an array-like or iterable object.
* @param elements An iterable object to convert to an array.
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Float64Array<ArrayBuffer>;
}
@@ -0,0 +1 @@
module.exports={C:{"115":0.52983,"121":0.00589,"140":1.0891,"146":0.02355,"149":0.00589,"152":0.04121,"153":0.02944,"154":0.36499,"155":1.11264,"156":0.91249,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 141 142 143 144 145 147 148 150 151 157 158 159 160 3.5 3.6"},D:{"84":0.00589,"103":0.08242,"104":0.01177,"105":0.01177,"106":0.00589,"107":0.01766,"108":0.00589,"109":0.78297,"111":0.01177,"116":0.01766,"117":0.00589,"118":0.05887,"119":0.01766,"120":0.30612,"122":0.01177,"124":0.05298,"125":0.02355,"126":0.01177,"128":0.04121,"130":0.01766,"131":0.09419,"132":0.00589,"133":0.0471,"134":0.02355,"135":0.00589,"136":0.06476,"137":0.05887,"138":0.45919,"139":0.01766,"140":0.01177,"141":0.05298,"142":0.07064,"143":0.10597,"144":0.10597,"145":0.05887,"146":0.30612,"147":0.18838,"148":0.03532,"149":0.10008,"150":0.51217,"151":1.67191,"152":12.49221,"153":7.38819,"154":1.34812,"155":0.05887,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 110 112 113 114 115 121 123 127 129 156 157"},F:{"133":0.00589,"134":0.02355,"135":0.19427,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00589,"119":0.00589,"120":0.01177,"138":0.01177,"139":0.02944,"144":0.01177,"148":0.00589,"149":0.01177,"150":0.0471,"151":0.08242,"152":4.68017,"153":4.19154,"154":1.74255,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 140 141 142 143 145 146 147"},E:{"27":0.56515,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 17.0 18.0 18.2 27.1 27.2 TP","15.6":0.05887,"16.1":0.00589,"16.3":0.02355,"16.4":0.01766,"16.5":0.09419,"16.6":0.10597,"17.1":0.6358,"17.2":0.18838,"17.3":0.01766,"17.4":0.01766,"17.5":0.02944,"17.6":0.47096,"18.1":0.01766,"18.3":0.07064,"18.4":0.01766,"18.5-18.7":0.38854,"26.0":0.01177,"26.1":0.06476,"26.2":0.03532,"26.3":0.06476,"26.4":0.26492,"26.5":1.51296,"26.6":6.929},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00194,"5.0-5.1":0.00194,"6.0-6.1":0,"7.0-7.1":0.00388,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01939,"11.0-11.2":0.00194,"11.3-11.4":0.00388,"12.0-12.1":0,"12.2-12.5":0.05042,"13.0-13.1":0,"13.2":0.0097,"13.3":0,"13.4-13.7":0.00194,"14.0-14.4":0.00776,"14.5-14.8":0.01164,"15.0-15.1":0.01164,"15.2-15.3":0.00776,"15.4":0.0097,"15.5":0.01164,"15.6-15.8":0.25211,"16.0":0.01939,"16.1":0.03491,"16.2":0.01939,"16.3":0.04266,"16.4":0.0097,"16.5":0.01551,"16.6-16.7":0.35101,"17.0":0.01357,"17.1":0.01939,"17.2":0.01939,"17.3":0.02909,"17.4":0.04072,"17.5":0.07951,"17.6-17.7":0.20556,"18.0":0.04266,"18.1":0.08533,"18.2":0.11636,"18.3":0.20169,"18.4":0.12605,"18.5-18.7":2.60445,"26.0":0.12605,"26.1":0.12799,"26.2":0.33356,"26.3":0.36071,"26.4":0.26374,"26.5":1.76668,"26.6":10.90069,"27.0":0.83583,"27.1":0,"27.2":0.02133},P:{"24":0.02957,"28":0.00986,"30":2.34611,_:"4 20 21 22 23 25 26 27 29 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.00411,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.02879,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00589,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":18.6347},R:{_:"0"},M:{"0":0.10694},Q:{_:"14.9"},O:{_:"0"},H:{all:0}};
@@ -0,0 +1,733 @@
export default `flf2a 7 5 10 -1 17
Alphabet by Wendell Hicken 11/93 (whicken@parasoft.com)
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be \`a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
6 - height of a character
5 - height of a character, not including descenders
20 - max line length (excluding comment lines) + a fudge factor
15 - default smushmode for this font (like "-m 15" on command line)
12 - number of comment lines
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
 @
 @
 @
 @
 @
 @
 @@
!!! @
!!! @
!!! @
@
!!! @
@
@@
'' '' @
'' '' @
@
@
@
@
@@
# # @
##### @
# # @
##### @
# # @
@
@@
$ $ @
$$$$$ @
$ $ $ @
$$$$$ @
$ $ $ @
$$$$$ @
$ $ @@
% %% @
%% @
%% @
%% @
%% % @
@
@@
&& @
& & @
&&& &@
& & & @
&&&& @
@
@@
'' @
'' @
@
@
@
@
@@
(( @
(( @
(( @
(( @
(( @
@
@@
)) @
)) @
)) @
)) @
)) @
@
@@
@
* * * @
*** @
***** @
*** @
* * * @
@@
@
+ @
+++ @
+ @
@
@
@@
@
@
@
@
,, @
, @
@@
@
@
--- @
@
@
@
@@
@
@
@
.. @
.. @
@
@@
//@
// @
// @
// @
// @
@
@@
000 @
0 00 @
0 0 0 @
00 0 @
000 @
@
@@
11 @
111 @
11 @
11 @
11l1 @
@
@@
22 @
2 2 @
2 @
2 @
2222 @
@
@@
333 @
3 @
33 @
3 @
333 @
@
@@
4 4 @
4 4 @
4444 @
4 @
4 @
@
@@
5555 @
5 @
555 @
5 @
555 @
@
@@
6 @
6 @
6666 @
6 6 @
666 @
@
@@
77777 @
7 @
7 @
7 @
7 @
@
@@
888 @
8 8 @
888 @
8 8 @
888 @
@
@@
9999 @
9 9 @
9999 @
9 @
9 @
@
@@
@
:: @
@
:: @
@
@
@@
@
;; @
@
;; @
; @
@
@@
<< @
<< @
<< @
<< @
<< @
@
@@
@
=== @
@
=== @
@
@
@@
>> @
>> @
>> @
>> @
>> @
@
@@
??? @
? ? @
? @
? @
? @
@
@@
@@@ @
@ @ @
@ @@ @
@ @
@@@ @
@
@@
AA @
A A @
AAAA @
A A @
A A @
@
@@
BBBB @
B B @
BBBB @
B B @
BBBB @
@
@@
CCC @
C @
C @
C @
CCC @
@
@@
DDD @
D D @
D D @
D D @
DDD @
@
@@
EEEE @
E @
EEE @
E @
EEEE @
@
@@
FFFF @
F @
FFF @
F @
F @
@
@@
GGG @
G @
G GG @
G G @
GGG @
@
@@
H H @
H H @
HHHH @
H H @
H H @
@
@@
III @
I @
I @
I @
III @
@
@@
J @
J @
J @
J J @
JJJ @
@
@@
K K @
K K @
KK @
K K @
K K @
@
@@
L @
L @
L @
L @
LLLL @
@
@@
M M @
MM MM @
M M M @
M M @
M M @
@
@@
N N @
NN N @
N N N @
N NN @
N N @
@
@@
OOO @
O O @
O O @
O O @
OOO @
@
@@
PPPP @
P P @
PPPP @
P @
P @
@
@@
QQQ @
Q Q @
Q Q @
Q QQ @
QQQQ @
Q @
@@
RRRR @
R R @
RRRR @
R R @
R RR @
@
@@
SSS @
S @
SSS @
S @
SSSS @
@
@@
TTTTTT @
TT @
TT @
TT @
TT @
@
@@
U U @
U U @
U U @
U U @
UUU @
@
@@
V V @
V V @
V V @
V V @
V @
@
@@
W W @
W W @
W W W @
W W W @
W W @
@
@@
X X @
X X @
X @
X X @
X X @
@
@@
Y Y @
Y Y @
Y @
Y @
Y @
@
@@
ZZZZZ @
Z @
Z @
Z @
ZZZZZ @
@
@@
[[[[ @
[[ @
[[ @
[[ @
[[[[ @
@
@@
\\\\ @
\\\\ @
\\\\ @
\\\\ @
\\\\@
@
@@
]]]] @
]] @
]] @
]] @
]]]] @
@
@@
^^ @
^ ^ @
@
@
@
@
@@
@
@
@
@
____@
____@
@@
\`\` @
@
@
@
@
@
@@
@
@
aa @
a a @
aaa @
@
@@
b @
b @
bbb @
b b @
bbb @
@
@@
@
@
ccc @
c @
ccc @
@
@@
d @
d @
ddd @
d d @
ddd @
@
@@
@
@
eee @
e e @
ee @
@
@@
ff @
f @
fff @
f @
f @
@
@@
@
@
ggg @
g g @
ggg @
g @
ggg @@
h @
h @
hhh @
h h @
h h @
@
@@
@
ii @
@
ii @
ii @
@
@@
@
j @
@
j @
j @
j j @
jj @@
k @
k k @
kk @
k k @
k k @
@
@@
l @
l @
l @
l @
l @
@
@@
@
@
mmmm @
m m m @
m m m @
@
@@
@
@
nnn @
n n @
n n @
@
@@
@
@
ooo @
o o @
ooo @
@
@@
@
@
ppp @
p p @
ppp @
p @
p @@
@
@
qqq @
q q @
qqq @
q @
qq @@
@
@
rrr @
r @
r @
@
@@
@
@
ss @
s @
ss @
@
@@
t @
t @
ttt @
t @
tt @
@
@@
@
@
u u @
u u @
uuu @
@
@@
@
@
v v @
v v @
v @
@
@@
@
@
w w @
w w w @
w w @
@
@@
@
@
x x @
x @
x x @
@
@@
@
@
y y @
y y @
yyy @
y @
yyy @@
@
@
zz @
z @
zz @
@
@@
{{ @
{{ @
{{ @
{{ @
{{ @
@
@@
||@
||@
||@
||@
||@
||@
@@
}} @
}} @
}} @
}} @
}} @
@
@@
@
~ ~ @
~ ~ @
@
@
@
@@
o o @
AA @
A A @
AAAA @
A A @
@
@@
o o @
OOO @
O O @
O O @
OOO @
@
@@
o o @
U U @
U U @
U U @
UUU @
@
@@
o o @
@
aa @
a a @
aaa @
@
@@
o o @
@
ooo @
o o @
ooo @
@
@@
o o @
@
u u @
u u @
uuu @
@
@@
BBBB @
B B @
BBBB @
B B @
BBBB @
B @
@@
`
@@ -0,0 +1,106 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{## def.skipFormat:
{{? $breakOnError }} if (true) { {{?}}
{{ return out; }}
#}}
{{? it.opts.format === false }}{{# def.skipFormat }}{{?}}
{{# def.$data }}
{{## def.$dataCheckFormat:
{{# def.$dataNotType:'string' }}
({{? $unknownFormats != 'ignore' }}
({{=$schemaValue}} && !{{=$format}}
{{? $allowUnknown }}
&& self._opts.unknownFormats.indexOf({{=$schemaValue}}) == -1
{{?}}) ||
{{?}}
({{=$format}} && {{=$formatType}} == '{{=$ruleType}}'
&& !(typeof {{=$format}} == 'function'
? {{? it.async}}
(async{{=$lvl}} ? await {{=$format}}({{=$data}}) : {{=$format}}({{=$data}}))
{{??}}
{{=$format}}({{=$data}})
{{?}}
: {{=$format}}.test({{=$data}}))))
#}}
{{## def.checkFormat:
{{
var $formatRef = 'formats' + it.util.getProperty($schema);
if ($isObject) $formatRef += '.validate';
}}
{{? typeof $format == 'function' }}
{{=$formatRef}}({{=$data}})
{{??}}
{{=$formatRef}}.test({{=$data}})
{{?}}
#}}
{{
var $unknownFormats = it.opts.unknownFormats
, $allowUnknown = Array.isArray($unknownFormats);
}}
{{? $isData }}
{{
var $format = 'format' + $lvl
, $isObject = 'isObject' + $lvl
, $formatType = 'formatType' + $lvl;
}}
var {{=$format}} = formats[{{=$schemaValue}}];
var {{=$isObject}} = typeof {{=$format}} == 'object'
&& !({{=$format}} instanceof RegExp)
&& {{=$format}}.validate;
var {{=$formatType}} = {{=$isObject}} && {{=$format}}.type || 'string';
if ({{=$isObject}}) {
{{? it.async}}
var async{{=$lvl}} = {{=$format}}.async;
{{?}}
{{=$format}} = {{=$format}}.validate;
}
if ({{# def.$dataCheckFormat }}) {
{{??}}
{{ var $format = it.formats[$schema]; }}
{{? !$format }}
{{? $unknownFormats == 'ignore' }}
{{ it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); }}
{{# def.skipFormat }}
{{?? $allowUnknown && $unknownFormats.indexOf($schema) >= 0 }}
{{# def.skipFormat }}
{{??}}
{{ throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); }}
{{?}}
{{?}}
{{
var $isObject = typeof $format == 'object'
&& !($format instanceof RegExp)
&& $format.validate;
var $formatType = $isObject && $format.type || 'string';
if ($isObject) {
var $async = $format.async === true;
$format = $format.validate;
}
}}
{{? $formatType != $ruleType }}
{{# def.skipFormat }}
{{?}}
{{? $async }}
{{
if (!it.async) throw new Error('async format in sync schema');
var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';
}}
if (!(await {{=$formatRef}}({{=$data}}))) {
{{??}}
if (!{{# def.checkFormat }}) {
{{?}}
{{?}}
{{# def.error:'format' }}
} {{? $breakOnError }} else { {{?}}
@@ -0,0 +1 @@
{"version":3,"file":"strip-trailing-slashes.js","sourceRoot":"","sources":["../../src/strip-trailing-slashes.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,+CAA+C;AAC/C,6CAA6C;AAC7C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,EAAE;IAClD,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAA;IACtB,IAAI,YAAY,GAAG,CAAC,CAAC,CAAA;IACrB,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACvC,YAAY,GAAG,CAAC,CAAA;QAChB,CAAC,EAAE,CAAA;IACL,CAAC;IACD,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;AAC/D,CAAC,CAAA","sourcesContent":["// warning: extremely hot code path.\n// This has been meticulously optimized for use\n// within npm install on large package trees.\n// Do not edit without careful benchmarking.\nexport const stripTrailingSlashes = (str: string) => {\n let i = str.length - 1\n let slashesStart = -1\n while (i > -1 && str.charAt(i) === '/') {\n slashesStart = i\n i--\n }\n return slashesStart === -1 ? str : str.slice(0, slashesStart)\n}\n"]}
@@ -0,0 +1,9 @@
import { AllContext, RouteById } from './routeInfo.js';
import { AnyRouter } from './router.js';
import { Expand, StrictOrFrom } from './utils.js';
export interface UseRouteContextBaseOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> {
select?: (search: ResolveUseRouteContext<TRouter, TFrom, TStrict>) => TSelected;
}
export type UseRouteContextOptions<TRouter extends AnyRouter, TFrom extends string | undefined, TStrict extends boolean, TSelected> = StrictOrFrom<TRouter, TFrom, TStrict> & UseRouteContextBaseOptions<TRouter, TFrom, TStrict, TSelected>;
export type ResolveUseRouteContext<TRouter extends AnyRouter, TFrom, TStrict extends boolean> = TStrict extends false ? AllContext<TRouter['routeTree']> : Expand<RouteById<TRouter['routeTree'], TFrom>['types']['allContext']>;
export type UseRouteContextResult<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> = unknown extends TSelected ? ResolveUseRouteContext<TRouter, TFrom, TStrict> : TSelected;
@@ -0,0 +1 @@
{"version":3,"file":"coffee.js","sources":["../../../src/icons/coffee.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Coffee\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMnYyIiAvPgogIDxwYXRoIGQ9Ik0xNCAydjIiIC8+CiAgPHBhdGggZD0iTTE2IDhhMSAxIDAgMCAxIDEgMXY4YTQgNCAwIDAgMS00IDRIN2E0IDQgMCAwIDEtNC00VjlhMSAxIDAgMCAxIDEtMWgxNGE0IDQgMCAxIDEgMCA4aC0xIiAvPgogIDxwYXRoIGQ9Ik02IDJ2MiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/coffee\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Coffee = createLucideIcon('Coffee', [\n ['path', { d: 'M10 2v2', key: '7u0qdc' }],\n ['path', { d: 'M14 2v2', key: '6buw04' }],\n [\n 'path',\n {\n d: 'M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1',\n key: 'pwadti',\n },\n ],\n ['path', { d: 'M6 2v2', key: 'colzsn' }],\n]);\n\nexport default Coffee;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACzC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,44 @@
const require_headers = require("./headers.cjs");
const require_ssr_server = require("./ssr-server.cjs");
let _tanstack_history = require("@tanstack/history");
//#region src/ssr/createRequestHandler.ts
function createRequestHandler({ createRouter, request, getRouterManifest }) {
return async (cb) => {
const router = createRouter();
let cbWillCleanup = false;
try {
require_ssr_server.attachRouterServerSsrUtils({
router,
manifest: await getRouterManifest?.()
});
const { url } = require_ssr_server.getNormalizedURL(request.url, "http://localhost");
const origin = require_ssr_server.getOrigin(request);
const history = (0, _tanstack_history.createMemoryHistory)({ initialEntries: [url.href.replace(url.origin, "")] });
router.update({
history,
origin: router.options.origin ?? origin
});
await router.load();
await router.serverSsr?.dehydrate();
const responseHeaders = getRequestHeaders({ router });
cbWillCleanup = true;
return cb({
request,
router,
responseHeaders
});
} finally {
if (!cbWillCleanup) router.serverSsr?.cleanup();
}
};
}
function getRequestHeaders(opts) {
const matchHeaders = opts.router.stores.matches.get().map((match) => match.headers);
const redirect = opts.router.stores.redirect.get();
if (redirect) matchHeaders.push(redirect.headers);
return require_headers.mergeHeaders({ "Content-Type": "text/html; charset=UTF-8" }, ...matchHeaders);
}
//#endregion
exports.createRequestHandler = createRequestHandler;
//# sourceMappingURL=createRequestHandler.cjs.map
@@ -0,0 +1,3 @@
export { animateSequence } from './animation/animators/waapi/animate-sequence.mjs';
export { animateMini as animate } from './animation/animators/waapi/animate-style.mjs';
//# sourceMappingURL=dom-mini.mjs.map
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Videotape = createLucideIcon("Videotape", [
["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }],
["path", { d: "M2 8h20", key: "d11cs7" }],
["circle", { cx: "8", cy: "14", r: "2", key: "1k2qr5" }],
["path", { d: "M8 12h8", key: "1wcyev" }],
["circle", { cx: "16", cy: "14", r: "2", key: "14k7lr" }]
]);
export { Videotape as default };
//# sourceMappingURL=videotape.js.map
@@ -0,0 +1,334 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region \0rolldown/runtime.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
//#endregion
let fs = require("fs");
let path = require("path");
let url = require("url");
let fdir = require("fdir");
let picomatch = require("picomatch");
picomatch = __toESM(picomatch);
//#region src/utils.ts
const isReadonlyArray = Array.isArray;
const BACKSLASHES = /\\/g;
const isWin = process.platform === "win32";
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
function getPartialMatcher(patterns, options = {}) {
const patternsCount = patterns.length;
const patternsParts = Array(patternsCount);
const matchers = Array(patternsCount);
let i, j;
for (i = 0; i < patternsCount; i++) {
const parts = splitPattern(patterns[i]);
patternsParts[i] = parts;
const partsCount = parts.length;
const partMatchers = Array(partsCount);
for (j = 0; j < partsCount; j++) partMatchers[j] = (0, picomatch.default)(parts[j], options);
matchers[i] = partMatchers;
}
return (input) => {
const inputParts = input.split("/");
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
for (i = 0; i < patternsCount; i++) {
const patternParts = patternsParts[i];
const matcher = matchers[i];
const inputPatternCount = inputParts.length;
const minParts = Math.min(inputPatternCount, patternParts.length);
j = 0;
while (j < minParts) {
const part = patternParts[j];
if (part.includes("/")) return true;
if (!matcher[j](inputParts[j])) break;
if (!options.noglobstar && part === "**") return true;
j++;
}
if (j === inputPatternCount) return true;
}
return false;
};
}
/* node:coverage ignore next 2 */
const WIN32_ROOT_DIR = /^[A-Z]:\/$/i;
const isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === "/";
function buildFormat(cwd, root, absolute) {
if (cwd === root || root.startsWith(`${cwd}/`)) {
if (absolute) {
const start = cwd.length + +!isRoot(cwd);
return (p, isDir) => p.slice(start, isDir ? -1 : void 0) || ".";
}
const prefix = root.slice(cwd.length + 1);
if (prefix) return (p, isDir) => {
if (p === ".") return prefix;
const result = `${prefix}/${p}`;
return isDir ? result.slice(0, -1) : result;
};
return (p, isDir) => isDir && p !== "." ? p.slice(0, -1) : p;
}
if (absolute) return (p) => path.posix.relative(cwd, p) || ".";
return (p) => path.posix.relative(cwd, `${root}/${p}`) || ".";
}
function buildRelative(cwd, root) {
if (root.startsWith(`${cwd}/`)) {
const prefix = root.slice(cwd.length + 1);
return (p) => `${prefix}/${p}`;
}
return (p) => {
const result = path.posix.relative(cwd, `${root}/${p}`);
return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
};
}
const splitPatternOptions = { parts: true };
function splitPattern(path$1) {
var _result$parts;
const result = picomatch.default.scan(path$1, splitPatternOptions);
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
}
const ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g;
function convertPosixPathToPattern(path$2) {
return escapePosixPath(path$2);
}
function convertWin32PathToPattern(path$3) {
return escapeWin32Path(path$3).replace(ESCAPED_WIN32_BACKSLASHES, "/");
}
/**
* Converts a path to a pattern depending on the platform.
* Identical to {@link escapePath} on POSIX systems.
* @see {@link https://superchupu.dev/tinyglobby/documentation#convertPathToPattern}
*/
/* node:coverage ignore next 3 */
const convertPathToPattern = isWin ? convertWin32PathToPattern : convertPosixPathToPattern;
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
const escapePosixPath = (path$4) => path$4.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
const escapeWin32Path = (path$5) => path$5.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
/**
* Escapes a path's special characters depending on the platform.
* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
*/
/* node:coverage ignore next */
const escapePath = isWin ? escapeWin32Path : escapePosixPath;
/**
* Checks if a pattern has dynamic parts.
*
* Has a few minor differences with [`fast-glob`](https://github.com/mrmlnc/fast-glob) for better accuracy:
*
* - Doesn't necessarily return `false` on patterns that include `\`.
* - Returns `true` if the pattern includes parentheses, regardless of them representing one single pattern or not.
* - Returns `true` for unfinished glob extensions i.e. `(h`, `+(h`.
* - Returns `true` for unfinished brace expansions as long as they include `,` or `..`.
*
* @see {@link https://superchupu.dev/tinyglobby/documentation#isDynamicPattern}
*/
function isDynamicPattern(pattern, options) {
if ((options === null || options === void 0 ? void 0 : options.caseSensitiveMatch) === false) return true;
const scan = picomatch.default.scan(pattern);
return scan.isGlob || scan.negated;
}
function log(...tasks) {
console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
}
function ensureStringArray(value) {
return typeof value === "string" ? [value] : value !== null && value !== void 0 ? value : [];
}
//#endregion
//#region src/patterns.ts
const PARENT_DIRECTORY = /^(\/?\.\.)+/;
const ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
function normalizePattern(pattern, opts, props, isIgnore) {
var _PARENT_DIRECTORY$exe;
const cwd = opts.cwd;
let result = pattern;
if (pattern[pattern.length - 1] === "/") result = pattern.slice(0, -1);
if (result[result.length - 1] !== "*" && opts.expandDirectories) result += "/**";
const escapedCwd = escapePath(cwd);
result = (0, path.isAbsolute)(result.replace(ESCAPING_BACKSLASHES, "")) ? path.posix.relative(escapedCwd, result) : path.posix.normalize(result);
const parentDir = (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result)) === null || _PARENT_DIRECTORY$exe === void 0 ? void 0 : _PARENT_DIRECTORY$exe[0];
const parts = splitPattern(result);
if (parentDir) {
const n = (parentDir.length + 1) / 3;
let i = 0;
const cwdParts = escapedCwd.split("/");
while (i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]) {
result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".";
i++;
}
const potentialRoot = path.posix.join(cwd, parentDir.slice(i * 3));
if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
props.root = potentialRoot;
props.depthOffset = -n + i;
}
}
if (!isIgnore && props.depthOffset >= 0) {
var _props$commonPath;
(_props$commonPath = props.commonPath) !== null && _props$commonPath !== void 0 || (props.commonPath = parts);
const newCommonPath = [];
const length = Math.min(props.commonPath.length, parts.length);
for (let i = 0; i < length; i++) {
const part = parts[i];
if (part === "**" && !parts[i + 1]) {
newCommonPath.pop();
break;
}
if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part)) break;
newCommonPath.push(part);
}
props.depthOffset = newCommonPath.length;
props.commonPath = newCommonPath;
props.root = newCommonPath.length > 0 ? path.posix.join(cwd, ...newCommonPath) : cwd;
}
return result;
}
function processPatterns(options, patterns, props) {
const matchPatterns = [];
const ignorePatterns = [];
for (const pattern of options.ignore) {
if (!pattern) continue;
if (pattern[0] !== "!" || pattern[1] === "(") ignorePatterns.push(normalizePattern(pattern, options, props, true));
}
for (const pattern of patterns) {
if (!pattern) continue;
if (pattern[0] !== "!" || pattern[1] === "(") matchPatterns.push(normalizePattern(pattern, options, props, false));
else if (pattern[1] !== "!" || pattern[2] === "(") ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, true));
}
return {
match: matchPatterns,
ignore: ignorePatterns
};
}
//#endregion
//#region src/crawler.ts
function buildCrawler(options, patterns) {
const cwd = options.cwd;
const props = {
root: cwd,
depthOffset: 0
};
const processed = processPatterns(options, patterns, props);
if (options.debug) log("internal processing patterns:", processed);
const { absolute, caseSensitiveMatch, debug, dot, followSymbolicLinks, onlyDirectories } = options;
const root = props.root.replace(BACKSLASHES, "");
const matchOptions = {
dot,
nobrace: options.braceExpansion === false,
nocase: !caseSensitiveMatch,
noextglob: options.extglob === false,
noglobstar: options.globstar === false,
posix: true
};
const matcher = (0, picomatch.default)(processed.match, matchOptions);
const ignore = (0, picomatch.default)(processed.ignore, matchOptions);
const partialMatcher = getPartialMatcher(processed.match, matchOptions);
const format = buildFormat(cwd, root, absolute);
const excludeFormatter = absolute ? format : buildFormat(cwd, root, true);
const excludePredicate = (_, p) => {
const relativePath = excludeFormatter(p, true);
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
};
let maxDepth;
if (options.deep !== void 0) maxDepth = Math.round(options.deep - props.depthOffset);
const crawler = new fdir.fdir({
filters: [debug ? (p, isDirectory) => {
const path = format(p, isDirectory);
const matches = matcher(path) && !ignore(path);
if (matches) log(`matched ${path}`);
return matches;
} : (p, isDirectory) => {
const path = format(p, isDirectory);
return matcher(path) && !ignore(path);
}],
exclude: debug ? (_, p) => {
const skipped = excludePredicate(_, p);
log(`${skipped ? "skipped" : "crawling"} ${p}`);
return skipped;
} : excludePredicate,
fs: options.fs,
pathSeparator: "/",
relativePaths: !absolute,
resolvePaths: absolute,
includeBasePath: absolute,
resolveSymlinks: followSymbolicLinks,
excludeSymlinks: !followSymbolicLinks,
excludeFiles: onlyDirectories,
includeDirs: onlyDirectories || !options.onlyFiles,
maxDepth,
signal: options.signal
}).crawl(root);
if (options.debug) log("internal properties:", {
...props,
root
});
return [crawler, cwd !== root && !absolute && buildRelative(cwd, root)];
}
//#endregion
//#region src/index.ts
function formatPaths(paths, mapper) {
if (mapper) for (let i = paths.length - 1; i >= 0; i--) paths[i] = mapper(paths[i]);
return paths;
}
const defaultOptions = {
caseSensitiveMatch: true,
cwd: process.cwd(),
debug: !!process.env.TINYGLOBBY_DEBUG,
expandDirectories: true,
followSymbolicLinks: true,
onlyFiles: true
};
function getOptions(options) {
const opts = {
...defaultOptions,
...options
};
opts.cwd = (opts.cwd instanceof URL ? (0, url.fileURLToPath)(opts.cwd) : (0, path.resolve)(opts.cwd)).replace(BACKSLASHES, "/");
opts.ignore = ensureStringArray(opts.ignore);
opts.fs && (opts.fs = {
readdir: opts.fs.readdir || fs.readdir,
readdirSync: opts.fs.readdirSync || fs.readdirSync,
realpath: opts.fs.realpath || fs.realpath,
realpathSync: opts.fs.realpathSync || fs.realpathSync,
stat: opts.fs.stat || fs.stat,
statSync: opts.fs.statSync || fs.statSync
});
if (opts.debug) log("globbing with options:", opts);
return opts;
}
function getCrawler(globInput, inputOptions = {}) {
var _ref;
if (globInput && (inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
const isModern = isReadonlyArray(globInput) || typeof globInput === "string";
const patterns = ensureStringArray((_ref = isModern ? globInput : globInput.patterns) !== null && _ref !== void 0 ? _ref : "**/*");
const options = getOptions(isModern ? inputOptions : globInput);
return patterns.length > 0 ? buildCrawler(options, patterns) : [];
}
async function glob(globInput, options) {
const [crawler, relative] = getCrawler(globInput, options);
return crawler ? formatPaths(await crawler.withPromise(), relative) : [];
}
function globSync(globInput, options) {
const [crawler, relative] = getCrawler(globInput, options);
return crawler ? formatPaths(crawler.sync(), relative) : [];
}
//#endregion
exports.convertPathToPattern = convertPathToPattern;
exports.escapePath = escapePath;
exports.glob = glob;
exports.globSync = globSync;
exports.isDynamicPattern = isDynamicPattern;
@@ -0,0 +1,25 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const UserRoundCog = createLucideIcon("UserRoundCog", [
["path", { d: "M2 21a8 8 0 0 1 10.434-7.62", key: "1yezr2" }],
["circle", { cx: "10", cy: "8", r: "5", key: "o932ke" }],
["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
["path", { d: "m19.5 14.3-.4.9", key: "1eb35c" }],
["path", { d: "m16.9 20.8-.4.9", key: "dfjc4z" }],
["path", { d: "m21.7 19.5-.9-.4", key: "q4dx6b" }],
["path", { d: "m15.2 16.9-.9-.4", key: "1r0w5f" }],
["path", { d: "m21.7 16.5-.9.4", key: "1knoei" }],
["path", { d: "m15.2 19.1-.9.4", key: "j188fs" }],
["path", { d: "m19.5 21.7-.4-.9", key: "1tonu5" }],
["path", { d: "m16.9 15.2-.4-.9", key: "699xu" }]
]);
export { UserRoundCog as default };
//# sourceMappingURL=user-round-cog.js.map