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

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

No files matched your search

@@ -0,0 +1,30 @@
#include <windows.h>
#include "TestUtil.cc"
int main(int argc, char *argv[]) {
if (argc == 1) {
startChildProcess(L"CHILD");
return 0;
}
const int WIDTH = 25;
setWindowPos(0, 0, 1, 1);
setBufferSize(WIDTH, 40);
setWindowPos(0, 0, WIDTH, 20);
system("cls");
for (int i = 0; i < 100; ++i) {
printf("FOO(%d)\n", i);
}
repeatChar(5, '\n');
repeatChar(WIDTH * 5, '.');
repeatChar(10, '\n');
setWindowPos(0, 20, WIDTH, 20);
writeBox(0, 5, 1, 10, '|');
Sleep(120000);
}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","2":"K D E F wC"},B:{"1":"0 1 2 3 4 5 C L M G N O P 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:{"1":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC 0C 1C","33":"6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB","164":"J ZB K D E F A B C L M"},D:{"1":"0 1 2 3 4 5 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 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","2":"J ZB K D E F A B C L M G","33":"7 8 9 AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB","292":"6 N O P aB"},E:{"1":"A B C L M G 6C aC NC OC 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":"D E F 2C ZC 4C 5C","4":"J ZB K 3C"},F:{"1":"0 1 2 3 4 5 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 d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C FD GD HD ID NC uC JD OC","33":"6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB"},G:{"1":"QD RD SD 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 ND OD PD","4":"ZC KD vC LD MD"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC","33":"mD nD"},J:{"2":"D","33":"A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD","33":"J"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:2,C:"CSS font-feature-settings",D:true};
@@ -0,0 +1,224 @@
import debug from 'debug';
import { isStaticRequire, createRule } from '../utils/index.js';
const log = debug('eslint-plugin-import-x:rules:newline-after-import');
function containsNodeOrEqual(outerNode, innerNode) {
return (outerNode.range[0] <= innerNode.range[0] &&
outerNode.range[1] >= innerNode.range[1]);
}
function getScopeBody(scope) {
if (scope.block.type === 'SwitchStatement') {
log('SwitchStatement scopes not supported');
return [];
}
const body = 'body' in scope.block ? scope.block.body : null;
if (body && 'type' in body && body.type === 'BlockStatement') {
return body.body;
}
return Array.isArray(body) ? body : [];
}
function findNodeIndexInScopeBody(body, nodeToFind) {
return body.findIndex(node => containsNodeOrEqual(node, nodeToFind));
}
function getLineDifference(node, nextNode) {
return nextNode.loc.start.line - node.loc.end.line;
}
function isClassWithDecorator(node) {
return node.type === 'ClassDeclaration' && !!node.decorators?.length;
}
function isExportDefaultClass(node) {
return (node.type === 'ExportDefaultDeclaration' &&
node.declaration.type === 'ClassDeclaration');
}
function isExportNameClass(node) {
return (node.type === 'ExportNamedDeclaration' &&
node.declaration?.type === 'ClassDeclaration');
}
export default createRule({
name: 'newline-after-import',
meta: {
type: 'layout',
docs: {
category: 'Style guide',
description: 'Enforce a newline after import statements.',
},
fixable: 'whitespace',
schema: [
{
type: 'object',
properties: {
count: {
type: 'integer',
minimum: 1,
},
exactCount: { type: 'boolean' },
considerComments: { type: 'boolean' },
},
additionalProperties: false,
},
],
messages: {
newline: 'Expected {{count}} empty line{{lineSuffix}} after {{type}} statement not followed by another {{type}}.',
},
},
defaultOptions: [],
create(context) {
let level = 0;
const requireCalls = [];
const options = {
count: 1,
exactCount: false,
considerComments: false,
...context.options[0],
};
function checkForNewLine(node, nextNode, type) {
if (isExportDefaultClass(nextNode) || isExportNameClass(nextNode)) {
const classNode = nextNode.declaration;
if (isClassWithDecorator(classNode)) {
nextNode = classNode.decorators[0];
}
}
else if (isClassWithDecorator(nextNode)) {
nextNode = nextNode.decorators[0];
}
const lineDifference = getLineDifference(node, nextNode);
const EXPECTED_LINE_DIFFERENCE = options.count + 1;
if (lineDifference < EXPECTED_LINE_DIFFERENCE ||
(options.exactCount && lineDifference !== EXPECTED_LINE_DIFFERENCE)) {
let column = node.loc.start.column;
if (node.loc.start.line !== node.loc.end.line) {
column = 0;
}
context.report({
loc: {
line: node.loc.end.line,
column,
},
messageId: 'newline',
data: {
count: options.count,
lineSuffix: options.count > 1 ? 's' : '',
type,
},
fix: options.exactCount && EXPECTED_LINE_DIFFERENCE < lineDifference
? undefined
: fixer => fixer.insertTextAfter(node, '\n'.repeat(EXPECTED_LINE_DIFFERENCE - lineDifference)),
});
}
}
function commentAfterImport(node, nextComment, type) {
const lineDifference = getLineDifference(node, nextComment);
const EXPECTED_LINE_DIFFERENCE = options.count + 1;
if (lineDifference < EXPECTED_LINE_DIFFERENCE) {
let column = node.loc.start.column;
if (node.loc.start.line !== node.loc.end.line) {
column = 0;
}
context.report({
loc: {
line: node.loc.end.line,
column,
},
messageId: 'newline',
data: {
count: options.count,
lineSuffix: options.count > 1 ? 's' : '',
type,
},
fix: options.exactCount && EXPECTED_LINE_DIFFERENCE < lineDifference
? undefined
: fixer => fixer.insertTextAfter(node, '\n'.repeat(EXPECTED_LINE_DIFFERENCE - lineDifference)),
});
}
}
function incrementLevel() {
level++;
}
function decrementLevel() {
level--;
}
function checkImport(node) {
const { parent } = node;
if (!parent || !('body' in parent) || !parent.body) {
return;
}
const root = parent;
const nodePosition = root.body.indexOf(node);
const nextNode = root.body[nodePosition + 1];
const endLine = node.loc.end.line;
let nextComment;
if (root.comments !== undefined && options.considerComments) {
nextComment = root.comments.find(o => o.loc.start.line >= endLine &&
o.loc.start.line <= endLine + options.count + 1);
}
if (node.type === 'TSImportEqualsDeclaration' &&
node.isExport) {
return;
}
if (nextComment) {
commentAfterImport(node, nextComment, 'import');
}
else if (nextNode &&
nextNode.type !== 'ImportDeclaration' &&
(nextNode.type !== 'TSImportEqualsDeclaration' ||
nextNode.isExport)) {
checkForNewLine(node, nextNode, 'import');
}
}
return {
ImportDeclaration: checkImport,
TSImportEqualsDeclaration: checkImport,
CallExpression(node) {
if (isStaticRequire(node) && level === 0) {
requireCalls.push(node);
}
},
'Program:exit'(node) {
log('exit processing for', context.physicalFilename);
const scopeBody = getScopeBody(context.sourceCode.getScope(node));
log('got scope:', scopeBody);
for (const [index, node] of requireCalls.entries()) {
const nodePosition = findNodeIndexInScopeBody(scopeBody, node);
log('node position in scope:', nodePosition);
const statementWithRequireCall = scopeBody[nodePosition];
const nextStatement = scopeBody[nodePosition + 1];
const nextRequireCall = requireCalls[index + 1];
if (nextRequireCall &&
containsNodeOrEqual(statementWithRequireCall, nextRequireCall)) {
continue;
}
if (nextStatement &&
(!nextRequireCall ||
!containsNodeOrEqual(nextStatement, nextRequireCall))) {
let nextComment;
if ('comments' in statementWithRequireCall.parent &&
statementWithRequireCall.parent.comments !== undefined &&
options.considerComments) {
const endLine = node.loc.end.line;
nextComment = statementWithRequireCall.parent.comments.find(o => o.loc.start.line >= endLine &&
o.loc.start.line <= endLine + options.count + 1);
}
if (nextComment && nextComment !== undefined) {
commentAfterImport(statementWithRequireCall, nextComment, 'require');
}
else {
checkForNewLine(statementWithRequireCall, nextStatement, 'require');
}
}
}
},
FunctionDeclaration: incrementLevel,
FunctionExpression: incrementLevel,
ArrowFunctionExpression: incrementLevel,
BlockStatement: incrementLevel,
ObjectExpression: incrementLevel,
Decorator: incrementLevel,
'FunctionDeclaration:exit': decrementLevel,
'FunctionExpression:exit': decrementLevel,
'ArrowFunctionExpression:exit': decrementLevel,
'BlockStatement:exit': decrementLevel,
'ObjectExpression:exit': decrementLevel,
'Decorator:exit': decrementLevel,
};
},
});
//# sourceMappingURL=newline-after-import.js.map
@@ -0,0 +1,6 @@
import {
DeleteIcon
} from "./chunk-24KJWBGA.mjs";
export {
DeleteIcon
};
@@ -0,0 +1,13 @@
declare const _exports: RuleModule;
export = _exports;
export type RuleModule = import("eslint").Rule.RuleModule;
export type Config = {
type: "element";
} & import("../../types/rules/jsx-no-literals").ElementConfigProperties & import("../../types/rules/jsx-no-literals").ElementOverrides;
export type RawConfig = import("../../types/rules/jsx-no-literals").RawElementConfig & import("../../types/rules/jsx-no-literals").RawElementOverrides;
export type ResolvedConfig = import("../../types/rules/jsx-no-literals").OverrideConfig | import("../../types/rules/jsx-no-literals").Config;
export type OverrideConfig = import("../../types/rules/jsx-no-literals").OverrideConfigProperties & import("../../types/rules/jsx-no-literals").ElementConfigProperties;
export type ElementConfig = {
type: "element";
} & import("../../types/rules/jsx-no-literals").ElementConfigProperties;
//# sourceMappingURL=jsx-no-literals.d.ts.map
@@ -0,0 +1,21 @@
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
import type { AssertRest, AssertType, UnionToTuple } from '../helpers/index.mjs';
import type { TMappedResult } from '../mapped/index.mjs';
import { type TUnion } from '../union/index.mjs';
import { type Static } from '../static/index.mjs';
import { type TNever } from '../never/index.mjs';
import { type TUnionEvaluated } from '../union/index.mjs';
import { type TTemplateLiteral } from '../template-literal/index.mjs';
import { type TExtractFromMappedResult } from './extract-from-mapped-result.mjs';
import { type TExtractFromTemplateLiteral } from './extract-from-template-literal.mjs';
type TExtractRest<L extends TSchema[], R extends TSchema> = AssertRest<UnionToTuple<{
[K in keyof L]: Static<AssertType<L[K]>> extends Static<R> ? L[K] : never;
}[number]>> extends infer R extends TSchema[] ? TUnionEvaluated<R> : never;
export type TExtract<L extends TSchema, U extends TSchema> = (L extends TUnion<infer S> ? TExtractRest<S, U> : L extends U ? L : TNever);
/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
export declare function Extract<L extends TMappedResult, R extends TSchema>(type: L, union: R, options?: SchemaOptions): TExtractFromMappedResult<L, R>;
/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
export declare function Extract<L extends TTemplateLiteral, R extends TSchema>(type: L, union: R, options?: SchemaOptions): TExtractFromTemplateLiteral<L, R>;
/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
export declare function Extract<L extends TSchema, R extends TSchema>(type: L, union: R, options?: SchemaOptions): TExtract<L, R>;
export {};
@@ -0,0 +1,89 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'prefer-readonly-parameter-types',
meta: {
type: 'suggestion',
docs: {
description: 'Require function parameters to be typed as `readonly` to prevent accidental mutation of inputs',
requiresTypeChecking: true,
},
messages: {
shouldBeReadonly: 'Parameter should be a read only type.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allow: {
...util_1.readonlynessOptionsSchema.properties.allow,
description: 'An array of type specifiers to ignore.',
},
checkParameterProperties: {
type: 'boolean',
description: 'Whether to check class parameter properties.',
},
ignoreInferredTypes: {
type: 'boolean',
description: "Whether to ignore parameters which don't explicitly specify a type.",
},
treatMethodsAsReadonly: {
...util_1.readonlynessOptionsSchema.properties.treatMethodsAsReadonly,
description: 'Whether to treat all mutable methods as though they are readonly.',
},
},
},
],
},
defaultOptions: [
{
allow: util_1.readonlynessOptionsDefaults.allow,
checkParameterProperties: true,
ignoreInferredTypes: false,
treatMethodsAsReadonly: util_1.readonlynessOptionsDefaults.treatMethodsAsReadonly,
},
],
create(context, [{ allow, checkParameterProperties, ignoreInferredTypes, treatMethodsAsReadonly, },]) {
const services = (0, util_1.getParserServices)(context);
return {
[[
utils_1.AST_NODE_TYPES.ArrowFunctionExpression,
utils_1.AST_NODE_TYPES.FunctionDeclaration,
utils_1.AST_NODE_TYPES.FunctionExpression,
utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
utils_1.AST_NODE_TYPES.TSDeclareFunction,
utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
utils_1.AST_NODE_TYPES.TSFunctionType,
utils_1.AST_NODE_TYPES.TSMethodSignature,
].join(', ')](node) {
for (const param of node.params) {
if (!checkParameterProperties &&
param.type === utils_1.AST_NODE_TYPES.TSParameterProperty) {
continue;
}
const actualParam = param.type === utils_1.AST_NODE_TYPES.TSParameterProperty
? param.parameter
: param;
if (ignoreInferredTypes && actualParam.typeAnnotation == null) {
continue;
}
const type = services.getTypeAtLocation(actualParam);
const isReadOnly = (0, util_1.isTypeReadonly)(services.program, type, {
allow,
treatMethodsAsReadonly: !!treatMethodsAsReadonly,
});
if (!isReadOnly && !(0, util_1.isTypeBrandedLiteralLike)(type)) {
context.report({
node: actualParam,
messageId: 'shouldBeReadonly',
});
}
}
},
};
},
});
@@ -0,0 +1,33 @@
@font-face {
font-family: "<%=fontFamily%>";
src: url("<%=fontPath%><%=fontFile%>.eot"); /* IE9 */
src: <%if (local) {%>local("<%=local%>"), <%}%>url("<%=fontPath%><%=fontFile%>.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */<% if (base64) { %>
url(<%=base64%>) format("truetype"), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */<% } else { %>
url("<%=fontPath%><%=fontFile%>.woff2") format("woff2"), /* chrome 36+, firefox 39+,iOS 10+, Android 67+ */
url("<%=fontPath%><%=fontFile%>.woff") format("woff"), /* chrome, firefox */
url("<%=fontPath%><%=fontFile%>.ttf") format("truetype"), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */<% } %>
url("<%=fontPath%><%=fontFile%>.svg#<%=fontFamily%>") format("svg"); /* iOS 4.1- */
font-style: normal;
font-weight: normal;
}
<% if (glyph) { %>
[class^="<%=iconPrefix%>-"],
[class*=" <%=iconPrefix%>-"]:after {
font-family: "<%=fontFamily%>";
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
<% _.each(glyfList, function(glyf) { %>
.<%=iconPrefix%>-<%=glyf.name%>:before {
content: "<%=glyf.codeName%>";
}
<% }); %>
<% }; %>
@@ -0,0 +1,19 @@
/**
* @file base64字符串转数组
* @author mengke01(kekee000@gmail.com)
*/
/**
* base64字符串转数组
*
* @param {string} base64 base64字符串
* @return {Array} 数组
*/
export default function base642bytes(base64) {
const str = atob(base64);
const result = [];
for (let i = 0, l = str.length; i < l; i++) {
result.push(str[i].charCodeAt(0));
}
return result;
}
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC"}
@@ -0,0 +1,801 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var React = require('react');
var React__default = _interopDefault(React);
var core = require('@dnd-kit/core');
var utilities = require('@dnd-kit/utilities');
/**
* Move an array item to a different position. Returns a new array with the item moved to the new position.
*/
function arrayMove(array, from, to) {
const newArray = array.slice();
newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
return newArray;
}
/**
* Swap an array item to a different position. Returns a new array with the item swapped to the new position.
*/
function arraySwap(array, from, to) {
const newArray = array.slice();
newArray[from] = array[to];
newArray[to] = array[from];
return newArray;
}
function getSortedRects(items, rects) {
return items.reduce((accumulator, id, index) => {
const rect = rects.get(id);
if (rect) {
accumulator[index] = rect;
}
return accumulator;
}, Array(items.length));
}
function isValidIndex(index) {
return index !== null && index >= 0;
}
function itemsEqual(a, b) {
if (a === b) {
return true;
}
if (a.length !== b.length) {
return false;
}
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
}
function normalizeDisabled(disabled) {
if (typeof disabled === 'boolean') {
return {
draggable: disabled,
droppable: disabled
};
}
return disabled;
}
// To-do: We should be calculating scale transformation
const defaultScale = {
scaleX: 1,
scaleY: 1
};
const horizontalListSortingStrategy = _ref => {
var _rects$activeIndex;
let {
rects,
activeNodeRect: fallbackActiveRect,
activeIndex,
overIndex,
index
} = _ref;
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
if (!activeNodeRect) {
return null;
}
const itemGap = getItemGap(rects, index, activeIndex);
if (index === activeIndex) {
const newIndexRect = rects[overIndex];
if (!newIndexRect) {
return null;
}
return {
x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,
y: 0,
...defaultScale
};
}
if (index > activeIndex && index <= overIndex) {
return {
x: -activeNodeRect.width - itemGap,
y: 0,
...defaultScale
};
}
if (index < activeIndex && index >= overIndex) {
return {
x: activeNodeRect.width + itemGap,
y: 0,
...defaultScale
};
}
return {
x: 0,
y: 0,
...defaultScale
};
};
function getItemGap(rects, index, activeIndex) {
const currentRect = rects[index];
const previousRect = rects[index - 1];
const nextRect = rects[index + 1];
if (!currentRect || !previousRect && !nextRect) {
return 0;
}
if (activeIndex < index) {
return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);
}
return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);
}
const rectSortingStrategy = _ref => {
let {
rects,
activeIndex,
overIndex,
index
} = _ref;
const newRects = arrayMove(rects, overIndex, activeIndex);
const oldRect = rects[index];
const newRect = newRects[index];
if (!newRect || !oldRect) {
return null;
}
return {
x: newRect.left - oldRect.left,
y: newRect.top - oldRect.top,
scaleX: newRect.width / oldRect.width,
scaleY: newRect.height / oldRect.height
};
};
const rectSwappingStrategy = _ref => {
let {
activeIndex,
index,
rects,
overIndex
} = _ref;
let oldRect;
let newRect;
if (index === activeIndex) {
oldRect = rects[index];
newRect = rects[overIndex];
}
if (index === overIndex) {
oldRect = rects[index];
newRect = rects[activeIndex];
}
if (!newRect || !oldRect) {
return null;
}
return {
x: newRect.left - oldRect.left,
y: newRect.top - oldRect.top,
scaleX: newRect.width / oldRect.width,
scaleY: newRect.height / oldRect.height
};
};
// To-do: We should be calculating scale transformation
const defaultScale$1 = {
scaleX: 1,
scaleY: 1
};
const verticalListSortingStrategy = _ref => {
var _rects$activeIndex;
let {
activeIndex,
activeNodeRect: fallbackActiveRect,
index,
rects,
overIndex
} = _ref;
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
if (!activeNodeRect) {
return null;
}
if (index === activeIndex) {
const overIndexRect = rects[overIndex];
if (!overIndexRect) {
return null;
}
return {
x: 0,
y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,
...defaultScale$1
};
}
const itemGap = getItemGap$1(rects, index, activeIndex);
if (index > activeIndex && index <= overIndex) {
return {
x: 0,
y: -activeNodeRect.height - itemGap,
...defaultScale$1
};
}
if (index < activeIndex && index >= overIndex) {
return {
x: 0,
y: activeNodeRect.height + itemGap,
...defaultScale$1
};
}
return {
x: 0,
y: 0,
...defaultScale$1
};
};
function getItemGap$1(clientRects, index, activeIndex) {
const currentRect = clientRects[index];
const previousRect = clientRects[index - 1];
const nextRect = clientRects[index + 1];
if (!currentRect) {
return 0;
}
if (activeIndex < index) {
return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;
}
return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;
}
const ID_PREFIX = 'Sortable';
const Context = /*#__PURE__*/React__default.createContext({
activeIndex: -1,
containerId: ID_PREFIX,
disableTransforms: false,
items: [],
overIndex: -1,
useDragOverlay: false,
sortedRects: [],
strategy: rectSortingStrategy,
disabled: {
draggable: false,
droppable: false
}
});
function SortableContext(_ref) {
let {
children,
id,
items: userDefinedItems,
strategy = rectSortingStrategy,
disabled: disabledProp = false
} = _ref;
const {
active,
dragOverlay,
droppableRects,
over,
measureDroppableContainers
} = core.useDndContext();
const containerId = utilities.useUniqueId(ID_PREFIX, id);
const useDragOverlay = Boolean(dragOverlay.rect !== null);
const items = React.useMemo(() => userDefinedItems.map(item => typeof item === 'object' && 'id' in item ? item.id : item), [userDefinedItems]);
const isDragging = active != null;
const activeIndex = active ? items.indexOf(active.id) : -1;
const overIndex = over ? items.indexOf(over.id) : -1;
const previousItemsRef = React.useRef(items);
const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
const disabled = normalizeDisabled(disabledProp);
utilities.useIsomorphicLayoutEffect(() => {
if (itemsHaveChanged && isDragging) {
measureDroppableContainers(items);
}
}, [itemsHaveChanged, items, isDragging, measureDroppableContainers]);
React.useEffect(() => {
previousItemsRef.current = items;
}, [items]);
const contextValue = React.useMemo(() => ({
activeIndex,
containerId,
disabled,
disableTransforms,
items,
overIndex,
useDragOverlay,
sortedRects: getSortedRects(items, droppableRects),
strategy
}), // eslint-disable-next-line react-hooks/exhaustive-deps
[activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]);
return React__default.createElement(Context.Provider, {
value: contextValue
}, children);
}
const defaultNewIndexGetter = _ref => {
let {
id,
items,
activeIndex,
overIndex
} = _ref;
return arrayMove(items, activeIndex, overIndex).indexOf(id);
};
const defaultAnimateLayoutChanges = _ref2 => {
let {
containerId,
isSorting,
wasDragging,
index,
items,
newIndex,
previousItems,
previousContainerId,
transition
} = _ref2;
if (!transition || !wasDragging) {
return false;
}
if (previousItems !== items && index === newIndex) {
return false;
}
if (isSorting) {
return true;
}
return newIndex !== index && containerId === previousContainerId;
};
const defaultTransition = {
duration: 200,
easing: 'ease'
};
const transitionProperty = 'transform';
const disabledTransition = /*#__PURE__*/utilities.CSS.Transition.toString({
property: transitionProperty,
duration: 0,
easing: 'linear'
});
const defaultAttributes = {
roleDescription: 'sortable'
};
/*
* When the index of an item changes while sorting,
* we need to temporarily disable the transforms
*/
function useDerivedTransform(_ref) {
let {
disabled,
index,
node,
rect
} = _ref;
const [derivedTransform, setDerivedtransform] = React.useState(null);
const previousIndex = React.useRef(index);
utilities.useIsomorphicLayoutEffect(() => {
if (!disabled && index !== previousIndex.current && node.current) {
const initial = rect.current;
if (initial) {
const current = core.getClientRect(node.current, {
ignoreTransform: true
});
const delta = {
x: initial.left - current.left,
y: initial.top - current.top,
scaleX: initial.width / current.width,
scaleY: initial.height / current.height
};
if (delta.x || delta.y) {
setDerivedtransform(delta);
}
}
}
if (index !== previousIndex.current) {
previousIndex.current = index;
}
}, [disabled, index, node, rect]);
React.useEffect(() => {
if (derivedTransform) {
setDerivedtransform(null);
}
}, [derivedTransform]);
return derivedTransform;
}
function useSortable(_ref) {
let {
animateLayoutChanges = defaultAnimateLayoutChanges,
attributes: userDefinedAttributes,
disabled: localDisabled,
data: customData,
getNewIndex = defaultNewIndexGetter,
id,
strategy: localStrategy,
resizeObserverConfig,
transition = defaultTransition
} = _ref;
const {
items,
containerId,
activeIndex,
disabled: globalDisabled,
disableTransforms,
sortedRects,
overIndex,
useDragOverlay,
strategy: globalStrategy
} = React.useContext(Context);
const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
const index = items.indexOf(id);
const data = React.useMemo(() => ({
sortable: {
containerId,
index,
items
},
...customData
}), [containerId, customData, index, items]);
const itemsAfterCurrentSortable = React.useMemo(() => items.slice(items.indexOf(id)), [items, id]);
const {
rect,
node,
isOver,
setNodeRef: setDroppableNodeRef
} = core.useDroppable({
id,
data,
disabled: disabled.droppable,
resizeObserverConfig: {
updateMeasurementsFor: itemsAfterCurrentSortable,
...resizeObserverConfig
}
});
const {
active,
activatorEvent,
activeNodeRect,
attributes,
setNodeRef: setDraggableNodeRef,
listeners,
isDragging,
over,
setActivatorNodeRef,
transform
} = core.useDraggable({
id,
data,
attributes: { ...defaultAttributes,
...userDefinedAttributes
},
disabled: disabled.draggable
});
const setNodeRef = utilities.useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
const isSorting = Boolean(active);
const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
const shouldDisplaceDragSource = !useDragOverlay && isDragging;
const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;
const strategy = localStrategy != null ? localStrategy : globalStrategy;
const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({
rects: sortedRects,
activeNodeRect,
activeIndex,
overIndex,
index
}) : null;
const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
id,
items,
activeIndex,
overIndex
}) : index;
const activeId = active == null ? void 0 : active.id;
const previous = React.useRef({
activeId,
items,
newIndex,
containerId
});
const itemsHaveChanged = items !== previous.current.items;
const shouldAnimateLayoutChanges = animateLayoutChanges({
active,
containerId,
isDragging,
isSorting,
id,
index,
items,
newIndex: previous.current.newIndex,
previousItems: previous.current.items,
previousContainerId: previous.current.containerId,
transition,
wasDragging: previous.current.activeId != null
});
const derivedTransform = useDerivedTransform({
disabled: !shouldAnimateLayoutChanges,
index,
node,
rect
});
React.useEffect(() => {
if (isSorting && previous.current.newIndex !== newIndex) {
previous.current.newIndex = newIndex;
}
if (containerId !== previous.current.containerId) {
previous.current.containerId = containerId;
}
if (items !== previous.current.items) {
previous.current.items = items;
}
}, [isSorting, newIndex, containerId, items]);
React.useEffect(() => {
if (activeId === previous.current.activeId) {
return;
}
if (activeId != null && previous.current.activeId == null) {
previous.current.activeId = activeId;
return;
}
const timeoutId = setTimeout(() => {
previous.current.activeId = activeId;
}, 50);
return () => clearTimeout(timeoutId);
}, [activeId]);
return {
active,
activeIndex,
attributes,
data,
rect,
index,
newIndex,
items,
isOver,
isSorting,
isDragging,
listeners,
node,
overIndex,
over,
setNodeRef,
setActivatorNodeRef,
setDroppableNodeRef,
setDraggableNodeRef,
transform: derivedTransform != null ? derivedTransform : finalTransform,
transition: getTransition()
};
function getTransition() {
if ( // Temporarily disable transitions for a single frame to set up derived transforms
derivedTransform || // Or to prevent items jumping to back to their "new" position when items change
itemsHaveChanged && previous.current.newIndex === index) {
return disabledTransition;
}
if (shouldDisplaceDragSource && !utilities.isKeyboardEvent(activatorEvent) || !transition) {
return undefined;
}
if (isSorting || shouldAnimateLayoutChanges) {
return utilities.CSS.Transition.toString({ ...transition,
property: transitionProperty
});
}
return undefined;
}
}
function normalizeLocalDisabled(localDisabled, globalDisabled) {
var _localDisabled$dragga, _localDisabled$droppa;
if (typeof localDisabled === 'boolean') {
return {
draggable: localDisabled,
// Backwards compatibility
droppable: false
};
}
return {
draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,
droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable
};
}
function hasSortableData(entry) {
if (!entry) {
return false;
}
const data = entry.data.current;
if (data && 'sortable' in data && typeof data.sortable === 'object' && 'containerId' in data.sortable && 'items' in data.sortable && 'index' in data.sortable) {
return true;
}
return false;
}
const directions = [core.KeyboardCode.Down, core.KeyboardCode.Right, core.KeyboardCode.Up, core.KeyboardCode.Left];
const sortableKeyboardCoordinates = (event, _ref) => {
let {
context: {
active,
collisionRect,
droppableRects,
droppableContainers,
over,
scrollableAncestors
}
} = _ref;
if (directions.includes(event.code)) {
event.preventDefault();
if (!active || !collisionRect) {
return;
}
const filteredContainers = [];
droppableContainers.getEnabled().forEach(entry => {
if (!entry || entry != null && entry.disabled) {
return;
}
const rect = droppableRects.get(entry.id);
if (!rect) {
return;
}
switch (event.code) {
case core.KeyboardCode.Down:
if (collisionRect.top < rect.top) {
filteredContainers.push(entry);
}
break;
case core.KeyboardCode.Up:
if (collisionRect.top > rect.top) {
filteredContainers.push(entry);
}
break;
case core.KeyboardCode.Left:
if (collisionRect.left > rect.left) {
filteredContainers.push(entry);
}
break;
case core.KeyboardCode.Right:
if (collisionRect.left < rect.left) {
filteredContainers.push(entry);
}
break;
}
});
const collisions = core.closestCorners({
active,
collisionRect: collisionRect,
droppableRects,
droppableContainers: filteredContainers,
pointerCoordinates: null
});
let closestId = core.getFirstCollision(collisions, 'id');
if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) {
closestId = collisions[1].id;
}
if (closestId != null) {
const activeDroppable = droppableContainers.get(active.id);
const newDroppable = droppableContainers.get(closestId);
const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;
const newNode = newDroppable == null ? void 0 : newDroppable.node.current;
if (newNode && newRect && activeDroppable && newDroppable) {
const newScrollAncestors = core.getScrollableAncestors(newNode);
const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element);
const hasSameContainer = isSameContainer(activeDroppable, newDroppable);
const isAfterActive = isAfter(activeDroppable, newDroppable);
const offset = hasDifferentScrollAncestors || !hasSameContainer ? {
x: 0,
y: 0
} : {
x: isAfterActive ? collisionRect.width - newRect.width : 0,
y: isAfterActive ? collisionRect.height - newRect.height : 0
};
const rectCoordinates = {
x: newRect.left,
y: newRect.top
};
const newCoordinates = offset.x && offset.y ? rectCoordinates : utilities.subtract(rectCoordinates, offset);
return newCoordinates;
}
}
}
return undefined;
};
function isSameContainer(a, b) {
if (!hasSortableData(a) || !hasSortableData(b)) {
return false;
}
return a.data.current.sortable.containerId === b.data.current.sortable.containerId;
}
function isAfter(a, b) {
if (!hasSortableData(a) || !hasSortableData(b)) {
return false;
}
if (!isSameContainer(a, b)) {
return false;
}
return a.data.current.sortable.index < b.data.current.sortable.index;
}
exports.SortableContext = SortableContext;
exports.arrayMove = arrayMove;
exports.arraySwap = arraySwap;
exports.defaultAnimateLayoutChanges = defaultAnimateLayoutChanges;
exports.defaultNewIndexGetter = defaultNewIndexGetter;
exports.hasSortableData = hasSortableData;
exports.horizontalListSortingStrategy = horizontalListSortingStrategy;
exports.rectSortingStrategy = rectSortingStrategy;
exports.rectSwappingStrategy = rectSwappingStrategy;
exports.sortableKeyboardCoordinates = sortableKeyboardCoordinates;
exports.useSortable = useSortable;
exports.verticalListSortingStrategy = verticalListSortingStrategy;
//# sourceMappingURL=sortable.cjs.development.js.map
@@ -0,0 +1,52 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import type * as commentParser from 'comment-parser';
import type { ChildContext, DocStyle, ParseError, RuleContext } from '../types.js';
export type DocStyleParsers = Record<DocStyle, (comments: TSESTree.Comment[]) => commentParser.Block | undefined>;
export interface DeclarationMetadata {
source: Pick<TSESTree.Literal, 'value' | 'loc'>;
importedSpecifiers?: Set<string>;
dynamic?: boolean;
isOnlyImportingTypes?: boolean;
}
export interface ModuleNamespace {
doc?: commentParser.Block;
namespace?: ExportMap | null;
}
export interface ModuleImport {
getter: () => ExportMap | null;
declarations: Set<DeclarationMetadata>;
}
export declare class ExportMap {
path: string;
static for(context: ChildContext): ExportMap | null;
static get(source: string, context: RuleContext): ExportMap | null;
static parse(filepath: string, content: string, context: ChildContext): ExportMap | null;
namespace: Map<string, ModuleNamespace>;
reexports: Map<string, {
local: string;
getImport(): ExportMap | null;
}>;
dependencies: Set<() => ExportMap | null>;
imports: Map<string, ModuleImport>;
exports: Map<string, TSESTree.Identifier | TSESTree.ProgramStatement>;
errors: ParseError[];
parseGoal: 'ambiguous' | 'Module' | 'Script';
visitorKeys: TSESLint.SourceCode.VisitorKeys | null;
private mtime;
doc: commentParser.Block | undefined;
constructor(path: string);
get hasDefault(): boolean;
get size(): number;
has(name: string): boolean;
hasDeep(name: string): {
found: boolean;
path: ExportMap[];
};
get(name: string): ModuleNamespace | null | undefined;
$forEach(callback: (value: ModuleNamespace | null | undefined, name: string, map: ExportMap) => void, thisArg?: unknown): void;
reportErrors(context: RuleContext, declaration: {
source: TSESTree.Literal | null;
}): void;
}
export declare function recursivePatternCapture(pattern: TSESTree.Node, callback: (node: TSESTree.DestructuringPattern) => void): void;
export declare function makeContextCacheKey(context: RuleContext | ChildContext): string;
@@ -0,0 +1 @@
{"/Users/dabh/triple-beam/index.js":{"path":"/Users/dabh/triple-beam/index.js","statementMap":{"0":{"start":{"line":11,"column":0},"end":{"line":13,"column":3}},"1":{"start":{"line":23,"column":0},"end":{"line":25,"column":3}},"2":{"start":{"line":34,"column":0},"end":{"line":36,"column":3}},"3":{"start":{"line":44,"column":0},"end":{"line":46,"column":3}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"cc95d94182fb79b1be57a24c1394db64cdb2ae43","contentHash":"fc4e5a28fd95e03cae6b5495203bb1875d4000296fe4308cb90943317c6cd273"},"/Users/dabh/triple-beam/config/index.js":{"path":"/Users/dabh/triple-beam/config/index.js","statementMap":{"0":{"start":{"line":14,"column":0},"end":{"line":16,"column":3}},"1":{"start":{"line":22,"column":0},"end":{"line":24,"column":3}},"2":{"start":{"line":30,"column":0},"end":{"line":32,"column":3}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"153b0bdac58673ccf1f21070117bb797c37a2456","contentHash":"162d744ed325a346a9b0913721d2f61535053e170a78dc205aef5ae6aef820de"},"/Users/dabh/triple-beam/config/cli.js":{"path":"/Users/dabh/triple-beam/config/cli.js","statementMap":{"0":{"start":{"line":14,"column":0},"end":{"line":25,"column":2}},"1":{"start":{"line":31,"column":0},"end":{"line":42,"column":2}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"4843c10f2957d007fb3125cc3a04d3b940a44851","contentHash":"3c526501a0b8bf50d0bbc28e6d4a1baf4c1798586fe1154292a1d9ba3a77efaf"},"/Users/dabh/triple-beam/config/npm.js":{"path":"/Users/dabh/triple-beam/config/npm.js","statementMap":{"0":{"start":{"line":14,"column":0},"end":{"line":22,"column":2}},"1":{"start":{"line":28,"column":0},"end":{"line":36,"column":2}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"56fb16df83c6d6275045feafabbe26c61f098c4b","contentHash":"07a4e369cf657d332a918f7ca96bcc1b831720e571cc2902aec1feed0c598920"},"/Users/dabh/triple-beam/config/syslog.js":{"path":"/Users/dabh/triple-beam/config/syslog.js","statementMap":{"0":{"start":{"line":14,"column":0},"end":{"line":23,"column":2}},"1":{"start":{"line":29,"column":0},"end":{"line":38,"column":2}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"4a8f05f93061e8c418dd384c10b82586a7f6e950","contentHash":"6177cc185f053def4bdb52172b771267aa2ee7ff9e11208e7f88ec323f1b058a"}}
@@ -0,0 +1,9 @@
{
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"target": "ESNext",
},
"exclude": [
"coverage"
]
}
@@ -0,0 +1,3 @@
# @react-stately/tree
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","2":"K D E wC"},B:{"1":"0 1 2 3 4 5 C L M G N O P 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:{"1":"0 1 2 3 4 5 6 7 8 9 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC","132":"J ZB K D E F A B C L M G N O P aB 0C 1C"},D:{"1":"0 1 2 3 4 5 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 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":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 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"},F:{"1":"0 1 2 3 4 5 6 7 8 9 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 d e f g h i j k l m n o p q r s t u v w x y z HD ID NC uC JD OC","2":"F","4":"FD GD"},G:{"260":"E ZC KD vC LD MD ND OD PD QD RD SD 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"},H:{"2":"hD"},I:{"1":"TC J I kD lD vC mD nD","2":"iD jD"},J:{"1":"D A"},K:{"1":"B C H NC uC OC","2":"A"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:1,C:"Audio element",D:true};
@@ -0,0 +1,42 @@
{
"name": "goober-global",
"amdName": "gooberGlobal",
"version": "0.0.1",
"description": "The createGlobalStyles addon function for goober",
"sideEffects": false,
"main": "dist/goober-global.cjs",
"module": "dist/goober-global.esm.js",
"umd:main": "dist/goober-global.umd.js",
"source": "src/index.js",
"unpkg": "dist/goober-global.umd.js",
"types": "./global.d.ts",
"type": "module",
"scripts": {
"build": "rm -rf dist && microbundle --entry src/index.js --name gooberGlobal --no-sourcemap --generateTypes false",
"test": "jest"
},
"repository": {
"type": "git",
"url": "https://github.com/cristianbote/goober.git",
"directory": "global"
},
"author": "Cristian <botecristian@yahoo.com>",
"keywords": [
"goober",
"styled",
"global"
],
"license": "MIT",
"peerDependencies": {
"goober": "^2.0.29"
},
"devDependencies": {
"goober": "^2.0.29",
"microbundle": "^0.14.2",
"jest": "^24.1.0",
"preact": "^10.5.6",
"@babel/plugin-transform-react-jsx": "^7.7.0",
"@babel/preset-env": "^7.3.1",
"babel-jest": "^24.1.0"
}
}
@@ -0,0 +1,938 @@
export default `flf2a$ 9 8 18 -1 18
AMC razor 2 font by LESTER
============================
-> Conversion to FigLet font by MEPH. (Part of ASCII Editor Service Pack I)
(http://studenten.freepage.de/meph/ascii/ascii/editor/_index.htm)
-> Defined: ASCII code alphanumeric
-> Uppercase characters only.
.-~~-.
(_^..^_)
Lester||||AMC - Anthony Cucchiara
*Mythos Online : Internet Magazine of Lovecraftian Horror - Dead Alice*
http://www.fortunecity.com/victorian/redlion/157/deadal.htm
*Visit my web page ANSI/ASCII/Fonts*
http://members.aol.com/lester5374/
$@
$@
$@
$@
$@
$@
$@
$@
$@@
. @
|\`+. @
| | @
| | @
\`+.| @
. @
|\`+. @
\`+.| @
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
. @
|\`+. @
\`+.| @
@@
@
@
@
@
@
@
@
@
@@
. . @
.+'|=|\`+. @
| +' \`+ | @
| |\\ | | @
| | \\ | | @
| | \\| | @
| +. .+ | @
\`+.|=|.+' @
@@
. . @
.'|=|\`+. @
|.' | | @
| | @
| | @
| | @
| | @
|.+' @
@@
. . @
.+'|=|\`+. @
|.+' | | @
. | | @
.+'|=|.+' @
| | . @
| | .+'| @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
|.+' | | @
.'|=| | @
|.' | | @
. | | @
|\`+. | | @
\`+.|=|.+' @
@@
. . @
.+'| |\`+. @
| | | | @
\`++'=| | @
| | @
| | @
| | @
|.+' @
@@
. @
|~~|=|\`+. @
| | \`+.| @
| | . @
|..|=|\`+. @
. | | @
|\`+. | | @
\`+.|=|.+' @
@@
. . @
|\`+.=|\`+. @
| | \`+.| @
| | . @
| |=|\`+. @
| | | | @
| | | | @
\`+.|=|.+' @
@@
. . @
.+'|=.+'| @
|.+' | | @
|.+' @
.=' @
.+'| @
| | @
|..| @
@@
. . @
.+'|=|\`+. @
| | | | @
.' |=| \`. @
| | | | @
| | | | @
| | | | @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | | | @
| | | | @
\`+.|=| | @
. | | @
|\`+. | | @
\`+.|=|.+' @
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
. . @
.+'|=|\`+. @
| | | | @
| |=| | @
| | | | @
| | | | @
| | | | @
\`+.| |..| @
@@
. . @
.+'|=|\`+. @
| | | | @
| |'. '. @
| | | | @
| | | | @
| | | | @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | \`+.| @
| | @
| | @
| | . @
| | .+'| @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | \`+ | @
| | | | @
| | | | @
| | | | @
| | .+ | @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | \`+.| @
| |=|\`. @
| | \`.| @
| | . @
| | .+'| @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | \`+.| @
| |=|\`. @
| | \`.| @
| | @
| | @
\`+.| @
@@
. . @
.+'|=|\`+. @
| | \`+.| @
| | . @
| | |\`+. @
| | \`. | @
| | .+ | @
\`+.|=|.+' @
@@
. . @
.+'| |\`+. @
| | | | @
| |=| | @
| | | | @
| | | | @
| | | | @
\`+.| |..| @
@@
. @
|\`+. @
| | @
| | @
| | @
| | @
| | @
|.+' @
@@
. @
|\`+. @
| | @
| | @
| | @
. | | @
|\`+. | | @
\`+.|=|.+' @
@@
. . @
.+'| |\`. @
| | .+ | @
| |=|.+' @
| | |\`+. @
| | | | @
| | | | @
\`+.| |..| @
@@
. @
.+'| @
| | @
| | @
| | @
| | . @
| | .+'| @
\`+.|=|.+' @
@@
. . . @
.+'|=|\`+.=|\`+. @
| | \`+ | \`+ | @
| | | | | | @
| | | | | | @
| | | | | | @
| | | | | | @
\`+.| |.| |+' @
@@
. . @
.+'|=|\`+. @
| | \`+ | @
| | | | @
| | | | @
| | | | @
| | | | @
\`+.| |.| @
@@
. . @
.+'|=|\`+. @
| | | | @
| | | | @
| | | | @
| | | | @
| | | | @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | | | @
| |=\`++' @
| | @
| | @
| | @
\`+.| @
@@
. . @
.+'|=|\`+. @
| +' \`+ | @
| | | | @
| | | | @
| | .| | @
| +.\`. | @
\`+.|=|.-. @
@@
. . @
.+'|=|\`+. @
| | | | @
| |'. '. @
| | | | @
| | | | @
| | | | @
\`+.| |.+' @
@@
. . @
.+'|=|\`+. @
| | \`+.| @
| | . @
\`+.|=|\`+. @
. | | @
|\`+. | | @
\`+.|=|.+' @
@@
. . . @
.+'|=|\`+.=|\`+. @
|.+' | | \`+.| @
| | @
| | @
| | @
| | @
|.+' @
@@
. . @
.+'| |\`+. @
| | | | @
| | | | @
| | | | @
| | | | @
| | | | @
\`+.|=|.+' @
@@
. . @
.+'| .'| @
| | | | @
| | | | @
| | | | @
| | | | @
| | .+ | @
\`+.|=|.+' @
@@
. . . @
.+'| .'| .'| @
| | | | | | @
| | | | | | @
| | | | | | @
| | | | | | @
| | .+ | .+ | @
\`+.|=|.+'=|.+' @
@@
. . @
.+'| |\`+. @
| | | | @
.' .\`. \`. @
| | | | @
| | | | @
| | | | @
\`+.| |.+' @
@@
. . @
.+'|.+'| @
| || | @
\`+.\`'.+' @
| | @
| | @
| | @
|.+' @
@@
@
|~~|=|~~| @
|.+' | | @
|.+' @
.=' @
.+'| . @
| | .+'| @
|..|=|..| @
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
. . @
.+'|=|\`+. @
| | | | @
| |=| | @
| | | | @
| | | | @
| | | | @
\`+.| |..| @
@@
. . @
.+'|=|\`+. @
| | | | @
| |'. '. @
| | | | @
| | | | @
| | | | @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | \`+.| @
| | @
| | @
| | . @
| | .+'| @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | \`+ | @
| | | | @
| | | | @
| | | | @
| | .+ | @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | \`+.| @
| |=|\`. @
| | \`.| @
| | . @
| | .+'| @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | \`+.| @
| |=|\`. @
| | \`.| @
| | @
| | @
\`+.| @
@@
. . @
.+'|=|\`+. @
| | \`+.| @
| | . @
| | |\`+. @
| | \`. | @
| | .+ | @
\`+.|=|.+' @
@@
. . @
.+'| |\`+. @
| | | | @
| |=| | @
| | | | @
| | | | @
| | | | @
\`+.| |..| @
@@
. @
|\`+. @
| | @
| | @
| | @
| | @
| | @
|.+' @
@@
. @
|\`+. @
| | @
| | @
| | @
. | | @
|\`+. | | @
\`+.|=|.+' @
@@
. . @
.+'| |\`. @
| | .+ | @
| |=|.+' @
| | |\`+. @
| | | | @
| | | | @
\`+.| |..| @
@@
. @
.+'| @
| | @
| | @
| | @
| | . @
| | .+'| @
\`+.|=|.+' @
@@
. . . @
.+'|=|\`+.=|\`+. @
| | \`+ | \`+ | @
| | | | | | @
| | | | | | @
| | | | | | @
| | | | | | @
\`+.| |.| |+' @
@@
. . @
.+'|=|\`+. @
| | \`+ | @
| | | | @
| | | | @
| | | | @
| | | | @
\`+.| |.| @
@@
. . @
.+'|=|\`+. @
| | | | @
| | | | @
| | | | @
| | | | @
| | | | @
\`+.|=|.+' @
@@
. . @
.+'|=|\`+. @
| | | | @
| |=\`++' @
| | @
| | @
| | @
\`+.| @
@@
. . @
.+'|=|\`+. @
| +' \`+ | @
| | | | @
| | | | @
| | .| | @
| +.\`. | @
\`+.|=|.-. @
@@
. . @
.+'|=|\`+. @
| | | | @
| |'. '. @
| | | | @
| | | | @
| | | | @
\`+.| |.+' @
@@
. . @
.+'|=|\`+. @
| | \`+.| @
| | . @
\`+.|=|\`+. @
. | | @
|\`+. | | @
\`+.|=|.+' @
@@
. . . @
.+'|=|\`+.=|\`+. @
|.+' | | \`+.| @
| | @
| | @
| | @
| | @
|.+' @
@@
. . @
.+'| |\`+. @
| | | | @
| | | | @
| | | | @
| | | | @
| | | | @
\`+.|=|.+' @
@@
. . @
.+'| .'| @
| | | | @
| | | | @
| | | | @
| | | | @
| | .+ | @
\`+.|=|.+' @
@@
. . . @
.+'| .'| .'| @
| | | | | | @
| | | | | | @
| | | | | | @
| | | | | | @
| | .+ | .+ | @
\`+.|=|.+'=|.+' @
@@
. . @
.+'| |\`+. @
| | | | @
.' .\`. \`. @
| | | | @
| | | | @
| | | | @
\`+.| |.+' @
@@
. . @
.+'|.+'| @
| || | @
\`+.\`'.+' @
| | @
| | @
| | @
|.+' @
@@
@
|~~|=|~~| @
|.+' | | @
|.+' @
.=' @
.+'| . @
| | .+'| @
|..|=|..| @
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,43 @@
{
"name": "@types/babel__template",
"version": "7.4.4",
"description": "TypeScript definitions for @babel/template",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__template",
"license": "MIT",
"contributors": [
{
"name": "Troy Gerwien",
"githubUsername": "yortus",
"url": "https://github.com/yortus"
},
{
"name": "Marvin Hagemeister",
"githubUsername": "marvinhagemeister",
"url": "https://github.com/marvinhagemeister"
},
{
"name": "Melvin Groenhoff",
"githubUsername": "mgroenhoff",
"url": "https://github.com/mgroenhoff"
},
{
"name": "ExE Boss",
"githubUsername": "ExE-Boss",
"url": "https://github.com/ExE-Boss"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/babel__template"
},
"scripts": {},
"dependencies": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0"
},
"typesPublisherContentHash": "5730d754b4d1fcd41676b093f9e32b340c749c4d37b126dfa312e394467e86c6",
"typeScriptVersion": "4.5"
}
@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Doc = void 0;
class Doc {
constructor(args = []) {
this.content = [];
this.indent = 0;
if (this)
this.args = args;
}
indented(fn) {
this.indent += 1;
fn(this);
this.indent -= 1;
}
write(arg) {
if (typeof arg === "function") {
arg(this, { execution: "sync" });
arg(this, { execution: "async" });
return;
}
const content = arg;
const lines = content.split("\n").filter((x) => x);
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
for (const line of dedented) {
this.content.push(line);
}
}
compile() {
const F = Function;
const args = this?.args;
const content = this?.content ?? [``];
const lines = [...content.map((x) => ` ${x}`)];
// console.log(lines.join("\n"));
return new F(...args, lines.join("\n"));
}
}
exports.Doc = Doc;
@@ -0,0 +1,426 @@
'use strict'
module.exports = Yallist
Yallist.Node = Node
Yallist.create = Yallist
function Yallist (list) {
var self = this
if (!(self instanceof Yallist)) {
self = new Yallist()
}
self.tail = null
self.head = null
self.length = 0
if (list && typeof list.forEach === 'function') {
list.forEach(function (item) {
self.push(item)
})
} else if (arguments.length > 0) {
for (var i = 0, l = arguments.length; i < l; i++) {
self.push(arguments[i])
}
}
return self
}
Yallist.prototype.removeNode = function (node) {
if (node.list !== this) {
throw new Error('removing node which does not belong to this list')
}
var next = node.next
var prev = node.prev
if (next) {
next.prev = prev
}
if (prev) {
prev.next = next
}
if (node === this.head) {
this.head = next
}
if (node === this.tail) {
this.tail = prev
}
node.list.length--
node.next = null
node.prev = null
node.list = null
return next
}
Yallist.prototype.unshiftNode = function (node) {
if (node === this.head) {
return
}
if (node.list) {
node.list.removeNode(node)
}
var head = this.head
node.list = this
node.next = head
if (head) {
head.prev = node
}
this.head = node
if (!this.tail) {
this.tail = node
}
this.length++
}
Yallist.prototype.pushNode = function (node) {
if (node === this.tail) {
return
}
if (node.list) {
node.list.removeNode(node)
}
var tail = this.tail
node.list = this
node.prev = tail
if (tail) {
tail.next = node
}
this.tail = node
if (!this.head) {
this.head = node
}
this.length++
}
Yallist.prototype.push = function () {
for (var i = 0, l = arguments.length; i < l; i++) {
push(this, arguments[i])
}
return this.length
}
Yallist.prototype.unshift = function () {
for (var i = 0, l = arguments.length; i < l; i++) {
unshift(this, arguments[i])
}
return this.length
}
Yallist.prototype.pop = function () {
if (!this.tail) {
return undefined
}
var res = this.tail.value
this.tail = this.tail.prev
if (this.tail) {
this.tail.next = null
} else {
this.head = null
}
this.length--
return res
}
Yallist.prototype.shift = function () {
if (!this.head) {
return undefined
}
var res = this.head.value
this.head = this.head.next
if (this.head) {
this.head.prev = null
} else {
this.tail = null
}
this.length--
return res
}
Yallist.prototype.forEach = function (fn, thisp) {
thisp = thisp || this
for (var walker = this.head, i = 0; walker !== null; i++) {
fn.call(thisp, walker.value, i, this)
walker = walker.next
}
}
Yallist.prototype.forEachReverse = function (fn, thisp) {
thisp = thisp || this
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
fn.call(thisp, walker.value, i, this)
walker = walker.prev
}
}
Yallist.prototype.get = function (n) {
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
// abort out of the list early if we hit a cycle
walker = walker.next
}
if (i === n && walker !== null) {
return walker.value
}
}
Yallist.prototype.getReverse = function (n) {
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
// abort out of the list early if we hit a cycle
walker = walker.prev
}
if (i === n && walker !== null) {
return walker.value
}
}
Yallist.prototype.map = function (fn, thisp) {
thisp = thisp || this
var res = new Yallist()
for (var walker = this.head; walker !== null;) {
res.push(fn.call(thisp, walker.value, this))
walker = walker.next
}
return res
}
Yallist.prototype.mapReverse = function (fn, thisp) {
thisp = thisp || this
var res = new Yallist()
for (var walker = this.tail; walker !== null;) {
res.push(fn.call(thisp, walker.value, this))
walker = walker.prev
}
return res
}
Yallist.prototype.reduce = function (fn, initial) {
var acc
var walker = this.head
if (arguments.length > 1) {
acc = initial
} else if (this.head) {
walker = this.head.next
acc = this.head.value
} else {
throw new TypeError('Reduce of empty list with no initial value')
}
for (var i = 0; walker !== null; i++) {
acc = fn(acc, walker.value, i)
walker = walker.next
}
return acc
}
Yallist.prototype.reduceReverse = function (fn, initial) {
var acc
var walker = this.tail
if (arguments.length > 1) {
acc = initial
} else if (this.tail) {
walker = this.tail.prev
acc = this.tail.value
} else {
throw new TypeError('Reduce of empty list with no initial value')
}
for (var i = this.length - 1; walker !== null; i--) {
acc = fn(acc, walker.value, i)
walker = walker.prev
}
return acc
}
Yallist.prototype.toArray = function () {
var arr = new Array(this.length)
for (var i = 0, walker = this.head; walker !== null; i++) {
arr[i] = walker.value
walker = walker.next
}
return arr
}
Yallist.prototype.toArrayReverse = function () {
var arr = new Array(this.length)
for (var i = 0, walker = this.tail; walker !== null; i++) {
arr[i] = walker.value
walker = walker.prev
}
return arr
}
Yallist.prototype.slice = function (from, to) {
to = to || this.length
if (to < 0) {
to += this.length
}
from = from || 0
if (from < 0) {
from += this.length
}
var ret = new Yallist()
if (to < from || to < 0) {
return ret
}
if (from < 0) {
from = 0
}
if (to > this.length) {
to = this.length
}
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
walker = walker.next
}
for (; walker !== null && i < to; i++, walker = walker.next) {
ret.push(walker.value)
}
return ret
}
Yallist.prototype.sliceReverse = function (from, to) {
to = to || this.length
if (to < 0) {
to += this.length
}
from = from || 0
if (from < 0) {
from += this.length
}
var ret = new Yallist()
if (to < from || to < 0) {
return ret
}
if (from < 0) {
from = 0
}
if (to > this.length) {
to = this.length
}
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
walker = walker.prev
}
for (; walker !== null && i > from; i--, walker = walker.prev) {
ret.push(walker.value)
}
return ret
}
Yallist.prototype.splice = function (start, deleteCount /*, ...nodes */) {
if (start > this.length) {
start = this.length - 1
}
if (start < 0) {
start = this.length + start;
}
for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
walker = walker.next
}
var ret = []
for (var i = 0; walker && i < deleteCount; i++) {
ret.push(walker.value)
walker = this.removeNode(walker)
}
if (walker === null) {
walker = this.tail
}
if (walker !== this.head && walker !== this.tail) {
walker = walker.prev
}
for (var i = 2; i < arguments.length; i++) {
walker = insert(this, walker, arguments[i])
}
return ret;
}
Yallist.prototype.reverse = function () {
var head = this.head
var tail = this.tail
for (var walker = head; walker !== null; walker = walker.prev) {
var p = walker.prev
walker.prev = walker.next
walker.next = p
}
this.head = tail
this.tail = head
return this
}
function insert (self, node, value) {
var inserted = node === self.head ?
new Node(value, null, node, self) :
new Node(value, node, node.next, self)
if (inserted.next === null) {
self.tail = inserted
}
if (inserted.prev === null) {
self.head = inserted
}
self.length++
return inserted
}
function push (self, item) {
self.tail = new Node(item, self.tail, null, self)
if (!self.head) {
self.head = self.tail
}
self.length++
}
function unshift (self, item) {
self.head = new Node(item, null, self.head, self)
if (!self.tail) {
self.tail = self.head
}
self.length++
}
function Node (value, prev, next, list) {
if (!(this instanceof Node)) {
return new Node(value, prev, next, list)
}
this.list = list
this.value = value
if (prev) {
prev.next = this
this.prev = prev
} else {
this.prev = null
}
if (next) {
next.prev = this
this.next = next
} else {
this.next = null
}
}
try {
// add if support for Symbol.iterator is present
require('./iterator.js')(Yallist)
} catch (er) {}
@@ -0,0 +1,506 @@
/**
* The `node:os` module provides operating system-related utility methods and
* properties. It can be accessed using:
*
* ```js
* import os from 'node:os';
* ```
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/os.js)
*/
declare module "os" {
import { NonSharedBuffer } from "buffer";
interface CpuInfo {
model: string;
speed: number;
times: {
/** The number of milliseconds the CPU has spent in user mode. */
user: number;
/** The number of milliseconds the CPU has spent in nice mode. */
nice: number;
/** The number of milliseconds the CPU has spent in sys mode. */
sys: number;
/** The number of milliseconds the CPU has spent in idle mode. */
idle: number;
/** The number of milliseconds the CPU has spent in irq mode. */
irq: number;
};
}
interface NetworkInterfaceBase {
address: string;
netmask: string;
mac: string;
internal: boolean;
cidr: string | null;
scopeid?: number;
}
interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
family: "IPv4";
}
interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
family: "IPv6";
scopeid: number;
}
interface UserInfo<T> {
username: T;
uid: number;
gid: number;
shell: T | null;
homedir: T;
}
type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
/**
* Returns the host name of the operating system as a string.
* @since v0.3.3
*/
function hostname(): string;
/**
* Returns an array containing the 1, 5, and 15 minute load averages.
*
* The load average is a measure of system activity calculated by the operating
* system and expressed as a fractional number.
*
* The load average is a Unix-specific concept. On Windows, the return value is
* always `[0, 0, 0]`.
* @since v0.3.3
*/
function loadavg(): number[];
/**
* Returns the system uptime in number of seconds.
* @since v0.3.3
*/
function uptime(): number;
/**
* Returns the amount of free system memory in bytes as an integer.
* @since v0.3.3
*/
function freemem(): number;
/**
* Returns the total amount of system memory in bytes as an integer.
* @since v0.3.3
*/
function totalmem(): number;
/**
* Returns an array of objects containing information about each logical CPU core.
* The array will be empty if no CPU information is available, such as if the `/proc` file system is unavailable.
*
* The properties included on each object include:
*
* ```js
* [
* {
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
* speed: 2926,
* times: {
* user: 252020,
* nice: 0,
* sys: 30340,
* idle: 1070356870,
* irq: 0,
* },
* },
* {
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
* speed: 2926,
* times: {
* user: 306960,
* nice: 0,
* sys: 26980,
* idle: 1071569080,
* irq: 0,
* },
* },
* {
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
* speed: 2926,
* times: {
* user: 248450,
* nice: 0,
* sys: 21750,
* idle: 1070919370,
* irq: 0,
* },
* },
* {
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
* speed: 2926,
* times: {
* user: 256880,
* nice: 0,
* sys: 19430,
* idle: 1070905480,
* irq: 20,
* },
* },
* ]
* ```
*
* `nice` values are POSIX-only. On Windows, the `nice` values of all processors
* are always 0.
*
* `os.cpus().length` should not be used to calculate the amount of parallelism
* available to an application. Use {@link availableParallelism} for this purpose.
* @since v0.3.3
*/
function cpus(): CpuInfo[];
/**
* Returns an estimate of the default amount of parallelism a program should use.
* Always returns a value greater than zero.
*
* This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism).
* @since v19.4.0, v18.14.0
*/
function availableParallelism(): number;
/**
* Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it
* returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows.
*
* See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information
* about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems.
* @since v0.3.3
*/
function type(): string;
/**
* Returns the operating system as a string.
*
* On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See
* [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
* @since v0.3.3
*/
function release(): string;
/**
* Returns an object containing network interfaces that have been assigned a
* network address.
*
* Each key on the returned object identifies a network interface. The associated
* value is an array of objects that each describe an assigned network address.
*
* The properties available on the assigned network address object include:
*
* ```js
* {
* lo: [
* {
* address: '127.0.0.1',
* netmask: '255.0.0.0',
* family: 'IPv4',
* mac: '00:00:00:00:00:00',
* internal: true,
* cidr: '127.0.0.1/8'
* },
* {
* address: '::1',
* netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
* family: 'IPv6',
* mac: '00:00:00:00:00:00',
* scopeid: 0,
* internal: true,
* cidr: '::1/128'
* }
* ],
* eth0: [
* {
* address: '192.168.1.108',
* netmask: '255.255.255.0',
* family: 'IPv4',
* mac: '01:02:03:0a:0b:0c',
* internal: false,
* cidr: '192.168.1.108/24'
* },
* {
* address: 'fe80::a00:27ff:fe4e:66a1',
* netmask: 'ffff:ffff:ffff:ffff::',
* family: 'IPv6',
* mac: '01:02:03:0a:0b:0c',
* scopeid: 1,
* internal: false,
* cidr: 'fe80::a00:27ff:fe4e:66a1/64'
* }
* ]
* }
* ```
* @since v0.6.0
*/
function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
/**
* Returns the string path of the current user's home directory.
*
* On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it
* uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory.
*
* On Windows, it uses the `USERPROFILE` environment variable if defined.
* Otherwise it uses the path to the profile directory of the current user.
* @since v2.3.0
*/
function homedir(): string;
interface UserInfoOptions {
encoding?: BufferEncoding | "buffer" | undefined;
}
interface UserInfoOptionsWithBufferEncoding extends UserInfoOptions {
encoding: "buffer";
}
interface UserInfoOptionsWithStringEncoding extends UserInfoOptions {
encoding?: BufferEncoding | undefined;
}
/**
* Returns information about the currently effective user. On POSIX platforms,
* this is typically a subset of the password file. The returned object includes
* the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and `gid` fields are `-1`, and `shell` is `null`.
*
* The value of `homedir` returned by `os.userInfo()` is provided by the operating
* system. This differs from the result of `os.homedir()`, which queries
* environment variables for the home directory before falling back to the
* operating system response.
*
* Throws a [`SystemError`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`.
* @since v6.0.0
*/
function userInfo(options?: UserInfoOptionsWithStringEncoding): UserInfo<string>;
function userInfo(options: UserInfoOptionsWithBufferEncoding): UserInfo<NonSharedBuffer>;
function userInfo(options: UserInfoOptions): UserInfo<string | Buffer>;
type SignalConstants = {
[key in NodeJS.Signals]: number;
};
namespace constants {
const UV_UDP_REUSEADDR: number;
namespace signals {}
const signals: SignalConstants;
namespace errno {
const E2BIG: number;
const EACCES: number;
const EADDRINUSE: number;
const EADDRNOTAVAIL: number;
const EAFNOSUPPORT: number;
const EAGAIN: number;
const EALREADY: number;
const EBADF: number;
const EBADMSG: number;
const EBUSY: number;
const ECANCELED: number;
const ECHILD: number;
const ECONNABORTED: number;
const ECONNREFUSED: number;
const ECONNRESET: number;
const EDEADLK: number;
const EDESTADDRREQ: number;
const EDOM: number;
const EDQUOT: number;
const EEXIST: number;
const EFAULT: number;
const EFBIG: number;
const EHOSTUNREACH: number;
const EIDRM: number;
const EILSEQ: number;
const EINPROGRESS: number;
const EINTR: number;
const EINVAL: number;
const EIO: number;
const EISCONN: number;
const EISDIR: number;
const ELOOP: number;
const EMFILE: number;
const EMLINK: number;
const EMSGSIZE: number;
const EMULTIHOP: number;
const ENAMETOOLONG: number;
const ENETDOWN: number;
const ENETRESET: number;
const ENETUNREACH: number;
const ENFILE: number;
const ENOBUFS: number;
const ENODATA: number;
const ENODEV: number;
const ENOENT: number;
const ENOEXEC: number;
const ENOLCK: number;
const ENOLINK: number;
const ENOMEM: number;
const ENOMSG: number;
const ENOPROTOOPT: number;
const ENOSPC: number;
const ENOSR: number;
const ENOSTR: number;
const ENOSYS: number;
const ENOTCONN: number;
const ENOTDIR: number;
const ENOTEMPTY: number;
const ENOTSOCK: number;
const ENOTSUP: number;
const ENOTTY: number;
const ENXIO: number;
const EOPNOTSUPP: number;
const EOVERFLOW: number;
const EPERM: number;
const EPIPE: number;
const EPROTO: number;
const EPROTONOSUPPORT: number;
const EPROTOTYPE: number;
const ERANGE: number;
const EROFS: number;
const ESPIPE: number;
const ESRCH: number;
const ESTALE: number;
const ETIME: number;
const ETIMEDOUT: number;
const ETXTBSY: number;
const EWOULDBLOCK: number;
const EXDEV: number;
const WSAEINTR: number;
const WSAEBADF: number;
const WSAEACCES: number;
const WSAEFAULT: number;
const WSAEINVAL: number;
const WSAEMFILE: number;
const WSAEWOULDBLOCK: number;
const WSAEINPROGRESS: number;
const WSAEALREADY: number;
const WSAENOTSOCK: number;
const WSAEDESTADDRREQ: number;
const WSAEMSGSIZE: number;
const WSAEPROTOTYPE: number;
const WSAENOPROTOOPT: number;
const WSAEPROTONOSUPPORT: number;
const WSAESOCKTNOSUPPORT: number;
const WSAEOPNOTSUPP: number;
const WSAEPFNOSUPPORT: number;
const WSAEAFNOSUPPORT: number;
const WSAEADDRINUSE: number;
const WSAEADDRNOTAVAIL: number;
const WSAENETDOWN: number;
const WSAENETUNREACH: number;
const WSAENETRESET: number;
const WSAECONNABORTED: number;
const WSAECONNRESET: number;
const WSAENOBUFS: number;
const WSAEISCONN: number;
const WSAENOTCONN: number;
const WSAESHUTDOWN: number;
const WSAETOOMANYREFS: number;
const WSAETIMEDOUT: number;
const WSAECONNREFUSED: number;
const WSAELOOP: number;
const WSAENAMETOOLONG: number;
const WSAEHOSTDOWN: number;
const WSAEHOSTUNREACH: number;
const WSAENOTEMPTY: number;
const WSAEPROCLIM: number;
const WSAEUSERS: number;
const WSAEDQUOT: number;
const WSAESTALE: number;
const WSAEREMOTE: number;
const WSASYSNOTREADY: number;
const WSAVERNOTSUPPORTED: number;
const WSANOTINITIALISED: number;
const WSAEDISCON: number;
const WSAENOMORE: number;
const WSAECANCELLED: number;
const WSAEINVALIDPROCTABLE: number;
const WSAEINVALIDPROVIDER: number;
const WSAEPROVIDERFAILEDINIT: number;
const WSASYSCALLFAILURE: number;
const WSASERVICE_NOT_FOUND: number;
const WSATYPE_NOT_FOUND: number;
const WSA_E_NO_MORE: number;
const WSA_E_CANCELLED: number;
const WSAEREFUSED: number;
}
namespace dlopen {
const RTLD_LAZY: number;
const RTLD_NOW: number;
const RTLD_GLOBAL: number;
const RTLD_LOCAL: number;
const RTLD_DEEPBIND: number;
}
namespace priority {
const PRIORITY_LOW: number;
const PRIORITY_BELOW_NORMAL: number;
const PRIORITY_NORMAL: number;
const PRIORITY_ABOVE_NORMAL: number;
const PRIORITY_HIGH: number;
const PRIORITY_HIGHEST: number;
}
}
const devNull: string;
/**
* The operating system-specific end-of-line marker.
* * `\n` on POSIX
* * `\r\n` on Windows
*/
const EOL: string;
/**
* Returns the operating system CPU architecture for which the Node.js binary was
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`,
* and `'x64'`.
*
* The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v22.x/api/process.html#processarch).
* @since v0.5.0
*/
function arch(): string;
/**
* Returns a string identifying the kernel version.
*
* On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
* available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
* @since v13.11.0, v12.17.0
*/
function version(): string;
/**
* Returns a string identifying the operating system platform for which
* the Node.js binary was compiled. The value is set at compile time.
* Possible values are `'aix'`, `'darwin'`, `'freebsd'`, `'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`.
*
* The return value is equivalent to `process.platform`.
*
* The value `'android'` may also be returned if Node.js is built on the Android
* operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
* @since v0.5.0
*/
function platform(): NodeJS.Platform;
/**
* Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`, `mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`.
*
* On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
* available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
* @since v18.9.0, v16.18.0
*/
function machine(): string;
/**
* Returns the operating system's default directory for temporary files as a
* string.
* @since v0.9.9
*/
function tmpdir(): string;
/**
* Returns a string identifying the endianness of the CPU for which the Node.js
* binary was compiled.
*
* Possible values are `'BE'` for big endian and `'LE'` for little endian.
* @since v0.9.4
*/
function endianness(): "BE" | "LE";
/**
* Returns the scheduling priority for the process specified by `pid`. If `pid` is
* not provided or is `0`, the priority of the current process is returned.
* @since v10.10.0
* @param [pid=0] The process ID to retrieve scheduling priority for.
*/
function getPriority(pid?: number): number;
/**
* Attempts to set the scheduling priority for the process specified by `pid`. If `pid` is not provided or is `0`, the process ID of the current process is used.
*
* The `priority` input must be an integer between `-20` (high priority) and `19` (low priority). Due to differences between Unix priority levels and Windows
* priority classes, `priority` is mapped to one of six priority constants in `os.constants.priority`. When retrieving a process priority level, this range
* mapping may cause the return value to be slightly different on Windows. To avoid
* confusion, set `priority` to one of the priority constants.
*
* On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user
* privileges. Otherwise the set priority will be silently reduced to `PRIORITY_HIGH`.
* @since v10.10.0
* @param [pid=0] The process ID to set scheduling priority for.
* @param priority The scheduling priority to assign to the process.
*/
function setPriority(priority: number): void;
function setPriority(pid: number, priority: number): void;
}
declare module "node:os" {
export * from "os";
}
@@ -0,0 +1,30 @@
{
"name": "strnum",
"version": "1.1.2",
"description": "Parse String to Number based on configuration",
"main": "strnum.js",
"scripts": {
"test": "jasmine strnum.test.js"
},
"keywords": [
"string",
"number",
"parse",
"convert"
],
"repository": {
"type": "git",
"url": "https://github.com/NaturalIntelligence/strnum"
},
"author": "Amit Gupta (https://amitkumargupta.work/)",
"license": "MIT",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence"
}
],
"devDependencies": {
"jasmine": "^5.6.0"
}
}
@@ -0,0 +1,6 @@
import type { TSchema } from '../schema/index';
import { type TNever } from '../never/index';
import { TIntersect, IntersectOptions } from './intersect-type';
export type Intersect<Types extends TSchema[]> = (Types extends [TSchema] ? Types[0] : Types extends [] ? TNever : TIntersect<Types>);
/** `[Json]` Creates an evaluated Intersect type */
export declare function Intersect<Types extends TSchema[]>(types: [...Types], options?: IntersectOptions): Intersect<Types>;
@@ -0,0 +1,19 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var callBindBasic = require('call-bind-apply-helpers');
/** @type {(thisArg: string, searchString: string, position?: number) => number} */
var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
/** @type {import('.')} */
module.exports = function callBoundIntrinsic(name, allowMissing) {
/* eslint no-extra-parens: 0 */
var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
return callBindBasic(/** @type {const} */ ([intrinsic]));
}
return intrinsic;
};
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var skip_first_delay_1 = require("./skip-first/skip-first.delay");
var always_delay_1 = require("./always/always.delay");
function DelayFactory(options, attempt) {
var delay = initDelayClass(options);
delay.setAttemptNumber(attempt);
return delay;
}
exports.DelayFactory = DelayFactory;
function initDelayClass(options) {
if (!options.delayFirstAttempt) {
return new skip_first_delay_1.SkipFirstDelay(options);
}
return new always_delay_1.AlwaysDelay(options);
}
//# sourceMappingURL=delay.factory.js.map
@@ -0,0 +1,615 @@
flf2a$ 6 4 20 0 2
Derived from a copyrighted program by Jan Wolter (janc@crim.eecs.umich.edu)
Figlet-ized by Wendell Hicken (whicken@parasoft.com)
$$@
$$@
$$@
$$@
$$@
$$@@
@
/@
/ @
' @
o @
@@
@
o o@
' '@
@
@
@@
/ /@
-/-/-@
-/-/- @
/ / @
@
@@
,-/-@
(_/ @
/ ) @
-/-' @
@
@@
() /@
/ @
/ @
/ ()@
@
@@
() @
/\ @
( X @
\/ \@
@
@@
@
o@
'@
@
@
@@
_/@
/ @
/ @
/ @
@
@@
/@
/@
_/ @
/ @
@
@@
@
\ / @
--X--@
/ \ @
@
@@
@
/ @
--/--@
/ @
@
@@
@
@
@
o @
' @
@@
@
@
@
---@
@
@@
@
@
@
o@
@
@@
/@
/ @
/ @
/ @
@
@@
__ @
/ )@
/ / @
(__/ @
@
@@
_@
/@
/ @
/ @
@
@@
__ @
)@
.--' @
(__ @
@
@@
__ @
)@
-/ @
___/ @
@
@@
@
/ /@
'--/ @
/ @
@
@@
___@
/ @
'--. @
___) @
@
@@
@
/ @
/_ @
(__)@
@
@@
___@
/@
-/-@
/ @
@
@@
__ @
( )@
./' @
(__) @
@
@@
__ @
(__)@
/ @
/ @
@
@@
@
@
o@
@
o @
@@
@
@
o@
@
o @
' @@
/@
/ @
\ @
\@
@
@@
@
@
---@
---@
@
@@
\ @
\@
/@
/ @
@
@@
__ @
__)@
/ @
o @
@
@@
@
_ @
/o\ @
(____@
@
@@
_, @
/ | @
/--| @
_/ |_@
@
@@
_ __ @
( / )@
/--< @
/___/ @
@
@@
,___@
/ /@
/ @
(___/ @
@
@@
___ @
( / \@
/ /@
(/\_/ @
@
@@
______@
( / @
/-- @
(/____/@
@
@@
______@
( / @
-/-- @
_/ @
@
@@
,___@
/ /@
/ __ @
(___/ @
@
@@
__ @
( / /@
/--/ @
/ /_ @
@
@@
___ @
( / @
/ @
_/_ @
@
@@
___ @
( / @
/ @
_/_ @
// @
(/ @@
__ ,@
( /,/ @
/< @
/ \_ @
@
@@
__ @
( / @
/ @
(/___/@
@
@@
_ _ _ @
( / ) )@
/ / / @
/ / (_ @
@
@@
_ __ @
( / )@
/ / @
/ (_ @
@
@@
___ @
/ ()@
/ / @
(___/ @
@
@@
_ __ @
( / )@
/--' @
/ @
@
@@
___ @
/ )@
/_ / @
(__\/ @
\_ @
@@
_ __ @
( / )@
/--< @
/ \_@
@
@@
__,@
( @
`. @
(___)@
@
@@
______@
( / @
/ @
_/ @
@
@@
__ ,@
( / / @
/ / @
(_,/_ @
@
@@
_, _@
( | / @
| / @
|/ @
@
@@
__ _@
( / / @
/ / / @
(_/_/ @
@
@@
_, ,@
( |,' @
+ @
_,'|__ @
@
@@
__ _@
( / / @
(__/ @
_/_ @
// @
(/ @@
__ @
/ )@
-< @
_/_@
// @
(/ @@
_@
/ @
/ @
/_ @
@
@@
\ @
\ @
\ @
\@
@
@@
_@
/@
/ @
_/ @
@
@@
/\@
@
@
@
@
@@
@
@
@
@
___@
@@
@
o@
`@
@
@
@@
@
@
__, @
(_/(_@
@
@@
@
/ @
/ @
/_) @
@
@@
@
@
_,@
(__@
@
@@
@
/@
__/ @
(_/_ @
@
@@
@
@
_ @
(/_@
@
@@
@
/)@
// @
//_ @
/) @
(/ @@
@
@
_, @
(_)_@
/| @
(/ @@
@
/ @
/_ @
/ /_@
@
@@
@
o@
, @
(_@
@
@@
@
o@
, @
_/|_@
/) @
(/ @@
@
/ @
/< @
/ |_@
@
@@
_@
//@
// @
(/_ @
@
@@
@
@
_ _ _ @
/ / / /_@
@
@@
@
@
_ _ @
/ / /_@
@
@@
@
@
__@
(_)@
@
@@
@
@
,_ @
_/|_)_@
/| @
(/ @@
@
@
_, @
(_/_@
/| @
(/ @@
@
@
_ @
/ (_@
@
@@
@
@
( @
/_)_@
@
@@
@
_/_@
/ @
(__ @
@
@@
@
@
, ,@
(_/_@
@
@@
@
@
_ ,_@
/ |/ @
@
@@
@
@
, , ,@
(_(_/_@
@
@@
@
@
_., @
/ /\_@
@
@@
@
@
__ ,@
/ (_/_@
/ @
' @@
@
@
__,@
/_/_@
(/ @
@@
_/@
_/ @
/ @
/ @
@
@@
/@
/ @
/ @
/ @
@
@@
/ @
/_@
_/ @
/ @
@
@@
_ @
/ \_/@
@
@
@
@@
o_,o@
/ | @
/--| @
_/ |_@
@
@@
o__o@
/ ()@
/ / @
(___/ @
@
@@
__o o@
( / / @
/ / @
(_,/_ @
@
@@
@
o o@
__, @
(_/(_@
@
@@
@
o o@
__ @
(_) @
@
@@
@
o o@
, , @
(_/_ @
@
@@
__ @
/ )@
/--< @
/___/ @
/ @
@@
@@ -0,0 +1 @@
module.exports={C:{"52":0.00318,"115":0.02705,"127":0.00318,"140":0.00477,"141":0.00318,"142":0.01273,"143":0.14955,"144":0.15274,_:"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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 128 129 130 131 132 133 134 135 136 137 138 139 145 146 147 3.5 3.6"},D:{"34":0.00159,"38":0.00159,"46":0.00159,"50":0.00159,"56":0.01114,"58":0.00159,"66":0.00318,"69":0.00159,"71":0.00159,"73":0.00477,"77":0.02227,"78":0.00159,"79":0.01273,"80":0.00159,"81":0.00159,"83":0.00477,"86":0.00159,"87":0.01432,"89":0.00318,"90":0.00318,"91":0.00159,"92":0.00318,"95":0.00636,"97":0.00477,"98":0.00318,"100":0.00477,"101":0.00159,"103":0.00318,"104":0.00159,"106":0.00159,"107":0.00477,"108":0.00636,"109":0.2291,"110":0.00159,"111":0.00159,"112":0.71913,"113":0.00159,"114":0.00636,"115":0.00318,"116":0.00955,"117":0.02705,"118":0.00318,"119":0.01114,"120":0.00477,"121":0.00159,"122":0.01591,"123":0.05091,"124":0.00477,"125":0.81459,"126":0.07,"127":0.01114,"128":0.00955,"129":0.01273,"130":0.01432,"131":0.03978,"132":0.02546,"133":0.01591,"134":0.02068,"135":0.03818,"136":0.07478,"137":0.06205,"138":0.20206,"139":0.2482,"140":2.87653,"141":5.41736,"142":0.035,"143":0.00318,_:"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 35 36 37 39 40 41 42 43 44 45 47 48 49 51 52 53 54 55 57 59 60 61 62 63 64 65 67 68 70 72 74 75 76 84 85 88 93 94 96 99 102 105 144 145"},F:{"46":0.00477,"79":0.00159,"91":0.00318,"92":0.00636,"95":0.00318,"120":0.01591,"121":0.01432,"122":0.17342,_:"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 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 80 81 82 83 84 85 86 87 88 89 90 93 94 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:{"13":0.00159,"18":0.00159,"89":0.00159,"92":0.00955,"100":0.00159,"109":0.00159,"114":0.05409,"117":0.00477,"122":0.00159,"126":0.00159,"130":0.00159,"131":0.00159,"133":0.00318,"134":0.00159,"135":0.00318,"136":0.00796,"137":0.00318,"138":0.01114,"139":0.02864,"140":0.13524,"141":0.83687,"142":0.00159,_:"12 14 15 16 17 79 80 81 83 84 85 86 87 88 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 118 119 120 121 123 124 125 127 128 129 132"},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 16.4 17.2 26.2","5.1":0.01432,"13.1":0.00159,"14.1":0.00318,"15.4":0.00159,"15.5":0.00159,"15.6":0.01273,"16.0":0.00159,"16.1":0.00159,"16.2":0.00477,"16.3":0.00477,"16.5":0.00318,"16.6":0.0175,"17.0":0.00636,"17.1":0.00636,"17.3":0.00159,"17.4":0.00477,"17.5":0.00477,"17.6":0.00955,"18.0":0.00477,"18.1":0.00477,"18.2":0.00318,"18.3":0.00796,"18.4":0.00636,"18.5-18.6":0.02864,"26.0":0.08432,"26.1":0.00159},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00066,"5.0-5.1":0,"6.0-6.1":0.00263,"7.0-7.1":0.00198,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00593,"10.0-10.2":0.00066,"10.3":0.01119,"11.0-11.2":0.1659,"11.3-11.4":0.00395,"12.0-12.1":0.00132,"12.2-12.5":0.03226,"13.0-13.1":0,"13.2":0.00329,"13.3":0.00132,"13.4-13.7":0.00527,"14.0-14.4":0.01119,"14.5-14.8":0.01185,"15.0-15.1":0.01119,"15.2-15.3":0.00856,"15.4":0.00988,"15.5":0.01119,"15.6-15.8":0.14615,"16.0":0.01975,"16.1":0.03687,"16.2":0.01909,"16.3":0.03423,"16.4":0.00856,"16.5":0.01514,"16.6-16.7":0.19553,"17.0":0.01383,"17.1":0.02107,"17.2":0.01514,"17.3":0.02238,"17.4":0.0395,"17.5":0.06781,"17.6-17.7":0.17117,"18.0":0.03884,"18.1":0.08032,"18.2":0.04345,"18.3":0.13957,"18.4":0.07176,"18.5-18.6":3.65909,"26.0":0.45228,"26.1":0.01646},P:{"4":0.01023,"20":0.02045,"21":0.06135,"22":0.1227,"23":0.07158,"24":0.05113,"25":0.10225,"26":0.22495,"27":0.17383,"28":1.69737,"29":0.06135,_:"5.0-5.4 6.2-6.4 9.2 10.1 12.0","7.2-7.4":0.0409,"8.2":0.01023,"11.1-11.2":0.01023,"13.0":0.02045,"14.0":0.01023,"15.0":0.01023,"16.0":0.02045,"17.0":0.03068,"18.0":0.01023,"19.0":0.03068},I:{"0":0.01679,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.27746,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00159,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.06726},Q:{_:"14.9"},O:{"0":0.00841},H:{"0":0},L:{"0":76.71574}};
@@ -0,0 +1,113 @@
validate-npm-package-license
============================
Give me a string and I'll tell you if it's a valid npm package license string.
```javascript
var valid = require('validate-npm-package-license');
```
SPDX license identifiers are valid license strings:
```javascript
var assert = require('assert');
var validSPDXExpression = {
validForNewPackages: true,
validForOldPackages: true,
spdx: true
};
assert.deepEqual(valid('MIT'), validSPDXExpression);
assert.deepEqual(valid('BSD-2-Clause'), validSPDXExpression);
assert.deepEqual(valid('Apache-2.0'), validSPDXExpression);
assert.deepEqual(valid('ISC'), validSPDXExpression);
```
The function will return a warning and suggestion for nearly-correct license identifiers:
```javascript
assert.deepEqual(
valid('Apache 2.0'),
{
validForOldPackages: false,
validForNewPackages: false,
warnings: [
'license should be ' +
'a valid SPDX license expression (without "LicenseRef"), ' +
'"UNLICENSED", or ' +
'"SEE LICENSE IN <filename>"',
'license is similar to the valid expression "Apache-2.0"'
]
}
);
```
SPDX expressions are valid, too ...
```javascript
// Simple SPDX license expression for dual licensing
assert.deepEqual(
valid('(GPL-3.0-only OR BSD-2-Clause)'),
validSPDXExpression
);
```
... except if they contain `LicenseRef`:
```javascript
var warningAboutLicenseRef = {
validForOldPackages: false,
validForNewPackages: false,
spdx: true,
warnings: [
'license should be ' +
'a valid SPDX license expression (without "LicenseRef"), ' +
'"UNLICENSED", or ' +
'"SEE LICENSE IN <filename>"',
]
};
assert.deepEqual(
valid('LicenseRef-Made-Up'),
warningAboutLicenseRef
);
assert.deepEqual(
valid('(MIT OR LicenseRef-Made-Up)'),
warningAboutLicenseRef
);
```
If you can't describe your licensing terms with standardized SPDX identifiers, put the terms in a file in the package and point users there:
```javascript
assert.deepEqual(
valid('SEE LICENSE IN LICENSE.txt'),
{
validForNewPackages: true,
validForOldPackages: true,
inFile: 'LICENSE.txt'
}
);
assert.deepEqual(
valid('SEE LICENSE IN license.md'),
{
validForNewPackages: true,
validForOldPackages: true,
inFile: 'license.md'
}
);
```
If there aren't any licensing terms, use `UNLICENSED`:
```javascript
var unlicensed = {
validForNewPackages: true,
validForOldPackages: true,
unlicensed: true
};
assert.deepEqual(valid('UNLICENSED'), unlicensed);
assert.deepEqual(valid('UNLICENCED'), unlicensed);
```
@@ -0,0 +1,58 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _table = _interopRequireDefault(require("./table"));
var _struct = _interopRequireDefault(require("./struct"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @file loca表
* @author mengke01(kekee000@gmail.com)
*/
var _default = exports.default = _table.default.create('loca', [], {
read: function read(reader, ttf) {
var offset = this.offset;
var indexToLocFormat = ttf.head.indexToLocFormat;
// indexToLocFormat有2字节和4字节的区别
var type = _struct.default.names[indexToLocFormat === 0 ? _struct.default.Uint16 : _struct.default.Uint32];
var size = indexToLocFormat === 0 ? 2 : 4; // 字节大小
var sizeRatio = indexToLocFormat === 0 ? 2 : 1; // 真实地址偏移
var wordOffset = [];
reader.seek(offset);
var numGlyphs = ttf.maxp.numGlyphs;
for (var i = 0; i < numGlyphs; ++i) {
wordOffset.push(reader.read(type, offset, false) * sizeRatio);
offset += size;
}
return wordOffset;
},
write: function write(writer, ttf) {
var glyfSupport = ttf.support.glyf;
var offset = ttf.support.glyf.offset || 0;
var indexToLocFormat = ttf.head.indexToLocFormat;
var sizeRatio = indexToLocFormat === 0 ? 0.5 : 1;
var numGlyphs = ttf.glyf.length;
for (var i = 0; i < numGlyphs; ++i) {
if (indexToLocFormat) {
writer.writeUint32(offset);
} else {
writer.writeUint16(offset);
}
offset += glyfSupport[i].size * sizeRatio;
}
// write extra
if (indexToLocFormat) {
writer.writeUint32(offset);
} else {
writer.writeUint16(offset);
}
return writer;
},
size: function size(ttf) {
var locaCount = ttf.glyf.length + 1;
return ttf.head.indexToLocFormat ? locaCount * 4 : locaCount * 2;
}
});
@@ -0,0 +1 @@
module.exports={C:{"110":0.0062,"115":0.5332,"133":0.0124,"136":0.0062,"139":0.0248,"140":0.031,"141":0.0558,"142":0.6386,"143":0.5704,"144":0.5022,_:"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 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 134 135 137 138 145 146 147 3.5 3.6"},D:{"53":0.0062,"58":0.0062,"76":0.2356,"79":0.0124,"87":0.0186,"101":0.0062,"103":0.0806,"109":0.4216,"116":0.031,"122":0.031,"123":0.0062,"125":0.7874,"127":0.031,"128":0.0124,"129":0.0496,"130":0.0062,"131":0.0248,"133":0.0062,"134":0.0062,"135":0.0248,"136":0.434,"137":0.0558,"138":0.0806,"139":3.0938,"140":9.6906,"141":21.3838,"142":0.2108,_:"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 54 55 56 57 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 77 78 80 81 83 84 85 86 88 89 90 91 92 93 94 95 96 97 98 99 100 102 104 105 106 107 108 110 111 112 113 114 115 117 118 119 120 121 124 126 132 143 144 145"},F:{"104":0.0186,"117":0.0124,"120":0.0372,"121":0.0062,"122":0.7626,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 105 106 107 108 109 110 111 112 113 114 115 116 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"109":0.0248,"131":0.0124,"134":0.0248,"135":0.0496,"138":0.1426,"139":0.3472,"140":3.007,"141":10.943,_:"12 13 14 15 16 17 18 79 80 81 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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 132 133 136 137 142"},E:{"14":0.0062,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 15.1 15.2-15.3 15.4 15.5 16.1 16.2 16.3 16.4 16.5 17.0 17.2 17.3 18.0 26.1 26.2","14.1":0.0434,"15.6":0.0496,"16.0":0.0062,"16.6":0.1054,"17.1":0.0372,"17.4":0.0062,"17.5":0.0124,"17.6":0.1798,"18.1":0.0062,"18.2":0.1302,"18.3":0.0868,"18.4":0.0062,"18.5-18.6":0.279,"26.0":0.124},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00067,"5.0-5.1":0,"6.0-6.1":0.00268,"7.0-7.1":0.00201,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00602,"10.0-10.2":0.00067,"10.3":0.01137,"11.0-11.2":0.16854,"11.3-11.4":0.00401,"12.0-12.1":0.00134,"12.2-12.5":0.03277,"13.0-13.1":0,"13.2":0.00334,"13.3":0.00134,"13.4-13.7":0.00535,"14.0-14.4":0.01137,"14.5-14.8":0.01204,"15.0-15.1":0.01137,"15.2-15.3":0.00869,"15.4":0.01003,"15.5":0.01137,"15.6-15.8":0.14847,"16.0":0.02006,"16.1":0.03745,"16.2":0.0194,"16.3":0.03478,"16.4":0.00869,"16.5":0.01538,"16.6-16.7":0.19863,"17.0":0.01404,"17.1":0.0214,"17.2":0.01538,"17.3":0.02274,"17.4":0.04013,"17.5":0.06889,"17.6-17.7":0.17389,"18.0":0.03946,"18.1":0.08159,"18.2":0.04414,"18.3":0.14179,"18.4":0.0729,"18.5-18.6":3.71719,"26.0":0.45947,"26.1":0.01672},P:{"23":0.01123,"26":0.01123,"27":0.01123,"28":4.81972,"29":0.31457,_:"4 20 21 22 24 25 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.12522,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00003,"4.4":0,"4.4.3-4.4.4":0.00006},K:{"0":0.0722,_:"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":2.3522},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":26.8058}};
@@ -0,0 +1,14 @@
import { createClassUtils } from './class-utils.mjs';
import { createLruCache } from './lru-cache.mjs';
import { createSplitModifiers } from './modifier-utils.mjs';
function createConfigUtils(config) {
return {
cache: createLruCache(config.cacheSize),
splitModifiers: createSplitModifiers(config),
...createClassUtils(config)
};
}
export { createConfigUtils };
//# sourceMappingURL=config-utils.mjs.map
@@ -0,0 +1,36 @@
{
"name": "@react-aria/label",
"version": "3.7.13",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"main": "dist/main.js",
"module": "dist/module.js",
"exports": {
"types": "./dist/types.d.ts",
"import": "./dist/import.mjs",
"require": "./dist/main.js"
},
"types": "dist/types.d.ts",
"source": "src/index.ts",
"files": [
"dist",
"src"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-aria/utils": "^3.26.0",
"@react-types/shared": "^3.26.0",
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
}
@@ -0,0 +1,24 @@
/**
* @param {Link} node
* @param {Parents | undefined} _
* @param {State} state
* @param {Info} info
* @returns {string}
*/
export function link(node: Link, _: Parents | undefined, state: State, info: Info): string;
export namespace link {
export { linkPeek as peek };
}
import type { Link } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
/**
* @param {Link} node
* @param {Parents | undefined} _
* @param {State} state
* @returns {string}
*/
declare function linkPeek(node: Link, _: Parents | undefined, state: State): string;
export {};
//# sourceMappingURL=link.d.ts.map
@@ -0,0 +1,28 @@
'use strict';
var $TypeError = require('es-errors/type');
var isInteger = require('math-intrinsics/isInteger');
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
var HasOwnProperty = require('./HasOwnProperty');
var IsExtensible = require('./IsExtensible');
// https://262.ecma-international.org/12.0/#sec-setfunctionlength
module.exports = function SetFunctionLength(F, length) {
if (typeof F !== 'function' || !IsExtensible(F) || HasOwnProperty(F, 'length')) {
throw new $TypeError('Assertion failed: `F` must be an extensible function and lack an own `length` property');
}
if (typeof length !== 'number') {
throw new $TypeError('Assertion failed: `length` must be a Number');
}
if (length !== Infinity && (!isInteger(length) || length < 0)) {
throw new $TypeError('Assertion failed: `length` must be ∞, or an integer >= 0');
}
return DefinePropertyOrThrow(F, 'length', {
'[[Configurable]]': true,
'[[Enumerable]]': false,
'[[Value]]': length,
'[[Writable]]': false
});
};
@@ -0,0 +1,99 @@
import { decodeXML, decodeHTML, DecodingMode } from "./decode.js";
import { encodeHTML, encodeNonAsciiHTML } from "./encode.js";
import { encodeXML, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js";
/** The level of entities to support. */
export var EntityLevel;
(function (EntityLevel) {
/** Support only XML entities. */
EntityLevel[EntityLevel["XML"] = 0] = "XML";
/** Support HTML entities, which are a superset of XML entities. */
EntityLevel[EntityLevel["HTML"] = 1] = "HTML";
})(EntityLevel || (EntityLevel = {}));
export var EncodingMode;
(function (EncodingMode) {
/**
* The output is UTF-8 encoded. Only characters that need escaping within
* XML will be escaped.
*/
EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8";
/**
* The output consists only of ASCII characters. Characters that need
* escaping within HTML, and characters that aren't ASCII characters will
* be escaped.
*/
EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII";
/**
* Encode all characters that have an equivalent entity, as well as all
* characters that are not ASCII characters.
*/
EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive";
/**
* Encode all characters that have to be escaped in HTML attributes,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*/
EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute";
/**
* Encode all characters that have to be escaped in HTML text,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*/
EncodingMode[EncodingMode["Text"] = 4] = "Text";
})(EncodingMode || (EncodingMode = {}));
/**
* Decodes a string with entities.
*
* @param data String to decode.
* @param options Decoding options.
*/
export function decode(data, options = EntityLevel.XML) {
const level = typeof options === "number" ? options : options.level;
if (level === EntityLevel.HTML) {
const mode = typeof options === "object" ? options.mode : undefined;
return decodeHTML(data, mode);
}
return decodeXML(data);
}
/**
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
*
* @param data String to decode.
* @param options Decoding options.
* @deprecated Use `decode` with the `mode` set to `Strict`.
*/
export function decodeStrict(data, options = EntityLevel.XML) {
var _a;
const opts = typeof options === "number" ? { level: options } : options;
(_a = opts.mode) !== null && _a !== void 0 ? _a : (opts.mode = DecodingMode.Strict);
return decode(data, opts);
}
/**
* Encodes a string with entities.
*
* @param data String to encode.
* @param options Encoding options.
*/
export function encode(data, options = EntityLevel.XML) {
const opts = typeof options === "number" ? { level: options } : options;
// Mode `UTF8` just escapes XML entities
if (opts.mode === EncodingMode.UTF8)
return escapeUTF8(data);
if (opts.mode === EncodingMode.Attribute)
return escapeAttribute(data);
if (opts.mode === EncodingMode.Text)
return escapeText(data);
if (opts.level === EntityLevel.HTML) {
if (opts.mode === EncodingMode.ASCII) {
return encodeNonAsciiHTML(data);
}
return encodeHTML(data);
}
// ASCII and Extensive are equivalent
return encodeXML(data);
}
export { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js";
export { encodeHTML, encodeNonAsciiHTML,
// Legacy aliases (deprecated)
encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode.js";
export { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute,
// Legacy aliases (deprecated)
decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode.js";
//# sourceMappingURL=index.js.map
@@ -0,0 +1,13 @@
var Stat = require('fs').Stats
module.exports = cloneStats
function cloneStats(stats) {
var replacement = new Stat
Object.keys(stats).forEach(function(key) {
replacement[key] = stats[key]
})
return replacement
}
@@ -0,0 +1 @@
{"version":3,"file":"no-extraneous-dependencies.js","sourceRoot":"","sources":["../../src/rules/no-extraneous-dependencies.ts"],"names":[],"mappings":"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 truncated
@@ -0,0 +1 @@
{"name":"replace-ext","version":"1.0.1","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532127674,"integrity":"sha512-q0OS0Y5cgrmcdke2iDihqAhIsUk5yt1KSyttNMcpOMj+rF8T8SvIqocKzOY1D05Q825idaBrXauslARI0mCz/A==","mode":420,"size":1106},"index.js":{"checkedAt":1794532127674,"integrity":"sha512-o7g0LFHiP4V4KYWr9V+7BEfG7zGofd7gTM+vchamjgrgCIVqg+2PzqI3+X8VWZ+6BY/7dvFxdN68sNXEyM+UNw==","mode":420,"size":767},"LICENSE":{"checkedAt":1794532127674,"integrity":"sha512-tFN9qtUz+AeaNmaB2GCpNbpvmFJs6DzIxXjclFWB17x4wmdAyBb3gG9y+QJK4knBlXABQER6EIR3f4UsLY3gxQ==","mode":420,"size":1164},"README.md":{"checkedAt":1794532127674,"integrity":"sha512-5BIxgHIOcqysh1KH/Qxf0cadBmMuWVJQr1vQF7nEanm7Luj3RRxgnVLOACQtp+joTA8WD0g2X+EnHECmAys+5A==","mode":420,"size":2483}}}
@@ -0,0 +1,29 @@
{
"root": true,
"extends": "@ljharb/eslint-config/node/0.4",
"rules": {
"array-element-newline": 0,
"complexity": 0,
"func-style": [2, "declaration"],
"max-lines-per-function": 0,
"max-nested-callbacks": 1,
"max-statements-per-line": 1,
"max-statements": 0,
"multiline-comment-style": 0,
"no-continue": 1,
"no-param-reassign": 1,
"no-restricted-syntax": 1,
"object-curly-newline": 0,
},
"overrides": [
{
"files": "test/**",
"rules": {
"camelcase": 0,
},
},
]
}
@@ -0,0 +1,51 @@
{
"name": "@types/babel__core",
"version": "7.20.5",
"description": "TypeScript definitions for @babel/core",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__core",
"license": "MIT",
"contributors": [
{
"name": "Troy Gerwien",
"githubUsername": "yortus",
"url": "https://github.com/yortus"
},
{
"name": "Marvin Hagemeister",
"githubUsername": "marvinhagemeister",
"url": "https://github.com/marvinhagemeister"
},
{
"name": "Melvin Groenhoff",
"githubUsername": "mgroenhoff",
"url": "https://github.com/mgroenhoff"
},
{
"name": "Jessica Franco",
"githubUsername": "Jessidhia",
"url": "https://github.com/Jessidhia"
},
{
"name": "Ifiok Jr.",
"githubUsername": "ifiokjr",
"url": "https://github.com/ifiokjr"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/babel__core"
},
"scripts": {},
"dependencies": {
"@babel/parser": "^7.20.7",
"@babel/types": "^7.20.7",
"@types/babel__generator": "*",
"@types/babel__template": "*",
"@types/babel__traverse": "*"
},
"typesPublisherContentHash": "3ece429b02ff9f70503a5644f2b303b04d10e6da7940c91a9eff5e52f2c76b91",
"typeScriptVersion": "4.5"
}
@@ -0,0 +1,3 @@
declare function isWeakRef<T extends WeakKey>(value: unknown): value is WeakRef<T>;
export = isWeakRef;
@@ -0,0 +1,208 @@
/**
* Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License)
* Copyright (c) 2016, Daniel Imms (MIT License).
* Copyright (c) 2018, Microsoft Corporation (MIT License).
*/
import { Socket } from 'net';
import { Terminal, DEFAULT_COLS, DEFAULT_ROWS } from './terminal';
import { WindowsPtyAgent } from './windowsPtyAgent';
import { IPtyOpenOptions, IWindowsPtyForkOptions } from './interfaces';
import { ArgvOrCommandLine } from './types';
import { assign } from './utils';
const DEFAULT_FILE = 'cmd.exe';
const DEFAULT_NAME = 'Windows Shell';
export class WindowsTerminal extends Terminal {
private _isReady: boolean;
private _deferreds: any[];
private _agent: WindowsPtyAgent;
constructor(file?: string, args?: ArgvOrCommandLine, opt?: IWindowsPtyForkOptions) {
super(opt);
this._checkType('args', args, 'string', true);
// Initialize arguments
args = args || [];
file = file || DEFAULT_FILE;
opt = opt || {};
opt.env = opt.env || process.env;
if (opt.encoding) {
console.warn('Setting encoding on Windows is not supported');
}
const env = assign({}, opt.env);
this._cols = opt.cols || DEFAULT_COLS;
this._rows = opt.rows || DEFAULT_ROWS;
const cwd = opt.cwd || process.cwd();
const name = opt.name || env.TERM || DEFAULT_NAME;
const parsedEnv = this._parseEnv(env);
// If the terminal is ready
this._isReady = false;
// Functions that need to run after `ready` event is emitted.
this._deferreds = [];
// Create new termal.
this._agent = new WindowsPtyAgent(file, args, parsedEnv, cwd, this._cols, this._rows, false, opt.useConpty, opt.useConptyDll, opt.conptyInheritCursor);
this._socket = this._agent.outSocket;
// Not available until `ready` event emitted.
this._pid = this._agent.innerPid;
this._fd = this._agent.fd;
this._pty = this._agent.pty;
// The forked windows terminal is not available until `ready` event is
// emitted.
this._socket.on('ready_datapipe', () => {
// These events needs to be forwarded.
['connect', 'data', 'end', 'timeout', 'drain'].forEach(event => {
this._socket.on(event, () => {
// Wait until the first data event is fired then we can run deferreds.
if (!this._isReady && event === 'data') {
// Terminal is now ready and we can avoid having to defer method
// calls.
this._isReady = true;
// Execute all deferred methods
this._deferreds.forEach(fn => {
// NB! In order to ensure that `this` has all its references
// updated any variable that need to be available in `this` before
// the deferred is run has to be declared above this forEach
// statement.
fn.run();
});
// Reset
this._deferreds = [];
}
});
});
// Shutdown if `error` event is emitted.
this._socket.on('error', err => {
// Close terminal session.
this._close();
// EIO, happens when someone closes our child process: the only process
// in the terminal.
// node < 0.6.14: errno 5
// node >= 0.6.14: read EIO
if ((<any>err).code) {
if (~(<any>err).code.indexOf('errno 5') || ~(<any>err).code.indexOf('EIO')) return;
}
// Throw anything else.
if (this.listeners('error').length < 2) {
throw err;
}
});
// Cleanup after the socket is closed.
this._socket.on('close', () => {
this.emit('exit', this._agent.exitCode);
this._close();
});
});
this._file = file;
this._name = name;
this._readable = true;
this._writable = true;
this._forwardEvents();
}
protected _write(data: string): void {
this._defer(this._doWrite, data);
}
private _doWrite(data: string): void {
this._agent.inSocket.write(data);
}
/**
* openpty
*/
public static open(options?: IPtyOpenOptions): void {
throw new Error('open() not supported on windows, use Fork() instead.');
}
/**
* TTY
*/
public resize(cols: number, rows: number): void {
if (cols <= 0 || rows <= 0 || isNaN(cols) || isNaN(rows) || cols === Infinity || rows === Infinity) {
throw new Error('resizing must be done using positive cols and rows');
}
this._deferNoArgs(() => {
this._agent.resize(cols, rows);
this._cols = cols;
this._rows = rows;
});
}
public clear(): void {
this._deferNoArgs(() => {
this._agent.clear();
});
}
public destroy(): void {
this._deferNoArgs(() => {
this.kill();
});
}
public kill(signal?: string): void {
this._deferNoArgs(() => {
if (signal) {
throw new Error('Signals not supported on windows.');
}
this._close();
this._agent.kill();
});
}
private _deferNoArgs<A>(deferredFn: () => void): void {
// If the terminal is ready, execute.
if (this._isReady) {
deferredFn.call(this);
return;
}
// Queue until terminal is ready.
this._deferreds.push({
run: () => deferredFn.call(this)
});
}
private _defer<A>(deferredFn: (arg: A) => void, arg: A): void {
// If the terminal is ready, execute.
if (this._isReady) {
deferredFn.call(this, arg);
return;
}
// Queue until terminal is ready.
this._deferreds.push({
run: () => deferredFn.call(this, arg)
});
}
public get process(): string { return this._name; }
public get master(): Socket { throw new Error('master is not supported on Windows'); }
public get slave(): Socket { throw new Error('slave is not supported on Windows'); }
}
@@ -0,0 +1,184 @@
import { R as RouteModule, h as LinkDescriptor, L as Location, F as Func, i as Pretty, j as MetaDescriptor, G as GetLoaderData, k as ServerDataFunctionArgs, l as MiddlewareNextFunction, m as ClientDataFunctionArgs, D as DataStrategyResult, n as ServerDataFrom, N as Normalize, o as GetActionData } from '../../router-DIAPGK5f.mjs';
import { R as RouteFiles, P as Pages } from '../../register-_G476ptB.mjs';
import 'react';
type MaybePromise<T> = T | Promise<T>;
type Props = {
params: unknown;
loaderData: unknown;
actionData: unknown;
};
type RouteInfo = Props & {
module: RouteModule;
matches: Array<MatchInfo>;
};
type MatchInfo = {
id: string;
module: RouteModule;
};
type MetaMatch<T extends MatchInfo> = Pretty<{
id: T["id"];
params: Record<string, string | undefined>;
pathname: string;
meta: MetaDescriptor[];
/** @deprecated Use `MetaMatch.loaderData` instead */
data: GetLoaderData<T["module"]>;
loaderData: GetLoaderData<T["module"]>;
handle?: unknown;
error?: unknown;
}>;
type MetaMatches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<MatchInfo> | undefined>;
type HasErrorBoundary<T extends RouteInfo> = T["module"] extends {
ErrorBoundary: Func;
} ? true : false;
type CreateMetaArgs<T extends RouteInfo> = {
/** This is the current router `Location` object. This is useful for generating tags for routes at specific paths or query parameters. */
location: Location;
/** {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route. */
params: T["params"];
/**
* The return value for this route's server loader function
*
* @deprecated Use `Route.MetaArgs.loaderData` instead
*/
data: T["loaderData"] | (HasErrorBoundary<T> extends true ? undefined : never);
/** The return value for this route's server loader function */
loaderData: T["loaderData"] | (HasErrorBoundary<T> extends true ? undefined : never);
/** Thrown errors that trigger error boundaries will be passed to the meta function. This is useful for generating metadata for error pages. */
error?: unknown;
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
matches: MetaMatches<T["matches"]>;
};
type MetaDescriptors = MetaDescriptor[];
type HeadersArgs = {
loaderHeaders: Headers;
parentHeaders: Headers;
actionHeaders: Headers;
errorHeaders: Headers | undefined;
};
type CreateServerMiddlewareFunction<T extends RouteInfo> = (args: ServerDataFunctionArgs<T["params"]>, next: MiddlewareNextFunction<Response>) => MaybePromise<Response | void>;
type CreateClientMiddlewareFunction<T extends RouteInfo> = (args: ClientDataFunctionArgs<T["params"]>, next: MiddlewareNextFunction<Record<string, DataStrategyResult>>) => MaybePromise<Record<string, DataStrategyResult> | void>;
type CreateServerLoaderArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
type CreateClientLoaderArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
/** This is an asynchronous function to get the data from the server loader for this route. On client-side navigations, this will make a {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server loader. If you opt-into running your clientLoader on hydration, then this function will return the data that was already loaded on the server (via Promise.resolve). */
serverLoader: () => Promise<ServerDataFrom<T["module"]["loader"]>>;
};
type CreateServerActionArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
/** This is an asynchronous function that makes the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server action for this route. */
serverAction: () => Promise<ServerDataFrom<T["module"]["action"]>>;
};
type IsServerFirstRoute<T extends RouteInfo, RSCEnabled extends boolean> = RSCEnabled extends true ? T["module"] extends {
ServerComponent: Func;
} ? true : false : false;
type CreateHydrateFallbackProps<T extends RouteInfo, RSCEnabled extends boolean> = {
params: T["params"];
} & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
/** The data returned from the `loader` */
loaderData?: ServerDataFrom<T["module"]["loader"]>;
/** The data returned from the `action` following an action submission. */
actionData?: ServerDataFrom<T["module"]["action"]>;
} : {
/** The data returned from the `loader` or `clientLoader` */
loaderData?: T["loaderData"];
/** The data returned from the `action` or `clientAction` following an action submission. */
actionData?: T["actionData"];
});
type Match<T extends MatchInfo> = Pretty<{
id: T["id"];
params: Record<string, string | undefined>;
pathname: string;
/** @deprecated Use `Match.loaderData` instead */
data: GetLoaderData<T["module"]>;
loaderData: GetLoaderData<T["module"]>;
handle: unknown;
}>;
type Matches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [Match<F>, ...Matches<R>] : Array<Match<MatchInfo> | undefined>;
type CreateComponentProps<T extends RouteInfo, RSCEnabled extends boolean> = {
/**
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
* @example
* // app/routes.ts
* route("teams/:teamId", "./team.tsx"),
*
* // app/team.tsx
* export default function Component({
* params,
* }: Route.ComponentProps) {
* params.teamId;
* // ^ string
* }
**/
params: T["params"];
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
matches: Matches<T["matches"]>;
} & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
/** The data returned from the `loader` */
loaderData: ServerDataFrom<T["module"]["loader"]>;
/** The data returned from the `action` following an action submission. */
actionData?: ServerDataFrom<T["module"]["action"]>;
} : {
/** The data returned from the `loader` or `clientLoader` */
loaderData: T["loaderData"];
/** The data returned from the `action` or `clientAction` following an action submission. */
actionData?: T["actionData"];
});
type CreateErrorBoundaryProps<T extends RouteInfo, RSCEnabled extends boolean> = {
/**
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
* @example
* // app/routes.ts
* route("teams/:teamId", "./team.tsx"),
*
* // app/team.tsx
* export function ErrorBoundary({
* params,
* }: Route.ErrorBoundaryProps) {
* params.teamId;
* // ^ string
* }
**/
params: T["params"];
error: unknown;
} & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
/** The data returned from the `loader` */
loaderData?: ServerDataFrom<T["module"]["loader"]>;
/** The data returned from the `action` following an action submission. */
actionData?: ServerDataFrom<T["module"]["action"]>;
} : {
/** The data returned from the `loader` or `clientLoader` */
loaderData?: T["loaderData"];
/** The data returned from the `action` or `clientAction` following an action submission. */
actionData?: T["actionData"];
});
type GetAnnotations<Info extends RouteInfo, RSCEnabled extends boolean> = {
LinkDescriptors: LinkDescriptor[];
LinksFunction: () => LinkDescriptor[];
MetaArgs: CreateMetaArgs<Info>;
MetaDescriptors: MetaDescriptors;
MetaFunction: (args: CreateMetaArgs<Info>) => MetaDescriptors;
HeadersArgs: HeadersArgs;
HeadersFunction: (args: HeadersArgs) => Headers | HeadersInit;
MiddlewareFunction: CreateServerMiddlewareFunction<Info>;
ClientMiddlewareFunction: CreateClientMiddlewareFunction<Info>;
LoaderArgs: CreateServerLoaderArgs<Info>;
ClientLoaderArgs: CreateClientLoaderArgs<Info>;
ActionArgs: CreateServerActionArgs<Info>;
ClientActionArgs: CreateClientActionArgs<Info>;
HydrateFallbackProps: CreateHydrateFallbackProps<Info, RSCEnabled>;
ComponentProps: CreateComponentProps<Info, RSCEnabled>;
ErrorBoundaryProps: CreateErrorBoundaryProps<Info, RSCEnabled>;
};
type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
type GetInfo<T extends {
file: keyof RouteFiles;
module: RouteModule;
}> = {
params: Params<T["file"]>;
loaderData: GetLoaderData<T["module"]>;
actionData: GetActionData<T["module"]>;
};
export type { GetAnnotations, GetInfo };
@@ -0,0 +1,329 @@
<p align="center">
<a href="http://ecomfe.github.io/fontmin/">
<img height="128" width="128" src="https://raw.githubusercontent.com/ecomfe/fontmin/master/fontmin.png">
</a>
</p>
# fontmin
**Minify font seamlessly**
[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Downloads][downloads-image]][npm-url]
[![Dependencies][dep-image]][dep-url]
[![Font support][font-image]][font-url]
## Homepage
- [简体中文](http://ecomfe.github.io/fontmin/)
- [繁體中文](http://ecomfe.github.io/fontmin/tw)
- [日本語](http://ecomfe.github.io/fontmin/jp)
- [한국어](http://ecomfe.github.io/fontmin/kr)
- [English](http://ecomfe.github.io/fontmin/en)
## Install
```sh
$ npm install --save fontmin
```
## Usage
```js
var Fontmin = require('fontmin');
var fontmin = new Fontmin()
.src('fonts/*.ttf')
.dest('build/fonts');
fontmin.run(function (err, files) {
if (err) {
throw err;
}
console.log(files[0]);
// => { contents: <Buffer 00 01 00 ...> }
});
```
You can use [gulp-rename](https://github.com/hparra/gulp-rename) to rename your files:
```js
var Fontmin = require('fontmin');
var rename = require('gulp-rename');
var fontmin = new Fontmin()
.src('fonts/big.ttf')
.use(rename('small.ttf'));
```
## API
### new Fontmin()
Creates a new `Fontmin` instance.
### .src(file)
Type: `Array|Buffer|String`
Set the files to be optimized. Takes a buffer, glob string or an array of glob strings
as argument.
### .dest(folder)
Type: `String`
Set the destination folder to where your files will be written. If you don't set
any destination no files will be written.
### .use(plugin)
Type: `Function`
Add a `plugin` to the middleware stack.
### .run(cb)
Type: `Function`
Optimize your files with the given settings.
#### cb(err, files, stream)
The callback will return an array of vinyl files in `files` and a Readable/Writable
stream in `stream`
## Plugins
The following plugins are bundled with fontmin:
* [glyph](#glyph) — Compress ttf by glyph.
* [ttf2eot](#ttf2eot) — Convert ttf to eot.
* [ttf2woff](#ttf2woff) — Convert ttf to woff.
* [ttf2woff2](#ttf2woff2) — Convert ttf to woff2.
* [ttf2svg](#ttf2svg) — Convert ttf to svg.
* [css](#css) — Generate css from ttf, often used to make iconfont.
* [svg2ttf](#svg2ttf) — Convert font format svg to ttf.
* [svgs2ttf](#svgs2ttf) — Concat svg files to a ttf, just like css sprite.
* [otf2ttf](#otf2ttf) — Convert otf to ttf.
### .glyph()
Compress ttf by glyph.
```js
var Fontmin = require('fontmin');
var fontmin = new Fontmin()
.use(Fontmin.glyph({
text: '天地玄黄 宇宙洪荒',
hinting: false // keep ttf hint info (fpgm, prep, cvt). default = true
}));
```
### .ttf2eot()
Convert ttf to eot.
```js
var Fontmin = require('fontmin');
var fontmin = new Fontmin()
.use(Fontmin.ttf2eot());
```
### .ttf2woff()
Convert ttf to woff.
```js
var Fontmin = require('fontmin');
var fontmin = new Fontmin()
.use(Fontmin.ttf2woff({
deflate: true // deflate woff. default = false
}));
```
### .ttf2woff2()
Convert ttf to woff2.
```js
var Fontmin = require('fontmin');
var fontmin = new Fontmin()
.use(Fontmin.ttf2woff2());
```
### .ttf2svg()
Convert ttf to svg.
you can use [imagemin-svgo](https://github.com/imagemin/imagemin-svgo) to compress svg:
```js
var Fontmin = require('fontmin');
var svgo = require('imagemin-svgo');
var fontmin = new Fontmin()
.use(Fontmin.ttf2svg())
.use(svgo());
```
### .css()
Generate css from ttf, often used to make iconfont.
```js
var Fontmin = require('fontmin');
var fontmin = new Fontmin()
.use(Fontmin.css({
fontPath: './', // location of font file
base64: true, // inject base64 data:application/x-font-ttf; (gzip font with css).
// default = false
glyph: true, // generate class for each glyph. default = false
iconPrefix: 'my-icon', // class prefix, only work when glyph is `true`. default to "icon"
fontFamily: 'myfont', // custom fontFamily, default to filename or get from analysed ttf file
asFileName: false, // rewrite fontFamily as filename force. default = false
local: true // boolean to add local font. default = false
}));
```
Alternatively, a transform function can be passed as `fontFamily` option.
```js
var Fontmin = require('fontmin');
var fontmin = new Fontmin()
.use(Fontmin.css({
// ...
fontFamily: function(fontInfo, ttf) {
return "Transformed Font Family Name"
},
// ...
}));
```
### .svg2ttf()
Convert font format svg to ttf.
```js
var Fontmin = require('fontmin');
var fontmin = new Fontmin()
.src('font.svg')
.use(Fontmin.svg2ttf());
```
### .svgs2ttf()
Concat svg files to a ttf, just like css sprite.
awesome work with [css](#css) plugin:
```js
var Fontmin = require('fontmin');
var fontmin = new Fontmin()
.src('svgs/*.svg')
.use(Fontmin.svgs2ttf('font.ttf', {fontName: 'iconfont'}))
.use(Fontmin.css({
glyph: true
}));
```
### .otf2ttf()
Convert otf to ttf.
```js
var Fontmin = require('fontmin');
var fontmin = new Fontmin()
.src('fonts/*.otf')
.use(Fontmin.otf2ttf());
```
## CLI
```bash
$ npm install -g fontmin
```
```sh
$ fontmin --help
Usage
$ fontmin <file> [<output>]
$ fontmin <directory> [<output>]
$ fontmin <file> > <output>
$ cat <file> | fontmin > <output>
Example
$ fontmin fonts/* build
$ fontmin fonts build
$ fontmin foo.ttf > foo-optimized.ttf
$ cat foo.ttf | fontmin > foo-optimized.ttf
Options
-t, --text require glyphs by text
-b, --basic-text require glyphs with base chars
-d, --deflate-woff deflate woff
--font-family font-family for @font-face CSS
--css-glyph generate class for each glyf. default = false
-T, --show-time show time fontmin cost
```
you can use `curl` to generate font for websites running on PHP, ASP, Rails and more:
```sh
$ text=`curl www.baidu.com` && fontmin -t "$text" font.ttf
```
or you can use [html-to-text](https://www.npmjs.com/package/html-to-text) to make it smaller:
```sh
$ npm install -g html-to-text
$ text=`curl www.baidu.com | html-to-text` && fontmin -t "$text" font.ttf
```
what is more, you can use [phantom-fetch-cli](https://www.npmjs.com/package/phantom-fetch-cli) to generate font for `SPA` running JS template:
```sh
$ npm install -g phantom-fetch-cli
$ text=`phantom-fetch http://www.chinaw3c.org` && fontmin -t "$text" font.ttf
```
## Related
- [fontmin-app](https://github.com/ecomfe/fontmin-app)
- [gulp-fontmin](https://github.com/ecomfe/gulp-fontmin)
- [fonteditor](https://github.com/ecomfe/fonteditor)
## Thanks
- [imagemin](https://github.com/imagemin/imagemin)
- [free chinese font](http://zenozeng.github.io/Free-Chinese-Fonts/)
- [浙江民间书刻体][font-url]
## License
MIT © [fontmin](https://raw.githubusercontent.com/ecomfe/fontmin/master/LICENSE)
[downloads-image]: http://img.shields.io/npm/dm/fontmin.svg
[npm-url]: https://npmjs.org/package/fontmin
[npm-image]: http://img.shields.io/npm/v/fontmin.svg
[travis-url]: https://travis-ci.org/ecomfe/fontmin
[travis-image]: http://img.shields.io/travis/ecomfe/fontmin.svg
[dep-url]: https://david-dm.org/ecomfe/fontmin
[dep-image]: http://img.shields.io/david/ecomfe/fontmin.svg
[font-image]: https://img.shields.io/badge/font-eonway-blue.svg
[font-url]: http://weibo.com/eonway
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","2":"K D E wC"},B:{"1":"0 1 2 3 4 5 C L M G N O P 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:{"1":"0 1 2 3 4 5 8 9 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC","132":"6 7 J ZB K D E F A B C L M G N O P aB 0C 1C"},D:{"1":"0 1 2 3 4 5 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 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":"J ZB K D E F A B C L M G 3C 4C 5C 6C aC NC OC 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":"2C ZC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 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 d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C FD GD HD ID NC uC JD OC"},G:{"1":"E KD vC LD MD ND OD PD QD RD SD 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":"ZC"},H:{"2":"hD"},I:{"1":"TC J I kD lD vC mD nD","2":"iD jD"},J:{"1":"D A"},K:{"1":"B C H NC uC OC","2":"A"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:6,C:"MP3 audio format",D:true};
@@ -0,0 +1,21 @@
import baseWrapperValue from './_baseWrapperValue.js';
/**
* Executes the chain sequence to resolve the unwrapped value.
*
* @name value
* @memberOf _
* @since 0.1.0
* @alias toJSON, valueOf
* @category Seq
* @returns {*} Returns the resolved unwrapped value.
* @example
*
* _([1, 2, 3]).value();
* // => [1, 2, 3]
*/
function wrapperValue() {
return baseWrapperValue(this.__wrapped__, this.__actions__);
}
export default wrapperValue;
@@ -0,0 +1,222 @@
import * as react from 'react';
import { ReactNode } from 'react';
import * as tailwind_variants from 'tailwind-variants';
import * as _heroui_system from '@heroui/system';
import { PropGetter, HTMLHeroUIProps } from '@heroui/system';
import { ModalVariantProps, SlotsToClasses, ModalSlots } from '@heroui/theme';
import { HTMLMotionProps } from 'framer-motion';
import { AriaModalOverlayProps } from '@react-aria/overlays';
import { ReactRef } from '@heroui/react-utils';
import { OverlayTriggerProps } from '@react-stately/overlays';
interface Props extends HTMLHeroUIProps<"section"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLElement | null>;
/**
* The props to modify the framer motion animation. Use the `variants` API to create your own animation.
*/
motionProps?: HTMLMotionProps<"section">;
/**
* Determines whether to hide the modal close button.
* @default false
*/
hideCloseButton?: boolean;
/**
* Custom modal close button element.
*/
closeButton?: ReactNode;
/**
* Whether the animation should be disabled.
* @default false
*/
disableAnimation?: boolean;
/**
* The container element in which the overlay portal will be placed.
* @default document.body
*/
portalContainer?: Element;
/**
* Whether the scroll should be blocked when the modal is open.
* @default true
*/
shouldBlockScroll?: boolean;
/**
* Callback fired when the modal is closed.
*/
onClose?: () => void;
/**
* Classname or List of classes to change the classNames of the element.
* if `className` is passed, it will be added to the base slot.
*
* @example
* ```ts
* <Modal classNames={{
* wrapper: "wrapper-classes", // main modal wrapper
* backdrop: "backdrop-classes",
* base:"base-classes", // modal content wrapper
* header: "header-classes", // modal header
* body: "body-classes", // modal body
* footer: "footer-classes", // modal footer
* closeButton: "close-button-classes", // modal close button
* }} />
* ```
*/
classNames?: SlotsToClasses<ModalSlots>;
}
type UseModalProps = Props & OverlayTriggerProps & AriaModalOverlayProps & ModalVariantProps;
declare function useModal(originalProps: UseModalProps): {
Component: _heroui_system.As<any>;
slots: {
wrapper: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
base: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
backdrop: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
header: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
body: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
footer: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
closeButton: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
} & {
wrapper: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
base: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
backdrop: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
header: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
body: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
footer: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
closeButton: (slotProps?: ({
backdrop?: "transparent" | "opaque" | "blur" | undefined;
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "full" | undefined;
radius?: "sm" | "md" | "lg" | "none" | undefined;
placement?: "center" | "auto" | "top" | "top-center" | "bottom" | "bottom-center" | undefined;
shadow?: "sm" | "md" | "lg" | "none" | undefined;
scrollBehavior?: "normal" | "inside" | "outside" | undefined;
disableAnimation?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
} & {};
domRef: react.RefObject<HTMLElement>;
headerId: string;
bodyId: string;
motionProps: HTMLMotionProps<"section"> | undefined;
classNames: SlotsToClasses<"base" | "body" | "footer" | "header" | "backdrop" | "wrapper" | "closeButton"> | undefined;
isDismissable: boolean;
closeButton: ReactNode;
hideCloseButton: boolean;
portalContainer: Element | undefined;
shouldBlockScroll: boolean;
backdrop: "transparent" | "opaque" | "blur";
isOpen: boolean;
onClose: () => void;
disableAnimation: boolean;
setBodyMounted: react.Dispatch<react.SetStateAction<boolean>>;
setHeaderMounted: react.Dispatch<react.SetStateAction<boolean>>;
getDialogProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getBackdropProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getCloseButtonProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
};
type UseModalReturn = ReturnType<typeof useModal>;
export { UseModalProps, UseModalReturn, useModal };
@@ -0,0 +1,140 @@
'use strict';
var test = require('tape');
var toPrimitive = require('../es6');
var is = require('object-is');
var forEach = require('for-each');
var functionName = require('function.prototype.name');
var debug = require('object-inspect');
var v = require('es-value-fixtures');
/** @typedef {{ toString?: unknown, valueOf?: unknown, [Symbol.toPrimitive]?: unknown }} Coercible */
test('function properties', function (t) {
t.equal(toPrimitive.length, 1, 'length is 1');
t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive');
t.end();
});
test('primitives', function (t) {
forEach(v.primitives, function (i) {
t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value');
t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value');
t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value');
});
t.end();
});
test('Symbols', { skip: !v.hasSymbols }, function (t) {
forEach(v.symbols, function (sym) {
t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value');
t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value');
t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value');
});
var primitiveSym = Symbol('primitiveSym');
var objectSym = Object(primitiveSym);
t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym));
t.equal(toPrimitive(objectSym, String), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(primitiveSym));
t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym));
t.end();
});
test('Arrays', function (t) {
var arrays = [[], ['a', 'b'], [1, 2]];
forEach(arrays, function (arr) {
t.equal(toPrimitive(arr), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
t.equal(toPrimitive(arr, String), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
t.equal(toPrimitive(arr, Number), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
});
t.end();
});
test('Dates', function (t) {
var dates = [new Date(), new Date(0), new Date(NaN)];
forEach(dates, function (date) {
t.equal(toPrimitive(date), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date');
t.equal(toPrimitive(date, String), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date');
t.ok(is(toPrimitive(date, Number), Number(date)), 'toPrimitive(' + debug(date) + ') returns the number version of the date');
});
t.end();
});
test('Objects', function (t) {
t.equal(toPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf');
t.equal(toPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf');
t.equal(toPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to non-stringified toString');
t.equal(toPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to non-stringified toString');
t.equal(toPrimitive(v.coercibleFnObject, Number), v.coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to non-stringified toString');
t.equal(toPrimitive(v.coercibleFnObject, String), v.coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to non-stringified toString');
t.equal(toPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString');
t.equal(toPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString');
t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString');
t.equal(toPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns non-stringified toString');
t.equal(toPrimitive(v.toStringOnlyObject, Number), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns non-stringified toString');
t.equal(toPrimitive(v.toStringOnlyObject, String), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns non-stringified toString');
t.equal(toPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf');
t.equal(toPrimitive(v.valueOfOnlyObject, Number), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf');
t.equal(toPrimitive(v.valueOfOnlyObject, String), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns non-stringified valueOf');
t.test('Symbol.toPrimitive', { skip: !v.hasSymbols || !Symbol.toPrimitive }, function (st) {
/** @type {Coercible} */
var overriddenObject = { toString: st.fail, valueOf: st.fail };
overriddenObject[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
return String(hint);
};
st.equal(toPrimitive(overriddenObject), 'default', 'object with Symbol.toPrimitive + no hint invokes that');
st.equal(toPrimitive(overriddenObject, Number), 'number', 'object with Symbol.toPrimitive + hint Number invokes that');
st.equal(toPrimitive(overriddenObject, String), 'string', 'object with Symbol.toPrimitive + hint String invokes that');
/** @type {Coercible} */
var nullToPrimitive = { toString: v.coercibleObject.toString, valueOf: v.coercibleObject.valueOf };
nullToPrimitive[Symbol.toPrimitive] = null;
st.equal(toPrimitive(nullToPrimitive), toPrimitive(v.coercibleObject), 'object with no hint + null Symbol.toPrimitive ignores it');
st.equal(toPrimitive(nullToPrimitive, Number), toPrimitive(v.coercibleObject, Number), 'object with hint Number + null Symbol.toPrimitive ignores it');
st.equal(toPrimitive(nullToPrimitive, String), toPrimitive(v.coercibleObject, String), 'object with hint String + null Symbol.toPrimitive ignores it');
st.test('exceptions', function (sst) {
/** @type {Coercible} */
var nonFunctionToPrimitive = { toString: sst.fail, valueOf: sst.fail };
nonFunctionToPrimitive[Symbol.toPrimitive] = {};
sst['throws'](toPrimitive.bind(null, nonFunctionToPrimitive), TypeError, 'Symbol.toPrimitive returning a non-function throws');
/** @type {Coercible} */
var uncoercibleToPrimitive = { toString: sst.fail, valueOf: sst.fail };
uncoercibleToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
return { toString: function () { return hint; } };
};
sst['throws'](toPrimitive.bind(null, uncoercibleToPrimitive), TypeError, 'Symbol.toPrimitive returning an object throws');
/** @type {Coercible} */
var throwingToPrimitive = { toString: sst.fail, valueOf: sst.fail };
throwingToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
throw new RangeError(hint);
};
sst['throws'](toPrimitive.bind(null, throwingToPrimitive), RangeError, 'Symbol.toPrimitive throwing throws');
sst.end();
});
st.end();
});
t.test('exceptions', function (st) {
st['throws'](toPrimitive.bind(null, v.uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError');
st['throws'](toPrimitive.bind(null, v.uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError');
st['throws'](toPrimitive.bind(null, v.uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError');
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError');
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError');
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError');
st.end();
});
t.end();
});
@@ -0,0 +1,100 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var hasSymbols = require('has-symbols')();
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var IteratorPrototype = GetIntrinsic('%IteratorPrototype%', true);
var AdvanceStringIndex = require('./AdvanceStringIndex');
var CreateIterResultObject = require('./CreateIterResultObject');
var CreateMethodProperty = require('./CreateMethodProperty');
var Get = require('./Get');
var OrdinaryObjectCreate = require('./OrdinaryObjectCreate');
var RegExpExec = require('./RegExpExec');
var Set = require('./Set');
var ToLength = require('./ToLength');
var ToString = require('./ToString');
var SLOT = require('internal-slot');
var setToStringTag = require('es-set-tostringtag');
var RegExpStringIterator = function RegExpStringIterator(R, S, global, fullUnicode) {
if (typeof S !== 'string') {
throw new $TypeError('`S` must be a string');
}
if (typeof global !== 'boolean') {
throw new $TypeError('`global` must be a boolean');
}
if (typeof fullUnicode !== 'boolean') {
throw new $TypeError('`fullUnicode` must be a boolean');
}
SLOT.set(this, '[[IteratingRegExp]]', R);
SLOT.set(this, '[[IteratedString]]', S);
SLOT.set(this, '[[Global]]', global);
SLOT.set(this, '[[Unicode]]', fullUnicode);
SLOT.set(this, '[[Done]]', false);
};
if (IteratorPrototype) {
RegExpStringIterator.prototype = OrdinaryObjectCreate(IteratorPrototype);
}
var RegExpStringIteratorNext = function next() {
var O = this; // eslint-disable-line no-invalid-this
if (!isObject(O)) {
throw new $TypeError('receiver must be an object');
}
if (
!(O instanceof RegExpStringIterator)
|| !SLOT.has(O, '[[IteratingRegExp]]')
|| !SLOT.has(O, '[[IteratedString]]')
|| !SLOT.has(O, '[[Global]]')
|| !SLOT.has(O, '[[Unicode]]')
|| !SLOT.has(O, '[[Done]]')
) {
throw new $TypeError('"this" value must be a RegExpStringIterator instance');
}
if (SLOT.get(O, '[[Done]]')) {
return CreateIterResultObject(undefined, true);
}
var R = SLOT.get(O, '[[IteratingRegExp]]');
var S = SLOT.get(O, '[[IteratedString]]');
var global = SLOT.get(O, '[[Global]]');
var fullUnicode = SLOT.get(O, '[[Unicode]]');
var match = RegExpExec(R, S);
if (match === null) {
SLOT.set(O, '[[Done]]', true);
return CreateIterResultObject(undefined, true);
}
if (global) {
var matchStr = ToString(Get(match, '0'));
if (matchStr === '') {
var thisIndex = ToLength(Get(R, 'lastIndex'));
var nextIndex = AdvanceStringIndex(S, thisIndex, fullUnicode);
Set(R, 'lastIndex', nextIndex, true);
}
return CreateIterResultObject(match, false);
}
SLOT.set(O, '[[Done]]', true);
return CreateIterResultObject(match, false);
};
CreateMethodProperty(RegExpStringIterator.prototype, 'next', RegExpStringIteratorNext);
if (hasSymbols) {
setToStringTag(RegExpStringIterator.prototype, 'RegExp String Iterator');
if (Symbol.iterator && typeof RegExpStringIterator.prototype[Symbol.iterator] !== 'function') {
var iteratorFn = function SymbolIterator() {
return this;
};
CreateMethodProperty(RegExpStringIterator.prototype, Symbol.iterator, iteratorFn);
}
}
// https://262.ecma-international.org/11.0/#sec-createregexpstringiterator
module.exports = function CreateRegExpStringIterator(R, S, global, fullUnicode) {
// assert R.global === global && R.unicode === fullUnicode?
return new RegExpStringIterator(R, S, global, fullUnicode);
};
@@ -0,0 +1,75 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = asyncEachOfLimit;
var _breakLoop = require('./breakLoop.js');
var _breakLoop2 = _interopRequireDefault(_breakLoop);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// for async generators
function asyncEachOfLimit(generator, limit, iteratee, callback) {
let done = false;
let canceled = false;
let awaiting = false;
let running = 0;
let idx = 0;
function replenish() {
//console.log('replenish')
if (running >= limit || awaiting || done) return;
//console.log('replenish awaiting')
awaiting = true;
generator.next().then(({ value, done: iterDone }) => {
//console.log('got value', value)
if (canceled || done) return;
awaiting = false;
if (iterDone) {
done = true;
if (running <= 0) {
//console.log('done nextCb')
callback(null);
}
return;
}
running++;
iteratee(value, idx, iterateeCallback);
idx++;
replenish();
}).catch(handleError);
}
function iterateeCallback(err, result) {
//console.log('iterateeCallback')
running -= 1;
if (canceled) return;
if (err) return handleError(err);
if (err === false) {
done = true;
canceled = true;
return;
}
if (result === _breakLoop2.default || done && running <= 0) {
done = true;
//console.log('done iterCb')
return callback(null);
}
replenish();
}
function handleError(err) {
if (canceled) return;
awaiting = false;
done = true;
callback(err);
}
replenish();
}
module.exports = exports.default;
@@ -0,0 +1,4 @@
/** Used to lookup unminified function names. */
var realNames = {};
module.exports = realNames;
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var logRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {
'aria-live': 'polite'
},
relatedConcepts: [],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section']]
};
var _default = exports.default = logRole;
@@ -0,0 +1,189 @@
/**
* @fileoverview enforce a maximum file length
* @author Alberto Rodríguez
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Creates an array of numbers from `start` up to, but not including, `end`
* @param {number} start The start of the range
* @param {number} end The end of the range
* @returns {number[]} The range of numbers
*/
function range(start, end) {
return [...Array(end - start).keys()].map(x => x + start);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Enforce a maximum number of lines per file",
recommended: false,
url: "https://eslint.org/docs/latest/rules/max-lines",
},
schema: [
{
oneOf: [
{
type: "integer",
minimum: 0,
},
{
type: "object",
properties: {
max: {
type: "integer",
minimum: 0,
},
skipComments: {
type: "boolean",
},
skipBlankLines: {
type: "boolean",
},
},
additionalProperties: false,
},
],
},
],
messages: {
exceed: "File has too many lines ({{actual}}). Maximum allowed is {{max}}.",
},
},
create(context) {
const option = context.options[0];
let max = 300;
if (typeof option === "object" && Object.hasOwn(option, "max")) {
max = option.max;
} else if (typeof option === "number") {
max = option;
}
const skipComments = option && option.skipComments;
const skipBlankLines = option && option.skipBlankLines;
const sourceCode = context.sourceCode;
/**
* Returns whether or not a token is a comment node type
* @param {Token} token The token to check
* @returns {boolean} True if the token is a comment node
*/
function isCommentNodeType(token) {
return token && (token.type === "Block" || token.type === "Line");
}
/**
* Returns the line numbers of a comment that don't have any code on the same line
* @param {Node} comment The comment node to check
* @returns {number[]} The line numbers
*/
function getLinesWithoutCode(comment) {
let start = comment.loc.start.line;
let end = comment.loc.end.line;
let token;
token = comment;
do {
token = sourceCode.getTokenBefore(token, {
includeComments: true,
});
} while (isCommentNodeType(token));
if (token && astUtils.isTokenOnSameLine(token, comment)) {
start += 1;
}
token = comment;
do {
token = sourceCode.getTokenAfter(token, {
includeComments: true,
});
} while (isCommentNodeType(token));
if (token && astUtils.isTokenOnSameLine(comment, token)) {
end -= 1;
}
if (start <= end) {
return range(start, end + 1);
}
return [];
}
return {
"Program:exit"() {
let lines = sourceCode.lines.map((text, i) => ({
lineNumber: i + 1,
text,
}));
/*
* If file ends with a linebreak, `sourceCode.lines` will have one extra empty line at the end.
* That isn't a real line, so we shouldn't count it.
*/
if (lines.length > 1 && lines.at(-1).text === "") {
lines.pop();
}
if (skipBlankLines) {
lines = lines.filter(l => l.text.trim() !== "");
}
if (skipComments) {
const comments = sourceCode.getAllComments();
const commentLines = new Set(
comments.flatMap(getLinesWithoutCode),
);
lines = lines.filter(l => !commentLines.has(l.lineNumber));
}
if (lines.length > max) {
const loc = {
start: {
line: lines[max].lineNumber,
column: 0,
},
end: {
line: sourceCode.lines.length,
column: sourceCode.lines.at(-1).length,
},
};
context.report({
loc,
messageId: "exceed",
data: {
max,
actual: lines.length,
},
});
}
},
};
},
};
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","4":"K D E wC"},B:{"1":"0 1 2 3 4 5 C L M G N O P 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:{"1":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC 0C 1C"},D:{"1":"0 1 2 3 4 5 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 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":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 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"},F:{"1":"0 1 2 3 4 5 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 d e f g h i j k l m n o p q r s t u v w x y z FD GD HD ID NC uC JD OC"},G:{"1":"E ZC KD vC LD MD ND OD PD QD RD SD 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"},H:{"1":"hD"},I:{"1":"TC J I iD jD kD lD vC mD nD"},J:{"1":"D A"},K:{"1":"A B C H NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:2,C:"CSS3 Opacity",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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 truncated
@@ -0,0 +1,218 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ColorZoneStore, IColorZone, IColorZoneStore } from 'browser/decorations/ColorZoneStore';
import { ICoreBrowserService, IRenderService } from 'browser/services/Services';
import { Disposable, toDisposable } from 'common/Lifecycle';
import { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';
// Helper objects to avoid excessive calculation and garbage collection during rendering. These are
// static values for each render and can be accessed using the decoration position as the key.
const drawHeight = {
full: 0,
left: 0,
center: 0,
right: 0
};
const drawWidth = {
full: 0,
left: 0,
center: 0,
right: 0
};
const drawX = {
full: 0,
left: 0,
center: 0,
right: 0
};
export class OverviewRulerRenderer extends Disposable {
private readonly _canvas: HTMLCanvasElement;
private readonly _ctx: CanvasRenderingContext2D;
private readonly _colorZoneStore: IColorZoneStore = new ColorZoneStore();
private get _width(): number {
return this._optionsService.options.overviewRulerWidth || 0;
}
private _animationFrame: number | undefined;
private _shouldUpdateDimensions: boolean | undefined = true;
private _shouldUpdateAnchor: boolean | undefined = true;
private _lastKnownBufferLength: number = 0;
private _containerHeight: number | undefined;
constructor(
private readonly _viewportElement: HTMLElement,
private readonly _screenElement: HTMLElement,
@IBufferService private readonly _bufferService: IBufferService,
@IDecorationService private readonly _decorationService: IDecorationService,
@IRenderService private readonly _renderService: IRenderService,
@IOptionsService private readonly _optionsService: IOptionsService,
@ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService
) {
super();
this._canvas = this._coreBrowserService.mainDocument.createElement('canvas');
this._canvas.classList.add('xterm-decoration-overview-ruler');
this._refreshCanvasDimensions();
this._viewportElement.parentElement?.insertBefore(this._canvas, this._viewportElement);
const ctx = this._canvas.getContext('2d');
if (!ctx) {
throw new Error('Ctx cannot be null');
} else {
this._ctx = ctx;
}
this._registerDecorationListeners();
this._registerBufferChangeListeners();
this._registerDimensionChangeListeners();
this.register(toDisposable(() => {
this._canvas?.remove();
}));
}
/**
* On decoration add or remove, redraw
*/
private _registerDecorationListeners(): void {
this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh(undefined, true)));
this.register(this._decorationService.onDecorationRemoved(() => this._queueRefresh(undefined, true)));
}
/**
* On buffer change, redraw
* and hide the canvas if the alt buffer is active
*/
private _registerBufferChangeListeners(): void {
this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh()));
this.register(this._bufferService.buffers.onBufferActivate(() => {
this._canvas!.style.display = this._bufferService.buffer === this._bufferService.buffers.alt ? 'none' : 'block';
}));
this.register(this._bufferService.onScroll(() => {
if (this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length) {
this._refreshDrawHeightConstants();
this._refreshColorZonePadding();
}
}));
}
/**
* On dimension change, update canvas dimensions
* and then redraw
*/
private _registerDimensionChangeListeners(): void {
// container height changed
this.register(this._renderService.onRender((): void => {
if (!this._containerHeight || this._containerHeight !== this._screenElement.clientHeight) {
this._queueRefresh(true);
this._containerHeight = this._screenElement.clientHeight;
}
}));
// overview ruler width changed
this.register(this._optionsService.onSpecificOptionChange('overviewRulerWidth', () => this._queueRefresh(true)));
// device pixel ratio changed
this.register(this._coreBrowserService.onDprChange(() => this._queueRefresh(true)));
// set the canvas dimensions
this._queueRefresh(true);
}
private _refreshDrawConstants(): void {
// width
const outerWidth = Math.floor(this._canvas.width / 3);
const innerWidth = Math.ceil(this._canvas.width / 3);
drawWidth.full = this._canvas.width;
drawWidth.left = outerWidth;
drawWidth.center = innerWidth;
drawWidth.right = outerWidth;
// height
this._refreshDrawHeightConstants();
// x
drawX.full = 0;
drawX.left = 0;
drawX.center = drawWidth.left;
drawX.right = drawWidth.left + drawWidth.center;
}
private _refreshDrawHeightConstants(): void {
drawHeight.full = Math.round(2 * this._coreBrowserService.dpr);
// Calculate actual pixels per line
const pixelsPerLine = this._canvas.height / this._bufferService.buffer.lines.length;
// Clamp actual pixels within a range
const nonFullHeight = Math.round(Math.max(Math.min(pixelsPerLine, 12), 6) * this._coreBrowserService.dpr);
drawHeight.left = nonFullHeight;
drawHeight.center = nonFullHeight;
drawHeight.right = nonFullHeight;
}
private _refreshColorZonePadding(): void {
this._colorZoneStore.setPadding({
full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.full),
left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.left),
center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.center),
right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.right)
});
this._lastKnownBufferLength = this._bufferService.buffers.normal.lines.length;
}
private _refreshCanvasDimensions(): void {
this._canvas.style.width = `${this._width}px`;
this._canvas.width = Math.round(this._width * this._coreBrowserService.dpr);
this._canvas.style.height = `${this._screenElement.clientHeight}px`;
this._canvas.height = Math.round(this._screenElement.clientHeight * this._coreBrowserService.dpr);
this._refreshDrawConstants();
this._refreshColorZonePadding();
}
private _refreshDecorations(): void {
if (this._shouldUpdateDimensions) {
this._refreshCanvasDimensions();
}
this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);
this._colorZoneStore.clear();
for (const decoration of this._decorationService.decorations) {
this._colorZoneStore.addDecoration(decoration);
}
this._ctx.lineWidth = 1;
const zones = this._colorZoneStore.zones;
for (const zone of zones) {
if (zone.position !== 'full') {
this._renderColorZone(zone);
}
}
for (const zone of zones) {
if (zone.position === 'full') {
this._renderColorZone(zone);
}
}
this._shouldUpdateDimensions = false;
this._shouldUpdateAnchor = false;
}
private _renderColorZone(zone: IColorZone): void {
this._ctx.fillStyle = zone.color;
this._ctx.fillRect(
/* x */ drawX[zone.position || 'full'],
/* y */ Math.round(
(this._canvas.height - 1) * // -1 to ensure at least 2px are allowed for decoration on last line
(zone.startBufferLine / this._bufferService.buffers.active.lines.length) - drawHeight[zone.position || 'full'] / 2
),
/* w */ drawWidth[zone.position || 'full'],
/* h */ Math.round(
(this._canvas.height - 1) * // -1 to ensure at least 2px are allowed for decoration on last line
((zone.endBufferLine - zone.startBufferLine) / this._bufferService.buffers.active.lines.length) + drawHeight[zone.position || 'full']
)
);
}
private _queueRefresh(updateCanvasDimensions?: boolean, updateAnchor?: boolean): void {
this._shouldUpdateDimensions = updateCanvasDimensions || this._shouldUpdateDimensions;
this._shouldUpdateAnchor = updateAnchor || this._shouldUpdateAnchor;
if (this._animationFrame !== undefined) {
return;
}
this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
this._refreshDecorations();
this._animationFrame = undefined;
});
}
}
@@ -0,0 +1,331 @@
export type TypedArray =
| Int8Array
| Uint8Array
| Uint8ClampedArray
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Float32Array
| Float64Array
| BigInt64Array
| BigUint64Array;
/**
Check if the given value is an instance of `Uint8Array`.
Replacement for [`Buffer.isBuffer()`](https://nodejs.org/api/buffer.html#static-method-bufferisbufferobj).
@example
```
import {isUint8Array} from 'uint8array-extras';
console.log(isUint8Array(new Uint8Array()));
//=> true
console.log(isUint8Array(Buffer.from('x')));
//=> true
console.log(isUint8Array(new ArrayBuffer(10)));
//=> false
```
*/
export function isUint8Array(value: unknown): value is Uint8Array;
/**
Throw a `TypeError` if the given value is not an instance of `Uint8Array`.
@example
```
import {assertUint8Array} from 'uint8array-extras';
try {
assertUint8Array(new ArrayBuffer(10)); // Throws a TypeError
} catch (error) {
console.error(error.message);
}
```
*/
export function assertUint8Array(value: unknown): asserts value is Uint8Array;
/**
Throw a `TypeError` if the given value is not an instance of `Uint8Array` or `ArrayBuffer`.
Useful as a guard for functions that accept either a `Uint8Array` or `ArrayBuffer`.
@example
```
import {assertUint8ArrayOrArrayBuffer} from 'uint8array-extras';
assertUint8ArrayOrArrayBuffer(new Uint8Array());
assertUint8ArrayOrArrayBuffer(new ArrayBuffer(8));
```
*/
export function assertUint8ArrayOrArrayBuffer(value: unknown): asserts value is Uint8Array | ArrayBuffer;
/**
Convert a value to a `Uint8Array` without copying its data.
This can be useful for converting a `Buffer` to a pure `Uint8Array`. `Buffer` is already a `Uint8Array` subclass, but [`Buffer` alters some behavior](https://sindresorhus.com/blog/goodbye-nodejs-buffer), so it can be useful to cast it to a pure `Uint8Array` before returning it.
Tip: If you want a copy, just call `.slice()` on the return value.
*/
export function toUint8Array(value: TypedArray | ArrayBuffer | DataView): Uint8Array;
/**
Concatenate the given arrays into a new array.
If `arrays` is empty, it will return a zero-sized `Uint8Array`.
If `totalLength` is not specified, it is calculated from summing the lengths of the given arrays.
Replacement for [`Buffer.concat()`](https://nodejs.org/api/buffer.html#static-method-bufferconcatlist-totallength).
@example
```
import {concatUint8Arrays} from 'uint8array-extras';
const a = new Uint8Array([1, 2, 3]);
const b = new Uint8Array([4, 5, 6]);
console.log(concatUint8Arrays([a, b]));
//=> Uint8Array [1, 2, 3, 4, 5, 6]
```
*/
export function concatUint8Arrays(arrays: Uint8Array[], totalLength?: number): Uint8Array<ArrayBuffer>;
/**
Check if two arrays are identical by verifying that they contain the same bytes in the same sequence.
Replacement for [`Buffer#equals()`](https://nodejs.org/api/buffer.html#bufequalsotherbuffer).
@example
```
import {areUint8ArraysEqual} from 'uint8array-extras';
const a = new Uint8Array([1, 2, 3]);
const b = new Uint8Array([1, 2, 3]);
const c = new Uint8Array([4, 5, 6]);
console.log(areUint8ArraysEqual(a, b));
//=> true
console.log(areUint8ArraysEqual(a, c));
//=> false
```
*/
export function areUint8ArraysEqual(a: Uint8Array, b: Uint8Array): boolean;
/**
Compare two arrays and indicate their relative order or equality. Useful for sorting.
Replacement for [`Buffer.compare()`](https://nodejs.org/api/buffer.html#static-method-buffercomparebuf1-buf2).
@example
```
import {compareUint8Arrays} from 'uint8array-extras';
const array1 = new Uint8Array([1, 2, 3]);
const array2 = new Uint8Array([4, 5, 6]);
const array3 = new Uint8Array([7, 8, 9]);
[array3, array1, array2].sort(compareUint8Arrays);
//=> [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
```
*/
export function compareUint8Arrays(a: Uint8Array, b: Uint8Array): 0 | 1 | -1;
/**
Convert a `Uint8Array` to a string.
@param encoding - The [encoding](https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings) to convert from. Default: `'utf8'`
Replacement for [`Buffer#toString()`](https://nodejs.org/api/buffer.html#buftostringencoding-start-end). For the `encoding` parameter, `latin1` should be used instead of `binary` and `utf-16le` instead of `utf16le`.
@example
```
import {uint8ArrayToString} from 'uint8array-extras';
const byteArray = new Uint8Array([72, 101, 108, 108, 111]);
console.log(uint8ArrayToString(byteArray));
//=> 'Hello'
const zh = new Uint8Array([167, 65, 166, 110]);
console.log(uint8ArrayToString(zh, 'big5'));
//=> '你好'
const ja = new Uint8Array([130, 177, 130, 241, 130, 201, 130, 191, 130, 205]);
console.log(uint8ArrayToString(ja, 'shift-jis'));
//=> 'こんにちは'
```
*/
export function uint8ArrayToString(array: Uint8Array | ArrayBuffer, encoding?: string): string;
/**
Convert a string to a `Uint8Array` (using UTF-8 encoding).
Replacement for [`Buffer.from('Hello')`](https://nodejs.org/api/buffer.html#static-method-bufferfromstring-encoding).
@example
```
import {stringToUint8Array} from 'uint8array-extras';
console.log(stringToUint8Array('Hello'));
//=> Uint8Array [72, 101, 108, 108, 111]
```
*/
export function stringToUint8Array(string: string): Uint8Array<ArrayBuffer>;
/**
Convert a `Uint8Array` to a Base64-encoded string.
Specify `{urlSafe: true}` to get a [Base64URL](https://base64.guru/standards/base64url)-encoded string.
Replacement for [`Buffer#toString('base64')`](https://nodejs.org/api/buffer.html#buftostringencoding-start-end).
@example
```
import {uint8ArrayToBase64} from 'uint8array-extras';
const byteArray = new Uint8Array([72, 101, 108, 108, 111]);
console.log(uint8ArrayToBase64(byteArray));
//=> 'SGVsbG8='
```
*/
export function uint8ArrayToBase64(array: Uint8Array, options?: {urlSafe: boolean}): string;
/**
Convert a Base64-encoded or [Base64URL](https://base64.guru/standards/base64url)-encoded string to a `Uint8Array`.
Accepts Base64URL with or without padding.
Replacement for [`Buffer.from('SGVsbG8=', 'base64')`](https://nodejs.org/api/buffer.html#static-method-bufferfromstring-encoding).
@example
```
import {base64ToUint8Array} from 'uint8array-extras';
console.log(base64ToUint8Array('SGVsbG8='));
//=> Uint8Array [72, 101, 108, 108, 111]
```
*/
export function base64ToUint8Array(string: string): Uint8Array<ArrayBuffer>;
/**
Encode a string to a Base64-encoded string.
Specify `{urlSafe: true}` to get a [Base64URL](https://base64.guru/standards/base64url)-encoded string.
Replacement for `Buffer.from('Hello').toString('base64')` and [`btoa()`](https://developer.mozilla.org/en-US/docs/Web/API/btoa).
@example
```
import {stringToBase64} from 'uint8array-extras';
console.log(stringToBase64('Hello'));
//=> 'SGVsbG8='
```
*/
export function stringToBase64(string: string, options?: {urlSafe: boolean}): string;
/**
Decode a Base64-encoded or [Base64URL](https://base64.guru/standards/base64url)-encoded string to a string.
Accepts Base64URL with or without padding.
Replacement for `Buffer.from('SGVsbG8=', 'base64').toString()` and [`atob()`](https://developer.mozilla.org/en-US/docs/Web/API/atob).
@example
```
import {base64ToString} from 'uint8array-extras';
console.log(base64ToString('SGVsbG8='));
//=> 'Hello'
```
*/
export function base64ToString(base64String: string): string;
/**
Convert a `Uint8Array` to a Hex string.
Replacement for [`Buffer#toString('hex')`](https://nodejs.org/api/buffer.html#buftostringencoding-start-end).
@example
```
import {uint8ArrayToHex} from 'uint8array-extras';
const byteArray = new Uint8Array([72, 101, 108, 108, 111]);
console.log(uint8ArrayToHex(byteArray));
//=> '48656c6c6f'
```
*/
export function uint8ArrayToHex(array: Uint8Array): string;
/**
Convert a Hex string to a `Uint8Array`.
Replacement for [`Buffer.from('48656c6c6f', 'hex')`](https://nodejs.org/api/buffer.html#static-method-bufferfromstring-encoding).
@example
```
import {hexToUint8Array} from 'uint8array-extras';
console.log(hexToUint8Array('48656c6c6f'));
//=> Uint8Array [72, 101, 108, 108, 111]
```
*/
export function hexToUint8Array(hexString: string): Uint8Array<ArrayBuffer>;
/**
Read `DataView#byteLength` number of bytes from the given view, up to 48-bit.
Replacement for [`Buffer#readUIntBE`](https://nodejs.org/api/buffer.html#bufreaduintbeoffset-bytelength)
@example
```
import {getUintBE} from 'uint8array-extras';
const byteArray = new Uint8Array([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
console.log(getUintBE(new DataView(byteArray.buffer)));
//=> 20015998341291
```
*/
export function getUintBE(view: DataView): number; // eslint-disable-line @typescript-eslint/naming-convention
/**
Find the index of the first occurrence of the given sequence of bytes (`value`) within the given `Uint8Array` (`array`).
Replacement for [`Buffer#indexOf`](https://nodejs.org/api/buffer.html#bufindexofvalue-byteoffset-encoding). `Uint8Array#indexOf` only takes a number which is different from Buffer's `indexOf` implementation.
@example
```
import {indexOf} from 'uint8array-extras';
const byteArray = new Uint8Array([0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef]);
console.log(indexOf(byteArray, new Uint8Array([0x78, 0x90])));
//=> 3
```
*/
export function indexOf(array: Uint8Array, value: Uint8Array): number;
/**
Checks if the given sequence of bytes (`value`) is within the given `Uint8Array` (`array`).
Returns true if the value is included, otherwise false.
Replacement for [`Buffer#includes`](https://nodejs.org/api/buffer.html#bufincludesvalue-byteoffset-encoding). `Uint8Array#includes` only takes a number which is different from Buffer's `includes` implementation.
```
import {includes} from 'uint8array-extras';
const byteArray = new Uint8Array([0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef]);
console.log(includes(byteArray, new Uint8Array([0x78, 0x90])));
//=> true
```
*/
export function includes(array: Uint8Array, value: Uint8Array): boolean;
@@ -0,0 +1 @@
{"name":"type-fest","version":"1.4.0","requiresBuild":false,"files":{"license":{"checkedAt":1794532119360,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"package.json":{"checkedAt":1794532119360,"integrity":"sha512-SMuAc4hzJ1F7NRP51r5qEKYvU+1r8Te9YK1cFgJLWYxWIv9aWoE4YPFvDlUZupX0ukVg/i3ii/unh7lzcmnk1g==","mode":420,"size":1041},"readme.md":{"checkedAt":1794532119361,"integrity":"sha512-q6TifLHPH8F0OlZWaDJRypydG7/ajhaZJiNML25aGamRyTF2EMM30cnu/jGAI3sxBeS0Ry0UULVUMawiuXAbzw==","mode":420,"size":36484},"source/async-return-type.d.ts":{"checkedAt":1794532119361,"integrity":"sha512-kKlXdeRzkpkMA81fSVFvUU+7VwLdssVzM8qZAGc9EvYw8ziYmdMSXBOwr7w+2KV0sPykMlKXySpP1ocI4cALMg==","mode":420,"size":736},"source/asyncify.d.ts":{"checkedAt":1794532119361,"integrity":"sha512-Z43O76VXJRa/6FQfNsS4D5J9ZuHnbELXSbp1tPWXftPi9Kdoat0Aoa67VMIWDE7RzEyhEe7Ha2LlObbqnbtNyQ==","mode":420,"size":1235},"base.d.ts":{"checkedAt":1794532119361,"integrity":"sha512-loOJWaCZLW7dtpqSH1tXyEaAWMAd51OovJGklpkziE4DqrsHJaoEn4ZsCsbUvP/VqkItrsHr87SToWITyuo5oQ==","mode":420,"size":1884},"source/basic.d.ts":{"checkedAt":1794532119361,"integrity":"sha512-BSIOanT/FuYjqWIHKc/mXTy3plu9T8tvNKtgd1SrECzGyD86jiUwFrebuIWMAbHJnieLGXrFu91BJw8JiuG/gQ==","mode":420,"size":1181},"ts41/camel-case.d.ts":{"checkedAt":1794532119361,"integrity":"sha512-W9CFZ6/3YOgL33Q2eG+h7RD1/8c2/qGRgBfEvdZ+5QIkY2MlmNcYpQjyUmc9LNW5EGoxJj7Z+REf1+eKB1R74A==","mode":420,"size":2036},"ts41/camel-cased-properties-deep.d.ts":{"checkedAt":1794532119361,"integrity":"sha512-sagxQVs68/AdLP3zH46bM2wRwOzt1sB+jhalgIVAaPawFnJCuSbyjQ1uG2RABBUYK9e4kNddr+N1WiRp9+LwsQ==","mode":420,"size":924},"ts41/camel-cased-properties.d.ts":{"checkedAt":1794532119362,"integrity":"sha512-y0fG2tGLDdyTynGN1Mm7U5hyjXbY6WeqXkEbR1IMcjm0Qs240O/NwMWw+NzS3LFoD6GL4Byy2rbrIlzw5QWuEw==","mode":420,"size":598},"source/conditional-except.d.ts":{"checkedAt":1794532119362,"integrity":"sha512-6nbEv/ICQJZxoWwGD/upOVooMez5wUOd3P4LOUn+JXvZ1gqxIutWnRuQ5wGV3anicY1FhLmeTjvkrXsxJF7W0A==","mode":420,"size":1033},"source/conditional-keys.d.ts":{"checkedAt":1794532119362,"integrity":"sha512-Djk+lNEogYQoMwVuIL+zofmt8IG+2yAc5tZTVeS+s0nweolsvGQXb0iGOcZacnEWNbNrj1Jq8xan12z4e32WOQ==","mode":420,"size":1220},"source/conditional-pick.d.ts":{"checkedAt":1794532119362,"integrity":"sha512-shl+CyMwq6p55xGTJZrQxc88jqcJWKczpz5Ads/d8VwtWbqRm0EqNvtV7YcfzNVTIExdLF6eQlb9fC9tYqeJ2w==","mode":420,"size":954},"ts41/delimiter-case.d.ts":{"checkedAt":1794532119362,"integrity":"sha512-R3V3OrKlNp6wuubFzP1/FdAAOC/QVksJ1WHqsLiwc0zGvwr1c8+Se50b/LwM9N8f6Z5WD4n4pdl4b7AljckorQ==","mode":420,"size":2913},"ts41/delimiter-cased-properties-deep.d.ts":{"checkedAt":1794532119362,"integrity":"sha512-EAoYcyTvOtz0KHzEUJE2HL2egpWkhncsZKuXiUOEA1LwfSP8iFRGlgxbarJbwj4h5jO5yGGSpBkCFE3ZXt9MWA==","mode":420,"size":1083},"ts41/delimiter-cased-properties.d.ts":{"checkedAt":1794532119363,"integrity":"sha512-OHmY1rKCRFSGgjRtAK6eohD4VLgrMs4aHiENqyRiTFIbnGKDOcq3vBNTWt9nh/Pcz5Nvgo1EtsXfjL3z4h9fNw==","mode":420,"size":677},"source/entries.d.ts":{"checkedAt":1794532119363,"integrity":"sha512-E6EdnC9Mr1ndtDaekuHn1kVLQnWFYsfsSsbxFbRUP5mrmcwS2Ty/dsUo+3XlQbUBBoeSrBEVHe175GcPNj+AXg==","mode":420,"size":2503},"source/entry.d.ts":{"checkedAt":1794532119367,"integrity":"sha512-V7QTymFx6H4LiWv24ZDyX5jXJ7igZDC9lQlb/FPbFd/7UMUqqVezO/4UUvCzXTcz8IN2RXzZJ6tgKmaSkrZ1Zg==","mode":420,"size":2787},"source/except.d.ts":{"checkedAt":1794532119367,"integrity":"sha512-QHhNpQ376tvB/9I8Uw6+PqXEdiIl6fc8LDXCCqe+fuVa7uktYAOqL8FbPyyM0hZbVR46bFv+D+gOoR75/1PsPA==","mode":420,"size":1015},"source/fixed-length-array.d.ts":{"checkedAt":1794532119367,"integrity":"sha512-9N8ReQm7fQXQG/TBegILSlWPTYEE+RwsQJDgkE7xjYv5fAuGQWF6b18Re1/U9kSDbpG0L78he2TsLiFoZy/Qcw==","mode":420,"size":1501},"ts41/get.d.ts":{"checkedAt":1794532119367,"integrity":"sha512-wEBkUhDf7eX+1ewcSmL4vF2qWka/KsBLjNstg3vYpudAef1RH9zl6OqzgOi5GrisFjUiSO+/22ZCUCqVbcke0w==","mode":420,"size":4359},"ts41/includes.d.ts":{"checkedAt":1794532119368,"integrity":"sha512-8qRcu1CcmTPWuKsDZ8svcTiq8Z82Dzb/dJ0/p+4xUhxKdqOVEaBvaUgq3Zvt5xYMICpuA3JigIrMxGPumYP9pQ==","mode":420,"size":761},"index.d.ts":{"checkedAt":1794532119368,"integrity":"sha512-frtzzk3sODwR4guOYY+is02YYHfRNqVLFx9iNo/zoGYc1JtAa6siXnz44j7733OMF7MYmxwE6Gtj3/O1G8HREQ==","mode":420,"size":115},"ts41/index.d.ts":{"checkedAt":1794532119368,"integrity":"sha512-WnDWiAsPME/sNftkgq90IpaSZQsXoYg5GBabLYOrZLQfzb07l1zgnbDJinUoDxvSfnMMJ4hbj/Cbi8NneD2iTg==","mode":420,"size":1325},"source/iterable-element.d.ts":{"checkedAt":1794532119368,"integrity":"sha512-uSjSDgTpPED5xIs7TdnWOzZnd1aeZBHUqI01eDnHLvisWLZM9TDv8ZI507YnWTtgbj5RXlIzZmRk5V6FJRoO5A==","mode":420,"size":1303},"ts41/kebab-case.d.ts":{"checkedAt":1794532119368,"integrity":"sha512-VcQa4HNAWPfEXo4tervbruQG42PYzfmiX9NU5tnCdX+uHgRTyIZKWYso+YiF5LaEC76WKJYWZIDWk0iOPEBPzQ==","mode":420,"size":724},"ts41/kebab-cased-properties-deep.d.ts":{"checkedAt":1794532119368,"integrity":"sha512-ZOils3T/odYdYs2hn/FLine truncated
@@ -0,0 +1,17 @@
module.exports = function (pkg) {
var m;
if (m = match(JSON.stringify(pkg.repository))) {
return m;
}
else if (m = match(JSON.stringify(pkg))) {
return m;
}
return undefined;
};
function match (str) {
var m = /\bgithub.com[:\/]([^\/"]+)\/([^\/"]+)/.exec(str);
if (m) {
return 'https://github.com/' + m[1] + '/' + m[2].replace(/\.git$/, '');
}
}
@@ -0,0 +1,62 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {ToggleStateOptions} from '@react-types/checkbox';
import {useControlledState} from '@react-stately/utils';
import {useState} from 'react';
export type {ToggleStateOptions};
export interface ToggleState {
/** Whether the toggle is selected. */
readonly isSelected: boolean,
/** Whether the toggle is selected by default. */
readonly defaultSelected: boolean,
/** Updates selection state. */
setSelected(isSelected: boolean): void,
/** Toggle the selection state. */
toggle(): void
}
/**
* Provides state management for toggle components like checkboxes and switches.
*/
export function useToggleState(props: ToggleStateOptions = {}): ToggleState {
let {isReadOnly} = props;
// have to provide an empty function so useControlledState doesn't throw a fit
// can't use useControlledState's prop calling because we need the event object from the change
let [isSelected, setSelected] = useControlledState(props.isSelected, props.defaultSelected || false, props.onChange);
let [initialValue] = useState(isSelected);
function updateSelected(value) {
if (!isReadOnly) {
setSelected(value);
}
}
function toggleState() {
if (!isReadOnly) {
setSelected(!isSelected);
}
}
return {
isSelected,
defaultSelected: props.defaultSelected ?? initialValue,
setSelected: updateSelected,
toggle: toggleState
};
}
@@ -0,0 +1,108 @@
"use client";
import {
breadcrumb_item_default
} from "./chunk-W2E7RG4O.mjs";
// src/use-breadcrumbs.ts
import { Children } from "react";
import { mapPropsVariants, useProviderContext } from "@heroui/system";
import { breadcrumbs } from "@heroui/theme";
import { filterDOMProps, pickChildren, useDOMRef } from "@heroui/react-utils";
import { mergeProps } from "@react-aria/utils";
import { useBreadcrumbs as useAriaBreadcrumbs } from "@react-aria/breadcrumbs";
import { useMemo } from "react";
import { clsx, dataAttr, objectToDeps } from "@heroui/shared-utils";
function useBreadcrumbs(originalProps) {
var _a, _b;
const globalContext = useProviderContext();
const disableAnimation = (_b = (_a = originalProps == null ? void 0 : originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const [props, variantProps] = mapPropsVariants(originalProps, breadcrumbs.variantKeys);
const {
ref,
as,
color,
underline,
isDisabled,
separator,
children: childrenProp,
itemsBeforeCollapse = 1,
itemsAfterCollapse = 2,
maxItems = 8,
hideSeparator,
renderEllipsis,
className,
classNames,
itemClasses,
onAction,
...otherProps
} = props;
const Component = as || "nav";
const shouldFilterDOMProps = typeof Component === "string";
const { navProps } = useAriaBreadcrumbs(originalProps);
const [, children] = pickChildren(childrenProp, breadcrumb_item_default);
const childCount = Children.count(children);
const domRef = useDOMRef(ref);
const slots = useMemo(
() => breadcrumbs({
...variantProps,
className
}),
[objectToDeps(variantProps), className]
);
const baseStyles = clsx(classNames == null ? void 0 : classNames.base, className);
const itemProps = {
color,
underline,
disableAnimation,
hideSeparator,
size: originalProps == null ? void 0 : originalProps.size,
classNames: itemClasses
};
const getBaseProps = () => ({
ref: domRef,
"data-slot": "base",
className: slots.base({ class: baseStyles }),
...mergeProps(
navProps,
filterDOMProps(otherProps, {
enabled: shouldFilterDOMProps
})
)
});
const getListProps = () => ({
"data-slot": "list",
className: slots.list({ class: classNames == null ? void 0 : classNames.list })
});
const getEllipsisProps = () => ({
"data-slot": "ellipsis",
className: slots.ellipsis({ class: classNames == null ? void 0 : classNames.ellipsis })
});
const getSeparatorProps = () => ({
"data-slot": "separator",
"aria-hidden": dataAttr(true),
className: slots.separator({ class: classNames == null ? void 0 : classNames.separator })
});
return {
Component,
children,
slots,
separator,
childCount,
itemsAfterCollapse,
itemsBeforeCollapse,
maxItems,
classNames,
isDisabled,
itemProps,
renderEllipsis,
getBaseProps,
getListProps,
getEllipsisProps,
getSeparatorProps,
onAction
};
}
export {
useBreadcrumbs
};
@@ -0,0 +1,3 @@
<svg viewBox="0 0 18 18">
<path class="ql-fill" d="M6,9.5A1.5,1.5,0,1,1,4.5,8,1.5,1.5,0,0,1,6,9.5ZM9.5,8A1.5,1.5,0,1,0,11,9.5,1.5,1.5,0,0,0,9.5,8Zm5,0A1.5,1.5,0,1,0,16,9.5,1.5,1.5,0,0,0,14.5,8Z"/>
</svg>

After

Width:  |  Height:  |  Size: 205 B

@@ -0,0 +1,85 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{## def._validateRef:_v:
{{? it.opts.passContext }}
{{=_v}}.call(this,
{{??}}
{{=_v}}(
{{?}}
{{=$data}}, {{# def.dataPath }}{{# def.passParentData }}, rootData)
#}}
{{ var $async, $refCode; }}
{{? $schema == '#' || $schema == '#/' }}
{{
if (it.isRoot) {
$async = it.async;
$refCode = 'validate';
} else {
$async = it.root.schema.$async === true;
$refCode = 'root.refVal[0]';
}
}}
{{??}}
{{ var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); }}
{{? $refVal === undefined }}
{{ var $message = it.MissingRefError.message(it.baseId, $schema); }}
{{? it.opts.missingRefs == 'fail' }}
{{ it.logger.error($message); }}
{{# def.error:'$ref' }}
{{? $breakOnError }} if (false) { {{?}}
{{?? it.opts.missingRefs == 'ignore' }}
{{ it.logger.warn($message); }}
{{? $breakOnError }} if (true) { {{?}}
{{??}}
{{ throw new it.MissingRefError(it.baseId, $schema, $message); }}
{{?}}
{{?? $refVal.inline }}
{{# def.setupNextLevel }}
{{
$it.schema = $refVal.schema;
$it.schemaPath = '';
$it.errSchemaPath = $schema;
}}
{{ var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); }}
{{= $code }}
{{? $breakOnError}}
if ({{=$nextValid}}) {
{{?}}
{{??}}
{{
$async = $refVal.$async === true || (it.async && $refVal.$async !== false);
$refCode = $refVal.code;
}}
{{?}}
{{?}}
{{? $refCode }}
{{# def.beginDefOut}}
{{# def._validateRef:$refCode }}
{{# def.storeDefOut:__callValidate }}
{{? $async }}
{{ if (!it.async) throw new Error('async schema referenced by sync schema'); }}
{{? $breakOnError }} var {{=$valid}}; {{?}}
try {
await {{=__callValidate}};
{{? $breakOnError }} {{=$valid}} = true; {{?}}
} catch (e) {
if (!(e instanceof ValidationError)) throw e;
if (vErrors === null) vErrors = e.errors;
else vErrors = vErrors.concat(e.errors);
errors = vErrors.length;
{{? $breakOnError }} {{=$valid}} = false; {{?}}
}
{{? $breakOnError }} if ({{=$valid}}) { {{?}}
{{??}}
if (!{{=__callValidate}}) {
if (vErrors === null) vErrors = {{=$refCode}}.errors;
else vErrors = vErrors.concat({{=$refCode}}.errors);
errors = vErrors.length;
} {{? $breakOnError }} else { {{?}}
{{?}}
{{?}}
@@ -0,0 +1,261 @@
const util = require('./util')
module.exports = function stringify (value, replacer, space) {
const stack = []
let indent = ''
let propertyList
let replacerFunc
let gap = ''
let quote
if (
replacer != null &&
typeof replacer === 'object' &&
!Array.isArray(replacer)
) {
space = replacer.space
quote = replacer.quote
replacer = replacer.replacer
}
if (typeof replacer === 'function') {
replacerFunc = replacer
} else if (Array.isArray(replacer)) {
propertyList = []
for (const v of replacer) {
let item
if (typeof v === 'string') {
item = v
} else if (
typeof v === 'number' ||
v instanceof String ||
v instanceof Number
) {
item = String(v)
}
if (item !== undefined && propertyList.indexOf(item) < 0) {
propertyList.push(item)
}
}
}
if (space instanceof Number) {
space = Number(space)
} else if (space instanceof String) {
space = String(space)
}
if (typeof space === 'number') {
if (space > 0) {
space = Math.min(10, Math.floor(space))
gap = ' '.substr(0, space)
}
} else if (typeof space === 'string') {
gap = space.substr(0, 10)
}
return serializeProperty('', {'': value})
function serializeProperty (key, holder) {
let value = holder[key]
if (value != null) {
if (typeof value.toJSON5 === 'function') {
value = value.toJSON5(key)
} else if (typeof value.toJSON === 'function') {
value = value.toJSON(key)
}
}
if (replacerFunc) {
value = replacerFunc.call(holder, key, value)
}
if (value instanceof Number) {
value = Number(value)
} else if (value instanceof String) {
value = String(value)
} else if (value instanceof Boolean) {
value = value.valueOf()
}
switch (value) {
case null: return 'null'
case true: return 'true'
case false: return 'false'
}
if (typeof value === 'string') {
return quoteString(value, false)
}
if (typeof value === 'number') {
return String(value)
}
if (typeof value === 'object') {
return Array.isArray(value) ? serializeArray(value) : serializeObject(value)
}
return undefined
}
function quoteString (value) {
const quotes = {
"'": 0.1,
'"': 0.2,
}
const replacements = {
"'": "\\'",
'"': '\\"',
'\\': '\\\\',
'\b': '\\b',
'\f': '\\f',
'\n': '\\n',
'\r': '\\r',
'\t': '\\t',
'\v': '\\v',
'\0': '\\0',
'\u2028': '\\u2028',
'\u2029': '\\u2029',
}
let product = ''
for (let i = 0; i < value.length; i++) {
const c = value[i]
switch (c) {
case "'":
case '"':
quotes[c]++
product += c
continue
case '\0':
if (util.isDigit(value[i + 1])) {
product += '\\x00'
continue
}
}
if (replacements[c]) {
product += replacements[c]
continue
}
if (c < ' ') {
let hexString = c.charCodeAt(0).toString(16)
product += '\\x' + ('00' + hexString).substring(hexString.length)
continue
}
product += c
}
const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b)
product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar])
return quoteChar + product + quoteChar
}
function serializeObject (value) {
if (stack.indexOf(value) >= 0) {
throw TypeError('Converting circular structure to JSON5')
}
stack.push(value)
let stepback = indent
indent = indent + gap
let keys = propertyList || Object.keys(value)
let partial = []
for (const key of keys) {
const propertyString = serializeProperty(key, value)
if (propertyString !== undefined) {
let member = serializeKey(key) + ':'
if (gap !== '') {
member += ' '
}
member += propertyString
partial.push(member)
}
}
let final
if (partial.length === 0) {
final = '{}'
} else {
let properties
if (gap === '') {
properties = partial.join(',')
final = '{' + properties + '}'
} else {
let separator = ',\n' + indent
properties = partial.join(separator)
final = '{\n' + indent + properties + ',\n' + stepback + '}'
}
}
stack.pop()
indent = stepback
return final
}
function serializeKey (key) {
if (key.length === 0) {
return quoteString(key, true)
}
const firstChar = String.fromCodePoint(key.codePointAt(0))
if (!util.isIdStartChar(firstChar)) {
return quoteString(key, true)
}
for (let i = firstChar.length; i < key.length; i++) {
if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
return quoteString(key, true)
}
}
return key
}
function serializeArray (value) {
if (stack.indexOf(value) >= 0) {
throw TypeError('Converting circular structure to JSON5')
}
stack.push(value)
let stepback = indent
indent = indent + gap
let partial = []
for (let i = 0; i < value.length; i++) {
const propertyString = serializeProperty(String(i), value)
partial.push((propertyString !== undefined) ? propertyString : 'null')
}
let final
if (partial.length === 0) {
final = '[]'
} else {
if (gap === '') {
let properties = partial.join(',')
final = '[' + properties + ']'
} else {
let separator = ',\n' + indent
let properties = partial.join(separator)
final = '[\n' + indent + properties + ',\n' + stepback + ']'
}
}
stack.pop()
indent = stepback
return final
}
}
@@ -0,0 +1,19 @@
"use strict";
var FreshestCRL_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FreshestCRL = exports.id_ce_freshestCRL = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const object_identifiers_1 = require("../object_identifiers");
const crl_distribution_points_1 = require("./crl_distribution_points");
exports.id_ce_freshestCRL = `${object_identifiers_1.id_ce}.46`;
let FreshestCRL = FreshestCRL_1 = class FreshestCRL extends crl_distribution_points_1.CRLDistributionPoints {
constructor(items) {
super(items);
Object.setPrototypeOf(this, FreshestCRL_1.prototype);
}
};
exports.FreshestCRL = FreshestCRL;
exports.FreshestCRL = FreshestCRL = FreshestCRL_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: crl_distribution_points_1.DistributionPoint })
], FreshestCRL);
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/focus/src/index.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\nexport {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope} from './FocusScope';\nexport {FocusRing} from './FocusRing';\nexport {useFocusRing} from './useFocusRing';\nexport {useHasTabbableChild} from './useHasTabbableChild';\nexport {moveVirtualFocus, dispatchVirtualBlur, dispatchVirtualFocus, getVirtuallyFocusedElement} from './virtualFocus';\n// For backward compatibility.\nexport {isFocusable} from '@react-aria/utils';\nexport {FocusableProvider, Focusable, useFocusable, focusSafely} from '@react-aria/interactions';\n\nexport type {FocusScopeProps, FocusManager, FocusManagerOptions} from './FocusScope';\nexport type {FocusRingProps} from './FocusRing';\nexport type {FocusableAria, FocusableOptions, FocusableProviderProps} from '@react-aria/interactions';\nexport type {AriaFocusRingProps, FocusRingAria} from './useFocusRing';\n"],"names":[],"version":3,"file":"main.js.map"}
@@ -0,0 +1,32 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $pow = require('math-intrinsics/pow');
var $Number = GetIntrinsic('%Number%');
var $BigInt = GetIntrinsic('%BigInt%', true);
module.exports = function bytesAsInteger(rawBytes, elementSize, isUnsigned, isBigInt) {
var Z = isBigInt ? $BigInt : $Number;
// this is common to both branches
var intValue = Z(0);
for (var i = 0; i < rawBytes.length; i++) {
intValue += Z(rawBytes[i] * $pow(2, 8 * i));
}
/*
Let intValue be the byte elements of rawBytes concatenated and interpreted as a bit string encoding of an unsigned little-endian binary number.
*/
if (!isUnsigned) { // steps 5-6
// Let intValue be the byte elements of rawBytes concatenated and interpreted as a bit string encoding of a binary little-endian 2's complement number of bit length elementSize × 8.
var bitLength = elementSize * 8;
if (rawBytes[elementSize - 1] & 0x80) {
intValue -= Z($pow(2, bitLength));
}
}
return intValue; // step 7
};
@@ -0,0 +1 @@
{"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../../src/config/flat/warnings.ts"],"names":[],"mappings":"AAGA,eAAe;IACb,KAAK,EAAE;QACL,8BAA8B,EAAE,CAAC;QACjC,qCAAqC,EAAE,CAAC;QACxC,4BAA4B,EAAE,CAAC;QAC/B,wBAAwB,EAAE,CAAC;KAC5B;CAC6B,CAAA"}
@@ -0,0 +1,15 @@
"use client";
import {
LinkIcon
} from "./chunk-7LH7ZARU.mjs";
import {
link_default
} from "./chunk-OPTZHMJX.mjs";
import {
useLink
} from "./chunk-3GGKNGCF.mjs";
export {
link_default as Link,
LinkIcon,
useLink
};
@@ -0,0 +1,89 @@
declare type StringifyOptions = {
/**
* A function that alters the behavior of the stringification process, or an
* array of String and Number objects that serve as a allowlist for
* selecting/filtering the properties of the value object to be included in
* the JSON5 string. If this value is null or not provided, all properties
* of the object are included in the resulting JSON5 string.
*/
replacer?:
| ((this: any, key: string, value: any) => any)
| (string | number)[]
| null
/**
* A String or Number object that's used to insert white space into the
* output JSON5 string for readability purposes. If this is a Number, it
* indicates the number of space characters to use as white space; this
* number is capped at 10 (if it is greater, the value is just 10). Values
* less than 1 indicate that no space should be used. If this is a String,
* the string (or the first 10 characters of the string, if it's longer than
* that) is used as white space. If this parameter is not provided (or is
* null), no white space is used. If white space is used, trailing commas
* will be used in objects and arrays.
*/
space?: string | number | null
/**
* A String representing the quote character to use when serializing
* strings.
*/
quote?: string | null
}
/**
* Converts a JavaScript value to a JSON5 string.
* @param value The value to convert to a JSON5 string.
* @param replacer A function that alters the behavior of the stringification
* process. If this value is null or not provided, all properties of the object
* are included in the resulting JSON5 string.
* @param space A String or Number object that's used to insert white space into
* the output JSON5 string for readability purposes. If this is a Number, it
* indicates the number of space characters to use as white space; this number
* is capped at 10 (if it is greater, the value is just 10). Values less than 1
* indicate that no space should be used. If this is a String, the string (or
* the first 10 characters of the string, if it's longer than that) is used as
* white space. If this parameter is not provided (or is null), no white space
* is used. If white space is used, trailing commas will be used in objects and
* arrays.
* @returns The JSON5 string converted from the JavaScript value.
*/
declare function stringify(
value: any,
replacer?: ((this: any, key: string, value: any) => any) | null,
space?: string | number | null,
): string
/**
* Converts a JavaScript value to a JSON5 string.
* @param value The value to convert to a JSON5 string.
* @param replacer An array of String and Number objects that serve as a
* allowlist for selecting/filtering the properties of the value object to be
* included in the JSON5 string. If this value is null or not provided, all
* properties of the object are included in the resulting JSON5 string.
* @param space A String or Number object that's used to insert white space into
* the output JSON5 string for readability purposes. If this is a Number, it
* indicates the number of space characters to use as white space; this number
* is capped at 10 (if it is greater, the value is just 10). Values less than 1
* indicate that no space should be used. If this is a String, the string (or
* the first 10 characters of the string, if it's longer than that) is used as
* white space. If this parameter is not provided (or is null), no white space
* is used. If white space is used, trailing commas will be used in objects and
* arrays.
* @returns The JSON5 string converted from the JavaScript value.
*/
declare function stringify(
value: any,
replacer: (string | number)[],
space?: string | number | null,
): string
/**
* Converts a JavaScript value to a JSON5 string.
* @param value The value to convert to a JSON5 string.
* @param options An object specifying options.
* @returns The JSON5 string converted from the JavaScript value.
*/
declare function stringify(value: any, options: StringifyOptions): string
export = stringify
@@ -0,0 +1,29 @@
var baseGetTag = require('./_baseGetTag'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var boolTag = '[object Boolean]';
/**
* Checks if `value` is classified as a boolean primitive or object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
* @example
*
* _.isBoolean(false);
* // => true
*
* _.isBoolean(null);
* // => false
*/
function isBoolean(value) {
return value === true || value === false ||
(isObjectLike(value) && baseGetTag(value) == boolTag);
}
module.exports = isBoolean;
@@ -0,0 +1,11 @@
import {
clamp,
clampPercentage,
range
} from "./chunk-MNNRULGA.mjs";
import "./chunk-UYSIEMEK.mjs";
export {
clamp,
clampPercentage,
range
};
@@ -0,0 +1,34 @@
import $fkdHx$intlStringsmodulejs from "./intlStrings.mjs";
import {useId as $fkdHx$useId} from "@react-aria/utils";
import {useLocalizedStringFormatter as $fkdHx$useLocalizedStringFormatter} from "@react-aria/i18n";
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $7cb39d07f245a780$export$70e2eed1a92976ad(props, state) {
let { key: key } = props;
let manager = state.selectionManager;
let checkboxId = (0, $fkdHx$useId)();
let isDisabled = !state.selectionManager.canSelectItem(key);
let isSelected = state.selectionManager.isSelected(key);
// Checkbox should always toggle selection, regardless of selectionBehavior.
let onChange = ()=>manager.toggleSelection(key);
const stringFormatter = (0, $fkdHx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($fkdHx$intlStringsmodulejs))), '@react-aria/grid');
return {
checkboxProps: {
id: checkboxId,
'aria-label': stringFormatter.format('select'),
isSelected: isSelected,
isDisabled: isDisabled,
onChange: onChange
}
};
}
export {$7cb39d07f245a780$export$70e2eed1a92976ad as useGridSelectionCheckbox};
//# sourceMappingURL=useGridSelectionCheckbox.module.js.map
@@ -0,0 +1,264 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Convert = Convert;
const index_1 = require("../clone/index");
const index_2 = require("../check/index");
const index_3 = require("../deref/index");
const index_4 = require("../../type/symbols/index");
// ------------------------------------------------------------------
// ValueGuard
// ------------------------------------------------------------------
const index_5 = require("../guard/index");
// ------------------------------------------------------------------
// Conversions
// ------------------------------------------------------------------
function IsStringNumeric(value) {
return (0, index_5.IsString)(value) && !isNaN(value) && !isNaN(parseFloat(value));
}
function IsValueToString(value) {
return (0, index_5.IsBigInt)(value) || (0, index_5.IsBoolean)(value) || (0, index_5.IsNumber)(value);
}
function IsValueTrue(value) {
return value === true || ((0, index_5.IsNumber)(value) && value === 1) || ((0, index_5.IsBigInt)(value) && value === BigInt('1')) || ((0, index_5.IsString)(value) && (value.toLowerCase() === 'true' || value === '1'));
}
function IsValueFalse(value) {
return value === false || ((0, index_5.IsNumber)(value) && (value === 0 || Object.is(value, -0))) || ((0, index_5.IsBigInt)(value) && value === BigInt('0')) || ((0, index_5.IsString)(value) && (value.toLowerCase() === 'false' || value === '0' || value === '-0'));
}
function IsTimeStringWithTimeZone(value) {
return (0, index_5.IsString)(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value);
}
function IsTimeStringWithoutTimeZone(value) {
return (0, index_5.IsString)(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value);
}
function IsDateTimeStringWithTimeZone(value) {
return (0, index_5.IsString)(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value);
}
function IsDateTimeStringWithoutTimeZone(value) {
return (0, index_5.IsString)(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value);
}
function IsDateString(value) {
return (0, index_5.IsString)(value) && /^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(value);
}
// ------------------------------------------------------------------
// Convert
// ------------------------------------------------------------------
function TryConvertLiteralString(value, target) {
const conversion = TryConvertString(value);
return conversion === target ? conversion : value;
}
function TryConvertLiteralNumber(value, target) {
const conversion = TryConvertNumber(value);
return conversion === target ? conversion : value;
}
function TryConvertLiteralBoolean(value, target) {
const conversion = TryConvertBoolean(value);
return conversion === target ? conversion : value;
}
// prettier-ignore
function TryConvertLiteral(schema, value) {
return ((0, index_5.IsString)(schema.const) ? TryConvertLiteralString(value, schema.const) :
(0, index_5.IsNumber)(schema.const) ? TryConvertLiteralNumber(value, schema.const) :
(0, index_5.IsBoolean)(schema.const) ? TryConvertLiteralBoolean(value, schema.const) :
value);
}
function TryConvertBoolean(value) {
return IsValueTrue(value) ? true : IsValueFalse(value) ? false : value;
}
function TryConvertBigInt(value) {
const truncateInteger = (value) => value.split('.')[0];
return IsStringNumeric(value) ? BigInt(truncateInteger(value)) : (0, index_5.IsNumber)(value) ? BigInt(Math.trunc(value)) : IsValueFalse(value) ? BigInt(0) : IsValueTrue(value) ? BigInt(1) : value;
}
function TryConvertString(value) {
return (0, index_5.IsSymbol)(value) && value.description !== undefined ? value.description.toString() : IsValueToString(value) ? value.toString() : value;
}
function TryConvertNumber(value) {
return IsStringNumeric(value) ? parseFloat(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value;
}
function TryConvertInteger(value) {
return IsStringNumeric(value) ? parseInt(value) : (0, index_5.IsNumber)(value) ? Math.trunc(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value;
}
function TryConvertNull(value) {
return (0, index_5.IsString)(value) && value.toLowerCase() === 'null' ? null : value;
}
function TryConvertUndefined(value) {
return (0, index_5.IsString)(value) && value === 'undefined' ? undefined : value;
}
// ------------------------------------------------------------------
// note: this function may return an invalid dates for the regex
// tests above. Invalid dates will however be checked during the
// casting function and will return a epoch date if invalid.
// Consider better string parsing for the iso dates in future
// revisions.
// ------------------------------------------------------------------
// prettier-ignore
function TryConvertDate(value) {
return ((0, index_5.IsDate)(value) ? value :
(0, index_5.IsNumber)(value) ? new Date(value) :
IsValueTrue(value) ? new Date(1) :
IsValueFalse(value) ? new Date(0) :
IsStringNumeric(value) ? new Date(parseInt(value)) :
IsTimeStringWithoutTimeZone(value) ? new Date(`1970-01-01T${value}.000Z`) :
IsTimeStringWithTimeZone(value) ? new Date(`1970-01-01T${value}`) :
IsDateTimeStringWithoutTimeZone(value) ? new Date(`${value}.000Z`) :
IsDateTimeStringWithTimeZone(value) ? new Date(value) :
IsDateString(value) ? new Date(`${value}T00:00:00.000Z`) :
value);
}
// ------------------------------------------------------------------
// Default
// ------------------------------------------------------------------
function Default(value) {
return value;
}
// ------------------------------------------------------------------
// Convert
// ------------------------------------------------------------------
function FromArray(schema, references, value) {
const elements = (0, index_5.IsArray)(value) ? value : [value];
return elements.map((element) => Visit(schema.items, references, element));
}
function FromBigInt(schema, references, value) {
return TryConvertBigInt(value);
}
function FromBoolean(schema, references, value) {
return TryConvertBoolean(value);
}
function FromDate(schema, references, value) {
return TryConvertDate(value);
}
function FromImport(schema, references, value) {
const definitions = globalThis.Object.values(schema.$defs);
const target = schema.$defs[schema.$ref];
return Visit(target, [...references, ...definitions], value);
}
function FromInteger(schema, references, value) {
return TryConvertInteger(value);
}
function FromIntersect(schema, references, value) {
return schema.allOf.reduce((value, schema) => Visit(schema, references, value), value);
}
function FromLiteral(schema, references, value) {
return TryConvertLiteral(schema, value);
}
function FromNull(schema, references, value) {
return TryConvertNull(value);
}
function FromNumber(schema, references, value) {
return TryConvertNumber(value);
}
// prettier-ignore
function FromObject(schema, references, value) {
if (!(0, index_5.IsObject)(value) || (0, index_5.IsArray)(value))
return value;
for (const propertyKey of Object.getOwnPropertyNames(schema.properties)) {
if (!(0, index_5.HasPropertyKey)(value, propertyKey))
continue;
value[propertyKey] = Visit(schema.properties[propertyKey], references, value[propertyKey]);
}
return value;
}
function FromRecord(schema, references, value) {
const isConvertable = (0, index_5.IsObject)(value) && !(0, index_5.IsArray)(value);
if (!isConvertable)
return value;
const propertyKey = Object.getOwnPropertyNames(schema.patternProperties)[0];
const property = schema.patternProperties[propertyKey];
for (const [propKey, propValue] of Object.entries(value)) {
value[propKey] = Visit(property, references, propValue);
}
return value;
}
function FromRef(schema, references, value) {
return Visit((0, index_3.Deref)(schema, references), references, value);
}
function FromString(schema, references, value) {
return TryConvertString(value);
}
function FromSymbol(schema, references, value) {
return (0, index_5.IsString)(value) || (0, index_5.IsNumber)(value) ? Symbol(value) : value;
}
function FromThis(schema, references, value) {
return Visit((0, index_3.Deref)(schema, references), references, value);
}
// prettier-ignore
function FromTuple(schema, references, value) {
const isConvertable = (0, index_5.IsArray)(value) && !(0, index_5.IsUndefined)(schema.items);
if (!isConvertable)
return value;
return value.map((value, index) => {
return (index < schema.items.length)
? Visit(schema.items[index], references, value)
: value;
});
}
function FromUndefined(schema, references, value) {
return TryConvertUndefined(value);
}
function FromUnion(schema, references, value) {
// Check if original value already matches one of the union variants
for (const subschema of schema.anyOf) {
if ((0, index_2.Check)(subschema, references, value)) {
return value;
}
}
// Attempt conversion for each variant
for (const subschema of schema.anyOf) {
const converted = Visit(subschema, references, (0, index_1.Clone)(value));
if (!(0, index_2.Check)(subschema, references, converted))
continue;
return converted;
}
return value;
}
function Visit(schema, references, value) {
const references_ = (0, index_3.Pushref)(schema, references);
const schema_ = schema;
switch (schema[index_4.Kind]) {
case 'Array':
return FromArray(schema_, references_, value);
case 'BigInt':
return FromBigInt(schema_, references_, value);
case 'Boolean':
return FromBoolean(schema_, references_, value);
case 'Date':
return FromDate(schema_, references_, value);
case 'Import':
return FromImport(schema_, references_, value);
case 'Integer':
return FromInteger(schema_, references_, value);
case 'Intersect':
return FromIntersect(schema_, references_, value);
case 'Literal':
return FromLiteral(schema_, references_, value);
case 'Null':
return FromNull(schema_, references_, value);
case 'Number':
return FromNumber(schema_, references_, value);
case 'Object':
return FromObject(schema_, references_, value);
case 'Record':
return FromRecord(schema_, references_, value);
case 'Ref':
return FromRef(schema_, references_, value);
case 'String':
return FromString(schema_, references_, value);
case 'Symbol':
return FromSymbol(schema_, references_, value);
case 'This':
return FromThis(schema_, references_, value);
case 'Tuple':
return FromTuple(schema_, references_, value);
case 'Undefined':
return FromUndefined(schema_, references_, value);
case 'Union':
return FromUnion(schema_, references_, value);
default:
return Default(value);
}
}
/** `[Mutable]` Converts any type mismatched values to their target type if a reasonable conversion is possible. */
// prettier-ignore
function Convert(...args) {
return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]);
}
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InversifyCoreErrorKind = void 0;
var InversifyCoreErrorKind;
(function (InversifyCoreErrorKind) {
InversifyCoreErrorKind[InversifyCoreErrorKind["injectionDecoratorConflict"] = 0] = "injectionDecoratorConflict";
InversifyCoreErrorKind[InversifyCoreErrorKind["missingInjectionDecorator"] = 1] = "missingInjectionDecorator";
InversifyCoreErrorKind[InversifyCoreErrorKind["planning"] = 2] = "planning";
InversifyCoreErrorKind[InversifyCoreErrorKind["resolution"] = 3] = "resolution";
InversifyCoreErrorKind[InversifyCoreErrorKind["unknown"] = 4] = "unknown";
})(InversifyCoreErrorKind || (exports.InversifyCoreErrorKind = InversifyCoreErrorKind = {}));
//# sourceMappingURL=InversifyCoreErrorKind.js.map
@@ -0,0 +1,55 @@
/* DON'T EDIT THIS FILE. This is generated by 'scripts/update-lib-index.js' */
"use strict"
module.exports = {
configs: {
"recommended-module": require("./configs/recommended-module"),
"recommended-script": require("./configs/recommended-script"),
get recommended() {
return require("./configs/recommended")()
},
},
rules: {
"callback-return": require("./rules/callback-return"),
"exports-style": require("./rules/exports-style"),
"file-extension-in-import": require("./rules/file-extension-in-import"),
"global-require": require("./rules/global-require"),
"handle-callback-err": require("./rules/handle-callback-err"),
"no-callback-literal": require("./rules/no-callback-literal"),
"no-deprecated-api": require("./rules/no-deprecated-api"),
"no-exports-assign": require("./rules/no-exports-assign"),
"no-extraneous-import": require("./rules/no-extraneous-import"),
"no-extraneous-require": require("./rules/no-extraneous-require"),
"no-missing-import": require("./rules/no-missing-import"),
"no-missing-require": require("./rules/no-missing-require"),
"no-mixed-requires": require("./rules/no-mixed-requires"),
"no-new-require": require("./rules/no-new-require"),
"no-path-concat": require("./rules/no-path-concat"),
"no-process-env": require("./rules/no-process-env"),
"no-process-exit": require("./rules/no-process-exit"),
"no-restricted-import": require("./rules/no-restricted-import"),
"no-restricted-require": require("./rules/no-restricted-require"),
"no-sync": require("./rules/no-sync"),
"no-unpublished-bin": require("./rules/no-unpublished-bin"),
"no-unpublished-import": require("./rules/no-unpublished-import"),
"no-unpublished-require": require("./rules/no-unpublished-require"),
"no-unsupported-features/es-builtins": require("./rules/no-unsupported-features/es-builtins"),
"no-unsupported-features/es-syntax": require("./rules/no-unsupported-features/es-syntax"),
"no-unsupported-features/node-builtins": require("./rules/no-unsupported-features/node-builtins"),
"prefer-global/buffer": require("./rules/prefer-global/buffer"),
"prefer-global/console": require("./rules/prefer-global/console"),
"prefer-global/process": require("./rules/prefer-global/process"),
"prefer-global/text-decoder": require("./rules/prefer-global/text-decoder"),
"prefer-global/text-encoder": require("./rules/prefer-global/text-encoder"),
"prefer-global/url-search-params": require("./rules/prefer-global/url-search-params"),
"prefer-global/url": require("./rules/prefer-global/url"),
"prefer-promises/dns": require("./rules/prefer-promises/dns"),
"prefer-promises/fs": require("./rules/prefer-promises/fs"),
"process-exit-as-throw": require("./rules/process-exit-as-throw"),
shebang: require("./rules/shebang"),
// Deprecated rules.
"no-hide-core-modules": require("./rules/no-hide-core-modules"),
"no-unsupported-features": require("./rules/no-unsupported-features"),
},
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 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","2":"C L M G N O P","194":"Q H R S T U V"},C:{"1":"XB YB I XC MC YC yC zC","2":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB 0C 1C","322":"PB QB RB SB TB UB VB WB"},D:{"1":"0 1 2 3 4 5 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 XC MC YC","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","194":"7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V"},E:{"1":"qC rC sC tC DD ED","2":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 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"},F:{"1":"0 1 2 3 4 5 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","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 FD GD HD ID NC uC JD OC","194":"wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC"},G:{"1":"qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD RD SD 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"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB wD xD QC RC SC yD","2":"J oD pD qD rD sD aC tD uD vD"},Q:{"2":"zD"},R:{"1":"0D"},S:{"2":"1D 2D"}},B:7,C:"Cookie Store API",D:true};
@@ -0,0 +1,69 @@
import Benchmark from "benchmark";
import { z } from "zod/v3";
const emptySuite = new Benchmark.Suite("z.object: empty");
const shortSuite = new Benchmark.Suite("z.object: short");
const longSuite = new Benchmark.Suite("z.object: long");
const empty = z.object({});
const short = z.object({
string: z.string(),
});
const long = z.object({
string: z.string(),
number: z.number(),
boolean: z.boolean(),
});
emptySuite
.add("valid", () => {
empty.parse({});
})
.add("valid: extra keys", () => {
empty.parse({ string: "string" });
})
.add("invalid: null", () => {
try {
empty.parse(null);
} catch (_err) {}
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`${(emptySuite as any).name}: ${e.target}`);
});
shortSuite
.add("valid", () => {
short.parse({ string: "string" });
})
.add("valid: extra keys", () => {
short.parse({ string: "string", number: 42 });
})
.add("invalid: null", () => {
try {
short.parse(null);
} catch (_err) {}
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`${(shortSuite as any).name}: ${e.target}`);
});
longSuite
.add("valid", () => {
long.parse({ string: "string", number: 42, boolean: true });
})
.add("valid: extra keys", () => {
long.parse({ string: "string", number: 42, boolean: true, list: [] });
})
.add("invalid: null", () => {
try {
long.parse(null);
} catch (_err) {}
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`${(longSuite as any).name}: ${e.target}`);
});
export default {
suites: [emptySuite, shortSuite, longSuite],
};
@@ -0,0 +1,7 @@
Copyright © James Long and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,45 @@
import baseIteratee from './_baseIteratee.js';
import baseWhile from './_baseWhile.js';
/**
* Creates a slice of `array` with elements taken from the beginning. Elements
* are taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.takeWhile(users, function(o) { return !o.active; });
* // => objects for ['barney', 'fred']
*
* // The `_.matches` iteratee shorthand.
* _.takeWhile(users, { 'user': 'barney', 'active': false });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.takeWhile(users, ['active', false]);
* // => objects for ['barney', 'fred']
*
* // The `_.property` iteratee shorthand.
* _.takeWhile(users, 'active');
* // => []
*/
function takeWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, baseIteratee(predicate, 3))
: [];
}
export default takeWhile;
@@ -0,0 +1,443 @@
'use strict';
/** Highest positive signed 32-bit float value */
const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
/** Bootstring parameters */
const base = 36;
const tMin = 1;
const tMax = 26;
const skew = 38;
const damp = 700;
const initialBias = 72;
const initialN = 128; // 0x80
const delimiter = '-'; // '\x2D'
/** Regular expressions */
const regexPunycode = /^xn--/;
const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too.
const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
/** Error messages */
const errors = {
'overflow': 'Overflow: input needs wider integers to process',
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
'invalid-input': 'Invalid input'
};
/** Convenience shortcuts */
const baseMinusTMin = base - tMin;
const floor = Math.floor;
const stringFromCharCode = String.fromCharCode;
/*--------------------------------------------------------------------------*/
/**
* A generic error utility function.
* @private
* @param {String} type The error type.
* @returns {Error} Throws a `RangeError` with the applicable error message.
*/
function error(type) {
throw new RangeError(errors[type]);
}
/**
* A generic `Array#map` utility function.
* @private
* @param {Array} array The array to iterate over.
* @param {Function} callback The function that gets called for every array
* item.
* @returns {Array} A new array of values returned by the callback function.
*/
function map(array, callback) {
const result = [];
let length = array.length;
while (length--) {
result[length] = callback(array[length]);
}
return result;
}
/**
* A simple `Array#map`-like wrapper to work with domain name strings or email
* addresses.
* @private
* @param {String} domain The domain name or email address.
* @param {Function} callback The function that gets called for every
* character.
* @returns {String} A new string of characters returned by the callback
* function.
*/
function mapDomain(domain, callback) {
const parts = domain.split('@');
let result = '';
if (parts.length > 1) {
// In email addresses, only the domain name should be punycoded. Leave
// the local part (i.e. everything up to `@`) intact.
result = parts[0] + '@';
domain = parts[1];
}
// Avoid `split(regex)` for IE8 compatibility. See #17.
domain = domain.replace(regexSeparators, '\x2E');
const labels = domain.split('.');
const encoded = map(labels, callback).join('.');
return result + encoded;
}
/**
* Creates an array containing the numeric code points of each Unicode
* character in the string. While JavaScript uses UCS-2 internally,
* this function will convert a pair of surrogate halves (each of which
* UCS-2 exposes as separate characters) into a single code point,
* matching UTF-16.
* @see `punycode.ucs2.encode`
* @see <https://mathiasbynens.be/notes/javascript-encoding>
* @memberOf punycode.ucs2
* @name decode
* @param {String} string The Unicode input string (UCS-2).
* @returns {Array} The new array of code points.
*/
function ucs2decode(string) {
const output = [];
let counter = 0;
const length = string.length;
while (counter < length) {
const value = string.charCodeAt(counter++);
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
// It's a high surrogate, and there is a next character.
const extra = string.charCodeAt(counter++);
if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
} else {
// It's an unmatched surrogate; only append this code unit, in case the
// next code unit is the high surrogate of a surrogate pair.
output.push(value);
counter--;
}
} else {
output.push(value);
}
}
return output;
}
/**
* Creates a string based on an array of numeric code points.
* @see `punycode.ucs2.decode`
* @memberOf punycode.ucs2
* @name encode
* @param {Array} codePoints The array of numeric code points.
* @returns {String} The new Unicode string (UCS-2).
*/
const ucs2encode = codePoints => String.fromCodePoint(...codePoints);
/**
* Converts a basic code point into a digit/integer.
* @see `digitToBasic()`
* @private
* @param {Number} codePoint The basic numeric code point value.
* @returns {Number} The numeric value of a basic code point (for use in
* representing integers) in the range `0` to `base - 1`, or `base` if
* the code point does not represent a value.
*/
const basicToDigit = function(codePoint) {
if (codePoint >= 0x30 && codePoint < 0x3A) {
return 26 + (codePoint - 0x30);
}
if (codePoint >= 0x41 && codePoint < 0x5B) {
return codePoint - 0x41;
}
if (codePoint >= 0x61 && codePoint < 0x7B) {
return codePoint - 0x61;
}
return base;
};
/**
* Converts a digit/integer into a basic code point.
* @see `basicToDigit()`
* @private
* @param {Number} digit The numeric value of a basic code point.
* @returns {Number} The basic code point whose value (when used for
* representing integers) is `digit`, which needs to be in the range
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
* used; else, the lowercase form is used. The behavior is undefined
* if `flag` is non-zero and `digit` has no uppercase form.
*/
const digitToBasic = function(digit, flag) {
// 0..25 map to ASCII a..z or A..Z
// 26..35 map to ASCII 0..9
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
};
/**
* Bias adaptation function as per section 3.4 of RFC 3492.
* https://tools.ietf.org/html/rfc3492#section-3.4
* @private
*/
const adapt = function(delta, numPoints, firstTime) {
let k = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
delta = floor(delta / baseMinusTMin);
}
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};
/**
* Converts a Punycode string of ASCII-only symbols to a string of Unicode
* symbols.
* @memberOf punycode
* @param {String} input The Punycode string of ASCII-only symbols.
* @returns {String} The resulting string of Unicode symbols.
*/
const decode = function(input) {
// Don't use UCS-2.
const output = [];
const inputLength = input.length;
let i = 0;
let n = initialN;
let bias = initialBias;
// Handle the basic code points: let `basic` be the number of input code
// points before the last delimiter, or `0` if there is none, then copy
// the first basic code points to the output.
let basic = input.lastIndexOf(delimiter);
if (basic < 0) {
basic = 0;
}
for (let j = 0; j < basic; ++j) {
// if it's not a basic code point
if (input.charCodeAt(j) >= 0x80) {
error('not-basic');
}
output.push(input.charCodeAt(j));
}
// Main decoding loop: start just after the last delimiter if any basic code
// points were copied; start at the beginning otherwise.
for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
// `index` is the index of the next character to be consumed.
// Decode a generalized variable-length integer into `delta`,
// which gets added to `i`. The overflow checking is easier
// if we increase `i` as we go, then subtract off its starting
// value at the end to obtain `delta`.
const oldi = i;
for (let w = 1, k = base; /* no condition */; k += base) {
if (index >= inputLength) {
error('invalid-input');
}
const digit = basicToDigit(input.charCodeAt(index++));
if (digit >= base) {
error('invalid-input');
}
if (digit > floor((maxInt - i) / w)) {
error('overflow');
}
i += digit * w;
const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
if (digit < t) {
break;
}
const baseMinusT = base - t;
if (w > floor(maxInt / baseMinusT)) {
error('overflow');
}
w *= baseMinusT;
}
const out = output.length + 1;
bias = adapt(i - oldi, out, oldi == 0);
// `i` was supposed to wrap around from `out` to `0`,
// incrementing `n` each time, so we'll fix that now:
if (floor(i / out) > maxInt - n) {
error('overflow');
}
n += floor(i / out);
i %= out;
// Insert `n` at position `i` of the output.
output.splice(i++, 0, n);
}
return String.fromCodePoint(...output);
};
/**
* Converts a string of Unicode symbols (e.g. a domain name label) to a
* Punycode string of ASCII-only symbols.
* @memberOf punycode
* @param {String} input The string of Unicode symbols.
* @returns {String} The resulting Punycode string of ASCII-only symbols.
*/
const encode = function(input) {
const output = [];
// Convert the input in UCS-2 to an array of Unicode code points.
input = ucs2decode(input);
// Cache the length.
const inputLength = input.length;
// Initialize the state.
let n = initialN;
let delta = 0;
let bias = initialBias;
// Handle the basic code points.
for (const currentValue of input) {
if (currentValue < 0x80) {
output.push(stringFromCharCode(currentValue));
}
}
const basicLength = output.length;
let handledCPCount = basicLength;
// `handledCPCount` is the number of code points that have been handled;
// `basicLength` is the number of basic code points.
// Finish the basic string with a delimiter unless it's empty.
if (basicLength) {
output.push(delimiter);
}
// Main encoding loop:
while (handledCPCount < inputLength) {
// All non-basic code points < n have been handled already. Find the next
// larger one:
let m = maxInt;
for (const currentValue of input) {
if (currentValue >= n && currentValue < m) {
m = currentValue;
}
}
// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
// but guard against overflow.
const handledCPCountPlusOne = handledCPCount + 1;
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
error('overflow');
}
delta += (m - n) * handledCPCountPlusOne;
n = m;
for (const currentValue of input) {
if (currentValue < n && ++delta > maxInt) {
error('overflow');
}
if (currentValue === n) {
// Represent delta as a generalized variable-length integer.
let q = delta;
for (let k = base; /* no condition */; k += base) {
const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
if (q < t) {
break;
}
const qMinusT = q - t;
const baseMinusT = base - t;
output.push(
stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
);
q = floor(qMinusT / baseMinusT);
}
output.push(stringFromCharCode(digitToBasic(q, 0)));
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
delta = 0;
++handledCPCount;
}
}
++delta;
++n;
}
return output.join('');
};
/**
* Converts a Punycode string representing a domain name or an email address
* to Unicode. Only the Punycoded parts of the input will be converted, i.e.
* it doesn't matter if you call it on a string that has already been
* converted to Unicode.
* @memberOf punycode
* @param {String} input The Punycoded domain name or email address to
* convert to Unicode.
* @returns {String} The Unicode representation of the given Punycode
* string.
*/
const toUnicode = function(input) {
return mapDomain(input, function(string) {
return regexPunycode.test(string)
? decode(string.slice(4).toLowerCase())
: string;
});
};
/**
* Converts a Unicode string representing a domain name or an email address to
* Punycode. Only the non-ASCII parts of the domain name will be converted,
* i.e. it doesn't matter if you call it with a domain that's already in
* ASCII.
* @memberOf punycode
* @param {String} input The domain name or email address to convert, as a
* Unicode string.
* @returns {String} The Punycode representation of the given domain name or
* email address.
*/
const toASCII = function(input) {
return mapDomain(input, function(string) {
return regexNonASCII.test(string)
? 'xn--' + encode(string)
: string;
});
};
/*--------------------------------------------------------------------------*/
/** Define the public API */
const punycode = {
/**
* A string representing the current Punycode.js version number.
* @memberOf punycode
* @type String
*/
'version': '2.3.1',
/**
* An object of methods to convert from JavaScript's internal character
* representation (UCS-2) to Unicode code points, and back.
* @see <https://mathiasbynens.be/notes/javascript-encoding>
* @memberOf punycode
* @type Object
*/
'ucs2': {
'decode': ucs2decode,
'encode': ucs2encode
},
'decode': decode,
'encode': encode,
'toASCII': toASCII,
'toUnicode': toUnicode
};
module.exports = punycode;
@@ -0,0 +1,204 @@
# Function calls
a {
color: rgba(0, 255, 0, 0.5);
}
==>
StyleSheet(
RuleSet(TagSelector(TagName),Block(
Declaration(PropertyName,CallExpression(Callee,ArgList(NumberLiteral,NumberLiteral,NumberLiteral,NumberLiteral))))))
# Calls where each argument has multiple values
div {
background: repeating-linear-gradient(red, orange 50px);
clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%)
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(
Declaration(PropertyName,CallExpression(Callee,ArgList(ValueName,ValueName,NumberLiteral(Unit)))),
Declaration(PropertyName,CallExpression(Callee,ArgList(
NumberLiteral(Unit),NumberLiteral(Unit),NumberLiteral(Unit),NumberLiteral(Unit),
NumberLiteral(Unit),NumberLiteral(Unit),NumberLiteral(Unit),NumberLiteral(Unit),
NumberLiteral(Unit),NumberLiteral(Unit),NumberLiteral(Unit),NumberLiteral(Unit),
NumberLiteral(Unit),NumberLiteral(Unit),NumberLiteral(Unit),NumberLiteral(Unit)))))))
# Color literals
a {
b: #fafd04;
c: #fafd0401;
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(
Declaration(PropertyName,ColorLiteral),
Declaration(PropertyName,ColorLiteral))))
# Numbers
a {
b: 0.5%;
c: 5em;
margin: 10E3px;
margin: -456.8px;
margin: -0.0px;
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(
Declaration(PropertyName,NumberLiteral(Unit)),
Declaration(PropertyName,NumberLiteral(Unit)),
Declaration(PropertyName,NumberLiteral(Unit)),
Declaration(PropertyName,NumberLiteral(Unit)),
Declaration(PropertyName,NumberLiteral(Unit)))))
# Binary arithmetic operators
a {
width: calc(100% - 80px);
aspect-ratio: 1/2;
font-size: calc(10px + (56 - 10) * ((100vw - 320px) / (1920 - 320)));
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(
Declaration(PropertyName,CallExpression(Callee,ArgList(BinaryExpression(NumberLiteral(Unit),BinOp,NumberLiteral(Unit))))),
Declaration(PropertyName,BinaryExpression(NumberLiteral,BinOp,NumberLiteral)),
Declaration(PropertyName,CallExpression(Callee,ArgList(
BinaryExpression(BinaryExpression(NumberLiteral(Unit),BinOp,ParenthesizedValue(
BinaryExpression(NumberLiteral,BinOp,NumberLiteral))),BinOp,ParenthesizedValue(
BinaryExpression(ParenthesizedValue(BinaryExpression(NumberLiteral(Unit),BinOp,NumberLiteral(Unit))),BinOp,
ParenthesizedValue(BinaryExpression(NumberLiteral,BinOp,NumberLiteral)))))))))))
# Strings
a {
b: '';
c: '\'hi\'';
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(Declaration(PropertyName,StringLiteral),Declaration(PropertyName,StringLiteral))))
# URLs
a {
b: url(http://something-else?foo=bar);
c: url();
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(
Declaration(PropertyName,CallLiteral(CallTag,ParenthesizedContent)),
Declaration(PropertyName,CallLiteral(CallTag)))))
# Important declarations
a {
b: c !important;
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(Declaration(PropertyName,ValueName,Important))))
# Comments right after numbers
a {
shape-outside: circle(20em/*=*/at 50% 50%);
shape-outside: inset(1em, 1em, 1em, 1em);
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(
Declaration(PropertyName,CallExpression(Callee,ArgList(NumberLiteral(Unit),Comment,ValueName,NumberLiteral(Unit),NumberLiteral(Unit)))),
Declaration(PropertyName,CallExpression(Callee,ArgList(NumberLiteral(Unit),NumberLiteral(Unit),NumberLiteral(Unit),NumberLiteral(Unit)))))))
# Unfinished rule
a { foo: 2
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(Declaration(PropertyName,NumberLiteral),⚠)))
# Variable names
foo {
--my-variable: white;
color: var(--my-variable);
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(
Declaration(VariableName,ValueName),
Declaration(PropertyName,CallExpression(Callee,ArgList(VariableName))))))
# Trailing comma
div { color: var(--c,) }
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(
Declaration(PropertyName,CallExpression(Callee,ArgList(VariableName))))))
# Space before colon
div {
color : red;
.x :active {
color : blue;
}
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(
Declaration(PropertyName,ValueName),
RuleSet(DescendantSelector(ClassSelector(ClassName),PseudoClassSelector(PseudoClassName)),Block(
Declaration(PropertyName,ValueName))))))
# Empty value
p {
--var-name: ;
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(Declaration(VariableName))))
# Bracketed values
div {
--myvar: [ some: value; ]
}
==>
StyleSheet(RuleSet(TagSelector(TagName),Block(
Declaration(VariableName,BracketedValue("[", ValueName, ":", ValueName, ";", "]")))))
# Call to variables
.foo {
box-shadow: --shadow(blue);
}
==>
StyleSheet(RuleSet(ClassSelector(ClassName),Block(
Declaration(PropertyName,CallExpression(VariableName,ArgList(ValueName))))))
@@ -0,0 +1 @@
module.exports={C:{"50":0.01003,"57":0.01003,"72":0.01672,"99":0.01003,"112":0.03344,"115":0.13376,"122":0.0301,"127":0.03344,"134":0.00334,"140":0.0535,"141":0.09029,"142":0.08026,"143":0.80256,"144":0.6387,_:"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 51 52 53 54 55 56 58 59 60 61 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 100 101 102 103 104 105 106 107 108 109 110 111 113 114 116 117 118 119 120 121 123 124 125 126 128 129 130 131 132 133 135 136 137 138 139 145 146 147 3.5 3.6"},D:{"44":0.00334,"49":0.01003,"63":0.08026,"70":0.03344,"74":0.10032,"75":0.01003,"79":0.00334,"80":0.01338,"81":0.00334,"83":0.0301,"85":0.02341,"86":0.04347,"88":0.02675,"91":0.04682,"94":0.02341,"95":0.00334,"101":0.01672,"103":0.04347,"104":0.0535,"105":0.01672,"109":0.68886,"111":0.03344,"114":0.1137,"115":0.0301,"116":0.01003,"122":0.01003,"125":0.09698,"126":0.18392,"127":0.00334,"128":0.34778,"129":0.04013,"130":0.01338,"131":0.59523,"132":0.03344,"133":0.0301,"134":0.01338,"135":0.18726,"136":0.01338,"137":0.08694,"138":5.016,"139":0.4715,"140":4.65819,"141":5.74165,"142":0.0836,_:"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 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 64 65 66 67 68 69 71 72 73 76 77 78 84 87 89 90 92 93 96 97 98 99 100 102 106 107 108 110 112 113 117 118 119 120 121 123 124 143 144 145"},F:{"50":0.00334,"91":0.03344,"92":0.10366,"116":0.00334,"120":0.16051,"121":0.01003,"122":0.65542,_:"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 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.01003,"13":0.00334,"14":0.00334,"16":0.06019,"17":0.00334,"18":0.07022,"84":0.09029,"90":0.01338,"92":0.04682,"100":0.02341,"109":0.02675,"114":0.01672,"115":0.01003,"121":0.01338,"122":0.00334,"126":0.01003,"129":0.00334,"135":0.00334,"137":0.12707,"138":0.0301,"140":0.51832,"141":1.4513,_:"15 79 80 81 83 85 86 87 88 89 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 116 117 118 119 120 123 124 125 127 128 130 131 132 133 134 136 139 142"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.1 17.2 17.3 17.5 18.0 18.2 18.3 18.4 26.2","12.1":0.01003,"13.1":0.07357,"15.6":0.10366,"16.6":0.14379,"17.4":0.0301,"17.6":0.10032,"18.1":0.05685,"18.5-18.6":0.29762,"26.0":0.95973,"26.1":0.01338},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00044,"5.0-5.1":0,"6.0-6.1":0.00176,"7.0-7.1":0.00132,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00397,"10.0-10.2":0.00044,"10.3":0.00749,"11.0-11.2":0.11102,"11.3-11.4":0.00264,"12.0-12.1":0.00088,"12.2-12.5":0.02159,"13.0-13.1":0,"13.2":0.0022,"13.3":0.00088,"13.4-13.7":0.00352,"14.0-14.4":0.00749,"14.5-14.8":0.00793,"15.0-15.1":0.00749,"15.2-15.3":0.00573,"15.4":0.00661,"15.5":0.00749,"15.6-15.8":0.0978,"16.0":0.01322,"16.1":0.02467,"16.2":0.01278,"16.3":0.02291,"16.4":0.00573,"16.5":0.01013,"16.6-16.7":0.13085,"17.0":0.00925,"17.1":0.0141,"17.2":0.01013,"17.3":0.01498,"17.4":0.02643,"17.5":0.04538,"17.6-17.7":0.11455,"18.0":0.02599,"18.1":0.05375,"18.2":0.02908,"18.3":0.0934,"18.4":0.04802,"18.5-18.6":2.44864,"26.0":0.30267,"26.1":0.01101},P:{"4":0.04073,"20":0.01018,"22":0.07127,"24":0.02036,"25":0.06109,"26":0.04073,"27":0.17309,"28":0.62108,"29":0.01018,_:"21 23 5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0 13.0 14.0 15.0 17.0 18.0","7.2-7.4":0.08145,"11.1-11.2":0.03054,"16.0":0.01018,"19.0":0.02036},I:{"0":0.03323,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.98494,_:"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.09983},Q:{_:"14.9"},O:{"0":0.03993},H:{"0":0},L:{"0":65.22953}};
@@ -0,0 +1,64 @@
{
"name": "resize-observer-polyfill",
"author": "Denis Rul <que.etc@gmail.com>",
"version": "1.5.1",
"description": "A polyfill for the Resize Observer API",
"main": "dist/ResizeObserver.js",
"module": "dist/ResizeObserver.es.js",
"scripts": {
"build": "rollup -c && cpy src/index.js.flow dist --rename=ResizeObserver.js.flow",
"test": "npm run test:lint && npm run test:spec",
"test:ci": "npm run test:lint && npm run test:spec:sauce && npm run test:spec:node",
"test:ci:pull": "npm run test:lint && karma start --browsers Firefox && npm run test:spec:node",
"test:lint": "node ./node_modules/eslint/bin/eslint.js \"**/*.js\" --ignore-pattern \"/dist/\"",
"test:spec": "karma start --browsers Chrome && npm run test:spec:node",
"test:spec:sauce": "karma start --sauce=windows && karma start --sauce=linux && karma start --sauce=osx",
"test:spec:node": "npm run build && node tests/node/index.js",
"test:spec:custom": "karma start --no-browsers",
"test:spec:native": "karma start --no-browsers --native"
},
"repository": {
"type": "git",
"url": "https://github.com/que-etc/resize-observer-polyfill.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/que-etc/resize-observer-polyfill/issues"
},
"types": "src/index.d.ts",
"files": [
"src/",
"dist/"
],
"keywords": [
"ResizeObserver",
"resize",
"observer",
"util",
"client",
"browser",
"polyfill",
"ponyfill"
],
"homepage": "https://github.com/que-etc/resize-observer-polyfill",
"devDependencies": {
"babel-eslint": "10.0.1",
"cpy-cli": "2.0.0",
"eslint": "5.10.0",
"jasmine": "2.8.0",
"jasmine-core": "2.8.0",
"karma": "3.1.3",
"karma-chrome-launcher": "2.2.0",
"karma-firefox-launcher": "1.1.0",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "0.2.2",
"karma-rollup-preprocessor": "6.1.1",
"karma-sauce-launcher": "1.2.0",
"karma-sourcemap-loader": "0.3.7",
"karma-spec-reporter": "0.0.32",
"promise-polyfill": "8.1.0",
"rollup": "0.67.4",
"rollup-plugin-typescript": "1.0.0",
"typescript": "3.2.2"
}
}
@@ -0,0 +1,10 @@
function _extends() {
return _extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends.apply(null, arguments);
}
export { _extends as default };
@@ -0,0 +1,60 @@
import apply from './_apply.js';
import arrayMap from './_arrayMap.js';
import baseIteratee from './_baseIteratee.js';
import baseRest from './_baseRest.js';
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that iterates over `pairs` and invokes the corresponding
* function of the first predicate to return truthy. The predicate-function
* pairs are invoked with the `this` binding and arguments of the created
* function.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {Array} pairs The predicate-function pairs.
* @returns {Function} Returns the new composite function.
* @example
*
* var func = _.cond([
* [_.matches({ 'a': 1 }), _.constant('matches A')],
* [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
* [_.stubTrue, _.constant('no match')]
* ]);
*
* func({ 'a': 1, 'b': 2 });
* // => 'matches A'
*
* func({ 'a': 0, 'b': 1 });
* // => 'matches B'
*
* func({ 'a': '1', 'b': '2' });
* // => 'no match'
*/
function cond(pairs) {
var length = pairs == null ? 0 : pairs.length,
toIteratee = baseIteratee;
pairs = !length ? [] : arrayMap(pairs, function(pair) {
if (typeof pair[1] != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return [toIteratee(pair[0]), pair[1]];
});
return baseRest(function(args) {
var index = -1;
while (++index < length) {
var pair = pairs[index];
if (apply(pair[0], this, args)) {
return apply(pair[1], this, args);
}
}
});
}
export default cond;
@@ -0,0 +1,88 @@
// Finnish [fi]
import dayjs from '../index';
function relativeTimeFormatter(number, withoutSuffix, key, isFuture) {
var past = {
s: 'muutama sekunti',
m: 'minuutti',
mm: '%d minuuttia',
h: 'tunti',
hh: '%d tuntia',
d: 'päivä',
dd: '%d päivää',
M: 'kuukausi',
MM: '%d kuukautta',
y: 'vuosi',
yy: '%d vuotta',
numbers: 'nolla_yksi_kaksi_kolme_neljä_viisi_kuusi_seitsemän_kahdeksan_yhdeksän'.split('_')
};
var future = {
s: 'muutaman sekunnin',
m: 'minuutin',
mm: '%d minuutin',
h: 'tunnin',
hh: '%d tunnin',
d: 'päivän',
dd: '%d päivän',
M: 'kuukauden',
MM: '%d kuukauden',
y: 'vuoden',
yy: '%d vuoden',
numbers: 'nollan_yhden_kahden_kolmen_neljän_viiden_kuuden_seitsemän_kahdeksan_yhdeksän'.split('_')
};
var words = isFuture && !withoutSuffix ? future : past;
var result = words[key];
if (number < 10) {
return result.replace('%d', words.numbers[number]);
}
return result.replace('%d', number);
}
var locale = {
name: 'fi',
// Finnish
weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
// Note weekdays are not capitalized in Finnish
weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),
// There is no short form of weekdays in Finnish except this 2 letter format so it is used for both 'weekdaysShort' and 'weekdaysMin'
weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),
months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
// Note month names are not capitalized in Finnish
monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
ordinal: function ordinal(n) {
return n + ".";
},
weekStart: 1,
yearStart: 4,
relativeTime: {
future: '%s päästä',
past: '%s sitten',
s: relativeTimeFormatter,
m: relativeTimeFormatter,
mm: relativeTimeFormatter,
h: relativeTimeFormatter,
hh: relativeTimeFormatter,
d: relativeTimeFormatter,
dd: relativeTimeFormatter,
M: relativeTimeFormatter,
MM: relativeTimeFormatter,
y: relativeTimeFormatter,
yy: relativeTimeFormatter
},
formats: {
LT: 'HH.mm',
LTS: 'HH.mm.ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM[ta] YYYY',
LLL: 'D. MMMM[ta] YYYY, [klo] HH.mm',
LLLL: 'dddd, D. MMMM[ta] YYYY, [klo] HH.mm',
l: 'D.M.YYYY',
ll: 'D. MMM YYYY',
lll: 'D. MMM YYYY, [klo] HH.mm',
llll: 'ddd, D. MMM YYYY, [klo] HH.mm'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,25 @@
import * as core from "./core.js";
import * as errors from "./errors.js";
import type * as schemas from "./schemas.js";
import * as util from "./util.js";
export type $ZodErrorClass = {
new (issues: errors.$ZodIssue[]): errors.$ZodError;
};
export type $Parse = <T extends schemas.$ZodType>(schema: T, value: unknown, _ctx?: schemas.ParseContext<errors.$ZodIssue>, _params?: {
callee?: util.AnyFunc;
Err?: $ZodErrorClass;
}) => core.output<T>;
export declare const _parse: (_Err: $ZodErrorClass) => $Parse;
export declare const parse: $Parse;
export type $ParseAsync = <T extends schemas.$ZodType>(schema: T, value: unknown, _ctx?: schemas.ParseContext<errors.$ZodIssue>, _params?: {
callee?: util.AnyFunc;
Err?: $ZodErrorClass;
}) => Promise<core.output<T>>;
export declare const _parseAsync: (_Err: $ZodErrorClass) => $ParseAsync;
export declare const parseAsync: $ParseAsync;
export type $SafeParse = <T extends schemas.$ZodType>(schema: T, value: unknown, _ctx?: schemas.ParseContext<errors.$ZodIssue>) => util.SafeParseResult<core.output<T>>;
export declare const _safeParse: (_Err: $ZodErrorClass) => $SafeParse;
export declare const safeParse: $SafeParse;
export type $SafeParseAsync = <T extends schemas.$ZodType>(schema: T, value: unknown, _ctx?: schemas.ParseContext<errors.$ZodIssue>) => Promise<util.SafeParseResult<core.output<T>>>;
export declare const _safeParseAsync: (_Err: $ZodErrorClass) => $SafeParseAsync;
export declare const safeParseAsync: $SafeParseAsync;
@@ -0,0 +1,18 @@
'use strict';
var flatMap = require('../');
var test = require('tape');
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad array/this value', function (st) {
/* eslint no-useless-call: 0 */
st['throws'](function () { flatMap.call(undefined, function () {}); }, TypeError, 'undefined is not an object');
st['throws'](function () { flatMap.call(null, function () {}); }, TypeError, 'null is not an object');
st.end();
});
runTests(flatMap, t);
t.end();
});
@@ -0,0 +1,13 @@
"use strict";
const normalizeUnit = require("./normalizeUnit-Cn0hUyBC.js");
const endOf = require("./endOf.js");
const parse = require("./parse.js");
function isBefore(date, input, unit) {
unit = normalizeUnit.normalizeUnit(unit);
const inputMs = +parse(input);
if (!unit) {
return +date < inputMs;
}
return +endOf(new Date(date), unit) < inputMs;
}
module.exports = isBefore;
@@ -0,0 +1,155 @@
/**
* Component to render markdown.
*
* This is a synchronous component.
* When using async plugins,
* see {@linkcode MarkdownAsync} or {@linkcode MarkdownHooks}.
*
* @param {Readonly<Options>} options
* Props.
* @returns {ReactElement}
* React element.
*/
export function Markdown(options: Readonly<Options>): ReactElement;
/**
* Component to render markdown with support for async plugins
* through async/await.
*
* Components returning promises are supported on the server.
* For async support on the client,
* see {@linkcode MarkdownHooks}.
*
* @param {Readonly<Options>} options
* Props.
* @returns {Promise<ReactElement>}
* Promise to a React element.
*/
export function MarkdownAsync(options: Readonly<Options>): Promise<ReactElement>;
/**
* Component to render markdown with support for async plugins through hooks.
*
* This uses `useEffect` and `useState` hooks.
* Hooks run on the client and do not immediately render something.
* For async support on the server,
* see {@linkcode MarkdownAsync}.
*
* @param {Readonly<Options>} options
* Props.
* @returns {ReactElement}
* React element.
*/
export function MarkdownHooks(options: Readonly<Options>): ReactElement;
/**
* Make a URL safe.
*
* @satisfies {UrlTransform}
* @param {string} value
* URL.
* @returns {string}
* Safe URL.
*/
export function defaultUrlTransform(value: string): string;
/**
* Filter elements.
*/
export type AllowElement = (element: Readonly<Element>, index: number, parent: Readonly<Parents> | undefined) => boolean | null | undefined;
/**
* Extra fields we pass.
*/
export type ExtraProps = {
/**
* passed when `passNode` is on.
*/
node?: Element | undefined;
};
/**
* Map tag names to components.
*/
export type Components = { [Key in Extract<ElementType, string>]?: ElementType<ComponentProps<Key> & ExtraProps>; };
/**
* Deprecation.
*/
export type Deprecation = {
/**
* Old field.
*/
from: string;
/**
* ID in readme.
*/
id: string;
/**
* New field.
*/
to?: keyof Options;
};
/**
* Configuration.
*/
export type Options = {
/**
* Filter elements (optional);
* `allowedElements` / `disallowedElements` is used first.
*/
allowElement?: AllowElement | null | undefined;
/**
* Tag names to allow (default: all tag names);
* cannot combine w/ `disallowedElements`.
*/
allowedElements?: ReadonlyArray<string> | null | undefined;
/**
* Markdown.
*/
children?: string | null | undefined;
/**
* Wrap in a `div` with this class name.
*/
className?: string | null | undefined;
/**
* Map tag names to components.
*/
components?: Components | null | undefined;
/**
* Tag names to disallow (default: `[]`);
* cannot combine w/ `allowedElements`.
*/
disallowedElements?: ReadonlyArray<string> | null | undefined;
/**
* List of rehype plugins to use.
*/
rehypePlugins?: PluggableList | null | undefined;
/**
* List of remark plugins to use.
*/
remarkPlugins?: PluggableList | null | undefined;
/**
* Options to pass through to `remark-rehype`.
*/
remarkRehypeOptions?: Readonly<RemarkRehypeOptions> | null | undefined;
/**
* Ignore HTML in markdown completely (default: `false`).
*/
skipHtml?: boolean | null | undefined;
/**
* Extract (unwrap) what’s in disallowed elements (default: `false`);
* normally when say `strong` is not allowed, it and it’s children are dropped,
* with `unwrapDisallowed` the element itself is replaced by its children.
*/
unwrapDisallowed?: boolean | null | undefined;
/**
* Change URLs (default: `defaultUrlTransform`)
*/
urlTransform?: UrlTransform | null | undefined;
};
/**
* Transform all URLs.
*/
export type UrlTransform = (url: string, key: string, node: Readonly<Element>) => string | null | undefined;
import type { ReactElement } from 'react';
import type { Element } from 'hast';
import type { Parents } from 'hast';
import type { ElementType } from 'react';
import type { ComponentProps } from 'react';
import type { PluggableList } from 'unified';
import type { Options as RemarkRehypeOptions } from 'remark-rehype';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"BaseManagedClassElementMetadata.js","sourceRoot":"","sources":["../../../../src/metadata/models/BaseManagedClassElementMetadata.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
{"version":3,"file":"Tokenizer.js","sourceRoot":"","sources":["../../src/Tokenizer.ts"],"names":[],"mappings":"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 truncated
@@ -0,0 +1,287 @@
import React, { MutableRefObject, Ref, DOMAttributes, JSX, MouseEvent, ReactNode, HTMLAttributes, EffectCallback, Dispatch, RefObject as _RefObject1 } from "react";
import { AriaLabelingProps, DOMProps, GlobalDOMAttributes, LinkDOMProps, FocusableElement, Orientation, Href, RouterOptions, RefObject, AsyncLoadable, Collection } from "@react-types/shared";
export const useLayoutEffect: typeof React.useLayoutEffect;
/**
* If a default is not provided, generate an id.
* @param defaultId - Default component id.
*/
export function useId(defaultId?: string): string;
/**
* Merges two ids.
* Different ids will trigger a side-effect and re-render components hooked up with `useId`.
*/
export function mergeIds(idA: string, idB: string): string;
/**
* Used to generate an id, and after render, check if that id is rendered so we know
* if we can use it in places such as labelledby.
* @param depArray - When to recalculate if the id is in the DOM.
*/
export function useSlotId(depArray?: ReadonlyArray<any>): string;
/**
* Calls all functions in the order they were chained with the same arguments.
*/
export function chain(...callbacks: any[]): (...args: any[]) => void;
export const getOwnerDocument: (el: Element | null | undefined) => Document;
export const getOwnerWindow: (el: (Window & typeof global) | Element | null | undefined) => Window & typeof global;
/**
* Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to
* distinguish ShadowRoot from other DocumentFragments.
*/
export function isShadowRoot(node: Node | null): node is ShadowRoot;
/**
* ShadowDOM safe version of Node.contains.
*/
export function nodeContains(node: Node | null | undefined, otherNode: Node | null | undefined): boolean;
/**
* ShadowDOM safe version of document.activeElement.
*/
export const getActiveElement: (doc?: Document) => Element | null;
/**
* ShadowDOM safe version of event.target.
*/
export function getEventTarget<T extends Event>(event: T): Element;
export class ShadowTreeWalker implements TreeWalker {
readonly filter: NodeFilter | null;
readonly root: Node;
readonly whatToShow: number;
constructor(doc: Document, root: Node, whatToShow?: number, filter?: NodeFilter | null);
get currentNode(): Node;
set currentNode(node: Node);
get doc(): Document;
firstChild(): Node | null;
lastChild(): Node | null;
nextNode(): Node | null;
previousNode(): Node | null;
/**
* @deprecated
*/
nextSibling(): Node | null;
/**
* @deprecated
*/
previousSibling(): Node | null;
/**
* @deprecated
*/
parentNode(): Node | null;
}
/**
* ShadowDOM safe version of document.createTreeWalker.
*/
export function createShadowTreeWalker(doc: Document, root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;
interface Props {
[key: string]: any;
}
type PropsArg = Props | null | undefined;
type TupleTypes<T> = {
[P in keyof T]: T[P];
} extends {
[key: number]: infer V;
} ? NullToObject<V> : never;
type NullToObject<T> = T extends (null | undefined) ? {} : T;
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
/**
* Merges multiple props objects together. Event handlers are chained,
* classNames are combined, and ids are deduplicated - different ids
* will trigger a side-effect and re-render components hooked up with `useId`.
* For all other props, the last prop object overrides all previous ones.
* @param args - Multiple sets of props to merge together.
*/
export function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>>;
/**
* Merges multiple refs into one. Works with either callback or object refs.
*/
export function mergeRefs<T>(...refs: Array<Ref<T> | MutableRefObject<T> | null | undefined>): Ref<T>;
interface Options {
/**
* If labelling associated aria properties should be included in the filter.
*/
labelable?: boolean;
/** Whether the element is a link and should include DOM props for <a> elements. */
isLink?: boolean;
/** Whether to include global DOM attributes. */
global?: boolean;
/** Whether to include DOM events. */
events?: boolean;
/**
* A Set of other property names that should be included in the filter.
*/
propNames?: Set<string>;
}
/**
* Filters out all props that aren't valid DOM props or defined via override prop obj.
* @param props - The component props to be filtered.
* @param opts - Props to override.
*/
export function filterDOMProps(props: DOMProps & AriaLabelingProps & LinkDOMProps & GlobalDOMAttributes, opts?: Options): DOMProps & AriaLabelingProps & GlobalDOMAttributes;
export function focusWithoutScrolling(element: FocusableElement): void;
export function getOffset(element: HTMLElement, reverse?: boolean, orientation?: Orientation): number;
export const isMac: () => boolean;
export const isIPhone: () => boolean;
export const isIPad: () => boolean;
export const isIOS: () => boolean;
export const isAppleDevice: () => boolean;
export const isWebKit: () => boolean;
export const isChrome: () => boolean;
export const isAndroid: () => boolean;
export const isFirefox: () => boolean;
interface Router {
isNative: boolean;
open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => void;
useHref: (href: Href) => string;
}
interface RouterProviderProps {
navigate: (path: Href, routerOptions: RouterOptions | undefined) => void;
useHref?: (href: Href) => string;
children: ReactNode;
}
/**
* A RouterProvider accepts a `navigate` function from a framework or client side router,
* and provides it to all nested React Aria links to enable client side navigation.
*/
export function RouterProvider(props: RouterProviderProps): JSX.Element;
export function useRouter(): Router;
interface Modifiers {
metaKey?: boolean;
ctrlKey?: boolean;
altKey?: boolean;
shiftKey?: boolean;
}
export function shouldClientNavigate(link: HTMLAnchorElement, modifiers: Modifiers): boolean;
export function openLink(target: HTMLAnchorElement, modifiers: Modifiers, setOpening?: boolean): void;
export function useSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement>;
/** @deprecated - For backward compatibility. */
export function getSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement>;
export function useLinkProps(props?: LinkDOMProps): LinkDOMProps;
export function handleLinkClick(e: MouseEvent, router: Router, href: Href | undefined, routerOptions: RouterOptions | undefined): void;
export function runAfterTransition(fn: () => void): void;
interface UseDrag1DProps {
containerRef: MutableRefObject<HTMLElement>;
reverse?: boolean;
orientation?: Orientation;
onHover?: (hovered: boolean) => void;
onDrag?: (dragging: boolean) => void;
onPositionChange?: (position: number) => void;
onIncrement?: () => void;
onDecrement?: () => void;
onIncrementToMax?: () => void;
onDecrementToMin?: () => void;
onCollapseToggle?: () => void;
}
export function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement>;
interface GlobalListeners {
addGlobalListener<K extends keyof WindowEventMap>(el: Window, type: K, listener: (this: Document, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
removeAllGlobalListeners(): void;
}
export function useGlobalListeners(): GlobalListeners;
/**
* Merges aria-label and aria-labelledby into aria-labelledby when both exist.
* @param props - Aria label props.
* @param defaultLabel - Default value for aria-label when not present.
*/
export function useLabels(props: DOMProps & AriaLabelingProps, defaultLabel?: string): DOMProps & AriaLabelingProps;
/**
* Offers an object ref for a given callback ref or an object ref. Especially
* helfpul when passing forwarded refs (created using `React.forwardRef`) to
* React Aria hooks.
*
* @param ref The original ref intended to be used.
* @returns An object ref that updates the given ref.
* @see https://react.dev/reference/react/forwardRef
*/
export function useObjectRef<T>(ref?: ((instance: T | null) => (() => void) | void) | MutableRefObject<T | null> | null): MutableRefObject<T | null>;
export function useUpdateEffect(effect: EffectCallback, dependencies: any[]): void;
export function useUpdateLayoutEffect(effect: EffectCallback, dependencies: any[]): void;
type useResizeObserverOptionsType<T> = {
ref: RefObject<T | undefined | null> | undefined;
box?: ResizeObserverBoxOptions;
onResize: () => void;
};
export function useResizeObserver<T extends Element>(options: useResizeObserverOptionsType<T>): void;
interface ContextValue<T> {
ref?: MutableRefObject<T | null>;
}
export function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T | null>): void;
export function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean;
export function getScrollParent(node: Element, checkForOverflow?: boolean): Element;
export function getScrollParents(node: Element, checkForOverflow?: boolean): Element[];
interface Event {
altKey: boolean;
ctrlKey: boolean;
metaKey: boolean;
}
export function isCtrlKeyPressed(e: Event): boolean;
export function willOpenKeyboard(target: Element): boolean;
interface ViewportSize {
width: number;
height: number;
}
export function useViewportSize(): ViewportSize;
export function useDescription(description?: string): AriaLabelingProps;
export function useEffectEvent<T extends Function>(fn?: T): T;
export function useEvent<K extends keyof GlobalEventHandlersEventMap>(ref: RefObject<EventTarget | null>, event: K | (string & {}), handler?: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
type SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;
export function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>];
interface ScrollIntoViewportOpts {
/** The optional containing element of the target to be centered in the viewport. */
containingElement?: Element | null;
}
/**
* Scrolls `scrollView` so that `element` is visible.
* Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),
* but doesn't affect parents above `scrollView`.
*/
export function scrollIntoView(scrollView: HTMLElement, element: HTMLElement): void;
/**
* Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`
* that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on
* the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.
*/
export function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void;
export function isVirtualClick(event: MouseEvent | PointerEvent): boolean;
export function isVirtualPointerEvent(event: PointerEvent): boolean;
export function useDeepMemo<T>(value: T, isEqual: (a: T, b: T) => boolean): T;
export function useFormReset<T>(ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null> | undefined, initialValue: T, onReset: (value: T) => void): void;
interface LoadMoreProps {
/** Whether data is currently being loaded. */
isLoading?: boolean;
/** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */
onLoadMore?: () => void;
/**
* The amount of offset from the bottom of your scrollable region that should trigger load more.
* Uses a percentage value relative to the scroll body's client height. Load more is then triggered
* when your current scroll position's distance from the bottom of the currently loaded list of items is less than
* or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).
* @default 1
*/
scrollOffset?: number;
/** The data currently loaded. */
items?: any;
}
export function useLoadMore(props: LoadMoreProps, ref: _RefObject1<HTMLElement | null>): void;
export interface LoadMoreSentinelProps extends Omit<AsyncLoadable, 'isLoading'> {
collection: Collection<any>;
/**
* The amount of offset from the bottom of your scrollable region that should trigger load more.
* Uses a percentage value relative to the scroll body's client height. Load more is then triggered
* when your current scroll position's distance from the bottom of the currently loaded list of items is less than
* or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).
* @default 1
*/
scrollOffset?: number;
}
export function UNSTABLE_useLoadMoreSentinel(props: LoadMoreSentinelProps, ref: _RefObject1<HTMLElement | null>): void;
export function inertValue(value?: boolean): string | boolean | undefined;
export const CLEAR_FOCUS_EVENT = "react-aria-clear-focus";
export const FOCUS_EVENT = "react-aria-focus";
export function useEnterAnimation(ref: _RefObject1<HTMLElement | null>, isReady?: boolean): boolean;
export function useExitAnimation(ref: _RefObject1<HTMLElement | null>, isOpen: boolean): boolean;
export function isFocusable(element: Element): boolean;
export function isTabbable(element: Element): boolean;
export { clamp, snapValueToStep } from '@react-stately/utils';
//# sourceMappingURL=types.d.ts.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more