docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run

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,749 @@
'use strict'
const assert = require('node:assert')
const net = require('node:net')
const http = require('node:http')
const util = require('../core/util.js')
const { ClientStats } = require('../util/stats.js')
const { channels } = require('../core/diagnostics.js')
const Request = require('../core/request.js')
const DispatcherBase = require('./dispatcher-base')
const {
InvalidArgumentError,
InformationalError,
ClientDestroyedError
} = require('../core/errors.js')
const buildConnector = require('../core/connect.js')
const {
kUrl,
kServerName,
kClient,
kBusy,
kConnect,
kResuming,
kRunning,
kPending,
kSize,
kQueue,
kConnected,
kConnecting,
kNeedDrain,
kKeepAliveDefaultTimeout,
kHostHeader,
kPendingIdx,
kRunningIdx,
kError,
kPipelining,
kKeepAliveTimeoutValue,
kMaxHeadersSize,
kKeepAliveMaxTimeout,
kKeepAliveTimeoutThreshold,
kHeadersTimeout,
kBodyTimeout,
kStrictContentLength,
kConnector,
kMaxRequests,
kCounter,
kClose,
kDestroy,
kDispatch,
kLocalAddress,
kMaxResponseSize,
kOnError,
kHTTPContext,
kMaxConcurrentStreams,
kHostAuthority,
kResume,
kHTTP2Options,
kUseMilo
} = require('../core/symbols.js')
const connectH1 = require('./client-h1.js')
const connectH2 = require('./client-h2.js')
const kClosedResolve = Symbol('kClosedResolve')
const getDefaultNodeMaxHeaderSize = http &&
http.maxHeaderSize &&
Number.isInteger(http.maxHeaderSize) &&
http.maxHeaderSize > 0
? () => http.maxHeaderSize
: () => { throw new InvalidArgumentError('http module not available or http.maxHeaderSize invalid') }
const noop = () => { }
function getPipelining (client) {
return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1
}
let h2NamespaceOptsWarning = false
function emitH2OptionsNamespaceWarning (optName) {
if (h2NamespaceOptsWarning === true) return
process.emitWarning(`Use h2Options.${optName} instead. ${optName} for H2 will be deprecated in future major.`, {
code: 'UNDICI-H2-OPTIONS'
})
h2NamespaceOptsWarning = true
}
// Protocol-aware dispatch ceiling. h1 RFC7230 pipelining is unrelated to h2
// stream multiplexing — over h2 the ceiling is the (server-confirmed)
// maxConcurrentStreams. Before a context is attached we use the h1
// pipelining factor; once h2 attaches the queued requests can drain in
// one batch up to maxConcurrentStreams.
function getMaxConcurrent (client) {
if (client[kHTTPContext]?.version === 'h2') {
return client[kMaxConcurrentStreams]
}
return getPipelining(client)
}
/**
* @type {import('../../types/client.js').default}
*/
class Client extends DispatcherBase {
/**
*
* @param {string|URL} url
* @param {import('../../types/client.js').Client.Options} options
*/
constructor (url, {
maxHeaderSize,
headersTimeout,
socketTimeout,
requestTimeout,
connectTimeout,
bodyTimeout,
idleTimeout,
keepAlive,
keepAliveTimeout,
maxKeepAliveTimeout,
keepAliveMaxTimeout,
keepAliveTimeoutThreshold,
socketPath,
pipelining,
tls,
strictContentLength,
maxCachedSessions,
connect,
maxRequestsPerClient,
localAddress,
maxResponseSize,
autoSelectFamily,
autoSelectFamilyAttemptTimeout,
// h2
maxConcurrentStreams,
allowH2,
useH2c,
initialWindowSize,
connectionWindowSize,
pingInterval,
useMilo,
webSocket,
h2Options,
eventSource
} = {}) {
if (keepAlive !== undefined) {
throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
}
if (socketTimeout !== undefined) {
throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
}
if (requestTimeout !== undefined) {
throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
}
if (idleTimeout !== undefined) {
throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
}
if (maxKeepAliveTimeout !== undefined) {
throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
}
if (maxHeaderSize != null) {
if (!Number.isInteger(maxHeaderSize) || maxHeaderSize < 1) {
throw new InvalidArgumentError('invalid maxHeaderSize')
}
} else {
// If maxHeaderSize is not provided, use the default value from the http module
// or if that is not available, throw an error.
maxHeaderSize = getDefaultNodeMaxHeaderSize()
}
if (socketPath != null && typeof socketPath !== 'string') {
throw new InvalidArgumentError('invalid socketPath')
}
if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
throw new InvalidArgumentError('invalid connectTimeout')
}
if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
throw new InvalidArgumentError('invalid keepAliveTimeout')
}
if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
}
if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
}
if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
}
if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
}
if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
throw new InvalidArgumentError('connect must be a function or an object')
}
if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
}
if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
throw new InvalidArgumentError('localAddress must be valid string IP address')
}
if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
throw new InvalidArgumentError('maxResponseSize must be a positive number')
}
if (
autoSelectFamilyAttemptTimeout != null &&
(!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
) {
throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
}
// h2
if (allowH2 != null && typeof allowH2 !== 'boolean') {
throw new InvalidArgumentError('allowH2 must be a valid boolean value')
}
// We validate only if allowH2 is enabled or null (enabled by default)
if (allowH2 !== false) {
// Prioritise new h2Options object, otherwise fallback to prior configuration options
if (h2Options != null) {
if (h2Options.useH2c != null && typeof h2Options.useH2c !== 'boolean') {
throw new InvalidArgumentError('h2Options.useH2c must be a valid boolean value')
}
if (h2Options.settings?.initialWindowSize != null && (!Number.isInteger(h2Options.settings.initialWindowSize) || h2Options.settings.initialWindowSize < 1)) {
throw new InvalidArgumentError('h2Options.settings.initialWindowSize must be a positive integer, greater than 0')
}
if (h2Options.maxConcurrentStreams != null && (!Number.isInteger(h2Options.maxConcurrentStreams) || h2Options.maxConcurrentStreams < 1)) {
throw new InvalidArgumentError('h2Options.maxConcurrentStreams must be a positive integer, greater than 0')
}
if (h2Options.connectionWindowSize != null && (!Number.isInteger(h2Options.connectionWindowSize) || h2Options.connectionWindowSize < 1)) {
throw new InvalidArgumentError('h2Options.connectionWindowSize must be a positive integer, greater than 0')
}
if (h2Options.pingInterval != null && (typeof h2Options.pingInterval !== 'number' || !Number.isInteger(h2Options.pingInterval) || h2Options.pingInterval < 0)) {
throw new InvalidArgumentError('h2Options.pingInterval must be a positive integer, greater or equal to 0')
}
} else {
if (useH2c != null && typeof useH2c !== 'boolean') {
emitH2OptionsNamespaceWarning('useH2c')
throw new InvalidArgumentError('useH2c must be a valid boolean value')
}
if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
emitH2OptionsNamespaceWarning('maxConcurrentStreams')
throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')
}
if (initialWindowSize != null && (!Number.isInteger(initialWindowSize) || initialWindowSize < 1)) {
emitH2OptionsNamespaceWarning('initialWindowSize')
throw new InvalidArgumentError('initialWindowSize must be a positive integer, greater than 0')
}
if (connectionWindowSize != null && (!Number.isInteger(connectionWindowSize) || connectionWindowSize < 1)) {
emitH2OptionsNamespaceWarning('connectionWindowSize')
throw new InvalidArgumentError('connectionWindowSize must be a positive integer, greater than 0')
}
if (pingInterval != null && (typeof pingInterval !== 'number' || !Number.isInteger(pingInterval) || pingInterval < 0)) {
emitH2OptionsNamespaceWarning('pingInterval')
throw new InvalidArgumentError('pingInterval must be a positive integer, greater or equal to 0')
}
}
}
super({ webSocket, eventSource })
if (typeof connect !== 'function') {
connect = buildConnector({
...tls,
maxCachedSessions,
allowH2,
socketPath,
useH2c: h2Options?.useH2c ?? useH2c,
timeout: connectTimeout,
...(typeof autoSelectFamily === 'boolean' ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
...connect
})
} else {
const customConnect = connect
connect = (opts, callback) => customConnect({
...opts,
...(socketPath != null ? { socketPath } : null),
...(allowH2 != null ? { allowH2 } : null)
}, callback)
}
this[kUrl] = util.parseOrigin(url)
this[kHostAuthority] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
this[kConnector] = connect
this[kPipelining] = pipelining != null ? pipelining : 1
this[kMaxHeadersSize] = maxHeaderSize
this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold
this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
this[kServerName] = null
this[kLocalAddress] = localAddress != null ? localAddress : null
this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
this[kHostHeader] = `host: ${this[kHostAuthority]}\r\n`
this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
this[kMaxRequests] = maxRequestsPerClient
this[kClosedResolve] = null
this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
this[kHTTPContext] = null
// h2
this[kHTTP2Options] = {
pingInterval: h2Options?.pingInterval ?? pingInterval ?? 60e3,
connectionWindowSize: h2Options?.connectionWindowSize ?? connectionWindowSize ?? 524288,
maxConcurrentStreams: h2Options?.maxConcurrentStreams ?? maxConcurrentStreams ?? 100, // Max peerConcurrentStreams for a Node h2 server
sessionOptions: {
// HTTP/2 window sizes are set to higher defaults than Node.js core for better performance:
// - initialWindowSize: 262144 (256KB) vs Node.js default 65535 (64KB - 1)
// Allows more data to be sent before requiring acknowledgment, improving throughput
// especially on high-latency networks. This matches common production HTTP/2 servers.
// - connectionWindowSize: 524288 (512KB) vs Node.js default (none set)
// Provides better flow control for the entire connection across multiple streams.
initialWindowSize: h2Options?.initialWindowSize ?? initialWindowSize ?? 262144
}
}
this[kUseMilo] = useMilo
// kQueue is built up of 3 sections separated by
// the kRunningIdx and kPendingIdx indices.
// | complete | running | pending |
// ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
// kRunningIdx points to the first running element.
// kPendingIdx points to the first pending element.
// This implements a fast queue with an amortized
// time of O(1).
this[kQueue] = []
this[kRunningIdx] = 0
this[kPendingIdx] = 0
this[kResume] = (sync) => resume(this, sync)
this[kOnError] = (err) => onError(this, err)
}
get pipelining () {
return this[kPipelining]
}
set pipelining (value) {
this[kPipelining] = value
this[kResume](true)
}
get stats () {
return new ClientStats(this)
}
get [kPending] () {
return this[kQueue].length - this[kPendingIdx]
}
get [kRunning] () {
return this[kPendingIdx] - this[kRunningIdx]
}
get [kSize] () {
return this[kQueue].length - this[kRunningIdx]
}
get [kConnected] () {
return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed
}
get [kBusy] () {
// The `kPending > 0` check below is the gate Pool uses to decide whether
// to spin up an additional Client. For h1 that fan-out is correct —
// each socket only handles one pipelined request at a time. Once an h2
// context is attached we want concurrent dispatches to multiplex onto
// the shared session, so suppress that signal in the h2 case.
const allowsMux = this[kHTTPContext]?.version === 'h2'
return Boolean(
this[kHTTPContext]?.busy(null) ||
(this[kSize] >= (getMaxConcurrent(this) || 1)) ||
(this[kPending] > 0 && !allowsMux)
)
}
[kConnect] (cb) {
connect(this)
this.once('connect', cb)
}
[kDispatch] (opts, handler) {
const request = new Request(this[kUrl].origin, opts, handler)
this[kQueue].push(request)
if (this[kResuming]) {
// Do nothing.
} else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
// Wait a tick in case stream/iterator is ended in the same tick.
this[kResuming] = 1
queueMicrotask(() => resume(this))
} else {
this[kResume](true)
}
if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
this[kNeedDrain] = 2
}
return this[kNeedDrain] < 2
}
[kClose] () {
// TODO: for H2 we need to gracefully flush the remaining enqueued
// request and close each stream.
return new Promise((resolve) => {
if (this[kSize]) {
this[kClosedResolve] = resolve
} else {
resolve(null)
}
})
}
[kDestroy] (err) {
return new Promise((resolve) => {
const requests = this[kQueue].splice(this[kPendingIdx])
for (let i = 0; i < requests.length; i++) {
const request = requests[i]
if (request != null) {
util.errorRequest(this, request, err)
}
}
const callback = () => {
if (this[kClosedResolve]) {
// TODO (fix): Should we error here with ClientDestroyedError?
this[kClosedResolve]()
this[kClosedResolve] = null
}
resolve(null)
}
if (this[kHTTPContext]) {
this[kHTTPContext].destroy(err, callback)
this[kHTTPContext] = null
} else {
queueMicrotask(callback)
}
this[kResume]()
})
}
}
function onError (client, err) {
if (
client[kRunning] === 0 &&
err.code !== 'UND_ERR_INFO' &&
err.code !== 'UND_ERR_SOCKET'
) {
// Error is not caused by running request and not a recoverable
// socket error.
assert(client[kPendingIdx] === client[kRunningIdx])
const requests = client[kQueue].splice(client[kRunningIdx])
for (let i = 0; i < requests.length; i++) {
const request = requests[i]
if (request != null) {
util.errorRequest(client, request, err)
}
}
assert(client[kSize] === 0)
}
}
/**
* @param {Client} client
* @returns {void}
*/
function connect (client) {
assert(!client[kConnecting])
assert(!client[kHTTPContext])
let { host, hostname, protocol, port } = client[kUrl]
// Resolve ipv6
if (hostname[0] === '[') {
const idx = hostname.indexOf(']')
assert(idx !== -1)
const ip = hostname.substring(1, idx)
assert(net.isIPv6(ip))
hostname = ip
}
client[kConnecting] = true
if (channels.beforeConnect.hasSubscribers) {
channels.beforeConnect.publish({
connectParams: {
host,
hostname,
protocol,
port,
version: client[kHTTPContext]?.version,
servername: client[kServerName],
localAddress: client[kLocalAddress]
},
connector: client[kConnector]
})
}
try {
client[kConnector]({
host,
hostname,
protocol,
port,
servername: client[kServerName],
localAddress: client[kLocalAddress]
}, (err, socket) => {
if (err) {
handleConnectError(client, err, { host, hostname, protocol, port })
client[kResume]()
return
}
if (client.destroyed) {
util.destroy(socket.on('error', noop), new ClientDestroyedError())
client[kResume]()
return
}
assert(socket)
try {
client[kHTTPContext] = socket.alpnProtocol === 'h2'
? connectH2(client, socket)
: connectH1(client, socket)
} catch (err) {
socket.destroy().on('error', noop)
handleConnectError(client, err, { host, hostname, protocol, port })
client[kResume]()
return
}
client[kConnecting] = false
socket[kCounter] = 0
socket[kMaxRequests] = client[kMaxRequests]
socket[kClient] = client
socket[kError] = null
if (channels.connected.hasSubscribers) {
channels.connected.publish({
connectParams: {
host,
hostname,
protocol,
port,
version: client[kHTTPContext]?.version,
servername: client[kServerName],
localAddress: client[kLocalAddress]
},
connector: client[kConnector],
socket
})
}
client.emit('connect', client[kUrl], [client])
client[kResume]()
})
} catch (err) {
handleConnectError(client, err, { host, hostname, protocol, port })
client[kResume]()
}
}
function handleConnectError (client, err, { host, hostname, protocol, port }) {
if (client.destroyed) {
return
}
client[kConnecting] = false
if (channels.connectError.hasSubscribers) {
channels.connectError.publish({
connectParams: {
host,
hostname,
protocol,
port,
version: client[kHTTPContext]?.version,
servername: client[kServerName],
localAddress: client[kLocalAddress]
},
connector: client[kConnector],
error: err
})
}
if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
const running = client[kQueue].splice(client[kRunningIdx], client[kRunning])
client[kPendingIdx] = client[kRunningIdx]
for (let i = 0; i < running.length; i++) {
util.errorRequest(client, running[i], err)
}
while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
const request = client[kQueue].splice(client[kPendingIdx], 1)[0]
util.errorRequest(client, request, err)
}
} else {
onError(client, err)
}
client.emit('connectionError', client[kUrl], [client], err)
}
function emitDrain (client) {
client[kNeedDrain] = 0
client.emit('drain', client[kUrl], [client])
}
function resume (client, sync) {
if (client[kResuming] === 2) {
return
}
client[kResuming] = 2
_resume(client, sync)
client[kResuming] = 0
if (client[kRunningIdx] > 256) {
client[kQueue].splice(0, client[kRunningIdx])
client[kPendingIdx] -= client[kRunningIdx]
client[kRunningIdx] = 0
}
}
function _resume (client, sync) {
while (true) {
if (client.destroyed) {
assert(client[kPending] === 0)
return
}
if (client[kClosedResolve] && !client[kSize]) {
client[kClosedResolve]()
client[kClosedResolve] = null
return
}
if (client[kHTTPContext]) {
client[kHTTPContext].resume()
}
if (client[kBusy]) {
client[kNeedDrain] = 2
} else if (client[kNeedDrain] === 2) {
if (sync) {
client[kNeedDrain] = 1
queueMicrotask(() => emitDrain(client))
} else {
emitDrain(client)
}
continue
}
if (client[kPending] === 0) {
return
}
if (client[kRunning] >= (getMaxConcurrent(client) || 1)) {
return
}
const request = client[kQueue][client[kPendingIdx]]
if (request === null) {
return
}
if (request.aborted) {
client[kQueue].splice(client[kPendingIdx], 1)
continue
}
if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
if (client[kRunning] > 0) {
return
}
client[kServerName] = request.servername
client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {
client[kHTTPContext] = null
resume(client)
})
}
if (client[kConnecting]) {
return
}
if (!client[kHTTPContext]) {
client[kServerName] = request.servername
connect(client)
return
}
if (client[kHTTPContext].destroyed) {
return
}
if (client[kHTTPContext].busy(request)) {
return
}
if (!request.aborted && client[kHTTPContext].write(request)) {
client[kPendingIdx]++
} else {
client[kQueue].splice(client[kPendingIdx], 1)
}
}
}
module.exports = Client
@@ -0,0 +1 @@
{"version":3,"file":"make-command.d.ts","sourceRoot":"","sources":["../../src/make-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,8BAA8B,EAC9B,gCAAgC,EAChC,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,+BAA+B,EAChC,MAAM,cAAc,CAAA;AASrB,MAAM,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,KAAK,OAAO,CAAA;AAExC,MAAM,MAAM,UAAU,CAAC,UAAU,EAAE,SAAS,SAAS;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,IAAI;IAErE,IAAI,UAAU,CAAA;IACd,CAAC,GAAG,EAAE,gCAAgC,GAAG,UAAU,CAAA;IACnD,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;IAC/B,CAAC,GAAG,EAAE,gCAAgC,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;CACvE,GAAG;IAEF,CAAC,GAAG,EAAE,+BAA+B,GAAG,SAAS,CAAA;IACjD,CAAC,GAAG,EAAE,+BAA+B,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CACrE,GAAG;IAEF,CAAC,GAAG,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpD,CAAC,GAAG,EAAE,8BAA8B,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvE,CAAC,GAAG,EAAE,8BAA8B,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D,CACE,GAAG,EAAE,8BAA8B,EACnC,OAAO,EAAE,MAAM,EAAE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B,EAAE,CAAC,EAAE,EAAE,KACJ,OAAO,CAAC,IAAI,CAAC,EAClB,YAAY,CAAC,GAAG,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EACvE,aAAa,CACX,GAAG,EAAE,qBAAqB,EAC1B,OAAO,EAAE,MAAM,EAAE,KACd,UAAU,EACf,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,KACvD,UAAU,CAAC,UAAU,EAAE,SAAS,CA2DlC,CAAA"}
@@ -0,0 +1,6 @@
'use strict';
var tempAdjacencyGraphs = {"azerty":{"0":["ç9",null,null,")°","pP","oO"],"1":["²~",null,null,"é2","aA",null],"2":["&1",null,null,"\"3","zZ","aA"],"3":["é2",null,null,"'4","eE","zZ"],"4":["\"3",null,null,"(5","rR","eE"],"5":["'4",null,null,"-6","tT","rR"],"6":["(5",null,null,"è7","yY","tT"],"7":["-6",null,null,"_8","uU","yY"],"8":["è7",null,null,"ç9","iI","uU"],"9":["_8",null,null,"à0","oO","iI"],"²":[null,null,null,"&1",null,null],"~":[null,null,null,"&1",null,null],"&":["²~",null,null,"é2","aA",null],"é":["&1",null,null,"\"3","zZ","aA"],"\"":["pP",")°","+=","$£","ù%","mM"],"'":["\"3",null,null,"(5","rR","eE"],"(":["'4",null,null,"-6","tT","rR"],"-":["(5",null,null,"è7","yY","tT"],"è":["-6",null,null,"_8","uU","yY"],"_":["è7",null,null,"ç9","iI","uU"],"ç":["_8",null,null,"à0","oO","iI"],"à":["ç9",null,null,")°","pP","oO"],")":["à0",null,null,"+=","^\"","pP"],"°":["à0",null,null,"+=","^\"","pP"],"+":[")°",null,null,null,"$£","^\""],"=":[")°",null,null,null,"$£","^\""],"a":[null,"&1","é2","zZ","qQ",null],"A":[null,"&1","é2","zZ","qQ",null],"z":["aA","é2","\"3","eE","sS","qQ"],"Z":["aA","é2","\"3","eE","sS","qQ"],"e":["zZ","\"3","'4","rR","dD","sS"],"E":["zZ","\"3","'4","rR","dD","sS"],"r":["eE","'4","(5","tT","fF","dD"],"R":["eE","'4","(5","tT","fF","dD"],"t":["rR","(5","-6","yY","gG","fF"],"T":["rR","(5","-6","yY","gG","fF"],"y":["tT","-6","è7","uU","hH","gG"],"Y":["tT","-6","è7","uU","hH","gG"],"u":["yY","è7","_8","iI","jJ","hH"],"U":["yY","è7","_8","iI","jJ","hH"],"i":["uU","_8","ç9","oO","kK","jJ"],"I":["uU","_8","ç9","oO","kK","jJ"],"o":["iI","ç9","à0","pP","lL","kK"],"O":["iI","ç9","à0","pP","lL","kK"],"p":["oO","à0",")°","^\"","mM","lL"],"P":["oO","à0",")°","^\"","mM","lL"],"^":["pP",")°","+=","$£","ù%","mM"],"$":["^\"","+=",null,null,"*µ","ù%"],"£":["^\"","+=",null,null,"*µ","ù%"],"q":[null,"aA","zZ","sS","wW","<>"],"Q":[null,"aA","zZ","sS","wW","<>"],"s":["qQ","zZ","eE","dD","xX","wW"],"S":["qQ","zZ","eE","dD","xX","wW"],"d":["sS","eE","rR","fF","cC","xX"],"D":["sS","eE","rR","fF","cC","xX"],"f":["dD","rR","tT","gG","vV","cC"],"F":["dD","rR","tT","gG","vV","cC"],"g":["fF","tT","yY","hH","bB","vV"],"G":["fF","tT","yY","hH","bB","vV"],"h":["gG","yY","uU","jJ","nN","bB"],"H":["gG","yY","uU","jJ","nN","bB"],"j":["hH","uU","iI","kK",",?","nN"],"J":["hH","uU","iI","kK",",?","nN"],"k":["jJ","iI","oO","lL",";.",",?"],"K":["jJ","iI","oO","lL",";.",",?"],"l":["kK","oO","pP","mM",":/",";."],"L":["kK","oO","pP","mM",":/",";."],"m":["lL","pP","^\"","ù%","!§",":/"],"M":["lL","pP","^\"","ù%","!§",":/"],"ù":["mM","^\"","$£","*µ",null,"!§"],"%":["mM","^\"","$£","*µ",null,"!§"],"*":["ù%","$£",null,null,null,null],"µ":["ù%","$£",null,null,null,null],"<":[null,null,"qQ","wW",null,null],">":[null,null,"qQ","wW",null,null],"w":["<>","qQ","sS","xX",null,null],"W":["<>","qQ","sS","xX",null,null],"x":["wW","sS","dD","cC",null,null],"X":["wW","sS","dD","cC",null,null],"c":["xX","dD","fF","vV",null,null],"C":["xX","dD","fF","vV",null,null],"v":["cC","fF","gG","bB",null,null],"V":["cC","fF","gG","bB",null,null],"b":["vV","gG","hH","nN",null,null],"B":["vV","gG","hH","nN",null,null],"n":["bB","hH","jJ",",?",null,null],"N":["bB","hH","jJ",",?",null,null],",":["nN","jJ","kK",";.",null,null],"?":["nN","jJ","kK",";.",null,null],";":[",?","kK","lL",":/",null,null],".":[",?","kK","lL",":/",null,null],":":[";.","lL","mM","!§",null,null],"/":[";.","lL","mM","!§",null,null],"!":[":/","mM","ù%",null,null,null],"§":[":/","mM","ù%",null,null,null]},"dvorak":{"0":["9(",null,null,"[{","lL","rR"],"1":["`~",null,null,"2@","'\"",null],"2":["1!",null,null,"3#",",<","'\""],"3":["2@",null,null,"4$",".>",",<"],"4":["3#",null,null,"5%","pP",".>"],"5":["4$",null,null,"6^","yY","pP"],"6":["5%",null,null,"7&","fF","yY"],"7":["6^",null,null,"8*","gG","fF"],"8":["7&",null,null,"9(","cC","gG"],"9":["8*",null,null,"0)","rR","cC"],"`":[null,null,null,"1!",null,null],"~":[null,null,null,"1!",null,null],"!":["`~",null,null,"2@","'\"",null],"@":["1!",null,null,"3#",",<","'\""],"#":["2@",null,null,"4$",".>",",<"],"$":["3#",null,null,"5%","pP",".>"],"%":["4$",null,null,"6^","yY","pP"],"^":["5%",null,null,"7&","fF","yY"],"&":["6^",null,null,"8*","gG","fF"],"*":["7&",null,null,"9(","cC","gG"],"(":["8*",null,null,"0)","rR","cC"],")":["9(",null,null,"[{","lL","rR"],"[":["0)",null,null,"]}","/?","lL"],"{":["0)",null,null,"]}","/?","lL"],"]":["[{",null,null,null,"=+","/?"],"}":["[{",null,null,null,"=+","/?"],"'":[null,"1!","2@",",<","aA",null],"\"":[null,"1!","2@",",<","aA",null],",":["'\"","2@","3#",".>","oO","aA"],"<":["'\"","2@","3#",".>","oO","aA"],".":[",<","3#","4$","pP","eE","oO"],">":[",<","3#","4$","pP","eE","oO"],"p":[".>","4$","5%","yY","uU","eE"],"P":[".>","4$","5%","yY","uU","eE"],"y":["pP","5%","6^","fF","iI","uU"],"Y":["pP","5%","6^","fF","iI","uU"],"f":["yY","6^","7&","gG","dD","iI"],"F":["yY","6^","7&","gG","dD","iI"],"g":["fF","7&","8*","cC","hH","dD"],"G":["fF","7&","8*",Line truncated
module.exports = tempAdjacencyGraphs;
//# sourceMappingURL=adjacencyGraphs.json.cjs.map
@@ -0,0 +1,87 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Hub", {
enumerable: true,
get: function () {
return _hub.default;
}
});
Object.defineProperty(exports, "NodePath", {
enumerable: true,
get: function () {
return _index.default;
}
});
Object.defineProperty(exports, "Scope", {
enumerable: true,
get: function () {
return _index2.default;
}
});
exports.visitors = exports.default = void 0;
require("./path/context.js");
var visitors = require("./visitors.js");
exports.visitors = visitors;
var _t = require("@babel/types");
var cache = require("./cache.js");
var _traverseNode = require("./traverse-node.js");
var _index = require("./path/index.js");
var _index2 = require("./scope/index.js");
var _hub = require("./hub.js");
const {
VISITOR_KEYS,
removeProperties,
traverseFast
} = _t;
function traverse(parent, opts = {}, scope, state, parentPath, visitSelf) {
if (!parent) return;
if (!opts.noScope && !scope) {
if (parent.type !== "Program" && parent.type !== "File") {
throw new Error("You must pass a scope and parentPath unless traversing a Program/File. " + `Instead of that you tried to traverse a ${parent.type} node without ` + "passing scope and parentPath.");
}
}
if (!parentPath && visitSelf) {
throw new Error("visitSelf can only be used when providing a NodePath.");
}
if (!VISITOR_KEYS[parent.type]) {
return;
}
visitors.explode(opts);
(0, _traverseNode.traverseNode)(parent, opts, scope, state, parentPath, undefined, visitSelf);
}
var _default = exports.default = traverse;
traverse.visitors = visitors;
traverse.verify = visitors.verify;
traverse.explode = visitors.explode;
traverse.cheap = function (node, enter) {
traverseFast(node, enter);
return;
};
traverse.node = function (node, opts, scope, state, path, skipKeys) {
(0, _traverseNode.traverseNode)(node, opts, scope, state, path, skipKeys);
};
traverse.clearNode = function (node, opts) {
removeProperties(node, opts);
};
traverse.removeProperties = function (tree, opts) {
traverseFast(tree, traverse.clearNode, opts);
return tree;
};
traverse.hasType = function (tree, type, denylistTypes) {
if (denylistTypes != null && denylistTypes.includes(tree.type)) return false;
if (tree.type === type) return true;
return traverseFast(tree, function (node) {
if (denylistTypes != null && denylistTypes.includes(node.type)) {
return traverseFast.skip;
}
if (node.type === type) {
return traverseFast.stop;
}
});
};
traverse.cache = cache;
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"useRouter.cjs","names":[],"sources":["../../src/useRouter.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { routerContext } from './routerContext'\nimport type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'\n\n/**\n * Access the current TanStack Router instance from React context.\n * Must be used within a `RouterProvider`.\n *\n * Options:\n * - `warn`: Log a warning if no router context is found (default: true).\n *\n * @returns The registered router instance.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook\n */\nexport function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {\n warn?: boolean\n}): TRouter {\n const value = React.useContext(routerContext)\n if (process.env.NODE_ENV !== 'production') {\n if ((opts?.warn ?? true) && !value) {\n console.warn(\n 'Warning: useRouter must be used inside a <RouterProvider> component!',\n )\n }\n }\n return value as any\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgB,UAAwD,MAE5D;CACV,MAAM,QAAQ,MAAM,WAAW,sBAAA,cAAc;AAC7C,KAAA,QAAA,IAAA,aAA6B;OACtB,MAAM,QAAQ,SAAS,CAAC,MAC3B,SAAQ,KACN,uEACD;;AAGL,QAAO"}
@@ -0,0 +1,17 @@
import type {Vocabulary} from "../types"
import coreVocabulary from "./core"
import validationVocabulary from "./validation"
import getApplicatorVocabulary from "./applicator"
import formatVocabulary from "./format"
import {metadataVocabulary, contentVocabulary} from "./metadata"
const draft7Vocabularies: Vocabulary[] = [
coreVocabulary,
validationVocabulary,
getApplicatorVocabulary(),
formatVocabulary,
metadataVocabulary,
contentVocabulary,
]
export default draft7Vocabularies
@@ -0,0 +1,18 @@
/**
* @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 Facebook = createLucideIcon("Facebook", [
[
"path",
{ d: "M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z", key: "1jg4f8" }
]
]);
export { Facebook as default };
//# sourceMappingURL=facebook.js.map
@@ -0,0 +1 @@
{"version":3,"file":"paperclip.js","sources":["../../../src/icons/paperclip.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Paperclip\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMuMjM0IDIwLjI1MiAyMSAxMi4zIiAvPgogIDxwYXRoIGQ9Im0xNiA2LTguNDE0IDguNTg2YTIgMiAwIDAgMCAwIDIuODI4IDIgMiAwIDAgMCAyLjgyOCAwbDguNDE0LTguNTg2YTQgNCAwIDAgMCAwLTUuNjU2IDQgNCAwIDAgMC01LjY1NiAwbC04LjQxNSA4LjU4NWE2IDYgMCAxIDAgOC40ODYgOC40ODYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/paperclip\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 Paperclip = createLucideIcon('Paperclip', [\n ['path', { d: 'M13.234 20.252 21 12.3', key: '1cbrk9' }],\n [\n 'path',\n {\n d: 'm16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486',\n key: '1pkts6',\n },\n ],\n]);\n\nexport default Paperclip;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACvD,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;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,4 @@
import { parseDef } from "../parseDef.js";
export function parseBrandedDef(_def, refs) {
return parseDef(_def.type._def, refs);
}
@@ -0,0 +1,14 @@
import * as React from 'react';
import { Primitive } from '@radix-ui/react-primitive';
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
interface PortalProps extends PrimitiveDivProps {
/**
* An optional container where the portaled content should be appended.
*/
container?: Element | DocumentFragment | null;
}
declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
declare const Root: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
export { Portal, type PortalProps, Root };
@@ -0,0 +1,23 @@
/**
* @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 Box = createLucideIcon("Box", [
[
"path",
{
d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",
key: "hh9hay"
}
],
["path", { d: "m3.3 7 8.7 5 8.7-5", key: "g66t2b" }],
["path", { d: "M12 22V12", key: "d0xqtd" }]
]);
export { Box as default };
//# sourceMappingURL=box.js.map
@@ -0,0 +1 @@
{"version":3,"file":"square-equal.js","sources":["../../../src/icons/square-equal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareEqual\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik03IDEwaDEwIiAvPgogIDxwYXRoIGQ9Ik03IDE0aDEwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/square-equal\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 SquareEqual = createLucideIcon('SquareEqual', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M7 10h10', key: '1101jm' }],\n ['path', { d: 'M7 14h10', key: '1mhdw3' }],\n]);\n\nexport default SquareEqual;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,58 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebSocketClientTransport = void 0;
const types_js_1 = require("../types.js");
const SUBPROTOCOL = 'mcp';
/**
* Client transport for WebSocket: this will connect to a server over the WebSocket protocol.
*/
class WebSocketClientTransport {
constructor(url) {
this._url = url;
}
start() {
if (this._socket) {
throw new Error('WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.');
}
return new Promise((resolve, reject) => {
this._socket = new WebSocket(this._url, SUBPROTOCOL);
this._socket.onerror = event => {
const error = 'error' in event ? event.error : new Error(`WebSocket error: ${JSON.stringify(event)}`);
reject(error);
this.onerror?.(error);
};
this._socket.onopen = () => {
resolve();
};
this._socket.onclose = () => {
this.onclose?.();
};
this._socket.onmessage = (event) => {
let message;
try {
message = types_js_1.JSONRPCMessageSchema.parse(JSON.parse(event.data));
}
catch (error) {
this.onerror?.(error);
return;
}
this.onmessage?.(message);
};
});
}
async close() {
this._socket?.close();
}
send(message) {
return new Promise((resolve, reject) => {
if (!this._socket) {
reject(new Error('Not connected'));
return;
}
this._socket?.send(JSON.stringify(message));
resolve();
});
}
}
exports.WebSocketClientTransport = WebSocketClientTransport;
//# sourceMappingURL=websocket.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_core","require","_normalizeAndLoadMetadata","toGetWrapperPayload","lazy","source","metadata","isSideEffectImport","reexportAll","includes","Array","isArray","Error","wrapReference","ref","payload","t","callExpression"],"sources":["../src/lazy-modules.ts"],"sourcesContent":["// TODO: Move `lazy` implementation logic into the CommonJS plugin, since other\n// modules systems do not support `lazy`.\n\nimport { types as t } from \"@babel/core\";\nimport {\n type SourceModuleMetadata,\n isSideEffectImport,\n} from \"./normalize-and-load-metadata.ts\";\n\nexport type Lazy = boolean | string[] | ((source: string) => boolean);\n\nexport function toGetWrapperPayload(lazy: Lazy) {\n return (source: string, metadata: SourceModuleMetadata): null | \"lazy\" => {\n if (lazy === false) return null;\n if (isSideEffectImport(metadata) || metadata.reexportAll) return null;\n if (lazy === true) {\n // 'true' means that local relative files are eagerly loaded and\n // dependency modules are loaded lazily.\n return source.includes(\".\") ? null : \"lazy\";\n }\n if (Array.isArray(lazy)) {\n return !lazy.includes(source) ? null : \"lazy\";\n }\n if (typeof lazy === \"function\") {\n return lazy(source) ? \"lazy\" : null;\n }\n throw new Error(`.lazy must be a boolean, string array, or function`);\n };\n}\n\nexport function wrapReference(\n ref: t.Identifier,\n payload: unknown,\n): t.Expression | null {\n if (payload === \"lazy\") return t.callExpression(ref, []);\n return null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AAOO,SAASE,mBAAmBA,CAACC,IAAU,EAAE;EAC9C,OAAO,CAACC,MAAc,EAAEC,QAA8B,KAAoB;IACxE,IAAIF,IAAI,KAAK,KAAK,EAAE,OAAO,IAAI;IAC/B,IAAI,IAAAG,4CAAkB,EAACD,QAAQ,CAAC,IAAIA,QAAQ,CAACE,WAAW,EAAE,OAAO,IAAI;IACrE,IAAIJ,IAAI,KAAK,IAAI,EAAE;MAGjB,OAAOC,MAAM,CAACI,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,MAAM;IAC7C;IACA,IAAIC,KAAK,CAACC,OAAO,CAACP,IAAI,CAAC,EAAE;MACvB,OAAO,CAACA,IAAI,CAACK,QAAQ,CAACJ,MAAM,CAAC,GAAG,IAAI,GAAG,MAAM;IAC/C;IACA,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;MAC9B,OAAOA,IAAI,CAACC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;IACrC;IACA,MAAM,IAAIO,KAAK,CAAC,oDAAoD,CAAC;EACvE,CAAC;AACH;AAEO,SAASC,aAAaA,CAC3BC,GAAiB,EACjBC,OAAgB,EACK;EACrB,IAAIA,OAAO,KAAK,MAAM,EAAE,OAAOC,WAAC,CAACC,cAAc,CAACH,GAAG,EAAE,EAAE,CAAC;EACxD,OAAO,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,142 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeElement = removeElement;
exports.replaceElement = replaceElement;
exports.appendChild = appendChild;
exports.append = append;
exports.prependChild = prependChild;
exports.prepend = prepend;
/**
* Remove an element from the dom
*
* @category Manipulation
* @param elem The element to be removed
*/
function removeElement(elem) {
if (elem.prev)
elem.prev.next = elem.next;
if (elem.next)
elem.next.prev = elem.prev;
if (elem.parent) {
var childs = elem.parent.children;
var childsIndex = childs.lastIndexOf(elem);
if (childsIndex >= 0) {
childs.splice(childsIndex, 1);
}
}
elem.next = null;
elem.prev = null;
elem.parent = null;
}
/**
* Replace an element in the dom
*
* @category Manipulation
* @param elem The element to be replaced
* @param replacement The element to be added
*/
function replaceElement(elem, replacement) {
var prev = (replacement.prev = elem.prev);
if (prev) {
prev.next = replacement;
}
var next = (replacement.next = elem.next);
if (next) {
next.prev = replacement;
}
var parent = (replacement.parent = elem.parent);
if (parent) {
var childs = parent.children;
childs[childs.lastIndexOf(elem)] = replacement;
elem.parent = null;
}
}
/**
* Append a child to an element.
*
* @category Manipulation
* @param parent The element to append to.
* @param child The element to be added as a child.
*/
function appendChild(parent, child) {
removeElement(child);
child.next = null;
child.parent = parent;
if (parent.children.push(child) > 1) {
var sibling = parent.children[parent.children.length - 2];
sibling.next = child;
child.prev = sibling;
}
else {
child.prev = null;
}
}
/**
* Append an element after another.
*
* @category Manipulation
* @param elem The element to append after.
* @param next The element be added.
*/
function append(elem, next) {
removeElement(next);
var parent = elem.parent;
var currNext = elem.next;
next.next = currNext;
next.prev = elem;
elem.next = next;
next.parent = parent;
if (currNext) {
currNext.prev = next;
if (parent) {
var childs = parent.children;
childs.splice(childs.lastIndexOf(currNext), 0, next);
}
}
else if (parent) {
parent.children.push(next);
}
}
/**
* Prepend a child to an element.
*
* @category Manipulation
* @param parent The element to prepend before.
* @param child The element to be added as a child.
*/
function prependChild(parent, child) {
removeElement(child);
child.parent = parent;
child.prev = null;
if (parent.children.unshift(child) !== 1) {
var sibling = parent.children[1];
sibling.prev = child;
child.next = sibling;
}
else {
child.next = null;
}
}
/**
* Prepend an element before another.
*
* @category Manipulation
* @param elem The element to prepend before.
* @param prev The element be added.
*/
function prepend(elem, prev) {
removeElement(prev);
var parent = elem.parent;
if (parent) {
var childs = parent.children;
childs.splice(childs.indexOf(elem), 0, prev);
}
if (elem.prev) {
elem.prev.next = prev;
}
prev.parent = parent;
prev.prev = elem.prev;
prev.next = elem;
elem.prev = prev;
}
//# sourceMappingURL=manipulation.js.map
@@ -0,0 +1,81 @@
/**
* @fileoverview SourceCodeVisitor class
* @author Nicholas C. Zakas
*/
"use strict";
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const emptyArray = Object.freeze([]);
//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------
/**
* A structure to hold a list of functions to call for a given name.
* This is used to allow multiple rules to register functions for a given name
* without having to know about each other.
*/
class SourceCodeVisitor {
/**
* The functions to call for a given name.
* @type {Map<string, Function[]>}
*/
#functions = new Map();
/**
* Adds a function to the list of functions to call for a given name.
* @param {string} name The name of the function to call.
* @param {Function} func The function to call.
* @returns {void}
*/
add(name, func) {
if (this.#functions.has(name)) {
this.#functions.get(name).push(func);
} else {
this.#functions.set(name, [func]);
}
}
/**
* Gets the list of functions to call for a given name.
* @param {string} name The name of the function to call.
* @returns {Function[]} The list of functions to call.
*/
get(name) {
if (this.#functions.has(name)) {
return this.#functions.get(name);
}
return emptyArray;
}
/**
* Iterates over all names and calls the callback with the name.
* @param {(name:string) => void} callback The callback to call for each name.
* @returns {void}
*/
forEachName(callback) {
this.#functions.forEach((funcs, name) => {
callback(name);
});
}
/**
* Calls the functions for a given name with the given arguments.
* @param {string} name The name of the function to call.
* @param {any[]} args The arguments to pass to the function.
* @returns {void}
*/
callSync(name, ...args) {
if (this.#functions.has(name)) {
this.#functions.get(name).forEach(func => func(...args));
}
}
}
module.exports = { SourceCodeVisitor };
@@ -0,0 +1 @@
{"version":3,"names":["_gensync","data","require","_index","_index2","_normalizeOpts","_rewriteStackTrace","parseRunner","gensync","parse","code","opts","config","loadConfig","parser","passes","normalizeOptions","exports","callback","undefined","beginHiddenCallStack","sync","errback","parseSync","args","parseAsync","async"],"sources":["../src/parse.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\n\nimport loadConfig, { type InputOptions } from \"./config/index.ts\";\nimport parser, { type ParseResult } from \"./parser/index.ts\";\nimport normalizeOptions from \"./transformation/normalize-opts.ts\";\n\nimport { beginHiddenCallStack } from \"./errors/rewrite-stack-trace.ts\";\n\ntype FileParseCallback = {\n (err: Error, ast: null): void;\n (err: null, ast: ParseResult | null): void;\n};\n\ntype Parse = {\n (code: string, callback: FileParseCallback): void;\n (\n code: string,\n opts: InputOptions | undefined | null,\n callback: FileParseCallback,\n ): void;\n (code: string, opts?: InputOptions | null): ParseResult | null;\n};\n\nconst parseRunner = gensync(function* parse(\n code: string,\n opts: InputOptions | undefined | null,\n): Handler<ParseResult | null> {\n const config = yield* loadConfig(opts);\n\n if (config === null) {\n return null;\n }\n\n return yield* parser(config.passes, normalizeOptions(config), code);\n});\n\nexport const parse: Parse = function parse(\n code,\n opts?,\n callback?: FileParseCallback,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined as InputOptions;\n }\n\n if (callback === undefined) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'parse' function expects a callback. If you need to call it synchronously, please use 'parseSync'.\",\n );\n } else {\n // console.warn(\n // \"Starting from Babel 8.0.0, the 'parse' function will expect a callback. If you need to call it synchronously, please use 'parseSync'.\",\n // );\n return beginHiddenCallStack(parseRunner.sync)(code, opts);\n }\n }\n\n beginHiddenCallStack(parseRunner.errback)(code, opts, callback);\n};\n\nexport function parseSync(...args: Parameters<typeof parseRunner.sync>) {\n return beginHiddenCallStack(parseRunner.sync)(...args);\n}\nexport function parseAsync(...args: Parameters<typeof parseRunner.async>) {\n return beginHiddenCallStack(parseRunner.async)(...args);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,kBAAA,GAAAJ,OAAA;AAiBA,MAAMK,WAAW,GAAGC,SAAMA,CAAC,CAAC,UAAUC,KAAKA,CACzCC,IAAY,EACZC,IAAqC,EACR;EAC7B,MAAMC,MAAM,GAAG,OAAO,IAAAC,cAAU,EAACF,IAAI,CAAC;EAEtC,IAAIC,MAAM,KAAK,IAAI,EAAE;IACnB,OAAO,IAAI;EACb;EAEA,OAAO,OAAO,IAAAE,eAAM,EAACF,MAAM,CAACG,MAAM,EAAE,IAAAC,sBAAgB,EAACJ,MAAM,CAAC,EAAEF,IAAI,CAAC;AACrE,CAAC,CAAC;AAEK,MAAMD,KAAY,GAAAQ,OAAA,CAAAR,KAAA,GAAG,SAASA,KAAKA,CACxCC,IAAI,EACJC,IAAK,EACLO,QAA4B,EAC5B;EACA,IAAI,OAAOP,IAAI,KAAK,UAAU,EAAE;IAC9BO,QAAQ,GAAGP,IAAI;IACfA,IAAI,GAAGQ,SAAyB;EAClC;EAEA,IAAID,QAAQ,KAAKC,SAAS,EAAE;IASxB,OAAO,IAAAC,uCAAoB,EAACb,WAAW,CAACc,IAAI,CAAC,CAACX,IAAI,EAAEC,IAAI,CAAC;EAE7D;EAEA,IAAAS,uCAAoB,EAACb,WAAW,CAACe,OAAO,CAAC,CAACZ,IAAI,EAAEC,IAAI,EAAEO,QAAQ,CAAC;AACjE,CAAC;AAEM,SAASK,SAASA,CAAC,GAAGC,IAAyC,EAAE;EACtE,OAAO,IAAAJ,uCAAoB,EAACb,WAAW,CAACc,IAAI,CAAC,CAAC,GAAGG,IAAI,CAAC;AACxD;AACO,SAASC,UAAUA,CAAC,GAAGD,IAA0C,EAAE;EACxE,OAAO,IAAAJ,uCAAoB,EAACb,WAAW,CAACmB,KAAK,CAAC,CAAC,GAAGF,IAAI,CAAC;AACzD;AAAC","ignoreList":[]}
@@ -0,0 +1,108 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.parse = parse;
var _HermesParserDeserializer = _interopRequireDefault(require("./HermesParserDeserializer"));
var _HermesParserWASM = _interopRequireDefault(require("./HermesParserWASM"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
let HermesParserWASM;
let hermesParse;
let hermesParseResult_free;
let hermesParseResult_getError;
let hermesParseResult_getErrorLine;
let hermesParseResult_getErrorColumn;
let hermesParseResult_getProgramBuffer;
let hermesParseResult_getPositionBuffer;
let hermesParseResult_getPositionBufferSize;
/**
* Init the WASM wrapper code generated by `emscripten` to preparse the
* HermesParser WASM code.
*/
function initHermesParserWASM() {
if (HermesParserWASM != null) {
return;
}
HermesParserWASM = (0, _HermesParserWASM.default)({
/**
* The emscripten version of `quit` unconditionally assigns the `status` to
* `process.exitCode` which overrides any pre-existing code that has been
* set, even if it is non zero. For our use case we never want an
* `exitCode` to be set so this override removes that functionality.
*/
quit(_status, toThrow) {
throw toThrow;
}
});
hermesParse = HermesParserWASM.cwrap('hermesParse', 'number', ['number', 'number', 'number', 'number', 'number', 'number']);
hermesParseResult_free = HermesParserWASM.cwrap('hermesParseResult_free', 'void', ['number']);
hermesParseResult_getError = HermesParserWASM.cwrap('hermesParseResult_getError', 'string', ['number']);
hermesParseResult_getErrorLine = HermesParserWASM.cwrap('hermesParseResult_getErrorLine', 'number', ['number']);
hermesParseResult_getErrorColumn = HermesParserWASM.cwrap('hermesParseResult_getErrorColumn', 'number', ['number']);
hermesParseResult_getProgramBuffer = HermesParserWASM.cwrap('hermesParseResult_getProgramBuffer', 'number', ['number']);
hermesParseResult_getPositionBuffer = HermesParserWASM.cwrap('hermesParseResult_getPositionBuffer', 'number', ['number']);
hermesParseResult_getPositionBufferSize = HermesParserWASM.cwrap('hermesParseResult_getPositionBufferSize', 'number', ['number']);
} // Copy a string into the WASM heap and null-terminate
function copyToHeap(buffer, addr) {
HermesParserWASM.HEAP8.set(buffer, addr);
HermesParserWASM.HEAP8[addr + buffer.length] = 0;
}
function parse(source, options) {
initHermesParserWASM(); // Allocate space on heap for source text
const sourceBuffer = Buffer.from(source, 'utf8');
const sourceAddr = HermesParserWASM._malloc(sourceBuffer.length + 1);
if (!sourceAddr) {
throw new Error('Parser out of memory');
}
try {
// Copy source text onto WASM heap
copyToHeap(sourceBuffer, sourceAddr);
const parseResult = hermesParse(sourceAddr, sourceBuffer.length + 1, options.flow === 'detect', options.enableExperimentalComponentSyntax, options.tokens, options.allowReturnOutsideFunction);
try {
// Extract and throw error from parse result if parsing failed
const err = hermesParseResult_getError(parseResult);
if (err) {
const syntaxError = new SyntaxError(err); // $FlowExpectedError[prop-missing]
syntaxError.loc = {
line: hermesParseResult_getErrorLine(parseResult),
column: hermesParseResult_getErrorColumn(parseResult)
};
throw syntaxError;
}
const deserializer = new _HermesParserDeserializer.default(hermesParseResult_getProgramBuffer(parseResult), hermesParseResult_getPositionBuffer(parseResult), hermesParseResult_getPositionBufferSize(parseResult), HermesParserWASM, options);
return deserializer.deserialize();
} finally {
hermesParseResult_free(parseResult);
}
} finally {
HermesParserWASM._free(sourceAddr);
}
}
@@ -0,0 +1 @@
{"version":3,"file":"dd-base-impl.js","sourceRoot":"","sources":["../src/dd-base-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;;GAIG;AACH,MAAM,OAAgB,eAAe;IAArC;QASE,gBAAgB;QACN,mBAAc,GAEpB,EAAE,CAAC;IAwDT,CAAC;IAnEC;;;OAGG;IACH,IAAW,QAAQ,KAAgB,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAS3D;;;;;OAKG;IACI,EAAE,CAAC,KAAa,EAAE,QAAuB;QAC9C,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,GAAG,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,MAAM;QACX,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,OAAO;QACZ,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,OAAO;QACZ,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACI,YAAY,CAAC,SAAiB,EAAE,KAAY;QACjD,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;YACzE,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["/**\n * dd-base-impl.ts 12.6.0\n * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license\n */\n\n/**\n * Type for event callback functions used in drag & drop operations.\n * Can return boolean to indicate if the event should continue propagation.\n */\nexport type EventCallback = (event: Event) => boolean|void;\n\n/**\n * Abstract base class for all drag & drop implementations.\n * Provides common functionality for event handling, enable/disable state,\n * and lifecycle management used by draggable, droppable, and resizable implementations.\n */\nexport abstract class DDBaseImplement {\n /**\n * Returns the current disabled state.\n * Note: Use enable()/disable() methods to change state as other operations need to happen.\n */\n public get disabled(): boolean { return this._disabled; }\n\n /** @internal */\n protected _disabled: boolean; // initial state to differentiate from false\n /** @internal */\n protected _eventRegister: {\n [eventName: string]: EventCallback;\n } = {};\n\n /**\n * Register an event callback for the specified event.\n *\n * @param event - Event name to listen for\n * @param callback - Function to call when event occurs\n */\n public on(event: string, callback: EventCallback): void {\n this._eventRegister[event] = callback;\n }\n\n /**\n * Unregister an event callback for the specified event.\n *\n * @param event - Event name to stop listening for\n */\n public off(event: string): void {\n delete this._eventRegister[event];\n }\n\n /**\n * Enable this drag & drop implementation.\n * Subclasses should override to perform additional setup.\n */\n public enable(): void {\n this._disabled = false;\n }\n\n /**\n * Disable this drag & drop implementation.\n * Subclasses should override to perform additional cleanup.\n */\n public disable(): void {\n this._disabled = true;\n }\n\n /**\n * Destroy this drag & drop implementation and clean up resources.\n * Removes all event handlers and clears internal state.\n */\n public destroy(): void {\n delete this._eventRegister;\n }\n\n /**\n * Trigger a registered event callback if one exists and the implementation is enabled.\n *\n * @param eventName - Name of the event to trigger\n * @param event - DOM event object to pass to the callback\n * @returns Result from the callback function, if any\n */\n public triggerEvent(eventName: string, event: Event): boolean|void {\n if (!this.disabled && this._eventRegister && this._eventRegister[eventName])\n return this._eventRegister[eventName](event);\n }\n}\n\n/**\n * Interface for HTML elements extended with drag & drop options.\n * Used to associate DD configuration with DOM elements.\n */\nexport interface HTMLElementExtendOpt<T> {\n /** The HTML element being extended */\n el: HTMLElement;\n /** The drag & drop options/configuration */\n option: T;\n /** Method to update the options and return the DD implementation */\n updateOption(T): DDBaseImplement;\n}\n"]}
@@ -0,0 +1,181 @@
/**
* This module defines nodes used to define types and validations for objects and interfaces.
*/
import { IContext } from "./util";
export declare type CheckerFunc = (value: any, ctx: IContext) => boolean;
/** Node that represents a type. */
export declare abstract class TType {
abstract getChecker(suite: ITypeSuite, strict: boolean, allowedProps?: Set<string>): CheckerFunc;
}
/**
* Descriptor from which TType may be build (by parseSpec()). A plain string is equivalent to
* name(string).
*/
export declare type TypeSpec = TType | string;
/**
* Represents a suite of named types. Suites are used to resolve type names.
*/
export interface ITypeSuite {
[name: string]: TType;
}
/**
* Defines a type name, either built-in, or defined in this suite. It can typically be included in
* the specs as just a plain string.
*/
export declare function name(value: string): TName;
export declare class TName extends TType {
name: string;
private _failMsg;
constructor(name: string);
getChecker(suite: ITypeSuite, strict: boolean, allowedProps?: Set<string>): CheckerFunc;
}
/**
* Defines a literal value, e.g. lit('hello') or lit(123).
*/
export declare function lit(value: any): TLiteral;
export declare class TLiteral extends TType {
value: any;
name: string;
private _failMsg;
constructor(value: any);
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Defines an array type, e.g. array('number').
*/
export declare function array(typeSpec: TypeSpec): TArray;
export declare class TArray extends TType {
ttype: TType;
constructor(ttype: TType);
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Defines a tuple type, e.g. tuple('string', 'number').
*/
export declare function tuple(...typeSpec: TypeSpec[]): TTuple;
export declare class TTuple extends TType {
ttypes: TType[];
constructor(ttypes: TType[]);
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Defines a union type, e.g. union('number', 'null').
*/
export declare function union(...typeSpec: TypeSpec[]): TUnion;
export declare class TUnion extends TType {
ttypes: TType[];
private _failMsg;
constructor(ttypes: TType[]);
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Defines an intersection type, e.g. intersection('number', 'null').
*/
export declare function intersection(...typeSpec: TypeSpec[]): TIntersection;
export declare class TIntersection extends TType {
ttypes: TType[];
constructor(ttypes: TType[]);
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Defines an enum type, e.g. enum({'A': 1, 'B': 2}).
*/
export declare function enumtype(values: {
[name: string]: string | number;
}): TEnumType;
export declare class TEnumType extends TType {
members: {
[name: string]: string | number;
};
readonly validValues: Set<string | number>;
private _failMsg;
constructor(members: {
[name: string]: string | number;
});
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Defines a literal enum value, such as Direction.Up, specified as enumlit("Direction", "Up").
*/
export declare function enumlit(name: string, prop: string): TEnumLiteral;
export declare class TEnumLiteral extends TType {
enumName: string;
prop: string;
private _failMsg;
constructor(enumName: string, prop: string);
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Defines an interface. The first argument is an array of interfaces that it extends, and the
* second is an array of properties.
*/
export declare function iface(bases: string[], props: {
[name: string]: TOptional | TypeSpec;
}): TIface;
export declare class TIface extends TType {
bases: string[];
props: TProp[];
private propSet;
constructor(bases: string[], props: TProp[]);
getChecker(suite: ITypeSuite, strict: boolean, allowedProps?: Set<string>): CheckerFunc;
}
/**
* Defines an optional property on an interface.
*/
export declare function opt(typeSpec: TypeSpec): TOptional;
export declare class TOptional extends TType {
ttype: TType;
constructor(ttype: TType);
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Defines a property in an interface.
*/
export declare class TProp {
name: string;
ttype: TType;
isOpt: boolean;
constructor(name: string, ttype: TType, isOpt: boolean);
}
/**
* Defines a function. The first argument declares the function's return type, the rest declare
* its parameters.
*/
export declare function func(resultSpec: TypeSpec, ...params: TParam[]): TFunc;
export declare class TFunc extends TType {
paramList: TParamList;
result: TType;
constructor(paramList: TParamList, result: TType);
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Defines a function parameter.
*/
export declare function param(name: string, typeSpec: TypeSpec, isOpt?: boolean): TParam;
export declare class TParam {
name: string;
ttype: TType;
isOpt: boolean;
constructor(name: string, ttype: TType, isOpt: boolean);
}
/**
* Defines a function parameter list.
*/
export declare class TParamList extends TType {
params: TParam[];
constructor(params: TParam[]);
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Single TType implementation for all basic built-in types.
*/
export declare class BasicType extends TType {
validator: (value: any) => boolean;
private message;
constructor(validator: (value: any) => boolean, message: string);
getChecker(suite: ITypeSuite, strict: boolean): CheckerFunc;
}
/**
* Defines the suite of basic types.
*/
export declare const basicTypes: ITypeSuite;
@@ -0,0 +1,6 @@
import * as re2 from "re2";
type Re2 = typeof re2 & {
code: string;
};
declare const _default: Re2;
export default _default;
@@ -0,0 +1,11 @@
#ifndef WIN_UTILS_H
#define WIN_UTILS_H
#include <string>
#include <windows.h>
std::wstring utf8ToUtf16(std::string input);
std::string utf16ToUtf8(const WCHAR *input, DWORD length);
std::string normalizePath(std::string path);
#endif
@@ -0,0 +1 @@
{"version":3,"file":"unlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"unfold-horizontal.js","sources":["../../../src/icons/unfold-horizontal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name UnfoldHorizontal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgMTJoNiIgLz4KICA8cGF0aCBkPSJNOCAxMkgyIiAvPgogIDxwYXRoIGQ9Ik0xMiAydjIiIC8+CiAgPHBhdGggZD0iTTEyIDh2MiIgLz4KICA8cGF0aCBkPSJNMTIgMTR2MiIgLz4KICA8cGF0aCBkPSJNMTIgMjB2MiIgLz4KICA8cGF0aCBkPSJtMTkgMTUgMy0zLTMtMyIgLz4KICA8cGF0aCBkPSJtNSA5LTMgMyAzIDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/unfold-horizontal\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 UnfoldHorizontal = createLucideIcon('UnfoldHorizontal', [\n ['path', { d: 'M16 12h6', key: '15xry1' }],\n ['path', { d: 'M8 12H2', key: '1jqql6' }],\n ['path', { d: 'M12 2v2', key: 'tus03m' }],\n ['path', { d: 'M12 8v2', key: '1woqiv' }],\n ['path', { d: 'M12 14v2', key: '8jcxud' }],\n ['path', { d: 'M12 20v2', key: '1lh1kg' }],\n ['path', { d: 'm19 15 3-3-3-3', key: 'wjy7rq' }],\n ['path', { d: 'm5 9-3 3 3 3', key: 'j64kie' }],\n]);\n\nexport default UnfoldHorizontal;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB,iBAAiB,kBAAoB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5D,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC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AA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"trophy.js","sources":["../../../src/icons/trophy.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Trophy\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiA5SDQuNWEyLjUgMi41IDAgMCAxIDAtNUg2IiAvPgogIDxwYXRoIGQ9Ik0xOCA5aDEuNWEyLjUgMi41IDAgMCAwIDAtNUgxOCIgLz4KICA8cGF0aCBkPSJNNCAyMmgxNiIgLz4KICA8cGF0aCBkPSJNMTAgMTQuNjZWMTdjMCAuNTUtLjQ3Ljk4LS45NyAxLjIxQzcuODUgMTguNzUgNyAyMC4yNCA3IDIyIiAvPgogIDxwYXRoIGQ9Ik0xNCAxNC42NlYxN2MwIC41NS40Ny45OC45NyAxLjIxQzE2LjE1IDE4Ljc1IDE3IDIwLjI0IDE3IDIyIiAvPgogIDxwYXRoIGQ9Ik0xOCAySDZ2N2E2IDYgMCAwIDAgMTIgMFYyWiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/trophy\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 Trophy = createLucideIcon('Trophy', [\n ['path', { d: 'M6 9H4.5a2.5 2.5 0 0 1 0-5H6', key: '17hqa7' }],\n ['path', { d: 'M18 9h1.5a2.5 2.5 0 0 0 0-5H18', key: 'lmptdp' }],\n ['path', { d: 'M4 22h16', key: '57wxv0' }],\n ['path', { d: 'M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22', key: '1nw9bq' }],\n ['path', { d: 'M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22', key: '1np0yb' }],\n ['path', { d: 'M18 2H6v7a6 6 0 0 0 12 0V2Z', key: 'u46fv3' }],\n]);\n\nexport default Trophy;\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,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC9D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,731 @@
flf2a$ 7 6 16 1 16 0 129 0
Author : Myflix
Date : 2003/10/18 21:37:14
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
_ #
U|"|u #
\| |/ #
|_| #
(_) #
|||_ #
(__)_) ##
"#
#
#
#
#
#
##
##
#
#
#
#
#
##
$#
#
#
#
#
#
##
%#
#
#
#
#
#
##
&#
#
#
#
#
#
##
_ #
|"| #
|_| #
#
#
#
##
(#
#
#
#
#
#
##
)#
#
#
#
#
#
##
*#
#
#
#
#
#
##
+#
#
#
#
#
#
##
#
#
#
#
_ #
(") #
\| ##
#
#
U u #
/___\ #
|__"__| #
#
##
#
#
#
#
_ #
(") #
" ##
/#
#
#
#
#
#
##
___ #
/ _"\ u #
| / U |/ #
| \// |,-. #
\___/(_/ #
// #
(__) ##
_ #
/"| #
u | |u #
\| |/ #
|_| #
_//<,-, #
(__)(_/ ##
____ #
|___"\ #
U __) | #
\/ __/ \ #
|_____|u #
<< // #
(__)(__) ##
_____ #
|___"/u #
U_|_ \/ #
___) | #
|____/ #
_// \\ #
(__)(__) ##
_ _ #
| ||"| #
| || |_ #
|__ _| #
/|_|\ #
u_|||_u #
(__)__) ##
____ #
U|"___|u #
\|___ \/ #
___) | #
|____/ #
,-,>>\,-. #
\ ) (_/ ##
__ #
U /"/_ u #
\| '_ \/ #
| (_) | #
\___/ #
_// \\_ #
(__) (__) ##
_____ #
|___ "| #
/ / #
u// /\ #
/_/ U #
<<>>_ #
(__)__) ##
___ #
U( " ) u #
\/ \/ #
| ( ) | #
\___/>> #
)( (__) #
(__) ##
___ #
/ _"\ #
| (_) | #
/\__, |\ #
U<< |_/ u #
(__) )( #
(__) ##
#
_ #
(") #
#
_ #
(") #
##
;#
#
#
#
#
#
##
<#
#
#
#
#
#
##
=#
#
#
#
#
#
##
>#
#
#
#
#
#
##
___ #
|__"\ #
U / /u #
\|_|/ #
(_) #
_//\,-. #
(__)( / ##
@#
#
#
#
#
#
##
_ #
U /"\ u #
\/ _ \/ #
/ ___ \ #
/_/ \_\ #
\\ >> #
(__) (__) ##
____ #
U | __")u #
\| _ \/ #
| |_) | #
|____/ #
_|| \\_ #
(__) (__) ##
____ #
U /"___| #
\| | u #
| |/__ #
\____| #
_// \\ #
(__)(__) ##
____ #
| _"\ #
/| | | | #
U| |_| |\ #
|____/ u #
|||_ #
(__)_) ##
U _____ u #
\| ___"|/ #
| _|" #
| |___ #
|_____| #
<< >> #
(__) (__) ##
_____ #
|" ___| #
U| |_ u #
\| _|/ #
|_| #
)(\\,- #
(__)(_/ ##
____ #
U /"___|u #
\| | _ / #
| |_| | #
\____| #
_)(|_ #
(__)__) ##
_ _ #
|'| |'| #
/| |_| |\ #
U| _ |u #
|_| |_| #
// \\ #
(_") ("_) ##
#
___ #
|_"_| #
| | #
U/| |\u #
.-,_|___|_,-. #
\_)-' '-(_/ ##
_ #
U |"| u #
_ \| |/ #
| |_| |_,-. #
\___/-(_/ #
_// #
(__) ##
_ __ #
|"|/ / #
| ' / #
U/| . \\u #
|_|\_\ #
,-,>> \\,-. #
\.) (_/ ##
_ #
|"| #
U | | u #
\| |/__ #
|_____| #
// \\ #
(_")("_) ##
__ __ #
U|' \/ '|u #
\| |\/| |/ #
| | | | #
|_| |_| #
<<,-,,-. #
(./ \.) ##
_ _ #
| \ |"| #
<| \| |> #
U| |\ |u #
|_| \_| #
|| \\,-. #
(_") (_/ ##
U ___ u #
\/"_ \/ #
| | | | #
.-,_| |_| | #
\_)-\___/ #
\\ #
(__) ##
____ #
U| _"\ u #
\| |_) |/ #
| __/ #
|_| #
||>>_ #
(__)__) ##
___ #
/ " \ #
| |"| | #
/| |_| |\ #
U \__\_\u #
\\// #
(_(__) ##
____ #
U | _"\ u #
\| |_) |/ #
| _ < #
|_| \_\ #
// \\_ #
(__) (__) ##
____ #
/ __"| u #
<\___ \/ #
u___) | #
|____/>> #
)( (__) #
(__) ##
_____ #
|_ " _| #
| | #
/| |\ #
u |_|U #
_// \\_ #
(__) (__) ##
_ _ #
U |"|u| | #
\| |\| | #
| |_| | #
<<\___/ #
(__) )( #
(__) ##
__ __ #
\ \ /"/u #
\ \ / // #
/\ V /_,-. #
U \_/-(_/ #
// #
(__) ##
#
__ __ #
\"\ /"/ #
/\ \ /\ / /\ #
U \ V V / U#
.-,_\ /\ /_,-.#
\_)-' '-(_/ ##
__ __ #
\ \/"/ #
/\ /\ #
U / \ u #
/_/\_\ #
,-,>> \\_ #
\_) (__) ##
__ __ #
\ \ / / #
\ V / #
U_|"|_u #
|_| #
.-,//|(_ #
\_) (__) ##
_____ #
|"_ /u #
U / // #
\/ /_ #
/____| #
_//<<,- #
(__) (_/ ##
[#
#
#
#
#
#
##
\#
#
#
#
#
#
##
]#
#
#
#
#
#
##
U _ u #
\/"\/ #
|/`\| #
#
#
#
##
_#
#
#
#
#
#
##
___ #
(" / #
)/ #
#
#
#
##
_ #
U /"\ u #
\/ _ \/ #
/ ___ \ #
/_/ \_\ #
\\ >> #
(__) (__) ##
____ #
U | __")u #
\| _ \/ #
| |_) | #
|____/ #
_|| \\_ #
(__) (__) ##
____ #
U /"___| #
\| | u #
| |/__ #
\____| #
_// \\ #
(__)(__) ##
____ #
| _"\ #
/| | | | #
U| |_| |\ #
|____/ u #
|||_ #
(__)_) ##
U _____ u #
\| ___"|/ #
| _|" #
| |___ #
|_____| #
<< >> #
(__) (__) ##
_____ #
|" ___| #
U| |_ u #
\| _|/ #
|_| #
)(\\,- #
(__)(_/ ##
____ #
U /"___|u #
\| | _ / #
| |_| | #
\____| #
_)(|_ #
(__)__) ##
_ _ #
|'| |'| #
/| |_| |\ #
U| _ |u #
|_| |_| #
// \\ #
(_") ("_) ##
#
___ #
|_"_| #
| | #
U/| |\u #
.-,_|___|_,-. #
\_)-' '-(_/ ##
_ #
U |"| u #
_ \| |/ #
| |_| |_,-. #
\___/-(_/ #
_// #
(__) ##
_ __ #
|"|/ / #
| ' / #
U/| . \\u #
|_|\_\ #
,-,>> \\,-. #
\.) (_/ ##
_ #
|"| #
U | | u #
\| |/__ #
|_____| #
// \\ #
(_")("_) ##
__ __ #
U|' \/ '|u #
\| |\/| |/ #
| | | | #
|_| |_| #
<<,-,,-. #
(./ \.) ##
_ _ #
| \ |"| #
<| \| |> #
U| |\ |u #
|_| \_| #
|| \\,-. #
(_") (_/ ##
U ___ u #
\/"_ \/ #
| | | | #
.-,_| |_| | #
\_)-\___/ #
\\ #
(__) ##
____ #
U| _"\ u #
\| |_) |/ #
| __/ #
|_| #
||>>_ #
(__)__) ##
___ #
/ " \ #
| |"| | #
/| |_| |\ #
U \__\_\u #
\\// #
(_(__) ##
____ #
U | _"\ u #
\| |_) |/ #
| _ < #
|_| \_\ #
// \\_ #
(__) (__) ##
____ #
/ __"| u #
<\___ \/ #
u___) | #
|____/>> #
)( (__) #
(__) ##
_____ #
|_ " _| #
| | #
/| |\ #
u |_|U #
_// \\_ #
(__) (__) ##
_ _ #
U |"|u| | #
\| |\| | #
| |_| | #
<<\___/ #
(__) )( #
(__) ##
__ __ #
\ \ /"/u #
\ \ / // #
/\ V /_,-. #
U \_/-(_/ #
// #
(__) ##
#
__ __ #
\"\ /"/ #
/\ \ /\ / /\ #
U \ V V / U#
.-,_\ /\ /_,-.#
\_)-' '-(_/ ##
__ __ #
\ \/"/ #
/\ /\ #
U / \ u #
/_/\_\ #
,-,>> \\_ #
\_) (__) ##
__ __ #
\ \ / / #
\ V / #
U_|"|_u #
|_| #
.-,//|(_ #
\_) (__) ##
_____ #
|"_ /u #
U / // #
\/ /_ #
/____| #
_//<<,- #
(__) (_/ ##
__ #
u /"/U #
\| |/ #
< < #
| | #
<<\_\ #
(__)_) ##
|#
#
#
#
#
#
##
__ #
\"\ u #
| |/ #
/ > > #
U| | #
/_/>>_ #
(_(__) ##
~#
#
#
#
#
#
##
_ #
U /"\ u #
\/ _ \/ #
/ ___ \ #
/_/ \_\ #
\\ >> #
(__) (__) ##
U ___ u #
\/"_ \/ #
| | | | #
.-,_| |_| | #
\_)-\___/ #
\\ #
(__) ##
_ _ #
U |"|u| | #
\| |\| | #
| |_| | #
<<\___/ #
(__) )( #
(__) ##
_ #
U /"\ u #
\/ _ \/ #
/ ___ \ #
/_/ \_\ #
\\ >> #
(__) (__) ##
U ___ u #
\/"_ \/ #
| | | | #
.-,_| |_| | #
\_)-\___/ #
\\ #
(__) ##
_ _ #
U |"|u| | #
\| |\| | #
| |_| | #
<<\___/ #
(__) )( #
(__) ##
ß#
#
#
#
#
#
##
@@ -0,0 +1,121 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "字符", verb: "包含" },
file: { unit: "字节", verb: "包含" },
array: { unit: "项", verb: "包含" },
set: { unit: "项", verb: "包含" },
map: { unit: "项", verb: "包含" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "输入",
email: "电子邮件",
url: "URL",
emoji: "表情符号",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO日期时间",
date: "ISO日期",
time: "ISO时间",
duration: "ISO时长",
ipv4: "IPv4地址",
ipv6: "IPv6地址",
mac: "MAC地址",
cidrv4: "IPv4网段",
cidrv6: "IPv6网段",
base64: "base64编码字符串",
base64url: "base64url编码字符串",
json_string: "JSON字符串",
e164: "E.164号码",
credit_card: "信用卡号",
currency_code: "货币代码",
iban: "IBAN",
jwt: "JWT",
template_literal: "输入",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "数字",
array: "数组",
null: "空值(null)",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `无效输入:期望 instanceof ${issue.expected},实际接收 ${received}`;
}
return `无效输入:期望 ${expected},实际接收 ${received}`;
}
case "invalid_value":
if (issue.values.length === 1) return `无效输入:期望 ${util.stringifyPrimitive(issue.values[0])}`;
return `无效选项:期望以下之一 ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "个元素"}`;
return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `无效字符串:必须以 "${_issue.prefix}" 开头`;
if (_issue.format === "ends_with") return `无效字符串:必须以 "${_issue.suffix}" 结尾`;
if (_issue.format === "includes") return `无效字符串:必须包含 "${_issue.includes}"`;
if (_issue.format === "regex") return `无效字符串:必须满足正则表达式 ${_issue.pattern}`;
return `无效${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `无效数字:必须是 ${issue.divisor} 的倍数`;
case "unrecognized_keys":
return `出现未知的键(key): ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} 中的键(key)无效`;
case "invalid_union":
return "无效输入";
case "invalid_element":
return `${issue.origin} 中包含无效值(value)`;
default:
return `无效输入`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,202 @@
/**
* @fileoverview Disallow renaming import, export, and destructured assignments to the same name.
* @author Kai Cataldo
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
ignoreDestructuring: false,
ignoreImport: false,
ignoreExport: false,
},
],
docs: {
description:
"Disallow renaming import, export, and destructured assignments to the same name",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-useless-rename",
},
fixable: "code",
schema: [
{
type: "object",
properties: {
ignoreDestructuring: { type: "boolean" },
ignoreImport: { type: "boolean" },
ignoreExport: { type: "boolean" },
},
additionalProperties: false,
},
],
messages: {
unnecessarilyRenamed: "{{type}} {{name}} unnecessarily renamed.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const [{ ignoreDestructuring, ignoreImport, ignoreExport }] =
context.options;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Reports error for unnecessarily renamed assignments
* @param {ASTNode} node node to report
* @param {ASTNode} initial node with initial name value
* @param {string} type the type of the offending node
* @returns {void}
*/
function reportError(node, initial, type) {
const name =
initial.type === "Identifier" ? initial.name : initial.value;
return context.report({
node,
messageId: "unnecessarilyRenamed",
data: {
name,
type,
},
fix(fixer) {
const replacementNode =
node.type === "Property" ? node.value : node.local;
if (
sourceCode.getCommentsInside(node).length >
sourceCode.getCommentsInside(replacementNode).length
) {
return null;
}
// Don't autofix code such as `({foo: (foo) = a} = obj);`, parens are not allowed in shorthand properties.
if (
replacementNode.type === "AssignmentPattern" &&
astUtils.isParenthesised(
sourceCode,
replacementNode.left,
)
) {
return null;
}
return fixer.replaceText(
node,
sourceCode.getText(replacementNode),
);
},
});
}
/**
* Checks whether a destructured assignment is unnecessarily renamed
* @param {ASTNode} node node to check
* @returns {void}
*/
function checkDestructured(node) {
if (ignoreDestructuring) {
return;
}
for (const property of node.properties) {
/**
* Properties using shorthand syntax and rest elements can not be renamed.
* If the property is computed, we have no idea if a rename is useless or not.
*/
if (
property.type !== "Property" ||
property.shorthand ||
property.computed
) {
continue;
}
const key =
(property.key.type === "Identifier" && property.key.name) ||
(property.key.type === "Literal" && property.key.value);
const renamedKey =
property.value.type === "AssignmentPattern"
? property.value.left.name
: property.value.name;
if (key === renamedKey) {
reportError(
property,
property.key,
"Destructuring assignment",
);
}
}
}
/**
* Checks whether an import is unnecessarily renamed
* @param {ASTNode} node node to check
* @returns {void}
*/
function checkImport(node) {
if (ignoreImport) {
return;
}
if (
node.imported.range[0] !== node.local.range[0] &&
astUtils.getModuleExportName(node.imported) === node.local.name
) {
reportError(node, node.imported, "Import");
}
}
/**
* Checks whether an export is unnecessarily renamed
* @param {ASTNode} node node to check
* @returns {void}
*/
function checkExport(node) {
if (ignoreExport) {
return;
}
if (
node.local.range[0] !== node.exported.range[0] &&
astUtils.getModuleExportName(node.local) ===
astUtils.getModuleExportName(node.exported)
) {
reportError(node, node.local, "Export");
}
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
ObjectPattern: checkDestructured,
ImportSpecifier: checkImport,
ExportSpecifier: checkExport,
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"skip-first.delay.js","sourceRoot":"","sources":["../../../src/delay/skip-first/skip-first.delay.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAsC;AAEtC;IAAoC,kCAAK;IAAzC;;IAYA,CAAC;IAXgB,8BAAK,GAAlB;;;gBACI,sBAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAM,KAAK,WAAE,EAAC;;;KACrD;IAED,sBAAY,0CAAc;aAA1B;YACI,OAAO,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC;QAC9B,CAAC;;;OAAA;IAED,sBAAc,gDAAoB;aAAlC;YACI,OAAO,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QAC5B,CAAC;;;OAAA;IACL,qBAAC;AAAD,CAAC,AAZD,CAAoC,kBAAK,GAYxC;AAZY,wCAAc"}
@@ -0,0 +1,60 @@
// deno-fmt-ignore-file
// deno-lint-ignore-file
// This code was bundled using `deno bundle` and it's not recommended to edit it manually
const canElideFrames = "captureStackTrace" in Error;
class AssertionError extends Error {
message;
get name() {
return "AssertionError";
}
get ok() {
return false;
}
constructor(message = "Unspecified AssertionError", props, ssf){
super(message);
this.message = message;
if (canElideFrames) {
Error.captureStackTrace(this, ssf || AssertionError);
}
for(const key in props){
if (!(key in this)) {
this[key] = props[key];
}
}
}
toJSON(stack) {
return {
...this,
name: this.name,
message: this.message,
ok: false,
stack: stack !== false ? this.stack : undefined
};
}
}
class AssertionResult {
get name() {
return "AssertionResult";
}
get ok() {
return true;
}
constructor(props){
for(const key in props){
if (!(key in this)) {
this[key] = props[key];
}
}
}
toJSON() {
return {
...this,
name: this.name,
ok: this.ok
};
}
}
export { AssertionError as AssertionError };
export { AssertionResult as AssertionResult };
@@ -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 Diamond = createLucideIcon("Diamond", [
[
"path",
{
d: "M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",
key: "1f1r0c"
}
]
]);
export { Diamond as default };
//# sourceMappingURL=diamond.js.map
@@ -0,0 +1 @@
module.exports={C:{"59":0.0033,"102":0.0033,"112":0.00991,"115":0.02312,"120":0.02642,"121":0.05945,"127":0.0033,"135":0.03633,"140":0.02312,"143":0.00661,"146":0.00991,"147":0.0033,"149":0.0033,"150":0.0033,"151":0.00661,"152":0.03964,"153":0.03964,"154":0.28736,"155":0.61766,"156":0.6573,"157":0.01982,_:"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 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 103 104 105 106 107 108 109 110 111 113 114 116 117 118 119 122 123 124 125 126 128 129 130 131 132 133 134 136 137 138 139 141 142 144 145 148 158 159 160 3.5 3.6"},D:{"55":0.0033,"58":0.0033,"65":0.0033,"66":0.0033,"68":0.00661,"69":0.0033,"70":0.00661,"71":0.00991,"73":0.00991,"74":0.00661,"78":0.0033,"79":0.0033,"80":0.0033,"81":0.00661,"86":0.00991,"87":0.0033,"88":0.00991,"89":0.0033,"91":0.00661,"92":0.0033,"93":0.03964,"94":0.01652,"95":0.00661,"97":0.0033,"98":0.00661,"100":0.0033,"101":0.01321,"102":0.05615,"103":0.01982,"104":0.00661,"105":0.00991,"106":0.00991,"107":0.0033,"108":0.00661,"109":0.25103,"110":0.00991,"111":0.00991,"112":0.0033,"114":0.03303,"115":0.0033,"116":0.03633,"117":0.00661,"118":0.17506,"119":0.06276,"120":0.07267,"122":0.03964,"123":0.00661,"124":0.01652,"125":0.06606,"126":0.00991,"127":0.01982,"128":0.03964,"129":0.0033,"130":0.08258,"131":0.1123,"132":0.0033,"133":0.04624,"134":0.06276,"135":0.04294,"136":0.03633,"137":0.04955,"138":0.16185,"139":0.06276,"140":0.06276,"141":0.04294,"142":0.14864,"143":0.05945,"144":0.05615,"145":0.01982,"146":0.05285,"147":0.10239,"148":0.07267,"149":0.06936,"150":0.29066,"151":1.71756,"152":6.76785,"153":5.54243,"154":1.29478,"155":0.01652,"156":0.0033,_:"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 56 57 59 60 61 62 63 64 67 72 75 76 77 83 84 85 90 96 99 113 121 157"},F:{"36":0.00991,"42":0.00661,"50":0.0033,"79":0.00991,"86":0.0033,"90":0.01321,"93":0.0033,"95":0.09579,"100":0.0033,"101":0.02642,"113":0.0033,"124":0.0033,"125":0.00991,"131":0.01321,"132":0.0033,"133":0.01652,"134":0.13542,"135":2.09741,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 41 43 44 45 46 47 48 49 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 80 81 82 83 84 85 87 88 89 91 92 94 96 97 98 99 102 103 104 105 106 107 108 109 110 111 112 114 115 116 117 118 119 120 121 122 123 126 127 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"15":0.0033,"16":0.0033,"17":0.01982,"18":0.03633,"89":0.0033,"90":0.01982,"92":0.05945,"100":0.00661,"109":0.01982,"111":0.00661,"112":0.0033,"114":0.0033,"119":0.02642,"120":0.02973,"122":0.01652,"131":0.0033,"140":0.00991,"141":0.00991,"142":0.0033,"143":0.0033,"144":0.01652,"145":0.02973,"146":0.00991,"147":0.01321,"148":0.01652,"149":0.05285,"150":0.10239,"151":0.27085,"152":1.46984,"153":1.51277,"154":0.46242,_:"12 13 14 79 80 81 83 84 85 86 87 88 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 113 115 116 117 118 121 123 124 125 126 127 128 129 130 132 133 134 135 136 137 138 139"},E:{"27":0.01982,_:"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 12.1 13.1 15.1 15.2-15.3 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.2 17.3 17.4 18.0 18.2 18.4 26.1 27.1 27.2 TP","11.1":0.0033,"14.1":0.0033,"15.4":0.0033,"15.6":0.03303,"16.6":0.01321,"17.1":0.00661,"17.5":0.0033,"17.6":0.03303,"18.1":0.0033,"18.3":0.0033,"18.5-18.7":0.0033,"26.0":0.0033,"26.2":0.0033,"26.3":0.0033,"26.4":0.00991,"26.5":0.02312,"26.6":0.15524},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00024,"5.0-5.1":0.00024,"6.0-6.1":0,"7.0-7.1":0.00048,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.0024,"11.0-11.2":0.00024,"11.3-11.4":0.00048,"12.0-12.1":0,"12.2-12.5":0.00623,"13.0-13.1":0,"13.2":0.0012,"13.3":0,"13.4-13.7":0.00024,"14.0-14.4":0.00096,"14.5-14.8":0.00144,"15.0-15.1":0.00144,"15.2-15.3":0.00096,"15.4":0.0012,"15.5":0.00144,"15.6-15.8":0.03117,"16.0":0.0024,"16.1":0.00432,"16.2":0.0024,"16.3":0.00527,"16.4":0.0012,"16.5":0.00192,"16.6-16.7":0.0434,"17.0":0.00168,"17.1":0.0024,"17.2":0.0024,"17.3":0.0036,"17.4":0.00503,"17.5":0.00983,"17.6-17.7":0.02541,"18.0":0.00527,"18.1":0.01055,"18.2":0.01439,"18.3":0.02493,"18.4":0.01558,"18.5-18.7":0.32199,"26.0":0.01558,"26.1":0.01582,"26.2":0.04124,"26.3":0.04459,"26.4":0.03261,"26.5":0.21841,"26.6":1.34765,"27.0":0.10333,"27.1":0,"27.2":0.00264},P:{"21":0.00907,"22":0.00907,"24":0.00907,"25":0.00907,"26":0.01815,"27":0.00907,"28":0.09073,"29":0.10888,"30":0.78031,_:"4 20 23 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0 19.0","7.2-7.4":0.07259,"17.0":0.00907},I:{"0":0.02008,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":3.16098,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7Line truncated
@@ -0,0 +1,233 @@
export default `flf2a$ 2 2 8 -1 27 0 0 0
Author : David Dahlberg <D-Mail@gmx.net>
Markus Gebhard markus@jave.de
Date : 2001/9/26 19:57:04
Version: 0.2
-------------------------------------------------
This font is not pure ASCII!
It is intended to work with the characters available
for adding comments to german bank statements.
Those characters are: A..Z 0..9 $%&/\`*�+-,.?^
Font designed by:
David Dahlberg <D-Mail@gmx.net>
Converted to FLF by:
Markus Gebhard <markus@jave.de>
-------------------------------------------------
This font has been created using Jave's FIGlet font export assistant
(that will be included in Jave 2.0).
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
-------------------------------------------------
Converted this file from a text encoding of ISO 8859-1 to UTF-8
Done by Patrick Gillespie (patorjk) on 2025/08/31
$ #
$ ##
!#
##
"#
##
##
##
$#
##
%#
##
&#
##
'#
##
(#
##
)#
##
*#
##
+#
##
#
, ##
-#
##
#
. ##
/#
##
0#
##
1#
##
2#
##
3#
##
4#
##
5#
##
6#
##
7#
##
8#
##
9#
##
:#
##
;#
##
<#
##
=#
##
>#
##
?#
##
@#
##
/1 #
/´/ ##
/´1 #
/.I ##
/\` #
L- ##
/\`. #
/.-´ ##
/.´ #
/.. ##
/´´ #
/´ ##
/´ #
/.T ##
/ / #
/´/ ##
/ #
/ ##
´´/ #
L/ ##
/.´ #
/´. ##
/ #
/. ##
/1/1 #
/ 1 ##
/1 / #
/ 1/ ##
/´/ #
/./ ##
/´/ #
/´´ ##
/´/ #
/.X ##
/´/ #
/\`. ##
/´´ #
../ ##
´/´ #
/ ##
/ / #
L/ ##
/ / #
1/ ##
/ / #
L/L/ ##
1/ #
/1 ##
L/ #
/ ##
´´/ #
/.. ##
[#
##
\\#
##
]#
##
^#
##
_#
##
\`#
##
/1 #
/´/ ##
/´1 #
/.I ##
/\` #
L- ##
/\`. #
/.-´ ##
/.´ #
/.. ##
/´´ #
/´ ##
/´ #
/.T ##
/ / #
/´/ ##
/ #
/ ##
´´/ #
L/ ##
/.´ #
/´. ##
/ #
/. ##
/1/1 #
/ 1 ##
/1 / #
/ 1/ ##
/´/ #
/./ ##
/´/ #
/´´ ##
/´/ #
/.X ##
/´/ #
/\`. ##
/´´ #
../ ##
´/´ #
/ ##
/ / #
L/ ##
/ / #
1/ ##
/ / #
L/L/ ##
1/ #
/1 ##
L/ #
/ ##
´´/ #
/.. ##
{#
##
|#
##
}#
##
~#
##
/1 #
/´/ ##
/´/ #
/./ ##
/ / #
L/ ##
/1 #
/´/ ##
/´/ #
/./ ##
/ / #
L/ ##
ß#
##
`
@@ -0,0 +1,33 @@
import { hex } from './hex.mjs';
import { hsla } from './hsla.mjs';
import { rgba } from './rgba.mjs';
const color = {
test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),
parse: (v) => {
if (rgba.test(v)) {
return rgba.parse(v);
}
else if (hsla.test(v)) {
return hsla.parse(v);
}
else {
return hex.parse(v);
}
},
transform: (v) => {
return typeof v === "string"
? v
: v.hasOwnProperty("red")
? rgba.transform(v)
: hsla.transform(v);
},
getAnimatableNone: (v) => {
const parsed = color.parse(v);
parsed.alpha = 0;
return color.transform(parsed);
},
};
export { color };
//# sourceMappingURL=index.mjs.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 './square-arrow-up.js';
//# sourceMappingURL=arrow-up-square.js.map
@@ -0,0 +1,17 @@
/**
* @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 MessageSquareQuote = createLucideIcon("MessageSquareQuote", [
["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }],
["path", { d: "M8 12a2 2 0 0 0 2-2V8H8", key: "1jfesj" }],
["path", { d: "M14 12a2 2 0 0 0 2-2V8h-2", key: "1dq9mh" }]
]);
export { MessageSquareQuote as default };
//# sourceMappingURL=message-square-quote.js.map
@@ -0,0 +1,346 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports._getKey = _getKey;
exports._getPattern = _getPattern;
exports.get = get;
exports.getAllNextSiblings = getAllNextSiblings;
exports.getAllPrevSiblings = getAllPrevSiblings;
exports.getAssignmentIdentifiers = getAssignmentIdentifiers;
exports.getBindingIdentifierPaths = getBindingIdentifierPaths;
exports.getBindingIdentifiers = getBindingIdentifiers;
exports.getCompletionRecords = getCompletionRecords;
exports.getNextSibling = getNextSibling;
exports.getOpposite = getOpposite;
exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths;
exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers;
exports.getPrevSibling = getPrevSibling;
exports.getSibling = getSibling;
var _index = require("./index.js");
var _t = require("@babel/types");
const {
getAssignmentIdentifiers: _getAssignmentIdentifiers,
getBindingIdentifiers: _getBindingIdentifiers,
getOuterBindingIdentifiers: _getOuterBindingIdentifiers,
numericLiteral,
unaryExpression
} = _t;
const NORMAL_COMPLETION = 0;
const BREAK_COMPLETION = 1;
function NormalCompletion(path) {
return {
type: NORMAL_COMPLETION,
path
};
}
function BreakCompletion(path) {
return {
type: BREAK_COMPLETION,
path
};
}
function getOpposite() {
if (this.key === "left") {
return this.getSibling("right");
} else if (this.key === "right") {
return this.getSibling("left");
}
return null;
}
function addCompletionRecords(path, records, context) {
if (path) {
records.push(..._getCompletionRecords(path, context));
}
return records;
}
function completionRecordForSwitch(cases, records, context) {
let lastNormalCompletions = [];
for (let i = 0; i < cases.length; i++) {
const casePath = cases[i];
const caseCompletions = _getCompletionRecords(casePath, context);
const normalCompletions = [];
const breakCompletions = [];
for (const c of caseCompletions) {
if (c.type === NORMAL_COMPLETION) {
normalCompletions.push(c);
}
if (c.type === BREAK_COMPLETION) {
breakCompletions.push(c);
}
}
if (normalCompletions.length) {
lastNormalCompletions = normalCompletions;
}
records.push(...breakCompletions);
}
records.push(...lastNormalCompletions);
return records;
}
function normalCompletionToBreak(completions) {
completions.forEach(c => {
c.type = BREAK_COMPLETION;
});
}
function replaceBreakStatementInBreakCompletion(completions, reachable) {
completions.forEach(c => {
if (c.path.isBreakStatement({
label: null
})) {
if (reachable) {
c.path.replaceWith(unaryExpression("void", numericLiteral(0)));
} else {
c.path.remove();
}
}
});
}
function getStatementListCompletion(paths, context) {
const completions = [];
if (context.canHaveBreak) {
let lastNormalCompletions = [];
for (let i = 0; i < paths.length; i++) {
const path = paths[i];
const newContext = Object.assign({}, context, {
inCaseClause: false
});
if (path.isBlockStatement() && (context.inCaseClause || context.shouldPopulateBreak)) {
newContext.shouldPopulateBreak = true;
} else {
newContext.shouldPopulateBreak = false;
}
const statementCompletions = _getCompletionRecords(path, newContext);
if (statementCompletions.length > 0 && statementCompletions.every(c => c.type === BREAK_COMPLETION)) {
if (lastNormalCompletions.length > 0 && statementCompletions.every(c => c.path.isBreakStatement({
label: null
}))) {
normalCompletionToBreak(lastNormalCompletions);
completions.push(...lastNormalCompletions);
if (lastNormalCompletions.some(c => c.path.isDeclaration())) {
completions.push(...statementCompletions);
if (!context.shouldPreserveBreak) {
replaceBreakStatementInBreakCompletion(statementCompletions, true);
}
}
if (!context.shouldPreserveBreak) {
replaceBreakStatementInBreakCompletion(statementCompletions, false);
}
} else {
completions.push(...statementCompletions);
if (!context.shouldPopulateBreak && !context.shouldPreserveBreak) {
replaceBreakStatementInBreakCompletion(statementCompletions, true);
}
}
break;
}
if (i === paths.length - 1) {
completions.push(...statementCompletions);
} else {
lastNormalCompletions = [];
for (let i = 0; i < statementCompletions.length; i++) {
const c = statementCompletions[i];
if (c.type === BREAK_COMPLETION) {
completions.push(c);
}
if (c.type === NORMAL_COMPLETION) {
lastNormalCompletions.push(c);
}
}
}
}
} else if (paths.length) {
for (let i = paths.length - 1; i >= 0; i--) {
const pathCompletions = _getCompletionRecords(paths[i], context);
if (pathCompletions.length > 1 || pathCompletions.length === 1 && !pathCompletions[0].path.isVariableDeclaration() && !pathCompletions[0].path.isEmptyStatement()) {
completions.push(...pathCompletions);
break;
}
}
}
return completions;
}
function _getCompletionRecords(path, context) {
let records = [];
if (path.isIfStatement()) {
records = addCompletionRecords(path.get("consequent"), records, context);
records = addCompletionRecords(path.get("alternate"), records, context);
} else if (path.isDoExpression() || path.isFor() || path.isWhile() || path.isLabeledStatement()) {
return addCompletionRecords(path.get("body"), records, context);
} else if (path.isProgram() || path.isBlockStatement()) {
return getStatementListCompletion(path.get("body"), context);
} else if (path.isFunction()) {
return _getCompletionRecords(path.get("body"), context);
} else if (path.isTryStatement()) {
records = addCompletionRecords(path.get("block"), records, context);
records = addCompletionRecords(path.get("handler"), records, context);
} else if (path.isCatchClause()) {
return addCompletionRecords(path.get("body"), records, context);
} else if (path.isSwitchStatement()) {
return completionRecordForSwitch(path.get("cases"), records, context);
} else if (path.isSwitchCase()) {
return getStatementListCompletion(path.get("consequent"), {
canHaveBreak: true,
shouldPopulateBreak: false,
inCaseClause: true,
shouldPreserveBreak: context.shouldPreserveBreak
});
} else if (path.isBreakStatement()) {
records.push(BreakCompletion(path));
} else {
records.push(NormalCompletion(path));
}
return records;
}
function getCompletionRecords(shouldPreserveBreak = false) {
const records = _getCompletionRecords(this, {
canHaveBreak: false,
shouldPopulateBreak: false,
inCaseClause: false,
shouldPreserveBreak
});
return records.map(r => r.path);
}
function getSibling(key) {
return _index.default.get({
parentPath: this.parentPath,
parent: this.parent,
container: this.container,
listKey: this.listKey,
key: key
}).setContext(this.context);
}
function getPrevSibling() {
return this.getSibling(this.key - 1);
}
function getNextSibling() {
return this.getSibling(this.key + 1);
}
function getAllNextSiblings() {
let _key = this.key;
let sibling = this.getSibling(++_key);
const siblings = [];
while (sibling.node) {
siblings.push(sibling);
sibling = this.getSibling(++_key);
}
return siblings;
}
function getAllPrevSiblings() {
let _key = this.key;
let sibling = this.getSibling(--_key);
const siblings = [];
while (sibling.node) {
siblings.push(sibling);
sibling = this.getSibling(--_key);
}
return siblings;
}
function get(key, context = true) {
if (context === true) context = this.context;
const parts = key.split(".");
if (parts.length === 1) {
return _getKey.call(this, key, context);
} else {
return _getPattern.call(this, parts, context);
}
}
function _getKey(key, context) {
const node = this.node;
const container = node[key];
if (Array.isArray(container)) {
return container.map((_, i) => {
return _index.default.get({
listKey: key,
parentPath: this,
parent: node,
container: container,
key: i
}).setContext(context);
});
} else {
return _index.default.get({
parentPath: this,
parent: node,
container: node,
key: key
}).setContext(context);
}
}
function _getPattern(parts, context) {
let path = this;
for (const part of parts) {
if (part === ".") {
path = path.parentPath;
} else {
if (Array.isArray(path)) {
path = path[part];
} else {
path = path.get(part, context);
}
}
}
return path;
}
function getAssignmentIdentifiers() {
return _getAssignmentIdentifiers(this.node);
}
function getBindingIdentifiers(duplicates) {
return _getBindingIdentifiers(this.node, duplicates);
}
function getOuterBindingIdentifiers(duplicates) {
return _getOuterBindingIdentifiers(this.node, duplicates);
}
function getBindingIdentifierPaths(duplicates = false, outerOnly = false) {
const path = this;
const search = [path];
const ids = Object.create(null);
while (search.length) {
const id = search.shift();
if (!id) continue;
if (!id.node) continue;
const keys = _getBindingIdentifiers.keys[id.node.type];
if (id.isIdentifier()) {
if (duplicates) {
const _ids = ids[id.node.name] = ids[id.node.name] || [];
_ids.push(id);
} else {
ids[id.node.name] = id;
}
continue;
}
if (id.isExportDeclaration()) {
const declaration = id.get("declaration");
if (declaration.isDeclaration()) {
search.push(declaration);
}
continue;
}
if (outerOnly) {
if (id.isFunctionDeclaration()) {
search.push(id.get("id"));
continue;
}
if (id.isFunctionExpression()) {
continue;
}
}
if (keys) {
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const child = id.get(key);
if (Array.isArray(child)) {
search.push(...child);
} else if (child.node) {
search.push(child);
}
}
}
}
return ids;
}
function getOuterBindingIdentifierPaths(duplicates = false) {
return this.getBindingIdentifierPaths(duplicates, true);
}
//# sourceMappingURL=family.js.map
@@ -0,0 +1 @@
{"version":3,"file":"rocking-chair.js","sources":["../../../src/icons/rocking-chair.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name RockingChair\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIzLjUgMiA2LjUgMTIuNSAxOCAxMi41IiAvPgogIDxsaW5lIHgxPSI5LjUiIHgyPSI1LjUiIHkxPSIxMi41IiB5Mj0iMjAiIC8+CiAgPGxpbmUgeDE9IjE1IiB4Mj0iMTguNSIgeTE9IjEyLjUiIHkyPSIyMCIgLz4KICA8cGF0aCBkPSJNMi43NSAxOGExMyAxMyAwIDAgMCAxOC41IDAiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/rocking-chair\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 RockingChair = createLucideIcon('RockingChair', [\n ['polyline', { points: '3.5 2 6.5 12.5 18 12.5', key: 'y3iy52' }],\n ['line', { x1: '9.5', x2: '5.5', y1: '12.5', y2: '20', key: '19vg5i' }],\n ['line', { x1: '15', x2: '18.5', y1: '12.5', y2: '20', key: '1inpmv' }],\n ['path', { d: 'M2.75 18a13 13 0 0 0 18.5 0', key: '1nquas' }],\n]);\n\nexport default RockingChair;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAChE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACtE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACtE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC9D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,31 @@
/**
* @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 Microchip = createLucideIcon("Microchip", [
["path", { d: "M18 12h2", key: "quuxs7" }],
["path", { d: "M18 16h2", key: "zsn3lv" }],
["path", { d: "M18 20h2", key: "9x5y9y" }],
["path", { d: "M18 4h2", key: "1luxfb" }],
["path", { d: "M18 8h2", key: "nxqzg" }],
["path", { d: "M4 12h2", key: "1ltxp0" }],
["path", { d: "M4 16h2", key: "8a5zha" }],
["path", { d: "M4 20h2", key: "27dk57" }],
["path", { d: "M4 4h2", key: "10groj" }],
["path", { d: "M4 8h2", key: "18vq6w" }],
[
"path",
{
d: "M8 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-1.5c-.276 0-.494.227-.562.495a2 2 0 0 1-3.876 0C9.994 2.227 9.776 2 9.5 2z",
key: "1681fp"
}
]
]);
export { Microchip as default };
//# sourceMappingURL=microchip.js.map
@@ -0,0 +1,20 @@
/**
* @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 FlaskConicalOff = createLucideIcon("FlaskConicalOff", [
["path", { d: "M10 2v2.343", key: "15t272" }],
["path", { d: "M14 2v6.343", key: "sxr80q" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
["path", { d: "M20 20a2 2 0 0 1-2 2H6a2 2 0 0 1-1.755-2.96l5.227-9.563", key: "k0duyd" }],
["path", { d: "M6.453 15H15", key: "1f0z33" }],
["path", { d: "M8.5 2h7", key: "csnxdl" }]
]);
export { FlaskConicalOff as default };
//# sourceMappingURL=flask-conical-off.js.map
@@ -0,0 +1,24 @@
'use strict';
/*
Copyright 2012-2015, Yahoo Inc.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
const path = require('path');
module.exports = {
create(name, cfg) {
cfg = cfg || {};
let Cons;
try {
Cons = require(path.join(__dirname, 'lib', name));
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
throw e;
}
Cons = require(name);
}
return new Cons(cfg);
}
};
@@ -0,0 +1,8 @@
import Options from '../../Options'
export default (options: Options) => {
return {
warning: options.translations.warnings.sequences,
suggestions: [options.translations.suggestions.sequences],
}
}
@@ -0,0 +1 @@
module.exports={A:{A:{"644":"_Z","772":"_A"},B:{"1":"_NI","260":"_2F"},C:{"1":"_tC","8":"_g"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_xL","8":"_0D"},G:{"1":"_cE","2":"_3F"},H:{"2":"1D"},I:{"2":"_G","1025":"I"},J:{"2":"_B"},K:{"1":"aC","8":"_cB","1025":"H"},L:{"1025":"I"},M:{"2":"YC"},N:{"1":"_A"},O:{"1025":"bC"},P:{"2":"_F"},Q:{"1":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:1,C:"Drag and Drop",D:true};
@@ -0,0 +1,327 @@
/**
SHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions.
RFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors,
not the base RIPEMD-160 compression spec.
Don't use them in a new protocol. What "weak" means:
- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160.
- No practical pre-image attacks (only theoretical, 2^123.4)
- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151
* @module
*/
import { Chi, HashMD, Maj } from "./_md.js";
import { clean, createHasher, rotl } from "./utils.js";
/** Initial SHA-1 state from RFC 3174 §6.1. */
const SHA1_IV = /* @__PURE__ */ Uint32Array.from([
0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,
]);
// Reusable 80-word SHA-1 message schedule buffer.
const SHA1_W = /* @__PURE__ */ new Uint32Array(80);
/** Internal SHA1 legacy hash class. */
export class _SHA1 extends HashMD {
A = SHA1_IV[0] | 0;
B = SHA1_IV[1] | 0;
C = SHA1_IV[2] | 0;
D = SHA1_IV[3] | 0;
E = SHA1_IV[4] | 0;
constructor() {
super(64, 20, 8, false);
}
get() {
const { A, B, C, D, E } = this;
return [A, B, C, D, E];
}
set(A, B, C, D, E) {
this.A = A | 0;
this.B = B | 0;
this.C = C | 0;
this.D = D | 0;
this.E = E | 0;
}
process(view, offset) {
for (let i = 0; i < 16; i++, offset += 4)
SHA1_W[i] = view.getUint32(offset, false);
for (let i = 16; i < 80; i++)
SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);
// Compression function main loop, 80 rounds
let { A, B, C, D, E } = this;
for (let i = 0; i < 80; i++) {
let F, K;
if (i < 20) {
F = Chi(B, C, D);
K = 0x5a827999;
}
else if (i < 40) {
F = B ^ C ^ D;
K = 0x6ed9eba1;
}
else if (i < 60) {
F = Maj(B, C, D);
K = 0x8f1bbcdc;
}
else {
F = B ^ C ^ D;
K = 0xca62c1d6;
}
const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0;
E = D;
D = C;
C = rotl(B, 30);
B = A;
A = T;
}
// Add the compressed chunk to the current hash value
A = (A + this.A) | 0;
B = (B + this.B) | 0;
C = (C + this.C) | 0;
D = (D + this.D) | 0;
E = (E + this.E) | 0;
this.set(A, B, C, D, E);
}
roundClean() {
clean(SHA1_W);
}
destroy() {
// HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves
// update()/digest() callable on reused instances.
this.destroyed = true;
this.set(0, 0, 0, 0, 0);
clean(this.buffer);
}
}
/**
* SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA1.
* ```ts
* sha1(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha1 = /* @__PURE__ */ createHasher(() => new _SHA1());
/** RFC 1321 `T[i]` uses `floor(2^32 * abs(sin(i)))`; this is the shared `2^32` scale factor. */
const p32 = /* @__PURE__ */ Math.pow(2, 32);
/** RFC 1321 `T[1..64]` table. */
const K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));
/** MD5 initial state from RFC 1321, stored as 4 u32 words. */
const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);
// Reusable 16-word MD5 message block buffer.
const MD5_W = /* @__PURE__ */ new Uint32Array(16);
/** Internal MD5 legacy hash class. */
export class _MD5 extends HashMD {
A = MD5_IV[0] | 0;
B = MD5_IV[1] | 0;
C = MD5_IV[2] | 0;
D = MD5_IV[3] | 0;
constructor() {
super(64, 16, 8, true);
}
get() {
const { A, B, C, D } = this;
return [A, B, C, D];
}
set(A, B, C, D) {
this.A = A | 0;
this.B = B | 0;
this.C = C | 0;
this.D = D | 0;
}
process(view, offset) {
for (let i = 0; i < 16; i++, offset += 4)
MD5_W[i] = view.getUint32(offset, true);
// Compression function main loop, 64 rounds
let { A, B, C, D } = this;
for (let i = 0; i < 64; i++) {
let F, g, s;
if (i < 16) {
F = Chi(B, C, D);
g = i;
s = [7, 12, 17, 22];
}
else if (i < 32) {
// RFC 1321 round 2 uses G(B,C,D) = (B & D) | (C & ~D), which is `Chi(D, B, C)`.
F = Chi(D, B, C);
g = (5 * i + 1) % 16;
s = [5, 9, 14, 20];
}
else if (i < 48) {
F = B ^ C ^ D;
g = (3 * i + 5) % 16;
s = [4, 11, 16, 23];
}
else {
F = C ^ (B | ~D);
g = (7 * i) % 16;
s = [6, 10, 15, 21];
}
F = F + A + K[i] + MD5_W[g];
A = D;
D = C;
C = B;
B = B + rotl(F, s[i % 4]);
}
// Add the compressed chunk to the current hash value
A = (A + this.A) | 0;
B = (B + this.B) | 0;
C = (C + this.C) | 0;
D = (D + this.D) | 0;
this.set(A, B, C, D);
}
roundClean() {
clean(MD5_W);
}
destroy() {
// HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves
// update()/digest() callable on reused instances.
this.destroyed = true;
this.set(0, 0, 0, 0);
clean(this.buffer);
}
}
/**
* MD5 (RFC 1321) legacy hash function. It was cryptographically broken.
* MD5 architecture is similar to SHA1, with some differences:
* - Reduced output length: 16 bytes (128 bit) instead of 20
* - 64 rounds, instead of 80
* - Little-endian: could be faster, but will require more code
* - Non-linear index selection: huge speed-up for unroll
* - Per round constants: more memory accesses, additional speed-up for unroll
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with MD5.
* ```ts
* md5(new Uint8Array([97, 98, 99]));
* ```
*/
export const md5 = /* @__PURE__ */ createHasher(() => new _MD5());
// RIPEMD-160
// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables.
const Rho160 = /* @__PURE__ */ Uint8Array.from([
7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
]);
const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();
const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();
// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds.
const idxLR = /* @__PURE__ */ (() => {
const L = [Id160];
const R = [Pi160];
const res = [L, R];
for (let i = 0; i < 4; i++)
for (let j of res)
j.push(j[i].map((k) => Rho160[k]));
return res;
})();
const idxL = /* @__PURE__ */ (() => idxLR[0])();
const idxR = /* @__PURE__ */ (() => idxLR[1])();
// const [idxL, idxR] = idxLR;
// Base per-group shift table before the left/right message-order permutations are applied.
const shifts160 = /* @__PURE__ */ [
[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
[12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
[13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
[14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
[15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],
].map((i) => Uint8Array.from(i));
const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j]));
const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j]));
// Five left-lane additive constants for RIPEMD-160.
const Kl160 = /* @__PURE__ */ Uint32Array.from([
0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,
]);
// Five right-lane additive constants for RIPEMD-160.
const Kr160 = /* @__PURE__ */ Uint32Array.from([
0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,
]);
// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range
// inputs currently fall through to the group-4 branch.
function ripemd_f(group, x, y, z) {
if (group === 0)
return x ^ y ^ z;
if (group === 1)
return (x & y) | (~x & z);
if (group === 2)
return (x | ~y) ^ z;
if (group === 3)
return (x & z) | (y & ~z);
return x ^ (y | ~z);
}
// Reusable 16-word RIPEMD-160 message block buffer.
const BUF_160 = /* @__PURE__ */ new Uint32Array(16);
/**
* Internal RIPEMD-160 legacy hash class.
* RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification.
*/
export class _RIPEMD160 extends HashMD {
h0 = 0x67452301 | 0;
h1 = 0xefcdab89 | 0;
h2 = 0x98badcfe | 0;
h3 = 0x10325476 | 0;
h4 = 0xc3d2e1f0 | 0;
constructor() {
super(64, 20, 8, true);
}
get() {
const { h0, h1, h2, h3, h4 } = this;
return [h0, h1, h2, h3, h4];
}
set(h0, h1, h2, h3, h4) {
this.h0 = h0 | 0;
this.h1 = h1 | 0;
this.h2 = h2 | 0;
this.h3 = h3 | 0;
this.h4 = h4 | 0;
}
process(view, offset) {
for (let i = 0; i < 16; i++, offset += 4)
BUF_160[i] = view.getUint32(offset, true);
// prettier-ignore
let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;
// Instead of iterating 0 to 80, we split it into 5 groups
// And use the groups in constants, functions, etc. Much simpler
for (let group = 0; group < 5; group++) {
const rGroup = 4 - group;
const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore
const rl = idxL[group], rr = idxR[group]; // prettier-ignore
const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore
for (let i = 0; i < 16; i++) {
const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0;
al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore
}
// 2 loops are 10% faster
for (let i = 0; i < 16; i++) {
const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0;
ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore
}
}
// Add the compressed chunk to the current hash value
// Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order.
this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);
}
roundClean() {
clean(BUF_160);
}
destroy() {
this.destroyed = true;
clean(this.buffer);
this.set(0, 0, 0, 0, 0);
}
}
/**
* RIPEMD-160 - a legacy hash function from 1990s.
* RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point
* at the base RIPEMD-160 references.
* * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html}
* * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf}
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with RIPEMD-160.
* ```ts
* ripemd160(new Uint8Array([97, 98, 99]));
* ```
*/
export const ripemd160 = /* @__PURE__ */ createHasher(() => new _RIPEMD160());
//# sourceMappingURL=legacy.js.map
@@ -0,0 +1,26 @@
/**
* @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 ClipboardPaste = createLucideIcon("ClipboardPaste", [
[
"path",
{ d: "M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z", key: "1pp7kr" }
],
[
"path",
{
d: "M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",
key: "2ik1ml"
}
],
["path", { d: "m17 10 4 4-4 4", key: "vp2hj1" }]
]);
export { ClipboardPaste as default };
//# sourceMappingURL=clipboard-paste.js.map
@@ -0,0 +1 @@
{"version":3,"file":"hmac.js","sourceRoot":"","sources":["src/hmac.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,KAAK,GAKN,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,MAAM,OAAO,KAAK;IAChB,KAAK,CAAI;IACT,KAAK,CAAI;IACT,QAAQ,CAAS;IACjB,SAAS,CAAS;IAClB,MAAM,GAAG,KAAK,CAAC;IACP,QAAQ,GAAG,KAAK,CAAC;IACjB,SAAS,GAAG,KAAK,CAAC;IAE1B,YAAY,IAAiB,EAAE,GAAqB;QAClD,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,EAAO,CAAC;QAChC,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,UAAU;YACzC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QACrC,wCAAwC;QACxC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,QAA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AAI,GAAiB,eAAe,CAAC,CAAC,GAAG,EAAE;IACtD,MAAM,KAAK,GAAG,CAAC,CACb,IAAiB,EACjB,GAAqB,EACrB,OAAyB,EACP,EAAE,CAAC,IAAI,KAAK,CAAM,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAiB,CAAC;IAC3F,KAAK,CAAC,MAAM,GAAG,CAAC,IAAiB,EAAE,GAAqB,EAAoB,EAAE,CAC5E,IAAI,KAAK,CAAM,IAAI,EAAE,GAAG,CAAqB,CAAC;IAChD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC,EAAE,CAAC"}
@@ -0,0 +1,63 @@
import Benchmark from "benchmark";
import { z } from "zod/v3";
const shortSuite = new Benchmark.Suite("realworld");
const People = z.array(
z.object({
type: z.literal("person"),
hair: z.enum(["blue", "brown"]),
active: z.boolean(),
name: z.string(),
age: z.number().int(),
hobbies: z.array(z.string()),
address: z.object({
street: z.string(),
zip: z.string(),
country: z.string(),
}),
})
);
let i = 0;
function num() {
return ++i;
}
function str() {
return (++i % 100).toString(16);
}
function array<T>(fn: () => T): T[] {
return Array.from({ length: ++i % 10 }, () => fn());
}
const people = Array.from({ length: 100 }, () => {
return {
type: "person",
hair: i % 2 ? "blue" : "brown",
active: !!(i % 2),
name: str(),
age: num(),
hobbies: array(str),
address: {
street: str(),
zip: str(),
country: str(),
},
};
});
shortSuite
.add("valid", () => {
People.parse(people);
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`${(shortSuite as any).name}: ${e.target}`);
});
export default {
suites: [shortSuite],
};
@@ -0,0 +1,13 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
*/
"use strict";
/**
* Check whether a given character is a combining mark or not.
* @param {number} codePoint The character code to check.
* @returns {boolean} `true` if the character has the General Category of Combining Mark (M), consisting of `Mc`, `Me`, and `Mn`.
*/
module.exports = function isCombiningCharacter(codePoint) {
return /^\p{M}$/u.test(String.fromCodePoint(codePoint));
};
@@ -0,0 +1,5 @@
export declare function groupPossibilities(possibilities: string[]): string;
export declare function padGroup(group: string): string;
export declare const ADDRESS_BOUNDARY = "[^A-Fa-f0-9:]";
export declare function simpleRegularExpression(groups: string[]): string;
export declare function possibleElisions(elidedGroups: number, moreLeft?: boolean, moreRight?: boolean): string;
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2022_error: LibDefinition;
@@ -0,0 +1,85 @@
"use strict";
/**
* Example MCP server using Hono with WebStandardStreamableHTTPServerTransport
*
* This example demonstrates using the Web Standard transport directly with Hono,
* which works on any runtime: Node.js, Cloudflare Workers, Deno, Bun, etc.
*
* Run with: npx tsx src/examples/server/honoWebStandardStreamableHttp.ts
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const hono_1 = require("hono");
const cors_1 = require("hono/cors");
const node_server_1 = require("@hono/node-server");
const z = __importStar(require("zod/v4"));
const mcp_js_1 = require("../../server/mcp.js");
const webStandardStreamableHttp_js_1 = require("../../server/webStandardStreamableHttp.js");
// Factory function to create a new MCP server per request (stateless mode)
const getServer = () => {
const server = new mcp_js_1.McpServer({
name: 'hono-webstandard-mcp-server',
version: '1.0.0'
});
// Register a simple greeting tool
server.registerTool('greet', {
title: 'Greeting Tool',
description: 'A simple greeting tool',
inputSchema: { name: z.string().describe('Name to greet') }
}, async ({ name }) => {
return {
content: [{ type: 'text', text: `Hello, ${name}! (from Hono + WebStandard transport)` }]
};
});
return server;
};
// Create the Hono app
const app = new hono_1.Hono();
// Enable CORS for all origins
app.use('*', (0, cors_1.cors)({
origin: '*',
allowMethods: ['GET', 'POST', 'DELETE', 'OPTIONS'],
allowHeaders: ['Content-Type', 'mcp-session-id', 'Last-Event-ID', 'mcp-protocol-version'],
exposeHeaders: ['mcp-session-id', 'mcp-protocol-version']
}));
// Health check endpoint
app.get('/health', c => c.json({ status: 'ok' }));
// MCP endpoint - create a fresh transport and server per request (stateless)
app.all('/mcp', async (c) => {
const transport = new webStandardStreamableHttp_js_1.WebStandardStreamableHTTPServerTransport();
const server = getServer();
await server.connect(transport);
return transport.handleRequest(c.req.raw);
});
// Start the server
const PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000;
console.log(`Starting Hono MCP server on port ${PORT}`);
console.log(`Health check: http://localhost:${PORT}/health`);
console.log(`MCP endpoint: http://localhost:${PORT}/mcp`);
(0, node_server_1.serve)({
fetch: app.fetch,
port: PORT
});
//# sourceMappingURL=honoWebStandardStreamableHttp.js.map
@@ -0,0 +1,933 @@
export default `flf2a$ 9 7 20 1 13
keyboard.flf composed by Vinney Thai <ssfiit@eris.cc.umb.edu>
date: Nov 21, 1994
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
9 - height of a character
7 - height of a character, not including descenders
20 - max line length (excluding comment lines) + a fudge factor
1 - default smushmode for this font (like "-m 0" on command line)
14 - number of comment lines
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |! | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |" | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |# | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |$ | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |% | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |& | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |' | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |( | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |) | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |* | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |+ | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |, | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |- | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |. | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |/ | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |0 | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |1 | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |2 | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |3 | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |4 | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |5 | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |6 | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |7 | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |8 | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |9 | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |: | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |; | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |< | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |= | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |> | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |? | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |@ | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |A | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |B | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |C | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |D | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |E | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |F | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |G | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |H | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |I | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |J | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |K | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |L | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |M | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |N | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |O | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |P | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |Q | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |R | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |S | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |T | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |U | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |V | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |W | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |X | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |Y | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |Z | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |[ | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |\\ | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |] | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |^ | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |_ | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |\` | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |a | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |b | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |c | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |d | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |e | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |f | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |g | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |h | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |i | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |j | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |k | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |l | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |m | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |n | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |o | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |p | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |q | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |r | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |s | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |t | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |u | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |v | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |w | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |x | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |y | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |z | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |{ | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| || | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |} | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |~ | |@
| +---+ |@
|/_____\\|@
@@
@
_______ @
|\\ /|@
| +---+ |@
| | | |@
| |ESC| |@
| +---+ |@
|/_____\\|@
@@
@
_________ @
|\\ /|@
| +-----+ |@
| | | |@
| |ALT | |@
| +-----+ |@
|/_______\\|@
@@
@
___________ @
|\\ /|@
| +-------+ |@
| | | |@
| |CTRL | |@
| +-------+ |@
|/_________\\|@
@@
@
____________ @
|\\ /|@
| +--------+ |@
| | | |@
| |SHIFT | |@
| +--------+ |@
|/__________\\|@
@@
@
____________ @
|\\ /|@
| +--------+ |@
| | | |@
| |ENTER | |@
| +--------+ |@
|/__________\\|@
@@
@
__________ @
|\\ /|@
| +------+ |@
| | | |@
| |GOLD | |@
| +------+ |@
|/________\\|@
@@
@
___________ @
|\\ /|@
| +-------+ |@
| | | |@
| |TAB | |@
| +-------+ |@
|/_________\\|@
@@
`
@@ -0,0 +1,822 @@
/**
* @fileoverview Rule to specify spacing of object literal keys and values
* @author Brandon Mills
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const { getGraphemeCount } = require("../shared/string-utils");
/**
* Checks whether a string contains a line terminator as defined in
* http://www.ecma-international.org/ecma-262/5.1/#sec-7.3
* @param {string} str String to test.
* @returns {boolean} True if str contains a line terminator.
*/
function containsLineTerminator(str) {
return astUtils.LINEBREAK_MATCHER.test(str);
}
/**
* Gets the last element of an array.
* @param {Array} arr An array.
* @returns {any} Last element of arr.
*/
function last(arr) {
return arr.at(-1);
}
/**
* Checks whether a node is contained on a single line.
* @param {ASTNode} node AST Node being evaluated.
* @returns {boolean} True if the node is a single line.
*/
function isSingleLine(node) {
return node.loc.end.line === node.loc.start.line;
}
/**
* Checks whether the properties on a single line.
* @param {ASTNode[]} properties List of Property AST nodes.
* @returns {boolean} True if all properties is on a single line.
*/
function isSingleLineProperties(properties) {
const [firstProp] = properties,
lastProp = last(properties);
return firstProp.loc.start.line === lastProp.loc.end.line;
}
/**
* Initializes a single option property from the configuration with defaults for undefined values
* @param {Object} toOptions Object to be initialized
* @param {Object} fromOptions Object to be initialized from
* @returns {Object} The object with correctly initialized options and values
*/
function initOptionProperty(toOptions, fromOptions) {
toOptions.mode = fromOptions.mode || "strict";
// Set value of beforeColon
if (typeof fromOptions.beforeColon !== "undefined") {
toOptions.beforeColon = +fromOptions.beforeColon;
} else {
toOptions.beforeColon = 0;
}
// Set value of afterColon
if (typeof fromOptions.afterColon !== "undefined") {
toOptions.afterColon = +fromOptions.afterColon;
} else {
toOptions.afterColon = 1;
}
// Set align if exists
if (typeof fromOptions.align !== "undefined") {
if (typeof fromOptions.align === "object") {
toOptions.align = fromOptions.align;
} else {
// "string"
toOptions.align = {
on: fromOptions.align,
mode: toOptions.mode,
beforeColon: toOptions.beforeColon,
afterColon: toOptions.afterColon,
};
}
}
return toOptions;
}
/**
* Initializes all the option values (singleLine, multiLine and align) from the configuration with defaults for undefined values
* @param {Object} toOptions Object to be initialized
* @param {Object} fromOptions Object to be initialized from
* @returns {Object} The object with correctly initialized options and values
*/
function initOptions(toOptions, fromOptions) {
if (typeof fromOptions.align === "object") {
// Initialize the alignment configuration
toOptions.align = initOptionProperty({}, fromOptions.align);
toOptions.align.on = fromOptions.align.on || "colon";
toOptions.align.mode = fromOptions.align.mode || "strict";
toOptions.multiLine = initOptionProperty(
{},
fromOptions.multiLine || fromOptions,
);
toOptions.singleLine = initOptionProperty(
{},
fromOptions.singleLine || fromOptions,
);
} else {
// string or undefined
toOptions.multiLine = initOptionProperty(
{},
fromOptions.multiLine || fromOptions,
);
toOptions.singleLine = initOptionProperty(
{},
fromOptions.singleLine || fromOptions,
);
// If alignment options are defined in multiLine, pull them out into the general align configuration
if (toOptions.multiLine.align) {
toOptions.align = {
on: toOptions.multiLine.align.on,
mode:
toOptions.multiLine.align.mode || toOptions.multiLine.mode,
beforeColon: toOptions.multiLine.align.beforeColon,
afterColon: toOptions.multiLine.align.afterColon,
};
}
}
return toOptions;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "key-spacing",
url: "https://eslint.style/rules/key-spacing",
},
},
],
},
type: "layout",
docs: {
description:
"Enforce consistent spacing between keys and values in object literal properties",
recommended: false,
url: "https://eslint.org/docs/latest/rules/key-spacing",
},
fixable: "whitespace",
schema: [
{
anyOf: [
{
type: "object",
properties: {
align: {
anyOf: [
{
enum: ["colon", "value"],
},
{
type: "object",
properties: {
mode: {
enum: ["strict", "minimum"],
},
on: {
enum: ["colon", "value"],
},
beforeColon: {
type: "boolean",
},
afterColon: {
type: "boolean",
},
},
additionalProperties: false,
},
],
},
mode: {
enum: ["strict", "minimum"],
},
beforeColon: {
type: "boolean",
},
afterColon: {
type: "boolean",
},
},
additionalProperties: false,
},
{
type: "object",
properties: {
singleLine: {
type: "object",
properties: {
mode: {
enum: ["strict", "minimum"],
},
beforeColon: {
type: "boolean",
},
afterColon: {
type: "boolean",
},
},
additionalProperties: false,
},
multiLine: {
type: "object",
properties: {
align: {
anyOf: [
{
enum: ["colon", "value"],
},
{
type: "object",
properties: {
mode: {
enum: [
"strict",
"minimum",
],
},
on: {
enum: [
"colon",
"value",
],
},
beforeColon: {
type: "boolean",
},
afterColon: {
type: "boolean",
},
},
additionalProperties: false,
},
],
},
mode: {
enum: ["strict", "minimum"],
},
beforeColon: {
type: "boolean",
},
afterColon: {
type: "boolean",
},
},
additionalProperties: false,
},
},
additionalProperties: false,
},
{
type: "object",
properties: {
singleLine: {
type: "object",
properties: {
mode: {
enum: ["strict", "minimum"],
},
beforeColon: {
type: "boolean",
},
afterColon: {
type: "boolean",
},
},
additionalProperties: false,
},
multiLine: {
type: "object",
properties: {
mode: {
enum: ["strict", "minimum"],
},
beforeColon: {
type: "boolean",
},
afterColon: {
type: "boolean",
},
},
additionalProperties: false,
},
align: {
type: "object",
properties: {
mode: {
enum: ["strict", "minimum"],
},
on: {
enum: ["colon", "value"],
},
beforeColon: {
type: "boolean",
},
afterColon: {
type: "boolean",
},
},
additionalProperties: false,
},
},
additionalProperties: false,
},
],
},
],
messages: {
extraKey: "Extra space after {{computed}}key '{{key}}'.",
extraValue:
"Extra space before value for {{computed}}key '{{key}}'.",
missingKey: "Missing space after {{computed}}key '{{key}}'.",
missingValue:
"Missing space before value for {{computed}}key '{{key}}'.",
},
},
create(context) {
/**
* OPTIONS
* "key-spacing": [2, {
* beforeColon: false,
* afterColon: true,
* align: "colon" // Optional, or "value"
* }
*/
const options = context.options[0] || {},
ruleOptions = initOptions({}, options),
multiLineOptions = ruleOptions.multiLine,
singleLineOptions = ruleOptions.singleLine,
alignmentOptions = ruleOptions.align || null;
const sourceCode = context.sourceCode;
/**
* Determines if the given property is key-value property.
* @param {ASTNode} property Property node to check.
* @returns {boolean} Whether the property is a key-value property.
*/
function isKeyValueProperty(property) {
return !(
(
property.method ||
property.shorthand ||
property.kind !== "init" ||
property.type !== "Property"
) // Could be "ExperimentalSpreadProperty" or "SpreadElement"
);
}
/**
* Starting from the given node (a property.key node here) looks forward
* until it finds the colon punctuator and returns it.
* @param {ASTNode} node The node to start looking from.
* @returns {ASTNode} The colon punctuator.
*/
function getNextColon(node) {
return sourceCode.getTokenAfter(node, astUtils.isColonToken);
}
/**
* Starting from the given node (a property.key node here) looks forward
* until it finds the last token before a colon punctuator and returns it.
* @param {ASTNode} node The node to start looking from.
* @returns {ASTNode} The last token before a colon punctuator.
*/
function getLastTokenBeforeColon(node) {
const colonToken = getNextColon(node);
return sourceCode.getTokenBefore(colonToken);
}
/**
* Starting from the given node (a property.key node here) looks forward
* until it finds the first token after a colon punctuator and returns it.
* @param {ASTNode} node The node to start looking from.
* @returns {ASTNode} The first token after a colon punctuator.
*/
function getFirstTokenAfterColon(node) {
const colonToken = getNextColon(node);
return sourceCode.getTokenAfter(colonToken);
}
/**
* Checks whether a property is a member of the property group it follows.
* @param {ASTNode} lastMember The last Property known to be in the group.
* @param {ASTNode} candidate The next Property that might be in the group.
* @returns {boolean} True if the candidate property is part of the group.
*/
function continuesPropertyGroup(lastMember, candidate) {
const groupEndLine = lastMember.loc.start.line,
candidateValueStartLine = (
isKeyValueProperty(candidate)
? getFirstTokenAfterColon(candidate.key)
: candidate
).loc.start.line;
if (candidateValueStartLine - groupEndLine <= 1) {
return true;
}
/*
* Check that the first comment is adjacent to the end of the group, the
* last comment is adjacent to the candidate property, and that successive
* comments are adjacent to each other.
*/
const leadingComments = sourceCode.getCommentsBefore(candidate);
if (
leadingComments.length &&
leadingComments[0].loc.start.line - groupEndLine <= 1 &&
candidateValueStartLine - last(leadingComments).loc.end.line <=
1
) {
for (let i = 1; i < leadingComments.length; i++) {
if (
leadingComments[i].loc.start.line -
leadingComments[i - 1].loc.end.line >
1
) {
return false;
}
}
return true;
}
return false;
}
/**
* Gets an object literal property's key as the identifier name or string value.
* @param {ASTNode} property Property node whose key to retrieve.
* @returns {string} The property's key.
*/
function getKey(property) {
const key = property.key;
if (property.computed) {
return sourceCode.getText().slice(key.range[0], key.range[1]);
}
return astUtils.getStaticPropertyName(property);
}
/**
* Reports an appropriately-formatted error if spacing is incorrect on one
* side of the colon.
* @param {ASTNode} property Key-value pair in an object literal.
* @param {string} side Side being verified - either "key" or "value".
* @param {string} whitespace Actual whitespace string.
* @param {number} expected Expected whitespace length.
* @param {string} mode Value of the mode as "strict" or "minimum"
* @returns {void}
*/
function report(property, side, whitespace, expected, mode) {
const diff = whitespace.length - expected;
if (
((diff && mode === "strict") ||
(diff < 0 && mode === "minimum") ||
(diff > 0 && !expected && mode === "minimum")) &&
!(expected && containsLineTerminator(whitespace))
) {
const nextColon = getNextColon(property.key),
tokenBeforeColon = sourceCode.getTokenBefore(nextColon, {
includeComments: true,
}),
tokenAfterColon = sourceCode.getTokenAfter(nextColon, {
includeComments: true,
}),
isKeySide = side === "key",
isExtra = diff > 0,
diffAbs = Math.abs(diff),
spaces = Array(diffAbs + 1).join(" ");
const locStart = isKeySide
? tokenBeforeColon.loc.end
: nextColon.loc.start;
const locEnd = isKeySide
? nextColon.loc.start
: tokenAfterColon.loc.start;
const missingLoc = isKeySide
? tokenBeforeColon.loc
: tokenAfterColon.loc;
const loc = isExtra
? { start: locStart, end: locEnd }
: missingLoc;
let fix;
if (isExtra) {
let range;
// Remove whitespace
if (isKeySide) {
range = [
tokenBeforeColon.range[1],
tokenBeforeColon.range[1] + diffAbs,
];
} else {
range = [
tokenAfterColon.range[0] - diffAbs,
tokenAfterColon.range[0],
];
}
fix = function (fixer) {
return fixer.removeRange(range);
};
} else {
// Add whitespace
if (isKeySide) {
fix = function (fixer) {
return fixer.insertTextAfter(
tokenBeforeColon,
spaces,
);
};
} else {
fix = function (fixer) {
return fixer.insertTextBefore(
tokenAfterColon,
spaces,
);
};
}
}
let messageId;
if (isExtra) {
messageId = side === "key" ? "extraKey" : "extraValue";
} else {
messageId = side === "key" ? "missingKey" : "missingValue";
}
context.report({
node: property[side],
loc,
messageId,
data: {
computed: property.computed ? "computed " : "",
key: getKey(property),
},
fix,
});
}
}
/**
* Gets the number of characters in a key, including quotes around string
* keys and braces around computed property keys.
* @param {ASTNode} property Property of on object literal.
* @returns {number} Width of the key.
*/
function getKeyWidth(property) {
const startToken = sourceCode.getFirstToken(property);
const endToken = getLastTokenBeforeColon(property.key);
return getGraphemeCount(
sourceCode
.getText()
.slice(startToken.range[0], endToken.range[1]),
);
}
/**
* Gets the whitespace around the colon in an object literal property.
* @param {ASTNode} property Property node from an object literal.
* @returns {Object} Whitespace before and after the property's colon.
*/
function getPropertyWhitespace(property) {
const whitespace = /(\s*):(\s*)/u.exec(
sourceCode
.getText()
.slice(property.key.range[1], property.value.range[0]),
);
if (whitespace) {
return {
beforeColon: whitespace[1],
afterColon: whitespace[2],
};
}
return null;
}
/**
* Creates groups of properties.
* @param {ASTNode} node ObjectExpression node being evaluated.
* @returns {Array<ASTNode[]>} Groups of property AST node lists.
*/
function createGroups(node) {
if (node.properties.length === 1) {
return [node.properties];
}
return node.properties.reduce(
(groups, property) => {
const currentGroup = last(groups),
prev = last(currentGroup);
if (!prev || continuesPropertyGroup(prev, property)) {
currentGroup.push(property);
} else {
groups.push([property]);
}
return groups;
},
[[]],
);
}
/**
* Verifies correct vertical alignment of a group of properties.
* @param {ASTNode[]} properties List of Property AST nodes.
* @returns {void}
*/
function verifyGroupAlignment(properties) {
const length = properties.length,
widths = properties.map(getKeyWidth), // Width of keys, including quotes
align = alignmentOptions.on; // "value" or "colon"
let targetWidth = Math.max(...widths),
beforeColon,
afterColon,
mode;
if (alignmentOptions && length > 1) {
// When aligning values within a group, use the alignment configuration.
beforeColon = alignmentOptions.beforeColon;
afterColon = alignmentOptions.afterColon;
mode = alignmentOptions.mode;
} else {
beforeColon = multiLineOptions.beforeColon;
afterColon = multiLineOptions.afterColon;
mode = alignmentOptions.mode;
}
// Conditionally include one space before or after colon
targetWidth += align === "colon" ? beforeColon : afterColon;
for (let i = 0; i < length; i++) {
const property = properties[i];
const whitespace = getPropertyWhitespace(property);
if (whitespace) {
// Object literal getters/setters lack a colon
const width = widths[i];
if (align === "value") {
report(
property,
"key",
whitespace.beforeColon,
beforeColon,
mode,
);
report(
property,
"value",
whitespace.afterColon,
targetWidth - width,
mode,
);
} else {
// align = "colon"
report(
property,
"key",
whitespace.beforeColon,
targetWidth - width,
mode,
);
report(
property,
"value",
whitespace.afterColon,
afterColon,
mode,
);
}
}
}
}
/**
* Verifies spacing of property conforms to specified options.
* @param {ASTNode} node Property node being evaluated.
* @param {Object} lineOptions Configured singleLine or multiLine options
* @returns {void}
*/
function verifySpacing(node, lineOptions) {
const actual = getPropertyWhitespace(node);
if (actual) {
// Object literal getters/setters lack colons
report(
node,
"key",
actual.beforeColon,
lineOptions.beforeColon,
lineOptions.mode,
);
report(
node,
"value",
actual.afterColon,
lineOptions.afterColon,
lineOptions.mode,
);
}
}
/**
* Verifies spacing of each property in a list.
* @param {ASTNode[]} properties List of Property AST nodes.
* @param {Object} lineOptions Configured singleLine or multiLine options
* @returns {void}
*/
function verifyListSpacing(properties, lineOptions) {
const length = properties.length;
for (let i = 0; i < length; i++) {
verifySpacing(properties[i], lineOptions);
}
}
/**
* Verifies vertical alignment, taking into account groups of properties.
* @param {ASTNode} node ObjectExpression node being evaluated.
* @returns {void}
*/
function verifyAlignment(node) {
createGroups(node).forEach(group => {
const properties = group.filter(isKeyValueProperty);
if (
properties.length > 0 &&
isSingleLineProperties(properties)
) {
verifyListSpacing(properties, multiLineOptions);
} else {
verifyGroupAlignment(properties);
}
});
}
//--------------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------------
if (alignmentOptions) {
// Verify vertical alignment
return {
ObjectExpression(node) {
if (isSingleLine(node)) {
verifyListSpacing(
node.properties.filter(isKeyValueProperty),
singleLineOptions,
);
} else {
verifyAlignment(node);
}
},
};
}
// Obey beforeColon and afterColon in each property as configured
return {
Property(node) {
verifySpacing(
node,
isSingleLine(node.parent)
? singleLineOptions
: multiLineOptions,
);
},
};
},
};
@@ -0,0 +1,44 @@
/**
* Compares two script coverages.
*
* The result corresponds to the comparison of their `url` value (alphabetical sort).
*/
function compareScriptCovs(a, b) {
if (a.url === b.url) {
return 0;
} else if (a.url < b.url) {
return -1;
} else {
return 1;
}
}
/**
* Compares two function coverages.
*
* The result corresponds to the comparison of the root ranges.
*/
function compareFunctionCovs(a, b) {
return compareRangeCovs(a.ranges[0], b.ranges[0]);
}
/**
* Compares two range coverages.
*
* The ranges are first ordered by ascending `startOffset` and then by
* descending `endOffset`.
* This corresponds to a pre-order tree traversal.
*/
function compareRangeCovs(a, b) {
if (a.startOffset !== b.startOffset) {
return a.startOffset - b.startOffset;
} else {
return b.endOffset - a.endOffset;
}
}
module.exports = {
compareScriptCovs,
compareFunctionCovs,
compareRangeCovs,
};
@@ -0,0 +1,50 @@
type Line = number;
type Column = number;
type Kind = number;
type Name = number;
type Var = number;
type SourcesIndex = number;
type ScopesIndex = number;
type Mix<A, B, O> = (A & O) | (B & O);
export type OriginalScope = Mix<[
Line,
Column,
Line,
Column,
Kind
], [
Line,
Column,
Line,
Column,
Kind,
Name
], {
vars: Var[];
}>;
export type GeneratedRange = Mix<[
Line,
Column,
Line,
Column
], [
Line,
Column,
Line,
Column,
SourcesIndex,
ScopesIndex
], {
callsite: CallSite | null;
bindings: Binding[];
isScope: boolean;
}>;
export type CallSite = [SourcesIndex, Line, Column];
type Binding = BindingExpressionRange[];
export type BindingExpressionRange = [Name] | [Name, Line, Column];
export declare function decodeOriginalScopes(input: string): OriginalScope[];
export declare function encodeOriginalScopes(scopes: OriginalScope[]): string;
export declare function decodeGeneratedRanges(input: string): GeneratedRange[];
export declare function encodeGeneratedRanges(ranges: GeneratedRange[]): string;
export {};
//# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs.map","sources":[".temp/src/ecma-versions.ts",".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/group-specifiers.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;AAaO,MAAM,iBAAiB,GAAG,IAAI;;ACTrC,IAAI,kBAAkB,GAAyB,SAAS,CAAA;AACxD,IAAI,qBAAqB,GAAyB,SAAS,CAAA;AAErD,SAAU,SAAS,CAAC,EAAU,EAA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AC,CAAC,CAAA;AACrD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,mBAAmB,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;AACvE,MAAM,WAAW,GAAG,IAAI,OAAO,CAC3B,opBAAopB,EACppB,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,CACL,CAAA;AACD,Line truncated
@@ -0,0 +1,124 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "حروف", verb: "ہونا" },
file: { unit: "بائٹس", verb: "ہونا" },
array: { unit: "آئٹمز", verb: "ہونا" },
set: { unit: "آئٹمز", verb: "ہونا" },
map: { unit: "آئٹمز", verb: "ہونا" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "ان پٹ",
email: "ای میل ایڈریس",
url: "یو آر ایل",
emoji: "ایموجی",
uuid: "یو یو آئی ڈی",
uuidv4: "یو یو آئی ڈی وی 4",
uuidv6: "یو یو آئی ڈی وی 6",
nanoid: "نینو آئی ڈی",
guid: "جی یو آئی ڈی",
cuid: "سی یو آئی ڈی",
cuid2: "سی یو آئی ڈی 2",
ulid: "یو ایل آئی ڈی",
xid: "ایکس آئی ڈی",
ksuid: "کے ایس یو آئی ڈی",
datetime: "آئی ایس او ڈیٹ ٹائم",
date: "آئی ایس او تاریخ",
time: "آئی ایس او وقت",
duration: "آئی ایس او مدت",
ipv4: "آئی پی وی 4 ایڈریس",
ipv6: "آئی پی وی 6 ایڈریس",
mac: "ایم اے سی ایڈریس",
cidrv4: "آئی پی وی 4 رینج",
cidrv6: "آئی پی وی 6 رینج",
base64: "بیس 64 ان کوڈڈ سٹرنگ",
base64url: "بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",
json_string: "جے ایس او این سٹرنگ",
e164: "ای 164 نمبر",
credit_card: "کریڈٹ کارڈ نمبر",
currency_code: "کرنسی کوڈ",
iban: "IBAN",
jwt: "جے ڈبلیو ٹی",
template_literal: "ان پٹ",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "نمبر",
array: "آرے",
null: "نل",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `غلط ان پٹ: instanceof ${issue.expected} متوقع تھا، ${received} موصول ہوا`;
}
return `غلط ان پٹ: ${expected} متوقع تھا، ${received} موصول ہوا`;
}
case "invalid_value":
if (issue.values.length === 1) return `غلط ان پٹ: ${util.stringifyPrimitive(issue.values[0])} متوقع تھا`;
return `غلط آپشن: ${util.joinValues(issue.values, "|")} میں سے ایک متوقع تھا`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `بہت بڑا: ${issue.origin ?? "ویلیو"} کے ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عناصر"} ہونے متوقع تھے`;
return `بہت بڑا: ${issue.origin ?? "ویلیو"} کا ${adj}${issue.maximum.toString()} ہونا متوقع تھا`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `بہت چھوٹا: ${issue.origin} کے ${adj}${issue.minimum.toString()} ${sizing.unit} ہونے متوقع تھے`;
}
return `بہت چھوٹا: ${issue.origin} کا ${adj}${issue.minimum.toString()} ہونا متوقع تھا`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") {
return `غلط سٹرنگ: "${_issue.prefix}" سے شروع ہونا چاہیے`;
}
if (_issue.format === "ends_with") return `غلط سٹرنگ: "${_issue.suffix}" پر ختم ہونا چاہیے`;
if (_issue.format === "includes") return `غلط سٹرنگ: "${_issue.includes}" شامل ہونا چاہیے`;
if (_issue.format === "regex") return `غلط سٹرنگ: پیٹرن ${_issue.pattern} سے میچ ہونا چاہیے`;
return `غلط ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `غلط نمبر: ${issue.divisor} کا مضاعف ہونا چاہیے`;
case "unrecognized_keys":
return `غیر تسلیم شدہ کی${issue.keys.length > 1 ? "ز" : ""}: ${util.joinValues(issue.keys, "، ")}`;
case "invalid_key":
return `${issue.origin} میں غلط کی`;
case "invalid_union":
return "غلط ان پٹ";
case "invalid_element":
return `${issue.origin} میں غلط ویلیو`;
default:
return `غلط ان پٹ`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_S"},D:{"1":"_qF","2":"_8H","66":"_4M","129":"_5E"},E:{"2":"_R"},F:{"1":"_vR","2":"_fH _bC _O"},G:{"1":"_sH","2":"_IO"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_xB","2":"_3B"},Q:{"1":"JE"},R:{"1":"KE"},S:{"2":"_C"}},B:5,C:"Credential Management API",D:true};
@@ -0,0 +1,37 @@
import { defaultSerializeError } from './router.js';
/**
* Well-known symbol used by {@link defer} to tag a promise with
* its deferred state. Consumers can read `promise[TSR_DEFERRED_PROMISE]`
* to access `status`, `data`, or `error`.
*/
export declare const TSR_DEFERRED_PROMISE: unique symbol;
export type DeferredPromiseState<T> = {
status: 'pending';
data?: T;
error?: unknown;
} | {
status: 'success';
data: T;
} | {
status: 'error';
data?: T;
error: unknown;
};
export type DeferredPromise<T> = Promise<T> & {
[TSR_DEFERRED_PROMISE]: DeferredPromiseState<T>;
};
/**
* Wrap a promise with a deferred state for use with `<Await>` and `useAwaited`.
*
* The returned promise is augmented with internal state (status/data/error)
* so UI can read progress or suspend until it settles.
*
* @param _promise The promise to wrap.
* @param options Optional config. Provide `serializeError` to customize how
* errors are serialized for transfer.
* @returns The same promise with attached deferred metadata.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/deferFunction
*/
export declare function defer<T>(_promise: Promise<T>, options?: {
serializeError?: typeof defaultSerializeError;
}): DeferredPromise<T>;