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

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

No files matched your search

@@ -0,0 +1,81 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const fs = require("fs")
const path = require("path")
const Cache = require("./cache")
const cache = new Cache()
/**
* Reads the `package.json` data in a given path.
*
* Don't cache the data.
*
* @param {string} dir - The path to a directory to read.
* @returns {import('type-fest').JsonObject|null} The read `package.json` data, or null.
*/
function readPackageJson(dir) {
const filePath = path.join(dir, "package.json")
try {
const text = fs.readFileSync(filePath, "utf8")
const data = JSON.parse(text)
if (
data != null &&
typeof data === "object" &&
Array.isArray(data) === false
) {
data.filePath = filePath
return data
}
} catch {
// do nothing.
}
return null
}
/**
* Gets a `package.json` data.
* The data is cached if found, then it's used after.
*
* @param {string} [startPath] - A file path to lookup.
* @returns {import('type-fest').JsonObject|null} A found `package.json` data or `null`.
* This object have additional property `filePath`.
*/
function getPackageJson(startPath = "a.js") {
const startDir = path.dirname(path.resolve(startPath))
let dir = startDir
let prevDir = ""
let data = null
do {
data = cache.get(dir)
if (data) {
if (dir !== startDir) {
cache.set(startDir, data)
}
return data
}
data = readPackageJson(dir)
if (data) {
cache.set(dir, data)
cache.set(startDir, data)
return data
}
// Go to next.
prevDir = dir
dir = path.resolve(dir, "..")
} while (dir !== prevDir)
cache.set(startDir, null)
return null
}
module.exports = { getPackageJson }
@@ -0,0 +1,23 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope, isFocusable} from './FocusScope';
export {FocusRing} from './FocusRing';
export {FocusableProvider, useFocusable} from './useFocusable';
export {useFocusRing} from './useFocusRing';
export {focusSafely} from './focusSafely';
export {useHasTabbableChild} from './useHasTabbableChild';
export type {FocusScopeProps, FocusManager, FocusManagerOptions} from './FocusScope';
export type {FocusRingProps} from './FocusRing';
export type {FocusableAria, FocusableOptions, FocusableProviderProps} from './useFocusable';
export type {AriaFocusRingProps, FocusRingAria} from './useFocusRing';
@@ -0,0 +1,11 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}
{{? !$isData }}
var schema{{=$lvl}} = validate.schema{{=$schemaPath}};
{{?}}
var {{=$valid}} = equal({{=$data}}, schema{{=$lvl}});
{{# def.checkError:'const' }}
{{? $breakOnError }} else { {{?}}
@@ -0,0 +1,625 @@
'use strict'
const { hasOwnProperty } = Object.prototype
const stringify = configure()
// @ts-expect-error
stringify.configure = configure
// @ts-expect-error
stringify.stringify = stringify
// @ts-expect-error
stringify.default = stringify
// @ts-expect-error used for named export
exports.stringify = stringify
// @ts-expect-error used for named export
exports.configure = configure
module.exports = stringify
// eslint-disable-next-line no-control-regex
const strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/
// Escape C0 control characters, double quotes, the backslash and every code
// unit with a numeric value in the inclusive range 0xD800 to 0xDFFF.
function strEscape (str) {
// Some magic numbers that worked out fine while benchmarking with v8 8.0
if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) {
return `"${str}"`
}
return JSON.stringify(str)
}
function sort (array, comparator) {
// Insertion sort is very efficient for small input sizes, but it has a bad
// worst case complexity. Thus, use native array sort for bigger values.
if (array.length > 2e2 || comparator) {
return array.sort(comparator)
}
for (let i = 1; i < array.length; i++) {
const currentValue = array[i]
let position = i
while (position !== 0 && array[position - 1] > currentValue) {
array[position] = array[position - 1]
position--
}
array[position] = currentValue
}
return array
}
const typedArrayPrototypeGetSymbolToStringTag =
Object.getOwnPropertyDescriptor(
Object.getPrototypeOf(
Object.getPrototypeOf(
new Int8Array()
)
),
Symbol.toStringTag
).get
function isTypedArrayWithEntries (value) {
return typedArrayPrototypeGetSymbolToStringTag.call(value) !== undefined && value.length !== 0
}
function stringifyTypedArray (array, separator, maximumBreadth) {
if (array.length < maximumBreadth) {
maximumBreadth = array.length
}
const whitespace = separator === ',' ? '' : ' '
let res = `"0":${whitespace}${array[0]}`
for (let i = 1; i < maximumBreadth; i++) {
res += `${separator}"${i}":${whitespace}${array[i]}`
}
return res
}
function getCircularValueOption (options) {
if (hasOwnProperty.call(options, 'circularValue')) {
const circularValue = options.circularValue
if (typeof circularValue === 'string') {
return `"${circularValue}"`
}
if (circularValue == null) {
return circularValue
}
if (circularValue === Error || circularValue === TypeError) {
return {
toString () {
throw new TypeError('Converting circular structure to JSON')
}
}
}
throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')
}
return '"[Circular]"'
}
function getDeterministicOption (options) {
let value
if (hasOwnProperty.call(options, 'deterministic')) {
value = options.deterministic
if (typeof value !== 'boolean' && typeof value !== 'function') {
throw new TypeError('The "deterministic" argument must be of type boolean or comparator function')
}
}
return value === undefined ? true : value
}
function getBooleanOption (options, key) {
let value
if (hasOwnProperty.call(options, key)) {
value = options[key]
if (typeof value !== 'boolean') {
throw new TypeError(`The "${key}" argument must be of type boolean`)
}
}
return value === undefined ? true : value
}
function getPositiveIntegerOption (options, key) {
let value
if (hasOwnProperty.call(options, key)) {
value = options[key]
if (typeof value !== 'number') {
throw new TypeError(`The "${key}" argument must be of type number`)
}
if (!Number.isInteger(value)) {
throw new TypeError(`The "${key}" argument must be an integer`)
}
if (value < 1) {
throw new RangeError(`The "${key}" argument must be >= 1`)
}
}
return value === undefined ? Infinity : value
}
function getItemCount (number) {
if (number === 1) {
return '1 item'
}
return `${number} items`
}
function getUniqueReplacerSet (replacerArray) {
const replacerSet = new Set()
for (const value of replacerArray) {
if (typeof value === 'string' || typeof value === 'number') {
replacerSet.add(String(value))
}
}
return replacerSet
}
function getStrictOption (options) {
if (hasOwnProperty.call(options, 'strict')) {
const value = options.strict
if (typeof value !== 'boolean') {
throw new TypeError('The "strict" argument must be of type boolean')
}
if (value) {
return (value) => {
let message = `Object can not safely be stringified. Received type ${typeof value}`
if (typeof value !== 'function') message += ` (${value.toString()})`
throw new Error(message)
}
}
}
}
function configure (options) {
options = { ...options }
const fail = getStrictOption(options)
if (fail) {
if (options.bigint === undefined) {
options.bigint = false
}
if (!('circularValue' in options)) {
options.circularValue = Error
}
}
const circularValue = getCircularValueOption(options)
const bigint = getBooleanOption(options, 'bigint')
const deterministic = getDeterministicOption(options)
const comparator = typeof deterministic === 'function' ? deterministic : undefined
const maximumDepth = getPositiveIntegerOption(options, 'maximumDepth')
const maximumBreadth = getPositiveIntegerOption(options, 'maximumBreadth')
function stringifyFnReplacer (key, parent, stack, replacer, spacer, indentation) {
let value = parent[key]
if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {
value = value.toJSON(key)
}
value = replacer.call(parent, key, value)
switch (typeof value) {
case 'string':
return strEscape(value)
case 'object': {
if (value === null) {
return 'null'
}
if (stack.indexOf(value) !== -1) {
return circularValue
}
let res = ''
let join = ','
const originalIndentation = indentation
if (Array.isArray(value)) {
if (value.length === 0) {
return '[]'
}
if (maximumDepth < stack.length + 1) {
return '"[Array]"'
}
stack.push(value)
if (spacer !== '') {
indentation += spacer
res += `\n${indentation}`
join = `,\n${indentation}`
}
const maximumValuesToStringify = Math.min(value.length, maximumBreadth)
let i = 0
for (; i < maximumValuesToStringify - 1; i++) {
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)
res += tmp !== undefined ? tmp : 'null'
res += join
}
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)
res += tmp !== undefined ? tmp : 'null'
if (value.length - 1 > maximumBreadth) {
const removedKeys = value.length - maximumBreadth - 1
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`
}
if (spacer !== '') {
res += `\n${originalIndentation}`
}
stack.pop()
return `[${res}]`
}
let keys = Object.keys(value)
const keyLength = keys.length
if (keyLength === 0) {
return '{}'
}
if (maximumDepth < stack.length + 1) {
return '"[Object]"'
}
let whitespace = ''
let separator = ''
if (spacer !== '') {
indentation += spacer
join = `,\n${indentation}`
whitespace = ' '
}
const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)
if (deterministic && !isTypedArrayWithEntries(value)) {
keys = sort(keys, comparator)
}
stack.push(value)
for (let i = 0; i < maximumPropertiesToStringify; i++) {
const key = keys[i]
const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation)
if (tmp !== undefined) {
res += `${separator}${strEscape(key)}:${whitespace}${tmp}`
separator = join
}
}
if (keyLength > maximumBreadth) {
const removedKeys = keyLength - maximumBreadth
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`
separator = join
}
if (spacer !== '' && separator.length > 1) {
res = `\n${indentation}${res}\n${originalIndentation}`
}
stack.pop()
return `{${res}}`
}
case 'number':
return isFinite(value) ? String(value) : fail ? fail(value) : 'null'
case 'boolean':
return value === true ? 'true' : 'false'
case 'undefined':
return undefined
case 'bigint':
if (bigint) {
return String(value)
}
// fallthrough
default:
return fail ? fail(value) : undefined
}
}
function stringifyArrayReplacer (key, value, stack, replacer, spacer, indentation) {
if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {
value = value.toJSON(key)
}
switch (typeof value) {
case 'string':
return strEscape(value)
case 'object': {
if (value === null) {
return 'null'
}
if (stack.indexOf(value) !== -1) {
return circularValue
}
const originalIndentation = indentation
let res = ''
let join = ','
if (Array.isArray(value)) {
if (value.length === 0) {
return '[]'
}
if (maximumDepth < stack.length + 1) {
return '"[Array]"'
}
stack.push(value)
if (spacer !== '') {
indentation += spacer
res += `\n${indentation}`
join = `,\n${indentation}`
}
const maximumValuesToStringify = Math.min(value.length, maximumBreadth)
let i = 0
for (; i < maximumValuesToStringify - 1; i++) {
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)
res += tmp !== undefined ? tmp : 'null'
res += join
}
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)
res += tmp !== undefined ? tmp : 'null'
if (value.length - 1 > maximumBreadth) {
const removedKeys = value.length - maximumBreadth - 1
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`
}
if (spacer !== '') {
res += `\n${originalIndentation}`
}
stack.pop()
return `[${res}]`
}
stack.push(value)
let whitespace = ''
if (spacer !== '') {
indentation += spacer
join = `,\n${indentation}`
whitespace = ' '
}
let separator = ''
for (const key of replacer) {
const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation)
if (tmp !== undefined) {
res += `${separator}${strEscape(key)}:${whitespace}${tmp}`
separator = join
}
}
if (spacer !== '' && separator.length > 1) {
res = `\n${indentation}${res}\n${originalIndentation}`
}
stack.pop()
return `{${res}}`
}
case 'number':
return isFinite(value) ? String(value) : fail ? fail(value) : 'null'
case 'boolean':
return value === true ? 'true' : 'false'
case 'undefined':
return undefined
case 'bigint':
if (bigint) {
return String(value)
}
// fallthrough
default:
return fail ? fail(value) : undefined
}
}
function stringifyIndent (key, value, stack, spacer, indentation) {
switch (typeof value) {
case 'string':
return strEscape(value)
case 'object': {
if (value === null) {
return 'null'
}
if (typeof value.toJSON === 'function') {
value = value.toJSON(key)
// Prevent calling `toJSON` again.
if (typeof value !== 'object') {
return stringifyIndent(key, value, stack, spacer, indentation)
}
if (value === null) {
return 'null'
}
}
if (stack.indexOf(value) !== -1) {
return circularValue
}
const originalIndentation = indentation
if (Array.isArray(value)) {
if (value.length === 0) {
return '[]'
}
if (maximumDepth < stack.length + 1) {
return '"[Array]"'
}
stack.push(value)
indentation += spacer
let res = `\n${indentation}`
const join = `,\n${indentation}`
const maximumValuesToStringify = Math.min(value.length, maximumBreadth)
let i = 0
for (; i < maximumValuesToStringify - 1; i++) {
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)
res += tmp !== undefined ? tmp : 'null'
res += join
}
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)
res += tmp !== undefined ? tmp : 'null'
if (value.length - 1 > maximumBreadth) {
const removedKeys = value.length - maximumBreadth - 1
res += `${join}"... ${getItemCount(removedKeys)} not stringified"`
}
res += `\n${originalIndentation}`
stack.pop()
return `[${res}]`
}
let keys = Object.keys(value)
const keyLength = keys.length
if (keyLength === 0) {
return '{}'
}
if (maximumDepth < stack.length + 1) {
return '"[Object]"'
}
indentation += spacer
const join = `,\n${indentation}`
let res = ''
let separator = ''
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)
if (isTypedArrayWithEntries(value)) {
res += stringifyTypedArray(value, join, maximumBreadth)
keys = keys.slice(value.length)
maximumPropertiesToStringify -= value.length
separator = join
}
if (deterministic) {
keys = sort(keys, comparator)
}
stack.push(value)
for (let i = 0; i < maximumPropertiesToStringify; i++) {
const key = keys[i]
const tmp = stringifyIndent(key, value[key], stack, spacer, indentation)
if (tmp !== undefined) {
res += `${separator}${strEscape(key)}: ${tmp}`
separator = join
}
}
if (keyLength > maximumBreadth) {
const removedKeys = keyLength - maximumBreadth
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`
separator = join
}
if (separator !== '') {
res = `\n${indentation}${res}\n${originalIndentation}`
}
stack.pop()
return `{${res}}`
}
case 'number':
return isFinite(value) ? String(value) : fail ? fail(value) : 'null'
case 'boolean':
return value === true ? 'true' : 'false'
case 'undefined':
return undefined
case 'bigint':
if (bigint) {
return String(value)
}
// fallthrough
default:
return fail ? fail(value) : undefined
}
}
function stringifySimple (key, value, stack) {
switch (typeof value) {
case 'string':
return strEscape(value)
case 'object': {
if (value === null) {
return 'null'
}
if (typeof value.toJSON === 'function') {
value = value.toJSON(key)
// Prevent calling `toJSON` again
if (typeof value !== 'object') {
return stringifySimple(key, value, stack)
}
if (value === null) {
return 'null'
}
}
if (stack.indexOf(value) !== -1) {
return circularValue
}
let res = ''
const hasLength = value.length !== undefined
if (hasLength && Array.isArray(value)) {
if (value.length === 0) {
return '[]'
}
if (maximumDepth < stack.length + 1) {
return '"[Array]"'
}
stack.push(value)
const maximumValuesToStringify = Math.min(value.length, maximumBreadth)
let i = 0
for (; i < maximumValuesToStringify - 1; i++) {
const tmp = stringifySimple(String(i), value[i], stack)
res += tmp !== undefined ? tmp : 'null'
res += ','
}
const tmp = stringifySimple(String(i), value[i], stack)
res += tmp !== undefined ? tmp : 'null'
if (value.length - 1 > maximumBreadth) {
const removedKeys = value.length - maximumBreadth - 1
res += `,"... ${getItemCount(removedKeys)} not stringified"`
}
stack.pop()
return `[${res}]`
}
let keys = Object.keys(value)
const keyLength = keys.length
if (keyLength === 0) {
return '{}'
}
if (maximumDepth < stack.length + 1) {
return '"[Object]"'
}
let separator = ''
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)
if (hasLength && isTypedArrayWithEntries(value)) {
res += stringifyTypedArray(value, ',', maximumBreadth)
keys = keys.slice(value.length)
maximumPropertiesToStringify -= value.length
separator = ','
}
if (deterministic) {
keys = sort(keys, comparator)
}
stack.push(value)
for (let i = 0; i < maximumPropertiesToStringify; i++) {
const key = keys[i]
const tmp = stringifySimple(key, value[key], stack)
if (tmp !== undefined) {
res += `${separator}${strEscape(key)}:${tmp}`
separator = ','
}
}
if (keyLength > maximumBreadth) {
const removedKeys = keyLength - maximumBreadth
res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`
}
stack.pop()
return `{${res}}`
}
case 'number':
return isFinite(value) ? String(value) : fail ? fail(value) : 'null'
case 'boolean':
return value === true ? 'true' : 'false'
case 'undefined':
return undefined
case 'bigint':
if (bigint) {
return String(value)
}
// fallthrough
default:
return fail ? fail(value) : undefined
}
}
function stringify (value, replacer, space) {
if (arguments.length > 1) {
let spacer = ''
if (typeof space === 'number') {
spacer = ' '.repeat(Math.min(space, 10))
} else if (typeof space === 'string') {
spacer = space.slice(0, 10)
}
if (replacer != null) {
if (typeof replacer === 'function') {
return stringifyFnReplacer('', { '': value }, [], replacer, spacer, '')
}
if (Array.isArray(replacer)) {
return stringifyArrayReplacer('', value, [], getUniqueReplacerSet(replacer), spacer, '')
}
}
if (spacer.length !== 0) {
return stringifyIndent('', value, [], spacer, '')
}
}
return stringifySimple('', value, [])
}
return stringify
}
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: ljharb
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/is-negative-zero
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,72 @@
'use strict';var _path = require('path');var _path2 = _interopRequireDefault(_path);
var _readPkgUp = require('eslint-module-utils/readPkgUp');var _readPkgUp2 = _interopRequireDefault(_readPkgUp);
var _contextCompat = require('eslint-module-utils/contextCompat');
var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve);
var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor);
var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType);
var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}
/** @param {string} filePath */
function toPosixPath(filePath) {
return filePath.replace(/\\/g, '/');
}
function findNamedPackage(filePath) {
var found = (0, _readPkgUp2['default'])({ cwd: filePath });
if (found.pkg && !found.pkg.name) {
return findNamedPackage(_path2['default'].join(found.path, '../..'));
}
return found;
}
function checkImportForRelativePackage(context, importPath, node) {
var potentialViolationTypes = ['parent', 'index', 'sibling'];
if (potentialViolationTypes.indexOf((0, _importType2['default'])(importPath, context)) === -1) {
return;
}
var resolvedImport = (0, _resolve2['default'])(importPath, context);
var resolvedContext = (0, _contextCompat.getPhysicalFilename)(context);
if (!resolvedImport || !resolvedContext) {
return;
}
var importPkg = findNamedPackage(resolvedImport);
var contextPkg = findNamedPackage(resolvedContext);
if (importPkg.pkg && contextPkg.pkg && importPkg.pkg.name !== contextPkg.pkg.name) {
var importBaseName = _path2['default'].basename(importPath);
var importRoot = _path2['default'].dirname(importPkg.path);
var properPath = _path2['default'].relative(importRoot, resolvedImport);
var properImport = _path2['default'].join(
importPkg.pkg.name,
_path2['default'].dirname(properPath),
importBaseName === _path2['default'].basename(importRoot) ? '' : importBaseName);
context.report({
node: node,
message: 'Relative import from another package is not allowed. Use `' + String(properImport) + '` instead of `' + String(importPath) + '`',
fix: function () {function fix(fixer) {return fixer.replaceText(node, JSON.stringify(toPosixPath(properImport)));}return fix;}() });
}
}
module.exports = {
meta: {
type: 'suggestion',
docs: {
category: 'Static analysis',
description: 'Forbid importing packages through relative paths.',
url: (0, _docsUrl2['default'])('no-relative-packages') },
fixable: 'code',
schema: [(0, _moduleVisitor.makeOptionsSchema)()] },
create: function () {function create(context) {
return (0, _moduleVisitor2['default'])(function (source) {return checkImportForRelativePackage(context, source.value, source);}, context.options[0]);
}return create;}() };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1yZWxhdGl2ZS1wYWNrYWdlcy5qcyJdLCJuYW1lcyI6WyJ0b1Bvc2l4UGF0aCIsImZpbGVQYXRoIiwicmVwbGFjZSIsImZpbmROYW1lZFBhY2thZ2UiLCJmb3VuZCIsImN3ZCIsInBrZyIsIm5hbWUiLCJwYXRoIiwiam9pbiIsImNoZWNrSW1wb3J0Rm9yUmVsYXRpdmVQYWNrYWdlIiwiY29udGV4dCIsImltcG9ydFBhdGgiLCJub2RlIiwicG90ZW50aWFsVmlvbGF0aW9uVHlwZXMiLCJpbmRleE9mIiwicmVzb2x2ZWRJbXBvcnQiLCJyZXNvbHZlZENvbnRleHQiLCJpbXBvcnRQa2ciLCJjb250ZXh0UGtnIiwiaW1wb3J0QmFzZU5hbWUiLCJiYXNlbmFtZSIsImltcG9ydFJvb3QiLCJkaXJuYW1lIiwicHJvcGVyUGF0aCIsInJlbGF0aXZlIiwicHJvcGVySW1wb3J0IiwicmVwb3J0IiwibWVzc2FnZSIsImZpeCIsImZpeGVyIiwicmVwbGFjZVRleHQiLCJKU09OIiwic3RyaW5naWZ5IiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJ1cmwiLCJmaXhhYmxlIiwic2NoZW1hIiwiY3JlYXRlIiwic291cmNlIiwidmFsdWUiLCJvcHRpb25zIl0sIm1hcHBpbmdzIjoiYUFBQSw0QjtBQUNBLDBEOztBQUVBO0FBQ0Esc0Q7QUFDQSxrRTtBQUNBLGdEO0FBQ0EscUM7O0FBRUE7QUFDQSxTQUFTQSxXQUFULENBQXFCQyxRQUFyQixFQUErQjtBQUM3QixTQUFPQSxTQUFTQyxPQUFULENBQWlCLEtBQWpCLEVBQXdCLEdBQXhCLENBQVA7QUFDRDs7QUFFRCxTQUFTQyxnQkFBVCxDQUEwQkYsUUFBMUIsRUFBb0M7QUFDbEMsTUFBTUcsUUFBUSw0QkFBVSxFQUFFQyxLQUFLSixRQUFQLEVBQVYsQ0FBZDtBQUNBLE1BQUlHLE1BQU1FLEdBQU4sSUFBYSxDQUFDRixNQUFNRSxHQUFOLENBQVVDLElBQTVCLEVBQWtDO0FBQ2hDLFdBQU9KLGlCQUFpQkssa0JBQUtDLElBQUwsQ0FBVUwsTUFBTUksSUFBaEIsRUFBc0IsT0FBdEIsQ0FBakIsQ0FBUDtBQUNEO0FBQ0QsU0FBT0osS0FBUDtBQUNEOztBQUVELFNBQVNNLDZCQUFULENBQXVDQyxPQUF2QyxFQUFnREMsVUFBaEQsRUFBNERDLElBQTVELEVBQWtFO0FBQ2hFLE1BQU1DLDBCQUEwQixDQUFDLFFBQUQsRUFBVyxPQUFYLEVBQW9CLFNBQXBCLENBQWhDO0FBQ0EsTUFBSUEsd0JBQXdCQyxPQUF4QixDQUFnQyw2QkFBV0gsVUFBWCxFQUF1QkQsT0FBdkIsQ0FBaEMsTUFBcUUsQ0FBQyxDQUExRSxFQUE2RTtBQUMzRTtBQUNEOztBQUVELE1BQU1LLGlCQUFpQiwwQkFBUUosVUFBUixFQUFvQkQsT0FBcEIsQ0FBdkI7QUFDQSxNQUFNTSxrQkFBa0Isd0NBQW9CTixPQUFwQixDQUF4Qjs7QUFFQSxNQUFJLENBQUNLLGNBQUQsSUFBbUIsQ0FBQ0MsZUFBeEIsRUFBeUM7QUFDdkM7QUFDRDs7QUFFRCxNQUFNQyxZQUFZZixpQkFBaUJhLGNBQWpCLENBQWxCO0FBQ0EsTUFBTUcsYUFBYWhCLGlCQUFpQmMsZUFBakIsQ0FBbkI7O0FBRUEsTUFBSUMsVUFBVVosR0FBVixJQUFpQmEsV0FBV2IsR0FBNUIsSUFBbUNZLFVBQVVaLEdBQVYsQ0FBY0MsSUFBZCxLQUF1QlksV0FBV2IsR0FBWCxDQUFlQyxJQUE3RSxFQUFtRjtBQUNqRixRQUFNYSxpQkFBaUJaLGtCQUFLYSxRQUFMLENBQWNULFVBQWQsQ0FBdkI7QUFDQSxRQUFNVSxhQUFhZCxrQkFBS2UsT0FBTCxDQUFhTCxVQUFVVixJQUF2QixDQUFuQjtBQUNBLFFBQU1nQixhQUFhaEIsa0JBQUtpQixRQUFMLENBQWNILFVBQWQsRUFBMEJOLGNBQTFCLENBQW5CO0FBQ0EsUUFBTVUsZUFBZWxCLGtCQUFLQyxJQUFMO0FBQ25CUyxjQUFVWixHQUFWLENBQWNDLElBREs7QUFFbkJDLHNCQUFLZSxPQUFMLENBQWFDLFVBQWIsQ0FGbUI7QUFHbkJKLHVCQUFtQlosa0JBQUthLFFBQUwsQ0FBY0MsVUFBZCxDQUFuQixHQUErQyxFQUEvQyxHQUFvREYsY0FIakMsQ0FBckI7O0FBS0FULFlBQVFnQixNQUFSLENBQWU7QUFDYmQsZ0JBRGE7QUFFYmUscUZBQXVFRixZQUF2RSw4QkFBc0dkLFVBQXRHLE9BRmE7QUFHYmlCLHdCQUFLLGFBQUNDLEtBQUQsVUFBV0EsTUFBTUMsV0FBTixDQUFrQmxCLElBQWxCLEVBQXdCbUIsS0FBS0MsU0FBTCxDQUFlakMsWUFBWTBCLFlBQVosQ0FBZixDQUF4QixDQUFYLEVBQUwsY0FIYSxFQUFmOzs7QUFNRDtBQUNGOztBQUVEUSxPQUFPQyxPQUFQLEdBQWlCO0FBQ2ZDLFFBQU07QUFDSkMsVUFBTSxZQURGO0FBRUpDLFVBQU07QUFDSkMsZ0JBQVUsaUJBRE47QUFFSkMsbUJBQWEsbURBRlQ7QUFHSkMsV0FBSywwQkFBUSxzQkFBUixDQUhELEVBRkY7O0FBT0pDLGFBQVMsTUFQTDtBQVFKQyxZQUFRLENBQUMsdUNBQUQsQ0FSSixFQURTOzs7QUFZZkMsUUFaZSwrQkFZUmpDLE9BWlEsRUFZQztBQUNkLGFBQU8sZ0NBQWMsVUFBQ2tDLE1BQUQsVUFBWW5DLDhCQUE4QkMsT0FBOUIsRUFBdUNrQyxPQUFPQyxLQUE5QyxFQUFxREQsTUFBckQsQ0FBWixFQUFkLEVBQXdGbEMsUUFBUW9DLE9BQVIsQ0FBZ0IsQ0FBaEIsQ0FBeEYsQ0FBUDtBQUNELEtBZGMsbUJBQWpCIiwiZmlsZSI6Im5vLXJlbGF0aXZlLXBhY2thZ2VzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHBhdGggZnJvbSAncGF0aCc7XG5pbXBvcnQgcmVhZFBrZ1VwIGZyb20gJ2VzbGludC1tb2R1bGUtdXRpbHMvcmVhZFBrZ1VwJztcblxuaW1wb3J0IHsgZ2V0UGh5c2ljYWxGaWxlbmFtZSB9IGZyb20gJ2VzbGludC1tb2R1bGUtdXRpbHMvY29udGV4dENvbXBhdCc7XG5pbXBvcnQgcmVzb2x2ZSBmcm9tICdlc2xpbnQtbW9kdWxlLXV0aWxzL3Jlc29sdmUnO1xuaW1wb3J0IG1vZHVsZVZpc2l0b3IsIHsgbWFrZU9wdGlvbnNTY2hlbWEgfSBmcm9tICdlc2xpbnQtbW9kdWxlLXV0aWxzL21vZHVsZVZpc2l0b3InO1xuaW1wb3J0IGltcG9ydFR5cGUgZnJvbSAnLi4vY29yZS9pbXBvcnRUeXBlJztcbmltcG9ydCBkb2NzVXJsIGZyb20gJy4uL2RvY3NVcmwnO1xuXG4vKiogQHBhcmFtIHtzdHJpbmd9IGZpbGVQYXRoICovXG5mdW5jdGlvbiB0b1Bvc2l4UGF0aChmaWxlUGF0aCkge1xuICByZXR1cm4gZmlsZVBhdGgucmVwbGFjZSgvXFxcXC9nLCAnLycpO1xufVxuXG5mdW5jdGlvbiBmaW5kTmFtZWRQYWNrYWdlKGZpbGVQYXRoKSB7XG4gIGNvbnN0IGZvdW5kID0gcmVhZFBrZ1VwKHsgY3dkOiBmaWxlUGF0aCB9KTtcbiAgaWYgKGZvdW5kLnBrZyAmJiAhZm91bmQucGtnLm5hbWUpIHtcbiAgICByZXR1cm4gZmluZE5hbWVkUGFja2FnZShwYXRoLmpvaW4oZm91bmQucGF0aCwgJy4uLy4uJykpO1xuICB9XG4gIHJldHVybiBmb3VuZDtcbn1cblxuZnVuY3Rpb24gY2hlY2tJbXBvcnRGb3JSZWxhdGl2ZVBhY2thZ2UoY29udGV4dCwgaW1wb3J0UGF0aCwgbm9kZSkge1xuICBjb25zdCBwb3RlbnRpYWxWaW9sYXRpb25UeXBlcyA9IFsncGFyZW50JywgJ2luZGV4JywgJ3NpYmxpbmcnXTtcbiAgaWYgKHBvdGVudGlhbFZpb2xhdGlvblR5cGVzLmluZGV4T2YoaW1wb3J0VHlwZShpbXBvcnRQYXRoLCBjb250ZXh0KSkgPT09IC0xKSB7XG4gICAgcmV0dXJuO1xuICB9XG5cbiAgY29uc3QgcmVzb2x2ZWRJbXBvcnQgPSByZXNvbHZlKGltcG9ydFBhdGgsIGNvbnRleHQpO1xuICBjb25zdCByZXNvbHZlZENvbnRleHQgPSBnZXRQaHlzaWNhbEZpbGVuYW1lKGNvbnRleHQpO1xuXG4gIGlmICghcmVzb2x2ZWRJbXBvcnQgfHwgIXJlc29sdmVkQ29udGV4dCkge1xuICAgIHJldHVybjtcbiAgfVxuXG4gIGNvbnN0IGltcG9ydFBrZyA9IGZpbmROYW1lZFBhY2thZ2UocmVzb2x2ZWRLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"index.exports.require.cjs.js","sources":["../src/guard.ts","../src/ColorError.ts","../src/parseToRgba.ts","../src/parseToHsla.ts","../src/hsla.ts","../src/adjustHue.ts","../src/darken.ts","../src/desaturate.ts","../src/getLuminance.ts","../src/getContrast.ts","../src/rgba.ts","../src/mix.ts","../src/getScale.ts","../src/hasBadContrast.ts","../src/lighten.ts","../src/transparentize.ts","../src/opacify.ts","../src/readableColorIsBlack.ts","../src/readableColor.ts","../src/saturate.ts","../src/toHex.ts","../src/toRgba.ts","../src/toHsla.ts"],"sourcesContent":["/**\n * A simple guard function:\n *\n * ```js\n * Math.min(Math.max(low, value), high)\n * ```\n */\nfunction guard(low: number, high: number, value: number): number {\n return Math.min(Math.max(low, value), high);\n}\n\nexport default guard;\n","class ColorError extends Error {\n constructor(color: string) {\n super(`Failed to parse color: \"${color}\"`);\n }\n}\n\nexport default ColorError;\n","import guard from './guard';\nimport ColorError from './ColorError';\n\n/**\n * Parses a color into red, gree, blue, alpha parts\n *\n * @param color the input color. Can be a RGB, RBGA, HSL, HSLA, or named color\n */\nfunction parseToRgba(color: string): [number, number, number, number] {\n if (typeof color !== 'string') throw new ColorError(color);\n if (color.trim().toLowerCase() === 'transparent') return [0, 0, 0, 0];\n\n let normalizedColor = color.trim();\n normalizedColor = namedColorRegex.test(color) ? nameToHex(color) : color;\n\n const reducedHexMatch = reducedHexRegex.exec(normalizedColor);\n if (reducedHexMatch) {\n const arr = Array.from(reducedHexMatch).slice(1);\n return [\n ...arr.slice(0, 3).map((x) => parseInt(r(x, 2), 16)),\n parseInt(r(arr[3] || 'f', 2), 16) / 255,\n ] as [number, number, number, number];\n }\n\n const hexMatch = hexRegex.exec(normalizedColor);\n if (hexMatch) {\n const arr = Array.from(hexMatch).slice(1);\n return [\n ...arr.slice(0, 3).map((x) => parseInt(x, 16)),\n parseInt(arr[3] || 'ff', 16) / 255,\n ] as [number, number, number, number];\n }\n\n const rgbaMatch = rgbaRegex.exec(normalizedColor);\n if (rgbaMatch) {\n const arr = Array.from(rgbaMatch).slice(1);\n return [\n ...arr.slice(0, 3).map((x) => parseInt(x, 10)),\n parseFloat(arr[3] || '1'),\n ] as [number, number, number, number];\n }\n\n const hslaMatch = hslaRegex.exec(normalizedColor);\n if (hslaMatch) {\n const [h, s, l, a] = Array.from(hslaMatch).slice(1).map(parseFloat);\n if (guard(0, 100, s) !== s) throw new ColorError(color);\n if (guard(0, 100, l) !== l) throw new ColorError(color);\n return [...hslToRgb(h, s, l), Number.isNaN(a) ? 1 : a] as [\n number,\n number,\n number,\n number\n ];\n }\n\n throw new ColorError(color);\n}\n\nfunction hash(str: string) {\n let hash = 5381;\n let i = str.length;\n\n while (i) {\n hash = (hash * 33) ^ str.charCodeAt(--i);\n }\n\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return (hash >>> 0) % 2341;\n}\n\nconst colorToInt = (x: string) => parseInt(x.replace(/_/g, ''), 36);\n\nconst compressedColorMap =\n '1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm'\n .split(' ')\n .reduce((acc, next) => {\n const key = colorToInt(next.substring(0, 3));\n const hex = colorToInt(next.substring(3)).toString(16);\n\n // NOTE: padStart could be used here but it breaks Node 6 compat\n // https://github.com/ricokahler/color2k/issues/351Line truncated
@@ -0,0 +1,8 @@
"use client";
import {
image_default
} from "./chunk-MLPFQTYO.mjs";
import "./chunk-DSOLHU5M.mjs";
export {
image_default as default
};
@@ -0,0 +1,40 @@
{
"name": "indent-string",
"version": "5.0.0",
"description": "Indent each line in a string",
"license": "MIT",
"repository": "sindresorhus/indent-string",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"indent",
"string",
"pad",
"align",
"line",
"text",
"each",
"every"
],
"devDependencies": {
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.38.2"
}
}
@@ -0,0 +1,9 @@
#!/bin/bash
set -e
name=$1
name=${name%.}
name=${name%.cc}
name=${name%.exe}
echo Compiling $name.cc to $name.exe
x86_64-w64-mingw32-g++.exe -static -std=c++11 $name.cc -o $name.exe
x86_64-w64-mingw32-strip $name.exe
@@ -0,0 +1,922 @@
flf2aQ 9 6 21 0 3 0 64 0
Font Author: half Cosmike, half Darth ObiKy
FIGFont created with: http://patorjk.com/figfont-editor
QQQ@
QQQ@
QQQ@
QQQ@
QQQ@
QQQ@
QQQ@
QQQ@
QQQ@@
.:@
;;;@
'[[@
$$@
""@
MM@
@
@
@@
Q:: ::Q@
Q"; ;"Q@
@
@
@
@
@
@
@@
@
:: :: @
__,;'_,;'_@
''[[''[[''@
,$" ,$" @
o88oo88oo @
,M" ,M" @
@
@@
@
.: @
,;;;. @
[[,,_` @
`"""Yo@
Yo_,d"@
'M' @
@
@@
@
.. .:`@
; ; ,;` @
^^ ,[` @
cP ,, @
,8" 8 8@
,dP "" @
@
@@
@
:\ @
.;;' @
([__ @
c$"" @
"Yo,oP@
"M,@
@
@@
::@
,'@
@
@
@
@
@
@
@@
.:@
,;' @
n[ @
Y$ @
8o,@
"M@
@
@
@@
:. @
';,@
[n@
$Y@
,o8 @
M" @
@
@
@@
@
\|/@
/|\@
@
@
@
@
@
@@
@
@
[ @
Q$$$$$Q@
8 @
@
@
@
@@
@
@
@
@
@
d8b@
,M"@
@
@@
@
@
@
QccccQ@
@
@
@
@
@@
@
@
@
@
d8b@
YMP@
@
@
@@
/:`@
/;` @
n[' @
c$" @
o8" @
mM" @
@
@
@@
@
,;;, @
,[' [n @
$$ $$@
Y8, ,8"@
"YmmP @
@
@
@@
:. @
.;; @
[[ @
$$ @
88 @
MMMM@
@
@
@@
.:::. @
,;'``;. @
'' ,[['@
.c$$P' @
d88 _,oo,@
MMMUP*"^^@
@
@
@@
.::. @
;'`';;, @
.n[[ @
``"$$$.@
,,o888"@
YMMP" @
@
@
@@
.:: @
,;';; @
,[' [[ @
$P__$$c@
`"""88"@
MM @
@
@
@@
::::::::@
`;;``'';@
[[,_ @
`""*Ycc@
__,od8"@
MMP" @
@
@
@@
.:. @
,;' @
,[[.od8b @
$$$" "$$@
Y8b,,d8P@
"YMP" @
@
@
@@
...:::::@
'''``;;'@
.[' @
,$$' @
888 @
MMM @
@
@
@@
.::::. @
`;. ,;'@
[nn[, @
$" $c@
Yb,_,8P@
"YMP" @
@
@
@@
.,,. @
,;;'`';,@
[[, _,[[@
Y$$P"$$@
,,_,d8"@
"MP" @
@
@
@@
@
,;,@
'['@
@
d8b@
YMP@
@
@
@@
@
,;,@
'['@
@
d8b@
,M"@
@
@
@@
@
,,@
,[['@
c$ @
"8bo,@
"MP@
@
@
@@
@
Q,,,,,Q@
Q""""Q@
QooooQ@
Q""""Q@
@
@
@
@@
@
,, @
'[[, @
$c@
,od8"@
YM" @
@
@
@@
.-::::-.@
;;'```;;;@
,n[[' @
d$P" @
"" @
MM @
@
@
@@
.:::''''''':::. @
;;' ,;;;;;;,.; `;.@
:[[ [. .['[[ [[@
$$, 'Y$$$P'Y$$P' @
'Y8o,_ __,oo @
`"YUMMMMMMUY" @
@
@
@@
:::. @
;;`;; @
,[[ '[[, @
c$$$cc$$$c @
888 888 @
YMM \"\"`@
@
@
@@
:::::::. @
;;;'';;' @
[[[__[[\.@
$$""""Y$$@
_88o,,od8P@
""YUMMMP" @
@
@
@@
.,~::::: @
,;;;'````' @
[[[ @
$$$ @
`88bo,__,o, @
"YUMMMMMP"@
@
@
@@
:::::::-. @
;;, `';,@
`[[ [[@
$$, $$@
888_,o8P'@
MMMMP"` @
@
@
@@
.,:::::: @
;;;;'''' @
[[cccc @
$$"""" @
888oo,__ @
""""YUMMM@
@
@
@@
.-:::::'@
;;;'''' @
[[[,,== @
`$$$"`` @
888 @
"MM, @
@
@
@@
.,-:::::/ @
,;;-'````' @
[[[ [[[[[[/@
"$$c. "$$ @
`Y8bo,,,o88o@
`'YMUP"YMM@
@
@
@@
:: .: @
,;; ;;, @
,[[[,,,[[[ @
"$$$"""$$$ @
888 "88o@
MMM YMM@
@
@
@@
:::@
;;;@
[[[@
$$$@
888@
MMM@
@
@
@@
....::::::@
;;;;;;;;;````@
''` `[[. @
,,, `$$ @
888boood88 @
"MMMMMMMM" @
@
@
@@
::: . @
;;; .;;,.@
[[[[[/' @
_$$$$, @
"888"88o, @
MMM "MMP"@
@
@
@@
::: @
;;; @
[[[ @
$$' @
o88oo,.__@
""""YUMMM@
@
@
@@
. : @
;;,. ;;; @
[[[[, ,[[[[, @
$$$$$$$$"$$$ @
888 Y88" 888o@
MMM M' "MMM@
@
@
@@
:::. :::.@
`;;;;, `;;;@
[[[[[. '[[@
$$$ "Y$c$$@
888 Y88@
MMM YM@
@
@
@@
... @
.;;;;;;;. @
,[[ \[[,@
$$$, $$$@
"888,_ _,88P@
"YMMMMMP" @
@
@
@@
::::::::::. @
`;;;```.;;;@
`]]nnn]]' @
$$$"" @
888o @
YMMMb @
@
@
@@
.::::::. @
,;;'```';;, @
[[[ [[[\@
"$$c cc$$$"@
"*8bo,Y88b,@
"*YP" "M"@
@
@
@@
:::::::.. @
;;;;``;;;; @
[[[,/[[[' @
$$$$$$c @
888b "88bo,@
MMMM "W" @
@
@
@@
.::::::. @
;;;` ` @
'[==/[[[[,@
''' $@
88b dP@
"YMmMY" @
@
@
@@
::::::::::::@
;;;;;;;;''''@
[[ @
$$ @
88, @
MMM @
@
@
@@
... :::@
;; ;;;@
[[' [[[@
$$ $$$@
88 .d888@
"YmmMMMM""@
@
@
@@
::: .::.@
';;, ,;;;' @
\[[ .[[/ @
Y$c.$$" @
Y88P @
MP @
@
@
@@
.:: . .:::@
';;, ;; ;;;' @
'[[, [[, [[' @
Y$c$$$c$P @
"88"888 @
"M "M" @
@
@
@@
.,:: .:@
`;;;, .,;; @
'[[,,[[' @
Y$$$P @
oP"``"Yo, @
,m" "Mm,@
@
@
@@
.-:. ::-.@
';;. ;;;;'@
'[[,[[[' @
c$$" @
,8P"` @
mM" @
@
@
@@
:::::::::@
'`````;;;@
.n[['@
,$$P" @
,888bo,_ @
`""*UMM @
@
@
@@
::::@
;;' @
[[ @
$$ @
88, @
"YMM@
@
@
@@
`:\ @
`;\ @
'[n @
"$c @
"8o @
"Mm@
@
@
@@
::::@
';;@
[[@
$$@
,88@
MMP"@
@
@
@@
.:. @
;' `;@
@
@
@
@
@
@
@@
@
@
@
@
@
@
mmmmmmm@
@
@@
`:. @
`;,@
@
@
@
@
@
@
@@
@
@
,ccc, @
$$$cc$$$ @
888 888@
"YUM" MP@
@
@
@@
:: @
;;; @
[[[[ccc, @
$$""""Y$$@
88o,,od8P@
"YUMMMP" @
@
@
@@
@
@
,cc[[[cc. @
$$$ @
88b ,o,@
"YUMMMMP"@
@
@
@@
:: @
;;;@
,c[[[cc,@
$$""""Y$$@
88o,,od8P@
"YUMMMP" @
@
@
@@
@
@
,cc[[[cc. @
$$$___--' @
88b ,o,@
"YUMMMMP"@
@
@
@@
.::::.@
;; `'@
=[[,,==@
`$$$"``@
888 @
"MM, @
@
@
@@
@
@
,ccc, @
$$$cc$$$ @
888 888@
"YUM" MP@
MMM@
,c. ###@
\M###MMU @@
:: @
;;; @
[[[[cc,,. @
$$$"""$$$ @
888 "88o@
MMM YMM@
@
@
@@
@
;;,@
@
$$$@
888@
MMM@
@
@
@@
@
;;,@
@
`[.@
`[[@
`$$@
,,, /88@
888boood88@
"MMMMMMMM"@@
::: @
;;; .;;, @
[[[[[/' @
_$$$$, @
"888"88o, @
MMM "MMP"@
@
@
@@
`::. @
;;; @
[[[ @
$$' @
\8o @
MM;@
@
@
@@
@
@
[ccc, ,cccc, @
$$$$$$$$"$$$ @
888 Y88" 888o@
MMM M' "MMM@
@
@
@@
@
@
[ccccc, @
$$$$"$$$ @
888 Y88o@
MMM "MMM@
@
@
@@
@
@
,ccc, @
$$$"c$$$@
888 88@
"YUMMP @
@
@
@@
@
@
@
,$$$$$. @
88""""88@
MMoooMM'@
MMMP @
### @
"##b @@
@
@
,ccc, @
$$$cc$$$ @
888 888 @
"YUM" MP @
MMM @
### ,c.@
\M###MMP @@
@
@
=,,[[==@
`$$$"``@
888 @
"MM, @
@
@
@@
@
@
,cc[[[cc. @
$$$____ @
. 88,@
"YUMMMMP"@
@
@
@@
`:: @
;; @
=[[[[[[.@
$$ @
88, @
MMM @
@
@
@@
@
@
,c , @
$$' $$$ @
888 888@
"YUM" MP@
@
@
@@
@
@
\[[ .[[/@
Y$c $$" @
Y88P @
MP @
@
@
@@
@
@
'[[, [[, [['@
Y$ $$$ $P @
"88"888 @
"M "M" @
@
@
@@
@
@
'[[ ,c' @
Y$$$P @
oP``Yo, @
,m" "Mm,@
@
@
@@
@
@
@
`$$$ $P@
88b 88 @
'MooMM @
MM @
##" @
m##" @@
@
@
.nnnnn[['@
,$$P" @
,888bo,_ @
`""*UMM @
@
@
@@
.:@
;'@
[@
$"@
8 @
"M@
@
@
@@
`:@
,;@
[[@
$$@
88@
MM@
##@
@
@@
:.@
';@
[ @
"$@
8@
M"@
@
@
@@
@
@
':.:':.@
`;' `;@
@
@
@
@
@@
:: ::. :: @
;;`;; @
,[[ '[[, @
c$$$cc$$$c @
888 888,@
YMM ""` @
@
@
@@
:: ... :: @
.;;;;;;;. @
,[[ \[[,@
$$$, $$$@
"888,_ _,88P@
"YMMMMMP" @
@
@
@@
..:: :: ::@
;; ;;;@
[[' [[[@
$$ $$$@
88 .d888@
"YmmMMMM""@
@
@
@@
@
;; ;; @
,ccc, @
$$$cc$$$ @
888 888@
"YUM" MP@
@
@
@@
@
;; ;; @
,ccc, @
$$$"c$$$@
888 88@
"YUMMP @
@
@
@@
@
;; ;; @
,c , @
$$' $$$ @
888 888@
"YUM" MP@
@
@
@@
:::::::. @
;;;'';;' @
[[[__[[\.@
$$""""Y$$@
88o,,od8P@
MM`YMMP" @
@
@
@@
@@ -0,0 +1,81 @@
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "getChildNodes", () => $7a155683b0d79a6a$export$1005530eda016c13);
$parcel$export(module.exports, "getFirstItem", () => $7a155683b0d79a6a$export$fbdeaa6a76694f71);
$parcel$export(module.exports, "getNthItem", () => $7a155683b0d79a6a$export$5f3398f8733f90e2);
$parcel$export(module.exports, "getLastItem", () => $7a155683b0d79a6a$export$7475b2c64539e4cf);
$parcel$export(module.exports, "compareNodeOrder", () => $7a155683b0d79a6a$export$8c434b3a7a4dad6);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $7a155683b0d79a6a$export$1005530eda016c13(node, collection) {
// New API: call collection.getChildren with the node key.
if (typeof collection.getChildren === 'function') return collection.getChildren(node.key);
// Old API: access childNodes directly.
return node.childNodes;
}
function $7a155683b0d79a6a$export$fbdeaa6a76694f71(iterable) {
return $7a155683b0d79a6a$export$5f3398f8733f90e2(iterable, 0);
}
function $7a155683b0d79a6a$export$5f3398f8733f90e2(iterable, index) {
if (index < 0) return undefined;
let i = 0;
for (let item of iterable){
if (i === index) return item;
i++;
}
}
function $7a155683b0d79a6a$export$7475b2c64539e4cf(iterable) {
let lastItem = undefined;
for (let value of iterable)lastItem = value;
return lastItem;
}
function $7a155683b0d79a6a$export$8c434b3a7a4dad6(collection, a, b) {
// If the two nodes have the same parent, compare their indices.
if (a.parentKey === b.parentKey) return a.index - b.index;
// Otherwise, collect all of the ancestors from each node, and find the first one that doesn't match starting from the root.
// Include the base nodes in case we are comparing nodes of different levels so that we can compare the higher node to the lower level node's
// ancestor of the same level
let aAncestors = [
...$7a155683b0d79a6a$var$getAncestors(collection, a),
a
];
let bAncestors = [
...$7a155683b0d79a6a$var$getAncestors(collection, b),
b
];
let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a, i)=>a !== bAncestors[i]);
if (firstNonMatchingAncestor !== -1) {
// Compare the indices of two children within the common ancestor.
a = aAncestors[firstNonMatchingAncestor];
b = bAncestors[firstNonMatchingAncestor];
return a.index - b.index;
}
// If there isn't a non matching ancestor, we might be in a case where one of the nodes is the ancestor of the other.
if (aAncestors.findIndex((node)=>node === b) >= 0) return 1;
else if (bAncestors.findIndex((node)=>node === a) >= 0) return -1;
// 🤷
return -1;
}
function $7a155683b0d79a6a$var$getAncestors(collection, node) {
let parents = [];
let currNode = node;
while((currNode === null || currNode === void 0 ? void 0 : currNode.parentKey) != null){
currNode = collection.getItem(currNode.parentKey);
if (currNode) parents.unshift(currNode);
}
return parents;
}
//# sourceMappingURL=getChildNodes.main.js.map
@@ -0,0 +1,39 @@
{
"name": "@react-aria/link",
"version": "3.7.7",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"main": "dist/main.js",
"module": "dist/module.js",
"exports": {
"types": "./dist/types.d.ts",
"import": "./dist/import.mjs",
"require": "./dist/main.js"
},
"types": "dist/types.d.ts",
"source": "src/index.ts",
"files": [
"dist",
"src"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-aria/focus": "^3.19.0",
"@react-aria/interactions": "^3.22.5",
"@react-aria/utils": "^3.26.0",
"@react-types/link": "^3.5.9",
"@react-types/shared": "^3.26.0",
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
}
@@ -0,0 +1,40 @@
var copyObject = require('./_copyObject'),
createAssigner = require('./_createAssigner'),
keysIn = require('./keysIn');
/**
* This method is like `_.assign` except that it iterates over own and
* inherited source properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extend
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assign
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assignIn({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
*/
var assignIn = createAssigner(function(object, source) {
copyObject(source, keysIn(source), object);
});
module.exports = assignIn;
@@ -0,0 +1,9 @@
export type Options = [
{
checkLiteralConstAssertions?: boolean;
typesToIgnore?: string[];
}
];
export type MessageIds = 'contextuallyUnnecessary' | 'unnecessaryAssertion';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1,55 @@
'use strict';
var $TypeError = require('es-errors/type');
var MAX_SAFE_INTEGER = require('math-intrinsics/constants/maxSafeInteger');
var Call = require('./Call');
var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow');
var Get = require('./Get');
var HasProperty = require('./HasProperty');
var IsArray = require('./IsArray');
var LengthOfArrayLike = require('./LengthOfArrayLike');
var ToString = require('./ToString');
// https://262.ecma-international.org/11.0/#sec-flattenintoarray
module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) {
var mapperFunction;
if (arguments.length > 5) {
mapperFunction = arguments[5];
}
var targetIndex = start;
var sourceIndex = 0;
while (sourceIndex < sourceLen) {
var P = ToString(sourceIndex);
var exists = HasProperty(source, P);
if (exists === true) {
var element = Get(source, P);
if (typeof mapperFunction !== 'undefined') {
if (arguments.length <= 6) {
throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided');
}
element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]);
}
var shouldFlatten = false;
if (depth > 0) {
shouldFlatten = IsArray(element);
}
if (shouldFlatten) {
var elementLen = LengthOfArrayLike(element);
targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1);
} else {
if (targetIndex >= MAX_SAFE_INTEGER) {
throw new $TypeError('index too large');
}
CreateDataPropertyOrThrow(target, ToString(targetIndex), element);
targetIndex += 1;
}
}
sourceIndex += 1;
}
return targetIndex;
};
@@ -0,0 +1,2 @@
import type { ScalarTag } from '../types';
export declare const string: ScalarTag;
@@ -0,0 +1,71 @@
declare const animations: {
animation: {
"drip-expand": string;
"spinner-ease-spin": string;
"spinner-linear-spin": string;
"appearance-in": string;
"appearance-out": string;
"indeterminate-bar": string;
};
keyframes: {
shimmer: {
"100%": {
transform: string;
};
};
"spinner-spin": {
"0%": {
transform: string;
};
"100%": {
transform: string;
};
};
"drip-expand": {
"0%": {
opacity: string;
transform: string;
};
"100%": {
opacity: string;
transform: string;
};
};
"appearance-in": {
"0%": {
opacity: string;
transform: string;
};
"60%": {
opacity: string;
backfaceVisibility: string;
webkitFontSmoothing: string;
transform: string;
};
"100%": {
opacity: string;
transform: string;
};
};
"appearance-out": {
"0%": {
opacity: string;
transform: string;
};
"100%": {
opacity: string;
transform: string;
};
};
"indeterminate-bar": {
"0%": {
transform: string;
};
"100%": {
transform: string;
};
};
};
};
export { animations };
@@ -0,0 +1,76 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SpecifiedECDomain = exports.ECPVer = exports.Curve = exports.FieldElement = exports.ECPoint = exports.FieldID = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
let FieldID = class FieldID {
constructor(params = {}) {
Object.assign(this, params);
}
};
exports.FieldID = FieldID;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], FieldID.prototype, "fieldType", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any })
], FieldID.prototype, "parameters", void 0);
exports.FieldID = FieldID = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })
], FieldID);
class ECPoint extends asn1_schema_1.OctetString {
}
exports.ECPoint = ECPoint;
class FieldElement extends asn1_schema_1.OctetString {
}
exports.FieldElement = FieldElement;
let Curve = class Curve {
constructor(params = {}) {
Object.assign(this, params);
}
};
exports.Curve = Curve;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.OctetString })
], Curve.prototype, "a", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.OctetString })
], Curve.prototype, "b", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString, optional: true })
], Curve.prototype, "seed", void 0);
exports.Curve = Curve = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })
], Curve);
var ECPVer;
(function (ECPVer) {
ECPVer[ECPVer["ecpVer1"] = 1] = "ecpVer1";
})(ECPVer || (exports.ECPVer = ECPVer = {}));
let SpecifiedECDomain = class SpecifiedECDomain {
constructor(params = {}) {
this.version = ECPVer.ecpVer1;
Object.assign(this, params);
}
};
exports.SpecifiedECDomain = SpecifiedECDomain;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })
], SpecifiedECDomain.prototype, "version", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: FieldID })
], SpecifiedECDomain.prototype, "fieldID", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: Curve })
], SpecifiedECDomain.prototype, "curve", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: ECPoint })
], SpecifiedECDomain.prototype, "base", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer, converter: asn1_schema_1.AsnIntegerArrayBufferConverter })
], SpecifiedECDomain.prototype, "order", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer, optional: true })
], SpecifiedECDomain.prototype, "cofactor", void 0);
exports.SpecifiedECDomain = SpecifiedECDomain = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })
], SpecifiedECDomain);
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var EmbeddedObjectRole = {
relatedConcepts: [{
module: 'HTML',
concept: {
name: 'embed'
}
}],
type: 'widget'
};
var _default = EmbeddedObjectRole;
exports.default = _default;
@@ -0,0 +1,7 @@
declare namespace setFunctionLength {
type Func = (...args: unknown[]) => unknown;
}
declare function setFunctionLength<T extends setFunctionLength.Func = setFunctionLength.Func>(fn: T, length: number, loose?: boolean): T;
export = setFunctionLength;
@@ -0,0 +1,64 @@
// German [de]
import dayjs from '../index';
var texts = {
s: 'ein paar Sekunden',
m: ['eine Minute', 'einer Minute'],
mm: '%d Minuten',
h: ['eine Stunde', 'einer Stunde'],
hh: '%d Stunden',
d: ['ein Tag', 'einem Tag'],
dd: ['%d Tage', '%d Tagen'],
M: ['ein Monat', 'einem Monat'],
MM: ['%d Monate', '%d Monaten'],
y: ['ein Jahr', 'einem Jahr'],
yy: ['%d Jahre', '%d Jahren']
};
function relativeTimeFormatter(number, withoutSuffix, key) {
var l = texts[key];
if (Array.isArray(l)) {
l = l[withoutSuffix ? 0 : 1];
}
return l.replace('%d', number);
}
var locale = {
name: 'de',
weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.'.split('_'),
ordinal: function ordinal(n) {
return n + ".";
},
weekStart: 1,
yearStart: 4,
formats: {
LTS: 'HH:mm:ss',
LT: 'HH:mm',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY HH:mm',
LLLL: 'dddd, D. MMMM YYYY HH:mm'
},
relativeTime: {
future: 'in %s',
past: 'vor %s',
s: relativeTimeFormatter,
m: relativeTimeFormatter,
mm: relativeTimeFormatter,
h: relativeTimeFormatter,
hh: relativeTimeFormatter,
d: relativeTimeFormatter,
dd: relativeTimeFormatter,
M: relativeTimeFormatter,
MM: relativeTimeFormatter,
y: relativeTimeFormatter,
yy: relativeTimeFormatter
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getStatistics = void 0;
var getStatistics = exports.getStatistics = function getStatistics(view) {
return {
line: view.state.doc.lineAt(view.state.selection.main.from),
lineCount: view.state.doc.lines,
lineBreak: view.state.lineBreak,
length: view.state.doc.length,
readOnly: view.state.readOnly,
tabSize: view.state.tabSize,
selection: view.state.selection,
selectionAsSingle: view.state.selection.asSingle().main,
ranges: view.state.selection.ranges,
selectionCode: view.state.sliceDoc(view.state.selection.main.from, view.state.selection.main.to),
selections: view.state.selection.ranges.map(function (r) {
return view.state.sliceDoc(r.from, r.to);
}),
selectedText: view.state.selection.ranges.some(function (r) {
return !r.empty;
})
};
};
@@ -0,0 +1,102 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _table = _interopRequireDefault(require("./table"));
var _parse = _interopRequireDefault(require("./glyf/parse"));
var _write = _interopRequireDefault(require("./glyf/write"));
var _sizeof = _interopRequireDefault(require("./glyf/sizeof"));
var _lang = require("../../common/lang");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @file glyf表
* @author mengke01(kekee000@gmail.com)
*
* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html
*/
var _default = exports.default = _table.default.create('glyf', [], {
read: function read(reader, ttf) {
var startOffset = this.offset;
var loca = ttf.loca;
var numGlyphs = ttf.maxp.numGlyphs;
var glyphs = [];
reader.seek(startOffset);
// subset
var subset = ttf.readOptions.subset;
if (subset && subset.length > 0) {
var subsetMap = {
0: true // 设置.notdef
};
subsetMap[0] = true;
// subset map
var cmap = ttf.cmap;
// unicode to index
Object.keys(cmap).forEach(function (c) {
if (subset.indexOf(+c) > -1) {
var _i = cmap[c];
subsetMap[_i] = true;
}
});
ttf.subsetMap = subsetMap;
var parsedGlyfMap = {};
// 循环解析subset相关的glyf,包括复合字形相关的字形
var travelsParse = function travels(subsetMap) {
var newSubsetMap = {};
Object.keys(subsetMap).forEach(function (i) {
var index = +i;
parsedGlyfMap[index] = true;
// 当前的和下一个一样,或者最后一个无轮廓
if (loca[index] === loca[index + 1]) {
glyphs[index] = {
contours: []
};
} else {
glyphs[index] = (0, _parse.default)(reader, ttf, startOffset + loca[index]);
}
if (glyphs[index].compound) {
glyphs[index].glyfs.forEach(function (g) {
if (!parsedGlyfMap[g.glyphIndex]) {
newSubsetMap[g.glyphIndex] = true;
}
});
}
});
if (!(0, _lang.isEmptyObject)(newSubsetMap)) {
travels(newSubsetMap);
}
};
travelsParse(subsetMap);
return glyphs;
}
// 解析字体轮廓, 前n-1个
var i;
var l;
for (i = 0, l = numGlyphs - 1; i < l; i++) {
// 当前的和下一个一样,或者最后一个无轮廓
if (loca[i] === loca[i + 1]) {
glyphs[i] = {
contours: []
};
} else {
glyphs[i] = (0, _parse.default)(reader, ttf, startOffset + loca[i]);
}
}
// 最后一个轮廓
if (ttf.tables.glyf.length - loca[i] < 5) {
glyphs[i] = {
contours: []
};
} else {
glyphs[i] = (0, _parse.default)(reader, ttf, startOffset + loca[i]);
}
return glyphs;
},
write: _write.default,
size: _sizeof.default
});
@@ -0,0 +1,32 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export {useOverlayPosition} from './useOverlayPosition';
export {useOverlay} from './useOverlay';
export {useOverlayTrigger} from './useOverlayTrigger';
export {usePreventScroll} from './usePreventScroll';
export {ModalProvider, useModalProvider, OverlayProvider, OverlayContainer, useModal} from './useModal';
export {DismissButton} from './DismissButton';
export {ariaHideOutside} from './ariaHideOutside';
export {usePopover} from './usePopover';
export {useModalOverlay} from './useModalOverlay';
export {Overlay, useOverlayFocusContain} from './Overlay';
export {UNSTABLE_PortalProvider, useUNSTABLE_PortalContext} from './PortalProvider';
export type {AriaPositionProps, PositionAria} from './useOverlayPosition';
export type {AriaOverlayProps, OverlayAria} from './useOverlay';
export type {OverlayTriggerAria, OverlayTriggerProps} from './useOverlayTrigger';
export type {AriaModalOptions, ModalAria, ModalProviderAria, ModalProviderProps, OverlayContainerProps} from './useModal';
export type {DismissButtonProps} from './DismissButton';
export type {AriaPopoverProps, PopoverAria} from './usePopover';
export type {AriaModalOverlayProps, ModalOverlayAria} from './useModalOverlay';
export type {OverlayProps} from './Overlay';
export type {Placement, PlacementAxis, PositionProps} from '@react-types/overlays';
@@ -0,0 +1 @@
{"version":3,"file":"BaseBindingNode.d.ts","sourceRoot":"","sources":["../../../../src/planning/models/BaseBindingNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAGvD,MAAM,WAAW,eAAe,CAAC,QAAQ,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAC3E,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;CAC5B"}
@@ -0,0 +1,4 @@
function _checkPrivateRedeclaration(e, t) {
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
}
module.exports = _checkPrivateRedeclaration, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,11 @@
import { Newable } from '@inversifyjs/common';
import { PluginContext } from '@inversifyjs/plugin';
import type { Container } from './Container';
import { ServiceReferenceManager } from './ServiceReferenceManager';
import { ServiceResolutionManager } from './ServiceResolutionManager';
export declare class PluginManager {
#private;
constructor(container: Container, serviceReferenceManager: ServiceReferenceManager, serviceResolutionManager: ServiceResolutionManager);
register(container: Container, pluginConstructor: Newable<unknown, [Container, PluginContext]>): void;
}
//# sourceMappingURL=PluginManager.d.ts.map
@@ -0,0 +1,96 @@
import { lineNumbers, highlightActiveLineGutter, highlightSpecialChars, drawSelection, dropCursor, rectangularSelection, crosshairCursor, highlightActiveLine, keymap } from '@codemirror/view';
export { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { foldGutter, indentOnInput, syntaxHighlighting, defaultHighlightStyle, bracketMatching, foldKeymap } from '@codemirror/language';
import { history, defaultKeymap, historyKeymap } from '@codemirror/commands';
import { highlightSelectionMatches, searchKeymap } from '@codemirror/search';
import { closeBrackets, autocompletion, closeBracketsKeymap, completionKeymap } from '@codemirror/autocomplete';
import { lintKeymap } from '@codemirror/lint';
// (The superfluous function calls around the list of extensions work
// around current limitations in tree-shaking software.)
/**
This is an extension value that just pulls together a number of
extensions that you might want in a basic editor. It is meant as a
convenient helper to quickly set up CodeMirror without installing
and importing a lot of separate packages.
Specifically, it includes...
- [the default command bindings](https://codemirror.net/6/docs/ref/#commands.defaultKeymap)
- [line numbers](https://codemirror.net/6/docs/ref/#view.lineNumbers)
- [special character highlighting](https://codemirror.net/6/docs/ref/#view.highlightSpecialChars)
- [the undo history](https://codemirror.net/6/docs/ref/#commands.history)
- [a fold gutter](https://codemirror.net/6/docs/ref/#language.foldGutter)
- [custom selection drawing](https://codemirror.net/6/docs/ref/#view.drawSelection)
- [drop cursor](https://codemirror.net/6/docs/ref/#view.dropCursor)
- [multiple selections](https://codemirror.net/6/docs/ref/#state.EditorState^allowMultipleSelections)
- [reindentation on input](https://codemirror.net/6/docs/ref/#language.indentOnInput)
- [the default highlight style](https://codemirror.net/6/docs/ref/#language.defaultHighlightStyle) (as fallback)
- [bracket matching](https://codemirror.net/6/docs/ref/#language.bracketMatching)
- [bracket closing](https://codemirror.net/6/docs/ref/#autocomplete.closeBrackets)
- [autocompletion](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion)
- [rectangular selection](https://codemirror.net/6/docs/ref/#view.rectangularSelection) and [crosshair cursor](https://codemirror.net/6/docs/ref/#view.crosshairCursor)
- [active line highlighting](https://codemirror.net/6/docs/ref/#view.highlightActiveLine)
- [active line gutter highlighting](https://codemirror.net/6/docs/ref/#view.highlightActiveLineGutter)
- [selection match highlighting](https://codemirror.net/6/docs/ref/#search.highlightSelectionMatches)
- [search](https://codemirror.net/6/docs/ref/#search.searchKeymap)
- [linting](https://codemirror.net/6/docs/ref/#lint.lintKeymap)
(You'll probably want to add some language package to your setup
too.)
This extension does not allow customization. The idea is that,
once you decide you want to configure your editor more precisely,
you take this package's source (which is just a bunch of imports
and an array literal), copy it into your own code, and adjust it
as desired.
*/
const basicSetup = /*@__PURE__*/(() => [
lineNumbers(),
highlightActiveLineGutter(),
highlightSpecialChars(),
history(),
foldGutter(),
drawSelection(),
dropCursor(),
EditorState.allowMultipleSelections.of(true),
indentOnInput(),
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
bracketMatching(),
closeBrackets(),
autocompletion(),
rectangularSelection(),
crosshairCursor(),
highlightActiveLine(),
highlightSelectionMatches(),
keymap.of([
...closeBracketsKeymap,
...defaultKeymap,
...searchKeymap,
...historyKeymap,
...foldKeymap,
...completionKeymap,
...lintKeymap
])
])();
/**
A minimal set of extensions to create a functional editor. Only
includes [the default keymap](https://codemirror.net/6/docs/ref/#commands.defaultKeymap), [undo
history](https://codemirror.net/6/docs/ref/#commands.history), [special character
highlighting](https://codemirror.net/6/docs/ref/#view.highlightSpecialChars), [custom selection
drawing](https://codemirror.net/6/docs/ref/#view.drawSelection), and [default highlight
style](https://codemirror.net/6/docs/ref/#language.defaultHighlightStyle).
*/
const minimalSetup = /*@__PURE__*/(() => [
highlightSpecialChars(),
history(),
drawSelection(),
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
keymap.of([
...defaultKeymap,
...historyKeymap,
])
])();
export { basicSetup, minimalSetup };
@@ -0,0 +1,20 @@
import { User, UserDetailInfoListenerArg } from '../types';
export declare class NodeIKernelProfileListener {
onUserDetailInfoChanged(_arg: UserDetailInfoListenerArg): void;
onProfileSimpleChanged(..._args: unknown[]): any;
onProfileDetailInfoChanged(_profile: User): any;
onStatusUpdate(..._args: unknown[]): any;
onSelfStatusChanged(..._args: unknown[]): any;
onStrangerRemarkChanged(..._args: unknown[]): any;
onMemberListChange(..._args: unknown[]): any;
onMemberInfoChange(..._args: unknown[]): any;
onGroupListUpdate(..._args: unknown[]): any;
onGroupAllInfoChange(..._args: unknown[]): any;
onGroupDetailInfoChange(..._args: unknown[]): any;
onGroupConfMemberChange(..._args: unknown[]): any;
onGroupExtListUpdate(..._args: unknown[]): any;
onGroupNotifiesUpdated(..._args: unknown[]): any;
onGroupNotifiesUnreadCountUpdated(..._args: unknown[]): any;
onGroupMemberLevelInfoChange(..._args: unknown[]): any;
onGroupBulletinChange(..._args: unknown[]): any;
}
@@ -0,0 +1,104 @@
import prettier from 'prettier'
import { corePlugins } from '../src/corePlugins'
import colors from '../src/public/colors'
import defaultTheme from '../src/public/default-theme'
import fs from 'fs'
import path from 'path'
import * as types from './type-utils'
fs.writeFileSync(
path.join(process.cwd(), 'types', 'generated', 'corePluginList.d.ts'),
`export type CorePluginList = ${Object.keys(corePlugins)
.map((p) => `'${p}'`)
.join(' | ')}`
)
let colorsWithoutDeprecatedColors = Object.fromEntries(
Object.entries(Object.getOwnPropertyDescriptors(colors))
.filter(([_, { value }]) => {
return typeof value !== 'undefined'
})
.map(([name, definition]) => [name, definition.value])
)
let deprecatedColors = Object.entries(Object.getOwnPropertyDescriptors(colors))
.filter(([_, { value }]) => {
return typeof value === 'undefined'
})
.map(([name, definition]) => {
let warn = console.warn
let messages = []
console.warn = (...args) => messages.push(args.pop())
definition.get()
console.warn = warn
let message = messages.join(' ').trim()
let newColor = message.match(/renamed to `(.*)`/)[1]
return `/** @deprecated ${message} */${name}: DefaultColors['${newColor}'],`
})
.join('\n')
fs.writeFileSync(
path.join(process.cwd(), 'types', 'generated', 'colors.d.ts'),
prettier.format(
`export interface DefaultColors { ${JSON.stringify(colorsWithoutDeprecatedColors).slice(
1,
-1
)}\n${deprecatedColors}\n}`,
{
semi: false,
singleQuote: true,
printWidth: 100,
parser: 'typescript',
}
)
)
const defaultThemeTypes = Object.entries(defaultTheme)
.map(([name, value]) => {
// Special cases for slightly more accurate types
if (name === 'keyframes') {
return [name, `Record<${types.forKeys(value)}, Record<string, CSSDeclarationList>>`]
}
if (name === 'fontSize') {
return [name, `Record<${types.forKeys(value)}, [string, { lineHeight: string }]>`]
}
// General cases
if (typeof value === 'string') {
return [name, `string`]
}
if (typeof value === 'function') {
return [name, null]
}
if (typeof value === 'object') {
if (Object.keys(value).length === 0) {
return [name, null]
}
return [name, types.forValue(value)]
}
return [name, `unknown`]
})
.filter(([, type]) => type !== null)
.map(([name, type]) => `${name}: ${type}`)
.join('\n')
fs.writeFileSync(
path.join(process.cwd(), 'types', 'generated', 'default-theme.d.ts'),
prettier.format(
`
type CSSDeclarationList = Record<string, string>
export type DefaultTheme = { ${defaultThemeTypes} }
`,
{
semi: false,
singleQuote: true,
printWidth: 100,
parser: 'typescript',
}
)
)
@@ -0,0 +1,20 @@
'use strict';
var $TypeError = require('es-errors/type');
var hasOwn = require('hasown');
var isObject = require('es-object-atoms/isObject');
var isPropertyKey = require('../helpers/isPropertyKey');
// https://262.ecma-international.org/6.0/#sec-hasownproperty
module.exports = function HasOwnProperty(O, P) {
if (!isObject(O)) {
throw new $TypeError('Assertion failed: `O` must be an Object');
}
if (!isPropertyKey(P)) {
throw new $TypeError('Assertion failed: `P` must be a Property Key');
}
return hasOwn(O, P);
};
@@ -0,0 +1,11 @@
/**
* @param {ThematicBreak} _
* @param {Parents | undefined} _1
* @param {State} state
* @returns {string}
*/
export function thematicBreak(_: ThematicBreak, _1: Parents | undefined, state: State): string;
import type { ThematicBreak } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
//# sourceMappingURL=thematic-break.d.ts.map
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var docCreditRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {
'aria-disabled': null,
'aria-errormessage': null,
'aria-expanded': null,
'aria-haspopup': null,
'aria-invalid': null
},
relatedConcepts: [{
concept: {
name: 'credit [EPUB-SSV]'
},
module: 'EPUB'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section']]
};
var _default = exports.default = docCreditRole;
@@ -0,0 +1,378 @@
# Glob
Match files using the patterns the shell uses, like stars and stuff.
[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
This is a glob implementation in JavaScript. It uses the `minimatch`
library to do its matching.
![a fun cartoon logo made of glob characters](logo/glob.png)
## Usage
Install with npm
```
npm i glob
```
```javascript
var glob = require("glob")
// options is optional
glob("**/*.js", options, function (er, files) {
// files is an array of filenames.
// If the `nonull` option is set, and nothing
// was found, then files is ["**/*.js"]
// er is an error object or null.
})
```
## Glob Primer
"Globs" are the patterns you type when you do stuff like `ls *.js` on
the command line, or put `build/*` in a `.gitignore` file.
Before parsing the path part patterns, braced sections are expanded
into a set. Braced sections start with `{` and end with `}`, with any
number of comma-delimited sections within. Braced sections may contain
slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
The following characters have special magic meaning when used in a
path portion:
* `*` Matches 0 or more characters in a single path portion
* `?` Matches 1 character
* `[...]` Matches a range of characters, similar to a RegExp range.
If the first character of the range is `!` or `^` then it matches
any character not in the range.
* `!(pattern|pattern|pattern)` Matches anything that does not match
any of the patterns provided.
* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
patterns provided.
* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
patterns provided.
* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
provided
* `**` If a "globstar" is alone in a path portion, then it matches
zero or more directories and subdirectories searching for matches.
It does not crawl symlinked directories.
### Dots
If a file or directory path portion has a `.` as the first character,
then it will not match any glob pattern unless that pattern's
corresponding path part also has a `.` as its first character.
For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
However the pattern `a/*/c` would not, because `*` does not start with
a dot character.
You can make glob treat dots as normal characters by setting
`dot:true` in the options.
### Basename Matching
If you set `matchBase:true` in the options, and the pattern has no
slashes in it, then it will seek for any file anywhere in the tree
with a matching basename. For example, `*.js` would match
`test/simple/basic.js`.
### Empty Sets
If no matching files are found, then an empty array is returned. This
differs from the shell, where the pattern itself is returned. For
example:
$ echo a*s*d*f
a*s*d*f
To get the bash-style behavior, set the `nonull:true` in the options.
### See Also:
* `man sh`
* `man bash` (Search for "Pattern Matching")
* `man 3 fnmatch`
* `man 5 gitignore`
* [minimatch documentation](https://github.com/isaacs/minimatch)
## glob.hasMagic(pattern, [options])
Returns `true` if there are any special characters in the pattern, and
`false` otherwise.
Note that the options affect the results. If `noext:true` is set in
the options object, then `+(a|b)` will not be considered a magic
pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`
then that is considered magical, unless `nobrace:true` is set in the
options.
## glob(pattern, [options], cb)
* `pattern` `{String}` Pattern to be matched
* `options` `{Object}`
* `cb` `{Function}`
* `err` `{Error | null}`
* `matches` `{Array<String>}` filenames found matching the pattern
Perform an asynchronous glob search.
## glob.sync(pattern, [options])
* `pattern` `{String}` Pattern to be matched
* `options` `{Object}`
* return: `{Array<String>}` filenames found matching the pattern
Perform a synchronous glob search.
## Class: glob.Glob
Create a Glob object by instantiating the `glob.Glob` class.
```javascript
var Glob = require("glob").Glob
var mg = new Glob(pattern, options, cb)
```
It's an EventEmitter, and starts walking the filesystem to find matches
immediately.
### new glob.Glob(pattern, [options], [cb])
* `pattern` `{String}` pattern to search for
* `options` `{Object}`
* `cb` `{Function}` Called when an error occurs, or matches are found
* `err` `{Error | null}`
* `matches` `{Array<String>}` filenames found matching the pattern
Note that if the `sync` flag is set in the options, then matches will
be immediately available on the `g.found` member.
### Properties
* `minimatch` The minimatch object that the glob uses.
* `options` The options object passed in.
* `aborted` Boolean which is set to true when calling `abort()`. There
is no way at this time to continue a glob search after aborting, but
you can re-use the statCache to avoid having to duplicate syscalls.
* `cache` Convenience object. Each field has the following possible
values:
* `false` - Path does not exist
* `true` - Path exists
* `'FILE'` - Path exists, and is not a directory
* `'DIR'` - Path exists, and is a directory
* `[file, entries, ...]` - Path exists, is a directory, and the
array value is the results of `fs.readdir`
* `statCache` Cache of `fs.stat` results, to prevent statting the same
path multiple times.
* `symlinks` A record of which paths are symbolic links, which is
relevant in resolving `**` patterns.
* `realpathCache` An optional object which is passed to `fs.realpath`
to minimize unnecessary syscalls. It is stored on the instantiated
Glob object, and may be re-used.
### Events
* `end` When the matching is finished, this is emitted with all the
matches found. If the `nonull` option is set, and no match was found,
then the `matches` list contains the original pattern. The matches
are sorted, unless the `nosort` flag is set.
* `match` Every time a match is found, this is emitted with the specific
thing that matched. It is not deduplicated or resolved to a realpath.
* `error` Emitted when an unexpected error is encountered, or whenever
any fs error occurs if `options.strict` is set.
* `abort` When `abort()` is called, this event is raised.
### Methods
* `pause` Temporarily stop the search
* `resume` Resume the search
* `abort` Stop the search forever
### Options
All the options that can be passed to Minimatch can also be passed to
Glob to change pattern matching behavior. Also, some have been added,
or have glob-specific ramifications.
All options are false by default, unless otherwise noted.
All options are added to the Glob object, as well.
If you are running many `glob` operations, you can pass a Glob object
as the `options` argument to a subsequent operation to shortcut some
`stat` and `readdir` calls. At the very least, you may pass in shared
`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
parallel glob operations will be sped up by sharing information about
the filesystem.
* `cwd` The current working directory in which to search. Defaults
to `process.cwd()`.
* `root` The place where patterns starting with `/` will be mounted
onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
systems, and `C:\` or some such on Windows.)
* `dot` Include `.dot` files in normal matches and `globstar` matches.
Note that an explicit dot in a portion of the pattern will always
match dot files.
* `nomount` By default, a pattern starting with a forward-slash will be
"mounted" onto the root setting, so that a valid filesystem path is
returned. Set this flag to disable that behavior.
* `mark` Add a `/` character to directory matches. Note that this
requires additional stat calls.
* `nosort` Don't sort the results.
* `stat` Set to true to stat *all* results. This reduces performance
somewhat, and is completely unnecessary, unless `readdir` is presumed
to be an untrustworthy indicator of file existence.
* `silent` When an unusual error is encountered when attempting to
read a directory, a warning will be printed to stderr. Set the
`silent` option to true to suppress these warnings.
* `strict` When an unusual error is encountered when attempting to
read a directory, the process will just continue on in search of
other matches. Set the `strict` option to raise an error in these
cases.
* `cache` See `cache` property above. Pass in a previously generated
cache object to save some fs calls.
* `statCache` A cache of results of filesystem information, to prevent
unnecessary stat calls. While it should not normally be necessary
to set this, you may pass the statCache from one glob() call to the
options object of another, if you know that the filesystem will not
change between calls. (See "Race Conditions" below.)
* `symlinks` A cache of known symbolic links. You may pass in a
previously generated `symlinks` object to save `lstat` calls when
resolving `**` matches.
* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
* `nounique` In some cases, brace-expanded patterns can result in the
same file showing up multiple times in the result set. By default,
this implementation prevents duplicates in the result set. Set this
flag to disable that behavior.
* `nonull` Set to never return an empty set, instead returning a set
containing the pattern itself. This is the default in glob(3).
* `debug` Set to enable debug logging in minimatch and glob.
* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
* `noglobstar` Do not match `**` against multiple filenames. (Ie,
treat it as a normal `*` instead.)
* `noext` Do not match `+(a|b)` "extglob" patterns.
* `nocase` Perform a case-insensitive match. Note: on
case-insensitive filesystems, non-magic patterns will match by
default, since `stat` and `readdir` will not raise errors.
* `matchBase` Perform a basename-only match if the pattern does not
contain any slash characters. That is, `*.js` would be treated as
equivalent to `**/*.js`, matching all js files in all directories.
* `nodir` Do not match directories, only files. (Note: to match
*only* directories, simply put a `/` at the end of the pattern.)
* `ignore` Add a pattern or an array of glob patterns to exclude matches.
Note: `ignore` patterns are *always* in `dot:true` mode, regardless
of any other settings.
* `follow` Follow symlinked directories when expanding `**` patterns.
Note that this can result in a lot of duplicate references in the
presence of cyclic links.
* `realpath` Set to true to call `fs.realpath` on all of the results.
In the case of a symlink that cannot be resolved, the full absolute
path to the matched entry is returned (though it will usually be a
broken symlink)
* `absolute` Set to true to always receive absolute paths for matched
files. Unlike `realpath`, this also affects the values returned in
the `match` event.
* `fs` File-system object with Node's `fs` API. By default, the built-in
`fs` module will be used. Set to a volume provided by a library like
`memfs` to avoid using the "real" file-system.
## Comparisons to other fnmatch/glob implementations
While strict compliance with the existing standards is a worthwhile
goal, some discrepancies exist between node-glob and other
implementations, and are intentional.
The double-star character `**` is supported by default, unless the
`noglobstar` flag is set. This is supported in the manner of bsdglob
and bash 4.3, where `**` only has special significance if it is the only
thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
`a/**b` will not.
Note that symlinked directories are not crawled as part of a `**`,
though their contents may match against subsequent portions of the
pattern. This prevents infinite loops and duplicates and the like.
If an escaped pattern has no matches, and the `nonull` flag is set,
then glob returns the pattern as-provided, rather than
interpreting the character escapes. For example,
`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
`"*a?"`. This is akin to setting the `nullglob` option in bash, except
that it does not resolve escaped pattern characters.
If brace expansion is not disabled, then it is performed before any
other interpretation of the glob pattern. Thus, a pattern like
`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
checked for validity. Since those two are valid, matching proceeds.
### Comments and Negation
Previously, this module let you mark a pattern as a "comment" if it
started with a `#` character, or a "negated" pattern if it started
with a `!` character.
These options were deprecated in version 5, and removed in version 6.
To specify things that should not match, use the `ignore` option.
## Windows
**Please only use forward-slashes in glob expressions.**
Though windows uses either `/` or `\` as its path separator, only `/`
characters are used by this glob implementation. You must use
forward-slashes **only** in glob expressions. Back-slashes will always
be interpreted as escape characters, not path separators.
Results from absolute patterns such as `/foo/*` are mounted onto the
root setting using `path.join`. On windows, this will by default result
in `/foo/*` matching `C:\foo\bar.txt`.
## Race Conditions
Glob searching, by its very nature, is susceptible to race conditions,
since it relies on directory walking and such.
As a result, it is possible that a file that exists when glob looks for
it may have been deleted or modified by the time it returns the result.
As part of its internal implementation, this program caches all stat
and readdir calls that it makes, in order to cut down on system
overhead. However, this also makes it even more susceptible to races,
especially if the cache or statCache objects are reused between glob
calls.
Users are thus advised not to use a glob result as a guarantee of
filesystem state in the face of rapid changes. For the vast majority
of operations, this is never a problem.
## Glob Logo
Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo).
The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).
## Contributing
Any change to behavior (including bugfixes) must come with a test.
Patches that fail tests or reduce performance will be rejected.
```
# to run tests
npm test
# to re-generate test fixtures
npm run test-regen
# to benchmark against bash/zsh
npm run bench
# to profile javascript
npm run prof
```
![](oh-my-glob.gif)
@@ -0,0 +1,161 @@
'use client';
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var react = require('react');
const ErrorBoundaryContext = react.createContext(null);
const initialState = {
didCatch: false,
error: null
};
class ErrorBoundary extends react.Component {
constructor(props) {
super(props);
this.resetErrorBoundary = this.resetErrorBoundary.bind(this);
this.state = initialState;
}
static getDerivedStateFromError(error) {
return {
didCatch: true,
error
};
}
resetErrorBoundary() {
const {
error
} = this.state;
if (error !== null) {
var _this$props$onReset, _this$props;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
(_this$props$onReset = (_this$props = this.props).onReset) === null || _this$props$onReset === void 0 ? void 0 : _this$props$onReset.call(_this$props, {
args,
reason: "imperative-api"
});
this.setState(initialState);
}
}
componentDidCatch(error, info) {
var _this$props$onError, _this$props2;
(_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error, info);
}
componentDidUpdate(prevProps, prevState) {
const {
didCatch
} = this.state;
const {
resetKeys
} = this.props;
// There's an edge case where if the thing that triggered the error happens to *also* be in the resetKeys array,
// we'd end up resetting the error boundary immediately.
// This would likely trigger a second error to be thrown.
// So we make sure that we don't check the resetKeys on the first call of cDU after the error is set.
if (didCatch && prevState.error !== null && hasArrayChanged(prevProps.resetKeys, resetKeys)) {
var _this$props$onReset2, _this$props3;
(_this$props$onReset2 = (_this$props3 = this.props).onReset) === null || _this$props$onReset2 === void 0 ? void 0 : _this$props$onReset2.call(_this$props3, {
next: resetKeys,
prev: prevProps.resetKeys,
reason: "keys"
});
this.setState(initialState);
}
}
render() {
const {
children,
fallbackRender,
FallbackComponent,
fallback
} = this.props;
const {
didCatch,
error
} = this.state;
let childToRender = children;
if (didCatch) {
const props = {
error,
resetErrorBoundary: this.resetErrorBoundary
};
if (typeof fallbackRender === "function") {
childToRender = fallbackRender(props);
} else if (FallbackComponent) {
childToRender = react.createElement(FallbackComponent, props);
} else if (fallback !== undefined) {
childToRender = fallback;
} else {
{
console.error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
}
throw error;
}
}
return react.createElement(ErrorBoundaryContext.Provider, {
value: {
didCatch,
error,
resetErrorBoundary: this.resetErrorBoundary
}
}, childToRender);
}
}
function hasArrayChanged() {
let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
return a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]));
}
function assertErrorBoundaryContext(value) {
if (value == null || typeof value.didCatch !== "boolean" || typeof value.resetErrorBoundary !== "function") {
throw new Error("ErrorBoundaryContext not found");
}
}
function useErrorBoundary() {
const context = react.useContext(ErrorBoundaryContext);
assertErrorBoundaryContext(context);
const [state, setState] = react.useState({
error: null,
hasError: false
});
const memoized = react.useMemo(() => ({
resetBoundary: () => {
context.resetErrorBoundary();
setState({
error: null,
hasError: false
});
},
showBoundary: error => setState({
error,
hasError: true
})
}), [context.resetErrorBoundary]);
if (state.hasError) {
throw state.error;
}
return memoized;
}
function withErrorBoundary(component, errorBoundaryProps) {
const Wrapped = react.forwardRef((props, ref) => react.createElement(ErrorBoundary, errorBoundaryProps, react.createElement(component, {
...props,
ref
})));
// Format for display in DevTools
const name = component.displayName || component.name || "Unknown";
Wrapped.displayName = "withErrorBoundary(".concat(name, ")");
return Wrapped;
}
exports.ErrorBoundary = ErrorBoundary;
exports.ErrorBoundaryContext = ErrorBoundaryContext;
exports.useErrorBoundary = useErrorBoundary;
exports.withErrorBoundary = withErrorBoundary;
@@ -0,0 +1,13 @@
Copyright (c) 2015, Rebecca Turner
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,18 @@
var asciiToArray = require('./_asciiToArray'),
hasUnicode = require('./_hasUnicode'),
unicodeToArray = require('./_unicodeToArray');
/**
* Converts `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function stringToArray(string) {
return hasUnicode(string)
? unicodeToArray(string)
: asciiToArray(string);
}
module.exports = stringToArray;
@@ -0,0 +1,35 @@
'use strict';
module.exports = (string, count = 1, options) => {
options = {
indent: ' ',
includeEmptyLines: false,
...options
};
if (typeof string !== 'string') {
throw new TypeError(
`Expected \`input\` to be a \`string\`, got \`${typeof string}\``
);
}
if (typeof count !== 'number') {
throw new TypeError(
`Expected \`count\` to be a \`number\`, got \`${typeof count}\``
);
}
if (typeof options.indent !== 'string') {
throw new TypeError(
`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``
);
}
if (count === 0) {
return string;
}
const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
return string.replace(regex, options.indent.repeat(count));
};
@@ -0,0 +1,41 @@
var arrayEach = require('./_arrayEach'),
baseEach = require('./_baseEach'),
castFunction = require('./_castFunction'),
isArray = require('./isArray');
/**
* Iterates over elements of `collection` and invokes `iteratee` for each element.
* The iteratee is invoked with three arguments: (value, index|key, collection).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* **Note:** As with other "Collections" methods, objects with a "length"
* property are iterated like arrays. To avoid this behavior use `_.forIn`
* or `_.forOwn` for object iteration.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias each
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEachRight
* @example
*
* _.forEach([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `1` then `2`.
*
* _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forEach(collection, iteratee) {
var func = isArray(collection) ? arrayEach : baseEach;
return func(collection, castFunction(iteratee));
}
module.exports = forEach;
@@ -0,0 +1,70 @@
// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
export function miniKindOf(val: any): string {
if (val === void 0) return 'undefined'
if (val === null) return 'null'
const type = typeof val
switch (type) {
case 'boolean':
case 'string':
case 'number':
case 'symbol':
case 'function': {
return type
}
}
if (Array.isArray(val)) return 'array'
if (isDate(val)) return 'date'
if (isError(val)) return 'error'
const constructorName = ctorName(val)
switch (constructorName) {
case 'Symbol':
case 'Promise':
case 'WeakMap':
case 'WeakSet':
case 'Map':
case 'Set':
return constructorName
}
// other
return Object.prototype.toString
.call(val)
.slice(8, -1)
.toLowerCase()
.replace(/\s/g, '')
}
function ctorName(val: any): string | null {
return typeof val.constructor === 'function' ? val.constructor.name : null
}
function isError(val: any) {
return (
val instanceof Error ||
(typeof val.message === 'string' &&
val.constructor &&
typeof val.constructor.stackTraceLimit === 'number')
)
}
function isDate(val: any) {
if (val instanceof Date) return true
return (
typeof val.toDateString === 'function' &&
typeof val.getDate === 'function' &&
typeof val.setDate === 'function'
)
}
export function kindOf(val: any) {
let typeOfVal: string = typeof val
if (process.env.NODE_ENV !== 'production') {
typeOfVal = miniKindOf(val)
}
return typeOfVal
}
@@ -0,0 +1,197 @@
"use strict";
var Buffer = require("safer-buffer").Buffer;
// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js
// == UTF16-BE codec. ==========================================================
exports.utf16be = Utf16BECodec;
function Utf16BECodec() {
}
Utf16BECodec.prototype.encoder = Utf16BEEncoder;
Utf16BECodec.prototype.decoder = Utf16BEDecoder;
Utf16BECodec.prototype.bomAware = true;
// -- Encoding
function Utf16BEEncoder() {
}
Utf16BEEncoder.prototype.write = function(str) {
var buf = Buffer.from(str, 'ucs2');
for (var i = 0; i < buf.length; i += 2) {
var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;
}
return buf;
}
Utf16BEEncoder.prototype.end = function() {
}
// -- Decoding
function Utf16BEDecoder() {
this.overflowByte = -1;
}
Utf16BEDecoder.prototype.write = function(buf) {
if (buf.length == 0)
return '';
var buf2 = Buffer.alloc(buf.length + 1),
i = 0, j = 0;
if (this.overflowByte !== -1) {
buf2[0] = buf[0];
buf2[1] = this.overflowByte;
i = 1; j = 2;
}
for (; i < buf.length-1; i += 2, j+= 2) {
buf2[j] = buf[i+1];
buf2[j+1] = buf[i];
}
this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;
return buf2.slice(0, j).toString('ucs2');
}
Utf16BEDecoder.prototype.end = function() {
this.overflowByte = -1;
}
// == UTF-16 codec =============================================================
// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.
// Defaults to UTF-16LE, as it's prevalent and default in Node.
// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le
// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});
// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).
exports.utf16 = Utf16Codec;
function Utf16Codec(codecOptions, iconv) {
this.iconv = iconv;
}
Utf16Codec.prototype.encoder = Utf16Encoder;
Utf16Codec.prototype.decoder = Utf16Decoder;
// -- Encoding (pass-through)
function Utf16Encoder(options, codec) {
options = options || {};
if (options.addBOM === undefined)
options.addBOM = true;
this.encoder = codec.iconv.getEncoder('utf-16le', options);
}
Utf16Encoder.prototype.write = function(str) {
return this.encoder.write(str);
}
Utf16Encoder.prototype.end = function() {
return this.encoder.end();
}
// -- Decoding
function Utf16Decoder(options, codec) {
this.decoder = null;
this.initialBufs = [];
this.initialBufsLen = 0;
this.options = options || {};
this.iconv = codec.iconv;
}
Utf16Decoder.prototype.write = function(buf) {
if (!this.decoder) {
// Codec is not chosen yet. Accumulate initial bytes.
this.initialBufs.push(buf);
this.initialBufsLen += buf.length;
if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below)
return '';
// We have enough bytes -> detect endianness.
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
this.decoder = this.iconv.getDecoder(encoding, this.options);
var resStr = '';
for (var i = 0; i < this.initialBufs.length; i++)
resStr += this.decoder.write(this.initialBufs[i]);
this.initialBufs.length = this.initialBufsLen = 0;
return resStr;
}
return this.decoder.write(buf);
}
Utf16Decoder.prototype.end = function() {
if (!this.decoder) {
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
this.decoder = this.iconv.getDecoder(encoding, this.options);
var resStr = '';
for (var i = 0; i < this.initialBufs.length; i++)
resStr += this.decoder.write(this.initialBufs[i]);
var trail = this.decoder.end();
if (trail)
resStr += trail;
this.initialBufs.length = this.initialBufsLen = 0;
return resStr;
}
return this.decoder.end();
}
function detectEncoding(bufs, defaultEncoding) {
var b = [];
var charsProcessed = 0;
var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE.
outer_loop:
for (var i = 0; i < bufs.length; i++) {
var buf = bufs[i];
for (var j = 0; j < buf.length; j++) {
b.push(buf[j]);
if (b.length === 2) {
if (charsProcessed === 0) {
// Check BOM first.
if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le';
if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be';
}
if (b[0] === 0 && b[1] !== 0) asciiCharsBE++;
if (b[0] !== 0 && b[1] === 0) asciiCharsLE++;
b.length = 0;
charsProcessed++;
if (charsProcessed >= 100) {
break outer_loop;
}
}
}
}
// Make decisions.
// Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.
// So, we count ASCII as if it was LE or BE, and decide from that.
if (asciiCharsBE > asciiCharsLE) return 'utf-16be';
if (asciiCharsBE < asciiCharsLE) return 'utf-16le';
// Couldn't decide (likely all zeros or not enough data).
return defaultEncoding || 'utf-16le';
}
@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,16 @@
/**
* @license React
* react-compiler-runtime.profiling.js
*
* 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.
*/
"use strict";
var ReactSharedInternals =
require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
exports.c = function (size) {
return ReactSharedInternals.H.useMemoCache(size);
};
@@ -0,0 +1,59 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/bold/volume-low.tsx
var volume_low_exports = {};
__export(volume_low_exports, {
VolumeLowBoldIcon: () => VolumeLowBoldIcon
});
module.exports = __toCommonJS(volume_low_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var VolumeLowBoldIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
"svg",
{
"aria-hidden": "true",
fill: "none",
focusable: "false",
height: "1em",
role: "presentation",
viewBox: "0 0 24 24",
width: "1em",
...props,
children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M19.3284 16.7503C19.1684 16.7503 19.0184 16.7003 18.8784 16.6003C18.5484 16.3503 18.4784 15.8803 18.7284 15.5503C20.2984 13.4603 20.2984 10.5403 18.7284 8.45027C18.4784 8.12027 18.5484 7.65027 18.8784 7.40027C19.2084 7.15027 19.6784 7.22027 19.9284 7.55027C21.8984 10.1703 21.8984 13.8303 19.9284 16.4503C19.7884 16.6503 19.5584 16.7503 19.3284 16.7503Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M15.3481 3.78168C14.2281 3.16168 12.7981 3.32168 11.3381 4.23168L8.41813 6.06168C8.21813 6.18168 7.98813 6.25168 7.75813 6.25168H6.82812H6.32812C3.90812 6.25168 2.57812 7.58168 2.57812 10.0017V14.0017C2.57812 16.4217 3.90812 17.7517 6.32812 17.7517H6.82812H7.75813C7.98813 17.7517 8.21813 17.8217 8.41813 17.9417L11.3381 19.7717C12.2181 20.3217 13.0781 20.5917 13.8781 20.5917C14.3981 20.5917 14.8981 20.4717 15.3481 20.2217C16.4581 19.6017 17.0781 18.3117 17.0781 16.5917V7.41168C17.0781 5.69168 16.4581 4.40168 15.3481 3.78168Z",
fill: "currentColor"
}
)
]
}
);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
VolumeLowBoldIcon
});
@@ -0,0 +1,238 @@
# sirv ![CI](https://github.com/lukeed/sirv/workflows/CI/badge.svg)
> The optimized and lightweight middleware for serving requests to static assets
You may use `sirv` as a *very* fast and lightweight alternative to [`serve-static`](https://www.npmjs.com/package/serve-static).
The massive performance advantage over `serve-static` is explained by **not** relying on the file system for existence checks on every request. These are expensive interactions and must be avoided whenever possible! Instead, when not in "dev" mode, `sirv` performs all its file-system operations upfront and then relies on its cache for future operations.
This middleware will work out of the box for [Polka](https://github.com/lukeed/polka), Express, and other Express-like frameworks. It will also work with the native `http`, `https` and `http2` modules. It requires _very_ little effort to modify/wrap it for servers that don't accept the `(req, res, next)` signature.
:bulb: For a feature-complete CLI application, check out the sibling [`sirv-cli`](https://github.com/lukeed/sirv/tree/master/packages/sirv-cli) package as an alternative to [`zeit/serve`](https://github.com/zeit/serve)~!
## Install
```
$ npm install --save sirv
```
## Usage
```js
const sirv = require('sirv');
const polka = require('polka');
const compress = require('compression')();
// Init `sirv` handler
const assets = sirv('public', {
maxAge: 31536000, // 1Y
immutable: true
});
polka()
.use(compress, assets)
.use('/api', require('./api'))
.listen(3000, err => {
if (err) throw err;
console.log('> Ready on localhost:3000~!');
});
```
## API
### sirv(dir, opts={})
Returns: `Function`
The returned function is a middleware in the standard Express-like signature: `(req, res, next)`, where `req` is the [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage), `res` is the [`http.ServerResponse`](https://nodejs.org/dist/latest-v9.x/docs/api/http.html#http_class_http_serverresponse), and `next` (in this case) is the function to call if no file was found for the given path.
When defined, a `next()` callback is always called _instead of_ the [`opts.onNoMatch`](#optsonnomatch) callback. However, unlike `onNoMatch`, your `next()` is given no arguments.
#### dir
Type: `String`<br>
Default: `.`
The directory from which to read and serve assets. It is resolved to an absolute path &mdash; you must provide an absolute path yourself if `process.cwd()` is not the correct assumption.
#### opts.dev
Type: `Boolean`<br>
Default: `false`
Enable "dev" mode, which disables/skips caching. Instead, `sirv` will traverse the file system ***on every request***.
Additionally, `dev` mode will ignore `maxAge` and `immutable` as these options generate a production-oriented `Cache-Control` header value.
> **Important:** Do not use `dev` mode in production!
#### opts.etag
Type: `Boolean`<br>
Default: `false`
Generate and attach an `ETag` header to responses.
> **Note:** If an incoming request's [`If-None-Match` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match) matches the `ETag` value, a `304` response is given.
#### opts.dotfiles
Type: `Boolean`<br>
Default: `false`
Allow requests to dotfiles (files or directories beginning with a `.`).
> **Note:** Requests to [`/.well-known/*`](https://tools.ietf.org/html/rfc8615) are always allowed.
#### opts.extensions
Type: `Array<String>`<br>
Default: `['html', 'htm']`
The file extension fallbacks to check for if a pathame is not initially found. For example, if a `/login` request cannot find a `login` filename, it will then look for `login.html` and `login.htm` before giving up~!
> **Important:** Actually, `sirv` will **also** look for `login/index.html` and `login/index.htm` before giving up.
#### opts.gzip
Type: `Boolean`<br>
Default: `false`
Determine if `sirv` look for **precompiled** `*.gz` files.<br>
Must be enabled _and_ the incoming request's [`Accept Encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding) must include "gzip" in order for `sirv` to search for the gzip'd alternative.
> **Note:** The `.gz` assumption also applies to the `opts.extensions` list.
```js
// NOTE: PSEUDO CODE
// Showing lookup logic
// Request: [Accept-Encoding: gzip] "/foobar.jpg"
lookup([
'/foobar.jpg.gz', '/foobar.jpg',
'/foobar.jpg.html.gz', '/foobar.jpg/index.html.gz',
'/foobar.jpg.htm.gz', '/foobar.jpg/index.htm.gz',
'/foobar.jpg.html', '/foobar.jpg/index.html',
'/foobar.jpg.htm', '/foobar.jpg/index.htm',
]);
// Request: [Accept-Encoding: gzip] "/"
lookup([
'/index.html.gz',
'/index.htm.gz',
'/index.html',
'/index.htm',
]);
```
#### opts.brotli
Type: `Boolean`<br>
Default: `false`
Determine if `sirv` look for **precompiled** `*.br` files.<br>
Must be enabled _and_ the incoming request's [`Accept Encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding) must include either "br" or "brotli" in order for `sirv` to search for the brotli-compressed alternative.
> **Note:** The `.br` assumption also applies to the `opts.extensions` list.
When both `opts.broli` and `opts.gzip` are enabled &mdash; and all conditions are equal &mdash; then the brotli variant always takes priority.
```js
// NOTE: PSEUDO CODE
// Showing lookup logic
// Request: [Accept-Encoding: br] "/foobar.jpg"
lookup([
'/foobar.jpg.br', '/foobar.jpg',
'/foobar.jpg.html.br', '/foobar.jpg/index.html.br',
'/foobar.jpg.htm.br', '/foobar.jpg/index.htm.br',
'/foobar.jpg.html', '/foobar.jpg/index.html',
'/foobar.jpg.htm', '/foobar.jpg/index.htm',
]);
// Request: [Accept-Encoding: br,gz] "/"
lookup([
'/index.html.br'
'/index.htm.br'
'/index.html.gz'
'/index.htm.gz'
'/index.html'
'/index.htm'
]);
```
#### opts.maxAge
Type: `Number`<br>
Default: `undefined`
Enables the `Cache-Control` header on responses and sets the `max-age` value (in seconds).<br>
For example, `maxAge: 31536000` is equivalent to one year.
#### opts.immutable
Type: `Boolean`<br>
Default: `false`
Appends the [`immutable` directive](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#Revalidation_and_reloading) on your `Cache-Control` header, used for uniquely-named assets that will not change!
> **Important:** Will only work if `opts.maxAge` has a value defined!
#### opts.single
Type: `Boolean` or `String`<br>
Default: `false`
Treat the directory as a single-page application.
When `true`, the directory's index page (default `index.html`) will be sent if the request asset does not exist.<br>
You may pass a `string` value to use a file _instead of_ `index.html` as your fallback.
For example, if "/about" is requested but no variants of that file exist, then the response for "/" is sent instead:
```js
// Note: This is psuedo code to illustrate what's happening
// Request: "/about"
let file = find(['/about', '/about.html', '/about.htm', '/about/index.html', '/about.htm']);
if (file) {
send(file);
} else if (opts.single === true) {
file = find(['/', '/index.html', '/index.htm']);
send(file);
} else if (typeof opts.single === 'string') {
file = find([opts.single]);
send(file);
} else {
// next() or 404
}
```
#### opts.ignores
Type: `false` or `Array<String | RegExp>`
Specify paths/patterns that should ignore the fallback behavior that `opts.single` provides.
By default, any asset-like path (URLs that end with an extension) will be ignored. This means that, for example, if `/foobar.jpg` is not found, a `404` response is sent instead of the `index.html` fallback.
Additionally, any `/.well-known/*` pathname ignores the fallback – as do all other dotfile requests when `opts.dotfiles` is enabled.
Any string value(s) will be passed through `new RegExp(value, 'i')` directly.
Finally, you may set `ignores: false` to disable ***all*** ignores, including the defaults. Put differently, this will fallback ***all*** unknown pathnames to your `index.html` (or custom `opts.single` value).
> **Important:** Only has an effect if `opts.single` is enabled.
#### opts.onNoMatch
Type: `Function`
A custom function to run if a file cannot be found for a given request. <br>By default, `sirv` will send a basic `(404) Not found` response.
The function receives the current `req <IncomingMessage>, res <ServerResponse>` pair for as its two arguments.
> **Note:** This won't run if a `next` callback has been provided to the middleware; see [`sirv`](#sirvdir-opts) description.
#### opts.setHeaders
Type: `Function`
A custom function to append or change any headers on the outgoing response. There is no default.
Its signature is `(res, pathname, stats)`, where `res` is the `ServerResponse`, `pathname` is incoming request path (stripped of queries), and `stats` is the file's result from [`fs.statSync`](https://nodejs.org/api/fs.html#fs_fs_statsync_path).
## License
MIT © [Luke Edwards](https://lukeed.com)
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var docBiblioentryRole = {
abstract: false,
accessibleNameRequired: true,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {
'aria-disabled': null,
'aria-errormessage': null,
'aria-expanded': null,
'aria-haspopup': null,
'aria-invalid': null
},
relatedConcepts: [{
concept: {
name: 'EPUB biblioentry [EPUB-SSV]'
},
module: 'EPUB'
}],
requireContextRole: ['doc-bibliography'],
requiredContextRole: ['doc-bibliography'],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section', 'listitem']]
};
var _default = exports.default = docBiblioentryRole;
@@ -0,0 +1 @@
{"version":3,"file":"isCheckBoxInput.d.ts","sourceRoot":"","sources":["../../src/utils/isCheckBoxInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;yBAE7B,SAAS,YAAY,KAAG,OAAO,IAAI,gBAAgB;AAAnE,wBAC8B"}
@@ -0,0 +1,4 @@
export { OverlayOptions, OverlayPlacement } from './types.mjs';
export { getArrowPlacement, getShouldUseAxisPlacement, getTransformOrigins, toOverlayPlacement, toReactAriaPlacement } from './utils.mjs';
export { ariaHideOutside, keepVisible } from './ariaHideOutside.mjs';
import '@react-types/overlays';
@@ -0,0 +1,9 @@
import { FormValidationState } from "@react-stately/form";
import { RefObject, Validation } from "@react-types/shared";
type ValidatableElement = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
interface FormValidationProps<T> extends Validation<T> {
focus?: () => void;
}
export function useFormValidation<T>(props: FormValidationProps<T>, state: FormValidationState, ref: RefObject<ValidatableElement | null> | undefined): void;
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
import type { ClientRect, UniqueIdentifier, UseDndContextReturnValue } from '@dnd-kit/core';
export declare function getSortedRects(items: UniqueIdentifier[], rects: UseDndContextReturnValue['droppableRects']): ClientRect[];
@@ -0,0 +1,18 @@
// Given a version, figure out what the release channel is so that we can publish to the correct
// channel on npm.
//
// E.g.:
//
// 1.2.3 -> latest (default)
// 0.0.0-insiders.ffaa88 -> insiders
// 4.1.0-alpha.4 -> alpha
let version =
process.argv[2] || process.env.npm_package_version || require('../package.json').version
let match = /\d+\.\d+\.\d+-(.*)\.\d+/g.exec(version)
if (match) {
console.log(match[1])
} else {
console.log('latest')
}
@@ -0,0 +1 @@
!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_zh_cn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){return"W"===_?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d}));
@@ -0,0 +1,31 @@
"use strict"
const { READ } = require("@eslint-community/eslint-utils")
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
const child_process = {
exec: { [READ]: { supported: ["0.1.90"] } },
execFile: { [READ]: { supported: ["0.1.91"] } },
fork: { [READ]: { supported: ["0.5.0"] } },
spawn: { [READ]: { supported: ["0.1.90"] } },
execFileSync: { [READ]: { supported: ["0.11.12"] } },
execSync: { [READ]: { supported: ["0.11.12"] } },
spawnSync: { [READ]: { supported: ["0.11.12"] } },
ChildProcess: { [READ]: { supported: ["2.2.0"] } },
}
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
module.exports = {
child_process: {
[READ]: { supported: ["0.1.90"] },
...child_process,
},
"node:child_process": {
[READ]: { supported: ["14.13.1", "12.20.0"] },
...child_process,
},
}
@@ -0,0 +1,37 @@
/**
* @file 路径旋转
* @author mengke01(kekee000@gmail.com)
*/
/**
* 对path坐标进行调整
*
* @param {Object} contour 坐标点
* @param {number} angle 角度
* @param {number} centerX x偏移
* @param {number} centerY y偏移
*
* @return {Object} contour 坐标点
*/
export default function pathRotate(contour, angle, centerX, centerY) {
angle = angle === undefined ? 0 : angle;
const x = centerX || 0;
const y = centerY || 0;
const cos = Math.cos(angle);
const sin = Math.sin(angle);
let px;
let py;
let p;
// x1=cos(angle)*x-sin(angle)*y;
// y1=cos(angle)*y+sin(angle)*x;
for (let i = 0, l = contour.length; i < l; i++) {
p = contour[i];
px = cos * (p.x - x) - sin * (p.y - y);
py = cos * (p.y - y) + sin * (p.x - x);
p.x = px + x;
p.y = py + y;
}
return contour;
}
@@ -0,0 +1,548 @@
export default `flf2a$ 3 2 7 0 8
This font is (c) Michel Eftimakis 1995 -- Version 1.1 -- 15 feb 1995
____________________________________________________________ /\`____
| Michel Eftimakis | "Ascii-Artist" '\\/ |
| Michel.Eftimakis@ustc.vlsi.com | Boo)- (00) ||
| Tel : (33) 92 96 27 19 | (_\`'_) ||
|__ Fax : (33) 92 96 27 01 _________|____ FRANCE ___________ _!!_ ____||
|_____________________________________________________________________|
$$@
$$@
$$@@
[]@
()@
@@
,,@
@
@@
@
=||=@
@@
|@
S@
|@@
o/@
/o@
@@
@
&@
@@
,@
$@
@@
$@
/$@
\`$@@
$ @
$\\@
$'@@
@
*@
@@
@
+@
@@
@
,@
@@
@
-@
@@
@
.@
@@
/@
/ @
@@
@
0@
@@
@
1@
@@
@
2@
@@
@
3@
@@
@
4@
@@
@
5@
@@
@
6@
@@
@
7@
@@
@
8@
@@
@
9@
@@
@
:@
@@
@
;@
@@
/@
\\@
@@
@
=@
@@
\\@
/@
@@
@
?@
@@
_ @
(a)@
@@
_ @
//\\@
@@
_ @
[|}@
@@
_@
((@
@@
_ @
[|)@
@@
__@
[|-@
\`-@@
__@
[|-@
@@
__ @
(|_;@
@@
@
[]-|@
@@
()@
[]@
@@
()@
||@
[_|@@
@
[]/@
\`@@
|| @
L_]@
@@
_ _ @
//\\/\\@
@@
_ @
[|\\|@
@@
_ @
(()@
@@
_ @
||)@
L| @@
_ @
(()@
\`@@
_ @
[|)@
\`@@
@
((@
''@@
____@
L| @
@@
@
|U|@
\`-'@@
_ _@
\\\\/@
@@
_ _ _@
\\\\/\\/@
@@
@
\\\\/@
''\`@@
_ _@
\\\\/@
'' @@
__ @
//_@
@@
_$@
| $@
|_$@@
\\ @
\\@
@@
$_ @
$ |@
$_|@@
^@
$@
@@
@
$$@
==@@
.@
$@
@@
@
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@
@@
@
{@
@@
|@
|@
|@@
@
}@
@@
@
~@
@@
..@
//\\@
@@
..@
(()@
@@
..@
|U|@
\`-'@@
..@
a @
@@
..@
o @
@@
..@
u @
@@
_ @
||}@
L| @@
160
$@
$@
$@@
161
()@
||@
L|@@
168
..@
$$@
@@
183
o@
$@
@@
192
\` @
//\\@
@@
193
' @
//\\@
@@
194
^ @
//\\@
@@
195
~ @
//\\@
@@
196
..@
//\\@
@@
197
o @
//\\@
@@
198
____@
//\\|-@
\`-@@
199
@
((@
'@@
200
\`_@
||-@
\`-@@
201
'_@
||-@
\`-@@
202
^_@
||-@
\`-@@
203
..@
||-@
\`-@@
204
\` @
L|@
@@
205
'@
L|@
@@
206
^ @
L|@
@@
207
..@
L|@
@@
209
_~ @
[|\\|@
@@
210
\` @
(()@
@@
211
' @
(()@
@@
212
^ @
(()@
@@
213
~ @
(()@
@@
214
..@
(()@
@@
217
\` @
|U|@
\`-'@@
218
' @
|U|@
\`-'@@
219
^ @
|U|@
\`-'@@
220
..@
|U|@
\`-'@@
223
_ @
||}@
L| @@
224
-@
a@
@@
225
,@
a@
@@
226
^@
a@
@@
227
~@
a@
@@
228
..@
a @
@@
229
.@
a@
@@
231
@
c@
'@@
232
-@
e@
@@
233
,@
e@
@@
234
^@
e@
@@
235
..@
e @
@@
236
-@
i@
@@
237
,@
i@
@@
238
^@
i@
@@
239
..@
i @
@@
241
~@
n@
@@
242
-@
o@
@@
243
,@
o@
@@
244
^@
o@
@@
245
~@
o@
@@
246
..@
o @
@@
249
-@
u@
@@
250
,@
u@
@@
251
^@
u@
@@
252
..@
u @
@@
253
,@
y@
@@
255
..@
y @
@@
`
@@ -0,0 +1 @@
{"version":3,"file":"OneToManyMapStar.spec.d.ts","sourceRoot":"","sources":["../../../../src/common/models/OneToManyMapStar.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
{"name":"redux-thunk","version":"3.1.0","requiresBuild":false,"files":{"dist/cjs/redux-thunk.cjs":{"checkedAt":1794532110403,"integrity":"sha512-P2a0YBpVALYTk+gDsp+6p5EDs9JY4DBlIT+QD/pnaTg+wekQyOIunBWpH70q6hXyPeBGueqK6o2MXOy9K3zGSQ==","mode":420,"size":1457},"dist/redux-thunk.legacy-esm.js":{"checkedAt":1794532110404,"integrity":"sha512-LAHYHOCb6sYpJBUqwaVZDLCLsLz9wp2AKh/VNXLaCfEwpcY9QN33svPYCCP1jtI+z63TnYXyocey5/rDeIK9qw==","mode":420,"size":417},"package.json":{"checkedAt":1794532110404,"integrity":"sha512-ldiqjPfjBDMvrPX7EprXfFvaFaH7e7D4HLJkSaGb625Iwjm7/lUbzJauccqOXZws5QRMqfqREOcpRbLa2rQF+w==","mode":420,"size":1856},"LICENSE.md":{"checkedAt":1794532110404,"integrity":"sha512-8fBWS9eMXK02BT0wqeTWTRhzA1KNZtfZw1rzgKmvRTKsC6WbSfiCuSYw3Z2TqcTRD878gPiB5xuBAQgy7hO+iA==","mode":420,"size":1107},"README.md":{"checkedAt":1794532110404,"integrity":"sha512-M0lR+tCT7lmywyCtrFcox6u268I4EMNquj2H5MD8zYHYGatMCkj4/SXMpkM39+yDG7LOhF5W8V7kpa5su4L7wg==","mode":420,"size":12803},"dist/redux-thunk.mjs":{"checkedAt":1794532110404,"integrity":"sha512-LAHYHOCb6sYpJBUqwaVZDLCLsLz9wp2AKh/VNXLaCfEwpcY9QN33svPYCCP1jtI+z63TnYXyocey5/rDeIK9qw==","mode":420,"size":417},"src/index.ts":{"checkedAt":1794532110404,"integrity":"sha512-ZiMRZxnPIO8f9zOyAmkvpq9d7jwxkpbOHP4XB9YQ6GSO2mOJM8/9ep3TpSmbueG69IUoltNHIpFhk5f1FklyJw==","mode":420,"size":1571},"dist/redux-thunk.d.ts":{"checkedAt":1794532110404,"integrity":"sha512-PPbnak3e860FPOhFTCvpQ8nv/c0IeNPlmUjxvYE0cFbadJvn1rShbUro2qNwSpirY9xRKKB3zq7X7sqIprsC/g==","mode":420,"size":3561},"src/types.ts":{"checkedAt":1794532110405,"integrity":"sha512-XD4VvqQWn/0GB0m1XJ20dYoQ6kwst67ZCdK+FhUmv/emtREBL0cdAz8146f1PRiU4IB7+8IoM1f+rCVgYvmjIg==","mode":420,"size":3568}}}
@@ -0,0 +1,60 @@
import { __read } from "tslib";
import { useState } from 'react';
import useMemoizedFn from '../useMemoizedFn';
import { isNumber } from '../utils';
function getTargetValue(val, options) {
if (options === void 0) { options = {}; }
var min = options.min, max = options.max;
var target = val;
if (isNumber(max)) {
target = Math.min(max, target);
}
if (isNumber(min)) {
target = Math.max(min, target);
}
return target;
}
function useCounter(initialValue, options) {
if (initialValue === void 0) { initialValue = 0; }
if (options === void 0) { options = {}; }
var min = options.min, max = options.max;
var _a = __read(useState(function () {
return getTargetValue(initialValue, {
min: min,
max: max,
});
}), 2), current = _a[0], setCurrent = _a[1];
var setValue = function (value) {
setCurrent(function (c) {
var target = isNumber(value) ? value : value(c);
return getTargetValue(target, {
max: max,
min: min,
});
});
};
var inc = function (delta) {
if (delta === void 0) { delta = 1; }
setValue(function (c) { return c + delta; });
};
var dec = function (delta) {
if (delta === void 0) { delta = 1; }
setValue(function (c) { return c - delta; });
};
var set = function (value) {
setValue(value);
};
var reset = function () {
setValue(initialValue);
};
return [
current,
{
inc: useMemoizedFn(inc),
dec: useMemoizedFn(dec),
set: useMemoizedFn(set),
reset: useMemoizedFn(reset),
},
];
}
export default useCounter;
@@ -0,0 +1 @@
{"version":3,"file":"buildEmptyMapMetadata.d.ts","sourceRoot":"","sources":["../../../../src/reflectMetadata/utils/buildEmptyMapMetadata.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAEvE"}
@@ -0,0 +1,20 @@
import { FORMAT_DEFAULT } from '../../constant';
import { u, englishFormats } from './utils';
export default (function (o, c, d) {
var proto = c.prototype;
var oldFormat = proto.format;
d.en.formats = englishFormats;
proto.format = function (formatStr) {
if (formatStr === void 0) {
formatStr = FORMAT_DEFAULT;
}
var _this$$locale = this.$locale(),
_this$$locale$formats = _this$$locale.formats,
formats = _this$$locale$formats === void 0 ? {} : _this$$locale$formats;
var result = u(formatStr, formats);
return oldFormat.call(this, result);
};
});
@@ -0,0 +1,90 @@
/*!
* forwarded
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module exports.
* @public
*/
module.exports = forwarded
/**
* Get all addresses in the request, using the `X-Forwarded-For` header.
*
* @param {object} req
* @return {array}
* @public
*/
function forwarded (req) {
if (!req) {
throw new TypeError('argument req is required')
}
// simple header parsing
var proxyAddrs = parse(req.headers['x-forwarded-for'] || '')
var socketAddr = getSocketAddr(req)
var addrs = [socketAddr].concat(proxyAddrs)
// return all addresses
return addrs
}
/**
* Get the socket address for a request.
*
* @param {object} req
* @return {string}
* @private
*/
function getSocketAddr (req) {
return req.socket
? req.socket.remoteAddress
: req.connection.remoteAddress
}
/**
* Parse the X-Forwarded-For header.
*
* @param {string} header
* @private
*/
function parse (header) {
var end = header.length
var list = []
var start = header.length
// gather addresses, backwards
for (var i = header.length - 1; i >= 0; i--) {
switch (header.charCodeAt(i)) {
case 0x20: /* */
if (start === end) {
start = end = i
}
break
case 0x2c: /* , */
if (start !== end) {
list.push(header.substring(start, end))
}
start = end = i
break
default:
start = i
break
}
}
// final address
if (start !== end) {
list.push(header.substring(start, end))
}
return list
}
@@ -0,0 +1,41 @@
const { join, sep } = require('path')
const getOptions = require('./common/get-options.js')
const mkdir = require('./mkdir.js')
const mkdtemp = require('./mkdtemp.js')
const rm = require('./rm/index.js')
// create a temp directory, ensure its permissions match its parent, then call
// the supplied function passing it the path to the directory. clean up after
// the function finishes, whether it throws or not
const withTempDir = async (root, fn, opts) => {
const options = getOptions(opts, {
copy: ['tmpPrefix'],
})
// create the directory, and fix its ownership
await mkdir(root, { recursive: true, owner: 'inherit' })
const target = await mkdtemp(join(`${root}${sep}`, options.tmpPrefix || ''), { owner: 'inherit' })
let err
let result
try {
result = await fn(target)
} catch (_err) {
err = _err
}
try {
await rm(target, { force: true, recursive: true })
} catch {
// ignore errors
}
if (err) {
throw err
}
return result
}
module.exports = withTempDir
@@ -0,0 +1 @@
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["link.js"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,2BANW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAuFlB;;;;0BArG+B,OAAO;6BAAP,OAAO;2BADT,wBAAwB;0BAAxB,wBAAwB;AAwGtD;;;;;GAKG;AACH,gCALW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAIlB"}
@@ -0,0 +1,18 @@
import baseSlice from './_baseSlice.js';
/**
* Casts `array` to a slice if it's needed.
*
* @private
* @param {Array} array The array to inspect.
* @param {number} start The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the cast slice.
*/
function castSlice(array, start, end) {
var length = array.length;
end = end === undefined ? length : end;
return (!start && end >= length) ? array : baseSlice(array, start, end);
}
export default castSlice;
@@ -0,0 +1 @@
{"name":"resolve-options","version":"1.1.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532123762,"integrity":"sha512-qUDOdqNKHWrDgjuUHeleQ3JgfM+NbK/wm10AL9ugAC07XgdekxZGuY6EXCad2TJzEXxRdlF7ycvdxirmT0CTxw==","mode":420,"size":1157},"README.md":{"checkedAt":1794532123762,"integrity":"sha512-p+AUbccozCBtCAOLfQsTltfgPtmWb/88M/1NazICFi7GE+1trnMqZfOPjl6sIzZBzXNe1Cp5IYMencIOvgp9+w==","mode":420,"size":3402},"LICENSE":{"checkedAt":1794532123682,"integrity":"sha512-1eXjnKHlcQI7jFq5BiVfafSp0IhjaBlZX8/qj5MN4P0MwqGyo1WQFf/19KyVw5blF503KVYf6zXFEh9u+oGDvQ==","mode":420,"size":1164},"index.js":{"checkedAt":1794532123762,"integrity":"sha512-1kjDscfvqsYRdDFjIN4UHThSih8LF2dpuXQnZryxSO/DzlcySOXujmmPfAjfBxUZLr34l9TTpCCRAAf/GRxNsw==","mode":420,"size":2218}}}
@@ -0,0 +1,44 @@
import Embed from '../blots/embed.js';
import Emitter from './emitter.js';
class Composition {
isComposing = false;
constructor(scroll, emitter) {
this.scroll = scroll;
this.emitter = emitter;
this.setupListeners();
}
setupListeners() {
this.scroll.domNode.addEventListener('compositionstart', event => {
if (!this.isComposing) {
this.handleCompositionStart(event);
}
});
this.scroll.domNode.addEventListener('compositionend', event => {
if (this.isComposing) {
// Webkit makes DOM changes after compositionend, so we use microtask to
// ensure the order.
// https://bugs.webkit.org/show_bug.cgi?id=31902
queueMicrotask(() => {
this.handleCompositionEnd(event);
});
}
});
}
handleCompositionStart(event) {
const blot = event.target instanceof Node ? this.scroll.find(event.target, true) : null;
if (blot && !(blot instanceof Embed)) {
this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_START, event);
this.scroll.batchStart();
this.emitter.emit(Emitter.events.COMPOSITION_START, event);
this.isComposing = true;
}
}
handleCompositionEnd(event) {
this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_END, event);
this.scroll.batchEnd();
this.emitter.emit(Emitter.events.COMPOSITION_END, event);
this.isComposing = false;
}
}
export default Composition;
//# sourceMappingURL=composition.js.map
@@ -0,0 +1,120 @@
{
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "5.9.3",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [
"TypeScript",
"Microsoft",
"compiler",
"language",
"javascript"
],
"bugs": {
"url": "https://github.com/microsoft/TypeScript/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/microsoft/TypeScript.git"
},
"main": "./lib/typescript.js",
"typings": "./lib/typescript.d.ts",
"bin": {
"tsc": "./bin/tsc",
"tsserver": "./bin/tsserver"
},
"engines": {
"node": ">=14.17"
},
"files": [
"bin",
"lib",
"!lib/enu",
"LICENSE.txt",
"README.md",
"SECURITY.md",
"ThirdPartyNoticeText.txt",
"!**/.gitattributes"
],
"devDependencies": {
"@dprint/formatter": "^0.4.1",
"@dprint/typescript": "0.93.4",
"@esfx/canceltoken": "^1.0.0",
"@eslint/js": "^9.20.0",
"@octokit/rest": "^21.1.1",
"@types/chai": "^4.3.20",
"@types/diff": "^7.0.1",
"@types/minimist": "^1.2.5",
"@types/mocha": "^10.0.10",
"@types/ms": "^0.7.34",
"@types/node": "latest",
"@types/source-map-support": "^0.5.10",
"@types/which": "^3.0.4",
"@typescript-eslint/rule-tester": "^8.24.1",
"@typescript-eslint/type-utils": "^8.24.1",
"@typescript-eslint/utils": "^8.24.1",
"azure-devops-node-api": "^14.1.0",
"c8": "^10.1.3",
"chai": "^4.5.0",
"chokidar": "^4.0.3",
"diff": "^7.0.0",
"dprint": "^0.49.0",
"esbuild": "^0.25.0",
"eslint": "^9.20.1",
"eslint-formatter-autolinkable-stylish": "^1.4.0",
"eslint-plugin-regexp": "^2.7.0",
"fast-xml-parser": "^4.5.2",
"glob": "^10.4.5",
"globals": "^15.15.0",
"hereby": "^1.10.0",
"jsonc-parser": "^3.3.1",
"knip": "^5.44.4",
"minimist": "^1.2.8",
"mocha": "^10.8.2",
"mocha-fivemat-progress-reporter": "^0.1.0",
"monocart-coverage-reports": "^2.12.1",
"ms": "^2.1.3",
"picocolors": "^1.1.1",
"playwright": "^1.50.1",
"source-map-support": "^0.5.21",
"tslib": "^2.8.1",
"typescript": "^5.7.3",
"typescript-eslint": "^8.24.1",
"which": "^3.0.1"
},
"overrides": {
"typescript@*": "$typescript"
},
"scripts": {
"test": "hereby runtests-parallel --light=false",
"test:eslint-rules": "hereby run-eslint-rules-tests",
"build": "npm run build:compiler && npm run build:tests",
"build:compiler": "hereby local",
"build:tests": "hereby tests",
"build:tests:notypecheck": "hereby tests --no-typecheck",
"clean": "hereby clean",
"gulp": "hereby",
"lint": "hereby lint",
"knip": "hereby knip",
"format": "dprint fmt",
"setup-hooks": "node scripts/link-hooks.mjs"
},
"browser": {
"fs": false,
"os": false,
"path": false,
"crypto": false,
"buffer": false,
"source-map-support": false,
"inspector": false,
"perf_hooks": false
},
"packageManager": "npm@8.19.4",
"volta": {
"node": "20.1.0",
"npm": "8.19.4"
},
"gitHead": "c63de15a992d37f0d6cec03ac7631872838602cb"
}
@@ -0,0 +1,42 @@
// src/bold/volume-high.tsx
import { jsx, jsxs } from "react/jsx-runtime";
var VolumeHighBoldIcon = (props) => /* @__PURE__ */ jsxs(
"svg",
{
"aria-hidden": "true",
fill: "none",
focusable: "false",
height: "1em",
role: "presentation",
viewBox: "0 0 24 24",
width: "1em",
...props,
children: [
/* @__PURE__ */ jsx(
"path",
{
d: "M18.0003 16.7503C17.8403 16.7503 17.6903 16.7003 17.5503 16.6003C17.2203 16.3503 17.1503 15.8803 17.4003 15.5503C18.9703 13.4603 18.9703 10.5403 17.4003 8.45027C17.1503 8.12027 17.2203 7.65027 17.5503 7.40027C17.8803 7.15027 18.3503 7.22027 18.6003 7.55027C20.5603 10.1703 20.5603 13.8303 18.6003 16.4503C18.4503 16.6503 18.2303 16.7503 18.0003 16.7503Z",
fill: "currentColor"
}
),
/* @__PURE__ */ jsx(
"path",
{
d: "M19.8284 19.2503C19.6684 19.2503 19.5184 19.2003 19.3784 19.1003C19.0484 18.8503 18.9784 18.3803 19.2284 18.0503C21.8984 14.4903 21.8984 9.51027 19.2284 5.95027C18.9784 5.62027 19.0484 5.15027 19.3784 4.90027C19.7084 4.65027 20.1784 4.72027 20.4284 5.05027C23.4984 9.14027 23.4984 14.8603 20.4284 18.9503C20.2884 19.1503 20.0584 19.2503 19.8284 19.2503Z",
fill: "currentColor"
}
),
/* @__PURE__ */ jsx(
"path",
{
d: "M14.02 3.78168C12.9 3.16168 11.47 3.32168 10.01 4.23168L7.09 6.06168C6.89 6.18168 6.66 6.25168 6.43 6.25168H5.5H5C2.58 6.25168 1.25 7.58168 1.25 10.0017V14.0017C1.25 16.4217 2.58 17.7517 5 17.7517H5.5H6.43C6.66 17.7517 6.89 17.8217 7.09 17.9417L10.01 19.7717C10.89 20.3217 11.75 20.5917 12.55 20.5917C13.07 20.5917 13.57 20.4717 14.02 20.2217C15.13 19.6017 15.75 18.3117 15.75 16.5917V7.41168C15.75 5.69168 15.13 4.40168 14.02 3.78168Z",
fill: "currentColor"
}
)
]
}
);
export {
VolumeHighBoldIcon
};
@@ -0,0 +1,17 @@
export { createTailwindMerge } from './lib/create-tailwind-merge'
export { getDefaultConfig } from './lib/default-config'
export { extendTailwindMerge } from './lib/extend-tailwind-merge'
export { fromTheme } from './lib/from-theme'
export { mergeConfigs } from './lib/merge-configs'
export { twJoin, type ClassNameValue } from './lib/tw-join'
export { twMerge } from './lib/tw-merge'
export {
type ClassValidator,
type Config,
type ConfigExtension,
type DefaultClassGroupIds,
type DefaultThemeGroupIds,
type ExperimentalParseClassNameParam,
type ExperimentalParsedClassName,
} from './lib/types'
export * as validators from './lib/validators'
@@ -0,0 +1,28 @@
var parse = require("./parse");
var walk = require("./walk");
var stringify = require("./stringify");
function ValueParser(value) {
if (this instanceof ValueParser) {
this.nodes = parse(value);
return this;
}
return new ValueParser(value);
}
ValueParser.prototype.toString = function() {
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
};
ValueParser.prototype.walk = function(cb, bubble) {
walk(this.nodes, cb, bubble);
return this;
};
ValueParser.unit = require("./unit");
ValueParser.walk = walk;
ValueParser.stringify = stringify;
module.exports = ValueParser;
@@ -0,0 +1,316 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {calculatePosition, PositionResult} from './calculatePosition';
import {DOMAttributes, RefObject} from '@react-types/shared';
import {Placement, PlacementAxis, PositionProps} from '@react-types/overlays';
import {useCallback, useEffect, useRef, useState} from 'react';
import {useCloseOnScroll} from './useCloseOnScroll';
import {useLayoutEffect, useResizeObserver} from '@react-aria/utils';
import {useLocale} from '@react-aria/i18n';
export interface AriaPositionProps extends PositionProps {
/**
* Cross size of the overlay arrow in pixels.
* @default 0
*/
arrowSize?: number,
/**
* Element that that serves as the positioning boundary.
* @default document.body
*/
boundaryElement?: Element,
/**
* The ref for the element which the overlay positions itself with respect to.
*/
targetRef: RefObject<Element | null>,
/**
* The ref for the overlay element.
*/
overlayRef: RefObject<Element | null>,
/**
* A ref for the scrollable region within the overlay.
* @default overlayRef
*/
scrollRef?: RefObject<Element | null>,
/**
* Whether the overlay should update its position automatically.
* @default true
*/
shouldUpdatePosition?: boolean,
/** Handler that is called when the overlay should close. */
onClose?: () => void,
/**
* The maxHeight specified for the overlay element.
* By default, it will take all space up to the current viewport height.
*/
maxHeight?: number,
/**
* The minimum distance the arrow's edge should be from the edge of the overlay element.
* @default 0
*/
arrowBoundaryOffset?: number
}
export interface PositionAria {
/** Props for the overlay container element. */
overlayProps: DOMAttributes,
/** Props for the overlay tip arrow if any. */
arrowProps: DOMAttributes,
/** Placement of the overlay with respect to the overlay trigger. */
placement: PlacementAxis | null,
/** Updates the position of the overlay. */
updatePosition(): void
}
interface ScrollAnchor {
type: 'top' | 'bottom',
offset: number
}
let visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;
/**
* Handles positioning overlays like popovers and menus relative to a trigger
* element, and updating the position when the window resizes.
*/
export function useOverlayPosition(props: AriaPositionProps): PositionAria {
let {direction} = useLocale();
let {
arrowSize = 0,
targetRef,
overlayRef,
scrollRef = overlayRef,
placement = 'bottom' as Placement,
containerPadding = 12,
shouldFlip = true,
boundaryElement = typeof document !== 'undefined' ? document.body : null,
offset = 0,
crossOffset = 0,
shouldUpdatePosition = true,
isOpen = true,
onClose,
maxHeight,
arrowBoundaryOffset = 0
} = props;
let [position, setPosition] = useState<PositionResult | null>(null);
let deps = [
shouldUpdatePosition,
placement,
overlayRef.current,
targetRef.current,
scrollRef.current,
containerPadding,
shouldFlip,
boundaryElement,
offset,
crossOffset,
isOpen,
direction,
maxHeight,
arrowBoundaryOffset,
arrowSize
];
// Note, the position freezing breaks if body sizes itself dynamicly with the visual viewport but that might
// just be a non-realistic use case
// Upon opening a overlay, record the current visual viewport scale so we can freeze the overlay styles
let lastScale = useRef(visualViewport?.scale);
useEffect(() => {
if (isOpen) {
lastScale.current = visualViewport?.scale;
}
}, [isOpen]);
let updatePosition = useCallback(() => {
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !boundaryElement) {
return;
}
if (visualViewport?.scale !== lastScale.current) {
return;
}
// Determine a scroll anchor based on the focused element.
// This stores the offset of the anchor element from the scroll container
// so it can be restored after repositioning. This way if the overlay height
// changes, the focused element appears to stay in the same position.
let anchor: ScrollAnchor | null = null;
if (scrollRef.current && scrollRef.current.contains(document.activeElement)) {
let anchorRect = document.activeElement?.getBoundingClientRect();
let scrollRect = scrollRef.current.getBoundingClientRect();
// Anchor from the top if the offset is in the top half of the scrollable element,
// otherwise anchor from the bottom.
anchor = {
type: 'top',
offset: (anchorRect?.top ?? 0) - scrollRect.top
};
if (anchor.offset > scrollRect.height / 2) {
anchor.type = 'bottom';
anchor.offset = (anchorRect?.bottom ?? 0) - scrollRect.bottom;
}
}
// Always reset the overlay's previous max height if not defined by the user so that we can compensate for
// RAC collections populating after a second render and properly set a correct max height + positioning when it populates.
let overlay = (overlayRef.current as HTMLElement);
if (!maxHeight && overlayRef.current) {
overlay.style.top = '0px';
overlay.style.bottom = '';
overlay.style.maxHeight = (window.visualViewport?.height ?? window.innerHeight) + 'px';
}
let position = calculatePosition({
placement: translateRTL(placement, direction),
overlayNode: overlayRef.current,
targetNode: targetRef.current,
scrollNode: scrollRef.current || overlayRef.current,
padding: containerPadding,
shouldFlip,
boundaryElement,
offset,
crossOffset,
maxHeight,
arrowSize,
arrowBoundaryOffset
});
if (!position.position) {
return;
}
// Modify overlay styles directly so positioning happens immediately without the need of a second render
// This is so we don't have to delay autoFocus scrolling or delay applying preventScroll for popovers
overlay.style.top = '';
overlay.style.bottom = '';
overlay.style.left = '';
overlay.style.right = '';
Object.keys(position.position).forEach(key => overlay.style[key] = (position.position!)[key] + 'px');
overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' : '';
// Restore scroll position relative to anchor element.
if (anchor && document.activeElement && scrollRef.current) {
let anchorRect = document.activeElement.getBoundingClientRect();
let scrollRect = scrollRef.current.getBoundingClientRect();
let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];
scrollRef.current.scrollTop += newOffset - anchor.offset;
}
// Trigger a set state for a second render anyway for arrow positioning
setPosition(position);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, deps);
// Update position when anything changes
// eslint-disable-next-line react-hooks/exhaustive-deps
useLayoutEffect(updatePosition, deps);
// Update position on window resize
useResize(updatePosition);
// Update position when the overlay changes size (might need to flip).
useResizeObserver({
ref: overlayRef,
onResize: updatePosition
});
// Update position when the target changes size (might need to flip).
useResizeObserver({
ref: targetRef,
onResize: updatePosition
});
// Reposition the overlay and do not close on scroll while the visual viewport is resizing.
// This will ensure that overlays adjust their positioning when the iOS virtual keyboard appears.
let isResizing = useRef(false);
useLayoutEffect(() => {
let timeout: ReturnType<typeof setTimeout>;
let onResize = () => {
isResizing.current = true;
clearTimeout(timeout);
timeout = setTimeout(() => {
isResizing.current = false;
}, 500);
updatePosition();
};
// Only reposition the overlay if a scroll event happens immediately as a result of resize (aka the virtual keyboard has appears)
// We don't want to reposition the overlay if the user has pinch zoomed in and is scrolling the viewport around.
let onScroll = () => {
if (isResizing.current) {
onResize();
}
};
visualViewport?.addEventListener('resize', onResize);
visualViewport?.addEventListener('scroll', onScroll);
return () => {
visualViewport?.removeEventListener('resize', onResize);
visualViewport?.removeEventListener('scroll', onScroll);
};
}, [updatePosition]);
let close = useCallback(() => {
if (!isResizing.current) {
onClose?.();
}
}, [onClose, isResizing]);
// When scrolling a parent scrollable region of the trigger (other than the body),
// we hide the popover. Otherwise, its position would be incorrect.
useCloseOnScroll({
triggerRef: targetRef,
isOpen,
onClose: onClose && close
});
return {
overlayProps: {
style: {
position: 'absolute',
zIndex: 100000, // should match the z-index in ModalTrigger
...position?.position,
maxHeight: position?.maxHeight ?? '100vh'
}
},
placement: position?.placement ?? null,
arrowProps: {
'aria-hidden': 'true',
role: 'presentation',
style: {
left: position?.arrowOffsetLeft,
top: position?.arrowOffsetTop
}
},
updatePosition
};
}
function useResize(onResize) {
useLayoutEffect(() => {
window.addEventListener('resize', onResize, false);
return () => {
window.removeEventListener('resize', onResize, false);
};
}, [onResize]);
}
function translateRTL(position, direction) {
if (direction === 'rtl') {
return position.replace('start', 'right').replace('end', 'left');
}
return position.replace('start', 'left').replace('end', 'right');
}
@@ -0,0 +1,106 @@
{
"name": "unist-util-visit-parents",
"version": "6.0.2",
"description": "unist utility to recursively walk over nodes, with ancestral information",
"license": "MIT",
"keywords": [
"unist",
"unist-util",
"util",
"utility",
"tree",
"ast",
"visit",
"traverse",
"walk",
"check",
"parent",
"parents"
],
"repository": "syntax-tree/unist-util-visit-parents",
"bugs": "https://github.com/syntax-tree/unist-util-visit-parents/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"exports": {
".": "./index.js",
"./do-not-use-color": {
"node": "./lib/color.node.js",
"default": "./lib/color.js"
}
},
"types": "index.d.ts",
"files": [
"lib/",
"index.d.ts.map",
"index.d.ts",
"index.js"
],
"dependencies": {
"@types/unist": "^3.0.0",
"unist-util-is": "^6.0.0"
},
"devDependencies": {
"@types/hast": "^3.0.0",
"@types/mdast": "^4.0.0",
"@types/node": "^24.0.0",
"@types/xast": "^2.0.0",
"c8": "^10.0.0",
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-gfm": "^3.0.0",
"micromark-extension-gfm": "^3.0.0",
"prettier": "^3.0.0",
"remark-cli": "^12.0.0",
"remark-preset-wooorm": "^10.0.0",
"strip-ansi": "^7.0.0",
"tsd": "^0.33.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.58.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
"build": "tsc --build --clean && tsc --build && tsd && type-coverage",
"format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
"bracketSpacing": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"remarkConfig": {
"plugins": [
"remark-preset-wooorm"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"#": "needed `any`s",
"ignoreFiles": [
"lib/index.d.ts"
],
"ignoreCatch": true,
"strict": true
},
"xo": {
"prettier": true,
"rules": {
"unicorn/prefer-at": "off",
"unicorn/prefer-string-replace-all": "off"
}
}
}
@@ -0,0 +1 @@
{"mappings":";;;;;;;AA2BO,SAAS,0CAA4D,KAA6B;IACvG,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG;IAC9B,sDAAsD;IACtD,IAAI,iBAAiB,MAAM,qBAAqB,IAAI,CAAA,GAAA,gCAAwB,EAAE;IAC9E,IAAI,eAAe,CAAA,GAAA,cAAM,EAAE,IACvB,MAAM,YAAY,GAAG,IAAI,IAAI,MAAM,YAAY,IAAI,IAAI,OACvD;QAAC,MAAM,YAAY;KAAC;IAExB,IAAI,gBAAgB,eAAe,aAAa;IAChD,eAAe,aAAa,GAAG,CAAC,KAAK;QACnC,2EAA2E;QAC3E,IAAI,cAAc,UAAU,OAAO,MAAM;YACvC,IAAI,OAAO,WAAW,OAAO,CAAC;YAC9B,IAAI,CAAA,iBAAA,2BAAA,KAAM,IAAI,MAAK,QAAQ;oBAGjB,cAEA;gBAJR,IAAI,WAAW,CAAA,GAAA,oBAAY,EAAE,MAAM;oBAE3B,kBAEA;gBAHR,IAAI,UAAU,QACZ,MAAM,CAAA,oBAAA,eAAA,CAAA,GAAA,kBAAU,EAAE,uBAAZ,mCAAA,aAAuB,GAAG,cAA1B,8BAAA,mBAA8B;qBAEpC,MAAM,CAAA,qBAAA,gBAAA,CAAA,GAAA,mBAAW,EAAE,uBAAb,oCAAA,cAAwB,GAAG,cAA3B,+BAAA,oBAA+B;YAEzC;QACF;QAEA,cAAc,KAAK;IACrB;IAEA,IAAI,mBAAmB,CAAA,GAAA,cAAM,EAAE,IAC7B,IAAI,CAAA,GAAA,uBAAe,EAAE,YAAY,iBAC/B;QAAC;QAAY;KAAe;IAGhC,iEAAiE;IACjE,MAAM,mBAAmB,CAAA,GAAA,aAAK,EAAY;IAC1C,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,eAAe,UAAU,IAAI,QAAQ,iBAAiB,OAAO,IAAI,CAAC,WAAW,OAAO,CAAC,eAAe,UAAU,GAAG;YACnH,MAAM,OAAO,iBAAiB,OAAO,CAAC,OAAO,CAAC,eAAe,UAAU;YACvE,MAAM,aACJ,CAAA,iBAAA,2BAAA,KAAM,SAAS,KAAI,QAAS,CAAA,KAAK,IAAI,KAAK,UAAU,KAAK,IAAI,KAAK,eAAe,KAAK,IAAI,KAAK,QAAO,IACtG,iBAAiB,OAAO,CAAC,OAAO,CAAC,KAAK,SAAS,IAC/C;YACF,IAAI,CAAC,YAAY;gBACf,eAAe,aAAa,CAAC;gBAC7B;YACF;YACA,MAAM,aAAa,iBAAiB,OAAO,CAAC,IAAI;YAChD,MAAM,OAAO,WAAW,IAAI;YAC5B,MAAM,OAAO,WAAW,MAAM,GAAG,KAAK,MAAM;YAC5C,IAAI,QAAQ,KAAK,GAAG,CAEhB,OAAO,IACP,KAAK,GAAG,CAAC,WAAW,KAAK,GAAG,OAAO,GAAG,KACtC,WAAW,KAAK,EAElB,KAAK,MAAM,GAAG;YAChB,IAAI,SAA6B;YACjC,MAAO,SAAS,EAAG;gBACjB,IAAI,CAAC,iBAAiB,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa;oBACrF,SAAS,IAAI,CAAC,MAAM;oBACpB;gBACF;gBACA,+BAA+B;gBAC/B,IAAI,QAAQ,KAAK,MAAM,GAAG,GACxB;qBAEK;oBACL,IAAI,QAAQ,WAAW,KAAK,EAC1B,QAAQ,WAAW,KAAK;oBAE1B;gBACF;YACF;YACA,IAAI,QAAQ;gBACV,MAAM,aAAa,OAAO,aAAa,GAAG;uBAAI,CAAA,GAAA,oBAAY,EAAE,QAAQ;iBAAY,GAAG,EAAE;gBACrF,MAAM,aACJ,OAAO,aAAa,IACpB,eAAe,QACf,QACA,KAAK,KAAK,GAAG,WAAW,MAAM,GAC9B,UAAU,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,GAC1B,OAAO,GAAG;gBACZ,eAAe,aAAa,CAAC;YAC/B,OACE,eAAe,aAAa,CAAC;QAEjC;QACA,iBAAiB,OAAO,GAAG;IAC7B,GAAG;QAAC;QAAY;QAAkB;QAAgB,eAAe,UAAU;KAAC;IAE5E,OAAO;oBACL;sBACA;QACA,8BAA8B;0BAC9B;IACF;AACF","sources":["packages/@react-stately/grid/src/useGridState.ts"],"sourcesContent":["import {getChildNodes, getFirstItem, getLastItem} from '@react-stately/collections';\nimport {GridCollection, GridNode} from '@react-types/grid';\nimport {Key} from '@react-types/shared';\nimport {MultipleSelectionState, MultipleSelectionStateProps, SelectionManager, useMultipleSelectionState} from '@react-stately/selection';\nimport {useEffect, useMemo, useRef} from 'react';\n\nexport interface GridState<T, C extends GridCollection<T>> {\n collection: C,\n /** A set of keys for rows that are disabled. */\n disabledKeys: Set<Key>,\n /** A selection manager to read and update row selection state. */\n selectionManager: SelectionManager,\n /** Whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */\n isKeyboardNavigationDisabled: boolean\n}\n\nexport interface GridStateOptions<T, C extends GridCollection<T>> extends MultipleSelectionStateProps {\n collection: C,\n disabledKeys?: Iterable<Key>,\n focusMode?: 'row' | 'cell',\n /** @private - do not use unless you know what you're doing. */\n UNSAFE_selectionState?: MultipleSelectionState\n}\n\n/**\n * Provides state management for a grid component. Handles row selection and focusing a grid cell's focusable child if applicable.\n */\nexport function useGridState<T extends object, C extends GridCollection<T>>(props: GridStateOptions<T, C>): GridState<T, C> {\n let {collection, focusMode} = props;\n // eslint-disable-next-line react-hooks/rules-of-hooks\n let selectionState = props.UNSAFE_selectionState || useMultipleSelectionState(props);\n let disabledKeys = useMemo(() =>\n props.disabledKeys ? new Set(props.disabledKeys) : new Set<Key>()\n , [props.disabledKeys]);\n\n let setFocusedKey = selectionState.setFocusedKey;\n selectionState.setFocusedKey = (key, child) => {\n // If focusMode is cell and an item is focused, focus a child cell instead.\n if (focusMode === 'cell' && key != null) {\n let item = collection.getItem(key);\n if (item?.type === 'item') {\n let children = getChildNodes(item, collection);\n if (child === 'last') {\n key = getLastItem(children)?.key ?? null;\n } else {\n key = getFirstItem(children)?.key ?? null;\n }\n }\n }\n\n setFocusedKey(key, child);\n };\n\n let selectionManager = useMemo(() =>\n new SelectionManager(collection, selectionState)\n , [collection, selectionState]\n );\n\n // Reset focused key if that item is deleted from the collection.\n const cachedCollection = useRef<C | null>(null);\n useEffect(() => {\n if (selectionState.focusedKey != null && cachedCollection.current && !collection.getItem(selectionState.focuseLine truncated
@@ -0,0 +1,60 @@
{
"name": "tar-stream",
"version": "1.6.2",
"description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.",
"author": "Mathias Buus <mathiasbuus@gmail.com>",
"engines": {
"node": ">= 0.8.0"
},
"dependencies": {
"bl": "^1.0.0",
"buffer-alloc": "^1.2.0",
"end-of-stream": "^1.0.0",
"fs-constants": "^1.0.0",
"readable-stream": "^2.3.0",
"to-buffer": "^1.1.1",
"xtend": "^4.0.0"
},
"devDependencies": {
"concat-stream": "^1.6.2",
"standard": "^11.0.1",
"tape": "^4.9.0"
},
"scripts": {
"test": "standard && tape test/extract.js test/pack.js",
"test-all": "standard && tape test/*.js"
},
"keywords": [
"tar",
"tarball",
"parse",
"parser",
"generate",
"generator",
"stream",
"stream2",
"streams",
"streams2",
"streaming",
"pack",
"extract",
"modify"
],
"bugs": {
"url": "https://github.com/mafintosh/tar-stream/issues"
},
"homepage": "https://github.com/mafintosh/tar-stream",
"main": "index.js",
"files": [
"*.js",
"LICENSE"
],
"directories": {
"test": "test"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/mafintosh/tar-stream.git"
}
}
@@ -0,0 +1,15 @@
var log = require('./')
var net = require('net')
function createServer () {
var server = net.createServer()
setInterval(function () {}, 1000)
server.listen(0)
}
createServer()
createServer()
setTimeout(function () {
log()
}, 100)
@@ -0,0 +1,22 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ const $99b62ae3ff97ec45$export$c5f62239608282b6 = new WeakMap();
function $99b62ae3ff97ec45$export$567fc7097e064344(state, key, role) {
if (!state) // this case should only happen in the first render before the tabs are registered
return '';
if (typeof key === 'string') key = key.replace(/\s+/g, '');
let baseId = $99b62ae3ff97ec45$export$c5f62239608282b6.get(state);
return `${baseId}-${role}-${key}`;
}
export {$99b62ae3ff97ec45$export$c5f62239608282b6 as tabsIds, $99b62ae3ff97ec45$export$567fc7097e064344 as generateId};
//# sourceMappingURL=utils.module.js.map
@@ -0,0 +1,281 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromEvent = fromEvent;
var file_1 = require("./file");
var FILES_TO_IGNORE = [
// Thumbnail cache files for macOS and Windows
'.DS_Store', // macOs
'Thumbs.db' // Windows
];
/**
* Convert a DragEvent's DataTrasfer object to a list of File objects
* NOTE: If some of the items are folders,
* everything will be flattened and placed in the same list but the paths will be kept as a {path} property.
*
* EXPERIMENTAL: A list of https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle objects can also be passed as an arg
* and a list of File objects will be returned.
*
* @param evt
*/
function fromEvent(evt) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
if (isObject(evt) && isDataTransfer(evt.dataTransfer)) {
return [2 /*return*/, getDataTransferFiles(evt.dataTransfer, evt.type)];
}
else if (isChangeEvt(evt)) {
return [2 /*return*/, getInputFiles(evt)];
}
else if (Array.isArray(evt) && evt.every(function (item) { return 'getFile' in item && typeof item.getFile === 'function'; })) {
return [2 /*return*/, getFsHandleFiles(evt)];
}
return [2 /*return*/, []];
});
});
}
function isDataTransfer(value) {
return isObject(value);
}
function isChangeEvt(value) {
return isObject(value) && isObject(value.target);
}
function isObject(v) {
return typeof v === 'object' && v !== null;
}
function getInputFiles(evt) {
return fromList(evt.target.files).map(function (file) { return (0, file_1.toFileWithPath)(file); });
}
// Ee expect each handle to be https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle
function getFsHandleFiles(handles) {
return __awaiter(this, void 0, void 0, function () {
var files;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, Promise.all(handles.map(function (h) { return h.getFile(); }))];
case 1:
files = _a.sent();
return [2 /*return*/, files.map(function (file) { return (0, file_1.toFileWithPath)(file); })];
}
});
});
}
function getDataTransferFiles(dt, type) {
return __awaiter(this, void 0, void 0, function () {
var items, files;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!dt.items) return [3 /*break*/, 2];
items = fromList(dt.items)
.filter(function (item) { return item.kind === 'file'; });
// According to https://html.spec.whatwg.org/multipage/dnd.html#dndevents,
// only 'dragstart' and 'drop' has access to the data (source node)
if (type !== 'drop') {
return [2 /*return*/, items];
}
return [4 /*yield*/, Promise.all(items.map(toFilePromises))];
case 1:
files = _a.sent();
return [2 /*return*/, noIgnoredFiles(flatten(files))];
case 2: return [2 /*return*/, noIgnoredFiles(fromList(dt.files)
.map(function (file) { return (0, file_1.toFileWithPath)(file); }))];
}
});
});
}
function noIgnoredFiles(files) {
return files.filter(function (file) { return FILES_TO_IGNORE.indexOf(file.name) === -1; });
}
// IE11 does not support Array.from()
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Browser_compatibility
// https://developer.mozilla.org/en-US/docs/Web/API/FileList
// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList
function fromList(items) {
if (items === null) {
return [];
}
var files = [];
// tslint:disable: prefer-for-of
for (var i = 0; i < items.length; i++) {
var file = items[i];
files.push(file);
}
return files;
}
// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem
function toFilePromises(item) {
if (typeof item.webkitGetAsEntry !== 'function') {
return fromDataTransferItem(item);
}
var entry = item.webkitGetAsEntry();
// Safari supports dropping an image node from a different window and can be retrieved using
// the DataTransferItem.getAsFile() API
// NOTE: FileSystemEntry.file() throws if trying to get the file
if (entry && entry.isDirectory) {
return fromDirEntry(entry);
}
return fromDataTransferItem(item, entry);
}
function flatten(items) {
return items.reduce(function (acc, files) { return __spreadArray(__spreadArray([], __read(acc), false), __read((Array.isArray(files) ? flatten(files) : [files])), false); }, []);
}
function fromDataTransferItem(item, entry) {
return __awaiter(this, void 0, void 0, function () {
var h, file_2, file, fwp;
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!(globalThis.isSecureContext && typeof item.getAsFileSystemHandle === 'function')) return [3 /*break*/, 3];
return [4 /*yield*/, item.getAsFileSystemHandle()];
case 1:
h = _b.sent();
if (h === null) {
throw new Error("".concat(item, " is not a File"));
}
if (!(h !== undefined)) return [3 /*break*/, 3];
return [4 /*yield*/, h.getFile()];
case 2:
file_2 = _b.sent();
file_2.handle = h;
return [2 /*return*/, (0, file_1.toFileWithPath)(file_2)];
case 3:
file = item.getAsFile();
if (!file) {
throw new Error("".concat(item, " is not a File"));
}
fwp = (0, file_1.toFileWithPath)(file, (_a = entry === null || entry === void 0 ? void 0 : entry.fullPath) !== null && _a !== void 0 ? _a : undefined);
return [2 /*return*/, fwp];
}
});
});
}
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry
function fromEntry(entry) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry)];
});
});
}
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry
function fromDirEntry(entry) {
var reader = entry.createReader();
return new Promise(function (resolve, reject) {
var entries = [];
function readEntries() {
var _this = this;
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries
reader.readEntries(function (batch) { return __awaiter(_this, void 0, void 0, function () {
var files, err_1, items;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!!batch.length) return [3 /*break*/, 5];
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, Promise.all(entries)];
case 2:
files = _a.sent();
resolve(files);
return [3 /*break*/, 4];
case 3:
err_1 = _a.sent();
reject(err_1);
return [3 /*break*/, 4];
case 4: return [3 /*break*/, 6];
case 5:
items = Promise.all(batch.map(fromEntry));
entries.push(items);
// Continue reading
readEntries();
_a.label = 6;
case 6: return [2 /*return*/];
}
});
}); }, function (err) {
reject(err);
});
}
readEntries();
});
}
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry
function fromFileEntry(entry) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) {
entry.file(function (file) {
var fwp = (0, file_1.toFileWithPath)(file, entry.fullPath);
resolve(fwp);
}, function (err) {
reject(err);
});
})];
});
});
}
//# sourceMappingURL=file-selector.js.map
@@ -0,0 +1 @@
{"version":3,"file":"BindingIdentifier.js","sourceRoot":"","sources":["../../../../src/binding/models/BindingIdentifier.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAW,MAAM,CAAC,GAAG,CACvD,0CAA0C,CAC3C,CAAC"}
@@ -0,0 +1,26 @@
import AttributeMap from './AttributeMap';
interface Op {
// only one property out of {insert, delete, retain} will be present
insert?: string | Record<string, unknown>;
delete?: number;
retain?: number | Record<string, unknown>;
attributes?: AttributeMap;
}
namespace Op {
export function length(op: Op): number {
if (typeof op.delete === 'number') {
return op.delete;
} else if (typeof op.retain === 'number') {
return op.retain;
} else if (typeof op.retain === 'object' && op.retain !== null) {
return 1;
} else {
return typeof op.insert === 'string' ? op.insert.length : 1;
}
}
}
export default Op;
@@ -0,0 +1,175 @@
/**
* @import {Root as HastRoot} from 'hast'
* @import {Root as MdastRoot} from 'mdast'
* @import {Options as ToHastOptions} from 'mdast-util-to-hast'
* @import {Processor} from 'unified'
* @import {VFile} from 'vfile'
*/
/**
* @typedef {Omit<ToHastOptions, 'file'>} Options
*
* @callback TransformBridge
* Bridge-mode.
*
* Runs the destination with the new hast tree.
* Discards result.
* @param {MdastRoot} tree
* Tree.
* @param {VFile} file
* File.
* @returns {Promise<undefined>}
* Nothing.
*
* @callback TransformMutate
* Mutate-mode.
*
* Further transformers run on the hast tree.
* @param {MdastRoot} tree
* Tree.
* @param {VFile} file
* File.
* @returns {HastRoot}
* Tree (hast).
*/
import {toHast} from 'mdast-util-to-hast'
/**
* Turn markdown into HTML.
*
* ##### Notes
*
* ###### Signature
*
* * if a processor is given,
* runs the (rehype) plugins used on it with a hast tree,
* then discards the result (*bridge mode*)
* * otherwise,
* returns a hast tree,
* the plugins used after `remarkRehype` are rehype plugins (*mutate mode*)
*
* > 👉 **Note**:
* > It’s highly unlikely that you want to pass a `processor`.
*
* ###### HTML
*
* Raw HTML is available in mdast as `html` nodes and can be embedded in hast
* as semistandard `raw` nodes.
* Most plugins ignore `raw` nodes but two notable ones don’t:
*
* * `rehype-stringify` also has an option `allowDangerousHtml` which will
* output the raw HTML.
* This is typically discouraged as noted by the option name but is useful if
* you completely trust authors
* * `rehype-raw` can handle the raw embedded HTML strings by parsing them
* into standard hast nodes (`element`, `text`, etc);
* this is a heavy task as it needs a full HTML parser,
* but it is the only way to support untrusted content
*
* ###### Footnotes
*
* Many options supported here relate to footnotes.
* Footnotes are not specified by CommonMark,
* which we follow by default.
* They are supported by GitHub,
* so footnotes can be enabled in markdown with `remark-gfm`.
*
* The options `footnoteBackLabel` and `footnoteLabel` define natural language
* that explains footnotes,
* which is hidden for sighted users but shown to assistive technology.
* When your page is not in English,
* you must define translated values.
*
* Back references use ARIA attributes,
* but the section label itself uses a heading that is hidden with an
* `sr-only` class.
* To show it to sighted users,
* define different attributes in `footnoteLabelProperties`.
*
* ###### Clobbering
*
* Footnotes introduces a problem,
* as it links footnote calls to footnote definitions on the page through `id`
* attributes generated from user content,
* which results in DOM clobbering.
*
* DOM clobbering is this:
*
* ```html
* <p id=x></p>
* <script>alert(x) // `x` now refers to the DOM `p#x` element</script>
* ```
*
* Elements by their ID are made available by browsers on the `window` object,
* which is a security risk.
* Using a prefix solves this problem.
*
* More information on how to handle clobbering and the prefix is explained in
* *Example: headings (DOM clobbering)* in `rehype-sanitize`.
*
* ###### Unknown nodes
*
* Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.
* The default behavior for unknown nodes is:
*
* * when the node has a `value`
* (and doesn’t have `data.hName`, `data.hProperties`, or `data.hChildren`,
* see later),
* create a hast `text` node
* * otherwise,
* create a `<div>` element (which could be changed with `data.hName`),
* with its children mapped from mdast to hast as well
*
* This behavior can be changed by passing an `unknownHandler`.
*
* @overload
* @param {Processor} processor
* @param {Readonly<Options> | null | undefined} [options]
* @returns {TransformBridge}
*
* @overload
* @param {Readonly<Options> | null | undefined} [options]
* @returns {TransformMutate}
*
* @overload
* @param {Readonly<Options> | Processor | null | undefined} [destination]
* @param {Readonly<Options> | null | undefined} [options]
* @returns {TransformBridge | TransformMutate}
*
* @param {Readonly<Options> | Processor | null | undefined} [destination]
* Processor or configuration (optional).
* @param {Readonly<Options> | null | undefined} [options]
* When a processor was given,
* configuration (optional).
* @returns {TransformBridge | TransformMutate}
* Transform.
*/
export default function remarkRehype(destination, options) {
if (destination && 'run' in destination) {
/**
* @type {TransformBridge}
*/
return async function (tree, file) {
// Cast because root in -> root out.
const hastTree = /** @type {HastRoot} */ (
toHast(tree, {file, ...options})
)
await destination.run(hastTree, file)
}
}
/**
* @type {TransformMutate}
*/
return function (tree, file) {
// Cast because root in -> root out.
// To do: in the future, disallow ` || options` fallback.
// With `unified-engine`, `destination` can be `undefined` but
// `options` will be the file set.
// We should not pass that as `options`.
return /** @type {HastRoot} */ (
toHast(tree, {file, ...(destination || options)})
)
}
}
@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AsnPropTypes = exports.AsnTypeTypes = void 0;
var AsnTypeTypes;
(function (AsnTypeTypes) {
AsnTypeTypes[AsnTypeTypes["Sequence"] = 0] = "Sequence";
AsnTypeTypes[AsnTypeTypes["Set"] = 1] = "Set";
AsnTypeTypes[AsnTypeTypes["Choice"] = 2] = "Choice";
})(AsnTypeTypes || (exports.AsnTypeTypes = AsnTypeTypes = {}));
var AsnPropTypes;
(function (AsnPropTypes) {
AsnPropTypes[AsnPropTypes["Any"] = 1] = "Any";
AsnPropTypes[AsnPropTypes["Boolean"] = 2] = "Boolean";
AsnPropTypes[AsnPropTypes["OctetString"] = 3] = "OctetString";
AsnPropTypes[AsnPropTypes["BitString"] = 4] = "BitString";
AsnPropTypes[AsnPropTypes["Integer"] = 5] = "Integer";
AsnPropTypes[AsnPropTypes["Enumerated"] = 6] = "Enumerated";
AsnPropTypes[AsnPropTypes["ObjectIdentifier"] = 7] = "ObjectIdentifier";
AsnPropTypes[AsnPropTypes["Utf8String"] = 8] = "Utf8String";
AsnPropTypes[AsnPropTypes["BmpString"] = 9] = "BmpString";
AsnPropTypes[AsnPropTypes["UniversalString"] = 10] = "UniversalString";
AsnPropTypes[AsnPropTypes["NumericString"] = 11] = "NumericString";
AsnPropTypes[AsnPropTypes["PrintableString"] = 12] = "PrintableString";
AsnPropTypes[AsnPropTypes["TeletexString"] = 13] = "TeletexString";
AsnPropTypes[AsnPropTypes["VideotexString"] = 14] = "VideotexString";
AsnPropTypes[AsnPropTypes["IA5String"] = 15] = "IA5String";
AsnPropTypes[AsnPropTypes["GraphicString"] = 16] = "GraphicString";
AsnPropTypes[AsnPropTypes["VisibleString"] = 17] = "VisibleString";
AsnPropTypes[AsnPropTypes["GeneralString"] = 18] = "GeneralString";
AsnPropTypes[AsnPropTypes["CharacterString"] = 19] = "CharacterString";
AsnPropTypes[AsnPropTypes["UTCTime"] = 20] = "UTCTime";
AsnPropTypes[AsnPropTypes["GeneralizedTime"] = 21] = "GeneralizedTime";
AsnPropTypes[AsnPropTypes["DATE"] = 22] = "DATE";
AsnPropTypes[AsnPropTypes["TimeOfDay"] = 23] = "TimeOfDay";
AsnPropTypes[AsnPropTypes["DateTime"] = 24] = "DateTime";
AsnPropTypes[AsnPropTypes["Duration"] = 25] = "Duration";
AsnPropTypes[AsnPropTypes["TIME"] = 26] = "TIME";
AsnPropTypes[AsnPropTypes["Null"] = 27] = "Null";
})(AsnPropTypes || (exports.AsnPropTypes = AsnPropTypes = {}));
@@ -0,0 +1 @@
{"name":"acorn","version":"8.15.0","requiresBuild":false,"files":{"bin/acorn":{"checkedAt":1794532093197,"integrity":"sha512-MLaQItkJuwyhrOKJyF/FKtIdJwIiCu8UK0PSNMdp2ycxUj54eYbX+eJ5qErbBGeZHapr4AdsuP9H+7gw1Kk0pA==","mode":493,"size":60},"LICENSE":{"checkedAt":1794532093197,"integrity":"sha512-sSZwWv50/V8LvOOycBo3ZvVml2zjfWDJyOeVwSWOfsidDTOfYQDxkZeYn5ZHYrtjwEzQ83d7V5QU92poVo7VEQ==","mode":420,"size":1099},"dist/acorn.js":{"checkedAt":1794532093198,"integrity":"sha512-2Fzm70I4oWrmN1lhsLP2O3W3BeoJ5SJZqVQ7wCzxguNgjCyo5slvQTB+UyzOaR1ZVq8bp1u6dMxM6dpZ+o8ggQ==","mode":420,"size":241575},"dist/bin.js":{"checkedAt":1794532093198,"integrity":"sha512-6nkNnZ8lxg2Q5+aZGEu2IEM5+AbG2/QKgK3DmUHN3Zznv6eDLpaS00D3mPc8608vB+Nz6dgRKp8jZ+Lg6u89pw==","mode":420,"size":3329},"package.json":{"checkedAt":1794532093198,"integrity":"sha512-8XvAlCd4SpAkuMl3PySAmgc0jND0VN70zA3uSKNNOTcR91kcZis2yY13pyMkTxn4rDWHBtcITRXXVSIhYWKrhw==","mode":420,"size":1061},"CHANGELOG.md":{"checkedAt":1794532093198,"integrity":"sha512-sUiuNPG+EIQxAp6VeGwnIvWT9fAB68nGftMOEXX55eSlej21pVLZUOW8hE7F+zw7xktqrMDt7d1t5kUzQANq7g==","mode":420,"size":23249},"README.md":{"checkedAt":1794532093198,"integrity":"sha512-UMAttWl2oI+Ioy/gdDBBjwJcwVAZN/770drh0lN4DlTiDlbWejHgOcvV4kSc1GdAiWhdqNZgLxuKHhUT66FdpQ==","mode":420,"size":10799},"dist/acorn.mjs":{"checkedAt":1794532093199,"integrity":"sha512-wsf5g/JpHKdSR2q3mf81WehA6ANc8i8EiGSj5ODQnps2VIDRzgYtma2yLhWt8n0+CoNyGLx53PnTe2B4EMGqRQ==","mode":420,"size":229792},"dist/acorn.d.mts":{"checkedAt":1794532093199,"integrity":"sha512-Anq5napGm2hHf8bVEfiJ5VdTTAMiHWUcSKfpjSfw6fzqCE7xSwPFmBkGuaFoXzc0JH2VfFbUTAOOVC5Kz5NaDw==","mode":420,"size":21989},"dist/acorn.d.ts":{"checkedAt":1794532093199,"integrity":"sha512-Anq5napGm2hHf8bVEfiJ5VdTTAMiHWUcSKfpjSfw6fzqCE7xSwPFmBkGuaFoXzc0JH2VfFbUTAOOVC5Kz5NaDw==","mode":420,"size":21989}}}
@@ -0,0 +1,30 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
ext_status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
battery_status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TNull;
type ReturnType = Static<typeof ReturnSchema>;
export declare class SetOnlineStatus extends OneBotAction<PayloadType, ReturnType> {
actionName: "set_online_status";
payloadSchema: import("@sinclair/typebox").TObject<{
status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
ext_status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
battery_status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>;
}>;
returnSchema: import("@sinclair/typebox").TNull;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
status: number;
ext_status: number;
battery_status: number;
};
returnExample: null;
_handle(payload: PayloadType): Promise<null>;
}
export {};
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=addRootServiceNodeBindingIfContextFree.spec.d.ts.map
@@ -0,0 +1,3 @@
declare function _exports(context: Context, node: ASTNode): boolean;
export = _exports;
//# sourceMappingURL=isCreateElement.d.ts.map
@@ -0,0 +1,403 @@
"use strict";
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 () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-deprecated',
meta: {
type: 'problem',
docs: {
description: 'Disallow using code marked as `@deprecated`',
recommended: 'strict',
requiresTypeChecking: true,
},
messages: {
deprecated: `\`{{name}}\` is deprecated.`,
deprecatedWithReason: `\`{{name}}\` is deprecated. {{reason}}`,
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allow: {
...util_1.typeOrValueSpecifiersSchema,
description: 'Type specifiers that can be allowed.',
},
},
},
],
},
defaultOptions: [
{
allow: [],
},
],
create(context, [options]) {
const { jsDocParsingMode } = context.parserOptions;
const allow = options.allow;
if (jsDocParsingMode === 'none' || jsDocParsingMode === 'type-info') {
throw new Error(`Cannot be used with jsDocParsingMode: '${jsDocParsingMode}'.`);
}
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
// Deprecated jsdoc tags can be added on some symbol alias, e.g.
//
// export { /** @deprecated */ foo }
//
// When we import foo, its symbol is an alias of the exported foo (the one
// with the deprecated tag), which is itself an alias of the original foo.
// Therefore, we carefully go through the chain of aliases and check each
// immediate alias for deprecated tags
function searchForDeprecationInAliasesChain(symbol, checkDeprecationsOfAliasedSymbol) {
if (!symbol || !tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias)) {
return checkDeprecationsOfAliasedSymbol
? getJsDocDeprecation(symbol)
: undefined;
}
const targetSymbol = checker.getAliasedSymbol(symbol);
while (tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias)) {
const reason = getJsDocDeprecation(symbol);
if (reason != null) {
return reason;
}
const immediateAliasedSymbol = symbol.getDeclarations() && checker.getImmediateAliasedSymbol(symbol);
if (!immediateAliasedSymbol) {
break;
}
symbol = immediateAliasedSymbol;
if (checkDeprecationsOfAliasedSymbol && symbol === targetSymbol) {
return getJsDocDeprecation(symbol);
}
}
return undefined;
}
function isDeclaration(node) {
const { parent } = node;
switch (parent.type) {
case utils_1.AST_NODE_TYPES.ArrayPattern:
return parent.elements.includes(node);
case utils_1.AST_NODE_TYPES.ClassExpression:
case utils_1.AST_NODE_TYPES.ClassDeclaration:
case utils_1.AST_NODE_TYPES.VariableDeclarator:
case utils_1.AST_NODE_TYPES.TSEnumMember:
return parent.id === node;
case utils_1.AST_NODE_TYPES.MethodDefinition:
case utils_1.AST_NODE_TYPES.PropertyDefinition:
case utils_1.AST_NODE_TYPES.AccessorProperty:
return parent.key === node;
case utils_1.AST_NODE_TYPES.Property:
// foo in "const { foo } = bar" will be processed twice, as parent.key
// and parent.value. The second is treated as a declaration.
if (parent.shorthand && parent.value === node) {
return parent.parent.type === utils_1.AST_NODE_TYPES.ObjectPattern;
}
if (parent.value === node) {
return false;
}
return parent.parent.type === utils_1.AST_NODE_TYPES.ObjectExpression;
case utils_1.AST_NODE_TYPES.AssignmentPattern:
// foo in "const { foo = "" } = bar" will be processed twice, as parent.parent.key
// and parent.left. The second is treated as a declaration.
return parent.left === node;
case utils_1.AST_NODE_TYPES.ArrowFunctionExpression:
case utils_1.AST_NODE_TYPES.FunctionDeclaration:
case utils_1.AST_NODE_TYPES.FunctionExpression:
case utils_1.AST_NODE_TYPES.TSDeclareFunction:
case utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression:
case utils_1.AST_NODE_TYPES.TSEnumDeclaration:
case utils_1.AST_NODE_TYPES.TSInterfaceDeclaration:
case utils_1.AST_NODE_TYPES.TSMethodSignature:
case utils_1.AST_NODE_TYPES.TSModuleDeclaration:
case utils_1.AST_NODE_TYPES.TSParameterProperty:
case utils_1.AST_NODE_TYPES.TSPropertySignature:
case utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration:
case utils_1.AST_NODE_TYPES.TSTypeParameter:
return true;
// treat `export import Bar = Foo;` (and `import Foo = require('...')`) as declarations
case utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration:
return parent.id === node;
default:
return false;
}
}
function isInsideImport(node) {
let current = node;
while (true) {
switch (current.type) {
case utils_1.AST_NODE_TYPES.ImportDeclaration:
return true;
case utils_1.AST_NODE_TYPES.ArrowFunctionExpression:
case utils_1.AST_NODE_TYPES.ExportAllDeclaration:
case utils_1.AST_NODE_TYPES.ExportNamedDeclaration:
case utils_1.AST_NODE_TYPES.BlockStatement:
case utils_1.AST_NODE_TYPES.ClassDeclaration:
case utils_1.AST_NODE_TYPES.TSInterfaceDeclaration:
case utils_1.AST_NODE_TYPES.FunctionDeclaration:
case utils_1.AST_NODE_TYPES.FunctionExpression:
case utils_1.AST_NODE_TYPES.Program:
case utils_1.AST_NODE_TYPES.TSUnionType:
case utils_1.AST_NODE_TYPES.VariableDeclarator:
return false;
default:
current = current.parent;
}
}
}
function getJsDocDeprecation(symbol) {
let jsDocTags;
try {
jsDocTags = symbol?.getJsDocTags(checker);
}
catch {
// workaround for https://github.com/microsoft/TypeScript/issues/60024
return;
}
const tag = jsDocTags?.find(tag => tag.name === 'deprecated');
if (!tag) {
return undefined;
}
const displayParts = tag.text;
return displayParts ? ts.displayPartsToString(displayParts) : '';
}
function isNodeCalleeOfParent(node) {
switch (node.parent?.type) {
case utils_1.AST_NODE_TYPES.NewExpression:
case utils_1.AST_NODE_TYPES.CallExpression:
return node.parent.callee === node;
case utils_1.AST_NODE_TYPES.TaggedTemplateExpression:
return node.parent.tag === node;
case utils_1.AST_NODE_TYPES.JSXOpeningElement:
return node.parent.name === node;
default:
return false;
}
}
function getCallLikeNode(node) {
let callee = node;
while (callee.parent?.type === utils_1.AST_NODE_TYPES.MemberExpression &&
callee.parent.property === callee) {
callee = callee.parent;
}
return isNodeCalleeOfParent(callee) ? callee : undefined;
}
function getCallLikeDeprecation(node) {
const tsNode = services.esTreeNodeToTSNodeMap.get(node.parent);
// If the node is a direct function call, we look for its signature.
const signature = (0, util_1.nullThrows)(checker.getResolvedSignature(tsNode), 'Expected call like node to have signature');
const symbol = services.getSymbolAtLocation(node);
const aliasedSymbol = symbol != null && tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias)
? checker.getAliasedSymbol(symbol)
: symbol;
const symbolDeclarationKind = aliasedSymbol?.declarations?.[0].kind;
// Properties with function-like types have "deprecated" jsdoc
// on their symbols, not on their signatures:
//
// interface Props {
// /** @deprecated */
// property: () => 'foo'
// ^symbol^ ^signature^
// }
if (symbolDeclarationKind !== ts.SyntaxKind.MethodDeclaration &&
symbolDeclarationKind !== ts.SyntaxKind.FunctionDeclaration &&
symbolDeclarationKind !== ts.SyntaxKind.MethodSignature) {
return (searchForDeprecationInAliasesChain(symbol, true) ??
getJsDocDeprecation(signature) ??
getJsDocDeprecation(aliasedSymbol));
}
return (searchForDeprecationInAliasesChain(symbol,
// Here we're working with a function declaration or method.
// Both can have 1 or more overloads, each overload creates one
// ts.Declaration which is placed in symbol.declarations.
//
// Imagine the following code:
//
// function foo(): void
// /** @deprecated Some Reason */
// function foo(arg: string): void
// function foo(arg?: string): void {}
//
// foo() // <- foo is our symbol
//
// If we call getJsDocDeprecation(checker.getAliasedSymbol(symbol)),
// we get 'Some Reason', but after all, we are calling foo with
// a signature that is not deprecated!
// It works this way because symbol.getJsDocTags returns tags from
// all symbol declarations combined into one array. And AFAIK there is
// no publicly exported TS function that can tell us if a particular
// declaration is deprecated or not.
//
// So, in case of function and method declarations, we don't check original
// aliased symbol, but rely on the getJsDocDeprecation(signature) call below.
false) ?? getJsDocDeprecation(signature));
}
function getJSXAttributeDeprecation(openingElement, propertyName) {
const tsNode = services.esTreeNodeToTSNodeMap.get(openingElement.name);
const contextualType = (0, util_1.nullThrows)(checker.getContextualType(tsNode), 'Expected JSX opening element name to have contextualType');
const symbol = contextualType.getProperty(propertyName);
return getJsDocDeprecation(symbol);
}
function getDeprecationReason(node) {
const callLikeNode = getCallLikeNode(node);
if (callLikeNode) {
return getCallLikeDeprecation(callLikeNode);
}
if (node.parent.type === utils_1.AST_NODE_TYPES.JSXAttribute &&
node.type !== utils_1.AST_NODE_TYPES.Super) {
return getJSXAttributeDeprecation(node.parent.parent, node.name);
}
if (node.parent.type === utils_1.AST_NODE_TYPES.Property &&
node.type !== utils_1.AST_NODE_TYPES.Super) {
const property = services
.getTypeAtLocation(node.parent.parent)
.getProperty(node.name);
const propertySymbol = services.getSymbolAtLocation(node);
const valueSymbol = checker.getShorthandAssignmentValueSymbol(propertySymbol?.valueDeclaration);
return (searchForDeprecationInAliasesChain(propertySymbol, true) ??
getJsDocDeprecation(property) ??
getJsDocDeprecation(propertySymbol) ??
getJsDocDeprecation(valueSymbol));
}
return searchForDeprecationInAliasesChain(services.getSymbolAtLocation(node), true);
}
function checkIdentifier(node) {
if (isDeclaration(node) || isInsideImport(node)) {
return;
}
const reason = getDeprecationReason(node);
if (reason == null) {
return;
}
const type = services.getTypeAtLocation(node);
if ((0, util_1.typeMatchesSomeSpecifier)(type, allow, services.program) ||
(0, util_1.valueMatchesSomeSpecifier)(node, allow, services.program, type)) {
return;
}
const name = getReportedNodeName(node);
context.report({
...(reason
? {
messageId: 'deprecatedWithReason',
data: { name, reason },
}
: {
messageId: 'deprecated',
data: { name },
}),
node,
});
}
function checkMemberExpression(node) {
if (!node.computed) {
return;
}
const propertyType = services.getTypeAtLocation(node.property);
if (propertyType.isLiteral()) {
const objectType = services.getTypeAtLocation(node.object);
const propertyName = propertyType.isStringLiteral()
? propertyType.value
: String(propertyType.value);
const property = objectType.getProperty(propertyName);
const reason = getJsDocDeprecation(property);
if (reason == null) {
return;
}
if ((0, util_1.typeMatchesSomeSpecifier)(objectType, allow, services.program)) {
return;
}
context.report({
...(reason
? {
messageId: 'deprecatedWithReason',
data: { name: propertyName, reason },
}
: {
messageId: 'deprecated',
data: { name: propertyName },
}),
node: node.property,
});
}
}
return {
Identifier(node) {
const { parent } = node;
if (parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration ||
parent.type === utils_1.AST_NODE_TYPES.ExportAllDeclaration) {
return;
}
// Computed identifier expressions are handled by checkMemberExpression
if (parent.type === utils_1.AST_NODE_TYPES.MemberExpression &&
parent.computed &&
parent.property === node) {
return;
}
if (parent.type === utils_1.AST_NODE_TYPES.ExportSpecifier) {
// only deal with the alias (exported) side, not the local binding
if (parent.exported !== node) {
return;
}
const symbol = services.getSymbolAtLocation(node);
const aliasDeprecation = getJsDocDeprecation(symbol);
if (aliasDeprecation != null) {
return;
}
}
// whether it's a plain identifier or the exported alias
checkIdentifier(node);
},
JSXIdentifier(node) {
if (node.parent.type !== utils_1.AST_NODE_TYPES.JSXClosingElement) {
checkIdentifier(node);
}
},
MemberExpression: checkMemberExpression,
PrivateIdentifier: checkIdentifier,
Super: checkIdentifier,
};
},
});
function getReportedNodeName(node) {
if (node.type === utils_1.AST_NODE_TYPES.Super) {
return 'super';
}
if (node.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) {
return `#${node.name}`;
}
return node.name;
}
@@ -0,0 +1,87 @@
/*
We purposely don't generate types for our plugin because TL;DR:
1) there's no real reason that anyone should do a typed import of our rules,
2) it would require us to change our code so there aren't as many inferred types
This type declaration exists as a hacky way to add a type to the export for our
internal packages that require it.
*** Long reason ***
When you turn on declaration files, TS requires all types to be "fully resolvable"
without changes to the code.
All of our lint rules `export default createRule(...)`, which means they all
implicitly reference the `TSESLint.Rule` type for the export.
TS wants to transpile each rule file to this `.d.ts` file:
```ts
import type { TSESLint } from '@typescript-eslint/utils';
declare const _default: TSESLint.RuleModule<TMessageIds, TOptions, TSESLint.RuleListener>;
export default _default;
```
Because we don't import `TSESLint` in most files, it means that TS would have to
insert a new import during the declaration emit to make this work.
However TS wants to avoid adding new imports to the file because a new module
could have type side-effects (like global augmentation) which could cause weird
type side-effects in the decl file that wouldn't exist in source TS file.
So TS errors on most of our rules with the following error:
```
The inferred type of 'default' cannot be named without a reference to
'../../../../node_modules/@typescript-eslint/utils/src/ts-eslint/Rule'.
This is likely not portable. A type annotation is necessary. ts(2742)
```
*/
/* eslint-disable no-restricted-syntax */
import type {
RuleModuleWithMetaDocs,
RuleRecommendation,
RuleRecommendationAcrossConfigs,
} from '@typescript-eslint/utils/ts-eslint';
interface ESLintPluginDocs {
/**
* Does the rule extend (or is it based off of) an ESLint code rule?
* Alternately accepts the name of the base rule, in case the rule has been renamed.
* This is only used for documentation purposes.
*/
extendsBaseRule?: boolean | string;
/**
* If a string config name, which starting config this rule is enabled in.
* If an object, which settings it has enabled in each of those configs.
*/
recommended?: RuleRecommendation | RuleRecommendationAcrossConfigs<unknown[]>;
/**
* Does the rule require us to create a full TypeScript Program in order for it
* to type-check code. This is only used for documentation purposes.
*/
requiresTypeChecking?: boolean;
}
type ESLintPluginRuleModule = RuleModuleWithMetaDocs<
string,
readonly unknown[],
ESLintPluginDocs
>;
type TypeScriptESLintRules = Record<
string,
RuleModuleWithMetaDocs<string, unknown[], ESLintPluginDocs>
>;
declare const rules: TypeScriptESLintRules;
declare namespace rules {
export type {
ESLintPluginDocs,
ESLintPluginRuleModule,
TypeScriptESLintRules,
};
}
export = rules;
@@ -0,0 +1,14 @@
declare const zinc: {
"50": string;
"100": string;
"200": string;
"300": string;
"400": string;
"500": string;
"600": string;
"700": string;
"800": string;
"900": string;
};
export { zinc };
@@ -0,0 +1,66 @@
'use strict';
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var Call = require('./Call');
var CreateDataProperty = require('./CreateDataProperty');
var EnumerableOwnPropertyNames = require('./EnumerableOwnPropertyNames');
var Get = require('./Get');
var IsArray = require('./IsArray');
var LengthOfArrayLike = require('./LengthOfArrayLike');
var ToString = require('./ToString');
var forEach = require('../helpers/forEach');
// https://262.ecma-international.org/11.0/#sec-internalizejsonproperty
module.exports = function InternalizeJSONProperty(holder, name, reviver) {
if (!isObject(holder)) {
throw new $TypeError('Assertion failed: `holder` is not an Object');
}
if (typeof name !== 'string') {
throw new $TypeError('Assertion failed: `name` is not a String');
}
if (typeof reviver !== 'function') {
throw new $TypeError('Assertion failed: `reviver` is not a Function');
}
var val = Get(holder, name); // step 1
if (isObject(val)) { // step 2
var isArray = IsArray(val); // step 2.a
if (isArray) { // step 2.b
var I = 0; // step 2.b.i
var len = LengthOfArrayLike(val, 'length'); // step 2.b.ii
while (I < len) { // step 2.b.iii
var newElement = InternalizeJSONProperty(val, ToString(I), reviver); // step 2.b.iv.1
if (typeof newElement === 'undefined') { // step 2.b.iii.2
delete val[ToString(I)]; // step 2.b.iii.2.a
} else { // step 2.b.iii.3
CreateDataProperty(val, ToString(I), newElement); // step 2.b.iii.3.a
}
I += 1; // step 2.b.iii.4
}
} else { // step 2.c
var keys = EnumerableOwnPropertyNames(val, 'key'); // step 2.c.i
forEach(keys, function (P) { // step 2.c.ii
// eslint-disable-next-line no-shadow
var newElement = InternalizeJSONProperty(val, P, reviver); // step 2.c.ii.1
if (typeof newElement === 'undefined') { // step 2.c.ii.2
delete val[P]; // step 2.c.ii.2.a
} else { // step 2.c.ii.3
CreateDataProperty(val, P, newElement); // step 2.c.ii.3.a
}
});
}
}
return Call(reviver, holder, [name, val]); // step 3
};
@@ -0,0 +1,11 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"complexity": [2, 11],
"max-statements": [2, 15],
"new-cap": [2, { "capIsNewExceptions": ["IsCallable"] }],
},
}
@@ -0,0 +1,69 @@
'use strict';
var callBound = require('call-bound');
var hasToStringTag = require('has-tostringtag/shams')();
var hasOwn = require('hasown');
var gOPD = require('gopd');
/** @type {import('.')} */
var fn;
if (hasToStringTag) {
/** @type {(receiver: ThisParameterType<typeof RegExp.prototype.exec>, ...args: Parameters<typeof RegExp.prototype.exec>) => ReturnType<typeof RegExp.prototype.exec>} */
var $exec = callBound('RegExp.prototype.exec');
/** @type {object} */
var isRegexMarker = {};
var throwRegexMarker = function () {
throw isRegexMarker;
};
/** @type {{ toString(): never, valueOf(): never, [Symbol.toPrimitive]?(): never }} */
var badStringifier = {
toString: throwRegexMarker,
valueOf: throwRegexMarker
};
if (typeof Symbol.toPrimitive === 'symbol') {
badStringifier[Symbol.toPrimitive] = throwRegexMarker;
}
/** @type {import('.')} */
// @ts-expect-error TS can't figure out that the $exec call always throws
// eslint-disable-next-line consistent-return
fn = function isRegex(value) {
if (!value || typeof value !== 'object') {
return false;
}
// eslint-disable-next-line no-extra-parens
var descriptor = /** @type {NonNullable<typeof gOPD>} */ (gOPD)(/** @type {{ lastIndex?: unknown }} */ (value), 'lastIndex');
var hasLastIndexDataProperty = descriptor && hasOwn(descriptor, 'value');
if (!hasLastIndexDataProperty) {
return false;
}
try {
// eslint-disable-next-line no-extra-parens
$exec(value, /** @type {string} */ (/** @type {unknown} */ (badStringifier)));
} catch (e) {
return e === isRegexMarker;
}
};
} else {
/** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
var $toString = callBound('Object.prototype.toString');
/** @const @type {'[object RegExp]'} */
var regexClass = '[object RegExp]';
/** @type {import('.')} */
fn = function isRegex(value) {
// In older browsers, typeof regex incorrectly returns 'function'
if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
return false;
}
return $toString(value) === regexClass;
};
}
module.exports = fn;
@@ -0,0 +1,22 @@
/**
* ```asn1
* Version ::= INTEGER { v1(0), v2(1), v3(2) }
* ```
*/
export declare enum Version {
v1 = 0,
v2 = 1,
v3 = 2
}
/**
* ```asn1
* CertificateSerialNumber ::= INTEGER
* ```
*/
export type CertificateSerialNumber = ArrayBuffer;
/**
* ```asn1
* UniqueIdentifier ::= BIT STRING
* ```
*/
export type UniqueIdentifier = ArrayBuffer;
@@ -0,0 +1,15 @@
import { TSESTree } from '@typescript-eslint/types';
export const getValue = (node) => {
switch (node.type) {
case TSESTree.AST_NODE_TYPES.Identifier: {
return node.name;
}
case TSESTree.AST_NODE_TYPES.Literal: {
return node.value;
}
default: {
throw new Error(`Unsupported node type: ${node.type}`);
}
}
};
//# sourceMappingURL=get-value.js.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more