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 @@
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAMM,SAAS,0CAAS,KAAyB;IAChD,OAAO,SAAS,QAAS,CAAA,CAAC,MAAM,UAAoB,AAAC,OAAO,OAAQ,KAAK,CAAC,oBAAoB,IAAG;AACnG;AAEO,SAAS,0CAAoB,KAAyB;IAC3D,IAAI,CAAC,SAAS,OAAO,UAAU,UAC7B,OAAO;IAET,IAAI,QAAQ,MAAM,KAAK,CAAC;IACxB,6DAA6D;IAC7D,IAAI,CAAC,OAAO;QACV,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAC3B,QAAQ,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,6GAA6G,CAAC,EACzI;QAEJ,OAAO;IACT;IACA,OAAO,WAAW,KAAK,CAAC,EAAE;AAC5B;AAEO,SAAS,0CAAiB,KAAsB,EAAE,UAAkB;IACzE,IAAI,OAAO,UAAU,UAAU;QAC7B,IAAI,QAAQ,MAAM,KAAK,CAAC;QACxB,IAAI,CAAC,OACH,MAAM,IAAI,MAAM;QAElB,OAAO,aAAc,CAAA,WAAW,KAAK,CAAC,EAAE,IAAI,GAAE;IAChD;IACA,OAAO;AACT;AAGO,SAAS,0CAAY,QAA4C,EAAE,UAAkB;IAC1F,OAAO,YAAY,OACf,0CAAiB,UAAU,cAC3B,OAAO,gBAAgB;AAC7B;AAGO,SAAS,0CAAY,QAAyB,EAAE,UAAkB;IACvE,OAAO,YAAY,OACf,0CAAiB,UAAU,cAC3B;AACN;AA+CO,SAAS,0CAAqB,cAAsB,EAAE,OAAkB,EAAE,cAAoC,EAAE,eAAkE,EAAE,kBAAqE;IAC9P,IAAI,oBAAoB;IACxB,IAAI,YAAwB,QAAQ,GAAG,CAAC,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,IAAI,CAAC;IACpB;IAEA,OAAO;AACT","sources":["packages/@react-stately/table/src/TableUtils.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ColumnSize} from '@react-types/table';\nimport {Key} from '@react-types/shared';\n\n// numbers and percents are considered static. *fr units or a lack of units are considered dynamic.\nexport function isStatic(width?: ColumnSize | null): boolean {\n return width != null && (!isNaN(width as number) || (String(width)).match(/^(\\d+)(?=%$)/) !== null);\n}\n\nexport function parseFractionalUnit(width?: ColumnSize | null): number {\n if (!width || typeof width === 'number') {\n return 1;\n }\n let match = width.match(/^(.+)(?=fr$)/);\n // if width is the incorrect format, just default it to a 1fr\n if (!match) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`width: ${width} is not a supported format, width should be a number (ex. 150), percentage (ex. '50%') or fr unit (ex. '2fr')`,\n 'defaulting to \\'1fr\\'');\n }\n return 1;\n }\n return parseFloat(match[0]);\n}\n\nexport function parseStaticWidth(width: number | string, tableWidth: number): number {\n if (typeof width === 'string') {\n let match = width.match(/^(\\d+)(?=%$)/);\n if (!match) {\n throw new Error('Only percentages or numbers are supported for static column widths');\n }\n return tableLine truncated
@@ -0,0 +1,41 @@
'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports['default'] =
recursivePatternCapture; /**
* Traverse a pattern/identifier node, calling 'callback'
* for each leaf identifier.
* @param {node} pattern
* @param {Function} callback
* @return {void}
*/function recursivePatternCapture(pattern, callback) {switch (pattern.type) {case 'Identifier': // base case
callback(pattern);break;case 'ObjectPattern':pattern.properties.forEach(function (p) {
if (p.type === 'ExperimentalRestProperty' || p.type === 'RestElement') {
callback(p.argument);
return;
}
recursivePatternCapture(p.value, callback);
});
break;
case 'ArrayPattern':
pattern.elements.forEach(function (element) {
if (element == null) {return;}
if (element.type === 'ExperimentalRestProperty' || element.type === 'RestElement') {
callback(element.argument);
return;
}
recursivePatternCapture(element, callback);
});
break;
case 'AssignmentPattern':
callback(pattern.left);
break;
default:}
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvcGF0dGVybkNhcHR1cmUuanMiXSwibmFtZXMiOlsicmVjdXJzaXZlUGF0dGVybkNhcHR1cmUiLCJwYXR0ZXJuIiwiY2FsbGJhY2siLCJ0eXBlIiwicHJvcGVydGllcyIsImZvckVhY2giLCJwIiwiYXJndW1lbnQiLCJ2YWx1ZSIsImVsZW1lbnRzIiwiZWxlbWVudCIsImxlZnQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFPd0JBLHVCLEVBUHhCOzs7Ozs7NEJBT2UsU0FBU0EsdUJBQVQsQ0FBaUNDLE9BQWpDLEVBQTBDQyxRQUExQyxFQUFvRCxDQUNqRSxRQUFRRCxRQUFRRSxJQUFoQixHQUNFLEtBQUssWUFBTCxFQUFtQjtBQUNqQkQsZUFBU0QsT0FBVCxFQUNBLE1BRUYsS0FBSyxlQUFMLENBQ0VBLFFBQVFHLFVBQVIsQ0FBbUJDLE9BQW5CLENBQTJCLFVBQUNDLENBQUQsRUFBTztBQUNoQyxZQUFJQSxFQUFFSCxJQUFGLEtBQVcsMEJBQVgsSUFBeUNHLEVBQUVILElBQUYsS0FBVyxhQUF4RCxFQUF1RTtBQUNyRUQsbUJBQVNJLEVBQUVDLFFBQVg7QUFDQTtBQUNEO0FBQ0RQLGdDQUF3Qk0sRUFBRUUsS0FBMUIsRUFBaUNOLFFBQWpDO0FBQ0QsT0FORDtBQU9BOztBQUVGLFNBQUssY0FBTDtBQU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GVyaW1lbnRhbFJlc3RQcm9wZXJ0eScgfHwgcC50eXBlID09PSAnUmVzdEVsZW1lbnQnKSB7XG4gICAgICAgICAgY2FsbGJhY2socC5hcmd1bWVudCk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHJlY3Vyc2l2ZVBhdHRlcm5DYXB0dXJlKHAudmFsdWUsIGNhbGxiYWNrKTtcbiAgICAgIH0pO1xuICAgICAgYnJlYWs7XG5cbiAgICBjYXNlICdBcnJheVBhdHRlcm4nOlxuICAgICAgcGF0dGVybi5lbGVtZW50cy5mb3JFYWNoKChlbGVtZW50KSA9PiB7XG4gICAgICAgIGlmIChlbGVtZW50ID09IG51bGwpIHsgcmV0dXJuOyB9XG4gICAgICAgIGlmIChlbGVtZW50LnR5cGUgPT09ICdFeHBlcmltZW50YWxSZXN0UHJvcGVydHknIHx8IGVsZW1lbnQudHlwZSA9PT0gJ1Jlc3RFbGVtZW50Jykge1xuICAgICAgICAgIGNhbGxiYWNrKGVsZW1lbnQuYXJndW1lbnQpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICByZWN1cnNpdmVQYXR0ZXJuQ2FwdHVyZShlbGVtZW50LCBjYWxsYmFjayk7XG4gICAgICB9KTtcbiAgICAgIGJyZWFrO1xuXG4gICAgY2FzZSAnQXNzaWdubWVudFBhdHRlcm4nOlxuICAgICAgY2FsbGJhY2socGF0dGVybi5sZWZ0KTtcbiAgICAgIGJyZWFrO1xuICAgIGRlZmF1bHQ6XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,8 @@
import { Spec } from '../../primitives.js';
/**
* Splits `spect.lines[].token.description` into other tokens,
* and populates the spec.{tag, name, type, description}. Invoked in a chaing
* with other tokens, operations listed above can be moved to separate tokenizers
*/
export type Tokenizer = (spec: Spec) => Spec;
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;A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BAC9C,KAAK,CAAC,oCAAoC,CAAC,CAAA;gBAC3C,MAAM,UAAU,GAAG,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,CAAC,IAAI,CAAA;gBAE/C,MAAM,SAAS,GAAG,aAAG,CAAC,OAAO,+CACxB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,KACjD,MAAM;oBACN,UAAU,KACP,IAAI,CAAC,oBAAoB,EAC5B,CAAA;gBAEF,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;oBAChC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;oBACxC,OAAO,CAAC,SAAS,CAAC,CAAA;gBACpB,CAAC,CAAC,CAAA;gBAEF,OAAO,SAAS,CAAA;aACjB;YAED,OAAO,MAAM,CAAA;;KACd;CACF;AA7FD,0CA6FC;AAED,SAAS,IAAI,CACX,GAAM,EACN,GAAG,IAAO;IAIV,MAAM,GAAG,GAAG,EAAgD,CAAA;IAC5D,IAAI,GAAqB,CAAA;IACzB,KAAK,GAAG,IAAI,GAAG,EAAE;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACvB,GAAG,CAAC,GAAG,CAAC,GAAG,GAAGLine truncated
@@ -0,0 +1 @@
{"name":"@polka/url","version":"1.0.0-next.29","requiresBuild":false,"files":{"build.js":{"checkedAt":1794532091557,"integrity":"sha512-kChbpyaaGf9SV+Q2c4AiRetpxojUXYuawWdvUCZ5n50qD2euUkmCv71ihZMZyDzWho+hGSdc657Kx5mK0A5yxg==","mode":420,"size":895},"package.json":{"checkedAt":1794532091558,"integrity":"sha512-dSzuHl1TPIst+//Ic0IAtx56ifL1kvv1AjnRjMJdCY2j1Tj2VEwyNpdudWcxw5BthdzNX+fOYoMjB3Qua5WJ+g==","mode":420,"size":616},"readme.md":{"checkedAt":1794532091558,"integrity":"sha512-HGLVuCbaGmyEWnu6jJjakz9h6+Qri7G3J7QfJ1r+sXGJs9UeMjkP+/tN82C6yv5y2tWAbVdTHDU93kyxTiq1rw==","mode":420,"size":2154},"build.mjs":{"checkedAt":1794532091558,"integrity":"sha512-5lvA+AmivpgPqq+xDhcD/8NIB7uWK1UW40TPYrwiQz9jZhWR6Ue9Ismop6PkVpnrmN9hDPBabn7KvCo2+Nxhlg==","mode":420,"size":884},"index.d.ts":{"checkedAt":1794532091558,"integrity":"sha512-8ByosVfuRLRb12wRDpQcbAME6VU3Y7ETddtFiCD9+wog6I7vDse2lBiO3Vv0jNxHWqxqlNxmALGMuvTsdq77Aw==","mode":420,"size":266}}}
@@ -0,0 +1,12 @@
export default (function (option, Dayjs, dayjs) {
dayjs.updateLocale = function (locale, customConfig) {
var localeList = dayjs.Ls;
var localeConfig = localeList[locale];
if (!localeConfig) return;
var customConfigKeys = customConfig ? Object.keys(customConfig) : [];
customConfigKeys.forEach(function (c) {
localeConfig[c] = customConfig[c];
});
return localeConfig; // eslint-disable-line consistent-return
};
});
@@ -0,0 +1,23 @@
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
import type { Static } from '../static/index.mjs';
import type { Ensure } from '../helpers/index.mjs';
import type { TReadonlyOptional } from '../readonly-optional/index.mjs';
import type { TReadonly } from '../readonly/index.mjs';
import type { TOptional } from '../optional/index.mjs';
import { Kind } from '../symbols/index.mjs';
type StaticReturnType<U extends TSchema, P extends unknown[]> = Static<U, P>;
type StaticParameter<T extends TSchema, P extends unknown[]> = T extends TReadonlyOptional<T> ? [Readonly<Static<T, P>>?] : T extends TReadonly<T> ? [Readonly<Static<T, P>>] : T extends TOptional<T> ? [Static<T, P>?] : [
Static<T, P>
];
type StaticParameters<T extends TSchema[], P extends unknown[], Acc extends unknown[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? StaticParameters<R, P, [...Acc, ...StaticParameter<L, P>]> : Acc);
type StaticFunction<T extends TSchema[], U extends TSchema, P extends unknown[]> = Ensure<(...param: StaticParameters<T, P>) => StaticReturnType<U, P>>;
export interface TFunction<T extends TSchema[] = TSchema[], U extends TSchema = TSchema> extends TSchema {
[Kind]: 'Function';
static: StaticFunction<T, U, this['params']>;
type: 'Function';
parameters: T;
returns: U;
}
/** `[JavaScript]` Creates a Function type */
export declare function Function<T extends TSchema[], U extends TSchema>(parameters: [...T], returns: U, options?: SchemaOptions): TFunction<T, U>;
export {};
@@ -0,0 +1,429 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.StyleToJS = factory());
})(this, (function () { 'use strict';
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
var cjs$2 = {};
var cjs$1;
var hasRequiredCjs$2;
function requireCjs$2 () {
if (hasRequiredCjs$2) return cjs$1;
hasRequiredCjs$2 = 1;
// http://www.w3.org/TR/CSS21/grammar.html
// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
var NEWLINE_REGEX = /\n/g;
var WHITESPACE_REGEX = /^\s*/;
// declaration
var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
var COLON_REGEX = /^:\s*/;
var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
var SEMICOLON_REGEX = /^[;\s]*/;
// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
var TRIM_REGEX = /^\s+|\s+$/g;
// strings
var NEWLINE = '\n';
var FORWARD_SLASH = '/';
var ASTERISK = '*';
var EMPTY_STRING = '';
// types
var TYPE_COMMENT = 'comment';
var TYPE_DECLARATION = 'declaration';
/**
* @param {String} style
* @param {Object} [options]
* @return {Object[]}
* @throws {TypeError}
* @throws {Error}
*/
function index (style, options) {
if (typeof style !== 'string') {
throw new TypeError('First argument must be a string');
}
if (!style) return [];
options = options || {};
/**
* Positional.
*/
var lineno = 1;
var column = 1;
/**
* Update lineno and column based on `str`.
*
* @param {String} str
*/
function updatePosition(str) {
var lines = str.match(NEWLINE_REGEX);
if (lines) lineno += lines.length;
var i = str.lastIndexOf(NEWLINE);
column = ~i ? str.length - i : column + str.length;
}
/**
* Mark position and patch `node.position`.
*
* @return {Function}
*/
function position() {
var start = { line: lineno, column: column };
return function (node) {
node.position = new Position(start);
whitespace();
return node;
};
}
/**
* Store position information for a node.
*
* @constructor
* @property {Object} start
* @property {Object} end
* @property {undefined|String} source
*/
function Position(start) {
this.start = start;
this.end = { line: lineno, column: column };
this.source = options.source;
}
/**
* Non-enumerable source string.
*/
Position.prototype.content = style;
/**
* Error `msg`.
*
* @param {String} msg
* @throws {Error}
*/
function error(msg) {
var err = new Error(
options.source + ':' + lineno + ':' + column + ': ' + msg
);
err.reason = msg;
err.filename = options.source;
err.line = lineno;
err.column = column;
err.source = style;
if (options.silent) ; else {
throw err;
}
}
/**
* Match `re` and return captures.
*
* @param {RegExp} re
* @return {undefined|Array}
*/
function match(re) {
var m = re.exec(style);
if (!m) return;
var str = m[0];
updatePosition(str);
style = style.slice(str.length);
return m;
}
/**
* Parse whitespace.
*/
function whitespace() {
match(WHITESPACE_REGEX);
}
/**
* Parse comments.
*
* @param {Object[]} [rules]
* @return {Object[]}
*/
function comments(rules) {
var c;
rules = rules || [];
while ((c = comment())) {
if (c !== false) {
rules.push(c);
}
}
return rules;
}
/**
* Parse comment.
*
* @return {Object}
* @throws {Error}
*/
function comment() {
var pos = position();
if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
var i = 2;
while (
EMPTY_STRING != style.charAt(i) &&
(ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))
) {
++i;
}
i += 2;
if (EMPTY_STRING === style.charAt(i - 1)) {
return error('End of comment missing');
}
var str = style.slice(2, i - 2);
column += 2;
updatePosition(str);
style = style.slice(i);
column += 2;
return pos({
type: TYPE_COMMENT,
comment: str
});
}
/**
* Parse declaration.
*
* @return {Object}
* @throws {Error}
*/
function declaration() {
var pos = position();
// prop
var prop = match(PROPERTY_REGEX);
if (!prop) return;
comment();
// :
if (!match(COLON_REGEX)) return error("property missing ':'");
// val
var val = match(VALUE_REGEX);
var ret = pos({
type: TYPE_DECLARATION,
property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
value: val
? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))
: EMPTY_STRING
});
// ;
match(SEMICOLON_REGEX);
return ret;
}
/**
* Parse declarations.
*
* @return {Object[]}
*/
function declarations() {
var decls = [];
comments(decls);
// declarations
var decl;
while ((decl = declaration())) {
if (decl !== false) {
decls.push(decl);
comments(decls);
}
}
return decls;
}
whitespace();
return declarations();
}
/**
* Trim `str`.
*
* @param {String} str
* @return {String}
*/
function trim(str) {
return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
}
cjs$1 = index;
return cjs$1;
}
var hasRequiredCjs$1;
function requireCjs$1 () {
if (hasRequiredCjs$1) return cjs$2;
hasRequiredCjs$1 = 1;
var __importDefault = (cjs$2 && cjs$2.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(cjs$2, "__esModule", { value: true });
cjs$2.default = StyleToObject;
const inline_style_parser_1 = __importDefault(requireCjs$2());
/**
* Parses inline style to object.
*
* @param style - Inline style.
* @param iterator - Iterator.
* @returns - Style object or null.
*
* @example Parsing inline style to object:
*
* ```js
* import parse from 'style-to-object';
* parse('line-height: 42;'); // { 'line-height': '42' }
* ```
*/
function StyleToObject(style, iterator) {
let styleObject = null;
if (!style || typeof style !== 'string') {
return styleObject;
}
const declarations = (0, inline_style_parser_1.default)(style);
const hasIterator = typeof iterator === 'function';
declarations.forEach((declaration) => {
if (declaration.type !== 'declaration') {
return;
}
const { property, value } = declaration;
if (hasIterator) {
iterator(property, value, declaration);
}
else if (value) {
styleObject = styleObject || {};
styleObject[property] = value;
}
});
return styleObject;
}
return cjs$2;
}
var utilities = {};
var hasRequiredUtilities;
function requireUtilities () {
if (hasRequiredUtilities) return utilities;
hasRequiredUtilities = 1;
Object.defineProperty(utilities, "__esModule", { value: true });
utilities.camelCase = void 0;
var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/;
var HYPHEN_REGEX = /-([a-z])/g;
var NO_HYPHEN_REGEX = /^[^-]+$/;
var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
var MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;
/**
* Checks whether to skip camelCase.
*/
var skipCamelCase = function (property) {
return !property ||
NO_HYPHEN_REGEX.test(property) ||
CUSTOM_PROPERTY_REGEX.test(property);
};
/**
* Replacer that capitalizes first character.
*/
var capitalize = function (match, character) {
return character.toUpperCase();
};
/**
* Replacer that removes beginning hyphen of vendor prefix property.
*/
var trimHyphen = function (match, prefix) { return "".concat(prefix, "-"); };
/**
* CamelCases a CSS property.
*/
var camelCase = function (property, options) {
if (options === void 0) { options = {}; }
if (skipCamelCase(property)) {
return property;
}
property = property.toLowerCase();
if (options.reactCompat) {
// `-ms` vendor prefix should not be capitalized
property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);
}
else {
// for non-React, remove first hyphen so vendor prefix is not capitalized
property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
}
return property.replace(HYPHEN_REGEX, capitalize);
};
utilities.camelCase = camelCase;
return utilities;
}
var cjs;
var hasRequiredCjs;
function requireCjs () {
if (hasRequiredCjs) return cjs;
hasRequiredCjs = 1;
var __importDefault = (cjs && cjs.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var style_to_object_1 = __importDefault(requireCjs$1());
var utilities_1 = requireUtilities();
/**
* Parses CSS inline style to JavaScript object (camelCased).
*/
function StyleToJS(style, options) {
var output = {};
if (!style || typeof style !== 'string') {
return output;
}
(0, style_to_object_1.default)(style, function (property, value) {
// skip CSS comment
if (property && value) {
output[(0, utilities_1.camelCase)(property, options)] = value;
}
});
return output;
}
StyleToJS.default = StyleToJS;
cjs = StyleToJS;
return cjs;
}
var cjsExports = requireCjs();
var index = /*@__PURE__*/getDefaultExportFromCjs(cjsExports);
return index;
}));
//# sourceMappingURL=style-to-js.js.map
@@ -0,0 +1,7 @@
# @swc/couter
Download counter for swc packages.
This package does not contain any code. It is used solely to track number of downloads of npm packages like `@swc/core` and `@next/swc`. If you are building a huge project using SWC, please consider depending on this package. It will not add any code to your bundle, but it will help us determine the number of users of SWC.
Counting is done by npm, just like other packages.
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2018_asyncgenerator: LibDefinition;
@@ -0,0 +1,356 @@
// prettier-ignore
/* eslint-disable */
/* auto-generated by NAPI-RS */
const { readFileSync } = require('fs')
let nativeBinding = null
const loadErrors = []
const isMusl = () => {
let musl = false
if (process.platform === 'linux') {
musl = isMuslFromFilesystem()
if (musl === null) {
musl = isMuslFromReport()
}
if (musl === null) {
musl = isMuslFromChildProcess()
}
}
return musl
}
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
const isMuslFromFilesystem = () => {
try {
return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
} catch {
return null
}
}
const isMuslFromReport = () => {
const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null
if (!report) {
return null
}
if (report.header && report.header.glibcVersionRuntime) {
return false
}
if (Array.isArray(report.sharedObjects)) {
if (report.sharedObjects.some(isFileMusl)) {
return true
}
}
return false
}
const isMuslFromChildProcess = () => {
try {
return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
} catch (e) {
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
return false
}
}
function requireNative() {
if (process.platform === 'android') {
if (process.arch === 'arm64') {
try {
return require('./swc.android-arm64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-android-arm64')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm') {
try {
return require('./swc.android-arm-eabi.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-android-arm-eabi')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
}
} else if (process.platform === 'win32') {
if (process.arch === 'x64') {
try {
return require('./swc.win32-x64-msvc.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-win32-x64-msvc')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'ia32') {
try {
return require('./swc.win32-ia32-msvc.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-win32-ia32-msvc')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm64') {
try {
return require('./swc.win32-arm64-msvc.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-win32-arm64-msvc')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
}
} else if (process.platform === 'darwin') {
try {
return require('./swc.darwin-universal.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-darwin-universal')
} catch (e) {
loadErrors.push(e)
}
if (process.arch === 'x64') {
try {
return require('./swc.darwin-x64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-darwin-x64')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm64') {
try {
return require('./swc.darwin-arm64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-darwin-arm64')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
}
} else if (process.platform === 'freebsd') {
if (process.arch === 'x64') {
try {
return require('./swc.freebsd-x64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-freebsd-x64')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm64') {
try {
return require('./swc.freebsd-arm64.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-freebsd-arm64')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
}
} else if (process.platform === 'linux') {
if (process.arch === 'x64') {
if (isMusl()) {
try {
return require('./swc.linux-x64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-linux-x64-musl')
} catch (e) {
loadErrors.push(e)
}
} else {
try {
return require('./swc.linux-x64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-linux-x64-gnu')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'arm64') {
if (isMusl()) {
try {
return require('./swc.linux-arm64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-linux-arm64-musl')
} catch (e) {
loadErrors.push(e)
}
} else {
try {
return require('./swc.linux-arm64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-linux-arm64-gnu')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'arm') {
try {
return require('./swc.linux-arm-gnueabihf.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-linux-arm-gnueabihf')
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'riscv64') {
if (isMusl()) {
try {
return require('./swc.linux-riscv64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-linux-riscv64-musl')
} catch (e) {
loadErrors.push(e)
}
} else {
try {
return require('./swc.linux-riscv64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-linux-riscv64-gnu')
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 's390x') {
try {
return require('./swc.linux-s390x-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
return require('@swc/core-linux-s390x-gnu')
} catch (e) {
loadErrors.push(e)
}
} else {
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
}
} else {
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
}
}
nativeBinding = requireNative()
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
try {
nativeBinding = require('./swc.wasi.cjs')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
}
}
if (!nativeBinding) {
try {
nativeBinding = require('@swc/core-wasm32-wasi')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
}
}
}
}
if (!nativeBinding) {
if (loadErrors.length > 0) {
// TODO Link to documentation with potential fixes
// - The package owner could build/publish bindings for this arch
// - The user may need to bundle the correct files
// - The user may need to re-install node_modules to get new packages
throw new Error('Failed to load native binding', { cause: loadErrors })
}
throw new Error(`Failed to load native binding`)
}
module.exports.Compiler = nativeBinding.Compiler
module.exports.JsCompiler = nativeBinding.JsCompiler
module.exports.analyze = nativeBinding.analyze
module.exports.bundle = nativeBinding.bundle
module.exports.getTargetTriple = nativeBinding.getTargetTriple
module.exports.initCustomTraceSubscriber = nativeBinding.initCustomTraceSubscriber
module.exports.minify = nativeBinding.minify
module.exports.minifySync = nativeBinding.minifySync
module.exports.newMangleNameCache = nativeBinding.newMangleNameCache
module.exports.parse = nativeBinding.parse
module.exports.parseFile = nativeBinding.parseFile
module.exports.parseFileSync = nativeBinding.parseFileSync
module.exports.parseSync = nativeBinding.parseSync
module.exports.print = nativeBinding.print
module.exports.printSync = nativeBinding.printSync
module.exports.transform = nativeBinding.transform
module.exports.transformFile = nativeBinding.transformFile
module.exports.transformFileSync = nativeBinding.transformFileSync
module.exports.transformSync = nativeBinding.transformSync
@@ -0,0 +1,32 @@
'use strict';
var $TypeError = require('es-errors/type');
var GetIteratorDirect = require('../aos/GetIteratorDirect');
var IteratorStepValue = require('es-abstract/2024/IteratorStepValue');
var Type = require('es-abstract/2024/Type');
module.exports = function toArray() {
if (this instanceof toArray) {
throw new $TypeError('`toArray` is not a constructor');
}
var O = this; // step 1
if (Type(O) !== 'Object') {
throw new $TypeError('`this` value must be an Object'); // step 2
}
var iterated = GetIteratorDirect(O); // step 3
var items = []; // step 4
// eslint-disable-next-line no-constant-condition
while (true) { // step 5
var value = IteratorStepValue(iterated); // step 5.a
if (iterated['[[Done]]']) {
return items; // step 5.b
}
items[items.length] = value; // step 5.d
}
};
@@ -0,0 +1,108 @@
declare namespace Chars {
type Empty = '';
type Space = ' ';
type Newline = '\n';
type Dot = '.';
type Hyphen = '-';
type Digit = [
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9'
];
type Alpha = [
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z'
];
}
declare namespace Trim {
type W4 = `${W3}${W3}`;
type W3 = `${W2}${W2}`;
type W2 = `${W1}${W1}`;
type W1 = `${W0}${W0}`;
type W0 = ` `;
/** Trims whitespace only */
export type TrimWhitespace<Code extends string> = (Code extends `${W4}${infer Rest extends string}` ? TrimWhitespace<Rest> : Code extends `${W3}${infer Rest extends string}` ? TrimWhitespace<Rest> : Code extends `${W1}${infer Rest extends string}` ? TrimWhitespace<Rest> : Code extends `${W0}${infer Rest extends string}` ? TrimWhitespace<Rest> : Code);
/** Trims Whitespace and Newline */
export type TrimAll<Code extends string> = (Code extends `${W4}${infer Rest extends string}` ? TrimAll<Rest> : Code extends `${W3}${infer Rest extends string}` ? TrimAll<Rest> : Code extends `${W1}${infer Rest extends string}` ? TrimAll<Rest> : Code extends `${W0}${infer Rest extends string}` ? TrimAll<Rest> : Code extends `${Chars.Newline}${infer Rest extends string}` ? TrimAll<Rest> : Code);
export {};
}
/** Scans for the next match union */
type NextUnion<Variants extends string[], Code extends string> = (Variants extends [infer Variant extends string, ...infer Rest1 extends string[]] ? NextConst<Variant, Code> extends [infer Match extends string, infer Rest2 extends string] ? [Match, Rest2] : NextUnion<Rest1, Code> : []);
type NextConst<Value extends string, Code extends string> = (Code extends `${Value}${infer Rest extends string}` ? [Value, Rest] : []);
/** Scans for the next constant value */
export type Const<Value extends string, Code extends string> = (Value extends '' ? ['', Code] : Value extends `${infer First extends string}${string}` ? (First extends Chars.Newline ? NextConst<Value, Trim.TrimWhitespace<Code>> : First extends Chars.Space ? NextConst<Value, Code> : NextConst<Value, Trim.TrimAll<Code>>) : never);
type NextNumberNegate<Code extends string> = (Code extends `${Chars.Hyphen}${infer Rest extends string}` ? [Chars.Hyphen, Rest] : [Chars.Empty, Code]);
type NextNumberZeroCheck<Code extends string> = (Code extends `0${infer Rest}` ? NextUnion<Chars.Digit, Rest> extends [string, string] ? false : true : true);
type NextNumberScan<Code extends string, HasDecimal extends boolean = false, Result extends string = Chars.Empty> = (NextUnion<[...Chars.Digit, Chars.Dot], Code> extends [infer Char extends string, infer Rest extends string] ? Char extends Chars.Dot ? HasDecimal extends false ? NextNumberScan<Rest, true, `${Result}${Char}`> : [Result, `.${Rest}`] : NextNumberScan<Rest, HasDecimal, `${Result}${Char}`> : [Result, Code]);
export type NextNumber<Code extends string> = (NextNumberNegate<Code> extends [infer Negate extends string, infer Rest extends string] ? NextNumberZeroCheck<Rest> extends true ? NextNumberScan<Rest> extends [infer Number extends string, infer Rest2 extends string] ? Number extends Chars.Empty ? [] : [`${Negate}${Number}`, Rest2] : [] : [] : []);
/** Scans for the next literal number */
export type Number<Code extends string> = NextNumber<Trim.TrimAll<Code>>;
type NextStringQuote<Options extends string[], Code extends string> = NextUnion<Options, Code>;
type NextStringBody<Code extends string, Quote extends string, Result extends string = Chars.Empty> = (Code extends `${infer Char extends string}${infer Rest extends string}` ? Char extends Quote ? [Result, Rest] : NextStringBody<Rest, Quote, `${Result}${Char}`> : []);
type NextString<Options extends string[], Code extends string> = (NextStringQuote<Options, Code> extends [infer Quote extends string, infer Rest extends string] ? NextStringBody<Rest, Quote> extends [infer String extends string, infer Rest extends string] ? [String, Rest] : [] : []);
/** Scans for the next literal string */
export type String<Options extends string[], Code extends string> = NextString<Options, Trim.TrimAll<Code>>;
type IdentLeft = [...Chars.Alpha, '_', '$'];
type IdentRight = [...Chars.Digit, ...IdentLeft];
type NextIdentScan<Code extends string, Result extends string = Chars.Empty> = (NextUnion<IdentRight, Code> extends [infer Char extends string, infer Rest extends string] ? NextIdentScan<Rest, `${Result}${Char}`> : [Result, Code]);
type NextIdent<Code extends string> = (NextUnion<IdentLeft, Code> extends [infer Left extends string, infer Rest1 extends string] ? NextIdentScan<Rest1> extends [infer Right extends string, infer Rest2 extends string] ? [`${Left}${Right}`, Rest2] : [] : []);
/** Scans for the next Ident */
export type Ident<Code extends string> = NextIdent<Trim.TrimAll<Code>>;
export {};
@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var HeadingRole = {
relatedConcepts: [{
module: 'ARIA',
concept: {
name: 'heading'
}
}, {
module: 'HTML',
concept: {
name: 'h1'
}
}, {
module: 'HTML',
concept: {
name: 'h2'
}
}, {
module: 'HTML',
concept: {
name: 'h3'
}
}, {
module: 'HTML',
concept: {
name: 'h4'
}
}, {
module: 'HTML',
concept: {
name: 'h5'
}
}, {
module: 'HTML',
concept: {
name: 'h6'
}
}],
type: 'structure'
};
var _default = HeadingRole;
exports.default = _default;
@@ -0,0 +1,43 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("eslint-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Math.log10` method.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-math-log10.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' method is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
for (const { node, path } of tracker.iterateGlobalReferences({
Math: {
log10: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1 @@
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAaD,MAAM,8CAAwB,uBAAuB,KAAK,MAAM,GAAG,QAAQ,CAAC,IAAI,KAAK,CAAC;AACtF,IAAI,mDAA6B,uBAAuB,KAAK,MAAM,GAAG,QAAQ,CAAC,IAAI,KAAK,CAAC;AACzF,MAAO,gDAA0B,iDAC/B,mDAA6B,uBAAuB,KAAK,MAAM,GAAG,QAAQ,CAAC,IAAI,KAAK,CAAC;AAIhF,SAAS,0CAAmB,MAA6B,EAAE,WAA0B;IAC1F,IAAI,YAAY,MAAM,KAAK,GACzB,OAAO,EAAE;IAGX,IAAI,UAA2B,EAAE;IACjC,IAAI,OAAO,IAAI;IACf,KAAK,IAAI,UAAU,YAAa;QAC9B,IAAI,YAAY,OAAO,SAAS;QAChC,IAAI,MAAM;YAAC;SAAO;QAElB,MAAO,UAAW;YAChB,IAAI,SAAkC,OAAO,GAAG,CAAC;YACjD,IAAI,CAAC,QACH;YAGF,uDAAuD;YACvD,0DAA0D;YAC1D,6DAA6D;YAC7D,gEAAgE;YAChE,IAAI,KAAK,GAAG,CAAC,SAAS;oBACpB;;gBAAA,aAAA,UAAA,QAAO,sDAAP,QAAO,UAAY;gBACnB,OAAO,OAAO;gBACd,OAAO,OAAO,GAAG,OAAO,OAAO;gBAE/B,IAAI,UAAC,MAAM,SAAE,KAAK,EAAC,GAAG,KAAK,GAAG,CAAC;gBAC/B,IAAI,QAAQ,IAAI,MAAM,EACpB;gBAGF,IAAK,IAAI,IAAI,OAAO,IAAI,IAAI,MAAM,EAAE,IAClC,OAAO,MAAM,CAAC,GAAG,GAAG;gBAGtB,yBAAyB;gBACzB,IAA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ru Nagashima
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks whether or not a node is a `.apply()` for variadic.
* @param {ASTNode} node A CallExpression node to check.
* @returns {boolean} Whether or not the node is a `.apply()` for variadic.
*/
function isVariadicApplyCalling(node) {
return (
astUtils.isSpecificMemberAccess(node.callee, null, "apply") &&
node.arguments.length === 2 &&
node.arguments[1].type !== "ArrayExpression" &&
node.arguments[1].type !== "SpreadElement"
);
}
/**
* Checks whether or not `thisArg` is not changed by `.apply()`.
* @param {ASTNode|null} expectedThis The node that is the owner of the applied function.
* @param {ASTNode} thisArg The node that is given to the first argument of the `.apply()`.
* @param {RuleContext} context The ESLint rule context object.
* @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`.
*/
function isValidThisArg(expectedThis, thisArg, context) {
if (!expectedThis) {
return astUtils.isNullOrUndefined(thisArg);
}
return astUtils.equalTokens(expectedThis, thisArg, context);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Require spread operators instead of `.apply()`",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/prefer-spread",
},
schema: [],
fixable: null,
messages: {
preferSpread: "Use the spread operator instead of '.apply()'.",
},
},
create(context) {
const sourceCode = context.sourceCode;
return {
CallExpression(node) {
if (!isVariadicApplyCalling(node)) {
return;
}
const applied = astUtils.skipChainExpression(
astUtils.skipChainExpression(node.callee).object,
);
const expectedThis =
applied.type === "MemberExpression" ? applied.object : null;
const thisArg = node.arguments[0];
if (isValidThisArg(expectedThis, thisArg, sourceCode)) {
context.report({
node,
messageId: "preferSpread",
});
}
},
};
},
};
@@ -0,0 +1,43 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("eslint-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Number.parseFloat` method.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-number-parsefloat.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' method is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
for (const { node, path } of tracker.iterateGlobalReferences({
Number: {
parseFloat: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,4 @@
/**
* Detects whether window and document objects are available in current environment.
*/
export default typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
@@ -0,0 +1 @@
{"version":3,"file":"mapping-entry.js","sourceRoot":"","sources":["../src/mapping-entry.ts"],"names":[],"mappings":";;;AAAA,2BAA6B;AAW7B;;;;;;;;GAQG;AACH,SAAgB,yBAAyB,CACvC,eAAuB,EACvB,KAAY,EACZ,WAAoB;IAEpB,iEAAiE;IACjE,mEAAmE;IACnE,iEAAiE;IACjE,IAAM,UAAU,GAAG,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3D,IAAM,aAAa,GAAwB,EAAE,CAAC;IAC9C,KAAkB,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU,EAAE;QAAzB,IAAM,GAAG,mBAAA;QACZ,aAAa,CAAC,IAAI,CAAC;YACjB,OAAO,EAAE,GAAG;YACZ,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAC,aAAa;gBAClC,OAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC;YAAzC,CAAyC,CAC1C;SACF,CAAC,CAAC;KACJ;IACD,8FAA8F;IAC9F,+DAA+D;IAC/D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,WAAW,EAAE;QAC9B,aAAa,CAAC,IAAI,CAAC;YACjB,OAAO,EAAE,GAAG;YACZ,KAAK,EAAE,CAAC,UAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,OAAI,CAAC;SACnD,CAAC,CAAC;KACJ;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AA5BD,8DA4BC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CAAC,GAAkB;IAC7C,OAAO,GAAG;SACP,MAAM,EAAE;SACR,IAAI,CAAC,UAAC,CAAS,EAAE,CAAS,IAAK,OAAA,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,EAAvC,CAAuC,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,eAAe,CAAC,OAAe;IACtC,IAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,MAAM,CAAC;AAChD,CAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"DynamicValueBinding.js","sourceRoot":"","sources":["../../../../src/binding/models/DynamicValueBinding.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
import {MessageDictionary as $d6fd23bc337660df$export$64839e615120df17} from "./MessageDictionary.mjs";
import {MessageFormatter as $972eb555d604f491$export$526ebc05ff964723} from "./MessageFormatter.mjs";
/*
* 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 {$d6fd23bc337660df$export$64839e615120df17 as MessageDictionary, $972eb555d604f491$export$526ebc05ff964723 as MessageFormatter};
//# sourceMappingURL=module.js.map
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_object_spread.cjs",
"module": "../../esm/_object_spread.js"
}
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","isExportDefaultDeclaration","isExportNamedDeclaration","ClassDeclaration","node","parent","inExport","_shouldPrintDecoratorsBeforeExport","printJoin","decorators","declare","word","space","abstract","id","print","typeParameters","superClass","superTypeParameters","implements","printList","body","ClassBody","token","length","newline","separator","classBodyEmptySemicolonsPrinter","exit","enterDelimited","endsWith","rightBrace","printer","tokenMap","start","end","indexes","getIndexes","k","occurrenceCount","nextLocIndex","advanceNextLocIndex","i","tok","matchesOriginal","_tokens","undefined","ClassProperty","static","format","preserveFormat","_node$key$loc","endLine","key","loc","line","catchUp","tsPrintClassMemberModifiers","computed","_variance","optional","definite","typeAnnotation","value","semicolon","ClassAccessorProperty","_node$key$loc2","ClassPrivateProperty","ClassMethod","_classMethodHead","ClassPrivateMethod","_node$key$loc3","_methodHead","StaticBlock","printSequence"],"sources":["../../src/generators/classes.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isExportDefaultDeclaration,\n isExportNamedDeclaration,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\nexport function ClassDeclaration(\n this: Printer,\n node: t.ClassDeclaration,\n parent: t.Node,\n) {\n const inExport =\n isExportDefaultDeclaration(parent) || isExportNamedDeclaration(parent);\n\n if (\n !inExport ||\n !this._shouldPrintDecoratorsBeforeExport(\n parent as t.ExportDeclaration & { declaration: t.ClassDeclaration },\n )\n ) {\n this.printJoin(node.decorators);\n }\n\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n if (node.abstract) {\n // TS\n this.word(\"abstract\");\n this.space();\n }\n\n this.word(\"class\");\n\n if (node.id) {\n this.space();\n this.print(node.id);\n }\n\n this.print(node.typeParameters);\n\n if (node.superClass) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.superClass);\n this.print(\n process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Renamed\n node.superTypeArguments\n : // @ts-ignore(Babel 7 vs Babel 8) Renamed\n node.superTypeParameters,\n );\n }\n\n if (node.implements) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements);\n }\n\n this.space();\n this.print(node.body);\n}\n\nexport { ClassDeclaration as ClassExpression };\n\nexport function ClassBody(this: Printer, node: t.ClassBody) {\n this.token(\"{\");\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n\n const separator = classBodyEmptySemicolonsPrinter(this, node);\n separator?.(-1); // print leading semicolons in preserveFormat mode\n\n const exit = this.enterDelimited();\n this.printJoin(node.body, true, true, separator, true);\n exit();\n\n if (!this.endsWith(charCodes.lineFeed)) this.newline();\n\n this.rightBrace(node);\n }\n}\n\nfunction classBodyEmptySemicolonsPrinter(printer: Printer, node: t.ClassBody) {\n if (!printer.tokenMap || node.start == null || node.end == null) {\n return null;\n }\n\n // \"empty statements\" in class bodies are not represented in the AST.\n // Print them by checking if there are any ; tokens between the current AST\n // member and the next one.\n\n const indexes = printer.tokenMap.getIndexes(node);\n if (!indexes) return null;\n\n let k = 1; // start from 1 to skip '{'\n\n let occurrenceCount = 0;\n\n let nextLocIndex = 0;\n const advanceNextLocIndex = () => {\n while (\n nextLocIndex < node.body.length &&\n node.body[nextLocIndex].start == null\n ) {\n nextLocIndex++;\n }\n };\n advanceNextLocIndex();\n\n return (i: number) => {\n if (nextLocIndex <= i) {\n nextLocIndex = i + 1;\n advanceNextLocIndex();\n }\n\n const end =\n nextLocIndex === node.body.length\n ? node.end\n : node.body[nextLocIndex].start;\n\n let tok;\n while (\n k < indexes.length &&\n printer.tokenMap!.matchesOriginal(\n (tok = printer._tokens![indexes[k]]),\n \";\",\n ) &&\n tok.start < end!\n ) {\n printer.token(\";\", undefined, occurrenceCount++);\n k++;\n }\n };\n}\n\nexport function ClassProperty(this: Printer, node: t.ClassProperty) {\n this.printJoin(node.decorators);\n\n if (!node.static && !this.format.preserveFormat) {\n // catch up to property key, avoid line break\n // between member TS modifiers and the property key.\n const endLine = node.key.loc?.end?.line;\n if (endLine) this.catchUp(endLine);\n }\n\n this.tsPrintClassMemberModifiersLine truncated
@@ -0,0 +1,20 @@
import { Module } from "module";
import { TransformOptions, JITIOptions, JITIImportOptions } from "./types";
export type { JITIOptions, TransformOptions } from "./types";
type Require = typeof require;
type Module = typeof module;
type ModuleCache = Record<string, Module>;
export type EvalModuleOptions = Partial<{
id: string;
filename: string;
ext: string;
cache: ModuleCache;
}>;
export interface JITI extends Require {
transform: (opts: TransformOptions) => string;
register: () => () => void;
evalModule: (source: string, options?: EvalModuleOptions) => unknown;
/** @experimental Behavior of `jiti.import` might change in the future. */
import: (id: string, importOptions: JITIImportOptions) => Promise<unknown>;
}
export default function createJITI(_filename: string, opts?: JITIOptions, parentModule?: Module, parentCache?: ModuleCache): JITI;
@@ -0,0 +1,7 @@
import addHours from "./addHours.mjs";
function subHours(date, hours) {
return addHours(date, -hours);
}
export {
subHours as default
};
@@ -0,0 +1,34 @@
#include <windows.h>
#include "TestUtil.cc"
int main(int argc, char *argv[]) {
if (argc != 3 && argc != 5) {
printf("Usage: %s x y\n", argv[0]);
printf("Usage: %s x y width height\n", argv[0]);
return 1;
}
HWND hwnd = GetConsoleWindow();
const int x = atoi(argv[1]);
const int y = atoi(argv[2]);
int w = 0, h = 0;
if (argc == 3) {
RECT r = {};
BOOL ret = GetWindowRect(hwnd, &r);
ASSERT(ret && "GetWindowRect failed on console window");
w = r.right - r.left;
h = r.bottom - r.top;
} else {
w = atoi(argv[3]);
h = atoi(argv[4]);
}
BOOL ret = MoveWindow(hwnd, x, y, w, h, TRUE);
trace("MoveWindow: ret=%d", ret);
printf("MoveWindow: ret=%d\n", ret);
return 0;
}
@@ -0,0 +1,8 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage"
]
}
@@ -0,0 +1,219 @@
type Args<T extends Function> = T extends (...args: infer R) => any ? R : never;
type AnyFunction<T = any> = (...args: T[]) => any;
type Extractable = {
[key: string]: any;
} | undefined;
type Iteratee<T> = ((value: T) => any) | keyof T;
/**
* Capitalizes the first character of a string and converts the rest of the string to lowercase.
*
* @param s - The string to capitalize.
* @returns The capitalized string, or an empty string if the input is falsy.
*
* @example
* capitalize('hello'); // returns 'Hello'
* capitalize(''); // returns ''
*/
declare const capitalize: (s: string) => string;
/**
* Creates a function that invokes each provided function with the same argument, until
* one of the functions calls `event.preventDefault()`.
*
* @param fns - An array of functions that may or may not be defined.
* @returns A function that takes an event and invokes each handler with this event.
*
* @typeParam T - A function type that takes an event-like argument.
*
* @example
* const handler1 = event => console.log('Handled by first', event.type);
* const handler2 = event => event.preventDefault();
* const allHandlers = callAllHandlers(handler1, handler2);
* allHandlers({ type: 'click' });
*/
declare function callAllHandlers<T extends (event: any) => void>(...fns: (T | undefined)[]): (event: Args<T>[0]) => void;
/**
* Creates a function that invokes each provided function with the same argument.
*
* @param fns - An array of functions that may or may not be defined.
* @returns A function that takes one argument and invokes all provided functions with it.
*
* @typeParam T - A function type that takes any argument.
*
* @example
* const greet = name => console.log(`Hello, ${name}!`);
* const bye = name => console.log(`Goodbye, ${name}!`);
* const greetAndBye = callAll(greet, bye);
* greetAndBye('Alice');
*/
declare function callAll<T extends AnyFunction>(...fns: (T | undefined)[]): (arg: Args<T>[0]) => void;
/**
* Extracts a property from a list of objects, returning the first found non-falsy value or a default value.
*
* @param key - The key of the property to extract.
* @param defaultValue - The default value to return if no non-falsy property value is found.
* @param objs - An array of objects to search.
* @returns The value of the extracted property or the default value.
*
* @typeParam K - The type of the key.
* @typeParam D - The type of the default value.
*
* @example
* extractProperty('name', 'Unknown', { name: 'Alice' }, { name: 'Bob' }); // returns 'Alice'
* extractProperty('age', 18, { name: 'Alice' }); // returns 18
*/
declare function extractProperty<K extends keyof Extractable, D extends keyof Extractable>(key: K | string, defaultValue: D | string | boolean, ...objs: Extractable[]): Extractable[K] | D | string | boolean;
/**
* Generates a unique identifier using a specified prefix and a random number.
*
* @param prefix - The prefix to prepend to the unique identifier.
* @returns A string that combines the prefix and a random number.
*
* @example
* getUniqueID('btn'); // returns 'btn-123456'
*/
declare function getUniqueID(prefix: string): string;
/**
* Removes all properties from an object that start with 'on', which are typically event handlers.
*
* @param input - The object from which to remove event properties.
* @returns The same object with event properties removed.
*
* @example
* removeEvents({ onClick: () => {}, onChange: () => {}, value: 10 }); // returns { value: 10 }
*/
declare function removeEvents(input: {
[key: string]: any;
}): {
[key: string]: any;
};
/**
* Converts an object into a JSON string. Returns an empty string if the object
* is not extractable or if a circular reference is detected during stringification.
*
* @param obj - The object to convert into a dependency string.
*
* @returns A JSON string representation of the object or an empty string if conversion fails.
*
* @example
* objectToDeps({ key: 'value' }); // returns '{"key":"value"}'
* objectToDeps(undefined); // returns ""
*/
declare function objectToDeps(obj: Extractable): string;
/**
* Creates a debounced function that delays invoking `func` until after `waitMilliseconds` have elapsed
* since the last time the debounced function was invoked. The debounced function has the
* same `this` context and arguments as the original function.
*
* @param func - The function to debounce.
* @param waitMilliseconds - The number of milliseconds to delay; defaults to 0.
*
* @returns A new debounced function.
*
* @typeParam F - The type of the function to debounce.
*
* @example
* const save = debounce(() => console.log('Saved!'), 300);
* save(); // Will log 'Saved!' after 300ms, subsequent calls within 300ms will reset the timer.
*/
declare function debounce<F extends (...args: any[]) => void>(func: F, waitMilliseconds?: number): (this: ThisParameterType<F>, ...args: Parameters<F>) => void;
/**
* Returns a new array of unique elements from the given array, where the uniqueness is determined by the specified iteratee.
*
* @param arr - The array to process.
* @param iteratee - The iteratee invoked per element to generate the criterion by which uniqueness is computed.
* This can be a function or the string key of the object properties.
*
* @returns A new array of elements that are unique based on the iteratee function.
*
* @typeParam T - The type of elements in the input array.
*
* @example
* uniqBy([{ id: 1 }, { id: 2 }, { id: 1 }], 'id'); // returns [{ id: 1 }, { id: 2 }]
*/
declare function uniqBy<T>(arr: T[], iteratee: any): T[];
/**
* Creates an object composed of the own and inherited enumerable property paths of `obj` that are not omitted.
*
* @param obj - The source object.
* @param keys - The property keys to omit.
*
* @returns A new object with the keys specified omitted.
*
* @typeParam Obj - The type of the object.
* @typeParam Keys - The type of the keys to omit.
*
* @example
* omit({ a: 1, b: '2', c: 3 }, ['a', 'c']); // returns { b: '2' }
*/
declare const omit: <Obj, Keys extends keyof Obj>(obj: Obj, keys: Keys[]) => Omit<Obj, Keys>;
/**
* Converts a string to kebab-case.
*
* @param s - The string to convert.
*
* @returns The kebab-case version of the string.
*
* @example
* kebabCase('fooBar'); // returns 'foo-bar'
*/
declare const kebabCase: (s: string) => string;
/**
* Creates an object with keys transformed using provided `iteratee` function, which takes each value and the corresponding key.
*
* @param obj - The source object.
* @param iteratee - The function invoked per iteration to transform the keys.
*
* @returns A new object with keys transformed by `iteratee`.
*
* @example
* mapKeys({ a: 1, b: 2 }, (value, key) => key + value); // returns { a1: 1, b2: 2 }
*/
declare const mapKeys: (obj: Record<string, any>, iteratee: (value: any, key: string) => any) => Record<string, any>;
/**
* Retrieves the value at a given path of a provided object safely. If the path does not exist,
* the function returns a default value, if provided.
*
* @param object - The object from which to retrieve the property.
* @param path - A dot notation string or an array of strings and numbers indicating the path of the property in the object.
* Dot notation can also include array indices in bracket notation (e.g., 'a.b[0].c').
* @param defaultValue - The value to return if the resolved value is `undefined`. This parameter is optional.
*
* @returns The value from the object at the specified path, or the default value if the path is not resolved.
*
* @example
* const obj = { a: { b: [{ c: 3 }] } };
*
* // Using string path with dot and bracket notation
* get(obj, 'a.b[0].c'); // returns 3
*
* // Using array path
* get(obj, ['a', 'b', 0, 'c']); // returns 3
*
* // Using default value for non-existent path
* get(obj, 'a.b[1].c', 'not found'); // returns 'not found'
*/
declare const get: (object: Record<string, any>, path: string | (string | number)[], defaultValue?: any) => any;
/**
* Computes the list of values that are the intersection of all provided arrays,
* with each element being transformed by the given iteratee, which can be a function or property name.
*
* @param args - A rest parameter that collects all arrays to intersect followed by an iteratee.
* The last element in `args` is the iteratee, which can be either a function or a property name string.
* The rest are arrays of elements of type T.
*
* @returns An array of elements of type T that exist in all arrays after being transformed by the iteratee.
*
* @throws {Error} If less than two arguments are provided or if the iteratee is not a function or a valid property string.
*
* @typeParam T - The type of elements in the input arrays.
*
* @example
* // Using a function as an iteratee
* intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); // returns [2.1]
*
* // Using a property name as an iteratee
* intersectionBy([{ x: 1 }, { x: 2 }], [{ x: 1 }], 'x'); // returns [{ x: 1 }]
*/
declare const intersectionBy: <T>(...args: [...arrays: T[][], iteratee: Iteratee<T>]) => T[];
export { callAll, callAllHandlers, capitalize, debounce, extractProperty, get, getUniqueID, intersectionBy, kebabCase, mapKeys, objectToDeps, omit, removeEvents, uniqBy };
@@ -0,0 +1,10 @@
function _extends() {
return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments);
}
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var docBacklinkRole = {
abstract: false,
accessibleNameRequired: true,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author', 'contents'],
prohibitedProps: [],
props: {
'aria-errormessage': null,
'aria-invalid': null
},
relatedConcepts: [{
concept: {
name: 'referrer [EPUB-SSV]'
},
module: 'EPUB'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'widget', 'command', 'link']]
};
var _default = exports.default = docBacklinkRole;
@@ -0,0 +1,95 @@
"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 (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ADDRESS_BOUNDARY = void 0;
exports.groupPossibilities = groupPossibilities;
exports.padGroup = padGroup;
exports.simpleRegularExpression = simpleRegularExpression;
exports.possibleElisions = possibleElisions;
const v6 = __importStar(require("./constants"));
function groupPossibilities(possibilities) {
return `(${possibilities.join('|')})`;
}
function padGroup(group) {
if (group.length < 4) {
return `0{0,${4 - group.length}}${group}`;
}
return group;
}
exports.ADDRESS_BOUNDARY = '[^A-Fa-f0-9:]';
function simpleRegularExpression(groups) {
const zeroIndexes = [];
groups.forEach((group, i) => {
const groupInteger = parseInt(group, 16);
if (groupInteger === 0) {
zeroIndexes.push(i);
}
});
// You can technically elide a single 0, this creates the regular expressions
// to match that eventuality
const possibilities = zeroIndexes.map((zeroIndex) => groups
.map((group, i) => {
if (i === zeroIndex) {
const elision = i === 0 || i === v6.GROUPS - 1 ? ':' : '';
return groupPossibilities([padGroup(group), elision]);
}
return padGroup(group);
})
.join(':'));
// The simplest case
possibilities.push(groups.map(padGroup).join(':'));
return groupPossibilities(possibilities);
}
function possibleElisions(elidedGroups, moreLeft, moreRight) {
const left = moreLeft ? '' : ':';
const right = moreRight ? '' : ':';
const possibilities = [];
// 1. elision of everything (::)
if (!moreLeft && !moreRight) {
possibilities.push('::');
}
// 2. complete elision of the middle
if (moreLeft && moreRight) {
possibilities.push('');
}
if ((moreRight && !moreLeft) || (!moreRight && moreLeft)) {
// 3. complete elision of one side
possibilities.push(':');
}
// 4. elision from the left side
possibilities.push(`${left}(:0{1,4}){1,${elidedGroups - 1}}`);
// 5. elision from the right side
possibilities.push(`(0{1,4}:){1,${elidedGroups - 1}}${right}`);
// 6. no elision
possibilities.push(`(0{1,4}:){${elidedGroups - 1}}0{1,4}`);
// 7. elision (including sloppy elision) from the middle
for (let groups = 1; groups < elidedGroups - 1; groups++) {
for (let position = 1; position < elidedGroups - groups; position++) {
possibilities.push(`(0{1,4}:){${position}}:(0{1,4}:){${elidedGroups - position - groups - 1}}0{1,4}`);
}
}
return groupPossibilities(possibilities);
}
//# sourceMappingURL=regular-expressions.js.map
@@ -0,0 +1,198 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.base64 = factory());
})(this, (function () { 'use strict';
/* ------------------------------------------------------------------------------------
base64 - MIT License - Hexagon <hexagon@56k.guru>
------------------------------------------------------------------------------------
License:
Copyright (c) 2021 Hexagon <hexagon@56k.guru>
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.
------------------------------------------------------------------------------------ */
const
// Regular base64 characters
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
// Base64url characters
charsUrl = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
genLookup = (target) => {
const lookupTemp = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
const len = chars.length;
for (let i = 0; i < len; i++) {
lookupTemp[target.charCodeAt(i)] = i;
}
return lookupTemp;
},
// Use a lookup table to find the index.
lookup = genLookup(chars),
lookupUrl = genLookup(charsUrl);
/**
* Pre-calculated regexes for validating base64 and base64url
*/
const base64UrlPattern = /^[-A-Za-z0-9\-_]*$/;
const base64Pattern = /^[-A-Za-z0-9+/]*={0,3}$/;
/**
* @namespace base64
*/
const base64 = {};
/**
* Convenience function for converting a base64 encoded string to an ArrayBuffer instance
* @public
*
* @param {string} data - Base64 representation of data
* @param {boolean} [urlMode] - If set to true, URL mode string will be expected
* @returns {ArrayBuffer} - Decoded data
*/
base64.toArrayBuffer = (data, urlMode) => {
const
len = data.length;
let bufferLength = data.length * 0.75,
i,
p = 0,
encoded1,
encoded2,
encoded3,
encoded4;
if (data[data.length - 1] === "=") {
bufferLength--;
if (data[data.length - 2] === "=") {
bufferLength--;
}
}
const
arraybuffer = new ArrayBuffer(bufferLength),
bytes = new Uint8Array(arraybuffer),
target = urlMode ? lookupUrl : lookup;
for (i = 0; i < len; i += 4) {
encoded1 = target[data.charCodeAt(i)];
encoded2 = target[data.charCodeAt(i + 1)];
encoded3 = target[data.charCodeAt(i + 2)];
encoded4 = target[data.charCodeAt(i + 3)];
bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
}
return arraybuffer;
};
/**
* Convenience function for creating a base64 encoded string from an ArrayBuffer instance
* @public
*
* @param {ArrayBuffer} arrBuf - ArrayBuffer to be encoded
* @param {boolean} [urlMode] - If set to true, URL mode string will be returned
* @returns {string} - Base64 representation of data
*/
base64.fromArrayBuffer = (arrBuf, urlMode) => {
const bytes = new Uint8Array(arrBuf);
let
i,
result = "";
const
len = bytes.length,
target = urlMode ? charsUrl : chars;
for (i = 0; i < len; i += 3) {
result += target[bytes[i] >> 2];
result += target[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
result += target[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
result += target[bytes[i + 2] & 63];
}
const remainder = len % 3;
if (remainder === 2) {
result = result.substring(0, result.length - 1) + (urlMode ? "" : "=");
} else if (remainder === 1) {
result = result.substring(0, result.length - 2) + (urlMode ? "" : "==");
}
return result;
};
/**
* Convenience function for converting base64 to string
* @public
*
* @param {string} str - Base64 encoded string to be decoded
* @param {boolean} [urlMode] - If set to true, URL mode string will be expected
* @returns {string} - Decoded string
*/
base64.toString = (str, urlMode) => {
return new TextDecoder().decode(base64.toArrayBuffer(str, urlMode));
};
/**
* Convenience function for converting a javascript string to base64
* @public
*
* @param {string} str - String to be converted to base64
* @param {boolean} [urlMode] - If set to true, URL mode string will be returned
* @returns {string} - Base64 encoded string
*/
base64.fromString = (str, urlMode) => {
return base64.fromArrayBuffer(new TextEncoder().encode(str), urlMode);
};
/**
* Function to validate base64
* @public
* @param {string} encoded - Base64 or Base64url encoded data
* @param {boolean} [urlMode] - If set to true, base64url will be expected
* @returns {boolean} - Valid base64/base64url?
*/
base64.validate = (encoded, urlMode) => {
// Bail out if not string
if (!(typeof encoded === "string" || encoded instanceof String)) {
return false;
}
// Go on validate
try {
return urlMode ? base64UrlPattern.test(encoded) : base64Pattern.test(encoded);
} catch (_e) {
return false;
}
};
base64.base64 = base64;
return base64;
}));
@@ -0,0 +1,23 @@
/**
* A specialized version of `_.every` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
*/
function arrayEvery(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (!predicate(array[index], index, array)) {
return false;
}
}
return true;
}
module.exports = arrayEvery;
@@ -0,0 +1,34 @@
var toString = require('./toString'),
unescapeHtmlChar = require('./_unescapeHtmlChar');
/** Used to match HTML entities and HTML characters. */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
reHasEscapedHtml = RegExp(reEscapedHtml.source);
/**
* The inverse of `_.escape`; this method converts the HTML entities
* `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
* their corresponding characters.
*
* **Note:** No other HTML entities are unescaped. To unescape additional
* HTML entities use a third-party library like [_he_](https://mths.be/he).
*
* @static
* @memberOf _
* @since 0.6.0
* @category String
* @param {string} [string=''] The string to unescape.
* @returns {string} Returns the unescaped string.
* @example
*
* _.unescape('fred, barney, &amp; pebbles');
* // => 'fred, barney, & pebbles'
*/
function unescape(string) {
string = toString(string);
return (string && reHasEscapedHtml.test(string))
? string.replace(reEscapedHtml, unescapeHtmlChar)
: string;
}
module.exports = unescape;
@@ -0,0 +1,3 @@
import { type Newable } from '@inversifyjs/common';
export declare function findInPrototypeChain<T>(type: Newable, reader: (type: Newable) => T | undefined): T | undefined;
//# sourceMappingURL=findInPrototypeChain.d.ts.map
@@ -0,0 +1,4 @@
'use strict';
// TODO: remove, semver-major
module.exports = require('get-symbol-description');
@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cleanJSXElementLiteralChild;
var _index = require("../../builders/generated/index.js");
var _index2 = require("../../index.js");
function cleanJSXElementLiteralChild(child, args) {
const lines = child.value.split(/\r\n|\n|\r/);
let lastNonEmptyLine = 0;
for (let i = 0; i < lines.length; i++) {
if (/[^ \t]/.exec(lines[i])) {
lastNonEmptyLine = i;
}
}
let str = "";
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
const isFirstLine = i === 0;
const isLastLine = i === lines.length - 1;
const isLastNonEmptyLine = i === lastNonEmptyLine;
let trimmedLine = line.replace(/\t/g, " ");
if (!isFirstLine) {
trimmedLine = trimmedLine.replace(/^ +/, "");
}
if (!isLastLine) {
trimmedLine = trimmedLine.replace(/ +$/, "");
}
if (trimmedLine) {
if (!isLastNonEmptyLine) {
trimmedLine += " ";
}
str += trimmedLine;
}
}
if (str) args.push((0, _index2.inherits)((0, _index.stringLiteral)(str), child));
}
//# sourceMappingURL=cleanJSXElementLiteralChild.js.map
@@ -0,0 +1,19 @@
import arrayMap from './_arrayMap.js';
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an
* array of `object` property values corresponding to the property names
* of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the array of property values.
*/
function baseValues(object, props) {
return arrayMap(props, function(key) {
return object[key];
});
}
export default baseValues;
@@ -0,0 +1 @@
{"mappings":";;AAcA,4BAA4B,CAAC,CAAE,YAAW,WAAW,KAAK,CAAC,CAAC,CAAC;gBAO/C,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAiDnC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IAI/C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,OAAO,IAAI,gBAAgB,CAAC,GAAG,CAAC;IAIhC,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI;IAKlC,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI;IAKjC,WAAW,IAAI,GAAG,GAAG,IAAI;IAIzB,UAAU,IAAI,GAAG,GAAG,IAAI;IAIxB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,KAAK,CAAC,CA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CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzD,eAAe;IACf,wBAAwB,CAAC,EAAE,OAAO,CAAA;CACnC;AAED,uCAAuC,CAAC,CAAE,SAAQ,UAAU,CAAC,CAAC;IAC5D,+CAA+C;IAC/C,QAAQ,CAAC,WAAW,EAAE,GAAG,GAAG,IAAI,CAAC;IAEjC,6BAA6B;IAC7B,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;IAEtC,gDAAgD;IAChD,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,GAAG,IAAI,CAAA;CACtC;AAED;;;GAGG;AACH,yCAAyC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAsCpH","sources":["packages/@react-stately/list/src/packages/@react-stately/list/src/ListCollection.ts","packages/@react-stately/list/src/packages/@react-stately/list/src/useListState.ts","packages/@react-stately/list/src/packages/@react-stately/list/src/useSingleSelectListState.ts","packages/@react-stately/list/src/packages/@react-stately/list/src/index.ts","packages/@react-stately/list/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {ListProps, ListState} from './useListState';\nexport type {SingleSelectListProps, SingleSelectListState} from './useSingleSelectListState';\nexport {useListState, UNSTABLE_useFilteredListState} from './useListState';\nexport {useSingleSelectListState} from './useSingleSelectListState';\nexport {ListCollection} from './ListCollection';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -0,0 +1,17 @@
let { execSync } = require('child_process')
let pico = require('picocolors')
try {
let version = parseInt(execSync('npm -v'))
if (version <= 6) {
process.stderr.write(
pico.red(
'Update npm or call ' +
pico.yellow('npx browserslist@latest --update-db') +
'\n'
)
)
process.exit(1)
}
// eslint-disable-next-line no-unused-vars
} catch (e) {}
@@ -0,0 +1,56 @@
/*
* 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 {AriaLabelingProps} from '@react-types/shared';
import {useLayoutEffect} from './useLayoutEffect';
import {useState} from 'react';
let descriptionId = 0;
const descriptionNodes = new Map<string, {refCount: number, element: Element}>();
export function useDescription(description?: string): AriaLabelingProps {
let [id, setId] = useState<string | undefined>();
useLayoutEffect(() => {
if (!description) {
return;
}
let desc = descriptionNodes.get(description);
if (!desc) {
let id = `react-aria-description-${descriptionId++}`;
setId(id);
let node = document.createElement('div');
node.id = id;
node.style.display = 'none';
node.textContent = description;
document.body.appendChild(node);
desc = {refCount: 0, element: node};
descriptionNodes.set(description, desc);
} else {
setId(desc.element.id);
}
desc.refCount++;
return () => {
if (desc && --desc.refCount === 0) {
desc.element.remove();
descriptionNodes.delete(description);
}
};
}, [description]);
return {
'aria-describedby': description ? id : undefined
};
}
@@ -0,0 +1,8 @@
import { ServiceIdentifier } from '@inversifyjs/common';
import { PlanBindingNode } from './PlanBindingNode';
export interface PlanServiceNode {
bindings: PlanBindingNode | PlanBindingNode[] | undefined;
isContextFree: boolean;
readonly serviceIdentifier: ServiceIdentifier;
}
//# sourceMappingURL=PlanServiceNode.d.ts.map
@@ -0,0 +1,374 @@
export default `flf2a$ 1 1 11 -1 12 0
octal.flf by Karlton Wirsing based on
binary.flf (C) 1994 by Victor Parada (vparada@inf.utfsm.cl) 94/12/05
figlet 2.1 font, includes ISO Latin-1, excludes "-D" option chars.
Spaces are not shown as binary. If this is required, change "$@" below
to "20 @". Change to "@" to remove the hardspace between words.
Note that figlet always removes spaces when it moves words to a new line.
Try option "-m 0" to remove the space between letters (octets).
$@
041 @
042 @
043 @
044 @
045 @
046 @
047 @
050 @
051 @
052 @
053 @
054 @
055 @
056 @
057 @
060 @
061 @
062 @
063 @
064 @
065 @
066 @
067 @
070 @
071 @
072 @
073 @
074 @
075 @
076 @
077 @
100 @
101 @
102 @
103 @
104 @
105 @
106 @
107 @
110 @
111 @
112 @
113 @
114 @
115 @
116 @
117 @
120 @
121 @
122 @
123 @
124 @
125 @
126 @
127 @
130 @
131 @
132 @
133 @
134 @
135 @
136 @
137 @
140 @
141 @
142 @
143 @
144 @
145 @
146 @
147 @
150 @
151 @
152 @
153 @
154 @
155 @
156 @
157 @
160 @
161 @
162 @
163 @
164 @
165 @
166 @
167 @
170 @
171 @
172 @
173 @
174 @
175 @
176 @
@
@
@
@
@
@
@
127
177 @
128
200 @
129
201 @
130
202 @
131
203 @
132
204 @
133
205 @
134
206 @
135
207 @
136
210 @
137
211 @
138
212 @
139
213 @
140
214 @
141
215 @
142
216 @
143
217 @
144
220 @
145
221 @
146
222 @
147
223 @
148
224 @
149
225 @
150
226 @
151
227 @
152
230 @
153
231 @
154
232 @
155
233 @
156
234 @
157
235 @
158
236 @
159
237 @
160
240 @
161
241 @
162
242 @
163
243 @
164
244 @
165
245 @
166
246 @
167
247 @
168
250 @
169
251 @
170
252 @
171
253 @
172
254 @
173
255 @
174
256 @
175
257 @
176
260 @
177
261 @
178
262 @
179
263 @
180
264 @
181
265 @
182
266 @
183
267 @
184
270 @
185
271 @
186
272 @
187
273 @
188
274 @
189
275 @
190
276 @
191
277 @
192
300 @
193
301 @
194
302 @
195
303 @
196
304 @
197
305 @
198
306 @
199
307 @
200
310 @
201
311 @
202
312 @
203
313 @
204
314 @
205
315 @
206
316 @
207
317 @
208
320 @
209
321 @
210
322 @
211
323 @
212
324 @
213
325 @
214
326 @
215
327 @
216
330 @
217
331 @
218
332 @
219
333 @
220
334 @
221
335 @
222
336 @
223
337 @
224
340 @
225
341 @
226
342 @
227
343 @
228
344 @
229
345 @
230
346 @
231
347 @
232
350 @
233
351 @
234
352 @
235
353 @
236
354 @
237
355 @
238
356 @
239
357 @
240
360 @
241
361 @
242
362 @
243
363 @
244
364 @
245
365 @
246
366 @
247
367 @
248
370 @
249
371 @
250
372 @
251
373 @
252
374 @
253
375 @
254
376 @
255
377 @
`
@@ -0,0 +1,62 @@
"use strict"
const { READ } = require("@eslint-community/eslint-utils")
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
const v8 = {
serialize: { [READ]: { supported: ["8.0.0"] } },
deserialize: { [READ]: { supported: ["8.0.0"] } },
Serializer: { [READ]: { supported: ["8.0.0"] } },
Deserializer: { [READ]: { supported: ["8.0.0"] } },
DefaultSerializer: { [READ]: { supported: ["8.0.0"] } },
DefaultDeserializer: { [READ]: { supported: ["8.0.0"] } },
promiseHooks: {
[READ]: { supported: ["17.1.0", "16.14.0"] },
onInit: { [READ]: { supported: ["17.1.0", "16.14.0"] } },
onSettled: { [READ]: { supported: ["17.1.0", "16.14.0"] } },
onBefore: { [READ]: { supported: ["17.1.0", "16.14.0"] } },
onAfter: { [READ]: { supported: ["17.1.0", "16.14.0"] } },
createHook: { [READ]: { supported: ["17.1.0", "16.14.0"] } },
},
startupSnapshot: {
[READ]: { experimental: ["18.6.0", "16.17.0"] },
addSerializeCallback: { [READ]: { supported: ["18.6.0", "16.17.0"] } },
addDeserializeCallback: {
[READ]: { supported: ["18.6.0", "16.17.0"] },
},
setDeserializeMainFunction: {
[READ]: { supported: ["18.6.0", "16.17.0"] },
},
isBuildingSnapshot: { [READ]: { supported: ["18.6.0", "16.17.0"] } },
},
cachedDataVersionTag: { [READ]: { supported: ["8.0.0"] } },
getHeapCodeStatistics: { [READ]: { supported: ["12.8.0"] } },
getHeapSnapshot: { [READ]: { supported: ["11.13.0"] } },
getHeapSpaceStatistics: { [READ]: { supported: ["6.0.0"] } },
getHeapStatistics: { [READ]: { supported: ["1.0.0"] } },
isStringOneByteRepresentation: {
[READ]: { supported: ["22.15.0", "23.10.0"] },
},
queryObjects: { [READ]: { experimental: ["22.0.0", "20.13.0"] } },
setFlagsFromString: { [READ]: { supported: ["1.0.0"] } },
stopCoverage: { [READ]: { supported: ["15.1.0", "14.18.0", "12.22.0"] } },
takeCoverage: { [READ]: { supported: ["15.1.0", "14.18.0", "12.22.0"] } },
writeHeapSnapshot: { [READ]: { supported: ["11.13.0"] } },
setHeapSnapshotNearHeapLimit: {
[READ]: {
experimental: ["18.10.0", "16.18.0"],
supported: ["22.17.0"],
},
},
GCProfiler: { [READ]: { supported: ["19.6.0", "18.15.0"] } },
}
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
module.exports = {
v8: { ...v8, [READ]: { supported: ["1.0.0"] } },
"node:v8": { ...v8, [READ]: { supported: ["14.13.1", "12.20.0"] } },
}
@@ -0,0 +1,23 @@
var LazyWrapper = require('./_LazyWrapper'),
LodashWrapper = require('./_LodashWrapper'),
copyArray = require('./_copyArray');
/**
* Creates a clone of `wrapper`.
*
* @private
* @param {Object} wrapper The wrapper to clone.
* @returns {Object} Returns the cloned wrapper.
*/
function wrapperClone(wrapper) {
if (wrapper instanceof LazyWrapper) {
return wrapper.clone();
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
result.__index__ = wrapper.__index__;
result.__values__ = wrapper.__values__;
return result;
}
module.exports = wrapperClone;
@@ -0,0 +1,51 @@
/**
* Checks if a node represents a DOM element according to React.
* @param {object} node - JSXOpeningElement to check.
* @returns {boolean} Whether or not the node corresponds to a DOM element.
*/
export function isDOMComponent(node: object): boolean;
/**
* Test whether a JSXElement is a fragment
* @param {JSXElement} node
* @param {string} reactPragma
* @param {string} fragmentPragma
* @returns {boolean}
*/
export function isFragment(node: JSXElement, reactPragma: string, fragmentPragma: string): boolean;
/**
* Checks if a node represents a JSX element or fragment.
* @param {object} node - node to check.
* @returns {boolean} Whether or not the node if a JSX element or fragment.
*/
export function isJSX(node: object): boolean;
/**
* Check if node is like `key={...}` as in `<Foo key={...} />`
* @param {ASTNode} node
* @returns {boolean}
*/
export function isJSXAttributeKey(node: ASTNode): boolean;
/**
* Check if value has only whitespaces
* @param {unknown} value
* @returns {boolean}
*/
export function isWhiteSpaces(value: unknown): boolean;
/**
* Check if the node is returning JSX or null
*
* @param {Context} context The context of `ASTNode`.
* @param {ASTNode} ASTnode The AST node being checked
* @param {boolean} [strict] If true, in a ternary condition the node must return JSX in both cases
* @param {boolean} [ignoreNull] If true, null return values will be ignored
* @returns {boolean} True if the node is returning JSX or null, false if not
*/
export function isReturningJSX(context: Context, ASTnode: ASTNode, strict?: boolean, ignoreNull?: boolean): boolean;
/**
* Check if the node is returning only null values
*
* @param {ASTNode} ASTnode The AST node being checked
* @param {Context} context The context of `ASTNode`.
* @returns {boolean} True if the node is returning only null values
*/
export function isReturningOnlyNull(ASTnode: ASTNode, context: Context): boolean;
//# sourceMappingURL=jsx.d.ts.map
@@ -0,0 +1,39 @@
// Tagalog (Philippines) [tl-ph]
import dayjs from '../index';
var locale = {
name: 'tl-ph',
weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),
months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
weekStart: 1,
weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
ordinal: function ordinal(n) {
return n;
},
formats: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'MM/D/YYYY',
LL: 'MMMM D, YYYY',
LLL: 'MMMM D, YYYY HH:mm',
LLLL: 'dddd, MMMM DD, YYYY HH:mm'
},
relativeTime: {
future: 'sa loob ng %s',
past: '%s ang nakalipas',
s: 'ilang segundo',
m: 'isang minuto',
mm: '%d minuto',
h: 'isang oras',
hh: '%d oras',
d: 'isang araw',
dd: '%d araw',
M: 'isang buwan',
MM: '%d buwan',
y: 'isang taon',
yy: '%d taon'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAS5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAQ5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAOhC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAyBpC,MAAM,UAAU,cAAc,CAC5B,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,CAAA;AAChD,CAAC;AAsBD,MAAM,UAAU,UAAU,CACxB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA;AAC5C,CAAC;AAqBD,MAAM,UAAU,QAAQ,CACtB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,C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AC,CAAA;AACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA","sourcesContent":["import { escape, unescape } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nimport { Glob } from './glob.js'\nimport { hasMagic } from './has-magic.js'\n\nexport { escape, unescape } from 'minimatch'\nexport type {\n FSOption,\n Path,\n WalkOptions,\n WalkOptionsWithFileTypesTrue,\n WalkOptionsWithFileTypesUnset,\n} from 'path-scurry'\nexport { Glob } from './glob.js'\nexport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nexport { hasMagic } from './has-magic.js'\nexport { Ignore } from './ignore.js'\nexport type { IgnoreLike } from './ignore.js'\nexport type { MatchStream } from './walker.js'\n\n/**\n * Syncronous form of {@link globStream}. Will read all the matches as fast as\n * you consume them, even all in a single tick if you consume them immediately,\n * but will still respond to backpressure if they're not consumed immediately.\n */\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass<Path, Path>\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass<string, string>\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesUnset,\n): Minipass<string, string>\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass<Path, Path> | Minipass<string, string>\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).streamSync()\n}\n\n/**\n * Return a stream that emits all the strings or `Path` objects and\n * then emits `end` when completed.\n */\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass<string, string>\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass<Path, Path>\nexport function globStream(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Minipass<string, string>\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass<Path, Path> | Minipass<string, string>\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).stream()\n}\n\n/**\n * Synchronous form of {@link glob}\n */\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Path[]\nexport function globSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobLine truncated
@@ -0,0 +1 @@
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAmBD,0GAA0G;AAC1G,4HAA4H;AAC5H,IAAI,8BAAe;AACnB,IAAI,wCAAkB;AACtB,IAAI,2CAAqB,IAAI;AAEtB,SAAS,0CAAqB,MAAgB;IACnD,IAAI,CAAA,GAAA,YAAI,KAAK;QACX,IAAI,gCAAU,WAAW;YAEvB,MAAM,iBAAiB,CAAA,GAAA,uBAAe,EAAE;YACxC,wCAAkB,eAAe,eAAe,CAAC,KAAK,CAAC,gBAAgB;YACvE,eAAe,eAAe,CAAC,KAAK,CAAC,gBAAgB,GAAG;QAC1D;QAEA,8BAAQ;IACV,OAAO,IAAI,kBAAkB,eAAe,kBAAkB,YAAY;QACxE,sFAAsF;QACtF,kDAAkD;QAClD,yCAAmB,GAAG,CAAC,QAAQ,OAAO,KAAK,CAAC,UAAU;QACtD,OAAO,KAAK,CAAC,UAAU,GAAG;IAC5B;AACF;AAEO,SAAS,0CAAqB,MAAgB;IACnD,IAAI,CAAA,GAAA,YAAI,KAAK;QACX,0DAA0D;QAC1D,sEAAsE;QACtE,IAAI,gCAAU,YACZ;QAGF,8BAAQ;QAER,uEAAuE;QACvE,+DAA+D;QAC/D,WAAW;YACT,uEAAuE;YACvE,oEAAoE;YACpE,CAAA,GAAA,yBAAiB,EAAE;gBACjB,wBAAwB;gBACxB,IAAI,gCAAU,aAAa;oBAEzB,MAAM,iBAAiB,CAAA,GAAA,uBAAe,EAAE;oBACxC,IAAI,eAAe,eAAe,CAAC,KAAK,CAAC,gBAAgB,KAAK,QAC5D,eAAe,eAAe,CAAC,KAAK,CAAC,gBAAgB,GAAG,yCAAmB;oBAG7E,wCAAkB;oBAClB,8BAAQ;gBACV;YACF;QACF,GAAG;IACL,OAAO,IAAI,kBAAkB,eAAe,kBAAkB,YAC5D,+DAA+D;IAC/D,kDAAkD;IAClD;QAAA,IAAI,UAAU,yCAAmB,GAAG,CAAC,SAAS;YAC5C,IAAI,sBAAsB,yCAAmB,GAAG,CAAC;YAEjD,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAC9B,OAAO,KAAK,CAAC,UAAU,GAAG;YAG5B,IAAI,OAAO,YAAY,CAAC,aAAa,IACnC,OAAO,eAAe,CAAC;YAEzB,yCAAmB,MAAM,CAAC;QAC5B;IAAA;AAEJ","sources":["packages/@react-aria/interactions/src/textSelection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getOwnerDocument, isIOS, runAfterTransition} from '@react-aria/utils';\n\n// Safari on iOS starts selecting text on long press. The only way to avoid this, it seems,\n// is to add user-select: none to the entire page. Adding it to the pressable element prevents\n// that element from being selected, but nearby elements may still receive selection. We add\n// user-select: none on touch start, and remove it again on touch end to prevent this.\n// This must be implemented using global state to avoid race conditions between multiple elements.\n\n// There are three possible states due to the delay before removing user-select: none after\n// pointer up. The 'default' state always transitions to the 'disabled' state, which transitions\n// to 'restoring'. The 'restoring' state can either transition back to 'disabled' or 'default'.\n\n// For non-iOS devices, we apply user-select: none to the pressed element instead to avoid possible\n// performance issues that arise from applying and removing user-select: none to the entire page\n// (see https://github.com/adobe/react-spectrum/issues/1609).\ntype State = 'default' | 'disabled' | 'restoring';\n\n// Note that state only matters here for iOS. Non-iOS gets user-select: none applied to the target element\n// rather than at the document level so we just need to apply/remove user-select: none for each pressed element individually\nlet state: State = 'default';\nlet savedUserSelect = '';\nlet modifiedElementMap = new WeakMap<Element, string>();\n\nexport function disableTextSelection(target?: Element) {\n if (isIOS()) {\n if (state === 'default') {\n \n const documentObject = getOwnerDocument(target);\n savedUserSelect = documentObject.documentElement.style.webkitUserSelect;\n documentObject.documentElement.style.webkitUserSelect = 'none';\n }\n\n state = 'disabled';\n } else if (target instanceof HTMLElement || target instanceof SVGElement) {\n // If not iOS, store the target's original user-select and change to user-select: none\n // Ignore state since it doesn't apply for non iOS\n modifiedElementMap.set(target, target.style.userSelect);\n target.style.userSelect = 'none';\n }\n}\n\nexport function restoreTextSelection(target?: Element) {\n if (isIOS()) {\n // If the state is already default, there's nothing to do.\n // If it is restoring, then there's no need to queue a second restore.\n if (state !== 'disabled') {\n return;\n }\n\n state = 'restoring';\n\n // There appears to be a delay on iOS where selection still might occur\n // after pointer up, so wait a bit before removing user-select.\n setTimeout(() => {\n // Wait for any CSS transitions to complete so we don't recompute style\n // for the whole page in the middle of the animation and cause jank.\n runAfterTransition(() => {\n // Avoid race conditions\n if (state === 'restoring') {\n \n const documentObject = getOwnerDocument(target);\n if (documentObject.documentElement.Line truncated
@@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');
} else {
module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');
}
@@ -0,0 +1,45 @@
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $gErir$react = require("react");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useEffectEvent", () => $1254e5bb94ac8761$export$7f54fc3180508a52);
/*
* Copyright 2023 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.
*/
var $1254e5bb94ac8761$var$_React_useInsertionEffect;
// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,
// before all layout effects, but is available only in React 18 and later.
const $1254e5bb94ac8761$var$useEarlyEffect = ($1254e5bb94ac8761$var$_React_useInsertionEffect = (0, ($parcel$interopDefault($gErir$react)))['useInsertionEffect']) !== null && $1254e5bb94ac8761$var$_React_useInsertionEffect !== void 0 ? $1254e5bb94ac8761$var$_React_useInsertionEffect : (0, $78605a5d7424e31b$exports.useLayoutEffect);
function $1254e5bb94ac8761$export$7f54fc3180508a52(fn) {
const ref = (0, $gErir$react.useRef)(null);
$1254e5bb94ac8761$var$useEarlyEffect(()=>{
ref.current = fn;
}, [
fn
]);
// @ts-ignore
return (0, $gErir$react.useCallback)((...args)=>{
const f = ref.current;
return f === null || f === void 0 ? void 0 : f(...args);
}, []);
}
//# sourceMappingURL=useEffectEvent.main.js.map
@@ -0,0 +1,5 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
declare const AvatarIcon: () => react_jsx_runtime.JSX.Element;
export { AvatarIcon };
@@ -0,0 +1,22 @@
import type { Coordinates, UniqueIdentifier } from '../../types';
import type { SensorContext } from '../types';
export declare enum KeyboardCode {
Space = "Space",
Down = "ArrowDown",
Right = "ArrowRight",
Left = "ArrowLeft",
Up = "ArrowUp",
Esc = "Escape",
Enter = "Enter",
Tab = "Tab"
}
export declare type KeyboardCodes = {
start: KeyboardEvent['code'][];
cancel: KeyboardEvent['code'][];
end: KeyboardEvent['code'][];
};
export declare type KeyboardCoordinateGetter = (event: KeyboardEvent, args: {
active: UniqueIdentifier;
currentCoordinates: Coordinates;
context: SensorContext;
}) => Coordinates | void;
@@ -0,0 +1,47 @@
/**
* @fileoverview Report "this" being used in stateless functional components.
*/
'use strict';
const Components = require('../util/Components');
const docsUrl = require('../util/docsUrl');
const report = require('../util/report');
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
const messages = {
noThisInSFC: 'Stateless functional components should not use `this`',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Disallow `this` from being used in stateless functional components',
category: 'Possible Errors',
recommended: false,
url: docsUrl('no-this-in-sfc'),
},
messages,
schema: [],
},
create: Components.detect((context, components, utils) => ({
MemberExpression(node) {
if (node.object.type === 'ThisExpression') {
const component = components.get(utils.getParentStatelessComponent(node));
if (!component || (component.node && component.node.parent && component.node.parent.type === 'Property')) {
return;
}
report(context, messages.noThisInSFC, 'noThisInSFC', {
node,
});
}
},
})),
};
@@ -0,0 +1,124 @@
/**
* @file svg节点转字形轮廓
* @author mengke01(kekee000@gmail.com)
*/
import path2contours from './path2contours';
import oval2contour from './oval2contour';
import polygon2contour from './polygon2contour';
import rect2contour from './rect2contour';
import parseTransform from './parseTransform';
import contoursTransform from './contoursTransform';
// 支持的解析器集合
const support = {
path: {
parse: path2contours, // 解析器
params: ['d'], // 参数列表
contours: true // 是否是多个轮廓
},
circle: {
parse: oval2contour,
params: ['cx', 'cy', 'r']
},
ellipse: {
parse: oval2contour,
params: ['cx', 'cy', 'rx', 'ry']
},
rect: {
parse: rect2contour,
params: ['x', 'y', 'width', 'height']
},
polygon: {
parse: polygon2contour,
params: ['points']
},
polyline: {
parse: polygon2contour,
params: ['points']
}
};
/**
* svg节点转字形轮廓
*
* @param {Array} xmlNodes xml节点集合
* @return {Array|false} 轮廓数组
*/
export default function svgnode2contours(xmlNodes) {
let i;
let length;
let j;
let jlength;
let segment; // 当前指令
const parsedSegments = []; // 解析后的指令
if (xmlNodes.length) {
for (i = 0, length = xmlNodes.length; i < length; i++) {
const node = xmlNodes[i];
const name = node.tagName;
if (support[name]) {
const supportParams = support[name].params;
const params = [];
for (j = 0, jlength = supportParams.length; j < jlength; j++) {
params.push(node.getAttribute(supportParams[j]));
}
segment = {
name,
params,
transform: parseTransform(node.getAttribute('transform'))
};
if (node.parentNode) {
let curNode = node.parentNode;
const transforms = segment.transform || [];
let transAttr;
const iterator = function (t) {
transforms.unshift(t);
};
while (curNode !== null && curNode.tagName !== 'svg') {
transAttr = curNode.getAttribute('transform');
if (transAttr) {
parseTransform(transAttr).reverse().forEach(iterator);
}
curNode = curNode.parentNode;
}
segment.transform = transforms.length ? transforms : null;
}
parsedSegments.push(segment);
}
}
}
if (parsedSegments.length) {
const result = [];
for (i = 0, length = parsedSegments.length; i < length; i++) {
segment = parsedSegments[i];
const parser = support[segment.name];
const contour = parser.parse.apply(null, segment.params);
if (contour && contour.length) {
let contours = parser.contours ? contour : [contour];
// 如果有变换则应用变换规则
if (segment.transform) {
contours = contoursTransform(contours, segment.transform);
}
for (j = 0, jlength = contours.length; j < jlength; j++) {
result.push(contours[j]);
}
}
}
return result;
}
return false;
}
@@ -0,0 +1,27 @@
'use strict';
var $TypeError = require('es-errors/type');
var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
var $isNaN = require('math-intrinsics/isNaN');
var padTimeComponent = require('../helpers/padTimeComponent');
var DateFromTime = require('./DateFromTime');
var MonthFromTime = require('./MonthFromTime');
var WeekDay = require('./WeekDay');
var YearFromTime = require('./YearFromTime');
// https://262.ecma-international.org/9.0/#sec-datestring
module.exports = function DateString(tv) {
if (typeof tv !== 'number' || $isNaN(tv)) {
throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number');
}
var weekday = weekdays[WeekDay(tv)];
var month = months[MonthFromTime(tv)];
var day = padTimeComponent(DateFromTime(tv));
var year = padTimeComponent(YearFromTime(tv), 4);
return weekday + '\x20' + month + '\x20' + day + '\x20' + year;
};
@@ -0,0 +1,86 @@
import {getColumnHeaderId as $2140fb2337097f2d$export$37cd4213f2ad742e} from "./utils.module.js";
import $cjB6b$intlStringsmodulejs from "./intlStrings.module.js";
import {isAndroid as $cjB6b$isAndroid, useDescription as $cjB6b$useDescription, mergeProps as $cjB6b$mergeProps} from "@react-aria/utils";
import {useEffect as $cjB6b$useEffect} from "react";
import {usePress as $cjB6b$usePress, useFocusable as $cjB6b$useFocusable} from "@react-aria/interactions";
import {useGridCell as $cjB6b$useGridCell} from "@react-aria/grid";
import {useLocalizedStringFormatter as $cjB6b$useLocalizedStringFormatter} from "@react-aria/i18n";
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
/*
* 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 $f329116d8ad0aba0$export$9514819a8c81e960(props, state, ref) {
var _state_sortDescriptor, _state_sortDescriptor1;
let { node: node } = props;
let allowsSorting = node.props.allowsSorting;
// if there are no focusable children, the column header will focus the cell
let { gridCellProps: gridCellProps } = (0, $cjB6b$useGridCell)({
...props,
focusMode: 'child'
}, state, ref);
let isSelectionCellDisabled = node.props.isSelectionCell && state.selectionManager.selectionMode === 'single';
let { pressProps: pressProps } = (0, $cjB6b$usePress)({
isDisabled: !allowsSorting || isSelectionCellDisabled,
onPress () {
state.sort(node.key);
},
ref: ref
});
// Needed to pick up the focusable context, enabling things like Tooltips for example
let { focusableProps: focusableProps } = (0, $cjB6b$useFocusable)({}, ref);
let ariaSort = undefined;
let isSortedColumn = ((_state_sortDescriptor = state.sortDescriptor) === null || _state_sortDescriptor === void 0 ? void 0 : _state_sortDescriptor.column) === node.key;
let sortDirection = (_state_sortDescriptor1 = state.sortDescriptor) === null || _state_sortDescriptor1 === void 0 ? void 0 : _state_sortDescriptor1.direction;
// aria-sort not supported in Android Talkback
if (node.props.allowsSorting && !(0, $cjB6b$isAndroid)()) ariaSort = isSortedColumn ? sortDirection : 'none';
let stringFormatter = (0, $cjB6b$useLocalizedStringFormatter)((0, ($parcel$interopDefault($cjB6b$intlStringsmodulejs))), '@react-aria/table');
let sortDescription;
if (allowsSorting) {
sortDescription = `${stringFormatter.format('sortable')}`;
// Android Talkback doesn't support aria-sort so we add sort order details to the aria-described by here
if (isSortedColumn && sortDirection && (0, $cjB6b$isAndroid)()) sortDescription = `${sortDescription}, ${stringFormatter.format(sortDirection)}`;
}
let descriptionProps = (0, $cjB6b$useDescription)(sortDescription);
let shouldDisableFocus = state.collection.size === 0;
(0, $cjB6b$useEffect)(()=>{
if (shouldDisableFocus && state.selectionManager.focusedKey === node.key) state.selectionManager.setFocusedKey(null);
}, [
shouldDisableFocus,
state.selectionManager,
node.key
]);
return {
columnHeaderProps: {
...(0, $cjB6b$mergeProps)(focusableProps, gridCellProps, pressProps, descriptionProps, // If the table is empty, make all column headers untabbable
shouldDisableFocus ? {
tabIndex: -1
} : null),
role: 'columnheader',
id: (0, $2140fb2337097f2d$export$37cd4213f2ad742e)(state, node.key),
'aria-colspan': node.colSpan && node.colSpan > 1 ? node.colSpan : undefined,
'aria-sort': ariaSort
}
};
}
export {$f329116d8ad0aba0$export$9514819a8c81e960 as useTableColumnHeader};
//# sourceMappingURL=useTableColumnHeader.module.js.map
@@ -0,0 +1,44 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Map` class.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-map.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' class is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
Map: { [READ]: true },
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,70 @@
MIT License
Copyright (c) Pooya Parsa <pooya@pi0.io> - Daniel Roe <daniel@roe.dev>
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.
---
Copyright Joyent, Inc. and other Node contributors.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
---
Bundled zeptomatch (https://github.com/fabiospampinato/zeptomatch)
The MIT License (MIT)
Copyright (c) 2023-present Fabio Spampinato
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,137 @@
"use client";
import {
table_cell_default
} from "./chunk-LNVX26OF.mjs";
import {
table_checkbox_cell_default
} from "./chunk-IAFUOJEK.mjs";
import {
table_row_default
} from "./chunk-CKWQQGXG.mjs";
// src/table-body.tsx
import { forwardRef } from "@heroui/system";
import { useDOMRef } from "@heroui/react-utils";
import { clsx, dataAttr, mergeProps } from "@heroui/shared-utils";
import { useTableRowGroup } from "@react-aria/table";
import { filterDOMProps } from "@heroui/react-utils";
import { useMemo } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
var TableBody = forwardRef((props, ref) => {
var _a;
const {
as,
className,
slots,
state,
collection,
isSelectable,
color,
disableAnimation,
checkboxesProps,
selectionMode,
classNames,
...otherProps
} = props;
const Component = as || "tbody";
const shouldFilterDOMProps = typeof Component === "string";
const domRef = useDOMRef(ref);
const { rowGroupProps } = useTableRowGroup();
const tbodyStyles = clsx(classNames == null ? void 0 : classNames.tbody, className);
const bodyProps = collection == null ? void 0 : collection.body.props;
const isLoading = (bodyProps == null ? void 0 : bodyProps.isLoading) || (bodyProps == null ? void 0 : bodyProps.loadingState) === "loading" || (bodyProps == null ? void 0 : bodyProps.loadingState) === "loadingMore";
const renderRows = useMemo(() => {
return [...collection.body.childNodes].map((row) => /* @__PURE__ */ jsx(
table_row_default,
{
classNames,
isSelectable,
node: row,
slots,
state,
children: [...row.childNodes].map(
(cell) => cell.props.isSelectionCell ? /* @__PURE__ */ jsx(
table_checkbox_cell_default,
{
checkboxesProps,
classNames,
color,
disableAnimation,
node: cell,
rowKey: row.key,
selectionMode,
slots,
state
},
cell.key
) : /* @__PURE__ */ jsx(
table_cell_default,
{
classNames,
node: cell,
rowKey: row.key,
slots,
state
},
cell.key
)
)
},
row.key
));
}, [collection.body.childNodes, classNames, isSelectable, slots, state]);
let emptyContent;
let loadingContent;
if (collection.size === 0 && bodyProps.emptyContent) {
emptyContent = /* @__PURE__ */ jsx("tr", { role: "row", children: /* @__PURE__ */ jsx(
"td",
{
className: slots == null ? void 0 : slots.emptyWrapper({ class: classNames == null ? void 0 : classNames.emptyWrapper }),
colSpan: collection.columnCount,
role: "gridcell",
children: !isLoading && bodyProps.emptyContent
}
) });
}
if (isLoading && bodyProps.loadingContent) {
loadingContent = /* @__PURE__ */ jsxs("tr", { role: "row", children: [
/* @__PURE__ */ jsx(
"td",
{
className: slots == null ? void 0 : slots.loadingWrapper({ class: classNames == null ? void 0 : classNames.loadingWrapper }),
colSpan: collection.columnCount,
role: "gridcell",
children: bodyProps.loadingContent
}
),
!emptyContent && collection.size === 0 ? /* @__PURE__ */ jsx("td", { className: slots == null ? void 0 : slots.emptyWrapper({ class: classNames == null ? void 0 : classNames.emptyWrapper }) }) : null
] });
}
return /* @__PURE__ */ jsxs(
Component,
{
ref: domRef,
...mergeProps(
rowGroupProps,
filterDOMProps(bodyProps, {
enabled: shouldFilterDOMProps
}),
otherProps
),
className: (_a = slots.tbody) == null ? void 0 : _a.call(slots, { class: tbodyStyles }),
"data-empty": dataAttr(collection.size === 0),
"data-loading": dataAttr(isLoading),
children: [
renderRows,
loadingContent,
emptyContent
]
}
);
});
TableBody.displayName = "HeroUI.TableBody";
var table_body_default = TableBody;
export {
table_body_default
};
@@ -0,0 +1 @@
{"name":"@monaco-editor/loader","version":"1.6.1","requiresBuild":false,"files":{".babelrc":{"checkedAt":1794532110130,"integrity":"sha512-J/4z1bLpMfoCnFAtSEM19CCLL0+Yl+E4JXUdx7hM9mRKPgc+jfjhSKq0OfnMjYMSE8HN1XJjDinBEUOHwgPv3Q==","mode":420,"size":47},"LICENSE":{"checkedAt":1794532110130,"integrity":"sha512-mCVLX22mtzDSKqVHo/YOg1EAyraScALSwqewv4ggOA3stz1zuzDpyeEmQ0eXx6sniv8Hd7BgBODaeJjg+fuN6A==","mode":420,"size":1069},".husky/pre-commit":{"checkedAt":1794532110130,"integrity":"sha512-oL9pnzzRrvUT926uuRQSuhy8YCiREs8VXpn03jXiy9EpXnVO5e/wRcaMtkC2Ae5+BL6RJrWJEYufa19qTJdv0w==","mode":420,"size":25},"playground/index.html":{"checkedAt":1794532110130,"integrity":"sha512-2IH9xFy79nkd0VkkZDOd1l/EaD1q7Xyuwh/C9nEc7BYF2bxAWT79JU6zAoT3vYntOrQrzcmLPeo+2yQ18Ok+AQ==","mode":420,"size":392},"lib/cjs/_virtual/_rollupPluginBabelHelpers.js":{"checkedAt":1794532110130,"integrity":"sha512-hqyuwXdWsqsmDEmdmRToVltMO8Yk0PDUaM1HMzdd3KyrAEggT4+N4BGsKGhBN0svyPUwbB3VQ+YMOqNJZ//B4w==","mode":420,"size":4145},"lib/es/_virtual/_rollupPluginBabelHelpers.js":{"checkedAt":1794532110131,"integrity":"sha512-9MXGidDPptEFw9injLfaNxPYG4Z2KZh5m1dwqa3vRipw72lyY7y/whtDs+weKieRZ+66YrHKuND4ndENeHEjVw==","mode":420,"size":4057},"lib/cjs/utils/compose.js":{"checkedAt":1794532110131,"integrity":"sha512-dpYIwVPJSydDA2wFZ9woLsXHByPXKnPiO1z3GKkLZKn2xHed8tsPQ/IEZWaQA1EVH532pPMpKsLjXWekvA4feA==","mode":420,"size":378},"lib/es/utils/compose.js":{"checkedAt":1794532110131,"integrity":"sha512-+aDdW5Tty6FfLc2E+iKemXI9t6Cuuy+etZ93y/qGrbkBlMWf0milkcW01evTXe1SthITLQx79qlLWsaWILZp/Q==","mode":420,"size":303},"lib/cjs/utils/curry.js":{"checkedAt":1794532110131,"integrity":"sha512-rqjAunDqD0iVkSuRsA3xwzT14OkSwSgdHO0t9+njv/RMQUY8reUb8xSeHVGj0gXmysXDFoMCgSnR8/M+7rBpIA==","mode":420,"size":625},"lib/es/utils/curry.js":{"checkedAt":1794532110131,"integrity":"sha512-kFp8cIP1JJvlYD9AaLwmjlszB66t87M0R6AsiHrFGVLjXtKi1Uo+iTdQPwxgBaevMg+n+lrXejLhrCOgfpmcZg==","mode":420,"size":550},"lib/cjs/utils/deepMerge.js":{"checkedAt":1794532110131,"integrity":"sha512-nqCPoBmR/tZPuuZNNwNGNf6XufA85K1BBhsfXWA13wUQ/qr2yGjN86HVZldiBiveMmKGjd2uHWJQj0+QQq01iQ==","mode":420,"size":539},"lib/es/utils/deepMerge.js":{"checkedAt":1794532110132,"integrity":"sha512-8WLSa+EJgnQ8m47MeQuwvqCPCwtpvIbYAlg7wwhn7KvsSRfaLiHNFSfkhW0WOwgkIN/VxZCnPkxBvOFKK/EDxw==","mode":420,"size":421},"lib/cjs/config/index.js":{"checkedAt":1794532110132,"integrity":"sha512-iRBjp14+14l6toilE0hTP/JQv9IZk6gSe6gpok4G2xVxQHvnNJESwE6KF6IR5ZsKfzp5Dw5jqCTPF5RNMnNPcg==","mode":420,"size":206},"lib/cjs/index.js":{"checkedAt":1794532110132,"integrity":"sha512-Q5VXK64thajeI/y5qRu2EQ+0SVKgs1F24c72z05U/S208yn7ef0BUgXR+mOnk5q9YUzStAYNivvRXdWkOMYa+Q==","mode":420,"size":157},"lib/cjs/loader/index.js":{"checkedAt":1794532110132,"integrity":"sha512-Aq9ad5W7oXBgYj8H8KmyxWNeIwuqb9Ehys0DnEVnTdaieoxPMWRaFZHYcw0kiWNcke3x9b69rdBFOsKGtM5bLQ==","mode":420,"size":4527},"lib/cjs/validators/index.js":{"checkedAt":1794532110132,"integrity":"sha512-qz/kfiOeKfOW5y0XMC5ACOG6vtkucmyFgIg42Q67ayV7x+GAfabpVFaz6ZufOQeUxBcNP2RW26S1DcqKdFfQiQ==","mode":420,"size":1648},"lib/es/config/index.js":{"checkedAt":1794532110132,"integrity":"sha512-HjM2xtXVFGkhXWCH6UxlTWC2B4ho78n6Uja5YZu1GfNGaJdpCl9YwE6jsNPb7Fl8FNyQdzWusg7ZZQfrL9ImUQ==","mode":420,"size":131},"lib/es/index.js":{"checkedAt":1794532110133,"integrity":"sha512-DObguXQVOAM7u7BlfAsNkJB+b6AEK5s3P54a0dJ6v+dYELeiMw9/S1UrDpTrayaNO6CbfvG0d8ACsMDU3X3C8Q==","mode":420,"size":73},"lib/es/loader/index.js":{"checkedAt":1794532110133,"integrity":"sha512-CuZ8EesluShMCSvsTsJsBJdcsxQbSFEchNmtj1y7j68zGxcYRJ1+1lO3KNonjBg/5mUsGmnSdQ/5aHXSLe3jkg==","mode":420,"size":4392},"lib/es/validators/index.js":{"checkedAt":1794532110133,"integrity":"sha512-fLFz+LIVzOLdrqK5WLQhXLYLDP/vMXkGurm1G42sHXjjXLyDqC9kl3qzOIlEya/ma87zMPQ2NMBsJ76xb3C+/A==","mode":420,"size":1504},"lib/cjs/utils/isObject.js":{"checkedAt":1794532110133,"integrity":"sha512-gejWkHukfT76QJDxjivosxi0//HutDxxXfCnE//qTcdkgZ+EdIts9wT6dH/CH5wCVJiD1dkTm2sFVRPSAZEXow==","mode":420,"size":190},"lib/es/utils/isObject.js":{"checkedAt":1794532110133,"integrity":"sha512-j37Qt6uSWldHjC5yqCf8eJthieMMUhwjNZVGhg89SIFhdmzge5Saer8A8i3vJ4eI7huiknZd5prTf3qYJTWC2w==","mode":420,"size":115},"playground/main.js":{"checkedAt":1794532110134,"integrity":"sha512-jsvnAuYxNNA06uO64ShXPXWSO6aMAPhFnoxJDDXnG0sHV/dvyV6l1oX4l0JSjOqbUVUaBZh5BH/Av2Kks/tgXQ==","mode":420,"size":1074},"lib/cjs/utils/makeCancelable.js":{"checkedAt":1794532110134,"integrity":"sha512-ilqkXJR8BL4qNG6u1HVo/8bb7V9gKA4hQ+C7L1fHmXOaSXgBEdlAB1TZkZKirNIHdv5l86WuM1it4w69rsCHmA==","mode":420,"size":744},"lib/es/utils/makeCancelable.js":{"checkedAt":1794532110134,"integrity":"sha512-kfdwkpnhYnwfWlhKMrzAeP72+xaV9NvOLiKs+GktaDog/CHQpWEUa4FkpA36JobcusKpyEkKbiQaSHV+s8BlPQ==","mode":420,"size":639},"lib/umd/monaco-loader.js":{"checkedAt":1794532110134,"integrity":"sha512-oWxEFIx6s3I/tdphtJVcYcAKUpYsalFGVG3o/69AZSZtjmk+mCR0m6loV9RbYImZl8HJ4TM+f7GFPdfctn5X7Q==","mode":420,"size":17678},"lib/umd/monaco-loader.min.js":{"checkedAt":1794532110135,"integLine truncated
@@ -0,0 +1,26 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTargetElement = getTargetElement;
var _index = require("./index");
var _isBrowser = _interopRequireDefault(require("./isBrowser"));
function getTargetElement(target, defaultElement) {
if (!_isBrowser["default"]) {
return undefined;
}
if (!target) {
return defaultElement;
}
var targetElement;
if ((0, _index.isFunction)(target)) {
targetElement = target();
} else if ('current' in target) {
targetElement = target.current;
} else {
targetElement = target;
}
return targetElement;
}
@@ -0,0 +1,159 @@
import {flowParseAssignableListItemTypes} from "../plugins/flow";
import {tsParseAssignableListItemTypes, tsParseModifiers} from "../plugins/typescript";
import {
eat,
IdentifierRole,
match,
next,
popTypeContext,
pushTypeContext,
} from "../tokenizer/index";
import {ContextualKeyword} from "../tokenizer/keywords";
import {TokenType, TokenType as tt} from "../tokenizer/types";
import {isFlowEnabled, isTypeScriptEnabled, state} from "./base";
import {parseIdentifier, parseMaybeAssign, parseObj} from "./expression";
import {expect, unexpected} from "./util";
export function parseSpread() {
next();
parseMaybeAssign(false);
}
export function parseRest(isBlockScope) {
next();
parseBindingAtom(isBlockScope);
}
export function parseBindingIdentifier(isBlockScope) {
parseIdentifier();
markPriorBindingIdentifier(isBlockScope);
}
export function parseImportedIdentifier() {
parseIdentifier();
state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration;
}
export function markPriorBindingIdentifier(isBlockScope) {
let identifierRole;
if (state.scopeDepth === 0) {
identifierRole = IdentifierRole.TopLevelDeclaration;
} else if (isBlockScope) {
identifierRole = IdentifierRole.BlockScopedDeclaration;
} else {
identifierRole = IdentifierRole.FunctionScopedDeclaration;
}
state.tokens[state.tokens.length - 1].identifierRole = identifierRole;
}
// Parses lvalue (assignable) atom.
export function parseBindingAtom(isBlockScope) {
switch (state.type) {
case tt._this: {
// In TypeScript, "this" may be the name of a parameter, so allow it.
const oldIsType = pushTypeContext(0);
next();
popTypeContext(oldIsType);
return;
}
case tt._yield:
case tt.name: {
state.type = tt.name;
parseBindingIdentifier(isBlockScope);
return;
}
case tt.bracketL: {
next();
parseBindingList(tt.bracketR, isBlockScope, true /* allowEmpty */);
return;
}
case tt.braceL:
parseObj(true, isBlockScope);
return;
default:
unexpected();
}
}
export function parseBindingList(
close,
isBlockScope,
allowEmpty = false,
allowModifiers = false,
contextId = 0,
) {
let first = true;
let hasRemovedComma = false;
const firstItemTokenIndex = state.tokens.length;
while (!eat(close) && !state.error) {
if (first) {
first = false;
} else {
expect(tt.comma);
state.tokens[state.tokens.length - 1].contextId = contextId;
// After a "this" type in TypeScript, we need to set the following comma (if any) to also be
// a type token so that it will be removed.
if (!hasRemovedComma && state.tokens[firstItemTokenIndex].isType) {
state.tokens[state.tokens.length - 1].isType = true;
hasRemovedComma = true;
}
}
if (allowEmpty && match(tt.comma)) {
// Empty item; nothing further to parse for this item.
} else if (eat(close)) {
break;
} else if (match(tt.ellipsis)) {
parseRest(isBlockScope);
parseAssignableListItemTypes();
// Support rest element trailing commas allowed by TypeScript <2.9.
eat(TokenType.comma);
expect(close);
break;
} else {
parseAssignableListItem(allowModifiers, isBlockScope);
}
}
}
function parseAssignableListItem(allowModifiers, isBlockScope) {
if (allowModifiers) {
tsParseModifiers([
ContextualKeyword._public,
ContextualKeyword._protected,
ContextualKeyword._private,
ContextualKeyword._readonly,
ContextualKeyword._override,
]);
}
parseMaybeDefault(isBlockScope);
parseAssignableListItemTypes();
parseMaybeDefault(isBlockScope, true /* leftAlreadyParsed */);
}
function parseAssignableListItemTypes() {
if (isFlowEnabled) {
flowParseAssignableListItemTypes();
} else if (isTypeScriptEnabled) {
tsParseAssignableListItemTypes();
}
}
// Parses assignment pattern around given atom if possible.
export function parseMaybeDefault(isBlockScope, leftAlreadyParsed = false) {
if (!leftAlreadyParsed) {
parseBindingAtom(isBlockScope);
}
if (!eat(tt.eq)) {
return;
}
const eqIndex = state.tokens.length - 1;
parseMaybeAssign();
state.tokens[eqIndex].rhsEndIndex = state.tokens.length;
}
@@ -0,0 +1,977 @@
import type * as checks from "./checks.js";
import type * as JSONSchema from "./json-schema.js";
import { $ZodRegistry, globalRegistry } from "./registries.js";
import type * as schemas from "./schemas.js";
import { getEnumValues } from "./util.js";
interface JSONSchemaGeneratorParams {
/** A registry used to look up metadata for each schema. Any schema with an `id` property will be extracted as a $def.
* @default globalRegistry */
metadata?: $ZodRegistry<Record<string, any>>;
/** The JSON Schema version to target.
* - `"draft-2020-12"` — Default. JSON Schema Draft 2020-12
* - `"draft-7"` — JSON Schema Draft 7 */
target?: "draft-7" | "draft-2020-12";
/** How to handle unrepresentable types.
* - `"throw"` — Default. Unrepresentable types throw an error
* - `"any"` — Unrepresentable types become `{}` */
unrepresentable?: "throw" | "any";
/** Arbitrary custom logic that can be used to modify the generated JSON Schema. */
override?: (ctx: {
zodSchema: schemas.$ZodTypes;
jsonSchema: JSONSchema.BaseSchema;
path: (string | number)[];
}) => void;
/** Whether to extract the `"input"` or `"output"` type. Relevant to transforms, Error converting schema to JSONz, defaults, coerced primitives, etc.
* - `"output"` — Default. Convert the output schema.
* - `"input"` — Convert the input schema. */
io?: "input" | "output";
}
interface ProcessParams {
schemaPath: schemas.$ZodType[];
path: (string | number)[];
}
interface EmitParams {
/** How to handle cycles.
* - `"ref"` — Default. Cycles will be broken using $defs
* - `"throw"` — Cycles will throw an error if encountered */
cycles?: "ref" | "throw";
/* How to handle reused schemas.
* - `"inline"` — Default. Reused schemas will be inlined
* - `"ref"` — Reused schemas will be extracted as $defs */
reused?: "ref" | "inline";
external?:
| {
/** */
registry: $ZodRegistry<{ id?: string | undefined }>;
uri?: ((id: string) => string) | undefined;
defs: Record<string, JSONSchema.BaseSchema>;
}
| undefined;
}
interface Seen {
/** JSON Schema result for this Zod schema */
schema: JSONSchema.BaseSchema;
/** A cached version of the schema that doesn't get overwritten during ref resolution */
def?: JSONSchema.BaseSchema;
defId?: string | undefined;
/** Number of times this schema was encountered during traversal */
count: number;
/** Cycle path */
cycle?: (string | number)[] | undefined;
isParent?: boolean | undefined;
ref?: schemas.$ZodType | undefined | null;
/** JSON Schema property path for this schema */
path?: (string | number)[] | undefined;
}
export class JSONSchemaGenerator {
metadataRegistry: $ZodRegistry<Record<string, any>>;
target: "draft-7" | "draft-2020-12";
unrepresentable: "throw" | "any";
override: (ctx: {
zodSchema: schemas.$ZodTypes;
jsonSchema: JSONSchema.BaseSchema;
path: (string | number)[];
}) => void;
io: "input" | "output";
counter = 0;
seen: Map<schemas.$ZodType, Seen>;
constructor(params?: JSONSchemaGeneratorParams) {
this.metadataRegistry = params?.metadata ?? globalRegistry;
this.target = params?.target ?? "draft-2020-12";
this.unrepresentable = params?.unrepresentable ?? "throw";
this.override = params?.override ?? (() => {});
this.io = params?.io ?? "output";
this.seen = new Map();
}
process(schema: schemas.$ZodType, _params: ProcessParams = { path: [], schemaPath: [] }): JSONSchema.BaseSchema {
const def = (schema as schemas.$ZodTypes)._zod.def;
const formatMap: Partial<Record<checks.$ZodStringFormats, string | undefined>> = {
guid: "uuid",
url: "uri",
datetime: "date-time",
json_string: "json-string",
regex: "", // do not set
};
// check for schema in seens
const seen = this.seen.get(schema);
if (seen) {
seen.count++;
// check if cycle
const isCycle = _params.schemaPath.includes(schema);
if (isCycle) {
seen.cycle = _params.path;
}
return seen.schema;
}
// initialize
const result: Seen = { schema: {}, count: 1, cycle: undefined, path: _params.path };
this.seen.set(schema, result);
// custom method overrides default behavior
const overrideSchema = schema._zod.toJSONSchema?.();
if (overrideSchema) {
result.schema = overrideSchema as any;
} else {
const params = {
..._params,
schemaPath: [..._params.schemaPath, schema],
path: _params.path,
};
const parent = schema._zod.parent;
if (parent) {
// schema was cloned from another schema
result.ref = parent;
this.process(parent, params);
this.seen.get(parent)!.isParent = true;
} else {
const _json = result.schema;
switch (def.type) {
case "string": {
const json: JSONSchema.StringSchema = _json as any;
json.type = "string";
const { minimum, maximum, format, patterns, contentEncoding } = schema._zod
.bag as schemas.$ZodStringInternals<unknown>["bag"];
if (typeof minimum === "number") json.minLength = minimum;
if (typeof maximum === "number") json.maxLength = maximum;
// custom pattern overrides format
if (format) {
json.format = formatMap[format as checks.$ZodStringFormats] ?? format;
if (json.format === "") delete json.format; // empty format is not valid
}
if (contentEncoding) json.contentEncoding = contentEncoding;
if (patterns && patterns.size > 0) {
const regexes = [...patterns];
if (regexes.length === 1) json.pattern = regexes[0]!.source;
else if (regexes.length > 1) {
result.schema.allOf = [
...regexes.map((regex) => ({
...(this.target === "draft-7" ? ({ type: "string" } as const) : {}),
pattern: regex.source,
})),
];
}
}
break;
}
case "number": {
const json: JSONSchema.NumberSchema | JSONSchema.IntegerSchema = _json as any;
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
if (typeof format === "string" && format.includes("int")) json.type = "integer";
else json.type = "number";
if (typeof exclusiveMinimum === "number") json.exclusiveMinimum = exclusiveMinimum;
if (typeof minimum === "number") {
json.minimum = minimum;
if (typeof exclusiveMinimum === "number") {
if (exclusiveMinimum >= minimum) delete json.minimum;
else delete json.exclusiveMinimum;
}
}
if (typeof exclusiveMaximum === "number") json.exclusiveMaximum = exclusiveMaximum;
if (typeof maximum === "number") {
json.maximum = maximum;
if (typeof exclusiveMaximum === "number") {
if (exclusiveMaximum <= maximum) delete json.maximum;
else delete json.exclusiveMaximum;
}
}
if (typeof multipleOf === "number") json.multipleOf = multipleOf;
break;
}
case "boolean": {
const json = _json as JSONSchema.BooleanSchema;
json.type = "boolean";
break;
}
case "bigint": {
if (this.unrepresentable === "throw") {
throw new Error("BigInt cannot be represented in JSON Schema");
}
break;
}
case "symbol": {
if (this.unrepresentable === "throw") {
throw new Error("Symbols cannot be represented in JSON Schema");
}
break;
}
case "null": {
_json.type = "null";
break;
}
case "any": {
break;
}
case "unknown": {
break;
}
case "undefined": {
if (this.unrepresentable === "throw") {
throw new Error("Undefined cannot be represented in JSON Schema");
}
break;
}
case "void": {
if (this.unrepresentable === "throw") {
throw new Error("Void cannot be represented in JSON Schema");
}
break;
}
case "never": {
_json.not = {};
break;
}
case "date": {
if (this.unrepresentable === "throw") {
throw new Error("Date cannot be represented in JSON Schema");
}
break;
}
case "array": {
const json: JSONSchema.ArraySchema = _json as any;
const { minimum, maximum } = schema._zod.bag;
if (typeof minimum === "number") json.minItems = minimum;
if (typeof maximum === "number") json.maxItems = maximum;
json.type = "array";
json.items = this.process(def.element, { ...params, path: [...params.path, "items"] });
break;
}
case "object": {
const json: JSONSchema.ObjectSchema = _json as any;
json.type = "object";
json.properties = {};
const shape = def.shape; // params.shapeCache.get(schema)!;
for (const key in shape) {
json.properties[key] = this.process(shape[key]!, {
...params,
path: [...params.path, "properties", key],
});
}
// required keys
const allKeys = new Set(Object.keys(shape));
// const optionalKeys = new Set(def.optional);
const requiredKeys = new Set(
[...allKeys].filter((key) => {
const v = def.shape[key]!._zod;
if (this.io === "input") {
return v.optin === undefined;
} else {
return v.optout === undefined;
}
})
);
if (requiredKeys.size > 0) {
json.required = Array.from(requiredKeys);
}
// catchall
if (def.catchall?._zod.def.type === "never") {
// strict
json.additionalProperties = false;
} else if (!def.catchall) {
// regular
if (this.io === "output") json.additionalProperties = false;
} else if (def.catchall) {
json.additionalProperties = this.process(def.catchall, {
...params,
path: [...params.path, "additionalProperties"],
});
}
break;
}
case "union": {
const json: JSONSchema.BaseSchema = _json as any;
json.anyOf = def.options.map((x, i) =>
this.process(x, {
...params,
path: [...params.path, "anyOf", i],
})
);
break;
}
case "intersection": {
const json: JSONSchema.BaseSchema = _json as any;
const a = this.process(def.left, {
...params,
path: [...params.path, "allOf", 0],
});
const b = this.process(def.right, {
...params,
path: [...params.path, "allOf", 1],
});
const isSimpleIntersection = (val: any) => "allOf" in val && Object.keys(val).length === 1;
const allOf = [
...(isSimpleIntersection(a) ? (a.allOf as any[]) : [a]),
...(isSimpleIntersection(b) ? (b.allOf as any[]) : [b]),
];
json.allOf = allOf;
break;
}
case "tuple": {
const json: JSONSchema.ArraySchema = _json as any;
json.type = "array";
const prefixItems = def.items.map((x, i) =>
this.process(x, { ...params, path: [...params.path, "prefixItems", i] })
);
if (this.target === "draft-2020-12") {
json.prefixItems = prefixItems;
} else {
json.items = prefixItems;
}
if (def.rest) {
const rest = this.process(def.rest, {
...params,
path: [...params.path, "items"],
});
if (this.target === "draft-2020-12") {
json.items = rest;
} else {
json.additionalItems = rest;
}
}
// additionalItems
if (def.rest) {
json.items = this.process(def.rest, {
...params,
path: [...params.path, "items"],
});
}
// length
const { minimum, maximum } = schema._zod.bag as {
minimum?: number;
maximum?: number;
};
if (typeof minimum === "number") json.minItems = minimum;
if (typeof maximum === "number") json.maxItems = maximum;
break;
}
case "record": {
const json: JSONSchema.ObjectSchema = _json as any;
json.type = "object";
json.propertyNames = this.process(def.keyType, { ...params, path: [...params.path, "propertyNames"] });
json.additionalProperties = this.process(def.valueType, {
...params,
path: [...params.path, "additionalProperties"],
});
break;
}
case "map": {
if (this.unrepresentable === "throw") {
throw new Error("Map cannot be represented in JSON Schema");
}
break;
}
case "set": {
if (this.unrepresentable === "throw") {
throw new Error("Set cannot be represented in JSON Schema");
}
break;
}
case "enum": {
const json: JSONSchema.BaseSchema = _json as any;
const values = getEnumValues(def.entries);
// Number enums can have both string and number values
if (values.every((v) => typeof v === "number")) json.type = "number";
if (values.every((v) => typeof v === "string")) json.type = "string";
json.enum = values;
break;
}
case "literal": {
const json: JSONSchema.BaseSchema = _json as any;
const vals: (string | number | boolean | null)[] = [];
for (const val of def.values) {
if (val === undefined) {
if (this.unrepresentable === "throw") {
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
} else {
// do not add to vals
}
} else if (typeof val === "bigint") {
if (this.unrepresentable === "throw") {
throw new Error("BigInt literals cannot be represented in JSON Schema");
} else {
vals.push(Number(val));
}
} else {
vals.push(val);
}
}
if (vals.length === 0) {
// do nothing (an undefined literal was stripped)
} else if (vals.length === 1) {
const val = vals[0]!;
json.type = val === null ? ("null" as const) : (typeof val as any);
json.const = val;
} else {
if (vals.every((v) => typeof v === "number")) json.type = "number";
if (vals.every((v) => typeof v === "string")) json.type = "string";
if (vals.every((v) => typeof v === "boolean")) json.type = "string";
if (vals.every((v) => v === null)) json.type = "null";
json.enum = vals;
}
break;
}
case "file": {
const json: JSONSchema.StringSchema = _json as any;
const file: JSONSchema.StringSchema = {
type: "string",
format: "binary",
contentEncoding: "binary",
};
const { minimum, maximum, mime } = schema._zod.bag as schemas.$ZodFileInternals["bag"];
if (minimum !== undefined) file.minLength = minimum;
if (maximum !== undefined) file.maxLength = maximum;
if (mime) {
if (mime.length === 1) {
file.contentMediaType = mime[0]!;
Object.assign(json, file);
} else {
json.anyOf = mime.map((m) => {
const mFile: JSONSchema.StringSchema = { ...file, contentMediaType: m };
return mFile;
});
}
} else {
Object.assign(json, file);
}
// if (this.unrepresentable === "throw") {
// throw new Error("File cannot be represented in JSON Schema");
// }
break;
}
case "transform": {
if (this.unrepresentable === "throw") {
throw new Error("Transforms cannot be represented in JSON Schema");
}
break;
}
case "nullable": {
const inner = this.process(def.innerType, params);
_json.anyOf = [inner, { type: "null" }];
break;
}
case "nonoptional": {
this.process(def.innerType, params);
result.ref = def.innerType;
break;
}
case "success": {
const json = _json as JSONSchema.BooleanSchema;
json.type = "boolean";
break;
}
case "default": {
this.process(def.innerType, params);
result.ref = def.innerType;
_json.default = JSON.parse(JSON.stringify(def.defaultValue));
break;
}
case "prefault": {
this.process(def.innerType, params);
result.ref = def.innerType;
if (this.io === "input") _json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
break;
}
case "catch": {
// use conditionals
this.process(def.innerType, params);
result.ref = def.innerType;
let catchValue: any;
try {
catchValue = def.catchValue(undefined as any);
} catch {
throw new Error("Dynamic catch values are not supported in JSON Schema");
}
_json.default = catchValue;
break;
}
case "nan": {
if (this.unrepresentable === "throw") {
throw new Error("NaN cannot be represented in JSON Schema");
}
break;
}
case "template_literal": {
const json = _json as JSONSchema.StringSchema;
const pattern = schema._zod.pattern;
if (!pattern) throw new Error("Pattern not found in template literal");
json.type = "string";
json.pattern = pattern.source;
break;
}
case "pipe": {
const innerType = this.io === "input" ? (def.in._zod.def.type === "transform" ? def.out : def.in) : def.out;
this.process(innerType, params);
result.ref = innerType;
break;
}
case "readonly": {
this.process(def.innerType, params);
result.ref = def.innerType;
_json.readOnly = true;
break;
}
// passthrough types
case "promise": {
this.process(def.innerType, params);
result.ref = def.innerType;
break;
}
case "optional": {
this.process(def.innerType, params);
result.ref = def.innerType;
break;
}
case "lazy": {
const innerType = (schema as schemas.$ZodLazy)._zod.innerType;
this.process(innerType, params);
result.ref = innerType;
break;
}
case "custom": {
if (this.unrepresentable === "throw") {
throw new Error("Custom types cannot be represented in JSON Schema");
}
break;
}
default: {
def satisfies never;
}
}
}
}
// metadata
const meta = this.metadataRegistry.get(schema);
if (meta) Object.assign(result.schema, meta);
if (this.io === "input" && isTransforming(schema)) {
// examples/defaults only apply to output type of pipe
delete result.schema.examples;
delete result.schema.default;
}
// set prefault as default
if (this.io === "input" && result.schema._prefault) result.schema.default ??= result.schema._prefault;
delete result.schema._prefault;
// pulling fresh from this.seen in case it was overwritten
const _result = this.seen.get(schema)!;
return _result.schema;
}
emit(schema: schemas.$ZodType, _params?: EmitParams): JSONSchema.BaseSchema {
const params = {
cycles: _params?.cycles ?? "ref",
reused: _params?.reused ?? "inline",
// unrepresentable: _params?.unrepresentable ?? "throw",
// uri: _params?.uri ?? ((id) => `${id}`),
external: _params?.external ?? undefined,
} satisfies EmitParams;
// iterate over seen map;
const root = this.seen.get(schema);
if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
// initialize result with root schema fields
// Object.assign(result, seen.cached);
// returns a ref to the schema
// defId will be empty if the ref points to an external schema (or #)
const makeURI = (entry: [schemas.$ZodType<unknown, unknown>, Seen]): { ref: string; defId?: string } => {
// comparing the seen objects because sometimes
// multiple schemas map to the same seen object.
// e.g. lazy
// external is configured
const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
if (params.external) {
const externalId = params.external.registry.get(entry[0])?.id; // ?? "__shared";// `__schema${this.counter++}`;
// check if schema is in the external registry
const uriGenerator = params.external.uri ?? ((id) => id);
if (externalId) {
return { ref: uriGenerator(externalId) };
}
// otherwise, add to __shared
const id: string = entry[1].defId ?? (entry[1].schema.id as string) ?? `schema${this.counter++}`;
entry[1].defId = id; // set defId so it will be reused if needed
return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
}
if (entry[1] === root) {
return { ref: "#" };
}
// self-contained schema
const uriPrefix = `#`;
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
const defId = entry[1].schema.id ?? `__schema${this.counter++}`;
return { defId, ref: defUriPrefix + defId };
};
// stored cached version in `def` property
// remove all properties, set $ref
const extractToDef = (entry: [schemas.$ZodType<unknown, unknown>, Seen]): void => {
// if the schema is already a reference, do not extract it
if (entry[1].schema.$ref) {
return;
}
const seen = entry[1];
const { ref, defId } = makeURI(entry);
seen.def = { ...seen.schema };
// defId won't be set if the schema is a reference to an external schema
if (defId) seen.defId = defId;
// wipe away all properties except $ref
const schema = seen.schema;
for (const key in schema) {
delete schema[key];
}
schema.$ref = ref;
};
// throw on cycles
// break cycles
if (params.cycles === "throw") {
for (const entry of this.seen.entries()) {
const seen = entry[1];
if (seen.cycle) {
throw new Error(
"Cycle detected: " +
`#/${seen.cycle?.join("/")}/<root>` +
'\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.'
);
}
}
}
// extract schemas into $defs
for (const entry of this.seen.entries()) {
const seen = entry[1];
// convert root schema to # $ref
if (schema === entry[0]) {
extractToDef(entry); // this has special handling for the root schema
continue;
}
// extract schemas that are in the external registry
if (params.external) {
const ext = params.external.registry.get(entry[0])?.id;
if (schema !== entry[0] && ext) {
extractToDef(entry);
continue;
}
}
// extract schemas with `id` meta
const id = this.metadataRegistry.get(entry[0])?.id;
if (id) {
extractToDef(entry);
continue;
}
// break cycles
if (seen.cycle) {
// any
extractToDef(entry);
continue;
}
// extract reused schemas
if (seen.count > 1) {
if (params.reused === "ref") {
extractToDef(entry);
// biome-ignore lint:
continue;
}
}
}
// flatten _refs
const flattenRef = (zodSchema: schemas.$ZodType, params: Pick<ToJSONSchemaParams, "target">) => {
const seen = this.seen.get(zodSchema)!;
const schema = seen.def ?? seen.schema;
const _cached = { ...schema };
// already seen
if (seen.ref === null) {
return;
}
// flatten ref if defined
const ref = seen.ref;
seen.ref = null; // prevent recursion
if (ref) {
flattenRef(ref, params);
// merge referenced schema into current
const refSchema = this.seen.get(ref)!.schema;
if (refSchema.$ref && params.target === "draft-7") {
schema.allOf = schema.allOf ?? [];
schema.allOf.push(refSchema);
} else {
Object.assign(schema, refSchema);
Object.assign(schema, _cached); // prevent overwriting any fields in the original schema
}
}
// execute overrides
if (!seen.isParent)
this.override({
zodSchema: zodSchema as schemas.$ZodTypes,
jsonSchema: schema,
path: seen.path ?? [],
});
};
for (const entry of [...this.seen.entries()].reverse()) {
flattenRef(entry[0], { target: this.target });
}
const result: JSONSchema.BaseSchema = {};
if (this.target === "draft-2020-12") {
result.$schema = "https://json-schema.org/draft/2020-12/schema";
} else if (this.target === "draft-7") {
result.$schema = "http://json-schema.org/draft-07/schema#";
} else {
console.warn(`Invalid target: ${this.target}`);
}
if (params.external?.uri) {
const id = params.external.registry.get(schema)?.id;
if (!id) throw new Error("Schema is missing an `id` property");
result.$id = params.external.uri(id);
}
Object.assign(result, root.def);
// build defs object
const defs: JSONSchema.BaseSchema["$defs"] = params.external?.defs ?? {};
for (const entry of this.seen.entries()) {
const seen = entry[1];
if (seen.def && seen.defId) {
defs[seen.defId] = seen.def;
}
}
// set definitions in result
if (params.external) {
} else {
if (Object.keys(defs).length > 0) {
if (this.target === "draft-2020-12") {
result.$defs = defs;
} else {
result.definitions = defs;
}
}
}
try {
// this "finalizes" this schema and ensures all cycles are removed
// each call to .emit() is functionally independent
// though the seen map is shared
return JSON.parse(JSON.stringify(result));
} catch (_err) {
throw new Error("Error converting schema to JSON.");
}
}
}
interface ToJSONSchemaParams extends Omit<JSONSchemaGeneratorParams & EmitParams, "external"> {}
interface RegistryToJSONSchemaParams extends Omit<JSONSchemaGeneratorParams & EmitParams, "external"> {
uri?: (id: string) => string;
}
export function toJSONSchema(schema: schemas.$ZodType, _params?: ToJSONSchemaParams): JSONSchema.BaseSchema;
export function toJSONSchema(
registry: $ZodRegistry<{ id?: string | undefined }>,
_params?: RegistryToJSONSchemaParams
): { schemas: Record<string, JSONSchema.BaseSchema> };
export function toJSONSchema(
input: schemas.$ZodType | $ZodRegistry<{ id?: string | undefined }>,
_params?: ToJSONSchemaParams
): any {
if (input instanceof $ZodRegistry) {
const gen = new JSONSchemaGenerator(_params);
const defs: any = {};
for (const entry of input._idmap.entries()) {
const [_, schema] = entry;
gen.process(schema);
}
const schemas: Record<string, JSONSchema.BaseSchema> = {};
const external = {
registry: input,
uri: (_params as RegistryToJSONSchemaParams)?.uri,
defs,
};
for (const entry of input._idmap.entries()) {
const [key, schema] = entry;
schemas[key] = gen.emit(schema, {
..._params,
external,
});
}
if (Object.keys(defs).length > 0) {
const defsSegment = gen.target === "draft-2020-12" ? "$defs" : "definitions";
schemas.__shared = {
[defsSegment]: defs,
};
}
return { schemas };
}
const gen = new JSONSchemaGenerator(_params);
gen.process(input);
return gen.emit(input, _params);
}
function isTransforming(
_schema: schemas.$ZodType,
_ctx?: {
seen: Set<schemas.$ZodType>;
}
): boolean {
const ctx = _ctx ?? { seen: new Set() };
if (ctx.seen.has(_schema)) return false;
ctx.seen.add(_schema);
const schema = _schema as schemas.$ZodTypes;
const def = schema._zod.def;
switch (def.type) {
case "string":
case "number":
case "bigint":
case "boolean":
case "date":
case "symbol":
case "undefined":
case "null":
case "any":
case "unknown":
case "never":
case "void":
case "literal":
case "enum":
case "nan":
case "file":
case "template_literal":
return false;
case "array": {
return isTransforming(def.element, ctx);
}
case "object": {
for (const key in def.shape) {
if (isTransforming(def.shape[key]!, ctx)) return true;
}
return false;
}
case "union": {
for (const option of def.options) {
if (isTransforming(option, ctx)) return true;
}
return false;
}
case "intersection": {
return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
}
case "tuple": {
for (const item of def.items) {
if (isTransforming(item, ctx)) return true;
}
if (def.rest && isTransforming(def.rest, ctx)) return true;
return false;
}
case "record": {
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
}
case "map": {
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
}
case "set": {
return isTransforming(def.valueType, ctx);
}
// inner types
case "promise":
case "optional":
case "nonoptional":
case "nullable":
case "readonly":
return isTransforming(def.innerType, ctx);
case "lazy":
return isTransforming(def.getter(), ctx);
case "default": {
return isTransforming(def.innerType, ctx);
}
case "prefault": {
return isTransforming(def.innerType, ctx);
}
case "custom": {
return false;
}
case "transform": {
return true;
}
case "pipe": {
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
}
case "success": {
return false;
}
case "catch": {
return false;
}
default:
def satisfies never;
}
throw new Error(`Unknown schema type: ${(def as any).type}`);
}
@@ -0,0 +1,70 @@
import { ChildProcess, SpawnOptions } from 'node:child_process';
import { Readable } from 'node:stream';
declare class NonZeroExitError extends Error {
readonly result: Result;
readonly output?: Output;
get exitCode(): number | undefined;
constructor(result: Result, output?: Output);
}
interface Output {
stderr: string;
stdout: string;
exitCode: number | undefined;
}
interface PipeOptions extends Options {
}
type KillSignal = Parameters<ChildProcess['kill']>[0];
interface OutputApi extends AsyncIterable<string> {
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): Result;
process: ChildProcess | undefined;
kill(signal?: KillSignal): boolean;
get pid(): number | undefined;
get aborted(): boolean;
get killed(): boolean;
get exitCode(): number | undefined;
}
type Result = PromiseLike<Output> & OutputApi;
interface Options {
signal: AbortSignal;
nodeOptions: SpawnOptions;
timeout: number;
persist: boolean;
stdin: ExecProcess;
throwOnError: boolean;
}
interface TinyExec {
(command: string, args?: string[], options?: Partial<Options>): Result;
}
declare class ExecProcess implements Result {
protected _process?: ChildProcess;
protected _aborted: boolean;
protected _options: Partial<Options>;
protected _command: string;
protected _args: string[];
protected _resolveClose?: () => void;
protected _processClosed: Promise<void>;
protected _thrownError?: Error;
get process(): ChildProcess | undefined;
get pid(): number | undefined;
get exitCode(): number | undefined;
constructor(command: string, args?: string[], options?: Partial<Options>);
kill(signal?: KillSignal): boolean;
get aborted(): boolean;
get killed(): boolean;
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): Result;
[Symbol.asyncIterator](): AsyncIterator<string>;
protected _waitForOutput(): Promise<Output>;
then<TResult1 = Output, TResult2 = never>(onfulfilled?: ((value: Output) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
protected _streamOut?: Readable;
protected _streamErr?: Readable;
spawn(): void;
protected _resetState(): void;
protected _onError: (err: Error) => void;
protected _onClose: () => void;
}
declare const x: TinyExec;
declare const exec: TinyExec;
export { ExecProcess, type KillSignal, NonZeroExitError, type Options, type Output, type OutputApi, type PipeOptions, type Result, type TinyExec, exec, x };
@@ -0,0 +1,45 @@
{
"name": "type-is",
"description": "Infer the content-type of a request.",
"version": "1.6.18",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>",
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
],
"license": "MIT",
"repository": "jshttp/type-is",
"dependencies": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
},
"devDependencies": {
"eslint": "5.16.0",
"eslint-config-standard": "12.0.0",
"eslint-plugin-import": "2.17.2",
"eslint-plugin-markdown": "1.0.0",
"eslint-plugin-node": "8.0.1",
"eslint-plugin-promise": "4.1.1",
"eslint-plugin-standard": "4.0.0",
"mocha": "6.1.4",
"nyc": "14.0.0"
},
"engines": {
"node": ">= 0.6"
},
"files": [
"LICENSE",
"HISTORY.md",
"index.js"
],
"scripts": {
"lint": "eslint --plugin markdown --ext js,md .",
"test": "mocha --reporter spec --check-leaks --bail test/",
"test-cov": "nyc --reporter=html --reporter=text npm test",
"test-travis": "nyc --reporter=text npm test"
},
"keywords": [
"content",
"type",
"checking"
]
}
@@ -0,0 +1 @@
{"version":3,"names":["getAssignmentIdentifiers","node","search","concat","ids","Object","create","length","id","pop","type","push","elements","left","properties","value","argument","operator","name"],"sources":["../../src/retrievers/getAssignmentIdentifiers.ts"],"sourcesContent":["import type * as t from \"../index.ts\";\n\n/**\n * For the given node, generate a map from assignment id names to the identifier node.\n * Unlike getBindingIdentifiers, this function does not handle declarations and imports.\n * @param node the assignment expression or forXstatement\n * @returns an object map\n * @see getBindingIdentifiers\n */\nexport default function getAssignmentIdentifiers(\n node: t.Node | t.Node[],\n): Record<string, t.Identifier> {\n // null represents holes in an array pattern\n const search: (t.Node | null)[] = [].concat(node);\n const ids = Object.create(null);\n\n while (search.length) {\n const id = search.pop();\n if (!id) continue;\n\n switch (id.type) {\n case \"ArrayPattern\":\n search.push(...id.elements);\n break;\n\n case \"AssignmentExpression\":\n case \"AssignmentPattern\":\n case \"ForInStatement\":\n case \"ForOfStatement\":\n search.push(id.left);\n break;\n\n case \"ObjectPattern\":\n search.push(...id.properties);\n break;\n\n case \"ObjectProperty\":\n search.push(id.value);\n break;\n\n case \"RestElement\":\n case \"UpdateExpression\":\n search.push(id.argument);\n break;\n\n case \"UnaryExpression\":\n if (id.operator === \"delete\") {\n search.push(id.argument);\n }\n break;\n\n case \"Identifier\":\n ids[id.name] = id;\n break;\n\n default:\n break;\n }\n }\n\n return ids;\n}\n"],"mappings":";;;;;;AASe,SAASA,wBAAwBA,CAC9CC,IAAuB,EACO;EAE9B,MAAMC,MAAyB,GAAG,EAAE,CAACC,MAAM,CAACF,IAAI,CAAC;EACjD,MAAMG,GAAG,GAAGC,MAAM,CAACC,MAAM,CAAC,IAAI,CAAC;EAE/B,OAAOJ,MAAM,CAACK,MAAM,EAAE;IACpB,MAAMC,EAAE,GAAGN,MAAM,CAACO,GAAG,CAAC,CAAC;IACvB,IAAI,CAACD,EAAE,EAAE;IAET,QAAQA,EAAE,CAACE,IAAI;MACb,KAAK,cAAc;QACjBR,MAAM,CAACS,IAAI,CAAC,GAAGH,EAAE,CAACI,QAAQ,CAAC;QAC3B;MAEF,KAAK,sBAAsB;MAC3B,KAAK,mBAAmB;MACxB,KAAK,gBAAgB;MACrB,KAAK,gBAAgB;QACnBV,MAAM,CAACS,IAAI,CAACH,EAAE,CAACK,IAAI,CAAC;QACpB;MAEF,KAAK,eAAe;QAClBX,MAAM,CAACS,IAAI,CAAC,GAAGH,EAAE,CAACM,UAAU,CAAC;QAC7B;MAEF,KAAK,gBAAgB;QACnBZ,MAAM,CAACS,IAAI,CAACH,EAAE,CAACO,KAAK,CAAC;QACrB;MAEF,KAAK,aAAa;MAClB,KAAK,kBAAkB;QACrBb,MAAM,CAACS,IAAI,CAACH,EAAE,CAACQ,QAAQ,CAAC;QACxB;MAEF,KAAK,iBAAiB;QACpB,IAAIR,EAAE,CAACS,QAAQ,KAAK,QAAQ,EAAE;UAC5Bf,MAAM,CAACS,IAAI,CAACH,EAAE,CAACQ,QAAQ,CAAC;QAC1B;QACA;MAEF,KAAK,YAAY;QACfZ,GAAG,CAACI,EAAE,CAACU,IAAI,CAAC,GAAGV,EAAE;QACjB;MAEF;QACE;IACJ;EACF;EAEA,OAAOJ,GAAG;AACZ","ignoreList":[]}
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var treegridRole = {
abstract: false,
accessibleNameRequired: true,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {},
relatedConcepts: [],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [['row'], ['row', 'rowgroup']],
requiredProps: {},
superClass: [['roletype', 'widget', 'composite', 'grid'], ['roletype', 'structure', 'section', 'table', 'grid'], ['roletype', 'widget', 'composite', 'select', 'tree'], ['roletype', 'structure', 'section', 'group', 'select', 'tree']]
};
var _default = exports.default = treegridRole;
@@ -0,0 +1,19 @@
export const genId = (() => {
let count = 0;
return () => {
return (++count).toString();
};
})();
export const prefersReducedMotion = (() => {
// Cache result
let shouldReduceMotion: boolean | undefined = undefined;
return () => {
if (shouldReduceMotion === undefined && typeof window !== 'undefined') {
const mediaQuery = matchMedia('(prefers-reduced-motion: reduce)');
shouldReduceMotion = !mediaQuery || mediaQuery.matches;
}
return shouldReduceMotion;
};
})();
@@ -0,0 +1,6 @@
import { IHighwayUploader } from '../../../packet/highway/uploader/highwayUploader';
export declare class HighwayHttpUploader extends IHighwayUploader {
upload(): Promise<void>;
private uploadBlock;
private httpPostHighwayContent;
}
@@ -0,0 +1,31 @@
/**
* @file fpgm 表
* @author mengke01(kekee000@gmail.com)
*
* reference: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6fpgm.html
*/
import table from './table';
export default table.create(
'fpgm',
[],
{
read(reader, ttf) {
const length = ttf.tables.fpgm.length;
return reader.readBytes(this.offset, length);
},
write(writer, ttf) {
if (ttf.fpgm) {
writer.writeBytes(ttf.fpgm, ttf.fpgm.length);
}
},
size(ttf) {
return ttf.fpgm ? ttf.fpgm.length : 0;
}
}
);
@@ -0,0 +1,88 @@
import namedColors from './colorNames'
let HEX = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i
let SHORT_HEX = /^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i
let VALUE = /(?:\d+|\d*\.\d+)%?/
let SEP = /(?:\s*,\s*|\s+)/
let ALPHA_SEP = /\s*[,/]\s*/
let CUSTOM_PROPERTY = /var\(--(?:[^ )]*?)(?:,(?:[^ )]*?|var\(--[^ )]*?\)))?\)/
let RGB = new RegExp(
`^(rgba?)\\(\\s*(${VALUE.source}|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`
)
let HSL = new RegExp(
`^(hsla?)\\(\\s*((?:${VALUE.source})(?:deg|rad|grad|turn)?|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`
)
// In "loose" mode the color may contain fewer than 3 parts, as long as at least
// one of the parts is variable.
export function parseColor(value, { loose = false } = {}) {
if (typeof value !== 'string') {
return null
}
value = value.trim()
if (value === 'transparent') {
return { mode: 'rgb', color: ['0', '0', '0'], alpha: '0' }
}
if (value in namedColors) {
return { mode: 'rgb', color: namedColors[value].map((v) => v.toString()) }
}
let hex = value
.replace(SHORT_HEX, (_, r, g, b, a) => ['#', r, r, g, g, b, b, a ? a + a : ''].join(''))
.match(HEX)
if (hex !== null) {
return {
mode: 'rgb',
color: [parseInt(hex[1], 16), parseInt(hex[2], 16), parseInt(hex[3], 16)].map((v) =>
v.toString()
),
alpha: hex[4] ? (parseInt(hex[4], 16) / 255).toString() : undefined,
}
}
let match = value.match(RGB) ?? value.match(HSL)
if (match === null) {
return null
}
let color = [match[2], match[3], match[4]].filter(Boolean).map((v) => v.toString())
// rgba(var(--my-color), 0.1)
// hsla(var(--my-color), 0.1)
if (color.length === 2 && color[0].startsWith('var(')) {
return {
mode: match[1],
color: [color[0]],
alpha: color[1],
}
}
if (!loose && color.length !== 3) {
return null
}
if (color.length < 3 && !color.some((part) => /^var\(.*?\)$/.test(part))) {
return null
}
return {
mode: match[1],
color,
alpha: match[5]?.toString?.(),
}
}
export function formatColor({ mode, color, alpha }) {
let hasAlpha = alpha !== undefined
if (mode === 'rgba' || mode === 'hsla') {
return `${mode}(${color.join(', ')}${hasAlpha ? `, ${alpha}` : ''})`
}
return `${mode}(${color.join(' ')}${hasAlpha ? ` / ${alpha}` : ''})`
}
@@ -0,0 +1,54 @@
var createWrap = require('./_createWrap');
/** Used to compose bitmasks for function metadata. */
var WRAP_CURRY_RIGHT_FLAG = 16;
/**
* This method is like `_.curry` except that arguments are applied to `func`
* in the manner of `_.partialRight` instead of `_.partial`.
*
* The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curryRight(abc);
*
* curried(3)(2)(1);
* // => [1, 2, 3]
*
* curried(2, 3)(1);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(3)(1, _)(2);
* // => [1, 2, 3]
*/
function curryRight(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curryRight.placeholder;
return result;
}
// Assign default placeholders.
curryRight.placeholder = {};
module.exports = curryRight;
@@ -0,0 +1,10 @@
/**
* Remove initial and final spaces and tabs at the line breaks in `value`.
* Does not trim initial and final spaces and tabs of the value itself.
*
* @param {string} value
* Value to trim.
* @returns {string}
* Trimmed value.
*/
export function trimLines(value: string): string
@@ -0,0 +1,56 @@
var castPath = require('./_castPath'),
isFunction = require('./isFunction'),
toKey = require('./_toKey');
/**
* This method is like `_.get` except that if the resolved value is a
* function it's invoked with the `this` binding of its parent object and
* its result is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to resolve.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
*
* _.result(object, 'a[0].b.c1');
* // => 3
*
* _.result(object, 'a[0].b.c2');
* // => 4
*
* _.result(object, 'a[0].b.c3', 'default');
* // => 'default'
*
* _.result(object, 'a[0].b.c3', _.constant('default'));
* // => 'default'
*/
function result(object, path, defaultValue) {
path = castPath(path, object);
var index = -1,
length = path.length;
// Ensure the loop is entered when path is empty.
if (!length) {
length = 1;
object = undefined;
}
while (++index < length) {
var value = object == null ? undefined : object[toKey(path[index])];
if (value === undefined) {
index = length;
value = defaultValue;
}
object = isFunction(value) ? value.call(object) : value;
}
return object;
}
module.exports = result;
@@ -0,0 +1,5 @@
import { Variants } from 'framer-motion';
declare const hideOnScrollVariants: Variants;
export { hideOnScrollVariants };
@@ -0,0 +1 @@
{"name":"@react-stately/slider","version":"3.6.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532109243,"integrity":"sha512-cil7stSp3ik41Hdv2Dj+GMcbvUfs1q+MZ2Yte0804py9i6oJJN/diCiIr/brcQOZ5ZqwAI6dgaHA7l8FZheQBw==","mode":420,"size":11335},"dist/main.js":{"checkedAt":1794532109243,"integrity":"sha512-vb7fzsb49xHCLzaYkMW2dR/gZ1FBzqhtSfQ2MK+ARMCOgW+pEAPaMoS5yUwHDvSGrN9l0SZJvK6Jm5OD1BbNjQ==","mode":420,"size":953},"dist/module.js":{"checkedAt":1794532109243,"integrity":"sha512-Rm4GFIN0qw2IUPczVM+rkXP38bZllzOrD61uuWYLyYFUkf9/gKwJxEkeZjchGxhEN77iZPSnNsEJZtpcUctU2A==","mode":420,"size":833},"dist/useSliderState.main.js":{"checkedAt":1794532109243,"integrity":"sha512-RufZab5ImFZgYShdNGSIbxMk+7gmOlzZemVnZsHOet3Ki1JbcwpraGKWd3P7NRgvFkhCrRDJ7fm4g3CSiwe3Yg==","mode":420,"size":8048},"dist/useSliderState.module.js":{"checkedAt":1794532109243,"integrity":"sha512-flrXwgrB9Y12LMAZQ1NY2d5M2TaiYmC0Zgxa8bE7OKZuxN8sx9ctq8Eae6vjklUZuEg2jOaU2439UE/C8QTbfQ==","mode":420,"size":7901},"package.json":{"checkedAt":1794532109243,"integrity":"sha512-9VLHdkVip/3fsoMOrU81YRo2mG8f3pcxYPZaW7/dffj5L7+r1bq5CczGgu0k1tbWSWGTEezDg+rxICQvgZJkpA==","mode":420,"size":902},"dist/main.js.map":{"checkedAt":1794532109243,"integrity":"sha512-8+kV5SdGlY1fFobsK6coRd/pO26oZ7vv3YN62dq1agDPlomwTrXYI7Ovv9lCDAXFe2076Ou0oax+HlsKXjJ1Yw==","mode":420,"size":965},"dist/module.js.map":{"checkedAt":1794532109244,"integrity":"sha512-MoUFU/mWWVAvXxEXXuHAS8xoJvY1WpMfjYzkHYBnonzAFZs4M+EauA+k0OUG9awUu2P7GKt4mzf6UHwU94FjUA==","mode":420,"size":961},"dist/types.d.ts.map":{"checkedAt":1794532109244,"integrity":"sha512-iUb5zKmdSDlhQot/SVxVx5kl5amr3qFW9VQzkaP2TxdAPM7X1mAl4esO28ulzjFzRzL6LHfabCl+8vYvhYX2HA==","mode":420,"size":2762},"dist/useSliderState.main.js.map":{"checkedAt":1794532109244,"integrity":"sha512-DQdQqC2fQOY6fLAx3y+2sN7vt2iTB65hHvjgZ5nM5USi7oOGzQSK7nFPXKNnYU6S7AaTlQ+fgaXt9g4tpGpIVw==","mode":420,"size":14442},"dist/useSliderState.module.js.map":{"checkedAt":1794532109244,"integrity":"sha512-CS/P02Laz/nKKa97DBajYHhxzTNzPmbF4NIdSSkZGyej1HY145iAF/JvdjE4g3AufD7xDWeFlCbFwg0cCuCPwA==","mode":420,"size":14429},"README.md":{"checkedAt":1794532109244,"integrity":"sha512-ElQBvwIVQ1urcDg1vwzHBwZurnd6euILXDkNA17hHAJtDCzNTbwyWBNFRD/BcAEt4EeyiFfTNDZ6KnSF/ZlR+g==","mode":420,"size":138},"dist/import.mjs":{"checkedAt":1794532109244,"integrity":"sha512-o8LPAvhB0+09KXgLdO8fLcQATvpbksa0PDvUkGGJ2gSjEzEZ4ISju2GrO6DhkfxBdHpLL9Naim5HVC7pqAW8Rg==","mode":420,"size":827},"dist/useSliderState.mjs":{"checkedAt":1794532109243,"integrity":"sha512-flrXwgrB9Y12LMAZQ1NY2d5M2TaiYmC0Zgxa8bE7OKZuxN8sx9ctq8Eae6vjklUZuEg2jOaU2439UE/C8QTbfQ==","mode":420,"size":7901},"src/index.ts":{"checkedAt":1794532109245,"integrity":"sha512-umQhU+J4qd4n4bZhZQ6F1/fSHZmXRLWbsvvDq9NJxQsg3Lt2Yg+v+LSOwa3yt5ulNjZad9BYRes4/P10CTzI3A==","mode":420,"size":780},"dist/types.d.ts":{"checkedAt":1794532109245,"integrity":"sha512-KSsAtyLulhKM4eHCJGI92Y6yJy1EOpmDQmUF+CUrrsm5Z6Y2DHcKqnhp+135l6WYbr3x3U4EaXUAz9ojhoFFjw==","mode":420,"size":3880},"src/useSliderState.ts":{"checkedAt":1794532109245,"integrity":"sha512-FdChs6g+YLape2k6j70hVHmhCuLKTIkDsGJTpoyqlnZILgWwXE+Xk9bSy2/PNb11ynyZwgOJ6ycwtgQeKF1C2w==","mode":420,"size":10163}}}
@@ -0,0 +1,36 @@
/**
* @author Nicholas C. Zakas
* See LICENSE file in root directory for full license.
*/
"use strict"
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "disallow the use of `process.exit()`",
category: "Possible Errors",
recommended: false,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-process-exit.md",
},
fixable: null,
schema: [],
messages: {
noProcessExit: "Don't use process.exit(); throw an error instead.",
},
},
create(context) {
return {
"CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(
node
) {
context.report({
node: node.parent,
messageId: "noProcessExit",
})
},
}
},
}
@@ -0,0 +1 @@
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AA6CM,SAAS,0CAAoB,KAAuB;IACzD,IAAI,iBAAC,gBAAgB,kCAAU,sBAAsB,cAAE,aAAa,OAAM,GAAG;IAC7E,IAAI,CAAC,cAAc,gBAAgB,GAAG,CAAA,GAAA,yBAAiB,EACrD,CAAA,GAAA,cAAM,EAAE,IAAM,MAAM,YAAY,GAAG,IAAI,IAAI,MAAM,YAAY,IAAI,WAAW;QAAC,MAAM,YAAY;KAAC,GAChG,CAAA,GAAA,cAAM,EAAE,IAAM,MAAM,mBAAmB,GAAG,IAAI,IAAI,MAAM,mBAAmB,IAAI,IAAI,OAAO;QAAC,MAAM,mBAAmB;KAAC,GACrH,MAAM,iBAAiB;IAGzB,OAAO;uBACL;oBACA;sBACA;yBACA;QACA,WAAU,GAAG;YACX,IAAI;YACJ,IAAI,kBAAkB,YAAY;gBAChC,OAAO,IAAI,IAAI;gBACf,IAAI,KAAK,GAAG,CAAC,QAAS,CAAA,CAAC,0BAA0B,KAAK,IAAI,GAAG,CAAA,GAC3D,KAAK,MAAM,CAAC;qBAEZ,KAAK,GAAG,CAAC;YAEb,OACE,OAAO,IAAI,IAAI,aAAa,GAAG,CAAC,QAAQ,CAAC,yBAAyB,EAAE,GAAG;gBAAC;aAAI;YAG9E,gBAAgB;QAClB;QACA,aAAY,GAAG,EAAE,UAAU;YACzB,IAAI,eAAe,aAAa,GAAG,CAAC,MAClC,IAAI,CAAC,SAAS,CAAC;QAEnB;IACF;AACF","sources":["packages/@react-stately/toggle/src/useToggleGroupState.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key} from '@react-types/shared';\nimport {useControlledState} from '@react-stately/utils';\nimport {useMemo} from 'react';\n\nexport interface ToggleGroupProps {\n /** Whether single or multiple selection is enabled. */\n selectionMode?: 'single' | 'multiple',\n /** Whether the collection allows empty selection. */\n disallowEmptySelection?: boolean,\n /** The currently selected keys in the collection (controlled). */\n selectedKeys?: Iterable<Key>,\n /** The initial selected keys in the collection (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (keys: Set<Key>) => void,\n /** Whether all items are disabled. */\n isDisabled?: boolean\n}\n\nexport interface ToggleGroupState {\n /** Whether single or multiple selection is enabled. */\n readonly selectionMode: 'single' | 'multiple',\n\n /** Whether all items are disabled. */\n readonly isDisabled: boolean,\n \n /** A set of keys for items that are selected. */\n readonly selectedKeys: Set<Key>,\n\n /** Toggles the selected state for an item by its key. */\n toggleKey(key: Key): void,\n\n /** Sets whether the given key is selected. */\n setSelected(key: Key, isSelected: boolean): void,\n\n /** Replaces the set of selected keys. */\n setSelectedKeys(keys: Set<Key>): void\n}\n\n/**\n * Manages state for a group of toggles.\n * It supports both single and multiple selected items.\n */\nexport function useToggleGroupState(props: ToggleGroupProps): ToggleGroupState {\n let {selectionMode = 'single', disallowEmptySelection, isDisabled = false} = props;\n let [selectedKeys, setSelectedKeys] = useControlledState(\n useMemo(() => props.selectedKeys ? new Set(props.selectedKeys) : undefined, [props.selectedKeys]),\n useMemo(() => props.defaultSelectedKeys ? new Set(props.defaultSelectedKeys) : new Set(), [props.defaultSelectedKeys]),\n props.onSelectionChange\n );\n\n return {\n selectionMode,\n isDisabled,\n selectedKeys,\n setSelectedKeys,\n toggleKey(key) {\n let keys: Set<Key>;\n if (selectionMode === 'multiple') {\n keys = new Set(selectedKeys);\n if (keys.has(key) && (!disallowEmptySelection || keys.size > 1)) {\n keys.delete(key);\n } else {\n keys.add(key);\n }\n } else {\n keys = new Set(selectedKeys.has(key) && !disallowEmptySelection ? [] : [key]);\n }\n \n setSelectedKeys(keys);\n },\n setSelected(key, isSelected) {\n if (isSelected !== selectedKeys.has(key)) {\n this.toggleKey(key);\n }\n }\n };\n}\n"],"names":[],"version":3,"file":"useToggleGroupState.module.js.map"}
@@ -0,0 +1,7 @@
.git*
test/
test-browser/
build/
.travis.yml
*.swp
Makefile
@@ -0,0 +1,10 @@
/**
* @param {ParseOptions | null | undefined} [options]
* Configuration (optional).
* @returns {ParseContext}
* Parser.
*/
export function parse(options?: ParseOptions | null | undefined): ParseContext;
import type { ParseOptions } from 'micromark-util-types';
import type { ParseContext } from 'micromark-util-types';
//# sourceMappingURL=parse.d.ts.map
@@ -0,0 +1,3 @@
import { MaybeClassMetadata } from '../models/MaybeClassMetadata';
export declare function updateMaybeClassMetadataPostConstructor(methodName: string | symbol): (metadata: MaybeClassMetadata) => MaybeClassMetadata;
//# sourceMappingURL=updateMaybeClassMetadataPostConstructor.d.ts.map
@@ -0,0 +1,12 @@
import _typeof from "./typeof.js";
function toPrimitive(t, r) {
if ("object" != _typeof(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
export { toPrimitive as default };
@@ -0,0 +1,55 @@
# es-errors <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
A simple cache for a few of the JS Error constructors.
## Example
```js
const assert = require('assert');
const Base = require('es-errors');
const Eval = require('es-errors/eval');
const Range = require('es-errors/range');
const Ref = require('es-errors/ref');
const Syntax = require('es-errors/syntax');
const Type = require('es-errors/type');
const URI = require('es-errors/uri');
assert.equal(Base, Error);
assert.equal(Eval, EvalError);
assert.equal(Range, RangeError);
assert.equal(Ref, ReferenceError);
assert.equal(Syntax, SyntaxError);
assert.equal(Type, TypeError);
assert.equal(URI, URIError);
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
## Security
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
[package-url]: https://npmjs.org/package/es-errors
[npm-version-svg]: https://versionbadg.es/ljharb/es-errors.svg
[deps-svg]: https://david-dm.org/ljharb/es-errors.svg
[deps-url]: https://david-dm.org/ljharb/es-errors
[dev-deps-svg]: https://david-dm.org/ljharb/es-errors/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/es-errors#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/es-errors.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/es-errors.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/es-errors.svg
[downloads-url]: https://npm-stat.com/charts.html?package=es-errors
[codecov-image]: https://codecov.io/gh/ljharb/es-errors/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/es-errors/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-errors
[actions-url]: https://github.com/ljharb/es-errors/actions
@@ -0,0 +1,391 @@
'use strict';
const utils = require('./utils');
const {
CHAR_ASTERISK, /* * */
CHAR_AT, /* @ */
CHAR_BACKWARD_SLASH, /* \ */
CHAR_COMMA, /* , */
CHAR_DOT, /* . */
CHAR_EXCLAMATION_MARK, /* ! */
CHAR_FORWARD_SLASH, /* / */
CHAR_LEFT_CURLY_BRACE, /* { */
CHAR_LEFT_PARENTHESES, /* ( */
CHAR_LEFT_SQUARE_BRACKET, /* [ */
CHAR_PLUS, /* + */
CHAR_QUESTION_MARK, /* ? */
CHAR_RIGHT_CURLY_BRACE, /* } */
CHAR_RIGHT_PARENTHESES, /* ) */
CHAR_RIGHT_SQUARE_BRACKET /* ] */
} = require('./constants');
const isPathSeparator = code => {
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
};
const depth = token => {
if (token.isPrefix !== true) {
token.depth = token.isGlobstar ? Infinity : 1;
}
};
/**
* Quickly scans a glob pattern and returns an object with a handful of
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
*
* ```js
* const pm = require('picomatch');
* console.log(pm.scan('foo/bar/*.js'));
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
* ```
* @param {String} `str`
* @param {Object} `options`
* @return {Object} Returns an object with tokens and regex source string.
* @api public
*/
const scan = (input, options) => {
const opts = options || {};
const length = input.length - 1;
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
const slashes = [];
const tokens = [];
const parts = [];
let str = input;
let index = -1;
let start = 0;
let lastIndex = 0;
let isBrace = false;
let isBracket = false;
let isGlob = false;
let isExtglob = false;
let isGlobstar = false;
let braceEscaped = false;
let backslashes = false;
let negated = false;
let negatedExtglob = false;
let finished = false;
let braces = 0;
let prev;
let code;
let token = { value: '', depth: 0, isGlob: false };
const eos = () => index >= length;
const peek = () => str.charCodeAt(index + 1);
const advance = () => {
prev = code;
return str.charCodeAt(++index);
};
while (index < length) {
code = advance();
let next;
if (code === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
code = advance();
if (code === CHAR_LEFT_CURLY_BRACE) {
braceEscaped = true;
}
continue;
}
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
braces++;
while (eos() !== true && (code = advance())) {
if (code === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
advance();
continue;
}
if (code === CHAR_LEFT_CURLY_BRACE) {
braces++;
continue;
}
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
isBrace = token.isBrace = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (braceEscaped !== true && code === CHAR_COMMA) {
isBrace = token.isBrace = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_RIGHT_CURLY_BRACE) {
braces--;
if (braces === 0) {
braceEscaped = false;
isBrace = token.isBrace = true;
finished = true;
break;
}
}
}
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_FORWARD_SLASH) {
slashes.push(index);
tokens.push(token);
token = { value: '', depth: 0, isGlob: false };
if (finished === true) continue;
if (prev === CHAR_DOT && index === (start + 1)) {
start += 2;
continue;
}
lastIndex = index + 1;
continue;
}
if (opts.noext !== true) {
const isExtglobChar = code === CHAR_PLUS
|| code === CHAR_AT
|| code === CHAR_ASTERISK
|| code === CHAR_QUESTION_MARK
|| code === CHAR_EXCLAMATION_MARK;
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
isGlob = token.isGlob = true;
isExtglob = token.isExtglob = true;
finished = true;
if (code === CHAR_EXCLAMATION_MARK && index === start) {
negatedExtglob = true;
}
if (scanToEnd === true) {
while (eos() !== true && (code = advance())) {
if (code === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
code = advance();
continue;
}
if (code === CHAR_RIGHT_PARENTHESES) {
isGlob = token.isGlob = true;
finished = true;
break;
}
}
continue;
}
break;
}
}
if (code === CHAR_ASTERISK) {
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_QUESTION_MARK) {
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_LEFT_SQUARE_BRACKET) {
while (eos() !== true && (next = advance())) {
if (next === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
advance();
continue;
}
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
isBracket = token.isBracket = true;
isGlob = token.isGlob = true;
finished = true;
break;
}
}
if (scanToEnd === true) {
continue;
}
break;
}
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
negated = token.negated = true;
start++;
continue;
}
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
isGlob = token.isGlob = true;
if (scanToEnd === true) {
while (eos() !== true && (code = advance())) {
if (code === CHAR_LEFT_PARENTHESES) {
backslashes = token.backslashes = true;
code = advance();
continue;
}
if (code === CHAR_RIGHT_PARENTHESES) {
finished = true;
break;
}
}
continue;
}
break;
}
if (isGlob === true) {
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
}
if (opts.noext === true) {
isExtglob = false;
isGlob = false;
}
let base = str;
let prefix = '';
let glob = '';
if (start > 0) {
prefix = str.slice(0, start);
str = str.slice(start);
lastIndex -= start;
}
if (base && isGlob === true && lastIndex > 0) {
base = str.slice(0, lastIndex);
glob = str.slice(lastIndex);
} else if (isGlob === true) {
base = '';
glob = str;
} else {
base = str;
}
if (base && base !== '' && base !== '/' && base !== str) {
if (isPathSeparator(base.charCodeAt(base.length - 1))) {
base = base.slice(0, -1);
}
}
if (opts.unescape === true) {
if (glob) glob = utils.removeBackslashes(glob);
if (base && backslashes === true) {
base = utils.removeBackslashes(base);
}
}
const state = {
prefix,
input,
start,
base,
glob,
isBrace,
isBracket,
isGlob,
isExtglob,
isGlobstar,
negated,
negatedExtglob
};
if (opts.tokens === true) {
state.maxDepth = 0;
if (!isPathSeparator(code)) {
tokens.push(token);
}
state.tokens = tokens;
}
if (opts.parts === true || opts.tokens === true) {
let prevIndex;
for (let idx = 0; idx < slashes.length; idx++) {
const n = prevIndex ? prevIndex + 1 : start;
const i = slashes[idx];
const value = input.slice(n, i);
if (opts.tokens) {
if (idx === 0 && start !== 0) {
tokens[idx].isPrefix = true;
tokens[idx].value = prefix;
} else {
tokens[idx].value = value;
}
depth(tokens[idx]);
state.maxDepth += tokens[idx].depth;
}
if (idx !== 0 || value !== '') {
parts.push(value);
}
prevIndex = i;
}
if (prevIndex && prevIndex + 1 < input.length) {
const value = input.slice(prevIndex + 1);
parts.push(value);
if (opts.tokens) {
tokens[tokens.length - 1].value = value;
depth(tokens[tokens.length - 1]);
state.maxDepth += tokens[tokens.length - 1].depth;
}
}
state.slashes = slashes;
state.parts = parts;
}
return state;
};
module.exports = scan;
@@ -0,0 +1 @@
{"version":3,"file":"jsx-pascal-case.d.ts","sourceRoot":"","sources":["jsx-pascal-case.js"],"names":[],"mappings":"wBA8EW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1 @@
{"version":3,"file":"no-did-mount-set-state.d.ts","sourceRoot":"","sources":["no-did-mount-set-state.js"],"names":[],"mappings":"wBASW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1 @@
export { shallowEqual, Provider, ReactReduxContext } from 'react-redux'
@@ -0,0 +1 @@
{"version":3,"file":"mds.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/mds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,wuCAqBhC,CAAC"}
@@ -0,0 +1,186 @@
### Made by [@kilianvalkhof](https://twitter.com/kilianvalkhof)
#### Other projects:
- 💻 [Polypane](https://polypane.app) - Develop responsive websites and apps twice as fast on multiple screens at once
- 🖌️ [Superposition](https://superposition.design) - Kickstart your design system by extracting design tokens from your website
- 🗒️ [FromScratch](https://fromscratch.rocks) - A smart but simple autosaving scratchpad
---
# Electron-to-Chromium [![npm](https://img.shields.io/npm/v/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![travis](https://img.shields.io/travis/Kilian/electron-to-chromium/master.svg)](https://travis-ci.org/Kilian/electron-to-chromium) [![npm-downloads](https://img.shields.io/npm/dm/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![codecov](https://codecov.io/gh/Kilian/electron-to-chromium/branch/master/graph/badge.svg)](https://codecov.io/gh/Kilian/electron-to-chromium)[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_shield)
This repository provides a mapping of Electron versions to the Chromium version that it uses.
This package is used in [Browserslist](https://github.com/ai/browserslist), so you can use e.g. `electron >= 1.4` in [Autoprefixer](https://github.com/postcss/autoprefixer), [Stylelint](https://github.com/stylelint/stylelint), [babel-preset-env](https://github.com/babel/babel-preset-env) and [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat).
**Supported by:**
<a href="https://m.do.co/c/bb22ea58e765">
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
</a>
## Install
Install using `npm install electron-to-chromium`.
## Usage
To include Electron-to-Chromium, require it:
```js
var e2c = require('electron-to-chromium');
```
### Properties
The Electron-to-Chromium object has 4 properties to use:
#### `versions`
An object of key-value pairs with a _major_ Electron version as the key, and the corresponding major Chromium version as the value.
```js
var versions = e2c.versions;
console.log(versions['1.4']);
// returns "53"
```
#### `fullVersions`
An object of key-value pairs with a Electron version as the key, and the corresponding full Chromium version as the value.
```js
var versions = e2c.fullVersions;
console.log(versions['1.4.11']);
// returns "53.0.2785.143"
```
#### `chromiumVersions`
An object of key-value pairs with a _major_ Chromium version as the key, and the corresponding major Electron version as the value.
```js
var versions = e2c.chromiumVersions;
console.log(versions['54']);
// returns "1.4"
```
#### `fullChromiumVersions`
An object of key-value pairs with a Chromium version as the key, and an array of the corresponding major Electron versions as the value.
```js
var versions = e2c.fullChromiumVersions;
console.log(versions['54.0.2840.101']);
// returns ["1.5.1", "1.5.0"]
```
### Functions
#### `electronToChromium(query)`
Arguments:
* Query: string or number, required. A major or full Electron version.
A function that returns the corresponding Chromium version for a given Electron function. Returns a string.
If you provide it with a major Electron version, it will return a major Chromium version:
```js
var chromeVersion = e2c.electronToChromium('1.4');
// chromeVersion is "53"
```
If you provide it with a full Electron version, it will return the full Chromium version.
```js
var chromeVersion = e2c.electronToChromium('1.4.11');
// chromeVersion is "53.0.2785.143"
```
If a query does not match a Chromium version, it will return `undefined`.
```js
var chromeVersion = e2c.electronToChromium('9000');
// chromeVersion is undefined
```
#### `chromiumToElectron(query)`
Arguments:
* Query: string or number, required. A major or full Chromium version.
Returns a string with the corresponding Electron version for a given Chromium query.
If you provide it with a major Chromium version, it will return a major Electron version:
```js
var electronVersion = e2c.chromiumToElectron('54');
// electronVersion is "1.4"
```
If you provide it with a full Chrome version, it will return an array of full Electron versions.
```js
var electronVersions = e2c.chromiumToElectron('56.0.2924.87');
// electronVersions is ["1.6.3", "1.6.2", "1.6.1", "1.6.0"]
```
If a query does not match an Electron version, it will return `undefined`.
```js
var electronVersion = e2c.chromiumToElectron('10');
// electronVersion is undefined
```
#### `electronToBrowserList(query)` **DEPRECATED**
Arguments:
* Query: string or number, required. A major Electron version.
_**Deprecated**: Browserlist already includes electron-to-chromium._
A function that returns a [Browserslist](https://github.com/ai/browserslist) query that matches the given major Electron version. Returns a string.
If you provide it with a major Electron version, it will return a Browserlist query string that matches the Chromium capabilities:
```js
var query = e2c.electronToBrowserList('1.4');
// query is "Chrome >= 53"
```
If a query does not match a Chromium version, it will return `undefined`.
```js
var query = e2c.electronToBrowserList('9000');
// query is undefined
```
### Importing just versions, fullVersions, chromiumVersions and fullChromiumVersions
All lists can be imported on their own, if file size is a concern.
#### `versions`
```js
var versions = require('electron-to-chromium/versions');
```
#### `fullVersions`
```js
var fullVersions = require('electron-to-chromium/full-versions');
```
#### `chromiumVersions`
```js
var chromiumVersions = require('electron-to-chromium/chromium-versions');
```
#### `fullChromiumVersions`
```js
var fullChromiumVersions = require('electron-to-chromium/full-chromium-versions');
```
## Updating
This package will be updated with each new Electron release.
To update the list, run `npm run build.js`. Requires internet access as it downloads from the canonical list of Electron versions.
To verify correct behaviour, run `npm test`.
## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_large)
@@ -0,0 +1 @@
export declare function usePrevious<T>(value: T): T | undefined;
@@ -0,0 +1,144 @@
"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 (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "caràcters", verb: "contenir" },
file: { unit: "bytes", verb: "contenir" },
array: { unit: "elements", verb: "contenir" },
set: { unit: "elements", verb: "contenir" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "number";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "entrada",
email: "adreça electrònica",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "data i hora ISO",
date: "data ISO",
time: "hora ISO",
duration: "durada ISO",
ipv4: "adreça IPv4",
ipv6: "adreça IPv6",
cidrv4: "rang IPv4",
cidrv6: "rang IPv6",
base64: "cadena codificada en base64",
base64url: "cadena codificada en base64url",
json_string: "cadena JSON",
e164: "número E.164",
jwt: "JWT",
template_literal: "entrada",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Tipus invàlid: s'esperava ${issue.expected}, s'ha rebut ${parsedType(issue.input)}`;
// return `Tipus invàlid: s'esperava ${issue.expected}, s'ha rebut ${util.getParsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Valor invàlid: s'esperava ${util.stringifyPrimitive(issue.values[0])}`;
return `Opció invàlida: s'esperava una de ${util.joinValues(issue.values, " o ")}`;
case "too_big": {
const adj = issue.inclusive ? "com a màxim" : "menys de";
const sizing = getSizing(issue.origin);
if (sizing)
return `Massa gran: s'esperava que ${issue.origin ?? "el valor"} contingués ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
return `Massa gran: s'esperava que ${issue.origin ?? "el valor"} fos ${adj} ${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? "com a mínim" : "més de";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Massa petit: s'esperava que ${issue.origin} contingués ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
}
return `Massa petit: s'esperava que ${issue.origin} fos ${adj} ${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Format invàlid: ha de començar amb "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Format invàlid: ha d'acabar amb "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Format invàlid: ha d'incloure "${_issue.includes}"`;
if (_issue.format === "regex")
return `Format invàlid: ha de coincidir amb el patró ${_issue.pattern}`;
return `Format invàlid per a ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Número invàlid: ha de ser múltiple de ${issue.divisor}`;
case "unrecognized_keys":
return `Clau${issue.keys.length > 1 ? "s" : ""} no reconeguda${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Clau invàlida a ${issue.origin}`;
case "invalid_union":
return "Entrada invàlida"; // Could also be "Tipus d'unió invàlid" but "Entrada invàlida" is more general
case "invalid_element":
return `Element invàlid a ${issue.origin}`;
default:
return `Entrada invàlida`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2021: LibDefinition;
@@ -0,0 +1,3 @@
declare const URIError: URIErrorConstructor;
export = URIError;
@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _createRawReactElement;
var REACT_ELEMENT_TYPE;
function _createRawReactElement(type, props, key, children) {
if (!REACT_ELEMENT_TYPE) {
REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7;
}
var defaultProps = type && type.defaultProps;
var childrenLength = arguments.length - 3;
if (!props && childrenLength !== 0) {
props = {
children: void 0
};
}
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = new Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 3];
}
props.children = childArray;
}
if (props && defaultProps) {
for (var propName in defaultProps) {
if (props[propName] === void 0) {
props[propName] = defaultProps[propName];
}
}
} else if (!props) {
props = defaultProps || {};
}
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key === undefined ? null : "" + key,
ref: null,
props: props,
_owner: null
};
}
//# sourceMappingURL=jsx.js.map
@@ -0,0 +1,9 @@
const animationMaps = new WeakMap();
const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`;
function getAnimationMap(element) {
const map = animationMaps.get(element) || new Map();
animationMaps.set(element, map);
return map;
}
export { animationMapKey, getAnimationMap };
@@ -0,0 +1,42 @@
'use strict';
var whichBoxedPrimitive = require('which-boxed-primitive');
var callBound = require('call-bound');
var hasSymbols = require('has-symbols')();
var hasBigInts = require('has-bigints')();
var stringToString = callBound('String.prototype.toString');
var numberValueOf = callBound('Number.prototype.valueOf');
var booleanValueOf = callBound('Boolean.prototype.valueOf');
var symbolValueOf = hasSymbols && callBound('Symbol.prototype.valueOf');
var bigIntValueOf = hasBigInts && callBound('BigInt.prototype.valueOf');
/** @type {import('.')} */
module.exports = function unboxPrimitive(value) {
var which = whichBoxedPrimitive(value);
if (typeof which !== 'string') {
throw new TypeError(which === null ? 'value is an unboxed primitive' : 'value is a non-boxed-primitive object');
}
if (which === 'String') {
return stringToString(value);
}
if (which === 'Number') {
return numberValueOf(value);
}
if (which === 'Boolean') {
return booleanValueOf(value);
}
if (which === 'Symbol') {
if (!hasSymbols) {
throw new EvalError('somehow this environment does not have Symbols, but you have a boxed Symbol value. Please report this!');
}
// eslint-disable-next-line no-extra-parens
return /** @type {Exclude<typeof symbolValueOf, false>} */ (symbolValueOf)(value);
}
if (which === 'BigInt') {
// eslint-disable-next-line no-extra-parens
return /** @type {Exclude<typeof bigIntValueOf, false>} */ (bigIntValueOf)(value);
}
throw new RangeError('unknown boxed primitive found: ' + which);
};
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more