docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s

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,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./extensions"), exports);
tslib_1.__exportStar(require("./algorithm_identifier"), exports);
tslib_1.__exportStar(require("./attribute"), exports);
tslib_1.__exportStar(require("./certificate"), exports);
tslib_1.__exportStar(require("./certificate_list"), exports);
tslib_1.__exportStar(require("./extension"), exports);
tslib_1.__exportStar(require("./general_name"), exports);
tslib_1.__exportStar(require("./general_names"), exports);
tslib_1.__exportStar(require("./name"), exports);
tslib_1.__exportStar(require("./object_identifiers"), exports);
tslib_1.__exportStar(require("./subject_public_key_info"), exports);
tslib_1.__exportStar(require("./tbs_cert_list"), exports);
tslib_1.__exportStar(require("./tbs_certificate"), exports);
tslib_1.__exportStar(require("./time"), exports);
tslib_1.__exportStar(require("./types"), exports);
tslib_1.__exportStar(require("./validity"), exports);
@@ -0,0 +1,25 @@
import {
__DEV__,
__TEST__,
dataAttr,
isArray,
isEmpty,
isEmptyArray,
isEmptyObject,
isFunction,
isNumeric,
isObject
} from "./chunk-MCFSCOSB.mjs";
import "./chunk-UYSIEMEK.mjs";
export {
__DEV__,
__TEST__,
dataAttr,
isArray,
isEmpty,
isEmptyArray,
isEmptyObject,
isFunction,
isNumeric,
isObject
};
@@ -0,0 +1,114 @@
import { t } from '../localizedFormat/utils';
export default (function (o, c, dayjs) {
// locale needed later
var proto = c.prototype;
var getLocalePart = function getLocalePart(part) {
return part && (part.indexOf ? part : part.s);
};
var getShort = function getShort(ins, target, full, num, localeOrder) {
var locale = ins.name ? ins : ins.$locale();
var targetLocale = getLocalePart(locale[target]);
var fullLocale = getLocalePart(locale[full]);
var result = targetLocale || fullLocale.map(function (f) {
return f.slice(0, num);
});
if (!localeOrder) return result;
var weekStart = locale.weekStart;
return result.map(function (_, index) {
return result[(index + (weekStart || 0)) % 7];
});
};
var getDayjsLocaleObject = function getDayjsLocaleObject() {
return dayjs.Ls[dayjs.locale()];
};
var getLongDateFormat = function getLongDateFormat(l, format) {
return l.formats[format] || t(l.formats[format.toUpperCase()]);
};
var localeData = function localeData() {
var _this = this;
return {
months: function months(instance) {
return instance ? instance.format('MMMM') : getShort(_this, 'months');
},
monthsShort: function monthsShort(instance) {
return instance ? instance.format('MMM') : getShort(_this, 'monthsShort', 'months', 3);
},
firstDayOfWeek: function firstDayOfWeek() {
return _this.$locale().weekStart || 0;
},
weekdays: function weekdays(instance) {
return instance ? instance.format('dddd') : getShort(_this, 'weekdays');
},
weekdaysMin: function weekdaysMin(instance) {
return instance ? instance.format('dd') : getShort(_this, 'weekdaysMin', 'weekdays', 2);
},
weekdaysShort: function weekdaysShort(instance) {
return instance ? instance.format('ddd') : getShort(_this, 'weekdaysShort', 'weekdays', 3);
},
longDateFormat: function longDateFormat(format) {
return getLongDateFormat(_this.$locale(), format);
},
meridiem: this.$locale().meridiem,
ordinal: this.$locale().ordinal
};
};
proto.localeData = function () {
return localeData.bind(this)();
};
dayjs.localeData = function () {
var localeObject = getDayjsLocaleObject();
return {
firstDayOfWeek: function firstDayOfWeek() {
return localeObject.weekStart || 0;
},
weekdays: function weekdays() {
return dayjs.weekdays();
},
weekdaysShort: function weekdaysShort() {
return dayjs.weekdaysShort();
},
weekdaysMin: function weekdaysMin() {
return dayjs.weekdaysMin();
},
months: function months() {
return dayjs.months();
},
monthsShort: function monthsShort() {
return dayjs.monthsShort();
},
longDateFormat: function longDateFormat(format) {
return getLongDateFormat(localeObject, format);
},
meridiem: localeObject.meridiem,
ordinal: localeObject.ordinal
};
};
dayjs.months = function () {
return getShort(getDayjsLocaleObject(), 'months');
};
dayjs.monthsShort = function () {
return getShort(getDayjsLocaleObject(), 'monthsShort', 'months', 3);
};
dayjs.weekdays = function (localeOrder) {
return getShort(getDayjsLocaleObject(), 'weekdays', null, null, localeOrder);
};
dayjs.weekdaysShort = function (localeOrder) {
return getShort(getDayjsLocaleObject(), 'weekdaysShort', 'weekdays', 3, localeOrder);
};
dayjs.weekdaysMin = function (localeOrder) {
return getShort(getDayjsLocaleObject(), 'weekdaysMin', 'weekdays', 2, localeOrder);
};
});
@@ -0,0 +1,105 @@
'use strict';
var Alias = require('../nodes/Alias.js');
var identity = require('../nodes/identity.js');
var composeCollection = require('./compose-collection.js');
var composeScalar = require('./compose-scalar.js');
var resolveEnd = require('./resolve-end.js');
var utilEmptyScalarPosition = require('./util-empty-scalar-position.js');
const CN = { composeNode, composeEmptyNode };
function composeNode(ctx, token, props, onError) {
const atKey = ctx.atKey;
const { spaceBefore, comment, anchor, tag } = props;
let node;
let isSrcToken = true;
switch (token.type) {
case 'alias':
node = composeAlias(ctx, token, onError);
if (anchor || tag)
onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties');
break;
case 'scalar':
case 'single-quoted-scalar':
case 'double-quoted-scalar':
case 'block-scalar':
node = composeScalar.composeScalar(ctx, token, tag, onError);
if (anchor)
node.anchor = anchor.source.substring(1);
break;
case 'block-map':
case 'block-seq':
case 'flow-collection':
node = composeCollection.composeCollection(CN, ctx, token, props, onError);
if (anchor)
node.anchor = anchor.source.substring(1);
break;
default: {
const message = token.type === 'error'
? token.message
: `Unsupported token (type: ${token.type})`;
onError(token, 'UNEXPECTED_TOKEN', message);
node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);
isSrcToken = false;
}
}
if (anchor && node.anchor === '')
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
if (atKey &&
ctx.options.stringKeys &&
(!identity.isScalar(node) ||
typeof node.value !== 'string' ||
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
const msg = 'With stringKeys, all keys must be strings';
onError(tag ?? token, 'NON_STRING_KEY', msg);
}
if (spaceBefore)
node.spaceBefore = true;
if (comment) {
if (token.type === 'scalar' && token.source === '')
node.comment = comment;
else
node.commentBefore = comment;
}
// @ts-expect-error Type checking misses meaning of isSrcToken
if (ctx.options.keepSourceTokens && isSrcToken)
node.srcToken = token;
return node;
}
function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
const token = {
type: 'scalar',
offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),
indent: -1,
source: ''
};
const node = composeScalar.composeScalar(ctx, token, tag, onError);
if (anchor) {
node.anchor = anchor.source.substring(1);
if (node.anchor === '')
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
}
if (spaceBefore)
node.spaceBefore = true;
if (comment) {
node.comment = comment;
node.range[2] = end;
}
return node;
}
function composeAlias({ options }, { offset, source, end }, onError) {
const alias = new Alias.Alias(source.substring(1));
if (alias.source === '')
onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string');
if (alias.source.endsWith(':'))
onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true);
const valueEnd = offset + source.length;
const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);
alias.range = [offset, valueEnd, re.offset];
if (re.comment)
alias.comment = re.comment;
return alias;
}
exports.composeEmptyNode = composeEmptyNode;
exports.composeNode = composeNode;
@@ -0,0 +1,76 @@
'use strict';
var $TypeError = require('es-errors/type');
var isNegativeZero = require('math-intrinsics/isNegativeZero');
var MAX_SAFE_INTEGER = require('math-intrinsics/constants/maxSafeInteger');
var AddValueToKeyedGroup = require('./AddValueToKeyedGroup');
var Call = require('./Call');
var GetIterator = require('./GetIterator');
var IsCallable = require('./IsCallable');
var IteratorClose = require('./IteratorClose');
var IteratorStep = require('./IteratorStep');
var IteratorValue = require('./IteratorValue');
var RequireObjectCoercible = require('./RequireObjectCoercible');
var ThrowCompletion = require('./ThrowCompletion');
var ToPropertyKey = require('./ToPropertyKey');
// https://262.ecma-international.org/15.0/#sec-groupby
module.exports = function GroupBy(items, callbackfn, keyCoercion) {
if (keyCoercion !== 'PROPERTY' && keyCoercion !== 'ZERO') {
throw new $TypeError('Assertion failed: `keyCoercion` must be `"PROPERTY"` or `"ZERO"`');
}
RequireObjectCoercible(items); // step 1
if (!IsCallable(callbackfn)) {
throw new $TypeError('callbackfn must be callable'); // step 2
}
var groups = []; // step 3
var iteratorRecord = GetIterator(items, 'SYNC'); // step 4
var k = 0; // step 5
// eslint-disable-next-line no-constant-condition
while (true) { // step 6
if (k >= MAX_SAFE_INTEGER) { // step 6.a
var error = ThrowCompletion(new $TypeError('k must be less than 2 ** 53 - 1')); // step 6.a.i
return void IteratorClose(iteratorRecord, error); // step 6.a.ii
}
var next = IteratorStep(iteratorRecord); // step 6.b
if (!next) { // step 6.c
return groups; // step 6.c.i
}
var value = IteratorValue(next); // step 6.dv
var key;
try {
key = Call(callbackfn, undefined, [value, k]); // step 6.e
} catch (e) {
return void IteratorClose(iteratorRecord, ThrowCompletion(e)); // step 6.f
}
if (keyCoercion === 'PROPERTY') { // step 6.g
try {
key = ToPropertyKey(key); // step 6.g.i
} catch (e) {
return void IteratorClose(iteratorRecord, ThrowCompletion(e)); // step 6.g.ii
}
} else { // step 6.h
if (keyCoercion !== 'ZERO') {
throw new $TypeError('Assertion failed: keyCoercion must be ~PROPERTY~ or ~ZERO~'); // step 6.h.i
}
if (isNegativeZero(key)) {
key = +0; // step 6.h.ii
}
}
AddValueToKeyedGroup(groups, key, value); // step 6.i
k += 1; // step 6.j
}
};
@@ -0,0 +1,6 @@
{
"private": true,
"types": "../../dist/dom-mini.d.ts",
"main": "../../dist/cjs/dom-mini.js",
"module": "../../dist/es/dom-mini.mjs"
}
@@ -0,0 +1,43 @@
import escapeHtmlChar from './_escapeHtmlChar.js';
import toString from './toString.js';
/** Used to match HTML entities and HTML characters. */
var reUnescapedHtml = /[&<>"']/g,
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
/**
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
* corresponding HTML entities.
*
* **Note:** No other characters are escaped. To escape additional
* characters use a third-party library like [_he_](https://mths.be/he).
*
* Though the ">" character is escaped for symmetry, characters like
* ">" and "/" don't need escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value. See
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details.
*
* When working with HTML you should always
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
* XSS vectors.
*
* @static
* @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escape('fred, barney, & pebbles');
* // => 'fred, barney, &amp; pebbles'
*/
function escape(string) {
string = toString(string);
return (string && reHasUnescapedHtml.test(string))
? string.replace(reUnescapedHtml, escapeHtmlChar)
: string;
}
export default escape;
@@ -0,0 +1,45 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TSUtils = exports.TSESLint = exports.JSONSchema = exports.ESLintUtils = exports.ASTUtils = void 0;
exports.ASTUtils = __importStar(require("./ast-utils"));
exports.ESLintUtils = __importStar(require("./eslint-utils"));
exports.JSONSchema = __importStar(require("./json-schema"));
exports.TSESLint = __importStar(require("./ts-eslint"));
__exportStar(require("./ts-estree"), exports);
exports.TSUtils = __importStar(require("./ts-utils"));
@@ -0,0 +1,6 @@
import {
CopyLinearIcon
} from "../chunk-W5SCNTSN.mjs";
export {
CopyLinearIcon
};
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isParentBindingConstraintsWithTag = isParentBindingConstraintsWithTag;
const isBindingConstraintsWithTag_1 = require("./isBindingConstraintsWithTag");
const isParentBindingConstraints_1 = require("./isParentBindingConstraints");
function isParentBindingConstraintsWithTag(tag, value) {
return (0, isParentBindingConstraints_1.isParentBindingConstraints)((0, isBindingConstraintsWithTag_1.isBindingConstraintsWithTag)(tag, value));
}
//# sourceMappingURL=isParentBindingConstraintsWithTag.js.map
@@ -0,0 +1,49 @@
# `@rtsao/scc`
Find strongly connected components of a directed graph using [Tarjan's algorithm](https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm).
This algorithm efficiently yields both a topological order and list of any cycles.
## Installation
```
yarn add @rtsao/scc
```
```
npm install @rtsao/scc
```
## Usage
```js
const scc = require("@rtsao/scc");
const digraph = new Map([
["a", new Set(["c", "d"])],
["b", new Set(["a"])],
["c", new Set(["b"])],
["d", new Set(["e"])],
["e", new Set()]
]);
const components = scc(digraph);
// [ Set { 'e' }, Set { 'd' }, Set { 'b', 'c', 'a' } ]
```
#### Illustration of example input digraph
```
┌───┐ ┌───┐
│ d │ ◀── │ a │ ◀┐
└───┘ └───┘ │
│ │ │
▼ ▼ │
┌───┐ ┌───┐ │
│ e │ │ c │ │
└───┘ └───┘ │
│ │
▼ │
┌───┐ │
│ b │ ─┘
└───┘
```
@@ -0,0 +1,15 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $String = GetIntrinsic('%String%');
var ToPrimitive = require('./ToPrimitive');
var ToString = require('./ToString');
// https://262.ecma-international.org/6.0/#sec-topropertykey
module.exports = function ToPropertyKey(argument) {
var key = ToPrimitive(argument, $String);
return typeof key === 'symbol' ? key : ToString(key);
};
@@ -0,0 +1,10 @@
import { PluginFunc } from 'dayjs'
declare module 'dayjs' {
interface ConfigTypeMap {
arraySupport: [number?, number?, number?, number?, number?, number?, number?]
}
}
declare const plugin: PluginFunc
export = plugin
@@ -0,0 +1,5 @@
'use strict'
const compare = require('./compare')
const gte = (a, b, loose) => compare(a, b, loose) >= 0
module.exports = gte
@@ -0,0 +1,591 @@
"use strict";
// import { $ZodType } from "./schemas.js";
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.$ZodCheckOverwrite = exports.$ZodCheckMimeType = exports.$ZodCheckProperty = exports.$ZodCheckEndsWith = exports.$ZodCheckStartsWith = exports.$ZodCheckIncludes = exports.$ZodCheckUpperCase = exports.$ZodCheckLowerCase = exports.$ZodCheckRegex = exports.$ZodCheckStringFormat = exports.$ZodCheckLengthEquals = exports.$ZodCheckMinLength = exports.$ZodCheckMaxLength = exports.$ZodCheckSizeEquals = exports.$ZodCheckMinSize = exports.$ZodCheckMaxSize = exports.$ZodCheckBigIntFormat = exports.$ZodCheckNumberFormat = exports.$ZodCheckMultipleOf = exports.$ZodCheckGreaterThan = exports.$ZodCheckLessThan = exports.$ZodCheck = void 0;
const core = __importStar(require("./core.cjs"));
const regexes = __importStar(require("./regexes.cjs"));
const util = __importStar(require("./util.cjs"));
exports.$ZodCheck = core.$constructor("$ZodCheck", (inst, def) => {
var _a;
inst._zod ?? (inst._zod = {});
inst._zod.def = def;
(_a = inst._zod).onattach ?? (_a.onattach = []);
});
const numericOriginMap = {
number: "number",
bigint: "bigint",
object: "date",
};
exports.$ZodCheckLessThan = core.$constructor("$ZodCheckLessThan", (inst, def) => {
exports.$ZodCheck.init(inst, def);
const origin = numericOriginMap[typeof def.value];
inst._zod.onattach.push((inst) => {
const bag = inst._zod.bag;
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
if (def.value < curr) {
if (def.inclusive)
bag.maximum = def.value;
else
bag.exclusiveMaximum = def.value;
}
});
inst._zod.check = (payload) => {
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
return;
}
payload.issues.push({
origin,
code: "too_big",
maximum: def.value,
input: payload.value,
inclusive: def.inclusive,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckGreaterThan = core.$constructor("$ZodCheckGreaterThan", (inst, def) => {
exports.$ZodCheck.init(inst, def);
const origin = numericOriginMap[typeof def.value];
inst._zod.onattach.push((inst) => {
const bag = inst._zod.bag;
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
if (def.value > curr) {
if (def.inclusive)
bag.minimum = def.value;
else
bag.exclusiveMinimum = def.value;
}
});
inst._zod.check = (payload) => {
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
return;
}
payload.issues.push({
origin,
code: "too_small",
minimum: def.value,
input: payload.value,
inclusive: def.inclusive,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckMultipleOf =
/*@__PURE__*/ core.$constructor("$ZodCheckMultipleOf", (inst, def) => {
exports.$ZodCheck.init(inst, def);
inst._zod.onattach.push((inst) => {
var _a;
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
});
inst._zod.check = (payload) => {
if (typeof payload.value !== typeof def.value)
throw new Error("Cannot mix number and bigint in multiple_of check.");
const isMultiple = typeof payload.value === "bigint"
? payload.value % def.value === BigInt(0)
: util.floatSafeRemainder(payload.value, def.value) === 0;
if (isMultiple)
return;
payload.issues.push({
origin: typeof payload.value,
code: "not_multiple_of",
divisor: def.value,
input: payload.value,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckNumberFormat = core.$constructor("$ZodCheckNumberFormat", (inst, def) => {
exports.$ZodCheck.init(inst, def); // no format checks
def.format = def.format || "float64";
const isInt = def.format?.includes("int");
const origin = isInt ? "int" : "number";
const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];
inst._zod.onattach.push((inst) => {
const bag = inst._zod.bag;
bag.format = def.format;
bag.minimum = minimum;
bag.maximum = maximum;
if (isInt)
bag.pattern = regexes.integer;
});
inst._zod.check = (payload) => {
const input = payload.value;
if (isInt) {
if (!Number.isInteger(input)) {
// invalid_format issue
// payload.issues.push({
// expected: def.format,
// format: def.format,
// code: "invalid_format",
// input,
// inst,
// });
// invalid_type issue
payload.issues.push({
expected: origin,
format: def.format,
code: "invalid_type",
input,
inst,
});
return;
// not_multiple_of issue
// payload.issues.push({
// code: "not_multiple_of",
// origin: "number",
// input,
// inst,
// divisor: 1,
// });
}
if (!Number.isSafeInteger(input)) {
if (input > 0) {
// too_big
payload.issues.push({
input,
code: "too_big",
maximum: Number.MAX_SAFE_INTEGER,
note: "Integers must be within the safe integer range.",
inst,
origin,
continue: !def.abort,
});
}
else {
// too_small
payload.issues.push({
input,
code: "too_small",
minimum: Number.MIN_SAFE_INTEGER,
note: "Integers must be within the safe integer range.",
inst,
origin,
continue: !def.abort,
});
}
return;
}
}
if (input < minimum) {
payload.issues.push({
origin: "number",
input,
code: "too_small",
minimum,
inclusive: true,
inst,
continue: !def.abort,
});
}
if (input > maximum) {
payload.issues.push({
origin: "number",
input,
code: "too_big",
maximum,
inst,
});
}
};
});
exports.$ZodCheckBigIntFormat = core.$constructor("$ZodCheckBigIntFormat", (inst, def) => {
exports.$ZodCheck.init(inst, def); // no format checks
const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];
inst._zod.onattach.push((inst) => {
const bag = inst._zod.bag;
bag.format = def.format;
bag.minimum = minimum;
bag.maximum = maximum;
});
inst._zod.check = (payload) => {
const input = payload.value;
if (input < minimum) {
payload.issues.push({
origin: "bigint",
input,
code: "too_small",
minimum: minimum,
inclusive: true,
inst,
continue: !def.abort,
});
}
if (input > maximum) {
payload.issues.push({
origin: "bigint",
input,
code: "too_big",
maximum,
inst,
});
}
};
});
exports.$ZodCheckMaxSize = core.$constructor("$ZodCheckMaxSize", (inst, def) => {
var _a;
exports.$ZodCheck.init(inst, def);
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
const val = payload.value;
return !util.nullish(val) && val.size !== undefined;
});
inst._zod.onattach.push((inst) => {
const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);
if (def.maximum < curr)
inst._zod.bag.maximum = def.maximum;
});
inst._zod.check = (payload) => {
const input = payload.value;
const size = input.size;
if (size <= def.maximum)
return;
payload.issues.push({
origin: util.getSizableOrigin(input),
code: "too_big",
maximum: def.maximum,
input,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckMinSize = core.$constructor("$ZodCheckMinSize", (inst, def) => {
var _a;
exports.$ZodCheck.init(inst, def);
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
const val = payload.value;
return !util.nullish(val) && val.size !== undefined;
});
inst._zod.onattach.push((inst) => {
const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);
if (def.minimum > curr)
inst._zod.bag.minimum = def.minimum;
});
inst._zod.check = (payload) => {
const input = payload.value;
const size = input.size;
if (size >= def.minimum)
return;
payload.issues.push({
origin: util.getSizableOrigin(input),
code: "too_small",
minimum: def.minimum,
input,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckSizeEquals = core.$constructor("$ZodCheckSizeEquals", (inst, def) => {
var _a;
exports.$ZodCheck.init(inst, def);
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
const val = payload.value;
return !util.nullish(val) && val.size !== undefined;
});
inst._zod.onattach.push((inst) => {
const bag = inst._zod.bag;
bag.minimum = def.size;
bag.maximum = def.size;
bag.size = def.size;
});
inst._zod.check = (payload) => {
const input = payload.value;
const size = input.size;
if (size === def.size)
return;
const tooBig = size > def.size;
payload.issues.push({
origin: util.getSizableOrigin(input),
...(tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size }),
inclusive: true,
exact: true,
input: payload.value,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckMaxLength = core.$constructor("$ZodCheckMaxLength", (inst, def) => {
var _a;
exports.$ZodCheck.init(inst, def);
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
const val = payload.value;
return !util.nullish(val) && val.length !== undefined;
});
inst._zod.onattach.push((inst) => {
const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);
if (def.maximum < curr)
inst._zod.bag.maximum = def.maximum;
});
inst._zod.check = (payload) => {
const input = payload.value;
const length = input.length;
if (length <= def.maximum)
return;
const origin = util.getLengthableOrigin(input);
payload.issues.push({
origin,
code: "too_big",
maximum: def.maximum,
inclusive: true,
input,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckMinLength = core.$constructor("$ZodCheckMinLength", (inst, def) => {
var _a;
exports.$ZodCheck.init(inst, def);
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
const val = payload.value;
return !util.nullish(val) && val.length !== undefined;
});
inst._zod.onattach.push((inst) => {
const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);
if (def.minimum > curr)
inst._zod.bag.minimum = def.minimum;
});
inst._zod.check = (payload) => {
const input = payload.value;
const length = input.length;
if (length >= def.minimum)
return;
const origin = util.getLengthableOrigin(input);
payload.issues.push({
origin,
code: "too_small",
minimum: def.minimum,
inclusive: true,
input,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckLengthEquals = core.$constructor("$ZodCheckLengthEquals", (inst, def) => {
var _a;
exports.$ZodCheck.init(inst, def);
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
const val = payload.value;
return !util.nullish(val) && val.length !== undefined;
});
inst._zod.onattach.push((inst) => {
const bag = inst._zod.bag;
bag.minimum = def.length;
bag.maximum = def.length;
bag.length = def.length;
});
inst._zod.check = (payload) => {
const input = payload.value;
const length = input.length;
if (length === def.length)
return;
const origin = util.getLengthableOrigin(input);
const tooBig = length > def.length;
payload.issues.push({
origin,
...(tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length }),
inclusive: true,
exact: true,
input: payload.value,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckStringFormat = core.$constructor("$ZodCheckStringFormat", (inst, def) => {
var _a, _b;
exports.$ZodCheck.init(inst, def);
inst._zod.onattach.push((inst) => {
const bag = inst._zod.bag;
bag.format = def.format;
if (def.pattern) {
bag.patterns ?? (bag.patterns = new Set());
bag.patterns.add(def.pattern);
}
});
if (def.pattern)
(_a = inst._zod).check ?? (_a.check = (payload) => {
def.pattern.lastIndex = 0;
if (def.pattern.test(payload.value))
return;
payload.issues.push({
origin: "string",
code: "invalid_format",
format: def.format,
input: payload.value,
...(def.pattern ? { pattern: def.pattern.toString() } : {}),
inst,
continue: !def.abort,
});
});
else
(_b = inst._zod).check ?? (_b.check = () => { });
});
exports.$ZodCheckRegex = core.$constructor("$ZodCheckRegex", (inst, def) => {
exports.$ZodCheckStringFormat.init(inst, def);
inst._zod.check = (payload) => {
def.pattern.lastIndex = 0;
if (def.pattern.test(payload.value))
return;
payload.issues.push({
origin: "string",
code: "invalid_format",
format: "regex",
input: payload.value,
pattern: def.pattern.toString(),
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckLowerCase = core.$constructor("$ZodCheckLowerCase", (inst, def) => {
def.pattern ?? (def.pattern = regexes.lowercase);
exports.$ZodCheckStringFormat.init(inst, def);
});
exports.$ZodCheckUpperCase = core.$constructor("$ZodCheckUpperCase", (inst, def) => {
def.pattern ?? (def.pattern = regexes.uppercase);
exports.$ZodCheckStringFormat.init(inst, def);
});
exports.$ZodCheckIncludes = core.$constructor("$ZodCheckIncludes", (inst, def) => {
exports.$ZodCheck.init(inst, def);
const escapedRegex = util.escapeRegex(def.includes);
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
def.pattern = pattern;
inst._zod.onattach.push((inst) => {
const bag = inst._zod.bag;
bag.patterns ?? (bag.patterns = new Set());
bag.patterns.add(pattern);
});
inst._zod.check = (payload) => {
if (payload.value.includes(def.includes, def.position))
return;
payload.issues.push({
origin: "string",
code: "invalid_format",
format: "includes",
includes: def.includes,
input: payload.value,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckStartsWith = core.$constructor("$ZodCheckStartsWith", (inst, def) => {
exports.$ZodCheck.init(inst, def);
const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);
def.pattern ?? (def.pattern = pattern);
inst._zod.onattach.push((inst) => {
const bag = inst._zod.bag;
bag.patterns ?? (bag.patterns = new Set());
bag.patterns.add(pattern);
});
inst._zod.check = (payload) => {
if (payload.value.startsWith(def.prefix))
return;
payload.issues.push({
origin: "string",
code: "invalid_format",
format: "starts_with",
prefix: def.prefix,
input: payload.value,
inst,
continue: !def.abort,
});
};
});
exports.$ZodCheckEndsWith = core.$constructor("$ZodCheckEndsWith", (inst, def) => {
exports.$ZodCheck.init(inst, def);
const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);
def.pattern ?? (def.pattern = pattern);
inst._zod.onattach.push((inst) => {
const bag = inst._zod.bag;
bag.patterns ?? (bag.patterns = new Set());
bag.patterns.add(pattern);
});
inst._zod.check = (payload) => {
if (payload.value.endsWith(def.suffix))
return;
payload.issues.push({
origin: "string",
code: "invalid_format",
format: "ends_with",
suffix: def.suffix,
input: payload.value,
inst,
continue: !def.abort,
});
};
});
///////////////////////////////////
///// $ZodCheckProperty /////
///////////////////////////////////
function handleCheckPropertyResult(result, payload, property) {
if (result.issues.length) {
payload.issues.push(...util.prefixIssues(property, result.issues));
}
}
exports.$ZodCheckProperty = core.$constructor("$ZodCheckProperty", (inst, def) => {
exports.$ZodCheck.init(inst, def);
inst._zod.check = (payload) => {
const result = def.schema._zod.run({
value: payload.value[def.property],
issues: [],
}, {});
if (result instanceof Promise) {
return result.then((result) => handleCheckPropertyResult(result, payload, def.property));
}
handleCheckPropertyResult(result, payload, def.property);
return;
};
});
exports.$ZodCheckMimeType = core.$constructor("$ZodCheckMimeType", (inst, def) => {
exports.$ZodCheck.init(inst, def);
const mimeSet = new Set(def.mime);
inst._zod.onattach.push((inst) => {
inst._zod.bag.mime = def.mime;
});
inst._zod.check = (payload) => {
if (mimeSet.has(payload.value.type))
return;
payload.issues.push({
code: "invalid_value",
values: def.mime,
input: payload.value.type,
inst,
});
};
});
exports.$ZodCheckOverwrite = core.$constructor("$ZodCheckOverwrite", (inst, def) => {
exports.$ZodCheck.init(inst, def);
inst._zod.check = (payload) => {
payload.value = def.tx(payload.value);
};
});
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAuEM,SAAS,0CAAW,KAAgB,EAAE,KAAsC,EAAE,GAAkC;IACrH,IAAI,iBACF,aAAa,qBACb,iBAAiB,oBACjB,gBAAgB,aAChB,SAAS,aACT,SAAS,cACT,UAAU,eACV,WAAW,gBACX,YAAY,qBACZ,oBAAoB,yCACpB,qBAAqB,EACtB,GAAG;IACJ,IAAI,EAAC,kBAAkB,OAAO,EAAC,GAAG;IAElC,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB,EACnD,QAAQ,IAAI,CAAC;IAGf,0HAA0H;IAC1H,qFAAqF;IACrF,IAAI,WAAW,CAAA,GAAA,kBAAU,EAAE;QAAC,OAAO;QAAU,aAAa;IAAM;IAChE,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAC1B,IAAI,mBAAmB,MAAM,gBAAgB,CAAC,gBAAgB;IAC9D,IAAI,WAAW,CAAA,GAAA,cAAM,EAAE,IAAM,oBAAoB,IAAI,CAAA,GAAA,yCAAmB,EAAE;YACxE,YAAY,MAAM,UAAU;YAC5B,cAAc,MAAM,YAAY;8BAChC;iBACA;uBACA;sBACA;uBACA;QACF,IAAI;QAAC;QAAkB,MAAM,UAAU;QAAE,MAAM,YAAY;QAAE;QAAkB;QAAK;QAAW;QAAU;KAAU;IAEnH,IAAI,mBAAC,eAAe,EAAC,GAAG,CAAA,GAAA,8BAAsB,EAAE;aAC9C;QACA,kBAAkB;QAClB,kBAAkB;uBAClB;mBACA;2BACA;2BACA;IACF;IAEA,IAAI,KAAK,CAAA,GAAA,YAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,yCAAM,EAAE,GAAG,CAAC,OAAO;QAAC,kBAAkB;QAAU,SAAS;yBAAC;0BAAa;QAAY;+BAAG;IAAqB;IAE3G,IAAI,mBAAmB,CAAA,GAAA,yCAA+B,EAAE;QACtD,kBAAkB;QAClB,gBAAgB,CAAC,CAAE,CAAA,eAAe,YAAW;IAC/C;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IAErD,IAAI,UAAU,CAAA,GAAA,kBAAU,EAAE,CAAC;QACzB,IAAI,QAAQ,SAAS,EAAE;YACrB,gEAAgE;YAChE,IAAI,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,GACpC,QAAQ,UAAU,CAAC;YAGrB;QACF;QAEA,gEAAgE;QAChE,IAAI,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,GACpC;QAGF,QAAQ,UAAU,CAAC;IACrB,GAAG;QAAC;KAAQ;IAEZ,qFAAqF;IACrF,IAAI,sBAAsB,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;YACvC,QAAQ,gBAAgB,MAAM;qBAC9B;QACF,CAAA,GAAI;QAAC;QAAS,gBAAgB,MAAM;KAAC;IAErC,IAAI,mBAAmB,CAAA,GAAA,0BAAkB,EAAE,KAAK;QAC9C,YAAY,MAAM,UAAU,CAAC,IAAI,KAAK;IACxC;IAEA,IAAI,YAA2B,CAAA,GAAA,iBAAS,EACtC,UACA;QACE,MAAM;YACN;QACA,wBAAwB,QAAQ,aAAa,KAAK,aAAa,SAAS;IAC1E,GACA,MAAM,4BAA4B,GAAG,sBAAsB,iBAE3D,AADA,mGAAmG;IAClG,MAAM,UAAU,CAAC,IAAI,KAAK,KAAK;QAAC,UAAU,mBAAmB,KAAK;IAAC,KAAM,WAC1E;IAGF,IAAI,eAAe;QACjB,SAAS,CAAC,gBAAgB,GAAG,MAAM,UAAU,CAAC,IAAI;QAClD,SAAS,CAAC,gBAAgB,GAAG,MAAM,UAAU,CAAC,WAAW;IAC3D;IAEA,CAAA,GAAA,yCAA2B,EAAE;oBAAC;IAAU,GAAG;IAC3C,OAAO;mBACL;IACF;AACF","sources":["packages/@react-aria/grid/src/useGrid.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 {AriaLabelingProps, DOMAttributes, DOMProps, Key, KeyboardDelegate, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useId} from '@react-aria/utils';\nimport {GridCollection} from '@react-types/grid';\nimport {GridKeyboardDelegate} from './GridKeyboardDelegate';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {useCallback, useMemo} from 'react';\nimport {useCollator, useLocale} from '@react-aria/i18n';\nimport {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';\nimport {useHasTabbableChild} from '@react-aria/focus';\nimport {useHighlightSelectionDescription} from './useHighlightSelectionDescription';\nimport {useSelectableCollection} from '@react-aria/selection';\n\nexport interface GridProps extends DOMProps, AriaLabelingProps {\n /** Whether the grid uses virtual scrolling. */\n isVirtualized?: boolean,\n /**\n * Whether typeahead navigation is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * Whether initial grid focus should be placed on the grid row or grid cell.\n * @default 'row'\n */\n focusMode?: 'row' | 'cell',\n /**\n * A function that returns the text that should be announced by assistive technology when a row is added or removed from selection.\n * @default (key) => state.collection.getItem(key)?.textValue\n */\n getRowText?: (key: Key) => string,\n /**\n * The ref attached to the scrollable body. Used to provided automatic scrolling on item focus for non-virtualized grids.\n */\n scrollRef?: RefObject<HTMLElement | null>,\n /** Handler that is called when a user performs an action on the row. */\n onRowAction?: (key: Key) => void,\n /** Handler that is called when a user performs an action on the cell. */\n onCellAction?: (key: Key) => void,\n /**\n * Whether pressing the escape key should clear selection in the grid or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use Line truncated
@@ -0,0 +1 @@
const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",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},lookup=genLookup(chars),lookupUrl=genLookup(charsUrl);const base64UrlPattern=/^[-A-Za-z0-9\-_]*$/;const base64Pattern=/^[-A-Za-z0-9+/]*={0,3}$/;const base64={};base64.toArrayBuffer=(data,urlMode)=>{const len=data.length;let bufferLength=data.length*.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};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};base64.toString=(str,urlMode)=>{return(new TextDecoder).decode(base64.toArrayBuffer(str,urlMode))};base64.fromString=(str,urlMode)=>{return base64.fromArrayBuffer((new TextEncoder).encode(str),urlMode)};base64.validate=(encoded,urlMode)=>{if(!(typeof encoded==="string"||encoded instanceof String)){return false}try{return urlMode?base64UrlPattern.test(encoded):base64Pattern.test(encoded)}catch(_e){return false}};base64.base64=base64;export{base64,base64 as default};
@@ -0,0 +1,5 @@
import { GetAllOptions } from './GetAllOptions';
export interface OptionalGetAllOptions extends GetAllOptions {
optional: true;
}
//# sourceMappingURL=OptionalGetAllOptions.d.ts.map
@@ -0,0 +1 @@
{"name":"has-flag","version":"4.0.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532125225,"integrity":"sha512-/TELmRloOCqI8M0EkO5tsiwhmaATO2kmly7mIOG2LqRWBqEMgtDCwDZ+cy8mHZ8m97v8rnHW5yyA2Sc3Bsr+wQ==","mode":420,"size":696},"index.d.ts":{"checkedAt":1794532125225,"integrity":"sha512-ABvTGLTw6BbJ3tKAkdJWrn/307Dp/zsmI3Y3eFfggB5TtZ0+pDTC4DLNdG7RNcZVsUecr+XkRzx/uyJK429K6A==","mode":420,"size":684},"index.js":{"checkedAt":1794532125225,"integrity":"sha512-F0tdfsQQj5Kb/igBJQPvUKVugjo92BM9WLn1+hiHDQ+LiQ7bmrTWVOJ89s9lmgn/SwBe4e31v+GvvInye8TiwA==","mode":420,"size":330},"license":{"checkedAt":1794532125226,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"readme.md":{"checkedAt":1794532125226,"integrity":"sha512-AN63OKtj0IHTIDR1suGAggSkyEBVpH3uxCaGolTwVukTtnT5NCHSnREPOPRM7GjaxxGlzDSwsjUzgbFtn9gEXQ==","mode":420,"size":1600}}}
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/has-symbols
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,26 @@
{
"name": "motion-utils",
"version": "12.23.6",
"author": "Matt Perry",
"license": "MIT",
"repository": "https://github.com/motiondivision/motion",
"main": "./dist/cjs/index.js",
"types": "./dist/index.d.ts",
"module": "./dist/es/index.mjs",
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/cjs/index.js",
"import": "./dist/es/index.mjs",
"default": "./dist/cjs/index.js"
}
},
"scripts": {
"clean": "rm -rf types dist lib",
"build": "yarn clean && tsc -p . && rollup -c",
"dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"",
"test": "jest --config jest.config.json --max-workers=2"
},
"gitHead": "74a4413a8f545898109a0cf6aa4f763643972974"
}
@@ -0,0 +1,899 @@
import type {
AsyncThunk,
SerializedError,
ThunkDispatch,
UnknownAction,
} from '@reduxjs/toolkit'
import {
configureStore,
createAsyncThunk,
createReducer,
createSlice,
unwrapResult,
} from '@reduxjs/toolkit'
import type { TSVersion } from '@phryneas/ts-version'
import type { AxiosError } from 'axios'
import apiRequest from 'axios'
import type { AsyncThunkDispatchConfig } from '@internal/createAsyncThunk'
const defaultDispatch = (() => {}) as ThunkDispatch<{}, any, UnknownAction>
const unknownAction = { type: 'foo' } as UnknownAction
describe('type tests', () => {
test('basic usage', async () => {
const asyncThunk = createAsyncThunk('test', (id: number) =>
Promise.resolve(id * 2),
)
const reducer = createReducer({}, (builder) =>
builder
.addCase(asyncThunk.pending, (_, action) => {
expectTypeOf(action).toEqualTypeOf<
ReturnType<(typeof asyncThunk)['pending']>
>()
})
.addCase(asyncThunk.fulfilled, (_, action) => {
expectTypeOf(action).toEqualTypeOf<
ReturnType<(typeof asyncThunk)['fulfilled']>
>()
expectTypeOf(action.payload).toBeNumber()
})
.addCase(asyncThunk.rejected, (_, action) => {
expectTypeOf(action).toEqualTypeOf<
ReturnType<(typeof asyncThunk)['rejected']>
>()
expectTypeOf(action.error).toMatchTypeOf<Partial<Error> | undefined>()
}),
)
const promise = defaultDispatch(asyncThunk(3))
expectTypeOf(promise.requestId).toBeString()
expectTypeOf(promise.arg).toBeNumber()
expectTypeOf(promise.abort).toEqualTypeOf<(reason?: string) => void>()
const result = await promise
if (asyncThunk.fulfilled.match(result)) {
expectTypeOf(result).toEqualTypeOf<
ReturnType<(typeof asyncThunk)['fulfilled']>
>()
} else {
expectTypeOf(result).toEqualTypeOf<
ReturnType<(typeof asyncThunk)['rejected']>
>()
}
promise
.then(unwrapResult)
.then((result) => {
expectTypeOf(result).toBeNumber()
expectTypeOf(result).not.toMatchTypeOf<Error>()
})
.catch((error) => {
// catch is always any-typed, nothing we can do here
expectTypeOf(error).toBeAny()
})
})
test('More complex usage of thunk args', () => {
interface BookModel {
id: string
title: string
}
type BooksState = BookModel[]
const fakeBooks: BookModel[] = [
{ id: 'b', title: 'Second' },
{ id: 'a', title: 'First' },
]
const correctDispatch = (() => {}) as ThunkDispatch<
BookModel[],
{ userAPI: Function },
UnknownAction
>
// Verify that the the first type args to createAsyncThunk line up right
const fetchBooksTAC = createAsyncThunk<
BookModel[],
number,
{
state: BooksState
extra: { userAPI: Function }
}
>(
'books/fetch',
async (arg, { getState, dispatch, extra, requestId, signal }) => {
const state = getState()
expectTypeOf(arg).toBeNumber()
expectTypeOf(state).toEqualTypeOf<BookModel[]>()
expectTypeOf(extra).toEqualTypeOf<{ userAPI: Function }>()
return fakeBooks
},
)
correctDispatch(fetchBooksTAC(1))
// @ts-expect-error
defaultDispatch(fetchBooksTAC(1))
})
test('returning a rejected action from the promise creator is possible', async () => {
type ReturnValue = { data: 'success' }
type RejectValue = { data: 'error' }
const fetchBooksTAC = createAsyncThunk<
ReturnValue,
number,
{
rejectValue: RejectValue
}
>('books/fetch', async (arg, { rejectWithValue }) => {
return rejectWithValue({ data: 'error' })
})
const returned = await defaultDispatch(fetchBooksTAC(1))
if (fetchBooksTAC.rejected.match(returned)) {
expectTypeOf(returned.payload).toEqualTypeOf<undefined | RejectValue>()
expectTypeOf(returned.payload).toBeNullable()
} else {
expectTypeOf(returned.payload).toEqualTypeOf<ReturnValue>()
}
expectTypeOf(unwrapResult(returned)).toEqualTypeOf<ReturnValue>()
expectTypeOf(unwrapResult(returned)).not.toMatchTypeOf<RejectValue>()
})
test('regression #1156: union return values fall back to allowing only single member', () => {
const fn = createAsyncThunk('session/isAdmin', async () => {
const response: boolean = false
return response
})
})
test('Should handle reject with value within a try catch block. Note: this is a sample code taken from #1605', () => {
type ResultType = {
text: string
}
const demoPromise = async (): Promise<ResultType> =>
new Promise((resolve, _) => resolve({ text: '' }))
const thunk = createAsyncThunk('thunk', async (args, thunkAPI) => {
try {
const result = await demoPromise()
return result
} catch (error) {
return thunkAPI.rejectWithValue(error)
}
})
createReducer({}, (builder) =>
builder.addCase(thunk.fulfilled, (s, action) => {
expectTypeOf(action.payload).toEqualTypeOf<ResultType>()
}),
)
})
test('reject with value', () => {
interface Item {
name: string
}
interface ErrorFromServer {
error: string
}
interface CallsResponse {
data: Item[]
}
const fetchLiveCallsError = createAsyncThunk<
Item[],
string,
{
rejectValue: ErrorFromServer
}
>('calls/fetchLiveCalls', async (organizationId, { rejectWithValue }) => {
try {
const result = await apiRequest.get<CallsResponse>(
`organizations/${organizationId}/calls/live/iwill404`,
)
return result.data.data
} catch (err) {
const error: AxiosError<ErrorFromServer> = err as any // cast for access to AxiosError properties
if (!error.response) {
// let it be handled as any other unknown error
throw err
}
return rejectWithValue(error.response && error.response.data)
}
})
defaultDispatch(fetchLiveCallsError('asd')).then((result) => {
if (fetchLiveCallsError.fulfilled.match(result)) {
//success
expectTypeOf(result).toEqualTypeOf<
ReturnType<(typeof fetchLiveCallsError)['fulfilled']>
>()
expectTypeOf(result.payload).toEqualTypeOf<Item[]>()
} else {
expectTypeOf(result).toEqualTypeOf<
ReturnType<(typeof fetchLiveCallsError)['rejected']>
>()
if (result.payload) {
// rejected with value
expectTypeOf(result.payload).toEqualTypeOf<ErrorFromServer>()
} else {
// rejected by throw
expectTypeOf(result.payload).toBeUndefined()
expectTypeOf(result.error).toEqualTypeOf<SerializedError>()
expectTypeOf(result.error).not.toBeAny()
}
}
defaultDispatch(fetchLiveCallsError('asd'))
.then((result) => {
expectTypeOf(result.payload).toEqualTypeOf<
Item[] | ErrorFromServer | undefined
>()
return result
})
.then(unwrapResult)
.then((unwrapped) => {
expectTypeOf(unwrapped).toEqualTypeOf<Item[]>()
expectTypeOf(unwrapResult).parameter(0).not.toMatchTypeOf(unwrapped)
})
})
})
describe('payloadCreator first argument type has impact on asyncThunk argument', () => {
test('asyncThunk has no argument', () => {
const asyncThunk = createAsyncThunk('test', () => 0)
expectTypeOf(asyncThunk).toMatchTypeOf<() => any>()
expectTypeOf(asyncThunk).parameters.toEqualTypeOf<
[undefined?, AsyncThunkDispatchConfig?]
>()
expectTypeOf(asyncThunk).returns.toBeFunction()
})
test('one argument, specified as undefined: asyncThunk has no argument', () => {
const asyncThunk = createAsyncThunk('test', (arg: undefined) => 0)
expectTypeOf(asyncThunk).toMatchTypeOf<() => any>()
expectTypeOf(asyncThunk).parameters.toEqualTypeOf<
[undefined?, AsyncThunkDispatchConfig?]
>()
})
test('one argument, specified as void: asyncThunk has no argument', () => {
const asyncThunk = createAsyncThunk('test', (arg: void) => 0)
expectTypeOf(asyncThunk).toMatchTypeOf<() => any>()
})
test('one argument, specified as optional number: asyncThunk has optional number argument', () => {
// this test will fail with strictNullChecks: false, that is to be expected
// in that case, we have to forbid this behavior or it will make arguments optional everywhere
const asyncThunk = createAsyncThunk('test', (arg?: number) => 0)
// Per https://github.com/reduxjs/redux-toolkit/issues/3758#issuecomment-1742152774 , this is a bug in
// TS 5.1 and 5.2, that is fixed in 5.3. Conditionally run the TS assertion here.
type IsTS51Or52 = TSVersion.Major extends 5
? TSVersion.Minor extends 1 | 2
? true
: false
: false
type expectedType = IsTS51Or52 extends true
? (arg: number) => any
: (arg?: number) => any
expectTypeOf(asyncThunk).toMatchTypeOf<expectedType>()
// We _should_ be able to call this with no arguments, but we run into that error in 5.1 and 5.2.
// Disabling this for now.
// asyncThunk()
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameters.not.toMatchTypeOf<[string]>()
})
test('one argument, specified as number|undefined: asyncThunk has optional number argument', () => {
// this test will fail with strictNullChecks: false, that is to be expected
// in that case, we have to forbid this behavior or it will make arguments optional everywhere
const asyncThunk = createAsyncThunk(
'test',
(arg: number | undefined) => 0,
)
expectTypeOf(asyncThunk).toMatchTypeOf<(arg?: number) => any>()
expectTypeOf(asyncThunk).toBeCallableWith()
expectTypeOf(asyncThunk).toBeCallableWith(undefined)
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameters.not.toMatchTypeOf<[string]>()
})
test('one argument, specified as number|void: asyncThunk has optional number argument', () => {
const asyncThunk = createAsyncThunk('test', (arg: number | void) => 0)
expectTypeOf(asyncThunk).toMatchTypeOf<(arg?: number) => any>()
expectTypeOf(asyncThunk).toBeCallableWith()
expectTypeOf(asyncThunk).toBeCallableWith(undefined)
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameters.not.toMatchTypeOf<[string]>()
})
test('one argument, specified as any: asyncThunk has required any argument', () => {
const asyncThunk = createAsyncThunk('test', (arg: any) => 0)
expectTypeOf(asyncThunk).parameter(0).toBeAny()
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameters.not.toMatchTypeOf<[]>()
})
test('one argument, specified as unknown: asyncThunk has required unknown argument', () => {
const asyncThunk = createAsyncThunk('test', (arg: unknown) => 0)
expectTypeOf(asyncThunk).parameter(0).toBeUnknown()
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameters.not.toMatchTypeOf<[]>()
})
test('one argument, specified as number: asyncThunk has required number argument', () => {
const asyncThunk = createAsyncThunk('test', (arg: number) => 0)
expectTypeOf(asyncThunk).toMatchTypeOf<(arg: number) => any>()
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameters.not.toMatchTypeOf<[]>()
})
test('two arguments, first specified as undefined: asyncThunk has no argument', () => {
const asyncThunk = createAsyncThunk(
'test',
(arg: undefined, thunkApi) => 0,
)
expectTypeOf(asyncThunk).toMatchTypeOf<() => any>()
expectTypeOf(asyncThunk).toBeCallableWith()
expectTypeOf(asyncThunk).toBeCallableWith(undefined)
// cannot be called with an argument
expectTypeOf(asyncThunk).parameter(0).not.toBeAny()
expectTypeOf(asyncThunk).parameters.toEqualTypeOf<
[undefined?, AsyncThunkDispatchConfig?]
>()
})
test('two arguments, first specified as void: asyncThunk has no argument', () => {
const asyncThunk = createAsyncThunk('test', (arg: void, thunkApi) => 0)
expectTypeOf(asyncThunk).toMatchTypeOf<() => any>()
expectTypeOf(asyncThunk).toBeCallableWith()
expectTypeOf(asyncThunk).parameter(0).toBeVoid()
// cannot be called with an argument
expectTypeOf(asyncThunk).parameter(0).not.toBeAny()
expectTypeOf(asyncThunk).parameters.toEqualTypeOf<
[undefined?, AsyncThunkDispatchConfig?]
>()
})
test('two arguments, first specified as number|undefined: asyncThunk has optional number argument', () => {
// this test will fail with strictNullChecks: false, that is to be expected
// in that case, we have to forbid this behavior or it will make arguments optional everywhere
const asyncThunk = createAsyncThunk(
'test',
(arg: number | undefined, thunkApi) => 0,
)
expectTypeOf(asyncThunk).toMatchTypeOf<(arg?: number) => any>()
expectTypeOf(asyncThunk).toBeCallableWith()
expectTypeOf(asyncThunk).toBeCallableWith(undefined)
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameter(0).not.toBeString()
})
test('two arguments, first specified as number|void: asyncThunk has optional number argument', () => {
const asyncThunk = createAsyncThunk(
'test',
(arg: number | void, thunkApi) => 0,
)
expectTypeOf(asyncThunk).toMatchTypeOf<(arg?: number) => any>()
expectTypeOf(asyncThunk).toBeCallableWith()
expectTypeOf(asyncThunk).toBeCallableWith(undefined)
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameter(0).not.toBeString()
})
test('two arguments, first specified as any: asyncThunk has required any argument', () => {
const asyncThunk = createAsyncThunk('test', (arg: any, thunkApi) => 0)
expectTypeOf(asyncThunk).parameter(0).toBeAny()
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameters.not.toMatchTypeOf<[]>()
})
test('two arguments, first specified as unknown: asyncThunk has required unknown argument', () => {
const asyncThunk = createAsyncThunk('test', (arg: unknown, thunkApi) => 0)
expectTypeOf(asyncThunk).parameter(0).toBeUnknown()
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameters.not.toMatchTypeOf<[]>()
})
test('two arguments, first specified as number: asyncThunk has required number argument', () => {
const asyncThunk = createAsyncThunk('test', (arg: number, thunkApi) => 0)
expectTypeOf(asyncThunk).toMatchTypeOf<(arg: number) => any>()
expectTypeOf(asyncThunk).parameter(0).toBeNumber()
expectTypeOf(asyncThunk).toBeCallableWith(5)
expectTypeOf(asyncThunk).parameters.not.toMatchTypeOf<[]>()
})
})
test('createAsyncThunk without generics', () => {
const thunk = createAsyncThunk('test', () => {
return 'ret' as const
})
expectTypeOf(thunk).toEqualTypeOf<AsyncThunk<'ret', void, {}>>()
})
test('createAsyncThunk without generics, accessing `api` does not break return type', () => {
const thunk = createAsyncThunk('test', (_: void, api) => {
return 'ret' as const
})
expectTypeOf(thunk).toEqualTypeOf<AsyncThunk<'ret', void, {}>>()
})
test('createAsyncThunk rejectWithValue without generics: Expect correct return type', () => {
const asyncThunk = createAsyncThunk(
'test',
(_: void, { rejectWithValue }) => {
try {
return Promise.resolve(true)
} catch (e) {
return rejectWithValue(e)
}
},
)
defaultDispatch(asyncThunk())
.then((result) => {
if (asyncThunk.fulfilled.match(result)) {
expectTypeOf(result).toEqualTypeOf<
ReturnType<(typeof asyncThunk)['fulfilled']>
>()
expectTypeOf(result.payload).toBeBoolean()
expectTypeOf(result).not.toHaveProperty('error')
} else {
expectTypeOf(result).toEqualTypeOf<
ReturnType<(typeof asyncThunk)['rejected']>
>()
expectTypeOf(result.error).toEqualTypeOf<SerializedError>()
expectTypeOf(result.payload).toBeUnknown()
}
return result
})
.then(unwrapResult)
.then((unwrapped) => {
expectTypeOf(unwrapped).toBeBoolean()
})
})
test('createAsyncThunk with generics', () => {
type Funky = { somethingElse: 'Funky!' }
function funkySerializeError(err: any): Funky {
return { somethingElse: 'Funky!' }
}
// has to stay on one line or type tests fail in older TS versions
// prettier-ignore
// @ts-expect-error
const shouldFail = createAsyncThunk('without generics', () => {}, { serializeError: funkySerializeError })
const shouldWork = createAsyncThunk<
any,
void,
{ serializedErrorType: Funky }
>('with generics', () => {}, {
serializeError: funkySerializeError,
})
if (shouldWork.rejected.match(unknownAction)) {
expectTypeOf(unknownAction.error).toEqualTypeOf<Funky>()
}
})
test('`idGenerator` option takes no arguments, and returns a string', () => {
const returnsNumWithArgs = (foo: any) => 100
// has to stay on one line or type tests fail in older TS versions
// prettier-ignore
// @ts-expect-error
const shouldFailNumWithArgs = createAsyncThunk('foo', () => {}, { idGenerator: returnsNumWithArgs })
const returnsNumWithoutArgs = () => 100
// prettier-ignore
// @ts-expect-error
const shouldFailNumWithoutArgs = createAsyncThunk('foo', () => {}, { idGenerator: returnsNumWithoutArgs })
const returnsStrWithNumberArg = (foo: number) => 'foo'
// prettier-ignore
// @ts-expect-error
const shouldFailWrongArgs = createAsyncThunk('foo', (arg: string) => {}, { idGenerator: returnsStrWithNumberArg })
const returnsStrWithStringArg = (foo: string) => 'foo'
const shoulducceedCorrectArgs = createAsyncThunk(
'foo',
(arg: string) => {},
{
idGenerator: returnsStrWithStringArg,
},
)
const returnsStrWithoutArgs = () => 'foo'
const shouldSucceed = createAsyncThunk('foo', () => {}, {
idGenerator: returnsStrWithoutArgs,
})
})
test('fulfillWithValue should infer return value', () => {
// https://github.com/reduxjs/redux-toolkit/issues/2886
const initialState = {
loading: false,
obj: { magic: '' },
}
const getObj = createAsyncThunk(
'slice/getObj',
async (_: any, { fulfillWithValue, rejectWithValue }) => {
try {
return fulfillWithValue({ magic: 'object' })
} catch (rejected: any) {
return rejectWithValue(rejected?.response?.error || rejected)
}
},
)
createSlice({
name: 'slice',
initialState,
reducers: {},
extraReducers: (builder) => {
builder.addCase(getObj.fulfilled, (state, action) => {
expectTypeOf(action.payload).toEqualTypeOf<{ magic: string }>()
})
},
})
})
test('meta return values', () => {
// return values
createAsyncThunk<'ret', void, {}>('test', (_, api) => 'ret' as const)
createAsyncThunk<'ret', void, {}>('test', async (_, api) => 'ret' as const)
createAsyncThunk<'ret', void, { fulfilledMeta: string }>('test', (_, api) =>
api.fulfillWithValue('ret' as const, ''),
)
createAsyncThunk<'ret', void, { fulfilledMeta: string }>(
'test',
async (_, api) => api.fulfillWithValue('ret' as const, ''),
)
createAsyncThunk<'ret', void, { fulfilledMeta: string }>(
'test',
// @ts-expect-error has to be a fulfilledWithValue call
(_, api) => 'ret' as const,
)
createAsyncThunk<'ret', void, { fulfilledMeta: string }>(
'test',
// @ts-expect-error has to be a fulfilledWithValue call
async (_, api) => 'ret' as const,
)
createAsyncThunk<'ret', void, { fulfilledMeta: string }>(
'test', // @ts-expect-error should only allow returning with 'test'
(_, api) => api.fulfillWithValue(5, ''),
)
createAsyncThunk<'ret', void, { fulfilledMeta: string }>(
'test', // @ts-expect-error should only allow returning with 'test'
async (_, api) => api.fulfillWithValue(5, ''),
)
// reject values
createAsyncThunk<'ret', void, { rejectValue: string }>('test', (_, api) =>
api.rejectWithValue('ret'),
)
createAsyncThunk<'ret', void, { rejectValue: string }>(
'test',
async (_, api) => api.rejectWithValue('ret'),
)
createAsyncThunk<
'ret',
void,
{ rejectValue: string; rejectedMeta: number }
>('test', (_, api) => api.rejectWithValue('ret', 5))
createAsyncThunk<
'ret',
void,
{ rejectValue: string; rejectedMeta: number }
>('test', async (_, api) => api.rejectWithValue('ret', 5))
createAsyncThunk<
'ret',
void,
{ rejectValue: string; rejectedMeta: number }
>('test', (_, api) => api.rejectWithValue('ret', 5))
createAsyncThunk<
'ret',
void,
{ rejectValue: string; rejectedMeta: number }
>(
'test',
// @ts-expect-error wrong rejectedMeta type
(_, api) => api.rejectWithValue('ret', ''),
)
createAsyncThunk<
'ret',
void,
{ rejectValue: string; rejectedMeta: number }
>(
'test',
// @ts-expect-error wrong rejectedMeta type
async (_, api) => api.rejectWithValue('ret', ''),
)
createAsyncThunk<
'ret',
void,
{ rejectValue: string; rejectedMeta: number }
>(
'test',
// @ts-expect-error wrong rejectValue type
(_, api) => api.rejectWithValue(5, ''),
)
createAsyncThunk<
'ret',
void,
{ rejectValue: string; rejectedMeta: number }
>(
'test',
// @ts-expect-error wrong rejectValue type
async (_, api) => api.rejectWithValue(5, ''),
)
})
test('usage with config override generic', () => {
const typedCAT = createAsyncThunk.withTypes<{
state: RootState
dispatch: AppDispatch
rejectValue: string
extra: { s: string; n: number }
}>()
// inferred usage
const thunk = typedCAT('foo', (arg: number, api) => {
// correct getState Type
const test1: number = api.getState().foo.value
// correct dispatch type
const test2: number = api.dispatch((dispatch, getState) => {
expectTypeOf(dispatch).toEqualTypeOf<
ThunkDispatch<{ foo: { value: number } }, undefined, UnknownAction>
>()
expectTypeOf(getState).toEqualTypeOf<() => { foo: { value: number } }>()
return getState().foo.value
})
// correct extra type
const { s, n } = api.extra
expectTypeOf(s).toBeString()
expectTypeOf(n).toBeNumber()
if (1 < 2)
// @ts-expect-error
return api.rejectWithValue(5)
if (1 < 2) return api.rejectWithValue('test')
return test1 + test2
})
// usage with two generics
const thunk2 = typedCAT<number, string>('foo', (arg, api) => {
expectTypeOf(arg).toBeString()
// correct getState Type
const test1: number = api.getState().foo.value
// correct dispatch type
const test2: number = api.dispatch((dispatch, getState) => {
expectTypeOf(dispatch).toEqualTypeOf<
ThunkDispatch<{ foo: { value: number } }, undefined, UnknownAction>
>()
expectTypeOf(getState).toEqualTypeOf<() => { foo: { value: number } }>()
return getState().foo.value
})
// correct extra type
const { s, n } = api.extra
expectTypeOf(s).toBeString()
expectTypeOf(n).toBeNumber()
if (1 < 2) expectTypeOf(api.rejectWithValue).toBeCallableWith('test')
expectTypeOf(api.rejectWithValue).parameter(0).not.toBeNumber()
expectTypeOf(api.rejectWithValue).parameters.toEqualTypeOf<[string]>()
return api.rejectWithValue('test')
})
// usage with config override generic
const thunk3 = typedCAT<number, string, { rejectValue: number }>(
'foo',
(arg, api) => {
expectTypeOf(arg).toBeString()
// correct getState Type
const test1: number = api.getState().foo.value
// correct dispatch type
const test2: number = api.dispatch((dispatch, getState) => {
expectTypeOf(dispatch).toEqualTypeOf<
ThunkDispatch<{ foo: { value: number } }, undefined, UnknownAction>
>()
expectTypeOf(getState).toEqualTypeOf<
() => { foo: { value: number } }
>()
return getState().foo.value
})
// correct extra type
const { s, n } = api.extra
expectTypeOf(s).toBeString()
expectTypeOf(n).toBeNumber()
if (1 < 2) return api.rejectWithValue(5)
if (1 < 2) expectTypeOf(api.rejectWithValue).toBeCallableWith(5)
expectTypeOf(api.rejectWithValue).parameter(0).not.toBeString()
expectTypeOf(api.rejectWithValue).parameters.toEqualTypeOf<[number]>()
return api.rejectWithValue(5)
},
)
const slice = createSlice({
name: 'foo',
initialState: { value: 0 },
reducers: {},
extraReducers(builder) {
builder
.addCase(thunk.fulfilled, (state, action) => {
state.value += action.payload
})
.addCase(thunk.rejected, (state, action) => {
expectTypeOf(action.payload).toEqualTypeOf<string | undefined>()
})
.addCase(thunk2.fulfilled, (state, action) => {
state.value += action.payload
})
.addCase(thunk2.rejected, (state, action) => {
expectTypeOf(action.payload).toEqualTypeOf<string | undefined>()
})
.addCase(thunk3.fulfilled, (state, action) => {
state.value += action.payload
})
.addCase(thunk3.rejected, (state, action) => {
expectTypeOf(action.payload).toEqualTypeOf<number | undefined>()
})
},
})
const store = configureStore({
reducer: {
foo: slice.reducer,
},
})
type RootState = ReturnType<typeof store.getState>
type AppDispatch = typeof store.dispatch
})
test('rejectedMeta', async () => {
const getNewStore = () =>
configureStore({
reducer(actions = [], action) {
return [...actions, action]
},
})
const store = getNewStore()
const fulfilledThunk = createAsyncThunk<
string,
string,
{ rejectedMeta: { extraProp: string } }
>('test', (arg: string, { rejectWithValue }) => {
return rejectWithValue('damn!', { extraProp: 'baz' })
})
const promise = store.dispatch(fulfilledThunk('testArg'))
const ret = await promise
if (ret.meta.requestStatus === 'rejected' && ret.meta.rejectedWithValue) {
expectTypeOf(ret.meta.extraProp).toBeString()
} else {
// could be caused by a `throw`, `abort()` or `condition` - no `rejectedMeta` in that case
expectTypeOf(ret.meta).not.toHaveProperty('extraProp')
}
})
})
@@ -0,0 +1 @@
{"name":"@inversifyjs/prototype-utils","version":"0.1.3","requiresBuild":false,"files":{"lib/cjs/prototype/calculations/findInPrototypeChain.js":{"checkedAt":1794532100662,"integrity":"sha512-Cdo3KQIgdzdFKmc4+W7svE9w8b/EiQPpKSDolX93j0K3jqfUQ7SQAy8TrpzmzFK652TkObldeOcowSKQ9RcLZg==","mode":420,"size":537},"lib/cjs/prototype/calculations/getBaseType.js":{"checkedAt":1794532100662,"integrity":"sha512-zjR9qafsktG1GjlQPFBu3PdLq8KeI4WTzomfHY1TRUhAWQF+HE4bPSeOizHj1SLssEFLn+pYC4WjCbNdKRxDcA==","mode":420,"size":309},"lib/cjs/index.js":{"checkedAt":1794532100662,"integrity":"sha512-AWEjU0i3EU1kIwvegYn0VsOGbJaJadDpHprt68ly4RGjfaG4gXclNDfXhgy2AmUZZEOk+cKfsgQUBHT++COyyw==","mode":420,"size":608},"lib/esm/index.js":{"checkedAt":1794532100663,"integrity":"sha512-2pI+7iGuPfZFBa9ZNe+Vufcw/6P2JwIhW7wwH5X1zJMAjsyrev17PV6ZrZMBNmi3cm+pHVAFMRkw9Q1drEyNuQ==","mode":420,"size":253},"lib/cjs/prototype/models/Prototype.js":{"checkedAt":1794532100663,"integrity":"sha512-D9SBcaqUK3CAFNtQ2VwPlh2/w/xQGfRtFETzMCnC5s/Q/XiVzaDBONyYYD1gchE2LqocGsXDb/9FwjQ1Mzwd+A==","mode":420,"size":114},"lib/cjs/package.json":{"checkedAt":1794532100663,"integrity":"sha512-8U1e2/m1/MZLAABugPPCT7pT1gQsJ0emvlef4tzYwWdTJIrY6/1Ks6sAUDIRPeWx9i1UbwxIXcxgesvNgTTtuA==","mode":420,"size":24},"lib/esm/package.json":{"checkedAt":1794532100663,"integrity":"sha512-0/qKvY+e4vDrutI/Gs9dbxgY8+4bWMP+lwjtUzPoWNp8Btq/+DNRn4Fl+lNX+8ULTmX/HqaMXapHD6wIA6VgiQ==","mode":420,"size":22},"package.json":{"checkedAt":1794532100663,"integrity":"sha512-QNuO74TKoG5HKKiXg/57fP5qO2FuiFZ7JHGGoABQPJWzFujegqfwPWxi2Wg9dTGuiCMP2mvMycJwwEnfRCRN1A==","mode":420,"size":1942},"lib/cjs/prototype/calculations/findInPrototypeChain.d.ts.map":{"checkedAt":1794532100664,"integrity":"sha512-WEcPMox+z5wnq/US90XK4OpSqc0G/PktmVMzPYTw++jeuZY3/og3MsgNhInXvq6byEfwhg9VSzMtdPCoeDo1sg==","mode":420,"size":344},"lib/cjs/prototype/calculations/findInPrototypeChain.js.map":{"checkedAt":1794532100664,"integrity":"sha512-uE04yg6Gr2Vz3tYKcWH4ABojFjWAlNxFiKVvvqlB3BM0i+Z67E7810239UoARxADm/UrE5Fw+gR/p6Qaf1ziSg==","mode":420,"size":491},"lib/cjs/prototype/calculations/findInPrototypeChain.spec.d.ts.map":{"checkedAt":1794532100664,"integrity":"sha512-pmYslMb7lb/q3a8D6ActlTcPeyw6Dj0uDSqGCDOiacfumf6A7H5IJiP50v0qwLp+ulIKojkbrODLWpa3Sc5jTA==","mode":420,"size":176},"lib/cjs/prototype/calculations/getBaseType.d.ts.map":{"checkedAt":1794532100664,"integrity":"sha512-ITgnBbpsxsd0RJ/WF4YcENw0DsrXL82xar8NVkfGS+bRtdgXdpbjOdgq55UAO4mmyJ06D0o8Xk5oieFTc9VMxQ==","mode":420,"size":315},"lib/cjs/prototype/calculations/getBaseType.js.map":{"checkedAt":1794532100664,"integrity":"sha512-KDH7tZ5vsy4yluJ4OM1lpQA10wuL9fjnfYPPV9JO3ehO2iVjvBtGaCXUCXkW22c5fKXGHEpGfnVvRjPADcRLUQ==","mode":420,"size":328},"lib/cjs/prototype/calculations/getBaseType.spec.d.ts.map":{"checkedAt":1794532100664,"integrity":"sha512-itKEbqkw6EF2M4+3pHxwe7chSvl1jgLr4RFs2dhA6g94pDXckk7a2pFabvVCpFsQQb1YNKHEh2S3oY03aEf3Dg==","mode":420,"size":158},"lib/cjs/index.d.ts.map":{"checkedAt":1794532100664,"integrity":"sha512-k1IqnNdNZ6lzvUpNqoOCa01PrMs+aKrL3p8irGKfCgoozDw0uWAEfKFfTRIFoucfzZyDK6wKLxSmZvrGc69kug==","mode":420,"size":310},"lib/esm/index.d.ts.map":{"checkedAt":1794532100664,"integrity":"sha512-k1IqnNdNZ6lzvUpNqoOCa01PrMs+aKrL3p8irGKfCgoozDw0uWAEfKFfTRIFoucfzZyDK6wKLxSmZvrGc69kug==","mode":420,"size":310},"lib/cjs/index.js.map":{"checkedAt":1794532100665,"integrity":"sha512-tec0IwUjmypp4WQogiDupNRisO9WJ51NQ6hYOt77t+BpSuQ+M9IMvHtfAHzdOLZwJyVBcCVo9LzNUKvKP4nUmg==","mode":420,"size":181},"lib/esm/index.js.map":{"checkedAt":1794532100665,"integrity":"sha512-GmEGcbpH/GQ7MGm3A8IMzhY80lDyIFdQhRM2dWKf7y5mRG7W5iwP/n49OTpAwjiNM6qALJX0llGdKfidO5zI8g==","mode":420,"size":591},"lib/cjs/prototype/models/Prototype.d.ts.map":{"checkedAt":1794532100665,"integrity":"sha512-uwNSkE+2qhC0N4Mz+4ftL/m8B1Qk1fZ/CcEUAjRC6qRvEQxl0LkPgMD5PUDMl0PecGhFbg7qT3Y2PyhvUMJQzQ==","mode":420,"size":232},"lib/cjs/prototype/models/Prototype.js.map":{"checkedAt":1794532100665,"integrity":"sha512-Wt6IYBl/9Agkx5dZr7L03EYDKeYgRvcCXnfFi30LOmPBG+DdPzgMt+cmkpfYBnoLau7axZnxzOyarQ5Gsdyvtg==","mode":420,"size":136},"CHANGELOG.md":{"checkedAt":1794532100665,"integrity":"sha512-0uzq5/wY3SXjYWzX/ULiSZPPLs+kMhFZOc118jbmU6l0NMTXqg1PigrqciYuFsvfmrb1wSMOViHOIN5Mz5oWAQ==","mode":420,"size":424},"README.md":{"checkedAt":1794532100665,"integrity":"sha512-imcRhkFND29oyYboUFtcqQg6z7gVZG+ZgQkhv0+XaufUlig7DACP5poUb+Uys/BAAvfePPpWUNy9uYPK912qFQ==","mode":420,"size":542},"lib/cjs/prototype/calculations/findInPrototypeChain.d.ts":{"checkedAt":1794532100666,"integrity":"sha512-w1D0JR9VlLoikas0EojAyR1BaMm6Jyvs/fX51j5beskbXWvZjiQhUuMlsoFcDFdGX73iz+SKb/Wcim6fK9YYvw==","mode":420,"size":223},"lib/cjs/prototype/calculations/findInPrototypeChain.spec.d.ts":{"checkedAt":1794532100666,"integrity":"sha512-36NXdbBInMxc8ts+/GDncoQWCoT624NN+Uu8vWnWCwlaGoPLd2BX6jri0Ys6D30BO3PC5cvWmHdhrwlbMfjhPw==","mode":420,"size":66},"lib/cjs/prototype/calculations/getBaseType.d.ts":{"checkedAt":1794532100666,"integrity":"sha512-WFODBhG2EreLw/zb8ws7ro3XbdalCFCjVBmctUPLine truncated
@@ -0,0 +1,11 @@
export * from './controller';
export * from './errors';
export * from './events';
export * from './fieldArray';
export * from './fields';
export * from './form';
export * from './path';
export * from './resolvers';
export * from './utils';
export * from './validator';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,20 @@
'use strict';
var implementation = require('../implementation');
var callBind = require('call-bind');
var test = require('tape');
var hasStrictMode = require('has-strict-mode')();
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad array/this value', { skip: !hasStrictMode }, function (st) {
/* eslint no-useless-call: 0 */
st['throws'](function () { implementation.call(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { implementation.call(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(callBind(implementation, Object), t);
t.end();
});
@@ -0,0 +1,24 @@
import { Test } from '@vitest/runner';
import { ChainableFunction } from '@vitest/runner/utils';
import { TaskResult, Bench, Options } from 'tinybench';
interface Benchmark extends Test {
meta: {
benchmark: true;
result?: TaskResult;
};
}
interface BenchmarkResult extends TaskResult {
name: string;
rank: number;
sampleCount: number;
median: number;
}
type BenchFunction = (this: Bench) => Promise<void> | void;
type ChainableBenchmarkAPI = ChainableFunction<"skip" | "only" | "todo", (name: string | Function, fn?: BenchFunction, options?: Options) => void>;
type BenchmarkAPI = ChainableBenchmarkAPI & {
skipIf: (condition: any) => ChainableBenchmarkAPI;
runIf: (condition: any) => ChainableBenchmarkAPI;
};
export type { BenchmarkResult as B, BenchFunction as a, Benchmark as b, BenchmarkAPI as c };
@@ -0,0 +1,22 @@
import {
absoluteFullClasses,
baseStyles,
collapseAdjacentVariantBorders,
dataFocusVisibleClasses,
focusVisibleClasses,
groupDataFocusVisibleClasses,
hiddenInputClasses,
ringClasses,
translateCenterClasses
} from "../chunk-GH5E4FQB.mjs";
export {
absoluteFullClasses,
baseStyles,
collapseAdjacentVariantBorders,
dataFocusVisibleClasses,
focusVisibleClasses,
groupDataFocusVisibleClasses,
hiddenInputClasses,
ringClasses,
translateCenterClasses
};
@@ -0,0 +1,69 @@
'use strict';
const isHyper = typeof process !== 'undefined' && process.env.TERM_PROGRAM === 'Hyper';
const isWindows = typeof process !== 'undefined' && process.platform === 'win32';
const isLinux = typeof process !== 'undefined' && process.platform === 'linux';
const common = {
ballotDisabled: '☒',
ballotOff: '☐',
ballotOn: '☑',
bullet: '•',
bulletWhite: '◦',
fullBlock: '█',
heart: '❤',
identicalTo: '≡',
line: '─',
mark: '※',
middot: '·',
minus: '-',
multiplication: '×',
obelus: '÷',
pencilDownRight: '✎',
pencilRight: '✏',
pencilUpRight: '✐',
percent: '%',
pilcrow2: '❡',
pilcrow: '¶',
plusMinus: '±',
question: '?',
section: '§',
starsOff: '☆',
starsOn: '★',
upDownArrow: '↕'
};
const windows = Object.assign({}, common, {
check: '√',
cross: '×',
ellipsisLarge: '...',
ellipsis: '...',
info: 'i',
questionSmall: '?',
pointer: '>',
pointerSmall: '»',
radioOff: '( )',
radioOn: '(*)',
warning: '‼'
});
const other = Object.assign({}, common, {
ballotCross: '✘',
check: '✔',
cross: '✖',
ellipsisLarge: '⋯',
ellipsis: '…',
info: 'ℹ',
questionFull: '?',
questionSmall: '﹖',
pointer: isLinux ? '▸' : '❯',
pointerSmall: isLinux ? '‣' : '›',
radioOff: '◯',
radioOn: '◉',
warning: '⚠'
});
module.exports = (isWindows && !isHyper) ? windows : other;
Reflect.defineProperty(module.exports, 'common', { enumerable: false, value: common });
Reflect.defineProperty(module.exports, 'windows', { enumerable: false, value: windows });
Reflect.defineProperty(module.exports, 'other', { enumerable: false, value: other });
@@ -0,0 +1,26 @@
/**
* Add support for serializing to markdown.
*
* @param {Readonly<Options> | null | undefined} [options]
* Configuration (optional).
* @returns {undefined}
* Nothing.
*/
export default function remarkStringify(options?: Readonly<Options> | null | undefined): undefined;
export default class remarkStringify {
/**
* Add support for serializing to markdown.
*
* @param {Readonly<Options> | null | undefined} [options]
* Configuration (optional).
* @returns {undefined}
* Nothing.
*/
constructor(options?: Readonly<Options> | null | undefined);
compiler: (tree: import("mdast").Root, file: import("vfile").VFile) => string;
}
export type Root = import('mdast').Root;
export type ToMarkdownOptions = import('mdast-util-to-markdown').Options;
export type Compiler = import('unified').Compiler<Root, string>;
export type Processor = import('unified').Processor<undefined, undefined, undefined, Root, string>;
export type Options = Omit<ToMarkdownOptions, 'extensions'>;
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,mCAAK,CAAC;AACtC","sources":["packages/@react-aria/overlays/intl/ar-AE.json"],"sourcesContent":["{\n \"dismiss\": \"تجاهل\"\n}\n"],"names":[],"version":3,"file":"ar-AE.main.js.map"}
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var docErrataRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {
'aria-disabled': null,
'aria-errormessage': null,
'aria-expanded': null,
'aria-haspopup': null,
'aria-invalid': null
},
relatedConcepts: [{
concept: {
name: 'errata [EPUB-SSV]'
},
module: 'EPUB'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section', 'landmark']]
};
var _default = exports.default = docErrataRole;
@@ -0,0 +1,21 @@
"use strict";
exports.__esModule = true;
exports["default"] = stripComments;
function stripComments(str) {
var s = "";
var commentStart = str.indexOf("/*");
var lastEnd = 0;
while (commentStart >= 0) {
s = s + str.slice(lastEnd, commentStart);
var commentEnd = str.indexOf("*/", commentStart + 2);
if (commentEnd < 0) {
return s;
}
lastEnd = commentEnd + 2;
commentStart = str.indexOf("/*", lastEnd);
}
s = s + str.slice(lastEnd);
return s;
}
module.exports = exports.default;
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _skipFirstGeneratorNext;
function _skipFirstGeneratorNext(fn) {
return function () {
var it = fn.apply(this, arguments);
it.next();
return it;
};
}
//# sourceMappingURL=skipFirstGeneratorNext.js.map
@@ -0,0 +1 @@
{"name":"vitest","version":"4.0.9","requiresBuild":false,"files":{"dist/config.cjs":{"checkedAt":1794532091720,"integrity":"sha512-fEH2dH3yTZ9f+84ipXkK53smw+LIBLJMnevdj+QSCOiLCBwGIiutzBvdTPKe08VzG9H0+frm6Tj8OthXVy61Vg==","mode":420,"size":2642},"index.cjs":{"checkedAt":1794532091720,"integrity":"sha512-c6iCX6Wz7ZxzQRL76FM2Vh/Opcapd3ojVTZRsXINqZWwf9bKzcAJ6TEw1kZtLEJYsysMiGZ7IKbo1/9TDxHUPw==","mode":420,"size":412},"suppress-warnings.cjs":{"checkedAt":1794532091720,"integrity":"sha512-fO/u629XXw5SdppNYCY7Dl91rV6Dkkkx2IabBeUx1p6Q4Gs3qa9ljAPf+GXfElEVbpfLCllhC67tY4RxLCenNw==","mode":420,"size":780},"index.d.cts":{"checkedAt":1794532091720,"integrity":"sha512-oNAszGxOg1F9LzKbGzfE75pTdTxTZBL4+N3rBF4vSljaaS19M6LRyjPbYAoyrW4oa0Zfk/PZMSxGUL7FyTP1NQ==","mode":420,"size":32},"dist/chunks/_commonjsHelpers.BFTU3MAI.js":{"checkedAt":1794532091720,"integrity":"sha512-Ykq5GGMt8M1Ax0h1gBGy7Dcgjl6fbzQXfl8MtiD98qelPO+c9HH8IQhpP5W30IUuhSwBi2Kttpx/tudlavKpGA==","mode":420,"size":398},"dist/chunks/base.CiIV2DDC.js":{"checkedAt":1794532091720,"integrity":"sha512-Hsj/08IKO3u/UVKyKLjt9oXR75KKoUSuzsmS6Dq3ACKedTgc0VArI/qa+REOBcjBIWu/roBasQbITVgugX4JKA==","mode":420,"size":6282},"dist/chunks/benchmark.B3N2zMcH.js":{"checkedAt":1794532091720,"integrity":"sha512-CD0PyXl/QTWAqCVH1PjFEl8B9YFg3KMd4FN1ZZW/y6PJvP83birLd4AUzPEKQIRQD3U5pQxcVA4YXi6YIgfOIQ==","mode":420,"size":1433},"dist/browser.js":{"checkedAt":1794532091721,"integrity":"sha512-KasXUQ8a4AxTiH3XQEkzJ7vGbgZ0A9C9MyMGchUbYOqcFDTR8nYiaD9g9VKdNuHBd05vBTM7A+x9qUaJzcD6Gg==","mode":420,"size":884},"dist/chunks/cac.B_NTJoIH.js":{"checkedAt":1794532091721,"integrity":"sha512-8hWeZ/G/r2UgyGh3awt7e0fQc3D3D5Staokh459pm7hlWtFvr4BoEMbF7luz0+x3ccWD73kIDcwcH1DnKnfWAQ==","mode":420,"size":50853},"dist/chunks/cli-api.D48wY175.js":{"checkedAt":1794532091722,"integrity":"sha512-zHgdBELOH28tYE+6kNfly7VdnPWPK+lMOTmbpN1Kjd5iZAOHArN0WDc+xK1/FCJqaqXEfeB/zQFsi3DfrCtvJA==","mode":420,"size":414268},"dist/cli.js":{"checkedAt":1794532091722,"integrity":"sha512-lx42iPeU17MPXskDLLheIpYa6SGUCiFkl7zMO2klEsN/S8P84g60jDntx9jedVcgetWNUuO6pZS0CzBVTwNJSQ==","mode":420,"size":697},"dist/config.js":{"checkedAt":1794532091722,"integrity":"sha512-8BJAMAi+0dINlEKCkNA9SIzRRDsdtrjlzpU7kV/WllOHKr96xORWRCTlhtqZxkClAfMOEhrGC5EdP+b8tZOoJw==","mode":420,"size":464},"dist/chunks/console.Cf-YriPC.js":{"checkedAt":1794532091722,"integrity":"sha512-x/WZoSpMKM/U3D7CWtzsJ8mdWF+NebkS2hZQDsFIxmkSxinIkpX1qJSrCcKh1rI7z+NbCPiG4uTY2PDozr8TnA==","mode":420,"size":4768},"dist/chunks/constants.D_Q9UYh-.js":{"checkedAt":1794532091722,"integrity":"sha512-59+/13OmJYWDBAQa0Cd8ExOKtYuMI7B1XsyXe0BIWy1pXImUK90cdE8ZzYlg6fq6jt3MUbjaYYSlzUuJcbkeBw==","mode":420,"size":771},"browser/context.js":{"checkedAt":1794532091723,"integrity":"sha512-sEC5s9wFj9Aebwcu1+SSHK7+2+EwScEf57vKsD9UNKqm0iyZKzyuDij1iBlM14SaoCEI87RFN/z9VrvrGzysEA==","mode":420,"size":667},"dist/chunks/coverage.BUlIqJrL.js":{"checkedAt":1794532091723,"integrity":"sha512-aP44AU8x4Eo3epK05HZSXMhbtuRWq1UJcBE2Juld90Y9ON6VtFByu9qJrgVr6GoDUj9nYhHOl0f4b91OF8Z/dA==","mode":420,"size":106504},"dist/chunks/coverage.D_JHT54q.js":{"checkedAt":1794532091723,"integrity":"sha512-oqD7SnhfNwnfTctdKfllSvpjjFmGwlGAxOQFzoQvE9CDQ1ID9X/KHlSAlPqGw6JHU9jqnaxuw+zpEWhSuL4gKA==","mode":420,"size":1191},"dist/coverage.js":{"checkedAt":1794532091723,"integrity":"sha512-uQfOA8Y98jm3SL+GoDsqlaPXuXjVgCdjXyNOFuZlU9y/Ek/suyEKdtJvonlqAAkPy2kPptHH2+qtR/qWNH9x7w==","mode":420,"size":604},"dist/chunks/creator.BzqvXeRE.js":{"checkedAt":1794532091723,"integrity":"sha512-uYdDsRyJ4V84ry/5lvmku6ySB6Gq+TLPYBimQow0bjcn7aNCg71lEP6Zojid7Cm/jU1tCGxMPFQ4U8Cw1j62Jw==","mode":420,"size":18616},"dist/chunks/date.Bq6ZW5rf.js":{"checkedAt":1794532091723,"integrity":"sha512-2UlXPN9v2tY4eRWvIXgeqbwShY2WVfjgXjhYSxhNNgn+cNPyqqBCL6IG7WMedPLxVkTBHHR3ujy8J3jmmwDRag==","mode":420,"size":2364},"dist/chunks/defaults.BOqNVLsY.js":{"checkedAt":1794532091723,"integrity":"sha512-Yo4Py5gfuCMpfeqZUYs1qXo8l1pRMfCg908w6s/nYcZrpwR2FNlnGeyshxmOaEgxu1PDWr0xJkMigWXrXBR5kQ==","mode":420,"size":2018},"dist/chunks/env.D4Lgay0q.js":{"checkedAt":1794532091724,"integrity":"sha512-1PAwwXtoDMCzEfPD+bt36NxYypR2InpYqPHqSwK45oWQnRbstLGeJtodVlO5sOHxbljIgeIp/3b8vIeUSh4/MQ==","mode":420,"size":433},"dist/environments.js":{"checkedAt":1794532091724,"integrity":"sha512-Mu17NPlDtIzFu5V+nopED3/eAN1saJTdkRCk8kx+2c1e2IM1efDe/WIkXMDyEubPhaQOqwwBRK5vnzyUC/W+1w==","mode":420,"size":134},"dist/chunks/evaluatedModules.Dg1zASAC.js":{"checkedAt":1794532091724,"integrity":"sha512-3ZGFEXLgxqAP2NvSouJEsBD/BKRcgjUmZYgWrI/bNa1utGsoEPPAd97vnM8/MCvc87H+Nc8tDumoIJSK9U3E9g==","mode":420,"size":523},"dist/workers/forks.js":{"checkedAt":1794532091724,"integrity":"sha512-MuPs8q9yZs3T5/vyc/jwUseuB0WpO3llTXmkNPHs9h4P1DmQBRajG+DdypSKdo0OpDk5Ztb3lB90uglPMHeZCg==","mode":420,"size":1653},"dist/chunks/git.Bm2pzPAa.js":{"checkedAt":1794532091724,"integrity":"sha512-FlvhxtgdmPRXCPjhUOl1CPPDDZLXcy7+ZcL2G+jXNaDgZQgDO/ZwLhJ3CA/q1cJq29pUvCZxgVEPnFKgqV4//g==","mode":420,"size":1626},"dist/chunks/globals.DBrtKPdh.js":Line truncated
@@ -0,0 +1,49 @@
import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';
import { interpolate } from '../../utils/interpolate.mjs';
import { defaultOffset } from '../keyframes/offsets/default.mjs';
import { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';
function defaultEasing(values, easing) {
return values.map(() => easing || easeInOut).splice(0, values.length - 1);
}
function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) {
/**
* Easing functions can be externally defined as strings. Here we convert them
* into actual functions.
*/
const easingFunctions = isEasingArray(ease)
? ease.map(easingDefinitionToFunction)
: easingDefinitionToFunction(ease);
/**
* This is the Iterator-spec return value. We ensure it's mutable rather than using a generator
* to reduce GC during animation.
*/
const state = {
done: false,
value: keyframeValues[0],
};
/**
* Create a times array based on the provided 0-1 offsets
*/
const absoluteTimes = convertOffsetToTimes(
// Only use the provided offsets if they're the correct length
// TODO Maybe we should warn here if there's a length mismatch
times && times.length === keyframeValues.length
? times
: defaultOffset(keyframeValues), duration);
const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {
ease: Array.isArray(easingFunctions)
? easingFunctions
: defaultEasing(keyframeValues, easingFunctions),
});
return {
calculatedDuration: duration,
next: (t) => {
state.value = mapTimeToKeyframe(t);
state.done = t >= duration;
return state;
},
};
}
export { defaultEasing, keyframes };
@@ -0,0 +1,37 @@
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function() {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
export default shortOut;
@@ -0,0 +1 @@
{"version":3,"file":"urn-uuid.js","sourceRoot":"","sources":["../../../src/schemes/urn-uuid.ts"],"names":[],"mappings":"AAQA,MAAM,IAAI,GAAG,0DAA0D,CAAC;AACxE,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,UAAU;AACV,MAAM,OAAO,GAA+D;IAC3E,MAAM,EAAG,UAAU;IAEnB,KAAK,EAAG,UAAU,aAA2B,EAAE,OAAkB;QAChE,MAAM,cAAc,GAAG,aAA+B,CAAC;QACvD,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC;QACzC,cAAc,CAAC,GAAG,GAAG,SAAS,CAAC;QAE/B,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE;YACpF,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,oBAAoB,CAAC;SACpE;QAED,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,SAAS,EAAG,UAAU,cAA6B,EAAE,OAAkB;QACtE,MAAM,aAAa,GAAG,cAA+B,CAAC;QACtD,gBAAgB;QAChB,aAAa,CAAC,GAAG,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9D,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,134 @@
/*! js-cookie v3.0.5 | MIT */
/* eslint-disable no-var */
function assign (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
target[key] = source[key];
}
}
return target
}
/* eslint-enable no-var */
/* eslint-disable no-var */
var defaultConverter = {
read: function (value) {
if (value[0] === '"') {
value = value.slice(1, -1);
}
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
},
write: function (value) {
return encodeURIComponent(value).replace(
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
decodeURIComponent
)
}
};
/* eslint-enable no-var */
/* eslint-disable no-var */
function init (converter, defaultAttributes) {
function set (name, value, attributes) {
if (typeof document === 'undefined') {
return
}
attributes = assign({}, defaultAttributes, attributes);
if (typeof attributes.expires === 'number') {
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
}
if (attributes.expires) {
attributes.expires = attributes.expires.toUTCString();
}
name = encodeURIComponent(name)
.replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
.replace(/[()]/g, escape);
var stringifiedAttributes = '';
for (var attributeName in attributes) {
if (!attributes[attributeName]) {
continue
}
stringifiedAttributes += '; ' + attributeName;
if (attributes[attributeName] === true) {
continue
}
// Considers RFC 6265 section 5.2:
// ...
// 3. If the remaining unparsed-attributes contains a %x3B (";")
// character:
// Consume the characters of the unparsed-attributes up to,
// not including, the first %x3B (";") character.
// ...
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
}
return (document.cookie =
name + '=' + converter.write(value, name) + stringifiedAttributes)
}
function get (name) {
if (typeof document === 'undefined' || (arguments.length && !name)) {
return
}
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all.
var cookies = document.cookie ? document.cookie.split('; ') : [];
var jar = {};
for (var i = 0; i < cookies.length; i++) {
var parts = cookies[i].split('=');
var value = parts.slice(1).join('=');
try {
var found = decodeURIComponent(parts[0]);
jar[found] = converter.read(value, found);
if (name === found) {
break
}
} catch (e) {}
}
return name ? jar[name] : jar
}
return Object.create(
{
set,
get,
remove: function (name, attributes) {
set(
name,
'',
assign({}, attributes, {
expires: -1
})
);
},
withAttributes: function (attributes) {
return init(this.converter, assign({}, this.attributes, attributes))
},
withConverter: function (converter) {
return init(assign({}, this.converter, converter), this.attributes)
}
},
{
attributes: { value: Object.freeze(defaultAttributes) },
converter: { value: Object.freeze(converter) }
}
)
}
var api = init(defaultConverter, { path: '/' });
/* eslint-enable no-var */
export { api as default };
@@ -0,0 +1,35 @@
# @codemirror/commands [![NPM version](https://img.shields.io/npm/v/@codemirror/commands.svg)](https://www.npmjs.org/package/@codemirror/commands)
[ [**WEBSITE**](https://codemirror.net/) | [**DOCS**](https://codemirror.net/docs/ref/#commands) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/commands/blob/main/CHANGELOG.md) ]
This package implements a collection of editing commands for the
[CodeMirror](https://codemirror.net/) code editor.
The [project page](https://codemirror.net/) has more information, a
number of [examples](https://codemirror.net/examples/) and the
[documentation](https://codemirror.net/docs/).
This code is released under an
[MIT license](https://github.com/codemirror/commands/tree/main/LICENSE).
We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.
## Usage
```javascript
import {EditorView, keymap} from "@codemirror/view"
import {standardKeymap, selectLine} from "@codemirror/commands"
const view = new EditorView({
parent: document.body,
extensions: [
keymap.of([
...standardKeymap,
{key: "Alt-l", mac: "Ctrl-l", run: selectLine}
])
]
})
```
@@ -0,0 +1,111 @@
import * as fse from "./index.js";
export {
copy,
CopyFilterAsync,
CopyFilterSync,
CopyOptions,
CopyOptionsSync,
copySync,
createFile,
createFileSync,
createLink,
createLinkSync,
createSymlink,
createSymlinkSync,
emptyDir,
emptydir,
emptyDirSync,
emptydirSync,
ensureDir,
EnsureDirOptions,
ensureDirSync,
ensureFile,
ensureFileSync,
ensureLink,
ensureLinkSync,
ensureSymlink,
ensureSymlinkSync,
JsonOutputOptions,
JsonReadOptions,
JsonWriteOptions,
mkdirp,
mkdirpSync,
mkdirs,
mkdirsSync,
move,
MoveOptions,
moveSync,
NoParamCallback,
NoParamCallbackWithUndefined,
outputFile,
outputFileSync,
outputJSON,
outputJson,
outputJSONSync,
outputJsonSync,
pathExists,
pathExistsSync,
PathLike,
readJSON,
readJson,
readJSONSync,
readJsonSync,
remove,
removeSync,
SymlinkType,
WriteFileOptions,
writeJSON,
writeJson,
writeJSONSync,
writeJsonSync,
} from "./index.js";
declare const fsExtra: {
copy: typeof fse.copy;
copySync: typeof fse.copySync;
emptyDirSync: typeof fse.emptyDirSync;
emptydirSync: typeof fse.emptydirSync;
emptyDir: typeof fse.emptyDir;
emptydir: typeof fse.emptydir;
createFile: typeof fse.createFile;
createFileSync: typeof fse.createFileSync;
ensureFile: typeof fse.ensureFile;
ensureFileSync: typeof fse.ensureFileSync;
createLink: typeof fse.createLink;
createLinkSync: typeof fse.createLinkSync;
ensureLink: typeof fse.ensureLink;
ensureLinkSync: typeof fse.ensureLinkSync;
createSymlink: typeof fse.createSymlink;
createSymlinkSync: typeof fse.createSymlinkSync;
ensureSymlink: typeof fse.ensureSymlink;
ensureSymlinkSync: typeof fse.ensureSymlinkSync;
readJson: typeof fse.readJson;
readJSON: typeof fse.readJSON;
readJsonSync: typeof fse.readJsonSync;
readJSONSync: typeof fse.readJSONSync;
writeJson: typeof fse.writeJson;
writeJSON: typeof fse.writeJSON;
writeJsonSync: typeof fse.writeJsonSync;
writeJSONSync: typeof fse.writeJSONSync;
outputJson: typeof fse.outputJson;
outputJSON: typeof fse.outputJSON;
outputJsonSync: typeof fse.outputJsonSync;
outputJSONSync: typeof fse.outputJSONSync;
mkdirs: typeof fse.mkdirs;
mkdirsSync: typeof fse.mkdirsSync;
mkdirp: typeof fse.mkdirp;
mkdirpSync: typeof fse.mkdirpSync;
ensureDir: typeof fse.ensureDir;
ensureDirSync: typeof fse.ensureDirSync;
move: typeof fse.move;
moveSync: typeof fse.moveSync;
outputFile: typeof fse.outputFile;
outputFileSync: typeof fse.outputFileSync;
pathExists: typeof fse.pathExists;
pathExistsSync: typeof fse.pathExistsSync;
remove: typeof fse.remove;
removeSync: typeof fse.removeSync;
};
export default fsExtra;
@@ -0,0 +1,73 @@
'use strict';
exports.__esModule = true;
const extname = require('path').extname;
const log = require('debug')('eslint-plugin-import:utils:ignore');
// one-shot memoized
/** @type {Set<import('./types').Extension>} */ let cachedSet;
/** @type {import('./types').ESLintSettings} */ let lastSettings;
/** @type {import('./ignore').getFileExtensions} */
function makeValidExtensionSet(settings) {
// start with explicit JS-parsed extensions
/** @type {Set<import('./types').Extension>} */
const exts = new Set(settings['import/extensions'] || ['.js', '.mjs', '.cjs']);
// all alternate parser extensions are also valid
if ('import/parsers' in settings) {
for (const parser in settings['import/parsers']) {
const parserSettings = settings['import/parsers'][parser];
if (!Array.isArray(parserSettings)) {
throw new TypeError('"settings" for ' + parser + ' must be an array');
}
parserSettings.forEach((ext) => exts.add(ext));
}
}
return exts;
}
exports.getFileExtensions = makeValidExtensionSet;
/** @type {(context: import('eslint').Rule.RuleContext) => Set<import('./types').Extension>} */
function validExtensions(context) {
if (cachedSet && context.settings === lastSettings) {
return cachedSet;
}
lastSettings = context.settings;
cachedSet = makeValidExtensionSet(context.settings);
return cachedSet;
}
/** @type {import('./ignore').hasValidExtension} */
function hasValidExtension(path, context) {
// eslint-disable-next-line no-extra-parens
return validExtensions(context).has(/** @type {import('./types').Extension} */ (extname(path)));
}
exports.hasValidExtension = hasValidExtension;
/** @type {import('./ignore').default} */
exports.default = function ignore(path, context) {
// check extension whitelist first (cheap)
if (!hasValidExtension(path, context)) {
return true;
}
if (!('import/ignore' in context.settings)) {
return false;
}
const ignoreStrings = context.settings['import/ignore'];
for (let i = 0; i < ignoreStrings.length; i++) {
const regex = new RegExp(ignoreStrings[i]);
if (regex.test(path)) {
log(`ignoring ${path}, matched pattern /${ignoreStrings[i]}/`);
return true;
}
}
return false;
};
@@ -0,0 +1,4 @@
<svg viewBox="0 0 18 18">
<path class="ql-fill" d="M15,12v2a.99942.99942,0,0,1-1,1H4a.99942.99942,0,0,1-1-1V12a1,1,0,0,1,2,0v1h8V12a1,1,0,0,1,2,0ZM14,3H4A.99942.99942,0,0,0,3,4V6A1,1,0,0,0,5,6V5h8V6a1,1,0,0,0,2,0V4A.99942.99942,0,0,0,14,3Z"/>
<path class="ql-fill" d="M15,10H3A1,1,0,0,1,3,8H15a1,1,0,0,1,0,2Z"/>
</svg>

After

Width:  |  Height:  |  Size: 322 B

@@ -0,0 +1,30 @@
"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 __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useRuleContext = exports.setRuleContext = void 0;
__exportStar(require("./utils.js"), exports);
let ruleContext;
const setRuleContext = (nextRuleContext, callback) => {
const currentValue = ruleContext;
ruleContext = nextRuleContext;
const result = callback();
ruleContext = currentValue;
return result;
};
exports.setRuleContext = setRuleContext;
const useRuleContext = () => ruleContext;
exports.useRuleContext = useRuleContext;
//# sourceMappingURL=index.js.map
@@ -0,0 +1,10 @@
/**
* Configurable ways to encode characters as named references.
*
* @param {number} code
* @param {number} next
* @param {boolean|undefined} omit
* @param {boolean|undefined} attribute
* @returns {string}
*/
export function toNamed(code: number, next: number, omit: boolean | undefined, attribute: boolean | undefined): string;
@@ -0,0 +1,18 @@
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(require("./core"), require("./sha256"), require("./hmac"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./sha256", "./hmac"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
return CryptoJS.HmacSHA256;
}));
@@ -0,0 +1,114 @@
import type { SourceMapSegment } from './sourcemap-segment';
import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping';
export interface SourceMapV3 {
file?: string | null;
names: string[];
sourceRoot?: string;
sources: (string | null)[];
sourcesContent?: (string | null)[];
version: 3;
ignoreList?: number[];
}
export interface EncodedSourceMap extends SourceMapV3 {
mappings: string;
}
export interface DecodedSourceMap extends SourceMapV3 {
mappings: SourceMapSegment[][];
}
export interface Section {
offset: { line: number; column: number };
map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap;
}
export interface SectionedSourceMap {
file?: string | null;
sections: Section[];
version: 3;
}
export type OriginalMapping = {
source: string | null;
line: number;
column: number;
name: string | null;
};
export type InvalidOriginalMapping = {
source: null;
line: null;
column: null;
name: null;
};
export type GeneratedMapping = {
line: number;
column: number;
};
export type InvalidGeneratedMapping = {
line: null;
column: null;
};
export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND;
export type XInput = { x_google_ignoreList?: SourceMapV3['ignoreList'] };
export type EncodedSourceMapXInput = EncodedSourceMap & XInput;
export type DecodedSourceMapXInput = DecodedSourceMap & XInput;
export type SectionedSourceMapXInput = Omit<SectionedSourceMap, 'sections'> & {
sections: SectionXInput[];
};
export type SectionXInput = Omit<Section, 'map'> & {
map: SectionedSourceMapInput;
};
export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap;
export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput;
export type Needle = { line: number; column: number; bias?: Bias };
export type SourceNeedle = { source: string; line: number; column: number; bias?: Bias };
export type EachMapping =
| {
generatedLine: number;
generatedColumn: number;
source: null;
originalLine: null;
originalColumn: null;
name: null;
}
| {
generatedLine: number;
generatedColumn: number;
source: string | null;
originalLine: number;
originalColumn: number;
name: string | null;
};
export abstract class SourceMap {
declare version: SourceMapV3['version'];
declare file: SourceMapV3['file'];
declare names: SourceMapV3['names'];
declare sourceRoot: SourceMapV3['sourceRoot'];
declare sources: SourceMapV3['sources'];
declare sourcesContent: SourceMapV3['sourcesContent'];
declare resolvedSources: SourceMapV3['sources'];
declare ignoreList: SourceMapV3['ignoreList'];
}
export type Ro<T> =
T extends Array<infer V>
? V[] | Readonly<V[]> | RoArray<V> | Readonly<RoArray<V>>
: T extends object
? T | Readonly<T> | RoObject<T> | Readonly<RoObject<T>>
: T;
type RoArray<T> = Ro<T>[];
type RoObject<T> = { [K in keyof T]: T[K] | Ro<T[K]> };
export function parse<T>(map: T): Exclude<T, string> {
return typeof map === 'string' ? JSON.parse(map) : (map as Exclude<T, string>);
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=PlanTree.js.map
@@ -0,0 +1,34 @@
import ListCache from './_ListCache.js';
import Map from './_Map.js';
import MapCache from './_MapCache.js';
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
export default stackSet;
@@ -0,0 +1,86 @@
/**
* stream.js: Transport for outputting to any arbitrary stream.
*
* (C) 2010 Charlie Robbins
* MIT LICENCE
*/
'use strict';
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
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); }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var isStream = require('is-stream');
var _require = require('triple-beam'),
MESSAGE = _require.MESSAGE;
var os = require('os');
var TransportStream = require('winston-transport');
/**
* Transport for outputting to any arbitrary stream.
* @type {Stream}
* @extends {TransportStream}
*/
module.exports = /*#__PURE__*/function (_TransportStream) {
/**
* Constructor function for the Console transport object responsible for
* persisting log messages and metadata to a terminal or TTY.
* @param {!Object} [options={}] - Options for this instance.
*/
function Stream() {
var _this;
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, Stream);
_this = _callSuper(this, Stream, [options]);
if (!options.stream || !isStream(options.stream)) {
throw new Error('options.stream is required.');
}
// We need to listen for drain events when write() returns false. This can
// make node mad at times.
_this._stream = options.stream;
_this._stream.setMaxListeners(Infinity);
_this.isObjectMode = options.stream._writableState.objectMode;
_this.eol = typeof options.eol === 'string' ? options.eol : os.EOL;
return _this;
}
/**
* Core logging method exposed to Winston.
* @param {Object} info - TODO: add param description.
* @param {Function} callback - TODO: add param description.
* @returns {undefined}
*/
_inherits(Stream, _TransportStream);
return _createClass(Stream, [{
key: "log",
value: function log(info, callback) {
var _this2 = this;
setImmediate(function () {
return _this2.emit('logged', info);
});
if (this.isObjectMode) {
this._stream.write(info);
if (callback) {
callback(); // eslint-disable-line callback-return
}
return;
}
this._stream.write("".concat(info[MESSAGE]).concat(this.eol));
if (callback) {
callback(); // eslint-disable-line callback-return
}
return;
}
}]);
}(TransportStream);
@@ -0,0 +1,341 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.instance = exports.typeInfo = void 0;
const tslib_1 = require("tslib");
const providers_1 = require("./providers");
const provider_1 = require("./providers/provider");
const injection_token_1 = require("./providers/injection-token");
const registry_1 = require("./registry");
const lifecycle_1 = require("./types/lifecycle");
const resolution_context_1 = require("./resolution-context");
const error_helpers_1 = require("./error-helpers");
const lazy_helpers_1 = require("./lazy-helpers");
const disposable_1 = require("./types/disposable");
const interceptors_1 = require("./interceptors");
exports.typeInfo = new Map();
class InternalDependencyContainer {
constructor(parent) {
this.parent = parent;
this._registry = new registry_1.default();
this.interceptors = new interceptors_1.default();
this.disposed = false;
this.disposables = new Set();
}
register(token, providerOrConstructor, options = { lifecycle: lifecycle_1.default.Transient }) {
this.ensureNotDisposed();
let provider;
if (!provider_1.isProvider(providerOrConstructor)) {
provider = { useClass: providerOrConstructor };
}
else {
provider = providerOrConstructor;
}
if (providers_1.isTokenProvider(provider)) {
const path = [token];
let tokenProvider = provider;
while (tokenProvider != null) {
const currentToken = tokenProvider.useToken;
if (path.includes(currentToken)) {
throw new Error(`Token registration cycle detected! ${[...path, currentToken].join(" -> ")}`);
}
path.push(currentToken);
const registration = this._registry.get(currentToken);
if (registration && providers_1.isTokenProvider(registration.provider)) {
tokenProvider = registration.provider;
}
else {
tokenProvider = null;
}
}
}
if (options.lifecycle === lifecycle_1.default.Singleton ||
options.lifecycle == lifecycle_1.default.ContainerScoped ||
options.lifecycle == lifecycle_1.default.ResolutionScoped) {
if (providers_1.isValueProvider(provider) || providers_1.isFactoryProvider(provider)) {
throw new Error(`Cannot use lifecycle "${lifecycle_1.default[options.lifecycle]}" with ValueProviders or FactoryProviders`);
}
}
this._registry.set(token, { provider, options });
return this;
}
registerType(from, to) {
this.ensureNotDisposed();
if (providers_1.isNormalToken(to)) {
return this.register(from, {
useToken: to
});
}
return this.register(from, {
useClass: to
});
}
registerInstance(token, instance) {
this.ensureNotDisposed();
return this.register(token, {
useValue: instance
});
}
registerSingleton(from, to) {
this.ensureNotDisposed();
if (providers_1.isNormalToken(from)) {
if (providers_1.isNormalToken(to)) {
return this.register(from, {
useToken: to
}, { lifecycle: lifecycle_1.default.Singleton });
}
else if (to) {
return this.register(from, {
useClass: to
}, { lifecycle: lifecycle_1.default.Singleton });
}
throw new Error('Cannot register a type name as a singleton without a "to" token');
}
let useClass = from;
if (to && !providers_1.isNormalToken(to)) {
useClass = to;
}
return this.register(from, {
useClass
}, { lifecycle: lifecycle_1.default.Singleton });
}
resolve(token, context = new resolution_context_1.default(), isOptional = false) {
this.ensureNotDisposed();
const registration = this.getRegistration(token);
if (!registration && providers_1.isNormalToken(token)) {
if (isOptional) {
return undefined;
}
throw new Error(`Attempted to resolve unregistered dependency token: "${token.toString()}"`);
}
this.executePreResolutionInterceptor(token, "Single");
if (registration) {
const result = this.resolveRegistration(registration, context);
this.executePostResolutionInterceptor(token, result, "Single");
return result;
}
if (injection_token_1.isConstructorToken(token)) {
const result = this.construct(token, context);
this.executePostResolutionInterceptor(token, result, "Single");
return result;
}
throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.");
}
executePreResolutionInterceptor(token, resolutionType) {
if (this.interceptors.preResolution.has(token)) {
const remainingInterceptors = [];
for (const interceptor of this.interceptors.preResolution.getAll(token)) {
if (interceptor.options.frequency != "Once") {
remainingInterceptors.push(interceptor);
}
interceptor.callback(token, resolutionType);
}
this.interceptors.preResolution.setAll(token, remainingInterceptors);
}
}
executePostResolutionInterceptor(token, result, resolutionType) {
if (this.interceptors.postResolution.has(token)) {
const remainingInterceptors = [];
for (const interceptor of this.interceptors.postResolution.getAll(token)) {
if (interceptor.options.frequency != "Once") {
remainingInterceptors.push(interceptor);
}
interceptor.callback(token, result, resolutionType);
}
this.interceptors.postResolution.setAll(token, remainingInterceptors);
}
}
resolveRegistration(registration, context) {
this.ensureNotDisposed();
if (registration.options.lifecycle === lifecycle_1.default.ResolutionScoped &&
context.scopedResolutions.has(registration)) {
return context.scopedResolutions.get(registration);
}
const isSingleton = registration.options.lifecycle === lifecycle_1.default.Singleton;
const isContainerScoped = registration.options.lifecycle === lifecycle_1.default.ContainerScoped;
const returnInstance = isSingleton || isContainerScoped;
let resolved;
if (providers_1.isValueProvider(registration.provider)) {
resolved = registration.provider.useValue;
}
else if (providers_1.isTokenProvider(registration.provider)) {
resolved = returnInstance
? registration.instance ||
(registration.instance = this.resolve(registration.provider.useToken, context))
: this.resolve(registration.provider.useToken, context);
}
else if (providers_1.isClassProvider(registration.provider)) {
resolved = returnInstance
? registration.instance ||
(registration.instance = this.construct(registration.provider.useClass, context))
: this.construct(registration.provider.useClass, context);
}
else if (providers_1.isFactoryProvider(registration.provider)) {
resolved = registration.provider.useFactory(this);
}
else {
resolved = this.construct(registration.provider, context);
}
if (registration.options.lifecycle === lifecycle_1.default.ResolutionScoped) {
context.scopedResolutions.set(registration, resolved);
}
return resolved;
}
resolveAll(token, context = new resolution_context_1.default(), isOptional = false) {
this.ensureNotDisposed();
const registrations = this.getAllRegistrations(token);
if (!registrations && providers_1.isNormalToken(token)) {
if (isOptional) {
return [];
}
throw new Error(`Attempted to resolve unregistered dependency token: "${token.toString()}"`);
}
this.executePreResolutionInterceptor(token, "All");
if (registrations) {
const result = registrations.map(item => this.resolveRegistration(item, context));
this.executePostResolutionInterceptor(token, result, "All");
return result;
}
const result = [this.construct(token, context)];
this.executePostResolutionInterceptor(token, result, "All");
return result;
}
isRegistered(token, recursive = false) {
this.ensureNotDisposed();
return (this._registry.has(token) ||
(recursive &&
(this.parent || false) &&
this.parent.isRegistered(token, true)));
}
reset() {
this.ensureNotDisposed();
this._registry.clear();
this.interceptors.preResolution.clear();
this.interceptors.postResolution.clear();
}
clearInstances() {
this.ensureNotDisposed();
for (const [token, registrations] of this._registry.entries()) {
this._registry.setAll(token, registrations
.filter(registration => !providers_1.isValueProvider(registration.provider))
.map(registration => {
registration.instance = undefined;
return registration;
}));
}
}
createChildContainer() {
this.ensureNotDisposed();
const childContainer = new InternalDependencyContainer(this);
for (const [token, registrations] of this._registry.entries()) {
if (registrations.some(({ options }) => options.lifecycle === lifecycle_1.default.ContainerScoped)) {
childContainer._registry.setAll(token, registrations.map(registration => {
if (registration.options.lifecycle === lifecycle_1.default.ContainerScoped) {
return {
provider: registration.provider,
options: registration.options
};
}
return registration;
}));
}
}
return childContainer;
}
beforeResolution(token, callback, options = { frequency: "Always" }) {
this.interceptors.preResolution.set(token, {
callback: callback,
options: options
});
}
afterResolution(token, callback, options = { frequency: "Always" }) {
this.interceptors.postResolution.set(token, {
callback: callback,
options: options
});
}
dispose() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
this.disposed = true;
const promises = [];
this.disposables.forEach(disposable => {
const maybePromise = disposable.dispose();
if (maybePromise) {
promises.push(maybePromise);
}
});
yield Promise.all(promises);
});
}
getRegistration(token) {
if (this.isRegistered(token)) {
return this._registry.get(token);
}
if (this.parent) {
return this.parent.getRegistration(token);
}
return null;
}
getAllRegistrations(token) {
if (this.isRegistered(token)) {
return this._registry.getAll(token);
}
if (this.parent) {
return this.parent.getAllRegistrations(token);
}
return null;
}
construct(ctor, context) {
if (ctor instanceof lazy_helpers_1.DelayedConstructor) {
return ctor.createProxy((target) => this.resolve(target, context));
}
const instance = (() => {
const paramInfo = exports.typeInfo.get(ctor);
if (!paramInfo || paramInfo.length === 0) {
if (ctor.length === 0) {
return new ctor();
}
else {
throw new Error(`TypeInfo not known for "${ctor.name}"`);
}
}
const params = paramInfo.map(this.resolveParams(context, ctor));
return new ctor(...params);
})();
if (disposable_1.isDisposable(instance)) {
this.disposables.add(instance);
}
return instance;
}
resolveParams(context, ctor) {
return (param, idx) => {
try {
if (injection_token_1.isTokenDescriptor(param)) {
if (injection_token_1.isTransformDescriptor(param)) {
return param.multiple
? this.resolve(param.transform).transform(this.resolveAll(param.token, new resolution_context_1.default(), param.isOptional), ...param.transformArgs)
: this.resolve(param.transform).transform(this.resolve(param.token, context, param.isOptional), ...param.transformArgs);
}
else {
return param.multiple
? this.resolveAll(param.token, new resolution_context_1.default(), param.isOptional)
: this.resolve(param.token, context, param.isOptional);
}
}
else if (injection_token_1.isTransformDescriptor(param)) {
return this.resolve(param.transform, context).transform(this.resolve(param.token, context), ...param.transformArgs);
}
return this.resolve(param, context);
}
catch (e) {
throw new Error(error_helpers_1.formatErrorCtor(ctor, idx, e));
}
};
}
ensureNotDisposed() {
if (this.disposed) {
throw new Error("This container has been disposed, you cannot interact with a disposed container");
}
}
}
exports.instance = new InternalDependencyContainer();
exports.default = exports.instance;
@@ -0,0 +1,37 @@
import {useOverlayPosition as $2a41e45df1593e64$export$d39e1813b3bdd0e1} from "./useOverlayPosition.module.js";
import {useOverlay as $a11501f3d1d39e6c$export$ea8f71083e90600f} from "./useOverlay.module.js";
import {useOverlayTrigger as $628037886ba31236$export$f9d5c8beee7d008d} from "./useOverlayTrigger.module.js";
import {usePreventScroll as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18} from "./usePreventScroll.module.js";
import {ModalProvider as $f57aed4a881a3485$export$178405afcd8c5eb, OverlayContainer as $f57aed4a881a3485$export$b47c3594eab58386, OverlayProvider as $f57aed4a881a3485$export$bf688221f59024e5, useModal as $f57aed4a881a3485$export$33ffd74ebf07f060, useModalProvider as $f57aed4a881a3485$export$d9aaed4c3ece1bc0} from "./useModal.module.js";
import {DismissButton as $86ea4cb521eb2e37$export$2317d149ed6f78c4} from "./DismissButton.module.js";
import {ariaHideOutside as $5e3802645cc19319$export$1c3ebcada18427bf} from "./ariaHideOutside.module.js";
import {usePopover as $f2f8a6077418541e$export$542a6fd13ac93354} from "./usePopover.module.js";
import {useModalOverlay as $8ac8429251c45e4b$export$dbc0f175b25fb0fb} from "./useModalOverlay.module.js";
import {Overlay as $337b884510726a0d$export$c6fdb837b070b4ff, useOverlayFocusContain as $337b884510726a0d$export$14c98a7594375490} from "./Overlay.module.js";
import {UNSTABLE_PortalProvider as $96b38030c423d352$export$db995ea7163b4b67, useUNSTABLE_PortalContext as $96b38030c423d352$export$574e9b0fb070c3b0} from "./PortalProvider.module.js";
/*
* 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 {$2a41e45df1593e64$export$d39e1813b3bdd0e1 as useOverlayPosition, $a11501f3d1d39e6c$export$ea8f71083e90600f as useOverlay, $628037886ba31236$export$f9d5c8beee7d008d as useOverlayTrigger, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18 as usePreventScroll, $f57aed4a881a3485$export$178405afcd8c5eb as ModalProvider, $f57aed4a881a3485$export$d9aaed4c3ece1bc0 as useModalProvider, $f57aed4a881a3485$export$bf688221f59024e5 as OverlayProvider, $f57aed4a881a3485$export$b47c3594eab58386 as OverlayContainer, $f57aed4a881a3485$export$33ffd74ebf07f060 as useModal, $86ea4cb521eb2e37$export$2317d149ed6f78c4 as DismissButton, $5e3802645cc19319$export$1c3ebcada18427bf as ariaHideOutside, $f2f8a6077418541e$export$542a6fd13ac93354 as usePopover, $8ac8429251c45e4b$export$dbc0f175b25fb0fb as useModalOverlay, $337b884510726a0d$export$c6fdb837b070b4ff as Overlay, $337b884510726a0d$export$14c98a7594375490 as useOverlayFocusContain, $96b38030c423d352$export$db995ea7163b4b67 as UNSTABLE_PortalProvider, $96b38030c423d352$export$574e9b0fb070c3b0 as useUNSTABLE_PortalContext};
//# sourceMappingURL=module.js.map
@@ -0,0 +1,80 @@
'use strict';
// / <reference types="node" />
var callBind = require('call-bind');
var forEach = require('for-each');
var gOPD = require('gopd');
var isTypedArray = require('is-typed-array');
var typedArrays = require('possible-typed-array-names');
var gPO = require('reflect.getprototypeof/polyfill')();
/** @typedef {(value: import('.').TypedArray) => number} TypedArrayLengthGetter */
/** @typedef {{ [k in `$${import('.').TypedArrayName}` | '__proto__']: k extends '__proto__' ? null : TypedArrayLengthGetter }} Cache */
/** @type {Cache} */
// @ts-expect-error TS doesn't seem to have a "will eventually satisfy" type
var getters = { __proto__: null };
var oDP = Object.defineProperty;
if (gOPD) {
var getLength = /** @type {TypedArrayLengthGetter} */ function (x) {
return x.length;
};
forEach(typedArrays, /** @type {(typedArray: import('.').TypedArrayName) => void} */ function (typedArray) {
var TA = global[typedArray];
// In Safari 7, Typed Array constructors are typeof object
if (typeof TA === 'function' || typeof TA === 'object') {
var Proto = TA.prototype;
// @ts-expect-error TS doesn't narrow types inside callbacks, which is weird
var descriptor = gOPD(Proto, 'length');
if (!descriptor) {
var superProto = gPO(Proto);
// @ts-expect-error TS doesn't narrow types inside callbacks, which is weird
descriptor = gOPD(superProto, 'length');
}
// Opera 12.16 has a magic length data property on instances AND on Proto
if (descriptor && descriptor.get) {
// eslint-disable-next-line no-extra-parens
getters[/** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray)] = callBind(descriptor.get);
} else if (oDP) {
// this is likely an engine where instances have a magic length data property
var arr = new global[typedArray](2);
// @ts-expect-error TS doesn't narrow types inside callbacks, which is weird
descriptor = gOPD(arr, 'length');
if (descriptor && descriptor.configurable) {
oDP(arr, 'length', { value: 3 });
}
if (arr.length === 2) {
// eslint-disable-next-line no-extra-parens
getters[/** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray)] = getLength;
}
}
}
});
}
/** @type {TypedArrayLengthGetter} */
var tryTypedArrays = function tryAllTypedArrays(value) {
/** @type {number} */ var foundLength;
// @ts-expect-error not sure why this won't work
forEach(getters, /** @type {(getter: TypedArrayLengthGetter) => void} */ function (getter) {
if (typeof foundLength !== 'number') {
try {
var length = getter(value);
if (typeof length === 'number') {
foundLength = length;
}
} catch (e) {}
}
});
// @ts-expect-error TS can't guarantee the above callback is invoked sync
return foundLength;
};
/** @type {import('.')} */
module.exports = function typedArrayLength(value) {
if (!isTypedArray(value)) {
return false;
}
return tryTypedArrays(value);
};
@@ -0,0 +1,40 @@
/**
* ```asn1
* id-ce-cRLReasons OBJECT IDENTIFIER ::= { id-ce 21 }
* ```
*/
export declare const id_ce_cRLReasons = "2.5.29.21";
export declare enum CRLReasons {
unspecified = 0,
keyCompromise = 1,
cACompromise = 2,
affiliationChanged = 3,
superseded = 4,
cessationOfOperation = 5,
certificateHold = 6,
removeFromCRL = 8,
privilegeWithdrawn = 9,
aACompromise = 10
}
/**
* ```asn1
* CRLReason ::= ENUMERATED {
* unspecified (0),
* keyCompromise (1),
* cACompromise (2),
* affiliationChanged (3),
* superseded (4),
* cessationOfOperation (5),
* certificateHold (6),
* -- value 7 is not used
* removeFromCRL (8),
* privilegeWithdrawn (9),
* aACompromise (10) }
* ```
*/
export declare class CRLReason {
reason: CRLReasons;
constructor(reason?: CRLReasons);
toJSON(): string;
toString(): string;
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=DeactivationParams.js.map
@@ -0,0 +1,624 @@
export default `flf2a$ 6 5 16 0 11 0 24447 0
Author : mikechat
Date : 2006/6/9 12:03:25
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
$ #
$ #
$ #
$ #
$ #
$ ##
#
__ #
| / #
|_/ #
.-. #
\`-' ##
____ #
|/|/ #
' ' #
#
#
##
##
#
#
#
#
##
$#
#
#
#
#
##
%#
#
#
#
#
##
&#
#
#
#
#
##
'#
#
#
#
#
##
(#
#
#
#
#
##
)#
#
#
#
#
##
*#
#
#
#
#
##
+#
#
#
#
#
##
,#
#
#
#
#
##
#
#
#
\`-=-. #
#
##
#
#
#
.-. #
\`-' #
##
/#
#
#
#
#
##
#
.-. #
/ ) #
( / #
\`-' #
##
#
-. #
/ #
/ #
----- #
##
#
.-. #
) #
.-/. #
(_/ \`-' #
##
#
.--. #
.' #
'. #
'----' #
##
#
/ / #
/__/ #
/ #
/ #
##
#
.----. #
|_.-. #
) #
\`---' #
##
#
,--. #
/.-. #
( ) #
\`--\` #
##
#
..----. #
/ #
/ #
/ #
##
#
.-. #
(.-.) #
( ) #
\`---' #
##
#
.--. #
( ) #
\`--/ #
/ #
##
#
.-. #
\`-' #
.-. #
\`-' #
##
;#
#
#
#
#
##
<#
#
#
#
#
##
=#
#
#
#
#
##
> >#
#
#
#
#
##
?#
#
#
#
#
##
@#
#
#
#
#
##
/\\ #
_ / | #
( / | .#
\`/.__|_.'#
.:' / | #
(__.' \`-' ##
.-. #
(_) )-. #
/ __) #
/ \`. #
/' ) #
(_/ \`----' ##
.-._ .-._.#
..' (_)\`-' #
| #
| _ #
\`. ) #
\`--' ##
.-. #
(_) )-. #
/ \\ #
/ \\ #
.-/. ) #
(_/ \`----' ##
.- #
.---;\`-' #
( (_) #
)-- #
( / #
\`\\___.' ##
.-._.---' #
(_) / #
/--. #
/ #
.-/ #
(_/ ##
.-.#
.--.\`-' #
/ (_; #
/ #
( --;- #
\`.___.' ##
. / #
_ \\ / ( #
( ) ( ) #
\`./___\\.' #
. / \\ #
(_.' \`. ##
.----. #
/ \`#
/ #
/ #
/ #
.---------' ##
.----. #
/ #
/ #
..-. / #
\`. / #
\`-' ##
.-. #
(_) ) .'- #
/ / #
_/_.' #
. / \\ #
(_.' \`-' ##
.-. #
/ (_) #
/ #
/ #
.-/. .-. #
(_/ \`-._. ##
.-. #
/|/| #
/ | #
/ | #
.-' / | #
(__.' \`. ##
.-. #
/ | #
/\\ | #
/ \\ | #
.-' / \\| #
(__.' \`. ##
#
.--. .- #
/ )\`-' #
/ / #
( / #
\`-.' ##
.-. #
(_) )-. #
/ \\ #
/ ) #
.-/ \`--' #
(_/ ##
.\`-, #
/ ) #
/ / #
( / #
\`--\`-. #
'- ##
.-. #
(_) )-. #
/ \\ #
/ ) #
.-/ \`--' #
(_/ \`-._) ##
.-. #
.--.-' #
( (_) #
\`-. #
_ ) #
(_.--' ##
.--------' #
(_) / #
/ #
/ #
.-/._ #
(_/ \`- ##
#
_ .-. #
' ( #
/ ) #
( / #
\`._.' ##
#
..-. .-. #
) / #
/ / #
( .' #
\\/ ##
#
..-. .-. #
) ( #
/ \\ #
( . ) #
\`-' \`-' ##
#
.-. .-. #
( \\ / #
\`-' \\/ #
/\\ .- #
\`._; \`._; ##
#
.-. .- #
/ ( #
( ) #
. \`..' #
(__.-' ##
#
\`---. #
) #
_.' #
( .-. #
\`.__.-._) ##
[#
#
#
#
#
##
\\#
#
#
#
#
##
]#
#
#
#
#
##
^#
#
#
#
#
##
#
#
#
#
._____. #
\`===' ##
_ #
\\| #
\` #
#
#
##
#
#
.-. #
( | #
\`-'-' #
##
. #
/ #
/-. #
/ ) #
.'\`--'\`- #
##
#
#
.-. #
( #
\`---' #
##
. #
/ #
.-../ #
( / #
\`-'-.. #
##
#
#
.-. #
./.-'_ #
(__.' #
##
.-. #
/ -' #
-/-- #
/ #
\`.' #
##
#
#
.-. #
( ) #
\`-/-' #
-._/ ##
#
/ #
/-. #
/ | #
_.' | #
##
#
.-. #
\`-' #
/ #
_.(__. #
##
#
.-. #
\`-' #
/ #
( / #
\`-' ##
#
/ #
/-. #
/ ) #
_/ \\ #
##
. #
/ #
/ #
/ #
_/_.- #
##
#
#
. .-. .-. #
)/ ) ) #
'/ / ( #
\`-'##
#
#
. .-. #
)/ ) #
'/ ( #
\`- ##
#
#
.-._. #
( ) #
\`-' #
##
#
#
.-. #
/ ) #
/\`-' #
/ ##
#
#
.-. #
( ) #
\`-( #
\`-' ##
#
#
).--. #
/ #
/ #
##
#
#
. #
/ \\ #
/ ._) #
/ ##
#
/ #
---/--- #
/ #
/ #
##
#
#
) ( #
( ) #
\`--': #
##
#
#
) .-. #
( / #
\\_/ #
##
#
#
\`) ( #
/ . ) #
(_.' \`-' #
##
#
\`--. .-. #
\\/ #
/\\ #
.-' \`-. #
##
#
#
. .-. #
) / #
(_.' #
..-._) ##
#
#
.-. #
)_ #
( ) #
\`-' ##
{#
#
#
#
#
##
|#
#
#
#
#
##
}#
#
#
#
#
##
~#
#
#
#
#
##
/\\ #
_ / | #
( / | .#
\`/.__|_.'#
.:' / | #
(__.' \`-' ##
#
.--. .- #
/ )\`-' #
/ / #
( / #
\`-.' ##
#
_ .-. #
' ( #
/ ) #
( / #
\`._.' ##
#
#
.-. #
( | #
\`-'-' #
##
#
#
.-._. #
( ) #
\`-' #
##
#
#
) ( #
( ) #
\`--': #
##
�#
#
#
#
#
##`
@@ -0,0 +1,11 @@
"use strict";
var _array_without_holes = require("./_array_without_holes.cjs");
var _iterable_to_array = require("./_iterable_to_array.cjs");
var _non_iterable_spread = require("./_non_iterable_spread.cjs");
var _unsupported_iterable_to_array = require("./_unsupported_iterable_to_array.cjs");
function _to_consumable_array(arr) {
return _array_without_holes._(arr) || _iterable_to_array._(arr) || _unsupported_iterable_to_array._(arr) || _non_iterable_spread._();
}
exports._ = _to_consumable_array;
@@ -0,0 +1 @@
{"version":3,"names":["_setFunctionName","require","_toPropertyKey","old_createMetadataMethodsForProperty","metadataMap","kind","property","decoratorFinishedRef","getMetadata","key","old_assertNotFinished","old_assertMetadataKey","metadataForKey","pub","public","priv","private","get","Object","hasOwnProperty","call","constructor","setMetadata","value","Map","set","old_convertMetadataMapToFinal","obj","parentMetadataMap","Symbol","metadata","for","metadataKeys","getOwnPropertySymbols","length","i","metaForKey","parentMetaForKey","parentPub","setPrototypeOf","privArr","Array","from","values","parentPriv","concat","old_createAddInitializerMethod","initializers","addInitializer","initializer","old_assertCallable","push","old_memberDec","dec","name","desc","isStatic","isPrivate","kindStr","ctx","toPropertyKey","v","metadataKind","metadataName","access","assign","fnName","Error","TypeError","fn","hint","old_assertValidReturnValue","type","undefined","init","old_getInit","console","warn","old_applyMemberDec","ret","base","decInfo","decs","prefix","setFunctionName","getOwnPropertyDescriptor","newValue","newInit","instance","ownInitializers","originalInitializer","args","defineProperty","old_applyMemberDecs","Class","protoMetadataMap","staticMetadataMap","decInfos","protoInitializers","staticInitializers","existingProtoNonFields","existingStaticNonFields","isArray","prototype","existingNonFields","existingKind","old_pushInitializers","old_applyClassDecs","targetClass","classDecs","newClass","nextNewClass","applyDecs","memberDecs"],"sources":["../../src/helpers/applyDecs.js"],"sourcesContent":["/* @minVersion 7.17.8 */\n/* @onlyBabel7 */\n\nimport setFunctionName from \"setFunctionName\";\nimport toPropertyKey from \"toPropertyKey\";\n/**\n * NOTE: This is an old version of the helper, used for 2021-12 decorators.\n * Updates should be done in applyDecs2203R.js.\n */\n\n/**\n Enums are used in this file, but not assigned to vars to avoid non-hoistable values\n\n CONSTRUCTOR = 0;\n PUBLIC = 1;\n PRIVATE = 2;\n\n FIELD = 0;\n ACCESSOR = 1;\n METHOD = 2;\n GETTER = 3;\n SETTER = 4;\n\n STATIC = 5;\n\n CLASS = 10; // only used in assertValidReturnValue\n*/\n\nfunction old_createMetadataMethodsForProperty(\n metadataMap,\n kind,\n property,\n decoratorFinishedRef,\n) {\n return {\n getMetadata: function (key) {\n old_assertNotFinished(decoratorFinishedRef, \"getMetadata\");\n old_assertMetadataKey(key);\n\n var metadataForKey = metadataMap[key];\n\n if (metadataForKey === void 0) return void 0;\n\n if (kind === 1 /* PUBLIC */) {\n var pub = metadataForKey.public;\n if (pub !== void 0) {\n return pub[property];\n }\n } else if (kind === 2 /* PRIVATE */) {\n var priv = metadataForKey.private;\n if (priv !== void 0) {\n return priv.get(property);\n }\n } else if (Object.hasOwnProperty.call(metadataForKey, \"constructor\")) {\n return metadataForKey.constructor;\n }\n },\n setMetadata: function (key, value) {\n old_assertNotFinished(decoratorFinishedRef, \"setMetadata\");\n old_assertMetadataKey(key);\n\n var metadataForKey = metadataMap[key];\n\n if (metadataForKey === void 0) {\n metadataForKey = metadataMap[key] = {};\n }\n\n if (kind === 1 /* PUBLIC */) {\n var pub = metadataForKey.public;\n\n if (pub === void 0) {\n pub = metadataForKey.public = {};\n }\n\n pub[property] = value;\n } else if (kind === 2 /* PRIVATE */) {\n var priv = metadataForKey.priv;\n\n if (priv === void 0) {\n priv = metadataForKey.private = new Map();\n }\n\n priv.set(property, value);\n } else {\n metadataForKey.constructor = value;\n }\n },\n };\n}\n\nfunction old_convertMetadataMapToFinal(obj, metadataMap) {\n var parentMetadataMap = obj[Symbol.metadata || Symbol.for(\"Symbol.metadata\")];\n var metadataKeys = Object.getOwnPropertySymbols(metadataMap);\n\n if (metadataKeys.length === 0) return;\n\n for (var i = 0; i < metadataKeys.length; i++) {\n var key = metadataKeys[i];\n var metaForKey = metadataMap[key];\n var parentMetaForKey = parentMetadataMap ? parentMetadataMap[key] : null;\n\n var pub = metaForKey.public;\n var parentPub = parentMetaForKey ? parentMetaForKey.public : null;\n\n if (pub && parentPub) {\n Object.setPrototypeOf(pub, parentPub);\n }\n\n var priv = metaForKey.private;\n\n if (priv) {\n var privArr = Array.from(priv.values());\n var parentPriv = parentMetaForKey ? parentMetaForKey.private : null;\n\n if (parentPriv) {\n privArr = privArr.concat(parentPriv);\n }\n\n metaForKey.private = privArr;\n }\n\n if (parentMetaForKey) {\n Object.setPrototypeOf(metaForKey, parentMetaForKey);\n }\n }\n\n if (parentMetadataMap) {\n Object.setPrototypeOf(metadataMap, parentMetadataMap);\nLine truncated
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,SAAS,CAAC;IAC1C,iBAAiB,CAAC,OAAS,CAAC,yBAAyB,EAAE,KAAK,UAAU,CAAC,mBAAmB,CAAC;IAC3F,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,OAAO,CAAC;IAC9C,cAAc,CAAC,WAAW,CAAC;IAC3B,kBAAkB,CAAC,OAAS,CAAC,yBAAyB,EAAE,KAAK,UAAU,CAAC,qBAAqB,CAAC;IAC9F,sBAAsB,CAAC,+CAA4C,CAAC;IACpE,UAAU,CAAC,UAAU,CAAC;IACtB,aAAa,CAAC,eAAe,CAAC;IAC9B,YAAY,CAAC,uBAAoB,CAAC;AACpC","sources":["packages/@react-aria/table/intl/pt-BR.json"],"sourcesContent":["{\n \"ascending\": \"crescente\",\n \"ascendingSort\": \"classificado pela coluna {columnName} em ordem crescente\",\n \"columnSize\": \"{value} pixels\",\n \"descending\": \"decrescente\",\n \"descendingSort\": \"classificado pela coluna {columnName} em ordem decrescente\",\n \"resizerDescription\": \"Pressione Enter para começar a redimensionar\",\n \"select\": \"Selecionar\",\n \"selectAll\": \"Selecionar tudo\",\n \"sortable\": \"coluna classificável\"\n}\n"],"names":[],"version":3,"file":"pt-BR.main.js.map"}
@@ -0,0 +1 @@
{"version":3,"file":"InjectFromOptionsLifecycle.js","sourceRoot":"","sources":["../../../../src/metadata/models/InjectFromOptionsLifecycle.ts"],"names":[],"mappings":""}
@@ -0,0 +1,117 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "znakov", verb: "imeti" },
file: { unit: "bajtov", verb: "imeti" },
array: { unit: "elementov", verb: "imeti" },
set: { unit: "elementov", verb: "imeti" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "število";
}
case "object": {
if (Array.isArray(data)) {
return "tabela";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "vnos",
email: "e-poštni naslov",
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: "ISO datum in čas",
date: "ISO datum",
time: "ISO čas",
duration: "ISO trajanje",
ipv4: "IPv4 naslov",
ipv6: "IPv6 naslov",
cidrv4: "obseg IPv4",
cidrv6: "obseg IPv6",
base64: "base64 kodiran niz",
base64url: "base64url kodiran niz",
json_string: "JSON niz",
e164: "E.164 številka",
jwt: "JWT",
template_literal: "vnos",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Neveljaven vnos: pričakovano ${issue.expected}, prejeto ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Neveljaven vnos: pričakovano ${util.stringifyPrimitive(issue.values[0])}`;
return `Neveljavna možnost: pričakovano eno izmed ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} imelo ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementov"}`;
return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Premajhno: pričakovano, da bo ${issue.origin} imelo ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Premajhno: pričakovano, da bo ${issue.origin} ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Neveljaven niz: mora se začeti z "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Neveljaven niz: mora se končati z "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Neveljaven niz: mora vsebovati "${_issue.includes}"`;
if (_issue.format === "regex")
return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`;
return `Neveljaven ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Neveljavno število: mora biti večkratnik ${issue.divisor}`;
case "unrecognized_keys":
return `Neprepoznan${issue.keys.length > 1 ? "i ključi" : " ključ"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Neveljaven ključ v ${issue.origin}`;
case "invalid_union":
return "Neveljaven vnos";
case "invalid_element":
return `Neveljavna vrednost v ${issue.origin}`;
default:
return "Neveljaven vnos";
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1 @@
{"name":"@react-stately/form","version":"3.1.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532107641,"integrity":"sha512-cil7stSp3ik41Hdv2Dj+GMcbvUfs1q+MZ2Yte0804py9i6oJJN/diCiIr/brcQOZ5ZqwAI6dgaHA7l8FZheQBw==","mode":420,"size":11335},"dist/main.js":{"checkedAt":1794532107641,"integrity":"sha512-rJTn8icl/qJGVGSKQnk3t0wFBujU9qb3L/ubIl9F5BbxbB4rQcgFo5GWs6+vse7pFPC7SJLADK+aJ1DTxV++nA==","mode":420,"size":1541},"dist/module.js":{"checkedAt":1794532107641,"integrity":"sha512-FCALlWG4k6JqwClPje3zOtvj+DslAMvE5koilv5m8+muGj7N93+P+y+rWJ+Xn1Hp0MwLzQQXbfYKZEnNuyRvTA==","mode":420,"size":1539},"dist/useFormValidationState.main.js":{"checkedAt":1794532107642,"integrity":"sha512-RAP+bsgbu8BF52OA1SAYzjuOicMoTe7Q2QnBsPxT3u28NHfQbjbsijdmQX9WRu3kuoKzjpqmOQTPgnqSza8Ezw==","mode":420,"size":10270},"dist/useFormValidationState.module.js":{"checkedAt":1794532107642,"integrity":"sha512-CdLP30ACh3Ekdx5QRifuC4p3mats1L0ck3qA2bglhs82oYEDYgj40DlxNbJYt3+tkn7mRSFgPXNvySIPBIsrgg==","mode":420,"size":10021},"package.json":{"checkedAt":1794532107642,"integrity":"sha512-e2OLw1ah08xx9aFeMlee1Vn7l29hTOy6EJoOoi3YST++Gm9wCxHxw4G/RwIvh/yKxxMb8Oa0WZFacrLgSHtwJg==","mode":420,"size":824},"dist/main.js.map":{"checkedAt":1794532107642,"integrity":"sha512-zuQ5GXtaL2inFkC1k1ZcqbXEbOvjcruOjrShSYnxRS9siXBDC7+IK4GG9S8BB68yZzrwL0VkmGsIhqcj7ZroJw==","mode":420,"size":1056},"dist/module.js.map":{"checkedAt":1794532107642,"integrity":"sha512-XLPUTRC6JOoulf5ltbN9ibgBZAwWMkZYV2ZywwCXrWLrskeo+nyMMv+wULC29IbMw1g59stzzlgqa4myANCpwA==","mode":420,"size":1047},"dist/types.d.ts.map":{"checkedAt":1794532107642,"integrity":"sha512-xlj4NBTSfQmJLUIxJJMCD1cV2Agm1OY1pdxdvxfk+6U7QawzoPRdUiOGWtDZqHC4Q7ENtwXnNsE1nIMQh/BDtw==","mode":420,"size":1863},"dist/useFormValidationState.main.js.map":{"checkedAt":1794532107642,"integrity":"sha512-aFTKSJUHomCa/AHHhKsgf9W0Bs274DYlNKiUU6A9pOUGEY+pIs7RXoAx3YJK4I142YOY+V2V17JQwwLprNPZ2Q==","mode":420,"size":13322},"dist/useFormValidationState.module.js.map":{"checkedAt":1794532107643,"integrity":"sha512-6+d09ZS7hgTGuX9eklylyW3ZxEWFdr6DbozMe6BIth5VLB+QWJCvXzNc2PQOG1BaJTaJAQbAZ/Rls8UceUzb3g==","mode":420,"size":13304},"README.md":{"checkedAt":1794532107643,"integrity":"sha512-65AzVk9dVttI2TNpsEFvu/gH09FiVvmNutqgMBpXWvIgMDEy/g8T5B0dQB1ENUIgFY11Q/jjO7DV05t3yrk3Sg==","mode":420,"size":137},"dist/import.mjs":{"checkedAt":1794532107643,"integrity":"sha512-jBV77R76vVdLHwydORCH96PjX3zAFbhwST3wCvTVjrGS2VANjUJf/dovGXeUzTeY294NnY73kW0w2iQvKb5oYw==","mode":420,"size":1533},"dist/useFormValidationState.mjs":{"checkedAt":1794532107642,"integrity":"sha512-CdLP30ACh3Ekdx5QRifuC4p3mats1L0ck3qA2bglhs82oYEDYgj40DlxNbJYt3+tkn7mRSFgPXNvySIPBIsrgg==","mode":420,"size":10021},"src/index.ts":{"checkedAt":1794532107643,"integrity":"sha512-2e7sTWD4cSCFvkwmRJ9HV4JKKMuZ1RMAspdrdazszao73mEWRvOpkmPR6/+uBW2ibfP0UZQj6Cb9QPQPDcaRvA==","mode":420,"size":870},"dist/types.d.ts":{"checkedAt":1794532107643,"integrity":"sha512-rjRsQVryQaUto1017vVGajmFpPA6s7AAKHQFqQ2XKo4td5c0bFvZRWDjjyMNkQIkLiycXNtKF81RoEe6i3uJWg==","mode":420,"size":1392},"src/useFormValidationState.ts":{"checkedAt":1794532107643,"integrity":"sha512-JCQJtHP/uXhhEXfeatjI4+pQYrT2crkQWuB1tTkOtpRyLVu34/ThGPIWjTgAHm584easZQ33erzGrQsd3XKDtg==","mode":420,"size":9114}}}
@@ -0,0 +1,8 @@
export declare function getScrollElementRect(element: Element): {
top: number;
left: number;
right: number;
bottom: number;
width: number;
height: number;
};
@@ -0,0 +1,130 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var index_exports = {};
__export(index_exports, {
PaginationItemType: () => PaginationItemType,
usePagination: () => usePagination
});
module.exports = __toCommonJS(index_exports);
var import_react = require("react");
var import_i18n = require("@react-aria/i18n");
var import_shared_utils = require("@heroui/shared-utils");
var PaginationItemType = /* @__PURE__ */ ((PaginationItemType2) => {
PaginationItemType2["DOTS"] = "dots";
PaginationItemType2["PREV"] = "prev";
PaginationItemType2["NEXT"] = "next";
return PaginationItemType2;
})(PaginationItemType || {});
function usePagination(props) {
const {
page,
total,
siblings = 1,
boundaries = 1,
initialPage = 1,
showControls = false,
onChange
} = props;
const [activePage, setActivePage] = (0, import_react.useState)(page || initialPage);
const { direction } = (0, import_i18n.useLocale)();
const isRTL = direction === "rtl";
const onChangeActivePage = (newPage) => {
setActivePage(newPage);
onChange && onChange(newPage);
};
(0, import_react.useEffect)(() => {
if (page && page !== activePage) {
setActivePage(page);
}
}, [page]);
const setPage = (0, import_react.useCallback)(
(pageNumber) => {
if (pageNumber <= 0) {
onChangeActivePage(1);
} else if (pageNumber > total) {
onChangeActivePage(total);
} else {
onChangeActivePage(pageNumber);
}
},
[total, activePage, onChangeActivePage]
);
const next = () => setPage(activePage + 1);
const previous = () => setPage(activePage - 1);
const first = () => setPage(1);
const last = () => setPage(total);
const formatRange = (0, import_react.useCallback)(
(range2) => {
if (showControls) {
return ["prev" /* PREV */, ...range2, "next" /* NEXT */];
}
return range2;
},
[isRTL, showControls]
);
const paginationRange = (0, import_react.useMemo)(() => {
const totalPageNumbers = siblings * 2 + 3 + boundaries * 2;
if (totalPageNumbers >= total) {
return formatRange((0, import_shared_utils.range)(1, total));
}
const leftSiblingIndex = Math.max(activePage - siblings, boundaries);
const rightSiblingIndex = Math.min(activePage + siblings, total - boundaries);
const shouldShowLeftDots = leftSiblingIndex > boundaries + 2;
const shouldShowRightDots = rightSiblingIndex < total - (boundaries + 1);
if (!shouldShowLeftDots && shouldShowRightDots) {
const leftItemCount = siblings * 2 + boundaries + 2;
return formatRange([
...(0, import_shared_utils.range)(1, leftItemCount),
"dots" /* DOTS */,
...(0, import_shared_utils.range)(total - (boundaries - 1), total)
]);
}
if (shouldShowLeftDots && !shouldShowRightDots) {
const rightItemCount = boundaries + 1 + 2 * siblings;
return formatRange([
...(0, import_shared_utils.range)(1, boundaries),
"dots" /* DOTS */,
...(0, import_shared_utils.range)(total - rightItemCount, total)
]);
}
return formatRange([
...(0, import_shared_utils.range)(1, boundaries),
"dots" /* DOTS */,
...(0, import_shared_utils.range)(leftSiblingIndex, rightSiblingIndex),
"dots" /* DOTS */,
...(0, import_shared_utils.range)(total - boundaries + 1, total)
]);
}, [total, activePage, siblings, boundaries, formatRange]);
return {
range: paginationRange,
activePage,
setPage,
next,
previous,
first,
last
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PaginationItemType,
usePagination
});
@@ -0,0 +1,34 @@
/**
* @fileoverview Utility functions for type annotation detection.
* @author Yannick Croissant
* @author Vitor Balocco
*/
'use strict';
const getFirstTokens = require('./eslint').getFirstTokens;
/**
* Checks if we are declaring a `props` argument with a flow type annotation.
* @param {ASTNode} node The AST node being checked.
* @param {Object} context
* @returns {boolean} True if the node is a type annotated props declaration, false if not.
*/
function isAnnotatedFunctionPropsDeclaration(node, context) {
if (!node || !node.params || !node.params.length) {
return false;
}
const typeNode = node.params[0].type === 'AssignmentPattern' ? node.params[0].left : node.params[0];
const tokens = getFirstTokens(context, typeNode, 2);
const isAnnotated = typeNode.typeAnnotation;
const isDestructuredProps = typeNode.type === 'ObjectPattern';
const isProps = tokens[0].value === 'props' || (tokens[1] && tokens[1].value === 'props');
return (isAnnotated && (isDestructuredProps || isProps));
}
module.exports = {
isAnnotatedFunctionPropsDeclaration,
};
@@ -0,0 +1,313 @@
import { expect, expectTypeOf, test } from "vitest";
import { z } from "zod/v4";
test("basic defaults", () => {
expect(z.string().default("default").parse(undefined)).toBe("default");
});
test("default with optional", () => {
const schema = z.string().optional().default("default");
expect(schema.parse(undefined)).toBe("default");
expect(schema.unwrap().parse(undefined)).toBe(undefined);
});
test("default with transform", () => {
const stringWithDefault = z
.string()
.transform((val) => val.toUpperCase())
.default("default");
expect(stringWithDefault.parse(undefined)).toBe("default");
expect(stringWithDefault).toBeInstanceOf(z.ZodDefault);
expect(stringWithDefault.unwrap()).toBeInstanceOf(z.ZodPipe);
expect(stringWithDefault.unwrap().in).toBeInstanceOf(z.ZodString);
expect(stringWithDefault.unwrap().out).toBeInstanceOf(z.ZodTransform);
type inp = z.input<typeof stringWithDefault>;
expectTypeOf<inp>().toEqualTypeOf<string | undefined>();
type out = z.output<typeof stringWithDefault>;
expectTypeOf<out>().toEqualTypeOf<string>();
});
test("default on existing optional", () => {
const stringWithDefault = z.string().optional().default("asdf");
expect(stringWithDefault.parse(undefined)).toBe("asdf");
expect(stringWithDefault).toBeInstanceOf(z.ZodDefault);
expect(stringWithDefault.unwrap()).toBeInstanceOf(z.ZodOptional);
expect(stringWithDefault.unwrap().unwrap()).toBeInstanceOf(z.ZodString);
type inp = z.input<typeof stringWithDefault>;
expectTypeOf<inp>().toEqualTypeOf<string | undefined>();
type out = z.output<typeof stringWithDefault>;
expectTypeOf<out>().toEqualTypeOf<string>();
});
test("optional on default", () => {
const stringWithDefault = z.string().default("asdf").optional();
type inp = z.input<typeof stringWithDefault>;
expectTypeOf<inp>().toEqualTypeOf<string | undefined>();
type out = z.output<typeof stringWithDefault>;
expectTypeOf<out>().toEqualTypeOf<string | undefined>();
expect(stringWithDefault.parse(undefined)).toBe("asdf");
});
// test("complex chain example", () => {
// const complex = z
// .string()
// .default("asdf")
// .transform((val) => val.toUpperCase())
// .default("qwer")
// .unwrap()
// .optional()
// .default("asdfasdf");
// expect(complex.parse(undefined)).toBe("asdfasdf");
// });
test("removeDefault", () => {
const stringWithRemovedDefault = z.string().default("asdf").removeDefault();
type out = z.output<typeof stringWithRemovedDefault>;
expectTypeOf<out>().toEqualTypeOf<string>();
});
test("apply default at output", () => {
const schema = z
.string()
.transform((_) => (Math.random() > 0 ? undefined : _))
.default("asdf");
expect(schema.parse("")).toEqual("asdf");
});
test("nested", () => {
const inner = z.string().default("asdf");
const outer = z.object({ inner }).default({
inner: "qwer",
});
type input = z.input<typeof outer>;
expectTypeOf<input>().toEqualTypeOf<{ inner?: string | undefined } | undefined>();
type out = z.output<typeof outer>;
expectTypeOf<out>().toEqualTypeOf<{ inner: string }>();
expect(outer.parse(undefined)).toEqual({ inner: "qwer" });
expect(outer.parse({})).toEqual({ inner: "asdf" });
expect(outer.parse({ inner: undefined })).toEqual({ inner: "asdf" });
});
test("chained defaults", () => {
const stringWithDefault = z.string().default("inner").default("outer");
const result = stringWithDefault.parse(undefined);
expect(result).toEqual("outer");
});
test("object optionality", () => {
const schema = z.object({
hi: z.string().default("hi"),
});
type schemaInput = z.input<typeof schema>;
type schemaOutput = z.output<typeof schema>;
expectTypeOf<schemaInput>().toEqualTypeOf<{ hi?: string | undefined }>();
expectTypeOf<schemaOutput>().toEqualTypeOf<{ hi: string }>();
expect(schema.parse({})).toEqual({
hi: "hi",
});
});
test("nested prefault/default", () => {
const a = z
.string()
.default("a")
.refine((val) => val.startsWith("a"));
const b = z
.string()
.refine((val) => val.startsWith("b"))
.default("b");
const c = z
.string()
.prefault("c")
.refine((val) => val.startsWith("c"));
const d = z
.string()
.refine((val) => val.startsWith("d"))
.prefault("d");
const obj = z.object({
a,
b,
c,
d,
});
expect(obj.safeParse({ a: "a1", b: "b1", c: "c1", d: "d1" })).toMatchInlineSnapshot(`
{
"data": {
"a": "a1",
"b": "b1",
"c": "c1",
"d": "d1",
},
"success": true,
}
`);
expect(obj.safeParse({ a: "f", b: "f", c: "f", d: "f" })).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "custom",
"path": [
"a"
],
"message": "Invalid input"
},
{
"code": "custom",
"path": [
"b"
],
"message": "Invalid input"
},
{
"code": "custom",
"path": [
"c"
],
"message": "Invalid input"
},
{
"code": "custom",
"path": [
"d"
],
"message": "Invalid input"
}
]],
"success": false,
}
`);
expect(obj.safeParse({})).toMatchInlineSnapshot(`
{
"data": {
"a": "a",
"b": "b",
"c": "c",
"d": "d",
},
"success": true,
}
`);
expect(obj.safeParse({ a: undefined, b: undefined, c: undefined, d: undefined })).toMatchInlineSnapshot(`
{
"data": {
"a": "a",
"b": "b",
"c": "c",
"d": "d",
},
"success": true,
}
`);
const obj2 = z.object({
a: a.optional(),
b: b.optional(),
c: c.optional(),
d: d.optional(),
});
expect(obj2.safeParse({ a: undefined, b: undefined, c: undefined, d: undefined })).toMatchInlineSnapshot(`
{
"data": {
"a": "a",
"b": "b",
"c": "c",
"d": "d",
},
"success": true,
}
`);
expect(a.parse(undefined)).toBe("a");
expect(b.parse(undefined)).toBe("b");
expect(c.parse(undefined)).toBe("c");
expect(d.parse(undefined)).toBe("d");
});
test("failing default", () => {
const a = z
.string()
.default("z")
.refine((val) => val.startsWith("a"));
const b = z
.string()
.refine((val) => val.startsWith("b"))
.default("z");
const c = z
.string()
.prefault("z")
.refine((val) => val.startsWith("c"));
const d = z
.string()
.refine((val) => val.startsWith("d"))
.prefault("z");
const obj = z.object({
a,
b,
c,
d,
});
expect(
obj.safeParse({
a: undefined,
b: undefined,
c: undefined,
d: undefined,
}).error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "custom",
"message": "Invalid input",
"path": [
"a",
],
},
{
"code": "custom",
"message": "Invalid input",
"path": [
"c",
],
},
{
"code": "custom",
"message": "Invalid input",
"path": [
"d",
],
},
]
`);
});
test("partial should not clobber defaults", () => {
const objWithDefaults = z.object({
a: z.string().default("defaultA"),
b: z.string().default("defaultB"),
c: z.string().default("defaultC"),
});
const objPartialWithOneRequired = objWithDefaults.partial(); //.required({ a: true });
const test = objPartialWithOneRequired.parse({});
expect(test).toMatchInlineSnapshot(`
{
"a": "defaultA",
"b": "defaultB",
"c": "defaultC",
}
`);
});
@@ -0,0 +1,12 @@
import type { SchemaOptions } from '../schema/index.mjs';
import type { Ensure, Evaluate } from '../helpers/index.mjs';
import type { TProperties } from '../object/index.mjs';
import { type TMappedResult } from '../mapped/index.mjs';
import { type TKeyOfFromType } from './keyof.mjs';
type TFromProperties<Properties extends TProperties> = ({
[K2 in keyof Properties]: TKeyOfFromType<Properties[K2]>;
});
type TFromMappedResult<MappedResult extends TMappedResult> = (Evaluate<TFromProperties<MappedResult['properties']>>);
export type TKeyOfFromMappedResult<MappedResult extends TMappedResult, Properties extends TProperties = TFromMappedResult<MappedResult>> = (Ensure<TMappedResult<Properties>>);
export declare function KeyOfFromMappedResult<MappedResult extends TMappedResult, Properties extends TProperties = TFromMappedResult<MappedResult>>(mappedResult: MappedResult, options?: SchemaOptions): TMappedResult<Properties>;
export {};
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from '../types.js';
import 'react';
declare const ClockCircleLinearIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { ClockCircleLinearIcon };
@@ -0,0 +1,74 @@
"use strict";
const node_child_process_1 = require("node:child_process");
const fs = require("node:fs");
const os = require("node:os");
const path = require("node:path");
const constants_js_1 = require("./constants.js");
const helpers_js_1 = require("./helpers.js");
const EXECUTORS = {
npm: 'npx',
pnpm: 'pnpm',
yarn: 'yarn',
bun: 'bun',
deno: (args) => ['deno', 'run', `npm:${args[0]}`, ...args.slice(1)],
};
function constructCommand(value, args) {
const list = typeof value === 'function'
? value(args)
:
[].concat(value, args);
return {
command: list[0],
args: list.slice(1),
};
}
function fallback(packageJsonPath, checkVersion) {
const packageJson = require(packageJsonPath);
const { name, version: pkgVersion, optionalDependencies } = packageJson;
const { napi, version = pkgVersion } = (0, helpers_js_1.getNapiInfoFromPackageJson)(packageJson, checkVersion);
if (checkVersion && pkgVersion !== version) {
throw new Error((0, helpers_js_1.errorMessage)(`Inconsistent package versions found for \`${name}\` v${pkgVersion} vs \`${napi.packageName}\` v${version}.`));
}
if (process.versions.webcontainer) {
const bindingPkgName = `${napi.packageName}-${constants_js_1.WASM32_WASI}`;
if (!optionalDependencies?.[bindingPkgName]) {
throw new Error((0, helpers_js_1.errorMessage)(`\`${constants_js_1.WASM32_WASI}\` target is unavailable for \`${name}\` v${version}`));
}
const baseDir = path.resolve(os.tmpdir(), `${name}-${version}`);
const bindingEntry = path.resolve(baseDir, `node_modules/${bindingPkgName}/${napi.binaryName}.wasi.cjs`);
if (!fs.existsSync(bindingEntry)) {
fs.rmSync(baseDir, { recursive: true, force: true });
fs.mkdirSync(baseDir, { recursive: true });
const bindingPkg = `${bindingPkgName}@${version}`;
console.log((0, helpers_js_1.errorMessage)(`Downloading \`${bindingPkg}\` on WebContainer...`));
(0, node_child_process_1.execFileSync)('pnpm', ['i', bindingPkg], {
cwd: baseDir,
stdio: 'inherit',
});
}
return require(bindingEntry);
}
const userAgent = ((process.env.npm_config_user_agent || '').split('/')[0] ||
'npm');
const executor = EXECUTORS[userAgent];
if (!executor) {
throw new Error((0, helpers_js_1.errorMessage)(`Unsupported package manager: ${userAgent}. Supported managers are: ${Object.keys(EXECUTORS).join(', ')}.`));
}
const { command, args } = constructCommand(executor, [
'napi-postinstall',
name,
version,
checkVersion ? '1' : '0',
]);
const pkgDir = path.dirname(packageJsonPath);
(0, node_child_process_1.execFileSync)(command, args, {
cwd: pkgDir,
stdio: 'inherit',
});
process.env[`SKIP_${name.replace(/-/g, '_').toUpperCase()}_FALLBACK`] = '1';
const PKG_RESOLVED_PATH = require.resolve(pkgDir);
delete require.cache[PKG_RESOLVED_PATH];
return require(pkgDir);
}
module.exports = fallback;
//# sourceMappingURL=fallback.js.map
@@ -0,0 +1,179 @@
'use strict';
var fs = require('fs');
var path = require('path');
Object.defineProperty(exports, 'commentRegex', {
get: function getCommentRegex () {
return /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg;
}
});
Object.defineProperty(exports, 'mapFileCommentRegex', {
get: function getMapFileCommentRegex () {
// Matches sourceMappingURL in either // or /* comment styles.
return /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg;
}
});
var decodeBase64;
if (typeof Buffer !== 'undefined') {
if (typeof Buffer.from === 'function') {
decodeBase64 = decodeBase64WithBufferFrom;
} else {
decodeBase64 = decodeBase64WithNewBuffer;
}
} else {
decodeBase64 = decodeBase64WithAtob;
}
function decodeBase64WithBufferFrom(base64) {
return Buffer.from(base64, 'base64').toString();
}
function decodeBase64WithNewBuffer(base64) {
if (typeof value === 'number') {
throw new TypeError('The value to decode must not be of type number.');
}
return new Buffer(base64, 'base64').toString();
}
function decodeBase64WithAtob(base64) {
return decodeURIComponent(escape(atob(base64)));
}
function stripComment(sm) {
return sm.split(',').pop();
}
function readFromFileMap(sm, dir) {
// NOTE: this will only work on the server since it attempts to read the map file
var r = exports.mapFileCommentRegex.exec(sm);
// for some odd reason //# .. captures in 1 and /* .. */ in 2
var filename = r[1] || r[2];
var filepath = path.resolve(dir, filename);
try {
return fs.readFileSync(filepath, 'utf8');
} catch (e) {
throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e);
}
}
function Converter (sm, opts) {
opts = opts || {};
if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir);
if (opts.hasComment) sm = stripComment(sm);
if (opts.isEncoded) sm = decodeBase64(sm);
if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm);
this.sourcemap = sm;
}
Converter.prototype.toJSON = function (space) {
return JSON.stringify(this.sourcemap, null, space);
};
if (typeof Buffer !== 'undefined') {
if (typeof Buffer.from === 'function') {
Converter.prototype.toBase64 = encodeBase64WithBufferFrom;
} else {
Converter.prototype.toBase64 = encodeBase64WithNewBuffer;
}
} else {
Converter.prototype.toBase64 = encodeBase64WithBtoa;
}
function encodeBase64WithBufferFrom() {
var json = this.toJSON();
return Buffer.from(json, 'utf8').toString('base64');
}
function encodeBase64WithNewBuffer() {
var json = this.toJSON();
if (typeof json === 'number') {
throw new TypeError('The json to encode must not be of type number.');
}
return new Buffer(json, 'utf8').toString('base64');
}
function encodeBase64WithBtoa() {
var json = this.toJSON();
return btoa(unescape(encodeURIComponent(json)));
}
Converter.prototype.toComment = function (options) {
var base64 = this.toBase64();
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
};
// returns copy instead of original
Converter.prototype.toObject = function () {
return JSON.parse(this.toJSON());
};
Converter.prototype.addProperty = function (key, value) {
if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead');
return this.setProperty(key, value);
};
Converter.prototype.setProperty = function (key, value) {
this.sourcemap[key] = value;
return this;
};
Converter.prototype.getProperty = function (key) {
return this.sourcemap[key];
};
exports.fromObject = function (obj) {
return new Converter(obj);
};
exports.fromJSON = function (json) {
return new Converter(json, { isJSON: true });
};
exports.fromBase64 = function (base64) {
return new Converter(base64, { isEncoded: true });
};
exports.fromComment = function (comment) {
comment = comment
.replace(/^\/\*/g, '//')
.replace(/\*\/$/g, '');
return new Converter(comment, { isEncoded: true, hasComment: true });
};
exports.fromMapFileComment = function (comment, dir) {
return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true });
};
// Finds last sourcemap comment in file or returns null if none was found
exports.fromSource = function (content) {
var m = content.match(exports.commentRegex);
return m ? exports.fromComment(m.pop()) : null;
};
// Finds last sourcemap comment in file or returns null if none was found
exports.fromMapFileSource = function (content, dir) {
var m = content.match(exports.mapFileCommentRegex);
return m ? exports.fromMapFileComment(m.pop(), dir) : null;
};
exports.removeComments = function (src) {
return src.replace(exports.commentRegex, '');
};
exports.removeMapFileComments = function (src) {
return src.replace(exports.mapFileCommentRegex, '');
};
exports.generateMapFileComment = function (file, options) {
var data = 'sourceMappingURL=' + file;
return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
};
@@ -0,0 +1,24 @@
// Klingon [tlh]
import dayjs from '../index';
var locale = {
name: 'tlh',
weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'),
weekStart: 1,
weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
monthsShort: 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),
weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
ordinal: function ordinal(n) {
return n;
},
formats: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,25 @@
/**
* Generate the default label that GitHub uses on backreferences.
*
* @param {number} referenceIndex
* Index of the definition in the order that they are first referenced,
* 0-indexed.
* @param {number} rereferenceIndex
* Index of calls to the same definition, 0-indexed.
* @returns {string}
* Default label.
*/
export function defaultBackLabel(referenceIndex: number, rereferenceIndex: number): string;
/**
* Create an extension for `micromark` to support GFM footnotes when
* serializing to HTML.
*
* @param {Options | null | undefined} [options={}]
* Configuration (optional).
* @returns {HtmlExtension}
* Extension for `micromark` that can be passed in `htmlExtensions` to
* support GFM footnotes when serializing to HTML.
*/
export function gfmFootnoteHtml(options?: Options | null | undefined): HtmlExtension;
import type { HtmlOptions as Options } from 'micromark-extension-gfm-footnote';
import type { HtmlExtension } from 'micromark-util-types';
@@ -0,0 +1,29 @@
/*********************************************************************
* NAN - Native Abstractions for Node.js
*
* Copyright (c) 2018 NAN contributors
*
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/
#ifndef NAN_DEFINE_OWN_PROPERTY_HELPER_H_
#define NAN_DEFINE_OWN_PROPERTY_HELPER_H_
namespace imp {
inline Maybe<bool> DefineOwnPropertyHelper(
v8::PropertyAttribute current
, v8::Handle<v8::Object> obj
, v8::Handle<v8::String> key
, v8::Handle<v8::Value> value
, v8::PropertyAttribute attribs = v8::None) {
return !(current & v8::DontDelete) || // configurable OR
(!(current & v8::ReadOnly) && // writable AND
!((attribs ^ current) & ~v8::ReadOnly)) // same excluding RO
? Just<bool>(obj->ForceSet(key, value, attribs))
: Nothing<bool>();
}
} // end of namespace imp
#endif // NAN_DEFINE_OWN_PROPERTY_HELPER_H_
@@ -0,0 +1,7 @@
"use strict";
const RuleTester = require("./rule-tester");
module.exports = {
RuleTester,
};
@@ -0,0 +1,28 @@
{
"name": "color-name",
"version": "1.1.4",
"description": "A list of color names and its values",
"main": "index.js",
"files": [
"index.js"
],
"scripts": {
"test": "node test.js"
},
"repository": {
"type": "git",
"url": "git@github.com:colorjs/color-name.git"
},
"keywords": [
"color-name",
"color",
"color-keyword",
"keyword"
],
"author": "DY <dfcreative@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/colorjs/color-name/issues"
},
"homepage": "https://github.com/colorjs/color-name"
}
@@ -0,0 +1,4 @@
import Decimal from 'decimal.js';
export declare const TEN: Decimal;
export declare const ZERO: Decimal;
export declare const NEGATIVE_ZERO: Decimal;
@@ -0,0 +1 @@
{"name":"setprototypeof","version":"1.2.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532088785,"integrity":"sha512-bZuVvGYqCbU2T2+5Q+IImEzVDCPM1TYb2GJh/O6tmXsgO7OXIfDYLbLTXU/MZL5w5ItxJE2qUW3sfsCbYdravA==","mode":420,"size":1264},"index.d.ts":{"checkedAt":1794532088785,"integrity":"sha512-DS8yCXKYh/pZjbbttyDyJ66N+0/buJ34BR7eaaA45Hkl7qadfzE2VQAZzG5xP9sta9zRvoKTGBJHro7eHXD+cA==","mode":420,"size":93},"index.js":{"checkedAt":1794532088786,"integrity":"sha512-PpSmz/Avu7KWcB+Xn3m2Wu/WTFGnYZvUfcoht6Q2HiCao9HV19FL6G72EEOh3NpQcZWfBP6RlKat/fr9ytNkMg==","mode":420,"size":407},"LICENSE":{"checkedAt":1794532088786,"integrity":"sha512-VjzuMZnrO+c+8UVnuezGZlEM8Ae3aLTlPsK1+EuOCRUAclhQEsvBhuKCr0nf6OKxTTAf0OPGcFoBV2ItQ4ChbA==","mode":420,"size":727},"README.md":{"checkedAt":1794532088786,"integrity":"sha512-TOLBxqD6UCNFMwZ66MoSBy01P6PtYwLQwARS0xhxO8V2BBFJM8t3wa/3ek1B8z2rHHLkU67BxUCNAzXxdjJEmQ==","mode":420,"size":844},"test/index.js":{"checkedAt":1794532088786,"integrity":"sha512-SVCtTGyBr+EKHFaWpf2wVvgmGVotu6lY62Etw6cn5QFWkB+V5GeBk29bi4S7+4qSZOwiEPvcl4wJ76ELO4wZPQ==","mode":420,"size":690}}}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A wC","132":"B"},B:{"132":"C L M G N O P","1028":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"2":"0 1 2 6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0C 1C","4098":"3","8258":"4 5 GB HB IB JB KB LB MB NB OB PB QB RB SB TB","16388":"UB VB WB XB YB I XC MC YC yC zC"},D:{"2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p","2052":"0 1 2 3 4 5 q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC"},E:{"1":"L M G 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K D E F A 2C ZC 3C 4C 5C 6C aC","516":"B C NC OC"},F:{"2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c FD GD HD ID NC uC JD OC","2052":"0 1 2 3 4 5 d e f g h i j k l m n o p q r s t u v w x y z"},G:{"1":"TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD RD SD"},H:{"2":"hD"},I:{"2":"TC J iD jD kD lD vC mD nD","2052":"I"},J:{"2":"D A"},K:{"2":"A B C NC uC OC","258":"H"},L:{"2052":"I"},M:{"16388":"MC"},N:{"2":"A B"},O:{"2":"PC"},P:{"1":"7 8 9 AB BB CB DB EB FB","2":"J","258":"6 oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"2":"zD"},R:{"1":"0D"},S:{"2":"1D 2D"}},B:6,C:"HEVC/H.265 video format",D:true};
@@ -0,0 +1,152 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValueHashError = void 0;
exports.Hash = Hash;
const index_1 = require("../guard/index");
const index_2 = require("../../type/error/index");
// ------------------------------------------------------------------
// Errors
// ------------------------------------------------------------------
class ValueHashError extends index_2.TypeBoxError {
constructor(value) {
super(`Unable to hash value`);
this.value = value;
}
}
exports.ValueHashError = ValueHashError;
// ------------------------------------------------------------------
// ByteMarker
// ------------------------------------------------------------------
var ByteMarker;
(function (ByteMarker) {
ByteMarker[ByteMarker["Undefined"] = 0] = "Undefined";
ByteMarker[ByteMarker["Null"] = 1] = "Null";
ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean";
ByteMarker[ByteMarker["Number"] = 3] = "Number";
ByteMarker[ByteMarker["String"] = 4] = "String";
ByteMarker[ByteMarker["Object"] = 5] = "Object";
ByteMarker[ByteMarker["Array"] = 6] = "Array";
ByteMarker[ByteMarker["Date"] = 7] = "Date";
ByteMarker[ByteMarker["Uint8Array"] = 8] = "Uint8Array";
ByteMarker[ByteMarker["Symbol"] = 9] = "Symbol";
ByteMarker[ByteMarker["BigInt"] = 10] = "BigInt";
})(ByteMarker || (ByteMarker = {}));
// ------------------------------------------------------------------
// State
// ------------------------------------------------------------------
let Accumulator = BigInt('14695981039346656037');
const [Prime, Size] = [BigInt('1099511628211'), BigInt('18446744073709551616' /* 2 ^ 64 */)];
const Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));
const F64 = new Float64Array(1);
const F64In = new DataView(F64.buffer);
const F64Out = new Uint8Array(F64.buffer);
// ------------------------------------------------------------------
// NumberToBytes
// ------------------------------------------------------------------
function* NumberToBytes(value) {
const byteCount = value === 0 ? 1 : Math.ceil(Math.floor(Math.log2(value) + 1) / 8);
for (let i = 0; i < byteCount; i++) {
yield (value >> (8 * (byteCount - 1 - i))) & 0xff;
}
}
// ------------------------------------------------------------------
// Hashing Functions
// ------------------------------------------------------------------
function ArrayType(value) {
FNV1A64(ByteMarker.Array);
for (const item of value) {
Visit(item);
}
}
function BooleanType(value) {
FNV1A64(ByteMarker.Boolean);
FNV1A64(value ? 1 : 0);
}
function BigIntType(value) {
FNV1A64(ByteMarker.BigInt);
F64In.setBigInt64(0, value);
for (const byte of F64Out) {
FNV1A64(byte);
}
}
function DateType(value) {
FNV1A64(ByteMarker.Date);
Visit(value.getTime());
}
function NullType(value) {
FNV1A64(ByteMarker.Null);
}
function NumberType(value) {
FNV1A64(ByteMarker.Number);
F64In.setFloat64(0, value);
for (const byte of F64Out) {
FNV1A64(byte);
}
}
function ObjectType(value) {
FNV1A64(ByteMarker.Object);
for (const key of globalThis.Object.getOwnPropertyNames(value).sort()) {
Visit(key);
Visit(value[key]);
}
}
function StringType(value) {
FNV1A64(ByteMarker.String);
for (let i = 0; i < value.length; i++) {
for (const byte of NumberToBytes(value.charCodeAt(i))) {
FNV1A64(byte);
}
}
}
function SymbolType(value) {
FNV1A64(ByteMarker.Symbol);
Visit(value.description);
}
function Uint8ArrayType(value) {
FNV1A64(ByteMarker.Uint8Array);
for (let i = 0; i < value.length; i++) {
FNV1A64(value[i]);
}
}
function UndefinedType(value) {
return FNV1A64(ByteMarker.Undefined);
}
function Visit(value) {
if ((0, index_1.IsArray)(value))
return ArrayType(value);
if ((0, index_1.IsBoolean)(value))
return BooleanType(value);
if ((0, index_1.IsBigInt)(value))
return BigIntType(value);
if ((0, index_1.IsDate)(value))
return DateType(value);
if ((0, index_1.IsNull)(value))
return NullType(value);
if ((0, index_1.IsNumber)(value))
return NumberType(value);
if ((0, index_1.IsObject)(value))
return ObjectType(value);
if ((0, index_1.IsString)(value))
return StringType(value);
if ((0, index_1.IsSymbol)(value))
return SymbolType(value);
if ((0, index_1.IsUint8Array)(value))
return Uint8ArrayType(value);
if ((0, index_1.IsUndefined)(value))
return UndefinedType(value);
throw new ValueHashError(value);
}
function FNV1A64(byte) {
Accumulator = Accumulator ^ Bytes[byte];
Accumulator = (Accumulator * Prime) % Size;
}
// ------------------------------------------------------------------
// Hash
// ------------------------------------------------------------------
/** Creates a FNV1A-64 non cryptographic hash of the given value */
function Hash(value) {
Accumulator = BigInt('14695981039346656037');
Visit(value);
return Accumulator;
}
@@ -0,0 +1,5 @@
export * from "./ErrorBoundary.js";
export * from "./ErrorBoundaryContext.js";
export * from "./useErrorBoundary.js";
export * from "./withErrorBoundary.js";
export * from "./types.js";
@@ -0,0 +1,12 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2023_intl = void 0;
const base_config_1 = require("./base-config");
exports.es2023_intl = {
libs: [],
variables: [['Intl', base_config_1.TYPE_VALUE]],
};
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAwDM,SAAS,0CAAsB,QAA4B,CAAC,CAAC;IAClE,IAAI,CAAC,gBAAgB,SAAS,GAAG,CAAA,GAAA,2CAAiB,EAAE,MAAM,KAAK,EAAE,MAAM,YAAY,IAAI,EAAE,EAAE,MAAM,QAAQ;IACzG,IAAI,aAAa,CAAC,CAAC,MAAM,UAAU,IAAI,eAAe,MAAM,KAAK;IAEjE,IAAI,gBAAgB,CAAA,GAAA,mBAAK,EAAE,IAAI;IAC/B,IAAI,aAAa,CAAA,GAAA,8CAAqB,EAAE;QACtC,GAAG,KAAK;QACR,OAAO;IACT;IAEA,IAAI,YAAY,WAAW,iBAAiB,CAAC,SAAS;QAqDnC;IApDnB,MAAM,QAA4B;QAChC,GAAG,UAAU;QACb,OAAO;QACP,UAAS,KAAK;YACZ,IAAI,MAAM,UAAU,IAAI,MAAM,UAAU,EACtC;YAGF,SAAS;QACX;QACA,YAAY,MAAM,UAAU,IAAI;QAChC,YAAY,MAAM,UAAU,IAAI;QAChC,YAAW,KAAK;YACd,OAAO,eAAe,QAAQ,CAAC;QACjC;QACA,UAAS,KAAK;YACZ,IAAI,MAAM,UAAU,IAAI,MAAM,UAAU,EACtC;YAEF,IAAI,CAAC,eAAe,QAAQ,CAAC,QAC3B,SAAS,eAAe,MAAM,CAAC;QAEnC;QACA,aAAY,KAAK;YACf,IAAI,MAAM,UAAU,IAAI,MAAM,UAAU,EACtC;YAEF,IAAI,eAAe,QAAQ,CAAC,QAC1B,SAAS,eAAe,MAAM,CAAC,CAAA,gBAAiB,kBAAkB;QAEtE;QACA,aAAY,KAAK;YACf,IAAI,MAAM,UAAU,IAAI,MAAM,UAAU,EACtC;YAEF,IAAI,eAAe,QAAQ,CAAC,QAC1B,SAAS,eAAe,MAAM,CAAC,CAAA,gBAAiB,kBAAkB;iBAElE,SAAS,eAAe,MAAM,CAAC;QAEnC;QACA,YAAW,KAAK,EAAE,CAAC;YACjB,IAAI,IAAI,IAAI,IAAI,cAAc,OAAO;YACrC,IAAI,EAAE,SAAS,EACb,EAAE,GAAG,CAAC,OAAO;iBAEb,EAAE,MAAM,CAAC;YAGX,cAAc,OAAO,GAAG;YACxB,WAAW,gBAAgB,CAAC,CAAA,GAAA,uCAAc,KAAK,EAAE,MAAM;QACzD;QACA,iBAAiB,CAAA,yBAAA,MAAM,eAAe,cAArB,oCAAA,yBAA0B,YAAY,YAAY;mBACnE;oBACA;IACF;IAEA,OAAO;AACT","sources":["packages/@react-stately/checkbox/src/useCheckboxGroupState.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 {CheckboxGroupProps} from '@react-types/checkbox';\nimport {FormValidationState, mergeValidation, useFormValidationState} from '@react-stately/form';\nimport {useControlledState} from '@react-stately/utils';\nimport {useRef} from 'react';\nimport {ValidationResult, ValidationState} from '@react-types/shared';\n\nexport interface CheckboxGroupState extends FormValidationState {\n /** Current selected values. */\n readonly value: readonly string[],\n\n /** Whether the checkbox group is disabled. */\n readonly isDisabled: boolean,\n\n /** Whether the checkbox group is read only. */\n readonly isReadOnly: boolean,\n\n /**\n * The current validation state of the checkbox group.\n * @deprecated Use `isInvalid` instead.\n */\n readonly validationState: ValidationState | null,\n\n /** Whether the checkbox group is invalid. */\n readonly isInvalid: boolean,\n\n /**\n * Whether the checkboxes in the group are required.\n * This changes to false once at least one item is selected.\n */\n readonly isRequired: boolean,\n\n /** Returns whether the given value is selected. */\n isSelected(value: string): boolean,\n\n /** Sets the selected values. */\n setValue(value: string[]): void,\n\n /** Adds a value to the set of selected values. */\n addValue(value: string): void,\n\n /** Removes a value from the set of selected values. */\n removeValue(value: string): void,\n\n /** Toggles a value in the set of selected values. */\n toggleValue(value: string): void,\n\n /** Sets whether one of the checkboxes is invalid. */\n setInvalid(value: string, validation: ValidationResult): void\n}\n\n/**\n * Provides state management for a checkbox group component. Provides a name for the group,\n * and manages selection and focus state.\n */\nexport function useCheckboxGroupState(props: CheckboxGroupProps = {}): CheckboxGroupState {\n let [selectedValues, setValue] = useControlledState(props.value, props.defaultValue || [], props.onChange);\n let isRequired = !!props.isRequired && selectedValues.length === 0;\n\n let invalidValues = useRef(new Map<string, ValidationResult>());\n let validation = useFormValidationState({\n ...props,\n value: selectedValues\n });\n\n let isInvalid = validation.displayValidation.isInvalid;\n const state: CheckboxGroupState = {\n ...validation,\n value: selectedValues,\n setValue(value) {\n if (props.isReadOnly || props.isDisabled) {\n return;\n }\n\n setValue(value);\n },\n isDisabled: props.isDisabled || false,\n isReadOnly: props.isReadOnly || false,\n isSelected(value) {\n return selectedValues.includes(value);\n },\n addValue(value) {\n if (props.isReadOnly || props.isDisabled) {\n return;\n }\n if (!selectedValues.includes(value)) {\n setValue(selectedValues.concat(value));\n }\n },\n removeValue(value) {\n if (props.isReadOnly || props.Line truncated
@@ -0,0 +1 @@
module.exports={C:{"110":0.02729,"111":0.00546,"115":0.0764,"127":0.00546,"142":0.0382,"143":0.18554,"144":0.16371,"145":0.00546,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 112 113 114 116 117 118 119 120 121 122 123 124 125 126 128 129 130 131 132 133 134 135 136 137 138 139 140 141 146 147 3.5 3.6"},D:{"26":0.00546,"39":0.01637,"40":0.01637,"41":0.01637,"42":0.01637,"43":0.01637,"44":0.02183,"45":0.01091,"46":0.01637,"47":0.01637,"48":0.02183,"49":0.01637,"50":0.01637,"51":0.01091,"52":0.02183,"53":0.02183,"54":0.0382,"55":0.01091,"56":0.01637,"57":0.01091,"58":0.01637,"59":0.02183,"60":0.01637,"69":0.00546,"73":0.01637,"79":0.04366,"81":0.00546,"83":0.0764,"87":0.02183,"90":0.00546,"91":0.01091,"92":0.00546,"93":0.02183,"94":0.00546,"95":0.00546,"97":0.05457,"98":0.00546,"103":0.0382,"105":0.01091,"109":0.16371,"111":0.01637,"112":2.95769,"114":0.01091,"116":0.00546,"117":0.02183,"119":0.00546,"120":0.04911,"121":0.00546,"122":0.02729,"124":0.06548,"125":18.48286,"126":0.35471,"127":0.01091,"128":0.02183,"129":0.00546,"130":0.01637,"131":0.02729,"132":0.10914,"133":0.01091,"134":0.04911,"135":0.01637,"136":0.01637,"137":0.20737,"138":0.25648,"139":0.87312,"140":3.85264,"141":9.38058,"142":0.20737,"143":0.00546,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 28 29 30 31 32 33 34 35 36 37 38 61 62 63 64 65 66 67 68 70 71 72 74 75 76 77 78 80 84 85 86 88 89 96 99 100 101 102 104 106 107 108 110 113 115 118 123 144 145"},F:{"90":0.00546,"92":0.12551,"120":0.0764,"121":0.0382,"122":0.67667,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"16":0.00546,"18":0.01091,"92":0.01091,"109":0.02183,"114":0.5457,"116":0.00546,"117":0.00546,"120":0.01091,"122":0.02183,"131":0.00546,"132":0.00546,"134":0.02729,"137":0.01091,"138":0.02183,"139":0.06003,"140":0.77489,"141":5.09684,"142":0.00546,_:"12 13 14 15 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 118 119 121 123 124 125 126 127 128 129 130 133 135 136"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.5 16.0 16.1 16.4 16.5 17.0 17.2 17.3 17.4 18.0 18.1 26.2","5.1":0.00546,"13.1":0.00546,"14.1":0.01091,"15.4":0.00546,"15.6":0.07094,"16.2":0.00546,"16.3":0.00546,"16.6":0.01091,"17.1":0.02729,"17.5":0.02183,"17.6":0.16917,"18.2":0.00546,"18.3":0.01637,"18.4":0.00546,"18.5-18.6":0.05457,"26.0":0.33288,"26.1":0.00546},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00058,"5.0-5.1":0,"6.0-6.1":0.00233,"7.0-7.1":0.00174,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00523,"10.0-10.2":0.00058,"10.3":0.00989,"11.0-11.2":0.14657,"11.3-11.4":0.00349,"12.0-12.1":0.00116,"12.2-12.5":0.0285,"13.0-13.1":0,"13.2":0.00291,"13.3":0.00116,"13.4-13.7":0.00465,"14.0-14.4":0.00989,"14.5-14.8":0.01047,"15.0-15.1":0.00989,"15.2-15.3":0.00756,"15.4":0.00872,"15.5":0.00989,"15.6-15.8":0.12912,"16.0":0.01745,"16.1":0.03257,"16.2":0.01687,"16.3":0.03024,"16.4":0.00756,"16.5":0.01338,"16.6-16.7":0.17274,"17.0":0.01221,"17.1":0.01861,"17.2":0.01338,"17.3":0.01978,"17.4":0.0349,"17.5":0.05991,"17.6-17.7":0.15122,"18.0":0.03432,"18.1":0.07096,"18.2":0.03839,"18.3":0.12331,"18.4":0.0634,"18.5-18.6":3.23271,"26.0":0.39958,"26.1":0.01454},P:{"4":0.02129,"21":0.05324,"22":0.03194,"23":0.01065,"24":0.08518,"25":0.09582,"26":0.02129,"27":0.11712,"28":2.9386,"29":0.181,_:"20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 17.0 18.0","7.2-7.4":0.03194,"16.0":0.03194,"19.0":0.01065},I:{"0":0.00908,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.55891,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.17722},Q:{"14.9":0.01363},O:{"0":0.12269},H:{"0":0},L:{"0":41.24396}};
@@ -0,0 +1,430 @@
export default `flf2a$ 4 3 10 -1 20
Cyberfont - large
Figlet conversion by Kent Nassen, kentn@cyberspace.org, 8-10-94
From: stock@fwi.uva.nl (Lennert Stock)
Date: 15 Jul 1994 00:04:25 GMT
Here are some fonts. Non-figlet I'm afraid, if you wanna convert them, be
my guest. I posted the isometric fonts before.
------------------------------------------------------------------------------
.x%%%%%%x. .x%%%%%%x.
,%%%%%%%%%%. .%%%%%%%%%%.
,%%%' )' \\) :( \`( \`%%%.
,%x%)________) --------- L e n n e r t S t o c k ( _ __ (%x%.
(%%%~^88P~88P| |~=> .=-~ %%%)
(%%::. .:,\\ .' \`. /,:. .::%%)
\`;%:\`\\. \`-' | | \`-' ./':%:'
\`\`x\`. -===.' stock@fwi.uva.nl -------- \`.===- .'x''
/ \`:\`.__.; :.__.':' \\
.d8b. ..\`. .'.. .d8b.
$ $@
$ $@
$ $@
$ $@@
/@
/ @
. @
$@@
..@
''@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
.@
'@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
$@
$@
.@
'@@
$$$@
___@
$$$@
$$$@@
$@
$@
.@
$@@
/@
/ @
/ @
/ @@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
$@
.@
.@
$@@
$@
.@
.@
'@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
____ @
___|@
\\ @
\` @@
@
@
@
@@
_______@
|_____|@
| |@
@@
______ @
|_____]@
|_____]@
@@
_______@
| $@
|_____$@
@@
______$@
| \\@
|_____/@
@@
_______@
|______@
|______@
@@
_______@
|______@
| $@
@@
______@
| ____@
|_____|@
@@
_ _@
|_____|@
| |@
@@
_____@
| $@
__|__@
@@
_____@
| $@
__| $@
@@
_ _@
|____/$@
| \\_@
@@
$ $@
| $@
|_____@
@@
_______@
| | |@
| | |@
@@
__ _@
| \\ |@
| \\_|@
@@
_____ @
| |@
|_____|@
@@
_____ @
|_____]@
| $@
@@
_____ @
| __|@
|____\\|@
@@
______@
|_____/@
| \\_@
@@
_______@
|______@
______|@
@@
_______@
| $@
| $@
@@
_ _@
| |@
|_____|@
@@
_ _@
\\ /$@
\\/ $@
@@
_ _ _@
| | |@
|__|__|@
@@
_ _@
\\___/$@
_/ \\_@
@@
__ __@
\\_/ $@
| $@
@@
______@
____/@
/_____@
@@
@
@
@
@@
\\ @
\\ @
\\ @
\\@@
@
@
@
@@
@
@
@
@@
@
@
_____@
@@
.@
\`@
@
@@
_______@
|_____|@
| |@
@@
______ @
|_____]@
|_____]@
@@
_______@
| $@
|_____$@
@@
______$@
| \\@
|_____/@
@@
_______@
|______@
|______@
@@
_______@
|______@
| $@
@@
______@
| ____@
|_____|@
@@
_ _@
|_____|@
| |@
@@
_____@
| $@
__|__@
@@
_____@
| $@
__| $@
@@
_ _@
|____/$@
| \\_@
@@
$ $@
| $@
|_____@
@@
_______@
| | |@
| | |@
@@
__ _@
| \\ |@
| \\_|@
@@
_____ @
| |@
|_____|@
@@
_____ @
|_____]@
| $@
@@
_____ @
| __|@
|____\\|@
@@
______@
|_____/@
| \\_@
@@
_______@
|______@
______|@
@@
_______@
| $@
| $@
@@
_ _@
| |@
|_____|@
@@
_ _@
\\ /$@
\\/ $@
@@
_ _ _@
| | |@
|__|__|@
@@
_ _@
\\___/$@
_/ \\_@
@@
__ __@
\\_/ $@
| $@
@@
______@
____/@
/_____@
@@
@
@
@
@@
|@
|@
|@
|@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
`
@@ -0,0 +1,719 @@
# mdast-util-mdx-jsx
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]
[mdast][] extensions to parse and serialize [MDX][] JSX (`<a />`).
## Contents
* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`mdxJsxFromMarkdown()`](#mdxjsxfrommarkdown)
* [`mdxJsxToMarkdown(options?)`](#mdxjsxtomarkdownoptions)
* [`MdxJsxAttribute`](#mdxjsxattribute)
* [`MdxJsxAttributeValueExpression`](#mdxjsxattributevalueexpression)
* [`MdxJsxExpressionAttribute`](#mdxjsxexpressionattribute)
* [`MdxJsxFlowElement`](#mdxjsxflowelement)
* [`MdxJsxFlowElementHast`](#mdxjsxflowelementhast)
* [`MdxJsxTextElement`](#mdxjsxtextelement)
* [`MdxJsxTextElementHast`](#mdxjsxtextelementhast)
* [`ToMarkdownOptions`](#tomarkdownoptions)
* [HTML](#html)
* [Syntax](#syntax)
* [Syntax tree](#syntax-tree)
* [Nodes](#nodes)
* [Mixin](#mixin)
* [Content model](#content-model)
* [Types](#types)
* [Compatibility](#compatibility)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package contains two extensions that add support for MDX JSX syntax in
markdown to [mdast][].
These extensions plug into
[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing
JSX in markdown into a syntax tree) and
[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing
JSX in syntax trees to markdown).
[JSX][] is an XML-like syntax extension to ECMAScript (JavaScript), which MDX
brings to markdown.
For more info on MDX, see [What is MDX?][what-is-mdx]
## When to use this
You can use these extensions when you are working with
`mdast-util-from-markdown` and `mdast-util-to-markdown` already.
When working with `mdast-util-from-markdown`, you must combine this package
with [`micromark-extension-mdx-jsx`][micromark-extension-mdx-jsx].
When you are working with syntax trees and want all of MDX, use
[`mdast-util-mdx`][mdast-util-mdx] instead.
All these packages are used in [`remark-mdx`][remark-mdx], which
focusses on making it easier to transform content by abstracting these
internals away.
## Install
This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:
```sh
npm install mdast-util-mdx-jsx
```
In Deno with [`esm.sh`][esmsh]:
```js
import {mdxJsxFromMarkdown, mdxJsxToMarkdown} from 'https://esm.sh/mdast-util-mdx-jsx@3'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {mdxJsxFromMarkdown, mdxJsxToMarkdown} from 'https://esm.sh/mdast-util-mdx-jsx@3?bundle'
</script>
```
## Use
Say our document `example.mdx` contains:
```mdx
<Box>
- a list
</Box>
<MyComponent {...props} />
<abbr title="Hypertext Markup Language">HTML</abbr> is a lovely language.
```
…and our module `example.js` looks as follows:
```js
import fs from 'node:fs/promises'
import * as acorn from 'acorn'
import {mdxJsx} from 'micromark-extension-mdx-jsx'
import {fromMarkdown} from 'mdast-util-from-markdown'
import {mdxJsxFromMarkdown, mdxJsxToMarkdown} from 'mdast-util-mdx-jsx'
import {toMarkdown} from 'mdast-util-to-markdown'
const doc = await fs.readFile('example.mdx')
const tree = fromMarkdown(doc, {
extensions: [mdxJsx({acorn, addResult: true})],
mdastExtensions: [mdxJsxFromMarkdown()]
})
console.log(tree)
const out = toMarkdown(tree, {extensions: [mdxJsxToMarkdown()]})
console.log(out)
```
…now running `node example.js` yields (positional info removed for brevity):
```js
{
type: 'root',
children: [
{
type: 'mdxJsxFlowElement',
name: 'Box',
attributes: [],
children: [
{
type: 'list',
ordered: false,
start: null,
spread: false,
children: [
{
type: 'listItem',
spread: false,
checked: null,
children: [
{type: 'paragraph', children: [{type: 'text', value: 'a list'}]}
]
}
]
}
]
},
{
type: 'mdxJsxFlowElement',
name: 'MyComponent',
attributes: [
{
type: 'mdxJsxExpressionAttribute',
value: '...props',
data: {
estree: {
type: 'Program',
body: [
{
type: 'ExpressionStatement',
expression: {
type: 'ObjectExpression',
properties: [
{
type: 'SpreadElement',
argument: {type: 'Identifier', name: 'props'}
}
]
}
}
],
sourceType: 'module'
}
}
}
],
children: []
},
{
type: 'paragraph',
children: [
{
type: 'mdxJsxTextElement',
name: 'abbr',
attributes: [
{
type: 'mdxJsxAttribute',
name: 'title',
value: 'Hypertext Markup Language'
}
],
children: [{type: 'text', value: 'HTML'}]
},
{type: 'text', value: ' is a lovely language.'}
]
}
]
}
```
```markdown
<Box>
* a list
</Box>
<MyComponent {...props} />
<abbr title="Hypertext Markup Language">HTML</abbr> is a lovely language.
```
## API
This package exports the identifiers
[`mdxJsxFromMarkdown`][api-mdx-jsx-from-markdown] and
[`mdxJsxToMarkdown`][api-mdx-jsx-to-markdown].
There is no default export.
### `mdxJsxFromMarkdown()`
Create an extension for
[`mdast-util-from-markdown`][mdast-util-from-markdown]
to enable MDX JSX.
###### Returns
Extension for `mdast-util-from-markdown` to enable MDX JSX
([`FromMarkdownExtension`][from-markdown-extension]).
When using the [micromark syntax extension][micromark-extension-mdx-jsx] with
`addResult`, nodes will have a `data.estree` field set to an ESTree
[`Program`][program] node.
### `mdxJsxToMarkdown(options?)`
Create an extension for
[`mdast-util-to-markdown`][mdast-util-to-markdown]
to enable MDX JSX.
This extension configures `mdast-util-to-markdown` with
[`options.fences: true`][mdast-util-to-markdown-fences] and
[`options.resourceLink: true`][mdast-util-to-markdown-resourcelink] too, do not
overwrite them!
###### Parameters
* `options` ([`ToMarkdownOptions`][api-to-markdown-options])
— configuration
###### Returns
Extension for `mdast-util-to-markdown` to enable MDX JSX
([`FromMarkdownExtension`][to-markdown-extension]).
### `MdxJsxAttribute`
MDX JSX attribute with a key (TypeScript type).
###### Type
```ts
import type {Literal} from 'mdast'
interface MdxJsxAttribute extends Literal {
type: 'mdxJsxAttribute'
name: string
value?: MdxJsxAttributeValueExpression | string | null | undefined
}
```
### `MdxJsxAttributeValueExpression`
MDX JSX attribute value set to an expression (TypeScript type).
###### Type
```ts
import type {Program} from 'estree-jsx'
import type {Literal} from 'mdast'
interface MdxJsxAttributeValueExpression extends Literal {
type: 'mdxJsxAttributeValueExpression'
data?: {estree?: Program | null | undefined} & Literal['data']
}
```
### `MdxJsxExpressionAttribute`
MDX JSX attribute as an expression (TypeScript type).
###### Type
```ts
import type {Program} from 'estree-jsx'
import type {Literal} from 'mdast'
interface MdxJsxExpressionAttribute extends Literal {
type: 'mdxJsxExpressionAttribute'
data?: {estree?: Program | null | undefined} & Literal['data']
}
```
### `MdxJsxFlowElement`
MDX JSX element node, occurring in flow (block) (TypeScript type).
###### Type
```ts
import type {BlockContent, DefinitionContent, Parent} from 'mdast'
export interface MdxJsxFlowElement extends Parent {
type: 'mdxJsxFlowElement'
name: string | null
attributes: Array<MdxJsxAttribute | MdxJsxExpressionAttribute>
children: Array<BlockContent | DefinitionContent>
}
```
### `MdxJsxFlowElementHast`
Same as [`MdxJsxFlowElement`][api-mdx-jsx-flow-element], but registered with
`@types/hast` (TypeScript type).
###### Type
```ts
import type {ElementContent, Parent} from 'hast'
export interface MdxJsxFlowElementHast extends Parent {
type: 'mdxJsxFlowElement'
name: string | null
attributes: Array<MdxJsxAttribute | MdxJsxExpressionAttribute>
children: Array<ElementContent>
}
```
### `MdxJsxTextElement`
MDX JSX element node, occurring in text (phrasing) (TypeScript type).
###### Type
```ts
import type {Parent, PhrasingContent} from 'mdast'
export interface MdxJsxTextElement extends Parent {
type: 'mdxJsxTextElement'
name: string | null
attributes: Array<MdxJsxAttribute | MdxJsxExpressionAttribute>
children: Array<PhrasingContent>
}
```
### `MdxJsxTextElementHast`
Same as [`MdxJsxTextElement`][api-mdx-jsx-text-element], but registered with
`@types/hast` (TypeScript type).
###### Type
```ts
import type {ElementContent, Parent} from 'hast'
export interface MdxJsxTextElementHast extends Parent {
type: 'mdxJsxTextElement'
name: string | null
attributes: Array<MdxJsxAttribute | MdxJsxExpressionAttribute>
children: Array<ElementContent>
}
```
### `ToMarkdownOptions`
Configuration (TypeScript type).
##### Fields
* `quote` (`'"'` or `"'"`, default: `'"'`)
— preferred quote to use around attribute values
* `quoteSmart` (`boolean`, default: `false`)
— use the other quote if that results in less bytes
* `tightSelfClosing` (`boolean`, default: `false`)
— do not use an extra space when closing self-closing elements: `<img/>`
instead of `<img />`
* `printWidth` (`number`, default: `Infinity`)
— try and wrap syntax at this width.
When set to a finite number (say, `80`), the formatter will print
attributes on separate lines when a tag doesn’t fit on one line.
The normal behavior is to print attributes with spaces between them instead
of line endings
## HTML
MDX JSX has no representation in HTML.
Though, when you are dealing with MDX, you will likely go *through* hast.
You can enable passing MDX JSX through to hast by configuring
[`mdast-util-to-hast`][mdast-util-to-hast] with
`passThrough: ['mdxJsxFlowElement', 'mdxJsxTextElement']`.
## Syntax
See [Syntax in `micromark-extension-mdx-jsx`][syntax].
## Syntax tree
The following interfaces are added to **[mdast][]** by this utility.
### Nodes
#### `MdxJsxFlowElement`
```idl
interface MdxJsxFlowElement <: Parent {
type: 'mdxJsxFlowElement'
}
MdxJsxFlowElement includes MdxJsxElement
```
**MdxJsxFlowElement** (**[Parent][dfn-parent]**) represents JSX in flow (block).
It can be used where **[flow][dfn-content-flow]** content is expected.
It includes the mixin **[MdxJsxElement][dfn-mixin-mdx-jsx-element]**.
For example, the following markdown:
```markdown
<w x="y">
z
</w>
```
Yields:
```js
{
type: 'mdxJsxFlowElement',
name: 'w',
attributes: [{type: 'mdxJsxAttribute', name: 'x', value: 'y'}],
children: [{type: 'paragraph', children: [{type: 'text', value: 'z'}]}]
}
```
#### `MdxJsxTextElement`
```idl
interface MdxJsxTextElement <: Parent {
type: 'mdxJsxTextElement'
}
MdxJsxTextElement includes MdxJsxElement
```
**MdxJsxTextElement** (**[Parent][dfn-parent]**) represents JSX in text (span,
inline).
It can be used where **[phrasing][dfn-content-phrasing]** content is
expected.
It includes the mixin **[MdxJsxElement][dfn-mixin-mdx-jsx-element]**.
For example, the following markdown:
```markdown
a <b c>d</b> e.
```
Yields:
```js
{
type: 'mdxJsxTextElement',
name: 'b',
attributes: [{type: 'mdxJsxAttribute', name: 'c', value: null}],
children: [{type: 'text', value: 'd'}]
}
```
### Mixin
#### `MdxJsxElement`
```idl
interface mixin MdxJsxElement {
name: string?
attributes: [MdxJsxExpressionAttribute | MdxJsxAttribute]
}
interface MdxJsxExpressionAttribute <: Literal {
type: 'mdxJsxExpressionAttribute'
}
interface MdxJsxAttribute <: Node {
type: 'mdxJsxAttribute'
name: string
value: MdxJsxAttributeValueExpression | string?
}
interface MdxJsxAttributeValueExpression <: Literal {
type: 'mdxJsxAttributeValueExpression'
}
```
**MdxJsxElement** represents a JSX element.
The `name` field can be present and represents an identifier.
Without `name`, the element represents a fragment, in which case no attributes
must be present.
The `attributes` field represents information associated with the node.
The value of the `attributes` field is a list of **MdxJsxExpressionAttribute**
and **MdxJsxAttribute** nodes.
**MdxJsxExpressionAttribute** represents an expression (typically in a
programming language) that when evaluated results in multiple attributes.
**MdxJsxAttribute** represents a single attribute.
The `name` field must be present.
The `value` field can be present, in which case it is either a string (a static
value) or an expression (typically in a programming language) that when
evaluated results in an attribute value.
### Content model
###### `FlowContent` (MDX JSX)
```idl
type MdxJsxFlowContent = MdxJsxFlowElement | FlowContent
```
###### `PhrasingContent` (MDX JSX)
```idl
type MdxJsxPhrasingContent = MdxJsxTextElement | PhrasingContent
```
## Types
This package is fully typed with [TypeScript][].
It exports the additional types [`MdxJsxAttribute`][api-mdx-jsx-attribute],
[`MdxJsxAttributeValueExpression`][api-mdx-jsx-attribute-value-expression],
[`MdxJsxExpressionAttribute`][api-mdx-jsx-expression-attribute],
[`MdxJsxFlowElement`][api-mdx-jsx-flow-element],
[`MdxJsxFlowElementHast`][api-mdx-jsx-flow-element-hast],
[`MdxJsxTextElement`][api-mdx-jsx-text-element],
[`MdxJsxTextElementHast`][api-mdx-jsx-text-element-hast], and
[`ToMarkdownOptions`][api-to-markdown-options].
It also registers the node types with `@types/mdast` and `@types/hast`.
If you’re working with the syntax tree, make sure to import this utility
somewhere in your types, as that registers the new node types in the tree.
```js
/**
* @import {} from 'mdast-util-mdx-jsx'
* @import {Root} from 'mdast'
*/
import {visit} from 'unist-util-visit'
/** @type {Root} */
const tree = getMdastNodeSomeHow()
visit(tree, function (node) {
// `node` can now be one of the JSX nodes.
})
```
## Compatibility
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, `mdast-util-mdx-jsx@3`,
compatible with Node.js 16.
This utility works with `mdast-util-from-markdown` version 2+ and
`mdast-util-to-markdown` version 2+.
## Related
* [`micromark/micromark-extension-mdx-jsx`][micromark-extension-mdx-jsx]
— support MDX JSX in micromark
* [`syntax-tree/mdast-util-mdx`][mdast-util-mdx]
— support MDX in mdast
* [`remarkjs/remark-mdx`][remark-mdx]
— support MDX in remark
## Contribute
See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.
This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
[build-badge]: https://github.com/syntax-tree/mdast-util-mdx-jsx/workflows/main/badge.svg
[build]: https://github.com/syntax-tree/mdast-util-mdx-jsx/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-mdx-jsx.svg
[coverage]: https://codecov.io/github/syntax-tree/mdast-util-mdx-jsx
[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-mdx-jsx.svg
[downloads]: https://www.npmjs.com/package/mdast-util-mdx-jsx
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-mdx-jsx
[size]: https://bundlejs.com/?q=mdast-util-mdx-jsx
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[collective]: https://opencollective.com/unified
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://github.com/syntax-tree/unist/discussions
[npm]: https://docs.npmjs.com/cli/install
[esmsh]: https://esm.sh
[license]: license
[author]: https://wooorm.com
[health]: https://github.com/syntax-tree/.github
[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md
[support]: https://github.com/syntax-tree/.github/blob/main/support.md
[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[typescript]: https://www.typescriptlang.org
[mdast]: https://github.com/syntax-tree/mdast
[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast
[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown
[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension
[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown
[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options
[mdast-util-mdx]: https://github.com/syntax-tree/mdast-util-mdx
[program]: https://github.com/estree/estree/blob/master/es2015.md#programs
[dfn-parent]: https://github.com/syntax-tree/mdast#parent
[dfn-content-flow]: #flowcontent-mdx-jsx
[dfn-content-phrasing]: #phrasingcontent-mdx-jsx
[dfn-mixin-mdx-jsx-element]: #mdxjsxelement
[jsx]: https://facebook.github.io/jsx/
[what-is-mdx]: https://mdxjs.com/docs/what-is-mdx/
[micromark-extension-mdx-jsx]: https://github.com/micromark/micromark-extension-mdx-jsx
[syntax]: https://github.com/micromark/micromark-extension-mdx-jsx#syntax
[mdast-util-to-markdown-fences]: https://github.com/syntax-tree/mdast-util-to-markdown#optionsfences
[mdast-util-to-markdown-resourcelink]: https://github.com/syntax-tree/mdast-util-to-markdown#optionsresourcelink
[remark-mdx]: https://mdxjs.com/packages/remark-mdx/
[mdx]: https://mdxjs.com
[api-mdx-jsx-from-markdown]: #mdxjsxfrommarkdown
[api-mdx-jsx-to-markdown]: #mdxjsxtomarkdownoptions
[api-mdx-jsx-attribute]: #mdxjsxattribute
[api-mdx-jsx-attribute-value-expression]: #mdxjsxattributevalueexpression
[api-mdx-jsx-expression-attribute]: #mdxjsxexpressionattribute
[api-mdx-jsx-flow-element]: #mdxjsxflowelement
[api-mdx-jsx-flow-element-hast]: #mdxjsxflowelementhast
[api-mdx-jsx-text-element]: #mdxjsxtextelement
[api-mdx-jsx-text-element-hast]: #mdxjsxtextelementhast
[api-to-markdown-options]: #tomarkdownoptions
@@ -0,0 +1,5 @@
import { Parser } from "../index.js";
export declare const parsers: {
meriyah: Parser;
};
@@ -0,0 +1,6 @@
const wrap = (min, max, v) => {
const rangeSize = max - min;
return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;
};
export { wrap };
@@ -0,0 +1,59 @@
import {ArrayEntry, MapEntry, ObjectEntry, SetEntry} from './entry';
type ArrayEntries<BaseType extends readonly unknown[]> = Array<ArrayEntry<BaseType>>;
type MapEntries<BaseType> = Array<MapEntry<BaseType>>;
type ObjectEntries<BaseType> = Array<ObjectEntry<BaseType>>;
type SetEntries<BaseType extends Set<unknown>> = Array<SetEntry<BaseType>>;
/**
Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entries` type will return the type of that collection's entries.
For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable.
@see `Entry` if you want to just access the type of a single entry.
@example
```
import {Entries} from 'type-fest';
interface Example {
someKey: number;
}
const manipulatesEntries = (examples: Entries<Example>) => examples.map(example => [
// Does some arbitrary processing on the key (with type information available)
example[0].toUpperCase(),
// Does some arbitrary processing on the value (with type information available)
example[1].toFixed()
]);
const example: Example = {someKey: 1};
const entries = Object.entries(example) as Entries<Example>;
const output = manipulatesEntries(entries);
// Objects
const objectExample = {a: 1};
const objectEntries: Entries<typeof objectExample> = [['a', 1]];
// Arrays
const arrayExample = ['a', 1];
const arrayEntries: Entries<typeof arrayExample> = [[0, 'a'], [1, 1]];
// Maps
const mapExample = new Map([['a', 1]]);
const mapEntries: Entries<typeof map> = [['a', 1]];
// Sets
const setExample = new Set(['a', 1]);
const setEntries: Entries<typeof setExample> = [['a', 'a'], [1, 1]];
```
@category Utilities
*/
export type Entries<BaseType> =
BaseType extends Map<unknown, unknown> ? MapEntries<BaseType>
: BaseType extends Set<unknown> ? SetEntries<BaseType>
: BaseType extends unknown[] ? ArrayEntries<BaseType>
: BaseType extends object ? ObjectEntries<BaseType>
: never;
@@ -0,0 +1,27 @@
import React from 'react';
// basically Exclude<React.ClassAttributes<T>["ref"], string>
var updateRef = function updateRef(ref, value) {
if (typeof ref === 'function') {
ref(value);
return;
}
ref.current = value;
};
var useComposedRef = function useComposedRef(libRef, userRef) {
var prevUserRef = React.useRef();
return React.useCallback(function (instance) {
libRef.current = instance;
if (prevUserRef.current) {
updateRef(prevUserRef.current, null);
}
prevUserRef.current = userRef;
if (!userRef) {
return;
}
updateRef(userRef, instance);
}, [userRef]);
};
export { useComposedRef as default };
@@ -0,0 +1,69 @@
/*
* Copyright 2022 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 {ariaHideOutside} from './ariaHideOutside';
import {AriaOverlayProps, useOverlay} from './useOverlay';
import {DOMAttributes, RefObject} from '@react-types/shared';
import {mergeProps} from '@react-aria/utils';
import {OverlayTriggerState} from '@react-stately/overlays';
import {useEffect} from 'react';
import {useOverlayFocusContain} from './Overlay';
import {usePreventScroll} from './usePreventScroll';
export interface AriaModalOverlayProps extends Pick<AriaOverlayProps, 'shouldCloseOnInteractOutside'> {
/**
* Whether to close the modal when the user interacts outside it.
* @default false
*/
isDismissable?: boolean,
/**
* Whether pressing the escape key to close the modal should be disabled.
* @default false
*/
isKeyboardDismissDisabled?: boolean
}
export interface ModalOverlayAria {
/** Props for the modal element. */
modalProps: DOMAttributes,
/** Props for the underlay element. */
underlayProps: DOMAttributes
}
/**
* Provides the behavior and accessibility implementation for a modal component.
* A modal is an overlay element which blocks interaction with elements outside it.
*/
export function useModalOverlay(props: AriaModalOverlayProps, state: OverlayTriggerState, ref: RefObject<HTMLElement | null>): ModalOverlayAria {
let {overlayProps, underlayProps} = useOverlay({
...props,
isOpen: state.isOpen,
onClose: state.close
}, ref);
usePreventScroll({
isDisabled: !state.isOpen
});
useOverlayFocusContain();
useEffect(() => {
if (state.isOpen && ref.current) {
return ariaHideOutside([ref.current]);
}
}, [state.isOpen, ref]);
return {
modalProps: mergeProps(overlayProps),
underlayProps
};
}
@@ -0,0 +1,13 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-configs.js" script.
*/
"use strict"
module.exports = {
plugins: ["es-x"],
rules: {
"es-x/no-intl-segmenter": "error",
"es-x/no-intl-supportedvaluesof": "error",
},
}
@@ -0,0 +1,5 @@
export type BindingScope = 'Singleton' | 'Transient' | 'Request';
export declare const bindingScopeValues: {
[TKey in BindingScope]: TKey;
};
//# sourceMappingURL=BindingScope.d.ts.map
@@ -0,0 +1,619 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
test("_values", () => {
expect(z.string()._zod.values).toEqual(undefined);
expect(z.enum(["a", "b"])._zod.values).toEqual(new Set(["a", "b"]));
expect(z.nativeEnum({ a: "A", b: "B" })._zod.values).toEqual(new Set(["A", "B"]));
expect(z.literal("test")._zod.values).toEqual(new Set(["test"]));
expect(z.literal(123)._zod.values).toEqual(new Set([123]));
expect(z.literal(true)._zod.values).toEqual(new Set([true]));
expect(z.literal(BigInt(123))._zod.values).toEqual(new Set([BigInt(123)]));
expect(z.undefined()._zod.values).toEqual(new Set([undefined]));
expect(z.null()._zod.values).toEqual(new Set([null]));
const t = z.literal("test");
expect(t.optional()._zod.values).toEqual(new Set(["test", undefined]));
expect(t.nullable()._zod.values).toEqual(new Set(["test", null]));
expect(t.default("test")._zod.values).toEqual(new Set(["test"]));
expect(t.catch("test")._zod.values).toEqual(new Set(["test"]));
const pre = z.preprocess((val) => String(val), z.string()).pipe(z.literal("test"));
expect(pre._zod.values).toEqual(undefined);
const post = z.literal("test").transform((_) => Math.random());
expect(post._zod.values).toEqual(new Set(["test"]));
// Test that readonly literals pass through their values property
expect(z.literal("test").readonly()._zod.values).toEqual(new Set(["test"]));
});
test("valid parse - object", () => {
expect(
z
.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
])
.parse({ type: "a", a: "abc" })
).toEqual({ type: "a", a: "abc" });
});
test("valid - include discriminator key (deprecated)", () => {
expect(
z
.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
])
.parse({ type: "a", a: "abc" })
).toEqual({ type: "a", a: "abc" });
});
test("valid - optional discriminator (object)", () => {
const schema = z.discriminatedUnion("type", [
z.object({ type: z.literal("a").optional(), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
]);
expect(schema.parse({ type: "a", a: "abc" })).toEqual({ type: "a", a: "abc" });
expect(schema.parse({ a: "abc" })).toEqual({ a: "abc" });
});
test("valid - discriminator value of various primitive types", () => {
const schema = z.discriminatedUnion("type", [
z.object({ type: z.literal("1"), val: z.string() }),
z.object({ type: z.literal(1), val: z.string() }),
z.object({ type: z.literal(BigInt(1)), val: z.string() }),
z.object({ type: z.literal("true"), val: z.string() }),
z.object({ type: z.literal(true), val: z.string() }),
z.object({ type: z.literal("null"), val: z.string() }),
z.object({ type: z.null(), val: z.string() }),
z.object({ type: z.literal("undefined"), val: z.string() }),
z.object({ type: z.undefined(), val: z.string() }),
]);
expect(schema.parse({ type: "1", val: "val" })).toEqual({ type: "1", val: "val" });
expect(schema.parse({ type: 1, val: "val" })).toEqual({ type: 1, val: "val" });
expect(schema.parse({ type: BigInt(1), val: "val" })).toEqual({
type: BigInt(1),
val: "val",
});
expect(schema.parse({ type: "true", val: "val" })).toEqual({
type: "true",
val: "val",
});
expect(schema.parse({ type: true, val: "val" })).toEqual({
type: true,
val: "val",
});
expect(schema.parse({ type: "null", val: "val" })).toEqual({
type: "null",
val: "val",
});
expect(schema.parse({ type: null, val: "val" })).toEqual({
type: null,
val: "val",
});
expect(schema.parse({ type: "undefined", val: "val" })).toEqual({
type: "undefined",
val: "val",
});
expect(schema.parse({ type: undefined, val: "val" })).toEqual({
type: undefined,
val: "val",
});
const fail = schema.safeParse({
type: "not_a_key",
val: "val",
});
expect(fail.error).toBeInstanceOf(z.ZodError);
});
test("invalid - null", () => {
try {
z.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
]).parse(null);
throw new Error();
} catch (e: any) {
// [
// {
// code: z.ZodIssueCode.invalid_type,
// expected: z.ZodParsedType.object,
// input: null,
// message: "Expected object, received null",
// received: z.ZodParsedType.null,
// path: [],
// },
// ];
expect(e.issues).toMatchInlineSnapshot(`
[
{
"code": "invalid_type",
"expected": "object",
"message": "Invalid input: expected object, received null",
"path": [],
},
]
`);
}
});
test("invalid discriminator value", () => {
const result = z
.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
])
.safeParse({ type: "x", a: "abc" });
expect(result).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "invalid_union",
"errors": [],
"note": "No matching discriminator",
"path": [
"type"
],
"message": "Invalid input"
}
]],
"success": false,
}
`);
});
test("invalid discriminator value - unionFallback", () => {
const result = z
.discriminatedUnion(
"type",
[z.object({ type: z.literal("a"), a: z.string() }), z.object({ type: z.literal("b"), b: z.string() })],
{ unionFallback: true }
)
.safeParse({ type: "x", a: "abc" });
expect(result).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "invalid_union",
"errors": [
[
{
"code": "invalid_value",
"values": [
"a"
],
"path": [
"type"
],
"message": "Invalid input: expected \\"a\\""
}
],
[
{
"code": "invalid_value",
"values": [
"b"
],
"path": [
"type"
],
"message": "Invalid input: expected \\"b\\""
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"b"
],
"message": "Invalid input: expected string, received undefined"
}
]
],
"path": [],
"message": "Invalid input"
}
]],
"success": false,
}
`);
});
test("valid discriminator value, invalid data", () => {
const result = z
.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
])
.safeParse({ type: "a", b: "abc" });
// [
// {
// code: z.ZodIssueCode.invalid_type,
// expected: z.ZodParsedType.string,
// message: "Required",
// path: ["a"],
// received: z.ZodParsedType.undefined,
// },
// ];
expect(result).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"a"
],
"message": "Invalid input: expected string, received undefined"
}
]],
"success": false,
}
`);
});
test("wrong schema - missing discriminator", () => {
try {
z.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ b: z.string() }) as any,
])._zod.propValues;
throw new Error();
} catch (e: any) {
expect(e.message.includes("Invalid discriminated union option")).toBe(true);
}
});
// removed to account for unions of unions
// test("wrong schema - duplicate discriminator values", () => {
// try {
// z.discriminatedUnion("type",[
// z.object({ type: z.literal("a"), a: z.string() }),
// z.object({ type: z.literal("a"), b: z.string() }),
// ]);
// throw new Error();
// } catch (e: any) {
// expect(e.message.includes("Duplicate discriminator value")).toEqual(true);
// }
// });
test("async - valid", async () => {
const schema = await z.discriminatedUnion("type", [
z.object({
type: z.literal("a"),
a: z
.string()
.refine(async () => true)
.transform(async (val) => Number(val)),
}),
z.object({
type: z.literal("b"),
b: z.string(),
}),
]);
const data = { type: "a", a: "1" };
const result = await schema.safeParseAsync(data);
expect(result.data).toEqual({ type: "a", a: 1 });
});
test("async - invalid", async () => {
// try {
const a = z.discriminatedUnion("type", [
z.object({
type: z.literal("a"),
a: z
.string()
.refine(async () => true)
.transform(async (val) => val),
}),
z.object({
type: z.literal("b"),
b: z.string(),
}),
]);
const result = await a.safeParseAsync({ type: "a", a: 1 });
// expect(JSON.parse(e.message)).toEqual([
// {
// code: "invalid_type",
// expected: "string",
// input: 1,
// received: "number",
// path: ["a"],
// message: "Expected string, received number",
// },
// ]);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"a"
],
"message": "Invalid input: expected string, received number"
}
]]
`);
});
test("valid - literals with .default or .pipe", () => {
const schema = z.discriminatedUnion("type", [
z.object({
type: z.literal("foo").default("foo"),
a: z.string(),
}),
z.object({
type: z.literal("custom"),
method: z.string(),
}),
z.object({
type: z.literal("bar").transform((val) => val),
c: z.string(),
}),
]);
expect(schema.parse({ type: "foo", a: "foo" })).toEqual({
type: "foo",
a: "foo",
});
});
test("enum and nativeEnum", () => {
enum MyEnum {
d = 0,
e = "e",
}
const schema = z.discriminatedUnion("key", [
z.object({
key: z.literal("a"),
// Add other properties specific to this option
}),
z.object({
key: z.enum(["b", "c"]),
// Add other properties specific to this option
}),
z.object({
key: z.nativeEnum(MyEnum),
// Add other properties specific to this option
}),
]);
type schema = z.infer<typeof schema>;
expectTypeOf<schema>().toEqualTypeOf<{ key: "a" } | { key: "b" | "c" } | { key: MyEnum.d | MyEnum.e }>();
schema.parse({ key: "a" });
schema.parse({ key: "b" });
schema.parse({ key: "c" });
schema.parse({ key: MyEnum.d });
schema.parse({ key: MyEnum.e });
schema.parse({ key: "e" });
});
test("branded", () => {
const schema = z.discriminatedUnion("key", [
z.object({
key: z.literal("a"),
// Add other properties specific to this option
}),
z.object({
key: z.literal("b").brand<"asdfasdf">(),
// Add other properties specific to this option
}),
]);
type schema = z.infer<typeof schema>;
expectTypeOf<schema>().toEqualTypeOf<{ key: "a" } | { key: "b" & z.core.$brand<"asdfasdf"> }>();
schema.parse({ key: "a" });
schema.parse({ key: "b" });
expect(() => {
schema.parse({ key: "c" });
}).toThrow();
});
test("optional and nullable", () => {
const schema = z.discriminatedUnion("key", [
z.object({
key: z.literal("a").optional(),
a: z.literal(true),
}),
z.object({
key: z.literal("b").nullable(),
b: z.literal(true),
// Add other properties specific to this option
}),
]);
type schema = z.infer<typeof schema>;
expectTypeOf<schema>().toEqualTypeOf<{ key?: "a" | undefined; a: true } | { key: "b" | null; b: true }>();
schema.parse({ key: "a", a: true });
schema.parse({ key: undefined, a: true });
schema.parse({ key: "b", b: true });
schema.parse({ key: null, b: true });
expect(() => {
schema.parse({ key: null, a: true });
}).toThrow();
expect(() => {
schema.parse({ key: "b", a: true });
}).toThrow();
const value = schema.parse({ key: null, b: true });
if (!("key" in value)) value.a;
if (value.key === undefined) value.a;
if (value.key === "a") value.a;
if (value.key === "b") value.b;
if (value.key === null) value.b;
});
test("multiple discriminators", () => {
const FreeConfig = z.object({
type: z.literal("free"),
min_cents: z.null(),
});
// console.log(FreeConfig.shape.type);
const PricedConfig = z.object({
type: z.literal("fiat-price"),
// min_cents: z.int().nullable(),
min_cents: z.null(),
});
const Config = z.discriminatedUnion("type", [FreeConfig, PricedConfig]);
Config.parse({
min_cents: null,
type: "fiat-price",
name: "Standard",
});
expect(() => {
Config.parse({
min_cents: null,
type: "not real",
name: "Standard",
});
}).toThrow();
});
test("single element union", () => {
const schema = z.object({
a: z.literal("discKey"),
b: z.enum(["apple", "banana"]),
c: z.object({ id: z.string() }),
});
const input = {
a: "discKey",
b: "apple",
c: {}, // Invalid, as schema requires `id` property
};
// Validation must fail here, but it doesn't
const u = z.discriminatedUnion("a", [schema]);
const result = u.safeParse(input);
expect(result).toMatchObject({ success: false });
expect(result).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"c",
"id"
],
"message": "Invalid input: expected string, received undefined"
}
]],
"success": false,
}
`);
expect(u.options.length).toEqual(1);
});
test("nested discriminated unions", () => {
const BaseError = z.object({ status: z.literal("failed"), message: z.string() });
const MyErrors = z.discriminatedUnion("code", [
BaseError.extend({ code: z.literal(400) }),
BaseError.extend({ code: z.literal(401) }),
BaseError.extend({ code: z.literal(500) }),
]);
const MyResult = z.discriminatedUnion("status", [
z.object({ status: z.literal("success"), data: z.string() }),
MyErrors,
]);
expect(MyErrors._zod.propValues).toMatchInlineSnapshot(`
{
"code": Set {
400,
401,
500,
},
"status": Set {
"failed",
},
}
`);
expect(MyResult._zod.propValues).toMatchInlineSnapshot(`
{
"code": Set {
400,
401,
500,
},
"status": Set {
"success",
"failed",
},
}
`);
const result = MyResult.parse({ status: "success", data: "hello" });
expect(result).toMatchInlineSnapshot(`
{
"data": "hello",
"status": "success",
}
`);
const result2 = MyResult.parse({ status: "failed", code: 400, message: "bad request" });
expect(result2).toMatchInlineSnapshot(`
{
"code": 400,
"message": "bad request",
"status": "failed",
}
`);
const result3 = MyResult.parse({ status: "failed", code: 401, message: "unauthorized" });
expect(result3).toMatchInlineSnapshot(`
{
"code": 401,
"message": "unauthorized",
"status": "failed",
}
`);
const result4 = MyResult.parse({ status: "failed", code: 500, message: "internal server error" });
expect(result4).toMatchInlineSnapshot(`
{
"code": 500,
"message": "internal server error",
"status": "failed",
}
`);
});
test("readonly literal discriminator", () => {
const discUnion = z.discriminatedUnion("type", [
z.object({ type: z.literal("a").readonly(), a: z.string() }),
z.object({ type: z.literal("b"), b: z.number() }),
]);
// Test that both discriminator values are correctly included in propValues
const propValues = discUnion._zod.propValues;
expect(propValues?.type?.has("a")).toBe(true);
expect(propValues?.type?.has("b")).toBe(true);
// Test that the discriminated union works correctly
const result1 = discUnion.parse({ type: "a", a: "hello" });
expect(result1).toEqual({ type: "a", a: "hello" });
const result2 = discUnion.parse({ type: "b", b: 42 });
expect(result2).toEqual({ type: "b", b: 42 });
// Test that invalid discriminator values are rejected
expect(() => {
discUnion.parse({ type: "c", a: "hello" });
}).toThrow();
});
@@ -0,0 +1,2 @@
export { PositionedOverlay } from './PositionedOverlay';
export type { Props as PositionedOverlayProps } from './PositionedOverlay';
@@ -0,0 +1,6 @@
/**
* Returns the contrast ratio between two colors based on
* [W3's recommended equation for calculating contrast](http://www.w3.org/TR/WCAG20/#contrast-ratiodef).
*/
declare function getContrast(color1: string, color2: string): number;
export default getContrast;
@@ -0,0 +1,108 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SOCKS5_NO_ACCEPTABLE_AUTH = exports.SOCKS5_CUSTOM_AUTH_END = exports.SOCKS5_CUSTOM_AUTH_START = exports.SOCKS_INCOMING_PACKET_SIZES = exports.SocksClientState = exports.Socks5Response = exports.Socks5HostType = exports.Socks5Auth = exports.Socks4Response = exports.SocksCommand = exports.ERRORS = exports.DEFAULT_TIMEOUT = void 0;
const DEFAULT_TIMEOUT = 30000;
exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
// prettier-ignore
const ERRORS = {
InvalidSocksCommand: 'An invalid SOCKS command was provided. Valid options are connect, bind, and associate.',
InvalidSocksCommandForOperation: 'An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.',
InvalidSocksCommandChain: 'An invalid SOCKS command was provided. Chaining currently only supports the connect command.',
InvalidSocksClientOptionsDestination: 'An invalid destination host was provided.',
InvalidSocksClientOptionsExistingSocket: 'An invalid existing socket was provided. This should be an instance of stream.Duplex.',
InvalidSocksClientOptionsProxy: 'Invalid SOCKS proxy details were provided.',
InvalidSocksClientOptionsTimeout: 'An invalid timeout value was provided. Please enter a value above 0 (in ms).',
InvalidSocksClientOptionsProxiesLength: 'At least two socks proxies must be provided for chaining.',
InvalidSocksClientOptionsCustomAuthRange: 'Custom auth must be a value between 0x80 and 0xFE.',
InvalidSocksClientOptionsCustomAuthOptions: 'When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.',
NegotiationError: 'Negotiation error',
SocketClosed: 'Socket closed',
ProxyConnectionTimedOut: 'Proxy connection timed out',
InternalError: 'SocksClient internal error (this should not happen)',
InvalidSocks4HandshakeResponse: 'Received invalid Socks4 handshake response',
Socks4ProxyRejectedConnection: 'Socks4 Proxy rejected connection',
InvalidSocks4IncomingConnectionResponse: 'Socks4 invalid incoming connection response',
Socks4ProxyRejectedIncomingBoundConnection: 'Socks4 Proxy rejected incoming bound connection',
InvalidSocks5InitialHandshakeResponse: 'Received invalid Socks5 initial handshake response',
InvalidSocks5IntiailHandshakeSocksVersion: 'Received invalid Socks5 initial handshake (invalid socks version)',
InvalidSocks5InitialHandshakeNoAcceptedAuthType: 'Received invalid Socks5 initial handshake (no accepted authentication type)',
InvalidSocks5InitialHandshakeUnknownAuthType: 'Received invalid Socks5 initial handshake (unknown authentication type)',
Socks5AuthenticationFailed: 'Socks5 Authentication failed',
InvalidSocks5FinalHandshake: 'Received invalid Socks5 final handshake response',
InvalidSocks5FinalHandshakeRejected: 'Socks5 proxy rejected connection',
InvalidSocks5IncomingConnectionResponse: 'Received invalid Socks5 incoming connection response',
Socks5ProxyRejectedIncomingBoundConnection: 'Socks5 Proxy rejected incoming bound connection',
};
exports.ERRORS = ERRORS;
const SOCKS_INCOMING_PACKET_SIZES = {
Socks5InitialHandshakeResponse: 2,
Socks5UserPassAuthenticationResponse: 2,
// Command response + incoming connection (bind)
Socks5ResponseHeader: 5, // We need at least 5 to read the hostname length, then we wait for the address+port information.
Socks5ResponseIPv4: 10, // 4 header + 4 ip + 2 port
Socks5ResponseIPv6: 22, // 4 header + 16 ip + 2 port
Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7, // 4 header + 1 host length + host + 2 port
// Command response + incoming connection (bind)
Socks4Response: 8, // 2 header + 2 port + 4 ip
};
exports.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES;
var SocksCommand;
(function (SocksCommand) {
SocksCommand[SocksCommand["connect"] = 1] = "connect";
SocksCommand[SocksCommand["bind"] = 2] = "bind";
SocksCommand[SocksCommand["associate"] = 3] = "associate";
})(SocksCommand || (exports.SocksCommand = SocksCommand = {}));
var Socks4Response;
(function (Socks4Response) {
Socks4Response[Socks4Response["Granted"] = 90] = "Granted";
Socks4Response[Socks4Response["Failed"] = 91] = "Failed";
Socks4Response[Socks4Response["Rejected"] = 92] = "Rejected";
Socks4Response[Socks4Response["RejectedIdent"] = 93] = "RejectedIdent";
})(Socks4Response || (exports.Socks4Response = Socks4Response = {}));
var Socks5Auth;
(function (Socks5Auth) {
Socks5Auth[Socks5Auth["NoAuth"] = 0] = "NoAuth";
Socks5Auth[Socks5Auth["GSSApi"] = 1] = "GSSApi";
Socks5Auth[Socks5Auth["UserPass"] = 2] = "UserPass";
})(Socks5Auth || (exports.Socks5Auth = Socks5Auth = {}));
const SOCKS5_CUSTOM_AUTH_START = 0x80;
exports.SOCKS5_CUSTOM_AUTH_START = SOCKS5_CUSTOM_AUTH_START;
const SOCKS5_CUSTOM_AUTH_END = 0xfe;
exports.SOCKS5_CUSTOM_AUTH_END = SOCKS5_CUSTOM_AUTH_END;
const SOCKS5_NO_ACCEPTABLE_AUTH = 0xff;
exports.SOCKS5_NO_ACCEPTABLE_AUTH = SOCKS5_NO_ACCEPTABLE_AUTH;
var Socks5Response;
(function (Socks5Response) {
Socks5Response[Socks5Response["Granted"] = 0] = "Granted";
Socks5Response[Socks5Response["Failure"] = 1] = "Failure";
Socks5Response[Socks5Response["NotAllowed"] = 2] = "NotAllowed";
Socks5Response[Socks5Response["NetworkUnreachable"] = 3] = "NetworkUnreachable";
Socks5Response[Socks5Response["HostUnreachable"] = 4] = "HostUnreachable";
Socks5Response[Socks5Response["ConnectionRefused"] = 5] = "ConnectionRefused";
Socks5Response[Socks5Response["TTLExpired"] = 6] = "TTLExpired";
Socks5Response[Socks5Response["CommandNotSupported"] = 7] = "CommandNotSupported";
Socks5Response[Socks5Response["AddressNotSupported"] = 8] = "AddressNotSupported";
})(Socks5Response || (exports.Socks5Response = Socks5Response = {}));
var Socks5HostType;
(function (Socks5HostType) {
Socks5HostType[Socks5HostType["IPv4"] = 1] = "IPv4";
Socks5HostType[Socks5HostType["Hostname"] = 3] = "Hostname";
Socks5HostType[Socks5HostType["IPv6"] = 4] = "IPv6";
})(Socks5HostType || (exports.Socks5HostType = Socks5HostType = {}));
var SocksClientState;
(function (SocksClientState) {
SocksClientState[SocksClientState["Created"] = 0] = "Created";
SocksClientState[SocksClientState["Connecting"] = 1] = "Connecting";
SocksClientState[SocksClientState["Connected"] = 2] = "Connected";
SocksClientState[SocksClientState["SentInitialHandshake"] = 3] = "SentInitialHandshake";
SocksClientState[SocksClientState["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse";
SocksClientState[SocksClientState["SentAuthentication"] = 5] = "SentAuthentication";
SocksClientState[SocksClientState["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse";
SocksClientState[SocksClientState["SentFinalHandshake"] = 7] = "SentFinalHandshake";
SocksClientState[SocksClientState["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse";
SocksClientState[SocksClientState["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection";
SocksClientState[SocksClientState["Established"] = 10] = "Established";
SocksClientState[SocksClientState["Disconnected"] = 11] = "Disconnected";
SocksClientState[SocksClientState["Error"] = 99] = "Error";
})(SocksClientState || (exports.SocksClientState = SocksClientState = {}));
//# sourceMappingURL=constants.js.map
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('ceil', require('../ceil'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,11 @@
import { Binding } from '../../binding/models/Binding';
import { InternalBindingConstraints } from '../../binding/models/BindingConstraintsImplementation';
import { SingleImmutableLinkedList } from '../../common/models/SingleImmutableLinkedList';
import { ManagedClassElementMetadata } from '../../metadata/models/ManagedClassElementMetadata';
import { BasePlanParams } from '../models/BasePlanParams';
import { BindingNodeParent } from '../models/BindingNodeParent';
import { PlanBindingNode } from '../models/PlanBindingNode';
import { PlanServiceNode } from '../models/PlanServiceNode';
import { SubplanParams } from '../models/SubplanParams';
export declare function curryLazyBuildPlanServiceNodeFromClassElementMetadata(buildServiceNodeBindings: (params: BasePlanParams, bindingConstraintsList: SingleImmutableLinkedList<InternalBindingConstraints>, serviceBindings: Binding<unknown>[], parentNode: BindingNodeParent, chainedBindings: boolean) => PlanBindingNode[]): (params: SubplanParams, bindingConstraintsList: SingleImmutableLinkedList<InternalBindingConstraints>, elementMetadata: ManagedClassElementMetadata) => PlanServiceNode | undefined;
//# sourceMappingURL=curryLazyBuildPlanServiceNodeFromClassElementMetadata.d.ts.map
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 Colin McDonnell
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,827 @@
export default `flf2a$ 8 6 15 -1 9
nancyj-improved.flf
named after the login of a woman who asked me to make her a
sig. this is the font that came out of it. this is my first
attempt at a figlet font, so leave me alone.
vampyr@acs.bu.edu
$$ @
$$ @
$$ @
$$ @
$$ @
$$ @
$$ @
$$ @@
dP @
88 @
88 @
dP @
@
oo @
@
@@
dP dP @
dP dP @
@
@
@
@
@
@@
@
dP dP @
8888888 @
88 88 @
8888888 @
dP dP @
@
@@
# # @
.d8888P' @
Y8#oo#o. @
# #88 @
\`88888P' @
# # @
@
@@
d8P dP @
8 8 d8' @
Y8P d8' @
d8' d8P @
d8' 8 8 @
88 Y8P @
@
@@
d88b @
8\`'8 @
d8b @
d8P\`8b @
d8' \`8bP @
\`888P'\`YP @
@
@@
d8 @
88 @
.P @
@
@
@
@
@@
a88P @
d8' @
88 @
88 @
Y8. @
Y88b @
@
@@
Y88o @
\`8b @
88 @
88 @
.8P @
d88Y @
@
@@
dP @
8b. 88 .d8 @
\`8b88d8' @
.8P88Y8. @
8P' 88 \`Y8 @
dP @
@
@@
@
dP @
88 @
88888888 @
88 @
dP @
@
@@
@
@
@
@
dP @
88 @
.P @
@@
@
@
@
88888888 @
@
@
@
@@
@
@
@
@
dP @
88 @
@
@@
d8' @
d8' @
d8' @
d8' @
d8' @
88 @
@
@@
a8888a @
d8' ..8b @
88 .P 88 @
88 d' 88 @
Y8'' .8P @
Y8888P @
@
@@
d88 @
88 @
88 @
88 @
88 @
d88P @
@
@@
d8888b. @
\`88 @
.aaadP' @
88' @
88. @
Y88888P @
@
@@
d8888b. @
\`88 @
aaad8' @
\`88 @
.88 @
d88888P @
@
@@
dP dP @
88 88 @
88aaa88 @
88 @
88 @
dP @
@
@@
888888P @
88' @
88baaa. @
\`88 @
88 @
d88888P @
@
@@
.d8888P @
88' @
88baaa. @
88\` \`88 @
8b. .d8 @
\`Y888P' @
@
@@
d88888P @
d8' @
d8' @
d8' @
d8' @
d8' @
@
@@
.d888b. @
Y8' \`8P @
d8bad8b @
88\` \`88 @
8b. .88 @
Y88888P @
@
@@
.d888b. @
Y8' \`88 @
\`8bad88 @
\`88 @
d. .88 @
\`8888P @
@
@@
dP @
88 @
@
@
dP @
88 @
@
@@
dP @
88 @
@
@
dP @
88 @
.P @
@@
d8 @
d8' @
d8' @
Y8. @
Y8. @
Y8 @
@
@@
@
@
aaaaaaaa @
@
88888888 @
@
@
@@
8b @
\`8b @
\`8b @
.8P @
.8P @
8P @
@
@@
.d8888ba @
\`8' \`8b @
.d8' @
d8P' @
"" @
oo @
@
@@
a88888b. @
d8' \`88 @
88 d8P 88 @
88 Yo8b88 @
Y8. @
Y88888P' @
@
@@
.d888888 @
d8' 88 @
88aaaaa88a @
88 88 @
88 88 @
88 88 @
@
@@
888888ba @
88 \`8b @
a88aaaa8P' @
88 \`8b. @
88 .88 @
88888888P @
@
@@
a88888b. @
d8' \`88 @
88 @
88 @
Y8. .88 @
Y88888P' @
@
@@
888888ba @
88 \`8b @
88 88 @
88 88 @
88 .8P @
8888888P @
@
@@
88888888b @
88 @
a88aaaa @
88 @
88 @
88888888P @
@
@@
88888888b @
88 @
a88aaaa @
88 @
88 @
dP @
@
@@
.88888. @
d8' \`88 @
88 @
88 YP88 @
Y8. .88 @
\`88888' @
@
@@
dP dP @
88 88 @
88aaaaa88a @
88 88 @
88 88 @
dP dP @
@
@@
dP @
88 @
88 @
88 @
88 @
dP @
@
@@
dP @
88 @
88 @
88 @
88. .d8P @
\`Y8888' @
@
@@
dP dP @
88 .d8' @
88aaa8P' @
88 \`8b. @
88 88 @
dP dP @
@
@@
dP @
88 @
88 @
88 @
88 @
88888888P @
@
@@
8888ba.88ba @
88 \`8b \`8b @
88 88 88 @
88 88 88 @
88 88 88 @
dP dP dP @
@
@@
888888ba @
88 \`8b @
88 88 @
88 88 @
88 88 @
dP dP @
@
@@
.88888. @
d8' \`8b @
88 88 @
88 88 @
Y8. .8P @
\`8888P' @
@
@@
888888ba @
88 \`8b @
a88aaaa8P' @
88 @
88 @
dP @
@
@@
.88888. @
d8' \`8b @
88 88 @
88 db 88 @
Y8. Y88P @
\`8888PY8b @
@
@@
888888ba @
88 \`8b @
a88aaaa8P' @
88 \`8b. @
88 88 @
dP dP @
@
@@
.d88888b @
88. "' @
\`Y88888b. @
\`8b @
d8' .8P @
Y88888P @
@
@@
d888888P @
88 @
88 @
88 @
88 @
dP @
@
@@
dP dP @
88 88 @
88 88 @
88 88 @
Y8. .8P @
\`Y88888P' @
@
@@
dP dP @
88 88 @
88 .8P @
88 d8' @
88 .d8P @
888888' @
@
@@
dP dP dP @
88 88 88 @
88 .8P .8P @
88 d8' d8' @
88.d8P8.d8P @
8888' Y88' @
@
@@
dP dP @
Y8. .8P @
Y8aa8P @
d8' \`8b @
88 88 @
dP dP @
@
@@
dP dP @
Y8. .8P @
Y8aa8P @
88 @
88 @
dP @
@
@@
d8888888P @
.d8' @
.d8' @
.d8' @
d8' @
Y8888888P @
@
@@
8888P @
88 @
88 @
88 @
88 @
88888 @
@
@@
Yb @
\`Yb @
\`Yb @
\`Yb @
\`Yb @
88 @
@
@@
d8888 @
88 @
88 @
88 @
88 @
88888 @
@
@@
db @
d8'\`8b @
\`" "' @
@
@
@
@
@@
@
@
@
@
@
@
oooooooooooo @
@@
dP @
88 @
Y. @
@
@
@
@
@@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`88888P8 @
@
@@
dP @
88 @
88d888b. @
88' \`88 @
88. .88 @
88Y8888' @
@
@@
@
@
.d8888b. @
88' \`"" @
88. ... @
\`88888P' @
@
@@
dP @
88 @
.d888b88 @
88' \`88 @
88. .88 @
\`88888P8 @
@
@@
@
@
.d8888b. @
88ooood8 @
88. ... @
\`88888P' @
@
@@
.8888b @
88 " @
88aaa @
88 @
88 @
dP @
@
@@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`8888P88 @
.88 @
d8888P @@
dP @
88 @
88d888b. @
88' \`88 @
88 88 @
dP dP @
@
@@
oo @
@
dP @
88 @
88 @
dP @
@
@@
oo @
@
dP @
88 @
88 @
88 @
88 @
dP @@
dP @
88 @
88 .dP @
88888" @
88 \`8b. @
dP \`YP @
@
@@
dP @
88 @
88 @
88 @
88 @
dP @
@
@@
@
@
88d8b.d8b. @
88'\`88'\`88 @
88 88 88 @
dP dP dP @
@
@@
@
@
88d888b. @
88' \`88 @
88 88 @
dP dP @
@
@@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`88888P' @
@
@@
@
@
88d888b. @
88' \`88 @
88. .88 @
88Y888P' @
88 @
dP @@
@
@
.d8888b. @
88' \`88 @
88. .88 @
\`8888P88 @
88 @
dP @@
@
@
88d888b. @
88' \`88 @
88 @
dP @
@
@@
@
@
.d8888b. @
Y8ooooo. @
88 @
\`88888P' @
@
@@
dP @
88 @
d8888P @
88 @
88 @
dP @
@
@@
@
@
dP dP @
88 88 @
88. .88 @
\`88888P' @
@
@@
@
@
dP .dP @
88 d8' @
88 .88' @
8888P' @
@
@@
@
@
dP dP dP @
88 88 88 @
88.88b.88' @
8888P Y8P @
@
@@
@
@
dP. .dP @
\`8bd8' @
.d88b. @
dP' \`dP @
@
@@
@
@
dP dP @
88 88 @
88. .88 @
\`8888P88 @
.88 @
d8888P @@
@
@
d888888b @
.d8P' @
.Y8P @
d888888P @
@
@@
.d88P @
8: @
.oY8. @
d8 @
8: @
\`Y88b @
@
@@
dP @
88 @
"' @
dP @
88 @
"' @
@
@@
d88b. @
:8 @
.8Yo. @
8b @
:8 @
Y88P' @
@
@@
.oo. .d @
dP" "d8P @
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
`
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more