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,4 @@
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.Ce0vMQM7.js';
import '@vitest/snapshot/environment';
import './chunks/utils.DvEY5TfP.js';
import '@vitest/utils/timers';
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
{"name":"statuses","version":"2.0.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532088779,"integrity":"sha512-XMak2Jpdyxqd52W8dLdmy4u4BxinqJrtvcP3uYH9wv+rc4Lus/HKFa+Ira0yMsecQwlK0Vsh3b6HJDwWQ64GQQ==","mode":438,"size":1172},"index.js":{"checkedAt":1794532088780,"integrity":"sha512-aI6zDw0o8WVBWhiIKDtHPEA9I7oJqtHE/vlIDXAJozUmSMTCt6oqrab6CEI84YHpgVeqx4JaKQ90Q06oRI8fWw==","mode":438,"size":2610},"codes.json":{"checkedAt":1794532088780,"integrity":"sha512-s2xuaVImLfWFVXsIoBKSrtOsR0Y0yUnahFfPmdcLIQYEx14RrsW++FCyDweD5sEo1fRRP0+SxxeRdSxgEcSi0g==","mode":438,"size":1789},"package.json":{"checkedAt":1794532088780,"integrity":"sha512-i69KB3WG78Vxs7MsZN/eiioK607OqR4Bb/luQAUcDeTmwJzbjAcRonMadxINms6sC/IHfQ4U4ohT/vkNUSq2IA==","mode":438,"size":1440},"HISTORY.md":{"checkedAt":1794532088780,"integrity":"sha512-evOAvtlhUSD2nvWxt37Dsv0oe6JL0u509kyl9xWDXG9pMWVXDadVKf+rgnUNcRXfm4ThDX/ZWQY6l0tt2Rk9DQ==","mode":438,"size":1546},"README.md":{"checkedAt":1794532088781,"integrity":"sha512-6htWAGbWYEc84F2qlLpm84Mp2B1EPyOh2Y+2NmrA8Rs1H6CPhIsasqZ468NDItL/zJGORKyGF1XiQ3te41cNbw==","mode":438,"size":3559}}}
@@ -0,0 +1 @@
{"version":3,"file":"curryBuildServiceNodeBindings.spec.d.ts","sourceRoot":"","sources":["../../../../src/planning/actions/curryBuildServiceNodeBindings.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
export default (function (o, c) {
c.prototype.isSameOrBefore = function (that, units) {
return this.isSame(that, units) || this.isBefore(that, units);
};
});
@@ -0,0 +1 @@
{"name":"@internationalized/message","version":"3.1.8","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532105972,"integrity":"sha512-cil7stSp3ik41Hdv2Dj+GMcbvUfs1q+MZ2Yte0804py9i6oJJN/diCiIr/brcQOZ5ZqwAI6dgaHA7l8FZheQBw==","mode":420,"size":11335},"dist/main.js":{"checkedAt":1794532106279,"integrity":"sha512-vJ5tjVC+FdRvlJq+a1Ydl8y4hWgp33lgybz9sE/sPZnVDDRbpkgQlIDLpzzrsHsaTdstJrz7L+OCRgOj+l4kyA==","mode":420,"size":1136},"dist/MessageDictionary.main.js":{"checkedAt":1794532106279,"integrity":"sha512-8A1JvGKpMBmK+ceY9LXZuuI7WwDOFypHp7wJR3+GzSfLMmBTVlRo+YKbroIjaNtzy8+MfXOLrvo+E3aI1Low0g==","mode":420,"size":2699},"dist/MessageDictionary.module.js":{"checkedAt":1794532106279,"integrity":"sha512-aQVo3yq98lnqGfTe8ItBgrJ5+bc1pnitUWkSrgjgq1P9qEFPUDi5y8t7J+lgnlf0yjKLnnFm7S+bJr1wvdn6Dw==","mode":420,"size":2543},"dist/MessageFormatter.main.js":{"checkedAt":1794532106279,"integrity":"sha512-HD6oMMkPUp1KOtN5Tz71b70z4MB6r54H1ZYDzDQYOL7v4cdBCdPYEeWQ1oqnhaNDpgKuChnrtYpIJjHme9JU5Q==","mode":420,"size":1906},"dist/MessageFormatter.module.js":{"checkedAt":1794532106279,"integrity":"sha512-cGEKV0aUI0hvygShmIY78Qa6Lf9PuwH6D709JGfngPPknQVhHiFzXMQWiMh1+eUcSt8Jkjqe2nEaU3+av0lPAw==","mode":420,"size":1637},"dist/module.js":{"checkedAt":1794532106279,"integrity":"sha512-SITF48B2bAe1SKaqPUfUhofyLuEy74RTVUBW8qiwtmA2q/xIBeTeoeALXLXCcIz76cpMxrFJGL93AdIcO5sO1w==","mode":420,"size":1014},"package.json":{"checkedAt":1794532106279,"integrity":"sha512-zKL4n9+yplzAY1PAte0ZDNFzfEHNZBKEjNQoieUUeu1eeG32xpcSzUErgxEtKkZhPmQ51bwOvxVP+dt+HS2UpQ==","mode":420,"size":833},"dist/main.js.map":{"checkedAt":1794532106280,"integrity":"sha512-U8JKl3ylCA4Zf2fQLl/yauCeYvnyJ2rxR+vH7C8/oMqB8Yps24HfBOmbeOz3edk2xBNC0pV0X+lOR0cd7vdE7A==","mode":420,"size":979},"dist/MessageDictionary.main.js.map":{"checkedAt":1794532106280,"integrity":"sha512-iY+ir72WATBztdR4bAaj9C1Aad27zy/7ZSRYbCjbX7cW8Tc5zpoXNV7tYZ8usWOFPkBHwceuNXRgm9nnlj4jWA==","mode":420,"size":3995},"dist/MessageDictionary.module.js.map":{"checkedAt":1794532106280,"integrity":"sha512-h5E9YMnkwjJUJMzeTt9sPGYqYeNwwWO8VHJWLKrXPf8ydgf3kfT76cnf9fHoayX8z1NgJOgxdwKyXmg34JqVmw==","mode":420,"size":3991},"dist/MessageFormatter.main.js.map":{"checkedAt":1794532106280,"integrity":"sha512-/DJYANs+2HdtiTc6acmaEFrakpudlrPS9iGWYM7r3Y8Ky6ZHOQGOm/j+XjJ1HDNPIJq9K806eeugKd49wza6WA==","mode":420,"size":3012},"dist/MessageFormatter.module.js.map":{"checkedAt":1794532106280,"integrity":"sha512-nt4VpJtBeaGjSNIO3NV519DqRkFgrUnOD/aLq549lFgqLdGZv6HCqHFUWljQdhQN5wDL/SKibqYBbTV1Sk51JQ==","mode":420,"size":3004},"dist/module.js.map":{"checkedAt":1794532106280,"integrity":"sha512-QSCFK3aRNZJiQEhArifgyZ09MqRA8W2NxDbS6LTLWfYH/el5Ma6S92n/zgdUK8oZ+ICfFMkjXuNpFfSykcZPAA==","mode":420,"size":974},"dist/types.d.ts.map":{"checkedAt":1794532106280,"integrity":"sha512-lAfD8DrQsruZX71Yud+1R73HAu3EIuLGs4ZpVGfl6zbNWJ2zyjDkedsFCkeRkThKN7CumzT2Oo0UF4rbKVygsQ==","mode":420,"size":1814},"README.md":{"checkedAt":1794532106280,"integrity":"sha512-F+UCxEai9LVBCJ4TPxJWOGtxAKpsBTQdUmc4BHX3oq4k2wnvtI6NOC5ymoqquVH8A7SLGnvRBR4BHsue0cMdGg==","mode":420,"size":143},"dist/import.mjs":{"checkedAt":1794532106281,"integrity":"sha512-wy55PgOnMtWFC7cJUVH0qBwec1EppLPvhenPCh7VM8ZzsEjKYtexWyXmUCs3ilKqTnrO042oVnuJv7RMzd6Alg==","mode":420,"size":1002},"dist/MessageDictionary.mjs":{"checkedAt":1794532106279,"integrity":"sha512-aQVo3yq98lnqGfTe8ItBgrJ5+bc1pnitUWkSrgjgq1P9qEFPUDi5y8t7J+lgnlf0yjKLnnFm7S+bJr1wvdn6Dw==","mode":420,"size":2543},"dist/MessageFormatter.mjs":{"checkedAt":1794532106279,"integrity":"sha512-cGEKV0aUI0hvygShmIY78Qa6Lf9PuwH6D709JGfngPPknQVhHiFzXMQWiMh1+eUcSt8Jkjqe2nEaU3+av0lPAw==","mode":420,"size":1637},"src/index.ts":{"checkedAt":1794532106281,"integrity":"sha512-6bYl4Bza04TQk3SzqWng7q9nmJNiLhbl3EdfesWE5xW0cs+OLM7cscbKKilYLzJ5TJcLQ65ZWI394fP7OASGXA==","mode":420,"size":788},"src/MessageDictionary.ts":{"checkedAt":1794532106281,"integrity":"sha512-/DjVqHgr71B/rDrSgn7mPnQdUYYg/XbdyUqUF66oeaPRcLQWZGcO71HJUsTjOHrCUAGUJvmL1MHq61iUXxWYlg==","mode":420,"size":2666},"src/MessageFormatter.ts":{"checkedAt":1794532106281,"integrity":"sha512-N744aNYLgJsDsmGYb9PLmp4cbTV4pDTPG/WKK7c6AG1zTK6dElPh4K56WbYShYVOlrqA/lgFpeAFbaR1uPxqTA==","mode":420,"size":2060},"dist/types.d.ts":{"checkedAt":1794532106281,"integrity":"sha512-92/d+YrB7aOqE+/66fnA6l/7dkwiVWG7dAqKCCmBSWgLgzp4c27wQCzicu6X+AJSdsN3+d5pKKL3Sz0FNMTpUg==","mode":420,"size":871}}}
@@ -0,0 +1,29 @@
{
"name": "inherits",
"description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
"version": "2.0.4",
"keywords": [
"inheritance",
"class",
"klass",
"oop",
"object-oriented",
"inherits",
"browser",
"browserify"
],
"main": "./inherits.js",
"browser": "./inherits_browser.js",
"repository": "git://github.com/isaacs/inherits",
"license": "ISC",
"scripts": {
"test": "tap"
},
"devDependencies": {
"tap": "^14.2.4"
},
"files": [
"inherits.js",
"inherits_browser.js"
]
}
@@ -0,0 +1 @@
{"version":3,"file":"isAnyAncestorBindingConstraintsWithTag.d.ts","sourceRoot":"","sources":["../../../../src/binding/calculations/isAnyAncestorBindingConstraintsWithTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKpE,wBAAgB,sCAAsC,CACpD,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,OAAO,GACb,CAAC,WAAW,EAAE,kBAAkB,KAAK,OAAO,CAI9C"}
@@ -0,0 +1,12 @@
'use strict';
var tailwindMerge = require('tailwind-merge');
var q=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,g=e=>!e||typeof e!="object"||Object.keys(e).length===0,X=(e,l)=>JSON.stringify(e)===JSON.stringify(l);function Y(e,l){e.forEach(function(t){Array.isArray(t)?Y(t,l):l.push(t);});}function F(e){let l=[];return Y(e,l),l}var J=(...e)=>F(e).filter(Boolean),T=(e,l)=>{let t={},O=Object.keys(e),k=Object.keys(l);for(let y of O)if(k.includes(y)){let V=e[y],h=l[y];Array.isArray(V)||Array.isArray(h)?t[y]=J(h,V):typeof V=="object"&&typeof h=="object"?t[y]=T(V,h):t[y]=h+" "+V;}else t[y]=e[y];for(let y of k)O.includes(y)||(t[y]=l[y]);return t},R=e=>!e||typeof e!="string"?e:e.replace(/\s+/g," ").trim();var ce={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},_=e=>e||void 0,E=(...e)=>_(F(e).filter(Boolean).join(" ")),U=null,C={},W=!1,S=(...e)=>l=>l.twMerge?((!U||W)&&(W=!1,U=g(C)?tailwindMerge.twMerge:tailwindMerge.extendTailwindMerge({...C,extend:{theme:C.theme,classGroups:C.classGroups,conflictingClassGroupModifiers:C.conflictingClassGroupModifiers,conflictingClassGroups:C.conflictingClassGroups,...C.extend}})),_(U(E(e)))):E(e),Z=(e,l)=>{for(let t in l)e.hasOwnProperty(t)?e[t]=E(e[t],l[t]):e[t]=l[t];return e},oe=(e,l)=>{let{extend:t=null,slots:O={},variants:k={},compoundVariants:y=[],compoundSlots:V=[],defaultVariants:h={}}=e,d={...ce,...l},B=t!=null&&t.base?E(t.base,e==null?void 0:e.base):e==null?void 0:e.base,b=t!=null&&t.variants&&!g(t.variants)?T(k,t.variants):k,N=t!=null&&t.defaultVariants&&!g(t.defaultVariants)?{...t.defaultVariants,...h}:h;!g(d.twMergeConfig)&&!X(d.twMergeConfig,C)&&(W=!0,C=d.twMergeConfig);let $=g(t==null?void 0:t.slots),x=g(O)?{}:{base:E(e==null?void 0:e.base,$&&(t==null?void 0:t.base)),...O},M=$?x:Z({...t==null?void 0:t.slots},g(x)?{base:e==null?void 0:e.base}:x),j=g(t==null?void 0:t.compoundVariants)?y:J(t==null?void 0:t.compoundVariants,y),v=f=>{if(g(b)&&g(O)&&$)return S(B,f==null?void 0:f.class,f==null?void 0:f.className)(d);if(j&&!Array.isArray(j))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof j}`);if(V&&!Array.isArray(V))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof V}`);let P=(r,a,n=[],i)=>{let s=n;if(typeof a=="string")s=s.concat(R(a).split(" ").map(o=>`${r}:${o}`));else if(Array.isArray(a))s=s.concat(a.reduce((o,c)=>o.concat(`${r}:${c}`),[]));else if(typeof a=="object"&&typeof i=="string"){for(let o in a)if(a.hasOwnProperty(o)&&o===i){let c=a[o];if(c&&typeof c=="string"){let m=R(c);s[i]?s[i]=s[i].concat(m.split(" ").map(u=>`${r}:${u}`)):s[i]=m.split(" ").map(u=>`${r}:${u}`);}else Array.isArray(c)&&c.length>0&&(s[i]=c.reduce((m,u)=>m.concat(`${r}:${u}`),[]));}}return s},z=(r,a=b,n=null,i=null)=>{var L;let s=a[r];if(!s||g(s))return null;let o=(L=i==null?void 0:i[r])!=null?L:f==null?void 0:f[r];if(o===null)return null;let c=q(o),m=Array.isArray(d.responsiveVariants)&&d.responsiveVariants.length>0||d.responsiveVariants===!0,u=N==null?void 0:N[r],A=[];if(typeof c=="object"&&m)for(let[G,Q]of Object.entries(c)){let ae=s[Q];if(G==="initial"){u=Q;continue}Array.isArray(d.responsiveVariants)&&!d.responsiveVariants.includes(G)||(A=P(G,ae,A,n));}let p=c!=null&&typeof c!="object"?c:q(u),w=s[p||"false"];return typeof A=="object"&&typeof n=="string"&&A[n]?Z(A,w):A.length>0?(A.push(w),n==="base"?A.join(" "):A):w},ee=()=>b?Object.keys(b).map(r=>z(r,b)):null,te=(r,a)=>{if(!b||typeof b!="object")return null;let n=new Array;for(let i in b){let s=z(i,b,r,a),o=r==="base"&&typeof s=="string"?s:s&&s[r];o&&(n[n.length]=o);}return n},D={};for(let r in f)f[r]!==void 0&&(D[r]=f[r]);let H=(r,a)=>{var i;let n=typeof(f==null?void 0:f[r])=="object"?{[r]:(i=f[r])==null?void 0:i.initial}:{};return {...N,...D,...n,...a}},I=(r=[],a)=>{let n=[];for(let{class:i,className:s,...o}of r){let c=!0;for(let[m,u]of Object.entries(o)){let A=H(m,a)[m];if(Array.isArray(u)){if(!u.includes(A)){c=!1;break}}else {let p=w=>w==null||w===!1;if(p(u)&&p(A))continue;if(A!==u){c=!1;break}}}c&&(i&&n.push(i),s&&n.push(s));}return n},ne=r=>{let a=I(j,r);if(!Array.isArray(a))return a;let n={};for(let i of a)if(typeof i=="string"&&(n.base=S(n.base,i)(d)),typeof i=="object")for(let[s,o]of Object.entries(i))n[s]=S(n[s],o)(d);return n},re=r=>{if(V.length<1)return null;let a={};for(let{slots:n=[],class:i,className:s,...o}of V){if(!g(o)){let c=!0;for(let m of Object.keys(o)){let u=H(m,r)[m];if(u===void 0||(Array.isArray(o[m])?!o[m].includes(u):o[m]!==u)){c=!1;break}}if(!c)continue}for(let c of n)a[c]=a[c]||[],a[c].push([i,s]);}return a};if(!g(O)||!$){let r={};if(typeof M=="object"&&!g(M))for(let a of Object.keys(M))r[a]=n=>{var i,s;return S(M[a],te(a,n),((i=ne(n))!=null?i:[])[a],((s=re(n))!=null?s:[])[a],n==null?void 0:n.class,n==null?void 0:n.className)(d)};return r}return S(B,ee(),I(j),f==null?void 0:f.class,f==null?void 0:f.className)(d)},K=()=>{if(!(!b||typeof b!="object"))return Object.keys(b)};return v.variantKeys=K(),v.extend=t,v.base=B,v.slots=M,v.variants=b,v.defaultVariants=N,v.compoundSlots=V,v.compoundVariants=j,v},ye=e=Line truncated
exports.cn = S;
exports.cnBase = E;
exports.createTV = ye;
exports.defaultConfig = ce;
exports.tv = oe;
exports.voidEmpty = _;
@@ -0,0 +1,8 @@
import parser from 'postcss-selector-parser'
import escapeCommas from './escapeCommas'
export default function escapeClassName(className) {
let node = parser.className()
node.value = className
return escapeCommas(node?.raws?.value ?? node.value)
}
@@ -0,0 +1,99 @@
{
"name": "@rollup/pluginutils",
"version": "5.3.0",
"publishConfig": {
"access": "public"
},
"description": "A set of utility functions commonly used by Rollup plugins",
"license": "MIT",
"repository": {
"url": "rollup/plugins",
"directory": "packages/pluginutils"
},
"author": "Rich Harris <richard.a.harris@gmail.com>",
"homepage": "https://github.com/rollup/plugins/tree/master/packages/pluginutils#readme",
"bugs": {
"url": "https://github.com/rollup/plugins/issues"
},
"main": "./dist/cjs/index.js",
"module": "./dist/es/index.js",
"type": "commonjs",
"exports": {
"types": "./types/index.d.ts",
"import": "./dist/es/index.js",
"default": "./dist/cjs/index.js"
},
"engines": {
"node": ">=14.0.0"
},
"files": [
"dist",
"!dist/**/*.map",
"types",
"README.md",
"LICENSE"
],
"keywords": [
"rollup",
"plugin",
"utils"
],
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
},
"dependencies": {
"@types/estree": "^1.0.0",
"estree-walker": "^2.0.2",
"picomatch": "^4.0.2"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^23.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-typescript": "^9.0.1",
"@types/node": "^14.18.30",
"@types/picomatch": "^2.3.0",
"acorn": "^8.8.0",
"rollup": "^4.0.0-24",
"typescript": "^4.8.3"
},
"types": "./types/index.d.ts",
"ava": {
"extensions": [
"ts"
],
"require": [
"ts-node/register"
],
"workerThreads": false,
"files": [
"!**/fixtures/**",
"!**/helpers/**",
"!**/recipes/**",
"!**/types.ts"
]
},
"nyc": {
"extension": [
".js",
".ts"
]
},
"scripts": {
"build": "rollup -c",
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm build && pnpm lint",
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm test -- --verbose",
"prebuild": "del-cli dist",
"prerelease": "pnpm build",
"pretest": "pnpm build --sourcemap",
"release": "pnpm --workspace-root package:release $(pwd)",
"test": "ava",
"test:ts": "tsc --noEmit"
}
}
@@ -0,0 +1,487 @@
import type {
PreloadedStateShapeFromReducersMapObject,
Reducer,
StateFromReducersMapObject,
UnknownAction,
} from 'redux'
import { combineReducers } from 'redux'
import { nanoid } from './nanoid'
import type {
Id,
NonUndefined,
Tail,
UnionToIntersection,
WithOptionalProp,
} from './tsHelpers'
import { getOrInsertComputed } from './utils'
type SliceLike<ReducerPath extends string, State, PreloadedState = State> = {
reducerPath: ReducerPath
reducer: Reducer<State, any, PreloadedState>
}
type AnySliceLike = SliceLike<string, any>
type SliceLikeReducerPath<A extends AnySliceLike> =
A extends SliceLike<infer ReducerPath, any> ? ReducerPath : never
type SliceLikeState<A extends AnySliceLike> =
A extends SliceLike<any, infer State, any> ? State : never
type SliceLikePreloadedState<A extends AnySliceLike> =
A extends SliceLike<any, any, infer PreloadedState> ? PreloadedState : never
export type WithSlice<A extends AnySliceLike> = {
[Path in SliceLikeReducerPath<A>]: SliceLikeState<A>
}
export type WithSlicePreloadedState<A extends AnySliceLike> = {
[Path in SliceLikeReducerPath<A>]: SliceLikePreloadedState<A>
}
type ReducerMap = Record<string, Reducer>
type ExistingSliceLike<DeclaredState, PreloadedState> = {
[ReducerPath in keyof DeclaredState]: SliceLike<
ReducerPath & string,
NonUndefined<DeclaredState[ReducerPath]>,
NonUndefined<PreloadedState[ReducerPath & keyof PreloadedState]>
>
}[keyof DeclaredState]
export type InjectConfig = {
/**
* Allow replacing reducer with a different reference. Normally, an error will be thrown if a different reducer instance to the one already injected is used.
*/
overrideExisting?: boolean
}
/**
* A reducer that allows for slices/reducers to be injected after initialisation.
*/
export interface CombinedSliceReducer<
InitialState,
DeclaredState extends InitialState = InitialState,
PreloadedState extends Partial<
Record<keyof PreloadedState, any>
> = Partial<DeclaredState>,
> extends Reducer<DeclaredState, UnknownAction, PreloadedState> {
/**
* Provide a type for slices that will be injected lazily.
*
* One way to do this would be with interface merging:
* ```ts
*
* export interface LazyLoadedSlices {}
*
* export const rootReducer = combineSlices(stringSlice).withLazyLoadedSlices<LazyLoadedSlices>();
*
* // elsewhere
*
* declare module './reducer' {
* export interface LazyLoadedSlices extends WithSlice<typeof booleanSlice> {}
* }
*
* const withBoolean = rootReducer.inject(booleanSlice);
*
* // elsewhere again
*
* declare module './reducer' {
* export interface LazyLoadedSlices {
* customName: CustomState
* }
* }
*
* const withCustom = rootReducer.inject({ reducerPath: "customName", reducer: customSlice.reducer })
* ```
*/
withLazyLoadedSlices<Lazy = {}, LazyPreloaded = Lazy>(): CombinedSliceReducer<
InitialState,
Id<DeclaredState & Partial<Lazy>>,
Id<PreloadedState & Partial<LazyPreloaded>>
>
/**
* Inject a slice.
*
* Accepts an individual slice, RTKQ API instance, or a "slice-like" { reducerPath, reducer } object.
*
* ```ts
* rootReducer.inject(booleanSlice)
* rootReducer.inject(baseApi)
* rootReducer.inject({ reducerPath: 'boolean' as const, reducer: newReducer }, { overrideExisting: true })
* ```
*
*/
inject<Sl extends Id<ExistingSliceLike<DeclaredState, PreloadedState>>>(
slice: Sl,
config?: InjectConfig,
): CombinedSliceReducer<
InitialState,
Id<DeclaredState & WithSlice<Sl>>,
Id<PreloadedState & Partial<WithSlicePreloadedState<Sl>>>
>
/**
* Inject a slice.
*
* Accepts an individual slice, RTKQ API instance, or a "slice-like" { reducerPath, reducer } object.
*
* ```ts
* rootReducer.inject(booleanSlice)
* rootReducer.inject(baseApi)
* rootReducer.inject({ reducerPath: 'boolean' as const, reducer: newReducer }, { overrideExisting: true })
* ```
*
*/
inject<ReducerPath extends string, State, PreloadedState = State>(
slice: SliceLike<
ReducerPath,
State & (ReducerPath extends keyof DeclaredState ? never : State),
PreloadedState &
(ReducerPath extends keyof PreloadedState ? never : PreloadedState)
>,
config?: InjectConfig,
): CombinedSliceReducer<
InitialState,
Id<DeclaredState & WithSlice<SliceLike<ReducerPath, State>>>,
Id<
PreloadedState &
WithSlicePreloadedState<SliceLike<ReducerPath, State, PreloadedState>>
>
>
/**
* Create a selector that guarantees that the slices injected will have a defined value when selector is run.
*
* ```ts
* const selectBooleanWithoutInjection = (state: RootState) => state.boolean;
* // ^? boolean | undefined
*
* const selectBoolean = rootReducer.inject(booleanSlice).selector((state) => {
* // if action hasn't been dispatched since slice was injected, this would usually be undefined
* // however selector() uses a Proxy around the first parameter to ensure that it evaluates to the initial state instead, if undefined
* return state.boolean;
* // ^? boolean
* })
* ```
*
* If the reducer is nested inside the root state, a selectState callback can be passed to retrieve the reducer's state.
*
* ```ts
*
* export interface LazyLoadedSlices {};
*
* export const innerReducer = combineSlices(stringSlice).withLazyLoadedSlices<LazyLoadedSlices>();
*
* export const rootReducer = combineSlices({ inner: innerReducer });
*
* export type RootState = ReturnType<typeof rootReducer>;
*
* // elsewhere
*
* declare module "./reducer.ts" {
* export interface LazyLoadedSlices extends WithSlice<typeof booleanSlice> {}
* }
*
* const withBool = innerReducer.inject(booleanSlice);
*
* const selectBoolean = withBool.selector(
* (state) => state.boolean,
* (rootState: RootState) => state.inner
* );
* // now expects to be passed RootState instead of innerReducer state
*
* ```
*
* Value passed to selectorFn will be a Proxy - use selector.original(proxy) to get original state value (useful for debugging)
*
* ```ts
* const injectedReducer = rootReducer.inject(booleanSlice);
* const selectBoolean = injectedReducer.selector((state) => {
* console.log(injectedReducer.selector.original(state).boolean) // possibly undefined
* return state.boolean
* })
* ```
*/
selector: {
/**
* Create a selector that guarantees that the slices injected will have a defined value when selector is run.
*
* ```ts
* const selectBooleanWithoutInjection = (state: RootState) => state.boolean;
* // ^? boolean | undefined
*
* const selectBoolean = rootReducer.inject(booleanSlice).selector((state) => {
* // if action hasn't been dispatched since slice was injected, this would usually be undefined
* // however selector() uses a Proxy around the first parameter to ensure that it evaluates to the initial state instead, if undefined
* return state.boolean;
* // ^? boolean
* })
* ```
*
* Value passed to selectorFn will be a Proxy - use selector.original(proxy) to get original state value (useful for debugging)
*
* ```ts
* const injectedReducer = rootReducer.inject(booleanSlice);
* const selectBoolean = injectedReducer.selector((state) => {
* console.log(injectedReducer.selector.original(state).boolean) // undefined
* return state.boolean
* })
* ```
*/
<Selector extends (state: DeclaredState, ...args: any[]) => unknown>(
selectorFn: Selector,
): (
state: WithOptionalProp<
Parameters<Selector>[0],
Exclude<keyof DeclaredState, keyof InitialState>
>,
...args: Tail<Parameters<Selector>>
) => ReturnType<Selector>
/**
* Create a selector that guarantees that the slices injected will have a defined value when selector is run.
*
* ```ts
* const selectBooleanWithoutInjection = (state: RootState) => state.boolean;
* // ^? boolean | undefined
*
* const selectBoolean = rootReducer.inject(booleanSlice).selector((state) => {
* // if action hasn't been dispatched since slice was injected, this would usually be undefined
* // however selector() uses a Proxy around the first parameter to ensure that it evaluates to the initial state instead, if undefined
* return state.boolean;
* // ^? boolean
* })
* ```
*
* If the reducer is nested inside the root state, a selectState callback can be passed to retrieve the reducer's state.
*
* ```ts
*
* interface LazyLoadedSlices {};
*
* const innerReducer = combineSlices(stringSlice).withLazyLoadedSlices<LazyLoadedSlices>();
*
* const rootReducer = combineSlices({ inner: innerReducer });
*
* type RootState = ReturnType<typeof rootReducer>;
*
* // elsewhere
*
* declare module "./reducer.ts" {
* interface LazyLoadedSlices extends WithSlice<typeof booleanSlice> {}
* }
*
* const withBool = innerReducer.inject(booleanSlice);
*
* const selectBoolean = withBool.selector(
* (state) => state.boolean,
* (rootState: RootState) => state.inner
* );
* // now expects to be passed RootState instead of innerReducer state
*
* ```
*
* Value passed to selectorFn will be a Proxy - use selector.original(proxy) to get original state value (useful for debugging)
*
* ```ts
* const injectedReducer = rootReducer.inject(booleanSlice);
* const selectBoolean = injectedReducer.selector((state) => {
* console.log(injectedReducer.selector.original(state).boolean) // possibly undefined
* return state.boolean
* })
* ```
*/
<
Selector extends (state: DeclaredState, ...args: any[]) => unknown,
RootState,
>(
selectorFn: Selector,
selectState: (
rootState: RootState,
...args: Tail<Parameters<Selector>>
) => WithOptionalProp<
Parameters<Selector>[0],
Exclude<keyof DeclaredState, keyof InitialState>
>,
): (
state: RootState,
...args: Tail<Parameters<Selector>>
) => ReturnType<Selector>
/**
* Returns the unproxied state. Useful for debugging.
* @param state state Proxy, that ensures injected reducers have value
* @returns original, unproxied state
* @throws if value passed is not a state Proxy
*/
original: (state: DeclaredState) => InitialState & Partial<DeclaredState>
}
}
type InitialState<Slices extends Array<AnySliceLike | ReducerMap>> =
UnionToIntersection<
Slices[number] extends infer Slice
? Slice extends AnySliceLike
? WithSlice<Slice>
: StateFromReducersMapObject<Slice>
: never
>
type InitialPreloadedState<Slices extends Array<AnySliceLike | ReducerMap>> =
UnionToIntersection<
Slices[number] extends infer Slice
? Slice extends AnySliceLike
? WithSlicePreloadedState<Slice>
: PreloadedStateShapeFromReducersMapObject<Slice>
: never
>
const isSliceLike = (
maybeSliceLike: AnySliceLike | ReducerMap,
): maybeSliceLike is AnySliceLike =>
'reducerPath' in maybeSliceLike &&
typeof maybeSliceLike.reducerPath === 'string'
const getReducers = (slices: Array<AnySliceLike | ReducerMap>) =>
slices.flatMap<[string, Reducer]>((sliceOrMap) =>
isSliceLike(sliceOrMap)
? [[sliceOrMap.reducerPath, sliceOrMap.reducer]]
: Object.entries(sliceOrMap),
)
const ORIGINAL_STATE = Symbol.for('rtk-state-proxy-original')
const isStateProxy = (value: any) => !!value && !!value[ORIGINAL_STATE]
const stateProxyMap = new WeakMap<object, object>()
const createStateProxy = <State extends object>(
state: State,
reducerMap: Partial<Record<PropertyKey, Reducer>>,
initialStateCache: Record<PropertyKey, unknown>,
) =>
getOrInsertComputed(
stateProxyMap,
state,
() =>
new Proxy(state, {
get: (target, prop, receiver) => {
if (prop === ORIGINAL_STATE) return target
const result = Reflect.get(target, prop, receiver)
if (typeof result === 'undefined') {
const cached = initialStateCache[prop]
if (typeof cached !== 'undefined') return cached
const reducer = reducerMap[prop]
if (reducer) {
// ensure action type is random, to prevent reducer treating it differently
const reducerResult = reducer(undefined, { type: nanoid() })
if (typeof reducerResult === 'undefined') {
throw new Error(
`The slice reducer for key "${prop.toString()}" returned undefined when called for selector(). ` +
`If the state passed to the reducer is undefined, you must ` +
`explicitly return the initial state. The initial state may ` +
`not be undefined. If you don't want to set a value for this reducer, ` +
`you can use null instead of undefined.`,
)
}
initialStateCache[prop] = reducerResult
return reducerResult
}
}
return result
},
}),
) as State
const original = (state: any) => {
if (!isStateProxy(state)) {
throw new Error('original must be used on state Proxy')
}
return state[ORIGINAL_STATE]
}
const emptyObject = {}
const noopReducer: Reducer<Record<string, any>> = (state = emptyObject) => state
export function combineSlices<Slices extends Array<AnySliceLike | ReducerMap>>(
...slices: Slices
): CombinedSliceReducer<
Id<InitialState<Slices>>,
Id<InitialState<Slices>>,
Partial<Id<InitialPreloadedState<Slices>>>
> {
const reducerMap = Object.fromEntries(getReducers(slices))
const getReducer = () =>
Object.keys(reducerMap).length ? combineReducers(reducerMap) : noopReducer
let reducer = getReducer()
function combinedReducer(
state: Record<string, unknown>,
action: UnknownAction,
) {
return reducer(state, action)
}
combinedReducer.withLazyLoadedSlices = () => combinedReducer
const initialStateCache: Record<PropertyKey, unknown> = {}
const inject = (
slice: AnySliceLike,
config: InjectConfig = {},
): typeof combinedReducer => {
const { reducerPath, reducer: reducerToInject } = slice
const currentReducer = reducerMap[reducerPath]
if (
!config.overrideExisting &&
currentReducer &&
currentReducer !== reducerToInject
) {
if (
typeof process !== 'undefined' &&
process.env.NODE_ENV === 'development'
) {
console.error(
`called \`inject\` to override already-existing reducer ${reducerPath} without specifying \`overrideExisting: true\``,
)
}
return combinedReducer
}
if (config.overrideExisting && currentReducer !== reducerToInject) {
delete initialStateCache[reducerPath]
}
reducerMap[reducerPath] = reducerToInject
reducer = getReducer()
return combinedReducer
}
const selector = Object.assign(
function makeSelector<State extends object, RootState, Args extends any[]>(
selectorFn: (state: State, ...args: Args) => any,
selectState?: (rootState: RootState, ...args: Args) => State,
) {
return function selector(state: State, ...args: Args) {
return selectorFn(
createStateProxy(
selectState ? selectState(state as any, ...args) : state,
reducerMap,
initialStateCache,
),
...args,
)
}
},
{ original },
)
return Object.assign(combinedReducer, { inject, selector }) as any
}
@@ -0,0 +1,10 @@
import { URISchemeHandler, URIComponents, URIOptions } from "../uri";
export interface URNComponents extends URIComponents {
nid?: string;
nss?: string;
}
export interface URNOptions extends URIOptions {
nid?: string;
}
declare const handler: URISchemeHandler<URNComponents, URNOptions>;
export default handler;
@@ -0,0 +1 @@
{"name":"color-string","version":"2.1.2","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532101190,"integrity":"sha512-DnEtgklHUyArTNQUluMZgJaRm+odaSuh/niZke5PcI3KiFuMtlk6CKHJV7uWqBt4iGE+DAtkJnPRvq2gDQrlCQ==","mode":420,"size":1082},"index.js":{"checkedAt":1794532101190,"integrity":"sha512-DBMKOlYNi9AhCZX2la0iuhIesYRaRXOQ/hBvFUBE+lQYUYNGGlS0WxlTspG14nFBOWeLSBF/HbicAuA4A+y3zg==","mode":420,"size":5642},"package.json":{"checkedAt":1794532101190,"integrity":"sha512-ETOqXZ6J2faOWyHJmu5nlFZqM5B+Y5YThiBam6xCSYiRxygvDIcEohZnJWqsvZWdMxmRVuq0SPPX/dTVQk+uiA==","mode":420,"size":952},"README.md":{"checkedAt":1794532101190,"integrity":"sha512-08iYTl2embC/Lft1Ncru+kUn/7xIf8fdXAX+pvxWTg2e2NARbhEpj3X01GPT6zQAX9LvZiL8lVRYawRW6tbVmg==","mode":420,"size":2371},"index.d.ts":{"checkedAt":1794532101190,"integrity":"sha512-MfqwBwDe4ltClQqVXLX+c4wanKhF5F1CPiqdhMWKIgdUa57g+4X3zltKyXO3f5tgR8mOFdDRWwDR2NqJbl/pzw==","mode":420,"size":798}}}
@@ -0,0 +1,16 @@
var SubjectInfoAccessSyntax_1;
import { __decorate } from "tslib";
import { AsnArray, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
import { id_pe } from "../object_identifiers";
import { AccessDescription } from "./authority_information_access";
export const id_pe_subjectInfoAccess = `${id_pe}.11`;
let SubjectInfoAccessSyntax = SubjectInfoAccessSyntax_1 = class SubjectInfoAccessSyntax extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, SubjectInfoAccessSyntax_1.prototype);
}
};
SubjectInfoAccessSyntax = SubjectInfoAccessSyntax_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: AccessDescription })
], SubjectInfoAccessSyntax);
export { SubjectInfoAccessSyntax };
@@ -0,0 +1,8 @@
import type { Options } from "../index";
export interface JSXPragmaInfo {
base: string;
suffix: string;
fragmentBase: string;
fragmentSuffix: string;
}
export default function getJSXPragmaInfo(options: Options): JSXPragmaInfo;
@@ -0,0 +1 @@
{"name":"fresh","version":"2.0.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532089715,"integrity":"sha512-BhaNV6NyrRHymkGXIymQB2dg2/d/D/D9gpIZAVS15SPrei3jKEY8bO9dmmjg0tXIVSDCb4LNpQIjEmDqcaHxsA==","mode":420,"size":1174},"index.js":{"checkedAt":1794532089715,"integrity":"sha512-qbbnxITOUS+9NfPqkVa8FCB9hJDgAcef0BIrsgaklbm8be6pchUaODjkDKO6qDyvA/wjJsN3cNu0O8aTKhqVxQ==","mode":420,"size":2705},"package.json":{"checkedAt":1794532089716,"integrity":"sha512-1rjffDbkYfHqaT19f2jRs3cdACNCYaf6ngiKsV/AC76vrUBUrzyvLyQYfat7zLazSLK3d7bPkilCgUw9odLiaA==","mode":420,"size":1218},"HISTORY.md":{"checkedAt":1794532089716,"integrity":"sha512-sxQmN6c/hRX/g7zLD4FxK3noPsUpmLJ3i0aPctY17WyVNRyVFKJ5Mvn99igLWC5B5W1FX9MVyU6WSMIdBasN1A==","mode":420,"size":1844},"README.md":{"checkedAt":1794532089716,"integrity":"sha512-eRLw15AixlKlNxQEmNzHDdOF2SwaNU/Lb/sIwwtnaw+9y8YOOtOHrfhnty8wBUXZkh3L3pQLoyp7vn1e25MkHQ==","mode":420,"size":3348}}}
@@ -0,0 +1,36 @@
'use strict';
// https://262.ecma-international.org/15.0/#table-the-typedarray-constructors
module.exports = {
__proto__: null,
name: {
__proto__: null,
$Int8Array: 'INT8',
$Uint8Array: 'UINT8',
$Uint8ClampedArray: 'UINT8C',
$Int16Array: 'INT16',
$Uint16Array: 'UINT16',
$Int32Array: 'INT32',
$Uint32Array: 'UINT32',
$BigInt64Array: 'BIGINT64',
$BigUint64Array: 'BIGUINT64',
$Float32Array: 'FLOAT32',
$Float64Array: 'FLOAT64'
},
size: {
__proto__: null,
$INT8: 1,
$UINT8: 1,
$UINT8C: 1,
$INT16: 2,
$UINT16: 2,
$INT32: 4,
$UINT32: 4,
$BIGINT64: 8,
$BIGUINT64: 8,
$FLOAT32: 4,
$FLOAT64: 8
},
choices: '"INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"'
};
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Dany Castillo
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,104 @@
'use strict';
var test = require('tape');
var getSideChannel = require('../');
test('getSideChannel', function (t) {
t.test('export', function (st) {
st.equal(typeof getSideChannel, 'function', 'is a function');
st.equal(getSideChannel.length, 0, 'takes no arguments');
var channel = getSideChannel();
st.ok(channel, 'is truthy');
st.equal(typeof channel, 'object', 'is an object');
st.end();
});
t.test('assert', function (st) {
var channel = getSideChannel();
st['throws'](
function () { channel.assert({}); },
TypeError,
'nonexistent value throws'
);
var o = {};
channel.set(o, 'data');
st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops');
st.end();
});
t.test('has', function (st) {
var channel = getSideChannel();
/** @type {unknown[]} */ var o = [];
st.equal(channel.has(o), false, 'nonexistent value yields false');
channel.set(o, 'foo');
st.equal(channel.has(o), true, 'existent value yields true');
st.equal(channel.has('abc'), false, 'non object value non existent yields false');
channel.set('abc', 'foo');
st.equal(channel.has('abc'), true, 'non object value that exists yields true');
st.end();
});
t.test('get', function (st) {
var channel = getSideChannel();
var o = {};
st.equal(channel.get(o), undefined, 'nonexistent value yields undefined');
var data = {};
channel.set(o, data);
st.equal(channel.get(o), data, '"get" yields data set by "set"');
st.end();
});
t.test('set', function (st) {
var channel = getSideChannel();
var o = function () {};
st.equal(channel.get(o), undefined, 'value not set');
channel.set(o, 42);
st.equal(channel.get(o), 42, 'value was set');
channel.set(o, Infinity);
st.equal(channel.get(o), Infinity, 'value was set again');
var o2 = {};
channel.set(o2, 17);
st.equal(channel.get(o), Infinity, 'o is not modified');
st.equal(channel.get(o2), 17, 'o2 is set');
channel.set(o, 14);
st.equal(channel.get(o), 14, 'o is modified');
st.equal(channel.get(o2), 17, 'o2 is not modified');
st.end();
});
t.test('delete', function (st) {
var channel = getSideChannel();
var o = {};
st.equal(channel['delete']({}), false, 'nonexistent value yields false');
channel.set(o, 42);
st.equal(channel.has(o), true, 'value is set');
st.equal(channel['delete']({}), false, 'nonexistent value still yields false');
st.equal(channel['delete'](o), true, 'deleted value yields true');
st.equal(channel.has(o), false, 'value is no longer set');
st.end();
});
t.end();
});
@@ -0,0 +1,12 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../../../../../semver@7.7.3/node_modules/semver/bin/semver.js" "$@"
else
exec node "$basedir/../../../../../semver@7.7.3/node_modules/semver/bin/semver.js" "$@"
fi
@@ -0,0 +1,232 @@
/**
* Create `state` from an mdast tree.
*
* @param {MdastNodes} tree
* mdast node to transform.
* @param {Options | null | undefined} [options]
* Configuration (optional).
* @returns {State}
* `state` function.
*/
export function createState(tree: MdastNodes, options?: Options | null | undefined): State;
/**
* Wrap `nodes` with line endings between each node.
*
* @template {HastRootContent} Type
* Node type.
* @param {Array<Type>} nodes
* List of nodes to wrap.
* @param {boolean | undefined} [loose=false]
* Whether to add line endings at start and end (default: `false`).
* @returns {Array<HastText | Type>}
* Wrapped nodes.
*/
export function wrap<Type extends HastRootContent>(nodes: Array<Type>, loose?: boolean | undefined): Array<HastText | Type>;
export type HastElement = import("hast").Element;
export type HastElementContent = import("hast").ElementContent;
export type HastNodes = import("hast").Nodes;
export type HastProperties = import("hast").Properties;
export type HastRootContent = import("hast").RootContent;
export type HastText = import("hast").Text;
export type MdastDefinition = import("mdast").Definition;
export type MdastFootnoteDefinition = import("mdast").FootnoteDefinition;
export type MdastNodes = import("mdast").Nodes;
export type MdastParents = import("mdast").Parents;
export type VFile = import("vfile").VFile;
export type FootnoteBackContentTemplate = import("./footer.js").FootnoteBackContentTemplate;
export type FootnoteBackLabelTemplate = import("./footer.js").FootnoteBackLabelTemplate;
/**
* Handle a node.
*/
export type Handler = (state: State, node: any, parent: MdastParents | undefined) => Array<HastElementContent> | HastElementContent | undefined;
/**
* Handle nodes.
*/
export type Handlers = Partial<Record<MdastNodes["type"], Handler>>;
/**
* Configuration (optional).
*/
export type Options = {
/**
* Whether to persist raw HTML in markdown in the hast tree (default:
* `false`).
*/
allowDangerousHtml?: boolean | null | undefined;
/**
* Prefix to use before the `id` property on footnotes to prevent them from
* *clobbering* (default: `'user-content-'`).
*
* Pass `''` for trusted markdown and when you are careful with
* polyfilling.
* You could pass a different prefix.
*
* DOM clobbering is this:
*
* ```html
* <p id="x"></p>
* <script>alert(x) // `x` now refers to the `p#x` DOM element</script>
* ```
*
* The above example shows that elements are made available by browsers, by
* their ID, on the `window` object.
* This is a security risk because you might be expecting some other variable
* at that place.
* It can also break polyfills.
* Using a prefix solves these problems.
*/
clobberPrefix?: string | null | undefined;
/**
* Corresponding virtual file representing the input document (optional).
*/
file?: VFile | null | undefined;
/**
* Content of the backreference back to references (default: `defaultFootnoteBackContent`).
*
* The default value is:
*
* ```js
* function defaultFootnoteBackContent(_, rereferenceIndex) {
* const result = [{type: 'text', value: '↩'}]
*
* if (rereferenceIndex > 1) {
* result.push({
* type: 'element',
* tagName: 'sup',
* properties: {},
* children: [{type: 'text', value: String(rereferenceIndex)}]
* })
* }
*
* return result
* }
* ```
*
* This content is used in the `a` element of each backreference (the `↩`
* links).
*/
footnoteBackContent?: FootnoteBackContentTemplate | string | null | undefined;
/**
* Label to describe the backreference back to references (default:
* `defaultFootnoteBackLabel`).
*
* The default value is:
*
* ```js
* function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {
* return (
* 'Back to reference ' +
* (referenceIndex + 1) +
* (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')
* )
* }
* ```
*
* Change it when the markdown is not in English.
*
* This label is used in the `ariaLabel` property on each backreference
* (the `↩` links).
* It affects users of assistive technology.
*/
footnoteBackLabel?: FootnoteBackLabelTemplate | string | null | undefined;
/**
* Textual label to use for the footnotes section (default: `'Footnotes'`).
*
* Change it when the markdown is not in English.
*
* This label is typically hidden visually (assuming a `sr-only` CSS class
* is defined that does that) and so affects screen readers only.
* If you do have such a class, but want to show this section to everyone,
* pass different properties with the `footnoteLabelProperties` option.
*/
footnoteLabel?: string | null | undefined;
/**
* Properties to use on the footnote label (default: `{className:
* ['sr-only']}`).
*
* Change it to show the label and add other properties.
*
* This label is typically hidden visually (assuming an `sr-only` CSS class
* is defined that does that) and so affects screen readers only.
* If you do have such a class, but want to show this section to everyone,
* pass an empty string.
* You can also add different properties.
*
* > **Note**: `id: 'footnote-label'` is always added, because footnote
* > calls use it with `aria-describedby` to provide an accessible label.
*/
footnoteLabelProperties?: HastProperties | null | undefined;
/**
* HTML tag name to use for the footnote label element (default: `'h2'`).
*
* Change it to match your document structure.
*
* This label is typically hidden visually (assuming a `sr-only` CSS class
* is defined that does that) and so affects screen readers only.
* If you do have such a class, but want to show this section to everyone,
* pass different properties with the `footnoteLabelProperties` option.
*/
footnoteLabelTagName?: string | null | undefined;
/**
* Extra handlers for nodes (optional).
*/
handlers?: Handlers | null | undefined;
/**
* List of custom mdast node types to pass through (keep) in hast (note that
* the node itself is passed, but eventual children are transformed)
* (optional).
*/
passThrough?: Array<MdastNodes["type"]> | null | undefined;
/**
* Handler for all unknown nodes (optional).
*/
unknownHandler?: Handler | null | undefined;
};
/**
* Info passed around.
*/
export type State = {
/**
* Transform the children of an mdast parent to hast.
*/
all: (node: MdastNodes) => Array<HastElementContent>;
/**
* Honor the `data` of `from`, and generate an element instead of `node`.
*/
applyData: <Type extends HastNodes>(from: MdastNodes, to: Type) => HastElement | Type;
/**
* Definitions by their identifier.
*/
definitionById: Map<string, MdastDefinition>;
/**
* Footnote definitions by their identifier.
*/
footnoteById: Map<string, MdastFootnoteDefinition>;
/**
* Counts for how often the same footnote was called.
*/
footnoteCounts: Map<string, number>;
/**
* Identifiers of order when footnote calls first appear in tree order.
*/
footnoteOrder: Array<string>;
/**
* Applied handlers.
*/
handlers: Handlers;
/**
* Transform an mdast node to hast.
*/
one: (node: MdastNodes, parent: MdastParents | undefined) => Array<HastElementContent> | HastElementContent | undefined;
/**
* Configuration.
*/
options: Options;
/**
* Copy a node’s positional info.
*/
patch: (from: MdastNodes, node: HastNodes) => undefined;
/**
* Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.
*/
wrap: <Type extends HastRootContent>(nodes: Array<Type>, loose?: boolean | undefined) => Array<HastText | Type>;
};
@@ -0,0 +1,7 @@
'use strict'
const SemVer = require('../classes/semver')
const compare = (a, b, loose) =>
new SemVer(a, loose).compare(new SemVer(b, loose))
module.exports = compare
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.js';
import 'react';
declare const ChevronLeftIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { ChevronLeftIcon };
@@ -0,0 +1 @@
{"version":3,"file":"no-unused-prop-types.d.ts","sourceRoot":"","sources":["no-unused-prop-types.js"],"names":[],"mappings":"wBAiCW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AA6BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,2BAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;QACR,IAAI,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/@react-aria/listbox/src/useListBoxSection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '@react-aria/utils';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Techincally, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation'\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.main.js.map"}
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TargetNames = void 0;
const TargetNames = exports.TargetNames = {
node: "node",
deno: "deno",
chrome: "chrome",
opera: "opera",
edge: "edge",
firefox: "firefox",
safari: "safari",
ie: "ie",
ios: "ios",
android: "android",
electron: "electron",
samsung: "samsung",
rhino: "rhino",
opera_mobile: "opera_mobile"
};
//# sourceMappingURL=options.js.map
@@ -0,0 +1,30 @@
{
"name": "globrex",
"version": "0.1.2",
"description": "Glob to regular expression with support for extended globs",
"main": "index.js",
"author": "Terkel Gjervig",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/terkelg/globrex"
},
"files": [
"index.js"
],
"keywords": [
"glob",
"regex",
"regexp",
"parser",
"glob2regx",
"compiler"
],
"scripts": {
"test": "tape test/*.js | tap-spec"
},
"devDependencies": {
"tap-spec": "^4.1.1",
"tape": "^4.8.0"
}
}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=isNoAncestorBindingConstraints.spec.d.ts.map
@@ -0,0 +1,157 @@
/**
* @fileoverview HTML special characters should be escaped.
* @author Patrick Hayes
*/
'use strict';
const docsUrl = require('../util/docsUrl');
const getSourceCode = require('../util/eslint').getSourceCode;
const jsxUtil = require('../util/jsx');
const report = require('../util/report');
const getMessageData = require('../util/message');
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
// NOTE: '<' and '{' are also problematic characters, but they do not need
// to be included here because it is a syntax error when these characters are
// included accidentally.
const DEFAULTS = [{
char: '>',
alternatives: ['&gt;'],
}, {
char: '"',
alternatives: ['&quot;', '&ldquo;', '&#34;', '&rdquo;'],
}, {
char: '\'',
alternatives: ['&apos;', '&lsquo;', '&#39;', '&rsquo;'],
}, {
char: '}',
alternatives: ['&#125;'],
}];
const messages = {
unescapedEntity: 'HTML entity, `{{entity}}` , must be escaped.',
unescapedEntityAlts: '`{{entity}}` can be escaped with {{alts}}.',
replaceWithAlt: 'Replace with `{{alt}}`.',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
hasSuggestions: true,
docs: {
description: 'Disallow unescaped HTML entities from appearing in markup',
category: 'Possible Errors',
recommended: true,
url: docsUrl('no-unescaped-entities'),
},
messages,
schema: [{
type: 'object',
properties: {
forbid: {
type: 'array',
items: {
anyOf: [{
type: 'string',
}, {
type: 'object',
properties: {
char: {
type: 'string',
},
alternatives: {
type: 'array',
uniqueItems: true,
items: {
type: 'string',
},
},
},
}],
},
},
},
additionalProperties: false,
}],
},
create(context) {
function reportInvalidEntity(node) {
const configuration = context.options[0] || {};
const entities = configuration.forbid || DEFAULTS;
// HTML entities are already escaped in node.value (as well as node.raw),
// so pull the raw text from getSourceCode(context)
for (let i = node.loc.start.line; i <= node.loc.end.line; i++) {
let rawLine = getSourceCode(context).lines[i - 1];
let start = 0;
let end = rawLine.length;
if (i === node.loc.start.line) {
start = node.loc.start.column;
}
if (i === node.loc.end.line) {
end = node.loc.end.column;
}
rawLine = rawLine.slice(start, end);
for (let j = 0; j < entities.length; j++) {
for (let index = 0; index < rawLine.length; index++) {
const c = rawLine[index];
if (typeof entities[j] === 'string') {
if (c === entities[j]) {
report(context, messages.unescapedEntity, 'unescapedEntity', {
node,
loc: { line: i, column: start + index },
data: {
entity: entities[j],
},
});
}
} else if (c === entities[j].char) {
report(context, messages.unescapedEntityAlts, 'unescapedEntityAlts', {
node,
loc: { line: i, column: start + index },
data: {
entity: entities[j].char,
alts: entities[j].alternatives.map((alt) => `\`${alt}\``).join(', '),
},
suggest: entities[j].alternatives.map((alt) => Object.assign(
getMessageData('replaceWithAlt', messages.replaceWithAlt),
{
data: { alt },
fix(fixer) {
const lineToChange = i - node.loc.start.line;
const newText = node.raw.split('\n').map((line, idx) => {
if (idx === lineToChange) {
return line.slice(0, index) + alt + line.slice(index + 1);
}
return line;
}).join('\n');
return fixer.replaceText(node, newText);
},
}
)),
});
}
}
}
}
}
return {
'Literal, JSXText'(node) {
if (jsxUtil.isJSX(node.parent)) {
reportInvalidEntity(node);
}
},
};
},
};
@@ -0,0 +1,37 @@
import baseCreate from './_baseCreate.js';
import isObject from './isObject.js';
/**
* Creates a function that produces an instance of `Ctor` regardless of
* whether it was invoked as part of a `new` expression or by `call` or `apply`.
*
* @private
* @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function.
*/
function createCtor(Ctor) {
return function() {
// Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
case 0: return new Ctor;
case 1: return new Ctor(args[0]);
case 2: return new Ctor(args[0], args[1]);
case 3: return new Ctor(args[0], args[1], args[2]);
case 4: return new Ctor(args[0], args[1], args[2], args[3]);
case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args);
// Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
return isObject(result) ? result : thisBinding;
};
}
export default createCtor;
@@ -0,0 +1,15 @@
declare namespace getSideChannelMap {
type Channel<K, V> = {
assert: (key: K) => void;
has: (key: K) => boolean;
get: (key: K) => V | undefined;
set: (key: K, value: V) => void;
delete: (key: K) => boolean;
};
}
declare function getSideChannelMap<K, V>(): getSideChannelMap.Channel<K, V>;
declare const x: false | typeof getSideChannelMap;
export = x;
@@ -0,0 +1,41 @@
var UnprotectedAttributes_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
import { CMSVersion } from "./types";
import { Attribute } from "./attribute";
import { RecipientInfos } from "./recipient_infos";
import { OriginatorInfo } from "./originator_info";
import { EncryptedContentInfo } from "./encrypted_content_info";
let UnprotectedAttributes = UnprotectedAttributes_1 = class UnprotectedAttributes extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, UnprotectedAttributes_1.prototype);
}
};
UnprotectedAttributes = UnprotectedAttributes_1 = __decorate([
AsnType({ type: AsnTypeTypes.Set, itemType: Attribute })
], UnprotectedAttributes);
export { UnprotectedAttributes };
export class EnvelopedData {
constructor(params = {}) {
this.version = CMSVersion.v0;
this.recipientInfos = new RecipientInfos();
this.encryptedContentInfo = new EncryptedContentInfo();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], EnvelopedData.prototype, "version", void 0);
__decorate([
AsnProp({ type: OriginatorInfo, context: 0, implicit: true, optional: true })
], EnvelopedData.prototype, "originatorInfo", void 0);
__decorate([
AsnProp({ type: RecipientInfos })
], EnvelopedData.prototype, "recipientInfos", void 0);
__decorate([
AsnProp({ type: EncryptedContentInfo })
], EnvelopedData.prototype, "encryptedContentInfo", void 0);
__decorate([
AsnProp({ type: UnprotectedAttributes, context: 1, implicit: true, optional: true })
], EnvelopedData.prototype, "unprotectedAttrs", void 0);
@@ -0,0 +1,821 @@
export default `flf2a$ 8 6 14 1 3
puffy.flf by Juan Car (jc@juguete.quim.ucm.es)
Version 1.1 5/Mar/1994
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@@
_ @
( )@
| |@
| |@
| |@
(_)@
(_)@
@@
$ _ _ $@
$( )( )$@
$(_)(_)$@
$ $@
$ $@
$ $@
$ $@
$ $@@
@
_ _ @
_( )( )_ @
(_ .. _)@
(_ _)@
(_)(_) @
@
@@
( ) @
/'_ \\ @
( (_(_)@
\\__ \\ @
( )_) )@
\`\\_ _/'@
(_) @
@@
_ _ @
(_) /' )@
/' /' @
/' /' @
/' /' _ @
(_/' (_)@
@
@@
_____ @
( _ ) @
\`\\ ,/' @
/'_\`\\/\\ @
| (_> ,<\`@
\`\\___/\\/'@
@
@@
$_$@
( )@
|/$@
$ $@
$ $@
$ $@
$ $@
$ $@@
_ @
/' )@
| ,/'@
| | @
| \`\\ @
\`\\__)@
@
@@
_ @
( \`\\ @
\`\\ |@
| |@
/' |@
(__/'@
@
@@
_ @
_( )_ @
( \` ' )@
> < @
(_, ,_)@
(_) @
@
@@
_ @
( ) @
__| |__ @
(__ __)@
| | @
(_) @
@
@@
$ $@
$ $@
$ $@
$ $@
$_$@
( )@
|/$@
$ $@@
@
@
______ @
(______)@
@
@
@
@@
$ $@
$ $@
$ $@
$ $@
$_$@
(_)@
$ $@
$ $@@
__ @
/ )@
/' /' @
/' /' @
/' /' @
(_/' @
@
@@
__ @
/' _\`\\ @
| ( ) |@
| | | |@
| (_) |@
\`\\___/'@
@
@@
_ @
/' )@
(_, |@
| |@
| |@
(_)@
@
@@
__ @
/'__\`\\ @
(_) ) )@
/' / @
/' /( )@
(_____/'@
@
@@
___ @
/'_ )@
(_)_) |@
_(_ < @
( )_) |@
\`\\____)@
@
@@
_ _ @
( )( ) @
| || | @
| || |_ @
(__ ,__)@
(_) @
@
@@
_____ @
( ___)@
| (__ @
|___ \`\\@
( )_) |@
\`\\___/'@
@
@@
_____ @
( ___)@
| (__ @
| _ \`\\@
| (_) |@
\`\\___/'@
@
@@
_______ @
(_____ )@
/'/'@
/'/' @
/'/' @
(_/ @
@
@@
_ @
/'_\`\\ @
( (_) )@
> _ <'@
( (_) )@
\`\\___/'@
@
@@
__ @
/'_ \`\\@
( (_) |@
\\__, |@
| |@
(_)@
@
@@
$ $@
$ $@
$_$@
(_)@
$_$@
(_)@
$ $@
$ $@@
$ $@
$ $@
$_$@
(_)@
$_$@
( )@
|/$@
$ $@@
_ @
/' )@
/' /' @
< < @
\\ \`\\ @
\`\\__)@
@
@@
@
@
______ @
(______)@
(______)@
@
@
@@
_ @
( \`\\ @
\`\\ \`\\ @
> >@
/' /' @
(_/' @
@
@@
_ @
/'_\`\\ @
(_) ) |@
/'/'@
|_| @
(_) @
@
@@
@
_ @
/'_\`\\ @
/'/'_\` ) @
( ( (_| | @
\\ \`\\__,_)@
\`\\_____)@
@@
_____ @
( _ )@
| (_) |@
| _ |@
| | | |@
(_) (_)@
@
@@
___ @
( _\`\\ @
| (_) )@
| _ <'@
| (_) )@
(____/'@
@
@@
___ @
( _\`\\ @
| ( (_)@
| | _ @
| (_( )@
(____/'@
@
@@
___ @
( _\`\\ @
| | ) |@
| | | )@
| |_) |@
(____/'@
@
@@
___ @
( _\`\\ @
| (_(_)@
| _)_ @
| (_( )@
(____/'@
@
@@
___ @
( _\`\\ @
| (_(_)@
| _) @
| | @
(_) @
@
@@
___ @
( _\`\\ @
| ( (_)@
| |___ @
| (_, )@
(____/'@
@
@@
_ _ @
( ) ( )@
| |_| |@
| _ |@
| | | |@
(_) (_)@
@
@@
_ @
(_)@
| |@
| |@
| |@
(_)@
@
@@
_____ @
(___ )@
| |@
_ | |@
( )_| |@
\`\\___/'@
@
@@
_ _ @
( ) ( )@
| |/'/'@
| , < @
| |\\\`\\ @
(_) (_)@
@
@@
_ @
( ) @
| | @
| | _ @
| |_( )@
(____/'@
@
@@
@
/'\\_/\`\\@
| |@
| (_) |@
| | | |@
(_) (_)@
@
@@
_ _ @
( ) ( )@
| \`\\| |@
| , \` |@
| |\`\\ |@
(_) (_)@
@
@@
_____ @
( _ )@
| ( ) |@
| | | |@
| (_) |@
(_____)@
@
@@
___ @
( _\`\\ @
| |_) )@
| ,__/'@
| | @
(_) @
@
@@
_____ @
( _ )@
| ( ) |@
| | | |@
| (('\\|@
(___\\_)@
@
@@
___ @
| _\`\\ @
| (_) )@
| , / @
| |\\ \\ @
(_) (_)@
@
@@
___ @
( _\`\\ @
| (_(_)@
\`\\__ \\ @
( )_) |@
\`\\____)@
@
@@
_____ @
(_ _)@
| | @
| | @
| | @
(_) @
@
@@
_ _ @
( ) ( )@
| | | |@
| | | |@
| (_) |@
(_____)@
@
@@
_ _ @
( ) ( )@
| | | |@
| | | |@
| \\_/ |@
\`\\___/'@
@
@@
_ _ @
( ) _ ( )@
| | ( ) | |@
| | | | | |@
| (_/ \\_) |@
\`\\___x___/'@
@
@@
_ _ @
( ) ( )@
\`\\\`\\/'/'@
> < @
/'/\\\`\\ @
(_) (_)@
@
@@
_ _ @
( ) ( )@
\`\\\`\\_/'/'@
\`\\ /' @
| | @
(_) @
@
@@
_______ @
(_____ )@
/'/'@
/'/' @
/'/'___ @
(_______)@
@
@@
___ @
( _)@
| | @
| | @
| |_ @
(___)@
@
@@
_ @
( \`\\ @
\`\\ \`\\ @
\`\\ \`\\ @
\`\\ \`\\ @
\`\\_)@
@
@@
___ @
(_ )@
| |@
| |@
_| |@
(___)@
@
@@
$ __ $@
$/ \\$@
(_/\\_)@
$ $@
$ $@
$ $@
$ $@
$ $@@
$ $ @
$ $ @
$ $ @
$ $ @
$ $ @
$ $ @
______ @
(______)@@
$_$@
( )@
$\\|@
$ $@
$ $@
$ $@
$ $@
$ $@@
@
@
_ _ @
/'_\` )@
( (_| |@
\`\\__,_)@
@
@@
_ @
( ) @
| |_ @
| '_\`\\ @
| |_) )@
(_,__/'@
@
@@
@
@
___ @
/'___)@
( (___ @
\`\\____)@
@
@@
_ @
( )@
_| |@
/'_\` |@
( (_| |@
\`\\__,_)@
@
@@
@
@
__ @
/'__\`\\@
( ___/@
\`\\____)@
@
@@
___ @
/'___)@
| (__ @
| ,__) @
| | @
(_) @
@
@@
@
@
__ @
/'_ \`\\@
( (_) |@
\`\\__ |@
( )_) |@
\\___/'@@
_ @
( ) @
| |__ @
| _ \`\\@
| | | |@
(_) (_)@
@
@@
@
_ @
(_)@
| |@
| |@
(_)@
@
@@
@
_ @
(_)@
| |@
| |@
_ | |@
( )_| |@
\`\\___/'@@
_ @
( ) @
| |/') @
| , < @
| |\\\`\\ @
(_) (_)@
@
@@
_ @
(_ ) @
| | @
| | @
| | @
(___)@
@
@@
@
@
___ ___ @
/' _ \` _ \`\\@
| ( ) ( ) |@
(_) (_) (_)@
@
@@
@
@
___ @
/' _ \`\\@
| ( ) |@
(_) (_)@
@
@@
@
@
_ @
/'_\`\\ @
( (_) )@
\`\\___/'@
@
@@
@
@
_ _ @
( '_\`\\ @
| (_) )@
| ,__/'@
| | @
(_) @@
@
@
_ _ @
/'_\` )@
( (_) |@
\`\\__, |@
| |@
(_)@@
@
@
_ __ @
( '__)@
| | @
(_) @
@
@@
@
@
___ @
/',__)@
\\__, \\@
(____/@
@
@@
_ @
( )_ @
| ,_)@
| | @
| |_ @
\`\\__)@
@
@@
@
@
_ _ @
( ) ( )@
| (_) |@
\`\\___/'@
@
@@
@
@
_ _ @
( ) ( )@
| \\_/ |@
\`\\___/'@
@
@@
@
@
_ _ _ @
( ) ( ) ( )@
| \\_/ \\_/ |@
\`\\___x___/'@
@
@@
@
@
@
(\`\\/')@
> < @
(_/\\_)@
@
@@
@
@
_ _ @
( ) ( )@
| (_) |@
\`\\__, |@
( )_| |@
\`\\___/'@@
@
@
____ @
(_ ,)@
/'/_ @
(____)@
@
@@
_ @
/' )@
| ,/'@
<' | @
| \`\\ @
\`\\__)@
@
@@
@
_ @
( )@
| |@
| |@
| |@
(_)@
@@
_ @
( \`\\ @
\`\\ | @
| \`>@
/' | @
(__/' @
@
@@
_ _ @
/' \\/' )@
(_/\\__/' @
@
@
@
@
@@
(_)_(_)@
( _ )@
| (_) |@
| _ |@
| | | |@
(_) (_)@
@
@@
(_)_(_)@
( _ )@
| ( ) |@
| | | |@
| (_) |@
(_____)@
@
@@
(_) (_)@
( ) ( )@
| | | |@
| | | |@
| (_) |@
(_____)@
@
@@
_ _ @
(_) (_)@
_ _ @
/'_\` )@
( (_| |@
\`\\__,_)@
@
@@
_ _ @
(_) (_)@
_ @
/'_\`\\ @
( (_) )@
\`\\___/'@
@
@@
_ _ @
(_) (_)@
_ _ @
( ) ( )@
| (_) |@
\`\\___/'@
@
@@
@
@
_____ @
( _ )@
| |/ /'@
| |\\\`\\ @
| ||_/'@
(_) @@
`
@@ -0,0 +1 @@
{"version":3,"file":"deepEqual.d.ts","sourceRoot":"","sources":["../../src/utils/deepEqual.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,iBAAiB,mBAAgB,WA8ClC"}
@@ -0,0 +1,30 @@
export type QQPackageInfoType = {
version: string;
buildVersion: string;
platform: string;
eleArch: string;
};
export type QQVersionConfigType = {
baseVersion: string;
curVersion: string;
prevVersion: string;
onErrorVersions: Array<unknown>;
buildId: string;
};
export type QQAppidTableType = {
[key: string]: {
appid: string;
qua: string;
};
};
export interface Peer {
chatType: number;
peerUid: string;
guildId?: string;
}
export interface QQLevel {
crownNum: number;
sunNum: number;
moonNum: number;
starNum: number;
}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAgCM,SAAS,0CAAwB,KAAoC,EAAE,KAAoB,EAAE,GAAuC;QAoBpH,uBACD;IApBpB,IAAI,QAAC,IAAI,EAAC,GAAG;IACb,IAAI,gBAAgB,KAAK,KAAK,CAAC,aAAa;IAC5C,4EAA4E;IAC5E,IAAI,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,gCAAU,EAAE;QAAC,GAAG,KAAK;QAAE,WAAW;IAAO,GAAG,OAAO;IAEzE,IAAI,0BAA0B,KAAK,KAAK,CAAC,eAAe,IAAI,MAAM,gBAAgB,CAAC,aAAa,KAAK;IAErG,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;QAC1B,YAAY,CAAC,iBAAiB;QAC9B;YACE,MAAM,IAAI,CAAC,KAAK,GAAG;QACrB;aACA;IACF;IAEA,qFAAqF;IACrF,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE,CAAC,GAAG;IAExC,IAAI,WAAmD;IACvD,IAAI,iBAAiB,EAAA,wBAAA,MAAM,cAAc,cAApB,4CAAA,sBAAsB,MAAM,MAAK,KAAK,GAAG;IAC9D,IAAI,iBAAgB,yBAAA,MAAM,cAAc,cAApB,6CAAA,uBAAsB,SAAS;IACnD,8CAA8C;IAC9C,IAAI,KAAK,KAAK,CAAC,aAAa,IAAI,CAAC,CAAA,GAAA,+BAAQ,KACvC,WAAW,iBAAiB,gBAAgB;IAG9C,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI;IACJ,IAAI,eAAe;QACjB,kBAAkB,GAAG,gBAAgB,MAAM,CAAC,aAAa;QACzD,wGAAwG;QACxG,IAAI,kBAAkB,iBAAiB,CAAA,GAAA,+BAAQ,KAC7C,kBAAkB,GAAG,gBAAgB,EAAE,EAAE,gBAAgB,MAAM,CAAC,gBAAgB;IAEpF;IAEA,IAAI,mBAAmB,CAAA,GAAA,oCAAa,EAAE;IAEtC,IAAI,qBAAqB,MAAM,UAAU,CAAC,IAAI,KAAK;IACnD,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,sBAAsB,MAAM,gBAAgB,CAAC,UAAU,KAAK,KAAK,GAAG,EACtE,MAAM,gBAAgB,CAAC,aAAa,CAAC;IAEzC,GAAG;QAAC;QAAoB,MAAM,gBAAgB;QAAE,KAAK,GAAG;KAAC;IAEzD,OAAO;QACL,mBAAmB;YACjB,GAAG,CAAA,GAAA,gCAAS,EACV,gBACA,eACA,YACA,kBACA,4DAA4D;YAC5D,qBAAqB;gBAAC,UAAU;YAAE,IAAI,KACvC;YACD,MAAM;YACN,IAAI,CAAA,GAAA,2CAAgB,EAAE,OAAO,KAAK,GAAG;YACrC,gBAAgB,KAAK,OAAO,IAAI,KAAK,OAAO,GAAG,IAAI,KAAK,OAAO,GAAG;YAClE,aAAa;QACf;IACF;AACF","sources":["packages/@react-aria/table/src/useTableColumnHeader.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {getColumnHeaderId} from './utils';\nimport {GridNode} from '@react-types/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {isAndroid, mergeProps, useDescription} from '@react-aria/utils';\nimport {TableState} from '@react-stately/table';\nimport {useEffect} from 'react';\nimport {useFocusable, usePress} from '@react-aria/interactions';\nimport {useGridCell} from '@react-aria/grid';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaTableColumnHeaderProps<T> {\n /** An object representing the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader). Contains all the relevant information that makes up the column header. */\n node: GridNode<T>,\n /** Whether the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) is contained in a virtual scroller. */\n isVirtualized?: boolean\n}\n\nexport interface TableColumnHeaderAria {\n /** Props for the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) element. */\n columnHeaderProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a column header in a table.\n * @param props - Props for the column header.\n * @param state - State of the table, as returned by `useTableState`.\n * @param ref - The ref attached to the column header element.\n */\nexport function useTableColumnHeader<T>(props: AriaTableColumnHeaderProps<T>, state: TableState<T>, ref: RefObject<FocusableElement | null>): TableColumnHeaderAria {\n let {node} = props;\n let allowsSorting = node.props.allowsSorting;\n // if there are no focusable children, the column header will focus the cell\n let {gridCellProps} = useGridCell({...props, focusMode: 'child'}, state, ref);\n\n let isSelectionCellDisabled = node.props.isSelectionCell && state.selectionManager.selectionMode === 'single';\n\n let {pressProps} = usePress({\n isDisabled: !allowsSorting || isSelectionCellDisabled,\n onPress() {\n state.sort(node.key);\n },\n ref\n });\n\n // Needed to pick up the focusable context, enabling things like Tooltips for example\n let {focusableProps} = useFocusable({}, ref);\n\n let ariaSort: DOMAttributes['aria-sort'] | undefined = undefined;\n let isSortedColumn = state.sortDescriptor?.column === node.key;\n let sortDirection = state.sortDescriptor?.direction;\n // aria-sort not supported in Android Talkback\n if (node.props.allowsSorting && !isAndroid()) {\n ariaSort = isSortedColumn ? sortDirection : 'none';\n }\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/tablLine truncated
@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AttributeCertificateInfo = exports.AttCertVersion = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_x509_1 = require("@peculiar/asn1-x509");
const holder_1 = require("./holder");
const attr_cert_issuer_1 = require("./attr_cert_issuer");
const attr_cert_validity_period_1 = require("./attr_cert_validity_period");
var AttCertVersion;
(function (AttCertVersion) {
AttCertVersion[AttCertVersion["v2"] = 1] = "v2";
})(AttCertVersion || (exports.AttCertVersion = AttCertVersion = {}));
class AttributeCertificateInfo {
constructor(params = {}) {
this.version = AttCertVersion.v2;
this.holder = new holder_1.Holder();
this.issuer = new attr_cert_issuer_1.AttCertIssuer();
this.signature = new asn1_x509_1.AlgorithmIdentifier();
this.serialNumber = new ArrayBuffer(0);
this.attrCertValidityPeriod = new attr_cert_validity_period_1.AttCertValidityPeriod();
this.attributes = [];
Object.assign(this, params);
}
}
exports.AttributeCertificateInfo = AttributeCertificateInfo;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })
], AttributeCertificateInfo.prototype, "version", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: holder_1.Holder })
], AttributeCertificateInfo.prototype, "holder", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: attr_cert_issuer_1.AttCertIssuer })
], AttributeCertificateInfo.prototype, "issuer", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })
], AttributeCertificateInfo.prototype, "signature", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer, converter: asn1_schema_1.AsnIntegerArrayBufferConverter })
], AttributeCertificateInfo.prototype, "serialNumber", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: attr_cert_validity_period_1.AttCertValidityPeriod })
], AttributeCertificateInfo.prototype, "attrCertValidityPeriod", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.Attribute, repeated: "sequence" })
], AttributeCertificateInfo.prototype, "attributes", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString, optional: true })
], AttributeCertificateInfo.prototype, "issuerUniqueID", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.Extensions, optional: true })
], AttributeCertificateInfo.prototype, "extensions", void 0);
@@ -0,0 +1,23 @@
export type AsyncFunction<Args extends any[] = any[], Result = void> = (...args: Args) => Promise<Result>;
/**
* Check if value is an async function
*
* 校验是否为异步函数
*
* @example
* ```js
* import { isAsyncFunction } from 'is-what-type';
*
* isAsyncFunction(async () => { }); // true
* isAsyncFunction(() => { }); // false
* isAsyncFunction(function() { }); // false
* isAsyncFunction(async function() { }); // true
* isAsyncFunction(123); // false
* isAsyncFunction('string'); // false
* isAsyncFunction({}); // false
* ```
*
* @param value - The value to check
* @returns `true` if `value` is an async function, `false` otherwise
*/
export declare function isAsyncFunction<T = AsyncFunction>(value: unknown): value is T;
@@ -0,0 +1,21 @@
const $431fbd86ca7dc216$export$b204af158042fbac = (el)=>{
var _el_ownerDocument;
return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
};
const $431fbd86ca7dc216$export$f21a1ffae260145a = (el)=>{
if (el && 'window' in el && el.window === el) return el;
const doc = $431fbd86ca7dc216$export$b204af158042fbac(el);
return doc.defaultView || window;
};
/**
* Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.
*/ function $431fbd86ca7dc216$var$isNode(value) {
return value !== null && typeof value === 'object' && 'nodeType' in value && typeof value.nodeType === 'number';
}
function $431fbd86ca7dc216$export$af51f0f06c0f328a(node) {
return $431fbd86ca7dc216$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && 'host' in node;
}
export {$431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot};
//# sourceMappingURL=domHelpers.module.js.map
@@ -0,0 +1,24 @@
/**
* @import {CompilePattern} from '../types.js'
*/
/**
* @type {CompilePattern}
*/
export function compilePattern(pattern) {
if (!pattern._compiled) {
const before =
(pattern.atBreak ? '[\\r\\n][\\t ]*' : '') +
(pattern.before ? '(?:' + pattern.before + ')' : '')
pattern._compiled = new RegExp(
(before ? '(' + before + ')' : '') +
(/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? '\\' : '') +
pattern.character +
(pattern.after ? '(?:' + pattern.after + ')' : ''),
'g'
)
}
return pattern._compiled
}
@@ -0,0 +1,15 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"max-lines-per-function": 0,
"new-cap": [2, {
"capIsNewExceptions": [
"HasOwnProperty",
"IsCallable",
],
}],
},
}
@@ -0,0 +1,23 @@
declare module 'emoji-regex' {
function emojiRegex(): RegExp;
export default emojiRegex;
}
declare module 'emoji-regex/text' {
function emojiRegex(): RegExp;
export default emojiRegex;
}
declare module 'emoji-regex/es2015' {
function emojiRegex(): RegExp;
export default emojiRegex;
}
declare module 'emoji-regex/es2015/text' {
function emojiRegex(): RegExp;
export default emojiRegex;
}
@@ -0,0 +1,187 @@
let Browsers = require('./browsers')
let Prefixer = require('./prefixer')
let utils = require('./utils')
class Declaration extends Prefixer {
/**
* Clone and add prefixes for declaration
*/
add(decl, prefix, prefixes, result) {
let prefixed = this.prefixed(decl.prop, prefix)
if (
this.isAlready(decl, prefixed) ||
this.otherPrefixes(decl.value, prefix)
) {
return undefined
}
return this.insert(decl, prefix, prefixes, result)
}
/**
* Calculate indentation to create visual cascade
*/
calcBefore(prefixes, decl, prefix = '') {
let max = this.maxPrefixed(prefixes, decl)
let diff = max - utils.removeNote(prefix).length
let before = decl.raw('before')
if (diff > 0) {
before += Array(diff).fill(' ').join('')
}
return before
}
/**
* Always true, because we already get prefixer by property name
*/
check(/* decl */) {
return true
}
/**
* Clone and insert new declaration
*/
insert(decl, prefix, prefixes) {
let cloned = this.set(this.clone(decl), prefix)
if (!cloned) return undefined
let already = decl.parent.some(
i => i.prop === cloned.prop && i.value === cloned.value
)
if (already) {
return undefined
}
if (this.needCascade(decl)) {
cloned.raws.before = this.calcBefore(prefixes, decl, prefix)
}
return decl.parent.insertBefore(decl, cloned)
}
/**
* Did this declaration has this prefix above
*/
isAlready(decl, prefixed) {
let already = this.all.group(decl).up(i => i.prop === prefixed)
if (!already) {
already = this.all.group(decl).down(i => i.prop === prefixed)
}
return already
}
/**
* Return maximum length of possible prefixed property
*/
maxPrefixed(prefixes, decl) {
if (decl._autoprefixerMax) {
return decl._autoprefixerMax
}
let max = 0
for (let prefix of prefixes) {
prefix = utils.removeNote(prefix)
if (prefix.length > max) {
max = prefix.length
}
}
decl._autoprefixerMax = max
return decl._autoprefixerMax
}
/**
* Should we use visual cascade for prefixes
*/
needCascade(decl) {
if (!decl._autoprefixerCascade) {
decl._autoprefixerCascade =
this.all.options.cascade !== false && decl.raw('before').includes('\n')
}
return decl._autoprefixerCascade
}
/**
* Return unprefixed version of property
*/
normalize(prop) {
return prop
}
/**
* Return list of prefixed properties to clean old prefixes
*/
old(prop, prefix) {
return [this.prefixed(prop, prefix)]
}
/**
* Check `value`, that it contain other prefixes, rather than `prefix`
*/
otherPrefixes(value, prefix) {
for (let other of Browsers.prefixes()) {
if (other === prefix) {
continue
}
if (value.includes(other)) {
return value.replace(/var\([^)]+\)/, '').includes(other)
}
}
return false
}
/**
* Return prefixed version of property
*/
prefixed(prop, prefix) {
return prefix + prop
}
/**
* Add spaces for visual cascade
*/
process(decl, result) {
if (!this.needCascade(decl)) {
super.process(decl, result)
return
}
let prefixes = super.process(decl, result)
if (!prefixes || !prefixes.length) {
return
}
this.restoreBefore(decl)
decl.raws.before = this.calcBefore(prefixes, decl)
}
/**
* Remove visual cascade
*/
restoreBefore(decl) {
let lines = decl.raw('before').split('\n')
let min = lines[lines.length - 1]
this.all.group(decl).up(prefixed => {
let array = prefixed.raw('before').split('\n')
let last = array[array.length - 1]
if (last.length < min.length) {
min = last
}
})
lines[lines.length - 1] = min
decl.raws.before = lines.join('\n')
}
/**
* Set prefix to declaration
*/
set(decl, prefix) {
decl.prop = this.prefixed(decl.prop, prefix)
return decl
}
}
module.exports = Declaration
@@ -0,0 +1 @@
export declare function isHTMLElement(node: Node | Window): node is HTMLElement;
@@ -0,0 +1,237 @@
import {isMac as $28AnR$isMac, isVirtualClick as $28AnR$isVirtualClick, getOwnerWindow as $28AnR$getOwnerWindow, getOwnerDocument as $28AnR$getOwnerDocument} from "@react-aria/utils";
import {useState as $28AnR$useState, useEffect as $28AnR$useEffect} from "react";
import {useIsSSR as $28AnR$useIsSSR} from "@react-aria/ssr";
/*
* 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.
*/ // Portions of the code in this file are based on code from react.
// Original licensing for the following can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
let $507fabe10e71c6fb$var$currentModality = null;
let $507fabe10e71c6fb$var$changeHandlers = new Set();
let $507fabe10e71c6fb$export$d90243b58daecda7 = new Map(); // We use a map here to support setting event listeners across multiple document objects.
let $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
let $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
// Only Tab or Esc keys will make focus visible on text input elements
const $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
Tab: true,
Escape: true
};
function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
for (let handler of $507fabe10e71c6fb$var$changeHandlers)handler(modality, e);
}
/**
* Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus styles visible.
*/ function $507fabe10e71c6fb$var$isValidKey(e) {
// Control and Shift keys trigger when navigating back to the tab with keyboard.
return !(e.metaKey || !(0, $28AnR$isMac)() && e.altKey || e.ctrlKey || e.key === 'Control' || e.key === 'Shift' || e.key === 'Meta');
}
function $507fabe10e71c6fb$var$handleKeyboardEvent(e) {
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
if ($507fabe10e71c6fb$var$isValidKey(e)) {
$507fabe10e71c6fb$var$currentModality = 'keyboard';
$507fabe10e71c6fb$var$triggerChangeHandlers('keyboard', e);
}
}
function $507fabe10e71c6fb$var$handlePointerEvent(e) {
$507fabe10e71c6fb$var$currentModality = 'pointer';
if (e.type === 'mousedown' || e.type === 'pointerdown') {
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
$507fabe10e71c6fb$var$triggerChangeHandlers('pointer', e);
}
}
function $507fabe10e71c6fb$var$handleClickEvent(e) {
if ((0, $28AnR$isVirtualClick)(e)) {
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
$507fabe10e71c6fb$var$currentModality = 'virtual';
}
}
function $507fabe10e71c6fb$var$handleFocusEvent(e) {
// Firefox fires two extra focus events when the user first clicks into an iframe:
// first on the window, then on the document. We ignore these events so they don't
// cause keyboard focus rings to appear.
if (e.target === window || e.target === document) return;
// If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.
// This occurs, for example, when navigating a form with the next/previous buttons on iOS.
if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
$507fabe10e71c6fb$var$currentModality = 'virtual';
$507fabe10e71c6fb$var$triggerChangeHandlers('virtual', e);
}
$507fabe10e71c6fb$var$hasEventBeforeFocus = false;
$507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
}
function $507fabe10e71c6fb$var$handleWindowBlur() {
// When the window is blurred, reset state. This is necessary when tabbing out of the window,
// for example, since a subsequent focus event won't be fired.
$507fabe10e71c6fb$var$hasEventBeforeFocus = false;
$507fabe10e71c6fb$var$hasBlurredWindowRecently = true;
}
/**
* Setup global event listeners to control when keyboard focus style should be visible.
*/ function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) {
if (typeof window === 'undefined' || $507fabe10e71c6fb$export$d90243b58daecda7.get((0, $28AnR$getOwnerWindow)(element))) return;
const windowObject = (0, $28AnR$getOwnerWindow)(element);
const documentObject = (0, $28AnR$getOwnerDocument)(element);
// Programmatic focus() calls shouldn't affect the current input modality.
// However, we need to detect other cases when a focus event occurs without
// a preceding user event (e.g. screen reader focus). Overriding the focus
// method on HTMLElement.prototype is a bit hacky, but works.
let focus = windowObject.HTMLElement.prototype.focus;
windowObject.HTMLElement.prototype.focus = function() {
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
focus.apply(this, arguments);
};
documentObject.addEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
documentObject.addEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
documentObject.addEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
// Register focus events on the window so they are sure to happen
// before React's event listeners (registered on the document).
windowObject.addEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
windowObject.addEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
if (typeof PointerEvent !== 'undefined') {
documentObject.addEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.addEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.addEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
} else {
documentObject.addEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.addEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.addEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
}
// Add unmount handler
windowObject.addEventListener('beforeunload', ()=>{
$507fabe10e71c6fb$var$tearDownWindowFocusTracking(element);
}, {
once: true
});
$507fabe10e71c6fb$export$d90243b58daecda7.set(windowObject, {
focus: focus
});
}
const $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener)=>{
const windowObject = (0, $28AnR$getOwnerWindow)(element);
const documentObject = (0, $28AnR$getOwnerDocument)(element);
if (loadListener) documentObject.removeEventListener('DOMContentLoaded', loadListener);
if (!$507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject)) return;
windowObject.HTMLElement.prototype.focus = $507fabe10e71c6fb$export$d90243b58daecda7.get(windowObject).focus;
documentObject.removeEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
documentObject.removeEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
documentObject.removeEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
windowObject.removeEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
windowObject.removeEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
if (typeof PointerEvent !== 'undefined') {
documentObject.removeEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.removeEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.removeEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
} else {
documentObject.removeEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.removeEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.removeEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
}
$507fabe10e71c6fb$export$d90243b58daecda7.delete(windowObject);
};
function $507fabe10e71c6fb$export$2f1888112f558a7d(element) {
const documentObject = (0, $28AnR$getOwnerDocument)(element);
let loadListener;
if (documentObject.readyState !== 'loading') $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
else {
loadListener = ()=>{
$507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
};
documentObject.addEventListener('DOMContentLoaded', loadListener);
}
return ()=>$507fabe10e71c6fb$var$tearDownWindowFocusTracking(element, loadListener);
}
// Server-side rendering does not have the document object defined
// eslint-disable-next-line no-restricted-globals
if (typeof document !== 'undefined') $507fabe10e71c6fb$export$2f1888112f558a7d();
function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
return $507fabe10e71c6fb$var$currentModality !== 'pointer';
}
function $507fabe10e71c6fb$export$630ff653c5ada6a9() {
return $507fabe10e71c6fb$var$currentModality;
}
function $507fabe10e71c6fb$export$8397ddfc504fdb9a(modality) {
$507fabe10e71c6fb$var$currentModality = modality;
$507fabe10e71c6fb$var$triggerChangeHandlers(modality, null);
}
function $507fabe10e71c6fb$export$98e20ec92f614cfe() {
$507fabe10e71c6fb$var$setupGlobalFocusEvents();
let [modality, setModality] = (0, $28AnR$useState)($507fabe10e71c6fb$var$currentModality);
(0, $28AnR$useEffect)(()=>{
let handler = ()=>{
setModality($507fabe10e71c6fb$var$currentModality);
};
$507fabe10e71c6fb$var$changeHandlers.add(handler);
return ()=>{
$507fabe10e71c6fb$var$changeHandlers.delete(handler);
};
}, []);
return (0, $28AnR$useIsSSR)() ? null : modality;
}
const $507fabe10e71c6fb$var$nonTextInputTypes = new Set([
'checkbox',
'radio',
'range',
'color',
'file',
'image',
'button',
'submit',
'reset'
]);
/**
* If this is attached to text input component, return if the event is a focus event (Tab/Escape keys pressed) so that
* focus visible style can be properly set.
*/ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
var _e_target;
const IHTMLInputElement = typeof window !== 'undefined' ? (0, $28AnR$getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).HTMLInputElement : HTMLInputElement;
const IHTMLTextAreaElement = typeof window !== 'undefined' ? (0, $28AnR$getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).HTMLTextAreaElement : HTMLTextAreaElement;
const IHTMLElement = typeof window !== 'undefined' ? (0, $28AnR$getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).HTMLElement : HTMLElement;
const IKeyboardEvent = typeof window !== 'undefined' ? (0, $28AnR$getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).KeyboardEvent : KeyboardEvent;
isTextInput = isTextInput || (e === null || e === void 0 ? void 0 : e.target) instanceof IHTMLInputElement && !$507fabe10e71c6fb$var$nonTextInputTypes.has(e === null || e === void 0 ? void 0 : (_e_target = e.target) === null || _e_target === void 0 ? void 0 : _e_target.type) || (e === null || e === void 0 ? void 0 : e.target) instanceof IHTMLTextAreaElement || (e === null || e === void 0 ? void 0 : e.target) instanceof IHTMLElement && (e === null || e === void 0 ? void 0 : e.target.isContentEditable);
return !(isTextInput && modality === 'keyboard' && e instanceof IKeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
}
function $507fabe10e71c6fb$export$ffd9e5021c1fb2d6(props = {}) {
let { isTextInput: isTextInput, autoFocus: autoFocus } = props;
let [isFocusVisibleState, setFocusVisible] = (0, $28AnR$useState)(autoFocus || $507fabe10e71c6fb$export$b9b3dfddab17db27());
$507fabe10e71c6fb$export$ec71b4b83ac08ec3((isFocusVisible)=>{
setFocusVisible(isFocusVisible);
}, [
isTextInput
], {
isTextInput: isTextInput
});
return {
isFocusVisible: isFocusVisibleState
};
}
function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
$507fabe10e71c6fb$var$setupGlobalFocusEvents();
(0, $28AnR$useEffect)(()=>{
let handler = (modality, e)=>{
if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e)) return;
fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
};
$507fabe10e71c6fb$var$changeHandlers.add(handler);
return ()=>{
$507fabe10e71c6fb$var$changeHandlers.delete(handler);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, deps);
}
export {$507fabe10e71c6fb$export$d90243b58daecda7 as hasSetupGlobalListeners, $507fabe10e71c6fb$export$2f1888112f558a7d as addWindowFocusTracking, $507fabe10e71c6fb$export$b9b3dfddab17db27 as isFocusVisible, $507fabe10e71c6fb$export$630ff653c5ada6a9 as getInteractionModality, $507fabe10e71c6fb$export$8397ddfc504fdb9a as setInteractionModality, $507fabe10e71c6fb$export$98e20ec92f614cfe as useInteractionModality, $507fabe10e71c6fb$export$ffd9e5021c1fb2d6 as useFocusVisible, $507fabe10e71c6fb$export$ec71b4b83ac08ec3 as useFocusVisibleListener};
//# sourceMappingURL=useFocusVisible.module.js.map
@@ -0,0 +1,59 @@
import { interpolate, defaultOffset } from 'motion-dom';
import { clamp } from 'motion-utils';
import { calcInset } from './inset.mjs';
import { resolveOffset } from './offset.mjs';
import { ScrollOffset } from './presets.mjs';
const point = { x: 0, y: 0 };
function getTargetSize(target) {
return "getBBox" in target && target.tagName !== "svg"
? target.getBBox()
: { width: target.clientWidth, height: target.clientHeight };
}
function resolveOffsets(container, info, options) {
const { offset: offsetDefinition = ScrollOffset.All } = options;
const { target = container, axis = "y" } = options;
const lengthLabel = axis === "y" ? "height" : "width";
const inset = target !== container ? calcInset(target, container) : point;
/**
* Measure the target and container. If they're the same thing then we
* use the container's scrollWidth/Height as the target, from there
* all other calculations can remain the same.
*/
const targetSize = target === container
? { width: container.scrollWidth, height: container.scrollHeight }
: getTargetSize(target);
const containerSize = {
width: container.clientWidth,
height: container.clientHeight,
};
/**
* Reset the length of the resolved offset array rather than creating a new one.
* TODO: More reusable data structures for targetSize/containerSize would also be good.
*/
info[axis].offset.length = 0;
/**
* Populate the offset array by resolving the user's offset definition into
* a list of pixel scroll offets.
*/
let hasChanged = !info[axis].interpolate;
const numOffsets = offsetDefinition.length;
for (let i = 0; i < numOffsets; i++) {
const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]);
if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) {
hasChanged = true;
}
info[axis].offset[i] = offset;
}
/**
* If the pixel scroll offsets have changed, create a new interpolator function
* to map scroll value into a progress.
*/
if (hasChanged) {
info[axis].interpolate = interpolate(info[axis].offset, defaultOffset(offsetDefinition), { clamp: false });
info[axis].interpolatorOffsets = [...info[axis].offset];
}
info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current));
}
export { resolveOffsets };
@@ -0,0 +1,69 @@
/**
* @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions
* @typedef {import('micromark-extension-gfm-strikethrough').Options} Options
* @typedef {import('micromark-util-types').Extension} Extension
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
*/
import {
combineExtensions,
combineHtmlExtensions
} from 'micromark-util-combine-extensions'
import {
gfmAutolinkLiteral,
gfmAutolinkLiteralHtml
} from 'micromark-extension-gfm-autolink-literal'
import {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'
import {
gfmStrikethrough,
gfmStrikethroughHtml
} from 'micromark-extension-gfm-strikethrough'
import {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'
import {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'
import {
gfmTaskListItem,
gfmTaskListItemHtml
} from 'micromark-extension-gfm-task-list-item'
/**
* Create an extension for `micromark` to enable GFM syntax.
*
* @param {Options | null | undefined} [options]
* Configuration (optional).
*
* Passed to `micromark-extens-gfm-strikethrough`.
* @returns {Extension}
* Extension for `micromark` that can be passed in `extensions` to enable GFM
* syntax.
*/
export function gfm(options) {
return combineExtensions([
gfmAutolinkLiteral(),
gfmFootnote(),
gfmStrikethrough(options),
gfmTable(),
gfmTaskListItem()
])
}
/**
* Create an extension for `micromark` to support GFM when serializing to HTML.
*
* @param {HtmlOptions | null | undefined} [options]
* Configuration (optional).
*
* Passed to `micromark-extens-gfm-footnote`.
* @returns {HtmlExtension}
* Extension for `micromark` that can be passed in `htmlExtensions` to
* support GFM when serializing to HTML.
*/
export function gfmHtml(options) {
return combineHtmlExtensions([
gfmAutolinkLiteralHtml(),
gfmFootnoteHtml(options),
gfmStrikethroughHtml(),
gfmTableHtml(),
gfmTagfilterHtml(),
gfmTaskListItemHtml()
])
}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const esnext_collection: LibDefinition;
@@ -0,0 +1 @@
const{parse:t,stringify:e}=JSON,{keys:n}=Object,l=String,o="string",r={},s="object",c=(t,e)=>e,a=t=>t instanceof l?l(t):t,f=(t,e)=>typeof e===o?new l(e):e,i=(t,e,o,c)=>{const a=[];for(let f=n(o),{length:i}=f,p=0;p<i;p++){const n=f[p],i=o[n];if(i instanceof l){const l=t[i];typeof l!==s||e.has(l)?o[n]=c.call(o,n,l):(e.add(l),o[n]=r,a.push({k:n,a:[t,e,l,c]}))}else o[n]!==r&&(o[n]=c.call(o,n,i))}for(let{length:t}=a,e=0;e<t;e++){const{k:t,a:n}=a[e];o[t]=c.call(o,t,i.apply(null,n))}return o},p=(t,e,n)=>{const o=l(e.push(n)-1);return t.set(n,o),o},u=(e,n)=>{const l=t(e,f).map(a),o=l[0],r=n||c,p=typeof o===s&&o?i(l,new Set,o,r):o;return r.call({"":p},"",p)},h=(t,n,l)=>{const r=n&&typeof n===s?(t,e)=>""===t||-1<n.indexOf(t)?e:void 0:n||c,a=new Map,f=[],i=[];let u=+p(a,f,r.call({"":t},"",t)),h=!u;for(;u<f.length;)h=!0,i[u]=e(f[u++],y,l);return"["+i.join(",")+"]";function y(t,e){if(h)return h=!h,e;const n=r.call(this,t,e);switch(typeof n){case s:if(null===n)return n;case o:return a.get(n)||p(a,f,n)}return n}},y=e=>t(h(e)),g=t=>u(e(t));export{g as fromJSON,u as parse,h as stringify,y as toJSON};
@@ -0,0 +1,9 @@
"use client";
import {
menu_item_default
} from "./chunk-6GUQKX6L.mjs";
import "./chunk-7C7K3AST.mjs";
import "./chunk-DQ5FVIN3.mjs";
export {
menu_item_default as default
};
@@ -0,0 +1,6 @@
{
"version": 3,
"sources": ["../src/set-array.ts", "../src/gen-mapping.ts", "../src/sourcemap-segment.ts"],
"mappings": "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 truncated
"names": ["cast"]
}
@@ -0,0 +1,116 @@
{
"name": "micromark-extension-gfm-autolink-literal",
"version": "2.1.0",
"description": "micromark extension to support GFM autolink literals",
"license": "MIT",
"keywords": [
"micromark",
"micromark-extension",
"literal",
"url",
"autolink",
"auto",
"link",
"gfm",
"markdown",
"unified"
],
"repository": "micromark/micromark-extension-gfm-autolink-literal",
"bugs": "https://github.com/micromark/micromark-extension-gfm-autolink-literal/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"files": [
"dev/",
"lib/",
"index.d.ts",
"index.js"
],
"exports": {
"development": "./dev/index.js",
"default": "./index.js"
},
"dependencies": {
"micromark-util-character": "^2.0.0",
"micromark-util-sanitize-uri": "^2.0.0",
"micromark-util-symbol": "^2.0.0",
"micromark-util-types": "^2.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"c8": "^10.0.0",
"create-gfm-fixtures": "^1.0.0",
"micromark": "^4.0.0",
"micromark-build": "^2.0.0",
"prettier": "^3.0.0",
"rehype": "^13.0.0",
"remark-cli": "^12.0.0",
"remark-preset-wooorm": "^10.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.58.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
"build": "tsc --build --clean && tsc --build && type-coverage && micromark-build",
"format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
"test-api-prod": "node --conditions production test/index.js",
"test-api-dev": "node --conditions development test/index.js",
"test-api": "npm run test-api-dev && npm run test-api-prod",
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
"bracketSpacing": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"remarkConfig": {
"plugins": [
"remark-preset-wooorm"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"ignoreCatch": true,
"strict": true
},
"xo": {
"prettier": true,
"rules": {
"complexity": "off",
"unicorn/no-this-assignment": "off",
"unicorn/prefer-at": "off",
"unicorn/prefer-string-replace-all": "off"
},
"overrides": [
{
"files": [
"**/*.ts"
],
"rules": {
"@typescript-eslint/consistent-type-definitions": 0
}
},
{
"files": [
"test/**/*.js"
],
"rules": {
"no-await-in-loop": 0
}
}
]
}
}
@@ -0,0 +1,88 @@
import {UpperCaseCharacters, WordSeparators} from '../source/utilities';
/**
Unlike a simpler split, this one includes the delimiter splitted on in the resulting array literal. This is to enable splitting on, for example, upper-case characters.
@category Template Literals
*/
export type SplitIncludingDelimiters<Source extends string, Delimiter extends string> =
Source extends '' ? [] :
Source extends `${infer FirstPart}${Delimiter}${infer SecondPart}` ?
(
Source extends `${FirstPart}${infer UsedDelimiter}${SecondPart}`
? UsedDelimiter extends Delimiter
? Source extends `${infer FirstPart}${UsedDelimiter}${infer SecondPart}`
? [...SplitIncludingDelimiters<FirstPart, Delimiter>, UsedDelimiter, ...SplitIncludingDelimiters<SecondPart, Delimiter>]
: never
: never
: never
) :
[Source];
/**
Format a specific part of the splitted string literal that `StringArrayToDelimiterCase<>` fuses together, ensuring desired casing.
@see StringArrayToDelimiterCase
*/
type StringPartToDelimiterCase<StringPart extends string, UsedWordSeparators extends string, UsedUpperCaseCharacters extends string, Delimiter extends string> =
StringPart extends UsedWordSeparators ? Delimiter :
StringPart extends UsedUpperCaseCharacters ? `${Delimiter}${Lowercase<StringPart>}` :
StringPart;
/**
Takes the result of a splitted string literal and recursively concatenates it together into the desired casing.
It receives `UsedWordSeparators` and `UsedUpperCaseCharacters` as input to ensure it's fully encapsulated.
@see SplitIncludingDelimiters
*/
type StringArrayToDelimiterCase<Parts extends any[], UsedWordSeparators extends string, UsedUpperCaseCharacters extends string, Delimiter extends string> =
Parts extends [`${infer FirstPart}`, ...infer RemainingParts]
? `${StringPartToDelimiterCase<FirstPart, UsedWordSeparators, UsedUpperCaseCharacters, Delimiter>}${StringArrayToDelimiterCase<RemainingParts, UsedWordSeparators, UsedUpperCaseCharacters, Delimiter>}`
: '';
/**
Convert a string literal to a custom string delimiter casing.
This can be useful when, for example, converting a camel-cased object property to an oddly cased one.
@see KebabCase
@see SnakeCase
@example
```
import {DelimiterCase} from 'type-fest';
// Simple
const someVariable: DelimiterCase<'fooBar', '#'> = 'foo#bar';
// Advanced
type OddlyCasedProperties<T> = {
[K in keyof T as DelimiterCase<K, '#'>]: T[K]
};
interface SomeOptions {
dryRun: boolean;
includeFile: string;
foo: number;
}
const rawCliOptions: OddlyCasedProperties<SomeOptions> = {
'dry#run': true,
'include#file': 'bar.js',
foo: 123
};
```
@category Template Literals
*/
export type DelimiterCase<Value, Delimiter extends string> = Value extends string
? StringArrayToDelimiterCase<
SplitIncludingDelimiters<Value, WordSeparators | UpperCaseCharacters>,
WordSeparators,
UpperCaseCharacters,
Delimiter
>
: Value;
@@ -0,0 +1,10 @@
import { ClassValue } from 'tailwind-variants';
/**
* This Typescript utility transform a list of slots into a list of {slot: classes}
*/
type SlotsToClasses<S extends string> = {
[key in S]?: ClassValue;
};
export { SlotsToClasses };
@@ -0,0 +1 @@
{"name":"@react-aria/form","version":"3.1.2","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532107695,"integrity":"sha512-cil7stSp3ik41Hdv2Dj+GMcbvUfs1q+MZ2Yte0804py9i6oJJN/diCiIr/brcQOZ5ZqwAI6dgaHA7l8FZheQBw==","mode":420,"size":11335},"dist/main.js":{"checkedAt":1794532107695,"integrity":"sha512-SAT0LfS72pbUxJsQ0txaHQwhtLFOmt6zXtrwuF/sAZQYb427/SiDk3vLdzsu4sFLtkVhrPkPQJ0PMeCCxiXTTg==","mode":420,"size":962},"dist/module.js":{"checkedAt":1794532107695,"integrity":"sha512-o+/U5+MsWzgeOVj0WhCt5ZKNQaGgSJWo7fdy7xSkd87RLowvnvIJe0WXgU9VbXwpdc6Io1qWcxxOqwyIP3FRpQ==","mode":420,"size":842},"dist/useFormValidation.main.js":{"checkedAt":1794532107695,"integrity":"sha512-MMLZ+I5GQMqkcYeHoMHwIbJk69pK/M+rsTowjAWcIS4KaRMTx0lDlQeFlvr9AHQYRiZXZXyM0Z2cJU6PDHf/Dg==","mode":420,"size":6440},"dist/useFormValidation.module.js":{"checkedAt":1794532107695,"integrity":"sha512-DRM3f3J5RZ2irp3Ra+n850mQZGegazOWNg1J2fZxaMsyrSQmOelPBtTN0JpsQNCTqGnTDWmDrFdPJ/buswcTuQ==","mode":420,"size":6317},"package.json":{"checkedAt":1794532107695,"integrity":"sha512-uGqvXlof8BqEGAGJgw9Zb6iw8sciZzyoiWr3/Xra6Enyiv0K13ujaxj6Ji1pe+KdVoeNy83mUWsolHoT/tXVUA==","mode":420,"size":1078},"dist/main.js.map":{"checkedAt":1794532107695,"integrity":"sha512-DO+B1BWV27WziowKPv+VmWj1/I4wrnpQHp6UsCjRRNJeGKIseFUEXd1DNdOWYkpip0o6izJ1uoQsh0Hi6ASJOw==","mode":420,"size":853},"dist/module.js.map":{"checkedAt":1794532107696,"integrity":"sha512-EXnVnuplOTJNgwag/vioKBXocMgi26y/dRuxFdkiudiXL1r5gMeZgn/No31LBjHwB0Wnxm+45q7LpLemYaSj5Q==","mode":420,"size":849},"dist/types.d.ts.map":{"checkedAt":1794532107696,"integrity":"sha512-0GWvs1YrHUXVk9V566X+ECcJdZHzduvAgtHoQ7FEIqDZ+efc0gGwkEhgnjDfUueKY5tD9rWkCwtcXRn5gswgVg==","mode":420,"size":1269},"dist/useFormValidation.main.js.map":{"checkedAt":1794532107696,"integrity":"sha512-InJYmjz+m9tfxlI5Blx7rBr9wA2ixRe4Umxuw5T1YaAvGZaO2S5FpfxDJur2XiI70m0Dg7HwoiFRfNrdBPhdhg==","mode":420,"size":8485},"dist/useFormValidation.module.js.map":{"checkedAt":1794532107696,"integrity":"sha512-z1ZnVWQC8CIgamEoqjcM234pHld5Cwdh4Q0+O89Y2qCXbPI4InxUndorEEM9L8lmmWJR9KlIMzB6RmvfR5C9dQ==","mode":420,"size":8480},"README.md":{"checkedAt":1794532107696,"integrity":"sha512-ELvvJaEbSyR+vYiTFw0Wor08eceQ5Y5k4s6JXZco2/PAc41DUvFXdUdm86w+xJN7dS0aHWT0B6QF6UcU5ARmWA==","mode":420,"size":134},"dist/import.mjs":{"checkedAt":1794532107696,"integrity":"sha512-jZIffjSRtL+Z2qoc9ZWU/0QnOd54rPRMEEWr+H7b1CFnvPtN3CeTT7n6FhjqduEJNAESzOn4GOaS3vITTkADcQ==","mode":420,"size":836},"dist/useFormValidation.mjs":{"checkedAt":1794532107695,"integrity":"sha512-DRM3f3J5RZ2irp3Ra+n850mQZGegazOWNg1J2fZxaMsyrSQmOelPBtTN0JpsQNCTqGnTDWmDrFdPJ/buswcTuQ==","mode":420,"size":6317},"src/index.ts":{"checkedAt":1794532107697,"integrity":"sha512-Hn7qA7IalMdg/vYeBSshqY5udjp11cDOO14lQNjnhozH5Mjs6SX0CvkHq02SBDnq56LwlENipiBMTxls7XWQ+w==","mode":420,"size":676},"dist/types.d.ts":{"checkedAt":1794532107697,"integrity":"sha512-NWh5RPrNVzkVZ5lrnn2Hyxmg2oGKrLVCSg+MOYy89ZIggzlpxeT5mBhPtIRHxq4plGQwnjczF5fhp6mUamhKcg==","mode":420,"size":484},"src/useFormValidation.ts":{"checkedAt":1794532107697,"integrity":"sha512-twpTu7g9xMmepKEP/h9BEZtfhx2OPH4lByo5YnlkSp3MLLpnA0FlBrr3fNcyzCSuqGI0JJJgl3PX150/k3QWzA==","mode":420,"size":5637}}}
@@ -0,0 +1,7 @@
import type { FilterFunction } from '../settings';
import type Settings from '../settings';
import type { Errno } from '../types';
export declare function isFatalError(settings: Settings, error: Errno): boolean;
export declare function isAppliedFilter<T>(filter: FilterFunction<T> | null, value: T): boolean;
export declare function replacePathSegmentSeparator(filepath: string, separator: string): string;
export declare function joinPathSegments(a: string, b: string, separator: string): string;
@@ -0,0 +1 @@
{"name":"has-bigints","version":"1.1.0","requiresBuild":false,"files":{".eslintrc":{"checkedAt":1794532097706,"integrity":"sha512-4+yheARSL/pPQeg25245ejEKIOgmGjgRW2fotkREQVMDnQQZj7Rw9FvimX0senKxW9R3GgLHQbPLwHLqbvQy6Q==","mode":420,"size":43},".nycrc":{"checkedAt":1794532097706,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"LICENSE":{"checkedAt":1794532097706,"integrity":"sha512-d2fjYr50p8QKjqC0qhH5nWv3sgAsKHHicw91kVzLPCZ54cpPIRw8zJk+nn45Y6q/yJ/T/xdxK77zBLuAvFgmVg==","mode":420,"size":1071},"index.js":{"checkedAt":1794532097706,"integrity":"sha512-shX2K68dkD7X0Nrsw6Dib56xwl2Fp1fpZAsOEZYiHHRq4ajKrxrIa7Pscvc513POVEDmRhxPj/FhNv5YY9PdJg==","mode":420,"size":374},"test/index.js":{"checkedAt":1794532097707,"integrity":"sha512-7sN3T6eCRwn5u5Rd/MGo9MB6U0QNRvCOmXNrcjNB4fycAxDQsJ/aX88SeCgEUXeXP2sm2X9Bm4G3B6ZGMUB3cA==","mode":420,"size":1002},"package.json":{"checkedAt":1794532097707,"integrity":"sha512-EW+RQ7iSmKPeClMAc0EiO+goTZsyIeKThPtzXkdaR/U6+9YjpXmBrAJ/pzb6Cl57t6jckkq6hQghR2mCq8xyUA==","mode":420,"size":1867},"tsconfig.json":{"checkedAt":1794532097707,"integrity":"sha512-xBbrFV4Zb7DECDeefgt+yhGfHLeRKbwlh2H6L08d8tjUDpSQt9WyNmB4pcNL/slJJ50FIksbN+w5cFzfKhZ+bw==","mode":420,"size":123},"CHANGELOG.md":{"checkedAt":1794532097707,"integrity":"sha512-RC+JBntsmcLRJ0MdXY24jRlTxUt9Iepwtqj3E6Nv+0ZiWJNqaFrr1gQydseR1oR3vsAFR2xOS5GnhLZ6Mtq4zw==","mode":420,"size":7799},"README.md":{"checkedAt":1794532097707,"integrity":"sha512-qEG/BRXfGU0iEl+to+OQom9P+g7Svp1M1h2GsyNW3PPt6bovBOQr/cDjMBAc+tDEVvhgftsUv5v2SBy1YfK15w==","mode":420,"size":1729},"index.d.ts":{"checkedAt":1794532097707,"integrity":"sha512-I2pQi8ChQD5y5PHgAmwdic9r3y1Yt+MROdLsl+45ZQmnN7NLKxKuKy1a4TDCtdw7J3uWi7nSELtcaFMtkqDONw==","mode":420,"size":73},".github/FUNDING.yml":{"checkedAt":1794532097707,"integrity":"sha512-ISE1RevksY3xb8IFXPGShIY+NP62IPOX3bioO+0xo7Chds8eQylIxmkxxjrIlql1bkHSydV2szF8GBmm77QiEg==","mode":420,"size":582}}}
@@ -0,0 +1,198 @@
# type-is
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Infer the content-type of a request.
## Install
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```sh
$ npm install type-is
```
## API
```js
var http = require('http')
var typeis = require('type-is')
http.createServer(function (req, res) {
var istext = typeis(req, ['text/*'])
res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text')
})
```
### typeis(request, types)
Checks if the `request` is one of the `types`. If the request has no body,
even if there is a `Content-Type` header, then `null` is returned. If the
`Content-Type` header is invalid or does not matches any of the `types`, then
`false` is returned. Otherwise, a string of the type that matched is returned.
The `request` argument is expected to be a Node.js HTTP request. The `types`
argument is an array of type strings.
Each type in the `types` array can be one of the following:
- A file extension name such as `json`. This name will be returned if matched.
- A mime type such as `application/json`.
- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`.
The full mime type will be returned if matched.
- A suffix such as `+json`. This can be combined with a wildcard such as
`*/vnd+json` or `application/*+json`. The full mime type will be returned
if matched.
Some examples to illustrate the inputs and returned value:
```js
// req.headers.content-type = 'application/json'
typeis(req, ['json']) // => 'json'
typeis(req, ['html', 'json']) // => 'json'
typeis(req, ['application/*']) // => 'application/json'
typeis(req, ['application/json']) // => 'application/json'
typeis(req, ['html']) // => false
```
### typeis.hasBody(request)
Returns a Boolean if the given `request` has a body, regardless of the
`Content-Type` header.
Having a body has no relation to how large the body is (it may be 0 bytes).
This is similar to how file existence works. If a body does exist, then this
indicates that there is data to read from the Node.js request stream.
```js
if (typeis.hasBody(req)) {
// read the body, since there is one
req.on('data', function (chunk) {
// ...
})
}
```
### typeis.is(mediaType, types)
Checks if the `mediaType` is one of the `types`. If the `mediaType` is invalid
or does not matches any of the `types`, then `false` is returned. Otherwise, a
string of the type that matched is returned.
The `mediaType` argument is expected to be a
[media type](https://tools.ietf.org/html/rfc6838) string. The `types` argument
is an array of type strings.
Each type in the `types` array can be one of the following:
- A file extension name such as `json`. This name will be returned if matched.
- A mime type such as `application/json`.
- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`.
The full mime type will be returned if matched.
- A suffix such as `+json`. This can be combined with a wildcard such as
`*/vnd+json` or `application/*+json`. The full mime type will be returned
if matched.
Some examples to illustrate the inputs and returned value:
```js
var mediaType = 'application/json'
typeis.is(mediaType, ['json']) // => 'json'
typeis.is(mediaType, ['html', 'json']) // => 'json'
typeis.is(mediaType, ['application/*']) // => 'application/json'
typeis.is(mediaType, ['application/json']) // => 'application/json'
typeis.is(mediaType, ['html']) // => false
```
### typeis.match(expected, actual)
Match the type string `expected` with `actual`, taking in to account wildcards.
A wildcard can only be in the type of the subtype part of a media type and only
in the `expected` value (as `actual` should be the real media type to match). A
suffix can still be included even with a wildcard subtype. If an input is
malformed, `false` will be returned.
```js
typeis.match('text/html', 'text/html') // => true
typeis.match('*/html', 'text/html') // => true
typeis.match('text/*', 'text/html') // => true
typeis.match('*/*', 'text/html') // => true
typeis.match('*/*+json', 'application/x-custom+json') // => true
```
### typeis.normalize(type)
Normalize a `type` string. This works by performing the following:
- If the `type` is not a string, `false` is returned.
- If the string starts with `+` (so it is a `+suffix` shorthand like `+json`),
then it is expanded to contain the complete wildcard notation of `*/*+suffix`.
- If the string contains a `/`, then it is returned as the type.
- Else the string is assumed to be a file extension and the mapped media type is
returned, or `false` is there is no mapping.
This includes two special mappings:
- `'multipart'` -> `'multipart/*'`
- `'urlencoded'` -> `'application/x-www-form-urlencoded'`
## Examples
### Example body parser
```js
var express = require('express')
var typeis = require('type-is')
var app = express()
app.use(function bodyParser (req, res, next) {
if (!typeis.hasBody(req)) {
return next()
}
switch (typeis(req, ['urlencoded', 'json', 'multipart'])) {
case 'urlencoded':
// parse urlencoded body
throw new Error('implement urlencoded body parsing')
case 'json':
// parse json body
throw new Error('implement json body parsing')
case 'multipart':
// parse multipart body
throw new Error('implement multipart body parsing')
default:
// 415 error code
res.statusCode = 415
res.end()
break
}
})
```
## License
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/jshttp/type-is/master?label=ci
[ci-url]: https://github.com/jshttp/type-is/actions/workflows/ci.yml
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/type-is/master
[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master
[node-version-image]: https://badgen.net/npm/node/type-is
[node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/type-is
[npm-url]: https://npmjs.org/package/type-is
[npm-version-image]: https://badgen.net/npm/v/type-is
[travis-image]: https://badgen.net/travis/jshttp/type-is/master
[travis-url]: https://travis-ci.org/jshttp/type-is
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PartialFromMappedResult = PartialFromMappedResult;
const index_1 = require("../mapped/index");
const partial_1 = require("./partial");
const value_1 = require("../clone/value");
// prettier-ignore
function FromProperties(K, options) {
const Acc = {};
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
Acc[K2] = (0, partial_1.Partial)(K[K2], (0, value_1.Clone)(options));
return Acc;
}
// prettier-ignore
function FromMappedResult(R, options) {
return FromProperties(R.properties, options);
}
// prettier-ignore
function PartialFromMappedResult(R, options) {
const P = FromMappedResult(R, options);
return (0, index_1.MappedResult)(P);
}
@@ -0,0 +1,55 @@
{
"name": "@heroui/code",
"version": "2.2.7",
"description": "Code is a component used to display inline code.",
"keywords": [
"code"
],
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/components/code"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"@heroui/theme": ">=2.4.0"
},
"dependencies": {
"@heroui/system-rsc": "2.3.6",
"@heroui/shared-utils": "2.1.3",
"@heroui/react-utils": "2.1.4"
},
"clean-package": "../../../clean-package.config.json",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup src --dts",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "tsup src"
}
}
@@ -0,0 +1 @@
{"name":"@dabh/diagnostics","version":"2.0.8","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532100987,"integrity":"sha512-ip4fpJBcUPTM4SQ8PWdWX9FZHJcq4eDODb8lrHZ6gB4b8mEKQhupReUtvGn/6lPwOMySHY2kKE4B1F4y3tVF/w==","mode":420,"size":1119},"logger/console.js":{"checkedAt":1794532100987,"integrity":"sha512-Ce8OTaAuGljJDI6tmdmx15X1WR9YoOLi9KC15t4yIn8eRggA6cOgv3Mzj9kQQLzwVNbHIRCX3osbECb0Wuc8JQ==","mode":420,"size":744},"browser/development.js":{"checkedAt":1794532100987,"integrity":"sha512-G8xP7vPcDXjTgqV1rzen2A0CSeLDFXDSKYBB/Fc+KOvpB4WuACEpCEWiEIY5tdrsV70fWgdlZ851FDMw8oe6yQ==","mode":420,"size":872},"node/development.js":{"checkedAt":1794532100987,"integrity":"sha512-7jRZWj0z1erVcBTAhEK+XR0arbZeazU/M8JC0y15Hrv7vmNrgHlVLQVIApJZHS+f8cf27J1IQq5tyqrzSpw+ow==","mode":420,"size":931},"diagnostics.js":{"checkedAt":1794532100987,"integrity":"sha512-20xUp/r98+w6d3hYw9iWQ1/4MIYLm6t3+YkPys6R3n+9Q7MkvlalhcCEgAsm9ro1hIziHlMeAW7zj5zggbS5Uw==","mode":420,"size":4518},"adapters/hash.js":{"checkedAt":1794532100987,"integrity":"sha512-FfkV+d5Bop6LABcwLgDuxZMCz6nzHfh42LjFoSBHsSJ5jqvppmM217jMpSpSocsw6H2U5ZAIvxHRfkYW2OjXig==","mode":420,"size":231},"adapters/index.js":{"checkedAt":1794532100987,"integrity":"sha512-akquzAt8WoDqxJYV0O2ottq5LX8oIq13Wq1x7Sn4pRYFhrn1T/l+DJir9aOTnUqo8KswT939QHWxWI5+j07YgA==","mode":420,"size":401},"browser/index.js":{"checkedAt":1794532100987,"integrity":"sha512-/JGDTiTszb+hEMnsSjWloYkl6dmNK/We4CBQCj78b4OfB/JcbVo6s4iDvKAv1ywfCByI8nW2B7V1ckT18zzSbg==","mode":420,"size":223},"node/index.js":{"checkedAt":1794532100987,"integrity":"sha512-/JGDTiTszb+hEMnsSjWloYkl6dmNK/We4CBQCj78b4OfB/JcbVo6s4iDvKAv1ywfCByI8nW2B7V1ckT18zzSbg==","mode":420,"size":223},"adapters/localstorage.js":{"checkedAt":1794532100988,"integrity":"sha512-nGLPWj4bD2DoHbNX86lE72W/FaCaVo6eKWuJOdQYDyxJRaOOQEEn2cML+Wb+ZzNYhKwLQ4/hdmohSEBD4FNyqA==","mode":420,"size":242},"modifiers/namespace-ansi.js":{"checkedAt":1794532100988,"integrity":"sha512-gkk0Yml025cF8LwZyjGqiwCmNvjEqtZK5HeOHilKUyFjH1xAZZ/sQuPdGS/yhNFmHKgfBNeAljSfV3JDnjebXA==","mode":420,"size":564},"modifiers/namespace.js":{"checkedAt":1794532100988,"integrity":"sha512-A8czMQq2qHpeKS4ulJYz2BxN97C9ZzwTQ6VVQVOMgcPrDy+ffotgAR50Hsha3CwhKtJWborVcAkmIqUafLNRig==","mode":420,"size":979},"browser/override.js":{"checkedAt":1794532100988,"integrity":"sha512-F4wq6U2k3FfPkmPe5+Gs0YvSRFMUDjsm2/l2cKJrCbox6xRDXm3dSUDKJD8kupfLxDL49t2pa2Ou/h0YE+BXDA==","mode":420,"size":135},"node/override.js":{"checkedAt":1794532100988,"integrity":"sha512-zxL+eavP3yMQXEqseuHSs7HYUb4XeguIxjT2nZoo7Vd93OmPiuqE4X6AnKYEjCcr4GIZTP03XhiqZVTGRzP53A==","mode":420,"size":432},"adapters/process.env.js":{"checkedAt":1794532100988,"integrity":"sha512-3NBoYmoENtM9Gejpp0B/RmnXr/BmTREIhoKZgiQ9P0MscxYGK6c67bAGQsHNHWaTR/gYWObO4CSnP7kNdu+hvg==","mode":420,"size":221},"browser/production.js":{"checkedAt":1794532100989,"integrity":"sha512-zSMJACqoJmHOPYAW9m9oBX0C47P6SC7FE1mQJxE95Wn1lMnyLOl8NL61znwPyDmuiT3r5rFrKrgzCv5BQDRGPA==","mode":420,"size":578},"node/production.js":{"checkedAt":1794532100989,"integrity":"sha512-zSMJACqoJmHOPYAW9m9oBX0C47P6SC7FE1mQJxE95Wn1lMnyLOl8NL61znwPyDmuiT3r5rFrKrgzCv5BQDRGPA==","mode":420,"size":578},"package.json":{"checkedAt":1794532100989,"integrity":"sha512-mcMMcb26YWdEPfpj8x9zm9DczYIl5/DTmLJh91ou+RuMSanskVI/t/BxHfFUmp4kPyAgcmGyjrm6CJ59Bgry8A==","mode":420,"size":2156},"CHANGELOG.md":{"checkedAt":1794532100989,"integrity":"sha512-XRzopzaqfRN93ynO5tQ57rH5m8sDVvo6fBJFg6J3XXPvi195FhKmQWa/5ivUf4CwWVUVIQEqs3Q5R1+n5FKTlQ==","mode":420,"size":900},"README.md":{"checkedAt":1794532100989,"integrity":"sha512-K8+hJT3xgi3dis3ZlYbos6PpPcA43qRlprLzw14E9loX1dNY5eNehkkKxcSXa5+DmIftmPujjvw0VqVeUsghSA==","mode":420,"size":14165}}}
@@ -0,0 +1,15 @@
module.exports = {
"deselectedItem": (args)=>`Element ${args.item} ni izbran.`,
"longPressToSelect": `Za izbirni na\u{10D}in pritisnite in dlje \u{10D}asa dr\u{17E}ite.`,
"select": `Izberite`,
"selectedAll": `Vsi elementi so izbrani.`,
"selectedCount": (args, formatter)=>`${formatter.plural(args.count, {
"=0": `Noben element ni izbran`,
one: ()=>`${formatter.number(args.count)} element je izbran`,
other: ()=>`${formatter.number(args.count)} elementov je izbranih`
})}.`,
"selectedItem": (args)=>`Element ${args.item} je izbran.`
};
//# sourceMappingURL=sl-SI.main.js.map
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('isError', require('../isError'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,16 @@
'use strict'
const u = require('universalify').fromPromise
const jsonFile = require('./jsonfile')
jsonFile.outputJson = u(require('./output-json'))
jsonFile.outputJsonSync = require('./output-json-sync')
// aliases
jsonFile.outputJSON = jsonFile.outputJson
jsonFile.outputJSONSync = jsonFile.outputJsonSync
jsonFile.writeJSON = jsonFile.writeJson
jsonFile.writeJSONSync = jsonFile.writeJsonSync
jsonFile.readJSON = jsonFile.readJson
jsonFile.readJSONSync = jsonFile.readJsonSync
module.exports = jsonFile
@@ -0,0 +1,268 @@
# memoize-one
A memoization library that only caches the result of the most recent arguments.
> Also [async version](https://github.com/microlinkhq/async-memoize-one).
[![Build Status](https://travis-ci.org/alexreardon/memoize-one.svg?branch=master)](https://travis-ci.org/alexreardon/memoize-one)
[![npm](https://img.shields.io/npm/v/memoize-one.svg)](https://www.npmjs.com/package/memoize-one)
![types](https://img.shields.io/badge/types-typescript%20%7C%20flow-blueviolet)
[![dependencies](https://david-dm.org/alexreardon/memoize-one.svg)](https://david-dm.org/alexreardon/memoize-one)
[![minzip](https://img.shields.io/bundlephobia/minzip/memoize-one.svg)](https://www.npmjs.com/package/memoize-one)
[![Downloads per month](https://img.shields.io/npm/dm/memoize-one.svg)](https://www.npmjs.com/package/memoize-one)
## Rationale
Unlike other memoization libraries, `memoize-one` only remembers the latest arguments and result. No need to worry about cache busting mechanisms such as `maxAge`, `maxSize`, `exclusions` and so on, which can be prone to memory leaks. `memoize-one` simply remembers the last arguments, and if the function is next called with the same arguments then it returns the previous result.
## Usage
```js
// memoize-one uses the default import
import memoizeOne from 'memoize-one';
const add = (a, b) => a + b;
const memoizedAdd = memoizeOne(add);
memoizedAdd(1, 2); // 3
memoizedAdd(1, 2); // 3
// Add function is not executed: previous result is returned
memoizedAdd(2, 3); // 5
// Add function is called to get new value
memoizedAdd(2, 3); // 5
// Add function is not executed: previous result is returned
memoizedAdd(1, 2); // 3
// Add function is called to get new value.
// While this was previously cached,
// it is not the latest so the cached result is lost
```
## Installation
```bash
# yarn
yarn add memoize-one
# npm
npm install memoize-one --save
```
## Function argument equality
By default, we apply our own _fast_ and _naive_ equality function to determine whether the arguments provided to your function are equal. You can see the full code here: [are-inputs-equal.ts](https://github.com/alexreardon/memoize-one/blob/master/src/are-inputs-equal.ts).
(By default) function arguments are considered equal if:
1. there is same amount of arguments
2. each new argument has strict equality (`===`) with the previous argument
3. **[special case]** if two arguments are not `===` and they are both `NaN` then the two arguments are treated as equal
What this looks like in practice:
```js
import memoizeOne from 'memoize-one';
// add all numbers provided to the function
const add = (...args = []) =>
args.reduce((current, value) => {
return current + value;
}, 0);
const memoizedAdd = memoizeOne(add);
```
> 1. there is same amount of arguments
```js
memoizedAdd(1, 2);
// the amount of arguments has changed, so underlying add function is called
memoizedAdd(1, 2, 3);
```
> 2. new arguments have strict equality (`===`) with the previous argument
```js
memoizedAdd(1, 2);
// each argument is `===` to the last argument, so cache is used
memoizedAdd(1, 2);
// second argument has changed, so add function is called again
memoizedAdd(1, 3);
// the first value is not `===` to the previous first value (1 !== 3)
// so add function is called again
memoizedAdd(3, 1);
```
> 3. **[special case]** if the arguments are not `===` and they are both `NaN` then the argument is treated as equal
```js
memoizedAdd(NaN);
// Even though NaN !== NaN these arguments are treated as equal
memoizedAdd(NaN);
```
## Custom equality function
You can also pass in a custom function for checking the equality of two sets of arguments
```js
const memoized = memoizeOne(fn, isEqual);
```
The equality function needs to conform to this `type`:
```ts
type EqualityFn = (newArgs: any[], lastArgs: any[]) => boolean;
// You can import this type from memoize-one if you like
// typescript
import { EqualityFn } from 'memoize-one';
// flow
import type { EqualityFn } from 'memoize-one';
```
An equality function should return `true` if the arguments are equal. If `true` is returned then the wrapped function will not be called.
A custom equality function needs to compare `Arrays`. The `newArgs` array will be a new reference every time so a simple `newArgs === lastArgs` will always return `false`.
Equality functions are not called if the `this` context of the function has changed (see below).
Here is an example that uses a [dequal](https://github.com/lukeed/dequal) deep equal equality check
> `dequal` correctly handles deep comparing two arrays
```js
import memoizeOne from 'memoize-one';
import { dequal as isDeepEqual } from 'dequal';
const identity = (x) => x;
const shallowMemoized = memoizeOne(identity);
const deepMemoized = memoizeOne(identity, isDeepEqual);
const result1 = shallowMemoized({ foo: 'bar' });
const result2 = shallowMemoized({ foo: 'bar' });
result1 === result2; // false - different object reference
const result3 = deepMemoized({ foo: 'bar' });
const result4 = deepMemoized({ foo: 'bar' });
result3 === result4; // true - arguments are deep equal
```
## `this`
### `memoize-one` correctly respects `this` control
This library takes special care to maintain, and allow control over the the `this` context for **both** the original function being memoized as well as the returned memoized function. Both the original function and the memoized function's `this` context respect [all the `this` controlling techniques](https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch2.md):
- new bindings (`new`)
- explicit binding (`call`, `apply`, `bind`);
- implicit binding (call site: `obj.foo()`);
- default binding (`window` or `undefined` in `strict mode`);
- fat arrow binding (binding to lexical `this`)
- ignored this (pass `null` as `this` to explicit binding)
### Changes to `this` is considered an argument change
Changes to the running context (`this`) of a function can result in the function returning a different value even though its arguments have stayed the same:
```js
function getA() {
return this.a;
}
const temp1 = {
a: 20,
};
const temp2 = {
a: 30,
};
getA.call(temp1); // 20
getA.call(temp2); // 30
```
Therefore, in order to prevent against unexpected results, `memoize-one` takes into account the current execution context (`this`) of the memoized function. If `this` is different to the previous invocation then it is considered a change in argument. [further discussion](https://github.com/alexreardon/memoize-one/issues/3).
Generally this will be of no impact if you are not explicity controlling the `this` context of functions you want to memoize with [explicit binding](https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch2.md#explicit-binding) or [implicit binding](https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch2.md#implicit-binding). `memoize-One` will detect when you are manipulating `this` and will then consider the `this` context as an argument. If `this` changes, it will re-execute the original function even if the arguments have not changed.
## When your result function `throw`s
> There is no caching when your result function throws
If your result function `throw`s then the memoized function will also throw. The throw will not break the memoized functions existing argument cache. It means the memoized function will pretend like it was never called with arguments that made it `throw`.
```js
const canThrow = (name: string) => {
console.log('called');
if (name === 'throw') {
throw new Error(name);
}
return { name };
};
const memoized = memoizeOne(canThrow);
const value1 = memoized('Alex');
// console.log => 'called'
const value2 = memoized('Alex');
// result function not called
console.log(value1 === value2);
// console.log => true
try {
memoized('throw');
// console.log => 'called'
} catch (e) {
firstError = e;
}
try {
memoized('throw');
// console.log => 'called'
// the result function was called again even though it was called twice
// with the 'throw' string
} catch (e) {
secondError = e;
}
console.log(firstError !== secondError);
const value3 = memoized('Alex');
// result function not called as the original memoization cache has not been busted
console.log(value1 === value3);
// console.log => true
```
## Performance 🚀
### Tiny
`memoize-one` is super lightweight at [![min](https://img.shields.io/bundlephobia/min/memoize-one.svg?label=)](https://www.npmjs.com/package/memoize-one) minified and [![minzip](https://img.shields.io/bundlephobia/minzip/memoize-one.svg?label=)](https://www.npmjs.com/package/memoize-one) gzipped. (`1KB` = `1,024 Bytes`)
### Extremely fast
`memoize-one` performs better or on par with than other popular memoization libraries for the purpose of remembering the latest invocation.
**Results**
- [simple arguments](https://www.measurethat.net/Benchmarks/ShowResult/4452)
- [complex arguments](https://www.measurethat.net/Benchmarks/ShowResult/4488)
The comparisons are not exhaustive and are primarily to show that `memoize-one` accomplishes remembering the latest invocation really fast. The benchmarks do not take into account the differences in feature sets, library sizes, parse time, and so on.
## Code health 👍
- Tested with all built in [JavaScript types](https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/types%20%26%20grammar/ch1.md).
- 100% code coverage
- [Continuous integration](https://travis-ci.org/alexreardon/memoize-one) to run tests and type checks.
- Written in `Typescript`
- Correct typing for `Typescript` and `flow` type systems
- No dependencies
@@ -0,0 +1,73 @@
import { useMemo } from 'react'
import { useWebSocket } from './use-websocket'
import { DEFAULT_OPTIONS } from './constants'
import { Options, WebSocketHook } from './types';
export interface SocketIOMessageData<T = unknown> {
type: string,
payload: T | null,
}
const emptyEvent: SocketIOMessageData<null> = {
type: 'empty',
payload: null,
}
const getSocketData = <T = unknown>(event: WebSocketEventMap['message'] | null): SocketIOMessageData<T | null> => {
if (!event || !event.data) {
return emptyEvent
}
const match = event.data.match(/\[.*]/)
if (!match) {
return emptyEvent
}
const data = JSON.parse(match)
if (!Array.isArray(data) || !data[1]) {
return emptyEvent
}
return {
type: data[0],
payload: data[1],
}
}
export const useSocketIO = <T = unknown>(
url: string | (() => string | Promise<string>) | null,
options: Options = DEFAULT_OPTIONS,
connect: boolean = true,
): WebSocketHook<SocketIOMessageData<T | null>, SocketIOMessageData<T | null>> => {
const optionsWithSocketIO = useMemo(() => ({
...options,
fromSocketIO: true,
}), [])
const {
sendMessage,
sendJsonMessage,
lastMessage,
readyState,
getWebSocket,
} = useWebSocket(
url,
optionsWithSocketIO,
connect,
);
const socketIOLastMessage = useMemo(() =>
getSocketData<T>(lastMessage), [lastMessage]);
return {
sendMessage,
sendJsonMessage,
lastMessage: socketIOLastMessage,
lastJsonMessage: socketIOLastMessage,
readyState,
getWebSocket,
};
}
@@ -0,0 +1,64 @@
import {checkboxGroupData as $1ae600c947479353$export$ec98120685d4f57d} from "./utils.module.js";
import {filterDOMProps as $gtLuF$filterDOMProps, mergeProps as $gtLuF$mergeProps} from "@react-aria/utils";
import {useField as $gtLuF$useField} from "@react-aria/label";
import {useFocusWithin as $gtLuF$useFocusWithin} from "@react-aria/interactions";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $1e9fce0cfacc738b$export$49ff6f28c54f1cbe(props, state) {
let { isDisabled: isDisabled, name: name, form: form, validationBehavior: validationBehavior = 'aria' } = props;
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $gtLuF$useField)({
...props,
// Checkbox group is not an HTML input element so it
// shouldn't be labeled by a <label> element.
labelElementType: 'span',
isInvalid: isInvalid,
errorMessage: props.errorMessage || validationErrors
});
(0, $1ae600c947479353$export$ec98120685d4f57d).set(state, {
name: name,
form: form,
descriptionId: descriptionProps.id,
errorMessageId: errorMessageProps.id,
validationBehavior: validationBehavior
});
let domProps = (0, $gtLuF$filterDOMProps)(props, {
labelable: true
});
let { focusWithinProps: focusWithinProps } = (0, $gtLuF$useFocusWithin)({
onBlurWithin: props.onBlur,
onFocusWithin: props.onFocus,
onFocusWithinChange: props.onFocusChange
});
return {
groupProps: (0, $gtLuF$mergeProps)(domProps, {
role: 'group',
'aria-disabled': isDisabled || undefined,
...fieldProps,
...focusWithinProps
}),
labelProps: labelProps,
descriptionProps: descriptionProps,
errorMessageProps: errorMessageProps,
isInvalid: isInvalid,
validationErrors: validationErrors,
validationDetails: validationDetails
};
}
export {$1e9fce0cfacc738b$export$49ff6f28c54f1cbe as useCheckboxGroup};
//# sourceMappingURL=useCheckboxGroup.module.js.map
@@ -0,0 +1,6 @@
import {
DangerIcon
} from "./chunk-PHPAKJFX.mjs";
export {
DangerIcon
};
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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 truncated
@@ -0,0 +1,81 @@
import {usePress as $f6c31cce2adf654f$export$45712eceda6fad21} from "./usePress.module.js";
import {useGlobalListeners as $4k2kv$useGlobalListeners, getOwnerDocument as $4k2kv$getOwnerDocument, focusWithoutScrolling as $4k2kv$focusWithoutScrolling, useDescription as $4k2kv$useDescription, mergeProps as $4k2kv$mergeProps} from "@react-aria/utils";
import {useRef as $4k2kv$useRef} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
let { isDisabled: isDisabled, onLongPressStart: onLongPressStart, onLongPressEnd: onLongPressEnd, onLongPress: onLongPress, threshold: threshold = $8a26561d2877236e$var$DEFAULT_THRESHOLD, accessibilityDescription: accessibilityDescription } = props;
const timeRef = (0, $4k2kv$useRef)(undefined);
let { addGlobalListener: addGlobalListener, removeGlobalListener: removeGlobalListener } = (0, $4k2kv$useGlobalListeners)();
let { pressProps: pressProps } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
isDisabled: isDisabled,
onPressStart (e) {
e.continuePropagation();
if (e.pointerType === 'mouse' || e.pointerType === 'touch') {
if (onLongPressStart) onLongPressStart({
...e,
type: 'longpressstart'
});
timeRef.current = setTimeout(()=>{
// Prevent other usePress handlers from also handling this event.
e.target.dispatchEvent(new PointerEvent('pointercancel', {
bubbles: true
}));
// Ensure target is focused. On touch devices, browsers typically focus on pointer up.
if ((0, $4k2kv$getOwnerDocument)(e.target).activeElement !== e.target) (0, $4k2kv$focusWithoutScrolling)(e.target);
if (onLongPress) onLongPress({
...e,
type: 'longpress'
});
timeRef.current = undefined;
}, threshold);
// Prevent context menu, which may be opened on long press on touch devices
if (e.pointerType === 'touch') {
let onContextMenu = (e)=>{
e.preventDefault();
};
addGlobalListener(e.target, 'contextmenu', onContextMenu, {
once: true
});
addGlobalListener(window, 'pointerup', ()=>{
// If no contextmenu event is fired quickly after pointerup, remove the handler
// so future context menu events outside a long press are not prevented.
setTimeout(()=>{
removeGlobalListener(e.target, 'contextmenu', onContextMenu);
}, 30);
}, {
once: true
});
}
}
},
onPressEnd (e) {
if (timeRef.current) clearTimeout(timeRef.current);
if (onLongPressEnd && (e.pointerType === 'mouse' || e.pointerType === 'touch')) onLongPressEnd({
...e,
type: 'longpressend'
});
}
});
let descriptionProps = (0, $4k2kv$useDescription)(onLongPress && !isDisabled ? accessibilityDescription : undefined);
return {
longPressProps: (0, $4k2kv$mergeProps)(pressProps, descriptionProps)
};
}
export {$8a26561d2877236e$export$c24ed0104d07eab9 as useLongPress};
//# sourceMappingURL=useLongPress.module.js.map
@@ -0,0 +1 @@
{"name":"@typescript-eslint/eslint-plugin","version":"8.46.4","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532098932,"integrity":"sha512-t0z/UCQ+RY4AylIo7v6ZCtzCdS9pMnC0+yB0VQa2A+1S+oV4noJtM9o2SOJfDVq7GqTVK4GsuGR2QO4Nb/K7kw==","mode":420,"size":1097},"dist/rules/adjacent-overload-signatures.js":{"checkedAt":1794532098932,"integrity":"sha512-58/KkwwvQgTG0XoXdm3bea3nmiOaGTg+qnPH3lG2K7MFrw52xKB5NgJuAIiMRmPOUeJamPqUBOb0RfPixbiUMA==","mode":420,"size":5085},"dist/configs/eslintrc/all.js":{"checkedAt":1794532098933,"integrity":"sha512-5KiLmX95z2/mH9SupPNyQyLfCZw/czhLhiokcV6eKjs5w6L7fS2U0j8an6NHbMKe9ZEOtRb6tOX7s7M0E/yjFg==","mode":420,"size":8945},"dist/configs/flat/all.js":{"checkedAt":1794532098933,"integrity":"sha512-pUGLD6XNFhFvqlSJDLFWCirdeUVIlg8hsfCtojPttt2mir7DX2Ta1wePub07l5/S3J/JtnxWyRHQjHEnLtI+CA==","mode":420,"size":10194},"dist/rules/prefer-optional-chain-utils/analyzeChain.js":{"checkedAt":1794532098933,"integrity":"sha512-3kZBgNCP+sicQ07WtB/5QYV4WZmqRjpX452sHOw4bLeO6Jk4KQ9uCNlJ+FrVqbjG8kf7k+3c90pnni0r0WYv2g==","mode":420,"size":25831},"dist/rules/array-type.js":{"checkedAt":1794532098933,"integrity":"sha512-mGqNsW4PDbSoc18FfxAzVZVXw+yqgk76DDh4V9FAz6mG6WUJl73oW0sk3XTGVSe1jhC+ZWpTopXU0KfL1UNN7g==","mode":420,"size":10432},"dist/util/assertionFunctionUtils.js":{"checkedAt":1794532098933,"integrity":"sha512-KhSIo0ccyWTuAUo+sIgRMmFg9OQdDZu0cM57gz4WM6w+S3GIgNvmXJZBNizdyD53ZO1F5V82jhVGBFWkfptAqg==","mode":420,"size":4734},"dist/util/astUtils.js":{"checkedAt":1794532098933,"integrity":"sha512-B1gnpEGni4yUVmHowqvUEl2hEp2dU9Mzgy1fpg4WFIrTsl7v4B3Ffe9SQqalyWsFrDeZhTSGdjxqopXHXJV0tA==","mode":420,"size":4564},"dist/rules/await-thenable.js":{"checkedAt":1794532098934,"integrity":"sha512-6A6csYDpPZeFPQHtFCchNpOJTCbe5+RXQhK1PG8HWZfHTx739ez8DQQDy2rEOQrKf8mWqpokIfHbFwtBpkmI8g==","mode":420,"size":10742},"dist/rules/ban-ts-comment.js":{"checkedAt":1794532098934,"integrity":"sha512-hdGMLhT5+DUA3MOGDUUdvNn1d8vyZeXBUvd1f0RCvyY0jfaylAp3jmtMAFg9Y6ilhvd5+xQN9LkJFHGrQLbJ4w==","mode":420,"size":9718},"dist/rules/ban-tslint-comment.js":{"checkedAt":1794532098934,"integrity":"sha512-shhN84E3Zy5iJUcDzW/lGs97Lv7I+fPbVWrz1fq7Rm2OiO5nR/fXjlI04TeLO3aKxvf4e5pmPqiYfMep4kpVpg==","mode":420,"size":2191},"dist/configs/eslintrc/base.js":{"checkedAt":1794532098934,"integrity":"sha512-EEmRIaZW+ycv+ToZWzSHMqxhq1ZvJdnZaSBiIBE1rewnt9dnmOwVAPGsAZt7w8ABf7hzt1lWTasltfqh6XCCMg==","mode":420,"size":159},"dist/configs/flat/base.js":{"checkedAt":1794532098934,"integrity":"sha512-9W6RWEHu2AsOVgz9ejLF335Wj2FdYUXre9wtB21FJc8gZ/HcyyEXFnpdCph1n0vEZTumJTaXMQfEihG77vS/VQ==","mode":420,"size":567},"dist/rules/prefer-optional-chain-utils/checkNullishAndReport.js":{"checkedAt":1794532098934,"integrity":"sha512-7VvtBlcGVkgOFBzzz203Q3ADKVHk/bOcIg/9uiveU6RmjO0+1GbDhK7ktwr19qodlkrEHjLHhfqSkx85oOWX7Q==","mode":420,"size":2041},"dist/rules/class-literal-property-style.js":{"checkedAt":1794532098934,"integrity":"sha512-1N+rsFiefiLp93cgUGDGjB+sD2CsruTiA2Wl6JIuC5duKrPSmrUG5KcaNDIVCHCGKBPg98HbVdBRibUGtc/LFg==","mode":420,"size":7032},"dist/rules/class-methods-use-this.js":{"checkedAt":1794532098935,"integrity":"sha512-qXormlcNYVIvpEaXIR986J2ax0oeWFEo4ZKl1y/Z+T9MzYZJSjwsLQE+B9xRoB17lbwi8anreesLUHxUKbY0aw==","mode":420,"size":8607},"dist/util/collectUnusedVariables.js":{"checkedAt":1794532098935,"integrity":"sha512-/ak6YOr1zRM4XLGp0k7oXrLFOVxh2++yymF4nRgSr2W5H2s5BduYTnYXSwb+CW5Ss/Qnyv43DmLbG6koRVRf0g==","mode":420,"size":24279},"dist/rules/prefer-optional-chain-utils/compareNodes.js":{"checkedAt":1794532098935,"integrity":"sha512-phrHsZnNse1lFgAx0lSZhjCUboS1mINgcjlNt36dCFNnABccbF6HtyOeTj7OMP4b1alvpzrfOm/P8HFX3KJxtQ==","mode":420,"size":14851},"dist/rules/consistent-generic-constructors.js":{"checkedAt":1794532098935,"integrity":"sha512-bNlYFKgKbuLLr0NAEvYaTBnAQBzSMUjrYKPmHRgEkL40eyY317xhlNC1n0i6rjPiYGpMvT24eLckzeyWSvqbOQ==","mode":420,"size":5703},"dist/rules/consistent-indexed-object-style.js":{"checkedAt":1794532098935,"integrity":"sha512-fW+JIQdYo1eSgT5Zf/PsUKjBAUS8kM6d3gdAcqnvC67l9QHUEsqmGAdwtpSm9Cn8bFLK8qgUG1RWDPfttbzCmw==","mode":420,"size":12205},"dist/rules/consistent-return.js":{"checkedAt":1794532098935,"integrity":"sha512-StdBv/8bd1fH/5tFu1JjUHrSn3479gLHcCrqXboU/JwJA74v58ZGxvmUTqseFYboSs2g/3O6AkyvHAvtMki8Hw==","mode":420,"size":5463},"dist/rules/consistent-type-assertions.js":{"checkedAt":1794532098936,"integrity":"sha512-76QLJmHtEIPJ1vtmcLwOuLbqCSqhbARDBhR2Dp/6b2TFtNusQsQu7lm+mWbUkXgl7pYOTzEmzHuItjngyUwJWA==","mode":420,"size":12372},"dist/rules/consistent-type-definitions.js":{"checkedAt":1794532098936,"integrity":"sha512-JdO9Lmx1vpn7M0BCZGRpWbWadKGQBxW2hnnUKdNuNtaRjDehi3nY3L1nfo+AjFKzasl21aBbH9SyYHS6aSOgXw==","mode":420,"size":5199},"dist/rules/consistent-type-exports.js":{"checkedAt":1794532098936,"integrity":"sha512-JmPVIuRZFqOUxilpND3dxOZbTKWy61a04hfj9/sA4AmTE+YSo8KDxbYEsfSAqLrikzH7YHAZX6qaWN7KL7a+rw==","mode":420,"size":16338},"dist/rules/consistent-type-imports.js":{"checkedAt":1794532098936,"integrity":"sha512-JH+nEJOF9VHsDNQgJuL4eYYphm2WvkLine truncated
@@ -0,0 +1,4 @@
import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts';
export default function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][];
export declare function sortComparator<T extends SourceMapSegment | ReverseSegment>(a: T, b: T): number;
//# sourceMappingURL=sort.d.ts.map
@@ -0,0 +1,28 @@
import {useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7} from "./context.module.js";
import {NumberFormatter as $JFEdn$NumberFormatter} from "@internationalized/number";
import {useMemo as $JFEdn$useMemo} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $a916eb452884faea$export$b7a616150fdb9f44(options = {}) {
let { locale: locale } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
return (0, $JFEdn$useMemo)(()=>new (0, $JFEdn$NumberFormatter)(locale, options), [
locale,
options
]);
}
export {$a916eb452884faea$export$b7a616150fdb9f44 as useNumberFormatter};
//# sourceMappingURL=useNumberFormatter.module.js.map
@@ -0,0 +1,32 @@
let Declaration = require('../declaration')
let utils = require('./grid-utils')
class PlaceSelf extends Declaration {
/**
* Translate place-self to separate -ms- prefixed properties
*/
insert(decl, prefix, prefixes) {
if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
// prevent doubling of prefixes
if (decl.parent.some(i => i.prop === '-ms-grid-row-align')) {
return undefined
}
let [[first, second]] = utils.parse(decl)
if (second) {
utils.insertDecl(decl, 'grid-row-align', first)
utils.insertDecl(decl, 'grid-column-align', second)
} else {
utils.insertDecl(decl, 'grid-row-align', first)
utils.insertDecl(decl, 'grid-column-align', first)
}
return undefined
}
}
PlaceSelf.names = ['place-self']
module.exports = PlaceSelf
@@ -0,0 +1,57 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var $gOPD = require('gopd');
var $preventExtensions = GetIntrinsic('%Object.preventExtensions%', true);
var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true);
var forEach = require('../helpers/forEach');
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
// https://262.ecma-international.org/6.0/#sec-setintegritylevel
module.exports = function SetIntegrityLevel(O, level) {
if (!isObject(O)) {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (level !== 'sealed' && level !== 'frozen') {
throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`');
}
if (!$preventExtensions) {
throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support');
}
var status = $preventExtensions(O);
if (!status) {
return false;
}
if (!$gOPN) {
throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support');
}
var theKeys = $gOPN(O);
if (level === 'sealed') {
forEach(theKeys, function (k) {
DefinePropertyOrThrow(O, k, { configurable: false });
});
} else if (level === 'frozen') {
forEach(theKeys, function (k) {
var currentDesc = $gOPD(O, k);
if (typeof currentDesc !== 'undefined') {
var desc;
if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) {
desc = { configurable: false };
} else {
desc = { configurable: false, writable: false };
}
DefinePropertyOrThrow(O, k, desc);
}
});
}
return true;
};
@@ -0,0 +1 @@
{"name":"@heroui/checkbox","version":"2.3.9","requiresBuild":false,"files":{"dist/checkbox-group-context.js":{"checkedAt":1794532107581,"integrity":"sha512-UluyGTw9M0COs6C3bLrvzVG6sLcZDsOJs3W6mU017qwPsTl8CNzshigfzFub1QRY/EIz0ur9gfI63RY6197TPw==","mode":420,"size":1455},"dist/checkbox-group.js":{"checkedAt":1794532107582,"integrity":"sha512-eH8OFElh3+Dn3kO3jifeWAPDJvu1wotoajMkI+iTZ0s4mOzEOkbbZ5LaMb0qZtblBmXwkNtlitMwSl4RasdCog==","mode":420,"size":8292},"dist/checkbox-icon.js":{"checkedAt":1794532107582,"integrity":"sha512-oJuqSV05MwNW9MGKRWCWftkdCqOE2QA+EyH6WpKe1z1yJoFwI2+blsOG/rbHYMzGrnFUoPKFXGZr9xEsj6QZMQ==","mode":420,"size":2433},"dist/checkbox.js":{"checkedAt":1794532107582,"integrity":"sha512-pCK+eRENewmfyMQEdnhjGHgBfuyMPe0pzMeZzIqXljrqGawgtTjeg0p21ZIgvLF3d52DHOsqWflcjejYB3Dolw==","mode":420,"size":12984},"dist/index.js":{"checkedAt":1794532107583,"integrity":"sha512-JFZPUpWXAvwmawgjYVc0n5yevX9Yd9FoMHtGhOI51g6fvsb29lMidMusOL8+P0Le++lgMpCEzijMkoI9FpoClQ==","mode":420,"size":20409},"dist/use-checkbox-group.js":{"checkedAt":1794532107583,"integrity":"sha512-ep1ceNcl9dV3sNm07bmYVCuXemME7iiG9SeiX10XZxR0A9KPwl5km6y6GA1bx9AH9irjbXQRW7/5kUbyEgGvzw==","mode":420,"size":6845},"dist/use-checkbox.js":{"checkedAt":1794532107583,"integrity":"sha512-8PchS3fDhgaZeQwcKzk89iWppAEwKKhh/43+G7pj9RySqzZvkb9Mgx/9uphfKZLOT7cjkeRCWDCoDt5GC85Frg==","mode":420,"size":10555},"package.json":{"checkedAt":1794532107583,"integrity":"sha512-3hQOCq4XkLhkUqCgDu+6XNXubSYnwVkejGNE7QeYWf5eovCWwrdoX3KKTjMJY4vi2x0Qp9LTuZe+8h1mIvV6Jg==","mode":420,"size":1919},"README.md":{"checkedAt":1794532107583,"integrity":"sha512-QINNPZIi01BPVq5Ug10YBW8vDW3bccAvulhld+IeQFwgKJOHTbO1bmTTMybJHzebGoQ8BvLjgps+vjX8Mxrm+w==","mode":420,"size":608},"dist/checkbox-group-context.mjs":{"checkedAt":1794532107583,"integrity":"sha512-KRfVUJixLmClYgOHOK8sqWNfuPo90IU06K1CTlPOpg7wAcZOh2QVd1dVUPtAoy3ES2ethpyPT2GYgu+GQmsGvg==","mode":420,"size":168},"dist/checkbox-group.mjs":{"checkedAt":1794532107584,"integrity":"sha512-NKqVs2Ks9bnLFVPZrX/IZMlRah1ta8Fwy2LFHbXWnu+U90W2MzLCPyocbGrv8ad4tSKXR5spOELsbnEUSdcQGA==","mode":420,"size":189},"dist/checkbox-icon.mjs":{"checkedAt":1794532107584,"integrity":"sha512-EMJEh+WfuQ1dBxnX35pQIPC1clo0pb2xxwIY1EVXMLcHPSFoFx+aOLk0CmoJ6nLpM9xwkcTb6xIvSggvbQ76sQ==","mode":420,"size":96},"dist/checkbox.mjs":{"checkedAt":1794532107584,"integrity":"sha512-0LvVbtPk2bIj2GhEpjSsj6ciFDMnBamWGZncnzd7DTt7quwwrCsnZarpyA+8xSXtpW/nhU/ENMreSY77zqeAjQ==","mode":420,"size":208},"dist/chunk-4MFDKOXF.mjs":{"checkedAt":1794532107584,"integrity":"sha512-GJGeylVLRn0FkYhr8yCuQabPCxBMT3oTMOMuutHPsyDecNZLyTLBJ4/f2jrJx/9hEB2emULZU9eKqK+FSgzjFw==","mode":420,"size":1058},"dist/chunk-5E6Z6LLK.mjs":{"checkedAt":1794532107584,"integrity":"sha512-6wkqBKaFzHuLUP5mSVIVwYLBGPfQYwLqqcwSr3m74JWCHpl+a01UMB8kCrEIKGmgquOOqKUPIl4gIUidck9YkQ==","mode":420,"size":1263},"dist/chunk-5JTA22ZA.mjs":{"checkedAt":1794532107584,"integrity":"sha512-NL+r7jka/UlT7TEa300/GjT0qs/4GhFgxUhXmsvG7KmZXunDGdY8Hiu1AxS6BTHOqcWs9CIhb6ZENiDa4CAeOw==","mode":420,"size":8530},"dist/chunk-D7WRZFSP.mjs":{"checkedAt":1794532107585,"integrity":"sha512-PRgRm+oSOK4nhJ0E5UV3l3eK/yHkunqv1BEv9tILsM1MDN9GTlP0xFr4PnHX8c4UKcYAna5WA+o5JZDH+BTE4Q==","mode":420,"size":1214},"dist/chunk-LK575OWX.mjs":{"checkedAt":1794532107585,"integrity":"sha512-XgucBa/wONqgcjSePrT6lp2kcbL06LkeAvQzgJTbEwM0HbLpVKQ6B+A/PDa5U84NlIjcPbOXbNh9D30P7bEoEg==","mode":420,"size":288},"dist/chunk-LPCF7J76.mjs":{"checkedAt":1794532107585,"integrity":"sha512-dwgpFWHPIvuT7o3zbLXxqVbaEdhc7fb2Vu57/HgR+imGNZjzlAoDNvR9QSz5AiK/p/8RXMJaVnSRv2+a8AS4dg==","mode":420,"size":5447},"dist/index.mjs":{"checkedAt":1794532107585,"integrity":"sha512-H7YqtIPQ6k5KBQfBYyxLW2mIWKJHWtaOG3S8HvibfqNzz27hOEjUzOKt1OX4qfikmmfx4JF0e/j5jIcUVCVTVQ==","mode":420,"size":586},"dist/use-checkbox-group.mjs":{"checkedAt":1794532107585,"integrity":"sha512-EKoJMwW5amdR7wS268DlSA/Ivr6zrpqRK846m4IJ1O0XttsUeR3zrw84cQqI6ZDidQKqvDcdB1HsmyfOAj4bGg==","mode":420,"size":104},"dist/use-checkbox.mjs":{"checkedAt":1794532107585,"integrity":"sha512-4nD8gOEluvzeDeRMTsMPVaMNOYiNJ+2q7zKWRxkcPWxAXkAva/Bk8FId/sFLlWPruY/KWs4GGwkWVoxrpMn8yQ==","mode":420,"size":125},"dist/checkbox-group-context.d.ts":{"checkedAt":1794532107585,"integrity":"sha512-YMoxfl2QRUKtzxtKOONrynJZro1eLLJvjTvUDgk1giPJnhu/IRb1wYeCLJeciRhAGP5suieC/25rGspEglczfQ==","mode":420,"size":499},"dist/checkbox-group.d.ts":{"checkedAt":1794532107586,"integrity":"sha512-koMIDpdO/NUdGYCqoqSIKAVdCKwMxEGnzWppsWr/OkiqddlHp16SQkv0XmKgXD5xxjWQtyTPZHbReEvrffI6Pw==","mode":420,"size":567},"dist/checkbox-icon.d.ts":{"checkedAt":1794532107586,"integrity":"sha512-bLraJ1vZv6FMR5mjsxudPk/JxDGxbTK5B5MWvZO+uqyBkJ1OYbw7I+ygb18TlPCZiI0SMjhN21q3n7RwgDXuhQ==","mode":420,"size":510},"dist/checkbox.d.ts":{"checkedAt":1794532107586,"integrity":"sha512-XUxbHNXq6uJy39Fmt7GCqIPTLiY+NN+eZagbO0DMpElyNEkVa84OkJ6WQfgJLw1Hx4dP8gESmnIiPeZ4rYwauQ==","mode":420,"size":382},"dist/index.d.ts":{"checkedAt":1794532107586,"integrity":"sha512-jOylTiCHE4yBZ32VOWVAUSLe4GUYQup3Vmnap7fWiJOacKLine truncated
@@ -0,0 +1,16 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.esnext_iterator = void 0;
const base_config_1 = require("./base-config");
const es2015_iterable_1 = require("./es2015.iterable");
exports.esnext_iterator = {
libs: [es2015_iterable_1.es2015_iterable],
variables: [
['Iterator', base_config_1.TYPE_VALUE],
['IteratorObjectConstructor', base_config_1.TYPE],
],
};
@@ -0,0 +1,116 @@
{
"name": "@sinclair/typebox",
"version": "0.34.41",
"description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
"keywords": [
"typescript",
"json-schema",
"validate",
"typecheck"
],
"author": "sinclairzx81",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sinclairzx81/typebox"
},
"scripts": {
"test": "echo test"
},
"types": "./build/cjs/index.d.ts",
"main": "./build/cjs/index.js",
"module": "./build/esm/index.mjs",
"esm.sh": {
"bundle": false
},
"sideEffects": [
"./build/esm/type/registry/format.mjs",
"./build/esm/type/registry/type.mjs",
"./build/esm/type/system/policy.mjs",
"./build/cjs/type/registry/format.js",
"./build/cjs/type/registry/type.js",
"./build/cjs/type/system/policy.js"
],
"exports": {
".": {
"require": {
"types": "./build/cjs/index.d.ts",
"default": "./build/cjs/index.js"
},
"import": {
"types": "./build/esm/index.d.mts",
"default": "./build/esm/index.mjs"
}
},
"./compiler": {
"require": {
"types": "./build/cjs/compiler/index.d.ts",
"default": "./build/cjs/compiler/index.js"
},
"import": {
"types": "./build/esm/compiler/index.d.mts",
"default": "./build/esm/compiler/index.mjs"
}
},
"./errors": {
"require": {
"types": "./build/cjs/errors/index.d.ts",
"default": "./build/cjs/errors/index.js"
},
"import": {
"types": "./build/esm/errors/index.d.mts",
"default": "./build/esm/errors/index.mjs"
}
},
"./parser": {
"require": {
"types": "./build/cjs/parser/index.d.ts",
"default": "./build/cjs/parser/index.js"
},
"import": {
"types": "./build/esm/parser/index.d.mts",
"default": "./build/esm/parser/index.mjs"
}
},
"./syntax": {
"require": {
"types": "./build/cjs/syntax/index.d.ts",
"default": "./build/cjs/syntax/index.js"
},
"import": {
"types": "./build/esm/syntax/index.d.mts",
"default": "./build/esm/syntax/index.mjs"
}
},
"./system": {
"require": {
"types": "./build/cjs/system/index.d.ts",
"default": "./build/cjs/system/index.js"
},
"import": {
"types": "./build/esm/system/index.d.mts",
"default": "./build/esm/system/index.mjs"
}
},
"./type": {
"require": {
"types": "./build/cjs/type/index.d.ts",
"default": "./build/cjs/type/index.js"
},
"import": {
"types": "./build/esm/type/index.d.mts",
"default": "./build/esm/type/index.mjs"
}
},
"./value": {
"require": {
"types": "./build/cjs/value/index.d.ts",
"default": "./build/cjs/value/index.js"
},
"import": {
"types": "./build/esm/value/index.d.mts",
"default": "./build/esm/value/index.mjs"
}
}
}
}
@@ -0,0 +1,34 @@
/**
* @fileoverview The instance of Ajv validator.
* @author Evgeny Poberezkin
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const Ajv = require("ajv"),
metaSchema = require("ajv/lib/refs/json-schema-draft-04.json");
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
module.exports = (additionalOptions = {}) => {
const ajv = new Ajv({
meta: false,
useDefaults: true,
validateSchema: false,
missingRefs: "ignore",
verbose: true,
schemaId: "auto",
...additionalOptions,
});
ajv.addMetaSchema(metaSchema);
// eslint-disable-next-line no-underscore-dangle -- Ajv's API
ajv._opts.defaultMeta = metaSchema.id;
return ajv;
};
@@ -0,0 +1,83 @@
import * as fastq from '../'
import { promise as queueAsPromised } from '../'
// Basic example
const queue = fastq(worker, 1)
queue.push('world', (err, result) => {
if (err) throw err
console.log('the result is', result)
})
queue.push('push without cb')
queue.concurrency
queue.drain()
queue.empty = () => undefined
console.log('the queue tasks are', queue.getQueue())
queue.idle()
queue.kill()
queue.killAndDrain()
queue.length
queue.pause()
queue.resume()
queue.running()
queue.saturated = () => undefined
queue.unshift('world', (err, result) => {
if (err) throw err
console.log('the result is', result)
})
queue.unshift('unshift without cb')
function worker(task: any, cb: fastq.done) {
cb(null, 'hello ' + task)
}
// Generics example
interface GenericsContext {
base: number;
}
const genericsQueue = fastq<GenericsContext, number, string>({ base: 6 }, genericsWorker, 1)
genericsQueue.push(7, (err, done) => {
if (err) throw err
console.log('the result is', done)
})
genericsQueue.unshift(7, (err, done) => {
if (err) throw err
console.log('the result is', done)
})
function genericsWorker(this: GenericsContext, task: number, cb: fastq.done<string>) {
cb(null, 'the meaning of life is ' + (this.base * task))
}
const queue2 = queueAsPromised(asyncWorker, 1)
async function asyncWorker(task: any) {
return 'hello ' + task
}
async function run () {
await queue.push(42)
await queue.unshift(42)
}
run()
@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tryBuildGetPlanOptionsFromResolvedValueElementMetadata = tryBuildGetPlanOptionsFromResolvedValueElementMetadata;
const common_1 = require("@inversifyjs/common");
const ResolvedValueElementMetadataKind_1 = require("../../metadata/models/ResolvedValueElementMetadataKind");
function tryBuildGetPlanOptionsFromResolvedValueElementMetadata(resolvedValueElementMetadata) {
let tag;
if (resolvedValueElementMetadata.tags.size === 0) {
tag = undefined;
}
else if (resolvedValueElementMetadata.tags.size === 1) {
const [key, value] = resolvedValueElementMetadata.tags.entries().next().value;
tag = { key, value };
}
else {
return undefined;
}
const serviceIdentifier = common_1.LazyServiceIdentifier.is(resolvedValueElementMetadata.value)
? resolvedValueElementMetadata.value.unwrap()
: resolvedValueElementMetadata.value;
if (resolvedValueElementMetadata.kind ===
ResolvedValueElementMetadataKind_1.ResolvedValueElementMetadataKind.multipleInjection) {
return {
chained: resolvedValueElementMetadata.chained,
isMultiple: true,
name: resolvedValueElementMetadata.name,
optional: resolvedValueElementMetadata.optional,
serviceIdentifier,
tag,
};
}
else {
return {
isMultiple: false,
name: resolvedValueElementMetadata.name,
optional: resolvedValueElementMetadata.optional,
serviceIdentifier,
tag,
};
}
}
//# sourceMappingURL=tryBuildGetPlanOptionsFromResolvedValueElementMetadata.js.map
@@ -0,0 +1,389 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComparisonType = exports.NullishComparisonType = exports.OperandValidity = void 0;
exports.gatherLogicalOperands = gatherLogicalOperands;
const utils_1 = require("@typescript-eslint/utils");
const ts_api_utils_1 = require("ts-api-utils");
const ts = __importStar(require("typescript"));
const util_1 = require("../../util");
var ComparisonValueType;
(function (ComparisonValueType) {
ComparisonValueType["Null"] = "Null";
ComparisonValueType["Undefined"] = "Undefined";
ComparisonValueType["UndefinedStringLiteral"] = "UndefinedStringLiteral";
})(ComparisonValueType || (ComparisonValueType = {}));
var OperandValidity;
(function (OperandValidity) {
OperandValidity["Valid"] = "Valid";
OperandValidity["Last"] = "Last";
OperandValidity["Invalid"] = "Invalid";
})(OperandValidity || (exports.OperandValidity = OperandValidity = {}));
var NullishComparisonType;
(function (NullishComparisonType) {
/** `x != null`, `x != undefined` */
NullishComparisonType["NotEqualNullOrUndefined"] = "NotEqualNullOrUndefined";
/** `x == null`, `x == undefined` */
NullishComparisonType["EqualNullOrUndefined"] = "EqualNullOrUndefined";
/** `x !== null` */
NullishComparisonType["NotStrictEqualNull"] = "NotStrictEqualNull";
/** `x === null` */
NullishComparisonType["StrictEqualNull"] = "StrictEqualNull";
/** `x !== undefined`, `typeof x !== 'undefined'` */
NullishComparisonType["NotStrictEqualUndefined"] = "NotStrictEqualUndefined";
/** `x === undefined`, `typeof x === 'undefined'` */
NullishComparisonType["StrictEqualUndefined"] = "StrictEqualUndefined";
/** `!x` */
NullishComparisonType["NotBoolean"] = "NotBoolean";
/** `x` */
NullishComparisonType["Boolean"] = "Boolean";
})(NullishComparisonType || (exports.NullishComparisonType = NullishComparisonType = {}));
var ComparisonType;
(function (ComparisonType) {
ComparisonType["NotEqual"] = "NotEqual";
ComparisonType["Equal"] = "Equal";
ComparisonType["NotStrictEqual"] = "NotStrictEqual";
ComparisonType["StrictEqual"] = "StrictEqual";
})(ComparisonType || (exports.ComparisonType = ComparisonType = {}));
const NULLISH_FLAGS = ts.TypeFlags.Null | ts.TypeFlags.Undefined;
function isValidFalseBooleanCheckType(node, disallowFalseyLiteral, parserServices, options) {
const type = parserServices.getTypeAtLocation(node);
const types = (0, ts_api_utils_1.unionConstituents)(type);
if (disallowFalseyLiteral &&
/*
```
declare const x: false | {a: string};
x && x.a;
!x || x.a;
```
We don't want to consider these two cases because the boolean expression
narrows out the non-nullish falsy cases - so converting the chain to `x?.a`
would introduce a build error
*/ (types.some(t => (0, ts_api_utils_1.isBooleanLiteralType)(t) && t.intrinsicName === 'false') ||
types.some(t => (0, ts_api_utils_1.isStringLiteralType)(t) && t.value === '') ||
types.some(t => (0, ts_api_utils_1.isNumberLiteralType)(t) && t.value === 0) ||
types.some(t => (0, ts_api_utils_1.isBigIntLiteralType)(t) && t.value.base10Value === '0'))) {
return false;
}
let allowedFlags = NULLISH_FLAGS | ts.TypeFlags.Object;
if (options.checkAny === true) {
allowedFlags |= ts.TypeFlags.Any;
}
if (options.checkUnknown === true) {
allowedFlags |= ts.TypeFlags.Unknown;
}
if (options.checkString === true) {
allowedFlags |= ts.TypeFlags.StringLike;
}
if (options.checkNumber === true) {
allowedFlags |= ts.TypeFlags.NumberLike;
}
if (options.checkBoolean === true) {
allowedFlags |= ts.TypeFlags.BooleanLike;
}
if (options.checkBigInt === true) {
allowedFlags |= ts.TypeFlags.BigIntLike;
}
return types.every(t => (0, util_1.isTypeFlagSet)(t, allowedFlags));
}
function gatherLogicalOperands(node, parserServices, sourceCode, options) {
const result = [];
const { newlySeenLogicals, operands } = flattenLogicalOperands(node);
for (const operand of operands) {
const areMoreOperands = operand !== operands.at(-1);
switch (operand.type) {
case utils_1.AST_NODE_TYPES.BinaryExpression: {
// check for "yoda" style logical: null != x
const { comparedExpression, comparedValue, isYoda } = (() => {
// non-yoda checks are by far the most common, so check for them first
const comparedValueRight = getComparisonValueType(operand.right);
if (comparedValueRight) {
return {
comparedExpression: operand.left,
comparedValue: comparedValueRight,
isYoda: false,
};
}
return {
comparedExpression: operand.right,
comparedValue: getComparisonValueType(operand.left),
isYoda: true,
};
})();
if (comparedValue === ComparisonValueType.UndefinedStringLiteral) {
if (comparedExpression.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
comparedExpression.operator === 'typeof') {
const argument = comparedExpression.argument;
if (argument.type === utils_1.AST_NODE_TYPES.Identifier &&
// typeof window === 'undefined'
(0, util_1.isReferenceToGlobalFunction)(argument.name, argument, sourceCode)) {
result.push({ type: OperandValidity.Invalid });
continue;
}
// typeof x.y === 'undefined'
result.push({
comparedName: comparedExpression.argument,
comparisonType: operand.operator.startsWith('!')
? NullishComparisonType.NotStrictEqualUndefined
: NullishComparisonType.StrictEqualUndefined,
isYoda,
node: operand,
type: OperandValidity.Valid,
});
continue;
}
// y === 'undefined'
result.push({ type: OperandValidity.Invalid });
continue;
}
if (operand.operator.startsWith('!') !== (node.operator === '||')) {
switch (operand.operator) {
case '!=':
case '==':
if (comparedValue === ComparisonValueType.Null ||
comparedValue === ComparisonValueType.Undefined) {
// x == null, x == undefined
result.push({
comparedName: comparedExpression,
comparisonType: operand.operator.startsWith('!')
? NullishComparisonType.NotEqualNullOrUndefined
: NullishComparisonType.EqualNullOrUndefined,
isYoda,
node: operand,
type: OperandValidity.Valid,
});
continue;
}
break;
case '!==':
case '===': {
const comparedName = comparedExpression;
switch (comparedValue) {
case ComparisonValueType.Null:
result.push({
comparedName,
comparisonType: operand.operator.startsWith('!')
? NullishComparisonType.NotStrictEqualNull
: NullishComparisonType.StrictEqualNull,
isYoda,
node: operand,
type: OperandValidity.Valid,
});
continue;
case ComparisonValueType.Undefined:
result.push({
comparedName,
comparisonType: operand.operator.startsWith('!')
? NullishComparisonType.NotStrictEqualUndefined
: NullishComparisonType.StrictEqualUndefined,
isYoda,
node: operand,
type: OperandValidity.Valid,
});
continue;
}
}
}
}
// x == something :(
// x === something :(
// x != something :(
// x !== something :(
const binaryComparisonChain = getBinaryComparisonChain(operand);
if (binaryComparisonChain) {
const { comparedName, comparedValue, isYoda } = binaryComparisonChain;
switch (operand.operator) {
case '==':
case '===': {
const comparisonType = operand.operator === '=='
? ComparisonType.Equal
: ComparisonType.StrictEqual;
result.push({
comparedName,
comparisonType,
comparisonValue: comparedValue,
isYoda,
node: operand,
type: OperandValidity.Last,
});
continue;
}
case '!=':
case '!==': {
const comparisonType = operand.operator === '!='
? ComparisonType.NotEqual
: ComparisonType.NotStrictEqual;
result.push({
comparedName,
comparisonType,
comparisonValue: comparedValue,
isYoda,
node: operand,
type: OperandValidity.Last,
});
continue;
}
}
}
result.push({ type: OperandValidity.Invalid });
continue;
}
case utils_1.AST_NODE_TYPES.UnaryExpression:
if (operand.operator === '!' &&
(!areMoreOperands ||
isValidFalseBooleanCheckType(operand.argument, node.operator === '||', parserServices, options))) {
result.push({
comparedName: operand.argument,
comparisonType: NullishComparisonType.NotBoolean,
isYoda: false,
node: operand,
type: OperandValidity.Valid,
});
continue;
}
result.push({ type: OperandValidity.Invalid });
continue;
case utils_1.AST_NODE_TYPES.LogicalExpression:
// explicitly ignore the mixed logical expression cases
result.push({ type: OperandValidity.Invalid });
continue;
default:
if (!areMoreOperands ||
isValidFalseBooleanCheckType(operand, node.operator === '&&', parserServices, options)) {
result.push({
comparedName: operand,
comparisonType: NullishComparisonType.Boolean,
isYoda: false,
node: operand,
type: OperandValidity.Valid,
});
}
else {
result.push({ type: OperandValidity.Invalid });
}
continue;
}
}
return {
newlySeenLogicals,
operands: result,
};
/*
The AST is always constructed such the first element is always the deepest element.
I.e. for this code: `foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz`
The AST will look like this:
{
left: {
left: {
left: foo
right: foo.bar
}
right: foo.bar.baz
}
right: foo.bar.baz.buzz
}
So given any logical expression, we can perform a depth-first traversal to get
the operands in order.
Note that this function purposely does not inspect mixed logical expressions
like `foo || foo.bar && foo.bar.baz` - separate selector
*/
function flattenLogicalOperands(node) {
const operands = [];
const newlySeenLogicals = new Set([node]);
const stack = [node.right, node.left];
let current;
while ((current = stack.pop())) {
if (current.type === utils_1.AST_NODE_TYPES.LogicalExpression &&
current.operator === node.operator) {
newlySeenLogicals.add(current);
stack.push(current.right);
stack.push(current.left);
}
else {
operands.push(current);
}
}
return {
newlySeenLogicals,
operands,
};
}
function getComparisonValueType(node) {
switch (node.type) {
case utils_1.AST_NODE_TYPES.Literal:
// eslint-disable-next-line eqeqeq, @typescript-eslint/internal/eqeq-nullish -- intentional exact comparison against null
if (node.value === null && node.raw === 'null') {
return ComparisonValueType.Null;
}
if (node.value === 'undefined') {
return ComparisonValueType.UndefinedStringLiteral;
}
return null;
case utils_1.AST_NODE_TYPES.Identifier:
if (node.name === 'undefined') {
return ComparisonValueType.Undefined;
}
return null;
}
return null;
}
function getBinaryComparisonChain(node) {
const { left, right } = node;
let isYoda = false;
const isLeftMemberExpression = left.type === utils_1.AST_NODE_TYPES.MemberExpression;
const isRightMemberExpression = right.type === utils_1.AST_NODE_TYPES.MemberExpression;
if (isLeftMemberExpression && !isRightMemberExpression) {
const [comparedName, comparedValue] = [left, right];
return {
comparedName,
comparedValue,
isYoda,
};
}
if (!isLeftMemberExpression && isRightMemberExpression) {
const [comparedName, comparedValue] = [right, left];
isYoda = true;
return {
comparedName,
comparedValue,
isYoda,
};
}
return null;
}
}
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFixOrSuggest = getFixOrSuggest;
function getFixOrSuggest({ fixOrSuggest, suggestion, }) {
switch (fixOrSuggest) {
case 'fix':
return { fix: suggestion.fix };
case 'none':
return undefined;
case 'suggest':
return { suggest: [suggestion] };
}
}
@@ -0,0 +1,496 @@
import colorString from 'color-string';
import convert from 'color-convert';
const skippedModels = [
// To be honest, I don't really feel like keyword belongs in color convert, but eh.
'keyword',
// Gray conflicts with some method names, and has its own method defined.
'gray',
// Shouldn't really be in color-convert either...
'hex',
];
const hashedModelKeys = {};
for (const model of Object.keys(convert)) {
hashedModelKeys[[...convert[model].labels].sort().join('')] = model;
}
const limiters = {};
function Color(object, model) {
if (!(this instanceof Color)) {
return new Color(object, model);
}
if (model && model in skippedModels) {
model = null;
}
if (model && !(model in convert)) {
throw new Error('Unknown model: ' + model);
}
let i;
let channels;
if (object == null) { // eslint-disable-line no-eq-null,eqeqeq
this.model = 'rgb';
this.color = [0, 0, 0];
this.valpha = 1;
} else if (object instanceof Color) {
this.model = object.model;
this.color = [...object.color];
this.valpha = object.valpha;
} else if (typeof object === 'string') {
const result = colorString.get(object);
if (result === null) {
throw new Error('Unable to parse color from string: ' + object);
}
this.model = result.model;
channels = convert[this.model].channels;
this.color = result.value.slice(0, channels);
this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
} else if (object.length > 0) {
this.model = model || 'rgb';
channels = convert[this.model].channels;
const newArray = Array.prototype.slice.call(object, 0, channels);
this.color = zeroArray(newArray, channels);
this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
} else if (typeof object === 'number') {
// This is always RGB - can be converted later on.
this.model = 'rgb';
this.color = [
(object >> 16) & 0xFF,
(object >> 8) & 0xFF,
object & 0xFF,
];
this.valpha = 1;
} else {
this.valpha = 1;
const keys = Object.keys(object);
if ('alpha' in object) {
keys.splice(keys.indexOf('alpha'), 1);
this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
}
const hashedKeys = keys.sort().join('');
if (!(hashedKeys in hashedModelKeys)) {
throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
}
this.model = hashedModelKeys[hashedKeys];
const {labels} = convert[this.model];
const color = [];
for (i = 0; i < labels.length; i++) {
color.push(object[labels[i]]);
}
this.color = zeroArray(color);
}
// Perform limitations (clamping, etc.)
if (limiters[this.model]) {
channels = convert[this.model].channels;
for (i = 0; i < channels; i++) {
const limit = limiters[this.model][i];
if (limit) {
this.color[i] = limit(this.color[i]);
}
}
}
this.valpha = Math.max(0, Math.min(1, this.valpha));
if (Object.freeze) {
Object.freeze(this);
}
}
Color.prototype = {
toString() {
return this.string();
},
toJSON() {
return this[this.model]();
},
string(places) {
let self = this.model in colorString.to ? this : this.rgb();
self = self.round(typeof places === 'number' ? places : 1);
const arguments_ = self.valpha === 1 ? self.color : [...self.color, this.valpha];
return colorString.to[self.model](...arguments_);
},
percentString(places) {
const self = this.rgb().round(typeof places === 'number' ? places : 1);
const arguments_ = self.valpha === 1 ? self.color : [...self.color, this.valpha];
return colorString.to.rgb.percent(...arguments_);
},
array() {
return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
},
object() {
const result = {};
const {channels} = convert[this.model];
const {labels} = convert[this.model];
for (let i = 0; i < channels; i++) {
result[labels[i]] = this.color[i];
}
if (this.valpha !== 1) {
result.alpha = this.valpha;
}
return result;
},
unitArray() {
const rgb = this.rgb().color;
rgb[0] /= 255;
rgb[1] /= 255;
rgb[2] /= 255;
if (this.valpha !== 1) {
rgb.push(this.valpha);
}
return rgb;
},
unitObject() {
const rgb = this.rgb().object();
rgb.r /= 255;
rgb.g /= 255;
rgb.b /= 255;
if (this.valpha !== 1) {
rgb.alpha = this.valpha;
}
return rgb;
},
round(places) {
places = Math.max(places || 0, 0);
return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
},
alpha(value) {
if (value !== undefined) {
return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
}
return this.valpha;
},
// Rgb
red: getset('rgb', 0, maxfn(255)),
green: getset('rgb', 1, maxfn(255)),
blue: getset('rgb', 2, maxfn(255)),
hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => ((value % 360) + 360) % 360),
saturationl: getset('hsl', 1, maxfn(100)),
lightness: getset('hsl', 2, maxfn(100)),
saturationv: getset('hsv', 1, maxfn(100)),
value: getset('hsv', 2, maxfn(100)),
chroma: getset('hcg', 1, maxfn(100)),
gray: getset('hcg', 2, maxfn(100)),
white: getset('hwb', 1, maxfn(100)),
wblack: getset('hwb', 2, maxfn(100)),
cyan: getset('cmyk', 0, maxfn(100)),
magenta: getset('cmyk', 1, maxfn(100)),
yellow: getset('cmyk', 2, maxfn(100)),
black: getset('cmyk', 3, maxfn(100)),
x: getset('xyz', 0, maxfn(95.047)),
y: getset('xyz', 1, maxfn(100)),
z: getset('xyz', 2, maxfn(108.833)),
l: getset('lab', 0, maxfn(100)),
a: getset('lab', 1),
b: getset('lab', 2),
keyword(value) {
if (value !== undefined) {
return new Color(value);
}
return convert[this.model].keyword(this.color);
},
hex(value) {
if (value !== undefined) {
return new Color(value);
}
return colorString.to.hex(...this.rgb().round().color);
},
hexa(value) {
if (value !== undefined) {
return new Color(value);
}
const rgbArray = this.rgb().round().color;
let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
if (alphaHex.length === 1) {
alphaHex = '0' + alphaHex;
}
return colorString.to.hex(...rgbArray) + alphaHex;
},
rgbNumber() {
const rgb = this.rgb().color;
return ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);
},
luminosity() {
// http://www.w3.org/TR/WCAG20/#relativeluminancedef
const rgb = this.rgb().color;
const lum = [];
for (const [i, element] of rgb.entries()) {
const chan = element / 255;
lum[i] = (chan <= 0.04045) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
}
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
},
contrast(color2) {
// http://www.w3.org/TR/WCAG20/#contrast-ratiodef
const lum1 = this.luminosity();
const lum2 = color2.luminosity();
if (lum1 > lum2) {
return (lum1 + 0.05) / (lum2 + 0.05);
}
return (lum2 + 0.05) / (lum1 + 0.05);
},
level(color2) {
// https://www.w3.org/TR/WCAG/#contrast-enhanced
const contrastRatio = this.contrast(color2);
if (contrastRatio >= 7) {
return 'AAA';
}
return (contrastRatio >= 4.5) ? 'AA' : '';
},
isDark() {
// YIQ equation from http://24ways.org/2010/calculating-color-contrast
const rgb = this.rgb().color;
const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
return yiq < 128;
},
isLight() {
return !this.isDark();
},
negate() {
const rgb = this.rgb();
for (let i = 0; i < 3; i++) {
rgb.color[i] = 255 - rgb.color[i];
}
return rgb;
},
lighten(ratio) {
const hsl = this.hsl();
hsl.color[2] += hsl.color[2] * ratio;
return hsl;
},
darken(ratio) {
const hsl = this.hsl();
hsl.color[2] -= hsl.color[2] * ratio;
return hsl;
},
saturate(ratio) {
const hsl = this.hsl();
hsl.color[1] += hsl.color[1] * ratio;
return hsl;
},
desaturate(ratio) {
const hsl = this.hsl();
hsl.color[1] -= hsl.color[1] * ratio;
return hsl;
},
whiten(ratio) {
const hwb = this.hwb();
hwb.color[1] += hwb.color[1] * ratio;
return hwb;
},
blacken(ratio) {
const hwb = this.hwb();
hwb.color[2] += hwb.color[2] * ratio;
return hwb;
},
grayscale() {
// http://en.wikipedia.org/wiki/Grayscale#Converting_colour_to_grayscale
const rgb = this.rgb().color;
const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
return Color.rgb(value, value, value);
},
fade(ratio) {
return this.alpha(this.valpha - (this.valpha * ratio));
},
opaquer(ratio) {
return this.alpha(this.valpha + (this.valpha * ratio));
},
rotate(degrees) {
const hsl = this.hsl();
let hue = hsl.color[0];
hue = (hue + degrees) % 360;
hue = hue < 0 ? 360 + hue : hue;
hsl.color[0] = hue;
return hsl;
},
mix(mixinColor, weight) {
// Ported from sass implementation in C
// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
if (!mixinColor || !mixinColor.rgb) {
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
}
const color1 = mixinColor.rgb();
const color2 = this.rgb();
const p = weight === undefined ? 0.5 : weight;
const w = 2 * p - 1;
const a = color1.alpha() - color2.alpha();
const w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2;
const w2 = 1 - w1;
return Color.rgb(
w1 * color1.red() + w2 * color2.red(),
w1 * color1.green() + w2 * color2.green(),
w1 * color1.blue() + w2 * color2.blue(),
color1.alpha() * p + color2.alpha() * (1 - p));
},
};
// Model conversion methods and static constructors
for (const model of Object.keys(convert)) {
if (skippedModels.includes(model)) {
continue;
}
const {channels} = convert[model];
// Conversion methods
Color.prototype[model] = function (...arguments_) {
if (this.model === model) {
return new Color(this);
}
if (arguments_.length > 0) {
return new Color(arguments_, model);
}
return new Color([...assertArray(convert[this.model][model].raw(this.color)), this.valpha], model);
};
// 'static' construction methods
Color[model] = function (...arguments_) {
let color = arguments_[0];
if (typeof color === 'number') {
color = zeroArray(arguments_, channels);
}
return new Color(color, model);
};
}
function roundTo(number, places) {
return Number(number.toFixed(places));
}
function roundToPlace(places) {
return function (number) {
return roundTo(number, places);
};
}
function getset(model, channel, modifier) {
model = Array.isArray(model) ? model : [model];
for (const m of model) {
(limiters[m] ||= [])[channel] = modifier;
}
model = model[0];
return function (value) {
let result;
if (value !== undefined) {
if (modifier) {
value = modifier(value);
}
result = this[model]();
result.color[channel] = value;
return result;
}
result = this[model]().color[channel];
if (modifier) {
result = modifier(result);
}
return result;
};
}
function maxfn(max) {
return function (v) {
return Math.max(0, Math.min(max, v));
};
}
function assertArray(value) {
return Array.isArray(value) ? value : [value];
}
function zeroArray(array, length) {
for (let i = 0; i < length; i++) {
if (typeof array[i] !== 'number') {
array[i] = 0;
}
}
return array;
}
export default Color;
@@ -0,0 +1,116 @@
export const xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
const xmlCodeMap = new Map([
[34, "&quot;"],
[38, "&amp;"],
[39, "&apos;"],
[60, "&lt;"],
[62, "&gt;"],
]);
// For compatibility with node < 4, we wrap `codePointAt`
export const getCodePoint =
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
String.prototype.codePointAt != null
? (str, index) => str.codePointAt(index)
: // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
(c, index) => (c.charCodeAt(index) & 0xfc00) === 0xd800
? (c.charCodeAt(index) - 0xd800) * 0x400 +
c.charCodeAt(index + 1) -
0xdc00 +
0x10000
: c.charCodeAt(index);
/**
* Encodes all non-ASCII characters, as well as characters not valid in XML
* documents using XML entities.
*
* If a character has no equivalent entity, a
* numeric hexadecimal reference (eg. `&#xfc;`) will be used.
*/
export function encodeXML(str) {
let ret = "";
let lastIdx = 0;
let match;
while ((match = xmlReplacer.exec(str)) !== null) {
const i = match.index;
const char = str.charCodeAt(i);
const next = xmlCodeMap.get(char);
if (next !== undefined) {
ret += str.substring(lastIdx, i) + next;
lastIdx = i + 1;
}
else {
ret += `${str.substring(lastIdx, i)}&#x${getCodePoint(str, i).toString(16)};`;
// Increase by 1 if we have a surrogate pair
lastIdx = xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800);
}
}
return ret + str.substr(lastIdx);
}
/**
* Encodes all non-ASCII characters, as well as characters not valid in XML
* documents using numeric hexadecimal reference (eg. `&#xfc;`).
*
* Have a look at `escapeUTF8` if you want a more concise output at the expense
* of reduced transportability.
*
* @param data String to escape.
*/
export const escape = encodeXML;
/**
* Creates a function that escapes all characters matched by the given regular
* expression using the given map of characters to escape to their entities.
*
* @param regex Regular expression to match characters to escape.
* @param map Map of characters to escape to their entities.
*
* @returns Function that escapes all characters matched by the given regular
* expression using the given map of characters to escape to their entities.
*/
function getEscaper(regex, map) {
return function escape(data) {
let match;
let lastIdx = 0;
let result = "";
while ((match = regex.exec(data))) {
if (lastIdx !== match.index) {
result += data.substring(lastIdx, match.index);
}
// We know that this character will be in the map.
result += map.get(match[0].charCodeAt(0));
// Every match will be of length 1
lastIdx = match.index + 1;
}
return result + data.substring(lastIdx);
};
}
/**
* Encodes all characters not valid in XML documents using XML entities.
*
* Note that the output will be character-set dependent.
*
* @param data String to escape.
*/
export const escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap);
/**
* Encodes all characters that have to be escaped in HTML attributes,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*
* @param data String to escape.
*/
export const escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([
[34, "&quot;"],
[38, "&amp;"],
[160, "&nbsp;"],
]));
/**
* Encodes all characters that have to be escaped in HTML text,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*
* @param data String to escape.
*/
export const escapeText = getEscaper(/[&<>\u00A0]/g, new Map([
[38, "&amp;"],
[60, "&lt;"],
[62, "&gt;"],
[160, "&nbsp;"],
]));
//# sourceMappingURL=escape.js.map
@@ -0,0 +1,19 @@
(The MIT License)
Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
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,164 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = write;
/**
* @file 写cmap表
* @author mengke01(kekee000@gmail.com)
*/
/**
* 创建`子表0`
*
* @param {Writer} writer 写对象
* @param {Array} unicodes unicodes列表
* @return {Writer}
*/
function writeSubTable0(writer, unicodes) {
writer.writeUint16(0); // format
writer.writeUint16(262); // length
writer.writeUint16(0); // language
// Array of unicodes 0..255
var i = -1;
var unicode;
while (unicode = unicodes.shift()) {
while (++i < unicode[0]) {
writer.writeUint8(0);
}
writer.writeUint8(unicode[1]);
i = unicode[0];
}
while (++i < 256) {
writer.writeUint8(0);
}
return writer;
}
/**
* 创建`子表4`
*
* @param {Writer} writer 写对象
* @param {Array} segments 分块编码列表
* @return {Writer}
*/
function writeSubTable4(writer, segments) {
writer.writeUint16(4); // format
writer.writeUint16(24 + segments.length * 8); // length
writer.writeUint16(0); // language
var segCount = segments.length + 1;
var maxExponent = Math.floor(Math.log(segCount) / Math.LN2);
var searchRange = 2 * Math.pow(2, maxExponent);
writer.writeUint16(segCount * 2); // segCountX2
writer.writeUint16(searchRange); // searchRange
writer.writeUint16(maxExponent); // entrySelector
writer.writeUint16(2 * segCount - searchRange); // rangeShift
// end list
segments.forEach(function (segment) {
writer.writeUint16(segment.end);
});
writer.writeUint16(0xFFFF); // end code
writer.writeUint16(0); // reservedPad
// start list
segments.forEach(function (segment) {
writer.writeUint16(segment.start);
});
writer.writeUint16(0xFFFF); // start code
// id delta
segments.forEach(function (segment) {
writer.writeUint16(segment.delta);
});
writer.writeUint16(1);
// Array of range offsets, it doesn't matter when deltas present
for (var i = 0, l = segments.length; i < l; i++) {
writer.writeUint16(0);
}
writer.writeUint16(0); // rangeOffsetArray should be finished with 0
return writer;
}
/**
* 创建`子表12`
*
* @param {Writer} writer 写对象
* @param {Array} segments 分块编码列表
* @return {Writer}
*/
function writeSubTable12(writer, segments) {
writer.writeUint16(12); // format
writer.writeUint16(0); // reserved
writer.writeUint32(16 + segments.length * 12); // length
writer.writeUint32(0); // language
writer.writeUint32(segments.length); // nGroups
segments.forEach(function (segment) {
writer.writeUint32(segment.start);
writer.writeUint32(segment.end);
writer.writeUint32(segment.startId);
});
return writer;
}
/**
* 写subtableheader
*
* @param {Writer} writer Writer对象
* @param {number} platform 平台
* @param {number} encoding 编码
* @param {number} offset 偏移
* @return {Writer}
*/
function writeSubTableHeader(writer, platform, encoding, offset) {
writer.writeUint16(platform); // platform
writer.writeUint16(encoding); // encoding
writer.writeUint32(offset); // offset
return writer;
}
/**
* 写cmap表数据
*
* @param {Object} writer 写入器
* @param {Object} ttf ttf对象
* @return {Object} 写入器
*/
function write(writer, ttf) {
var hasGLyphsOver2Bytes = ttf.support.cmap.hasGLyphsOver2Bytes;
// write table header.
writer.writeUint16(0); // version
writer.writeUint16(hasGLyphsOver2Bytes ? 4 : 3); // count
// header size
var subTableOffset = 4 + (hasGLyphsOver2Bytes ? 32 : 24);
var format4Size = ttf.support.cmap.format4Size;
var format0Size = ttf.support.cmap.format0Size;
// subtable 4, unicode
writeSubTableHeader(writer, 0, 3, subTableOffset);
// subtable 0, mac standard
writeSubTableHeader(writer, 1, 0, subTableOffset + format4Size);
// subtable 4, windows standard
writeSubTableHeader(writer, 3, 1, subTableOffset);
if (hasGLyphsOver2Bytes) {
writeSubTableHeader(writer, 3, 10, subTableOffset + format4Size + format0Size);
}
// write tables, order of table seem to be magic, it is taken from TTX tool
writeSubTable4(writer, ttf.support.cmap.format4Segments);
writeSubTable0(writer, ttf.support.cmap.format0Segments);
if (hasGLyphsOver2Bytes) {
writeSubTable12(writer, ttf.support.cmap.format12Segments);
}
return writer;
}
@@ -0,0 +1,719 @@
export default `flf2a$ 7 7 8 0 3 0 64 0
Font Author: Diamond Planet
FIGFont created with: http://patorjk.com/figfont-editor
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
▗█▄▖@
▐▌█ @
▝█▚▖@
▗▄█▞▘@
▀ @
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
▄$@
▞$@
@
@
@
@
@@
@
@
@
@
@
@
@@
▄$@
@
@
@
@
@
@@
▄▀$@
█ @
▄▀ @
@
@
@
@@
▄▀▀▚▖@
█ ▐▌@
█ ▐▌@
▀▄▄▞▘@
@
@
@@
█$@
█$@
█$@
█$@
@
@
@@
▄▄▄▄$@
█$@
█▀▀▀$@
█▄▄▄$@
@
@
@@
▄▄▄▄$@
█$@
▀▀▀█$@
▄▄▄█$@
@
@
@@
▄ ▗▖@
█ ▐▌@
▀▀▀▜▌@
▐▌@
@
@
@@
▄▄▄▄$@
█ @
▀▀▀█$@
▄▄▄█$@
@
@
@@
▄▄▄▄$@
█ @
█▀▀█$@
█▄▄█$@
@
@
@@
▗▄▄▄▖@
▐▌@
▐▌@
▐▌@
@
@
@@
▄▄▄▄$@
█ █$@
█▀▀█$@
█▄▄█$@
@
@
@@
▄▄▄▄$@
█ █$@
▀▀▀█$@
▄▄▄█$@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
▗▄▖ @
▐▌ ▐▌@
▐▛▀▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▚▖@
▐▙▄▞▘@
@
@
@@
▗▄▄▖@
▐▌ @
▐▌ @
▝▚▄▄▖@
@
@
@@
▗▄▄▄ @
▐▌ █$@
▐▌ █$@
▐▙▄▄▀$@
@
@
@@
▗▄▄▄▖@
▐▌ @
▐▛▀▀▘@
▐▙▄▄▖@
@
@
@@
▗▄▄▄▖@
▐▌ @
▐▛▀▀▘@
▐▌ @
@
@
@@
▗▄▄▖@
▐▌ @
▐▌▝▜▌@
▝▚▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▛▀▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▄▄▖@
█ @
█ @
▗▄█▄▖@
@
@
@@
▗▖@
▐▌@
▐▌@
▗▄▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌▗▞▘@
▐▛▚▖ @
▐▌ ▐▌@
@
@
@@
▗▖ @
▐▌ @
▐▌ @
▐▙▄▄▖@
@
@
@@
▗▖ ▗▖@
▐▛▚▞▜▌@
▐▌ ▐▌@
▐▌ ▐▌@
@
@
@@
▗▖ ▗▖@
▐▛▚▖▐▌@
▐▌ ▝▜▌@
▐▌ ▐▌@
@
@
@@
▗▄▖ @
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▄▞▘@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▘ @
▐▌ @
@
@
@@
▗▄▄▄▖ @
▐▌ ▐▌ @
▐▌ ▐▌ @
▐▙▄▟▙▖@
@
@
@@
▗▄▄▖ @
▐▌ ▐▌@
▐▛▀▚▖@
▐▌ ▐▌@
@
@
@@
▗▄▄▖@
▐▌ @
▝▀▚▖@
▗▄▄▞▘@
@
@
@@
▗▄▄▄▖@
█ @
█ @
█ @
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▄▞▘@
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▝▚▞▘ @
@
@
@@
▗▖ ▗▖@
▐▌ ▐▌@
▐▌ ▐▌@
▐▙█▟▌@
@
@
@@
▗▖ ▗▖@
▝▚▞▘ @
▐▌ @
▗▞▘▝▚▖@
@
@
@@
▗▖ ▗▖@
▝▚▞▘ @
▐▌ @
▐▌ @
@
@
@@
▗▄▄▄▄▖@
▗▞▘@
▗▞▘ @
▐▙▄▄▄▖@
@
@
@@
▗▄▄▖ @
▐▌ @
▐▌ @
■ @
■■■$@
@
@@
@
@
@
@
@
@
@@
▗▄▄▖ @
▐▌ @
▐▌ @
■$@
■■■$@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
▗▞▀▜▌@
▝▚▄▟▌@
@
@
@
@
$ @@
▗▖ @
▐▌ @
▐▛▀▚▖@
▐▙▄▞▘@
@
@
@@
▗▞▀▘@
▝▚▄▖@
@
@
@
@
$ @@
▐▌@
▐▌@
▗▞▀▜▌@
▝▚▄▟▌@
@
@
@@
▗▞▀▚▖@
▐▛▀▀▘@
▝▚▄▄▖@
@
@
@
@@
▗▞▀▀▘@
▐▌ @
▐▛▀▘ @
▐▌ @
@
@
$ @@
$ @
@
@
▗▄▖ @
▐▌ ▐▌@
▝▀▜▌@
▐▙▄▞▘@@
▐▌ @
▐▌ @
▐▛▀▚▖@
▐▌ ▐▌@
@
@
$ @@
▄$@
▄$@
█$@
█$@
@
@
@@
▗▖@
▗▖@
▄ ▐▌@
▀▄▄▞▘@
@
@
$ @@
█ ▄$@
█▄▀ @
█ ▀▄$@
█ █$@
@
@
$ @@
█$@
█$@
█$@
█$@
@
@
@@
▄▄▄▄ @
█ █ █$@
█ █$@
@
@
@
$ @@
▄▄▄▄ @
█ █$@
█ █$@
@
@
@
$ @@
▄▄▄ @
█ █$@
▀▄▄▄▀$@
@
@
@
$ @@
▄▄▄▄ @
█ █$@
█▄▄▄▀$@
█ @
▀ @
@
$ @@
▄▄▄▄$@
█ █$@
▀▄▄▄█$@
█$@
▀$@
@
@@
▄▄▄$@
█ @
█ @
@
@
@
$ @@
▄▄▄$@
▀▄▄ @
▄▄▄▀$@
@
@
@
$ @@
■ @
▗▄▟▙▄▖@
▐▌ @
▐▌ @
▐▌ @
@
@@
█ ▐▌@
▀▄▄▞▘@
@
@
@
@
$ @@
▄ ▄$@
█ █$@
▀▄▀ @
@
@
@
$ @@
▄ ▄$@
█ ▄ █$@
█▄█▄█$@
@
@
@
$ @@
▄ ▄$@
▀▄▀ @
▄▀ ▀▄$@
@
@
@
$ @@
▄ ▄$@
█ █$@
▀▀▀█$@
▄ █$@
▀▀▀$ @
@
@@
▄▄▄▄▄$@
▄▄▄▀$@
█▄▄▄▄$@
@
@
@
$ @@
▗▞▘@
▗▞▘ @
▐▌ @
▝▘@
@
@
$ @@
@
@
@
@
@
@
@@
■ @
■ @
■ @
■$@
■ @
■ @
■ @@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
`
@@ -0,0 +1 @@
export { _ as default } from "../esm/_class_apply_descriptor_get.js";
@@ -0,0 +1,58 @@
/**
* FFmpeg Exec Adapter
* 使用 execFile 调用 FFmpeg 命令行工具的适配器实现
*/
import { LogWrapper } from '../../helper/log';
import type { IFFmpegAdapter, VideoInfoResult } from './ffmpeg-adapter-interface';
/**
* FFmpeg 命令行适配器实现
*/
export declare class FFmpegExecAdapter implements IFFmpegAdapter {
private ffmpegPath;
private ffprobePath;
private binaryPath?;
private logger?;
readonly name = "FFmpegExec";
private downloadAttempted;
constructor(ffmpegPath?: string, ffprobePath?: string, binaryPath?: string | undefined, logger?: LogWrapper | undefined);
/**
* 检查 FFmpeg 是否可用,如果不可用则尝试下载
*/
isAvailable(): Promise<boolean>;
/**
* 设置 FFmpeg 路径
*/
setFFmpegPath(ffmpegPath: string): void;
/**
* 设置 FFprobe 路径
*/
setFFprobePath(ffprobePath: string): void;
/**
* 获取视频信息
*/
getVideoInfo(videoPath: string): Promise<VideoInfoResult>;
/**
* 获取时长
*/
getDuration(filePath: string): Promise<number>;
/**
* 判断是否为 Silk 格式
*/
isSilk(filePath: string): Promise<boolean>;
/**
* 转换为 PCM
*/
convertToPCM(filePath: string, pcmPath: string): Promise<{
result: boolean;
sampleRate: number;
}>;
/**
* 转换文件
*/
convertFile(inputFile: string, outputFile: string, format: string): Promise<void>;
/**
* 提取缩略图
*/
extractThumbnail(videoPath: string, thumbnailPath: string): Promise<void>;
convertToNTSilkTct(_inputFile: string, _outputFile: string): Promise<void>;
}
@@ -0,0 +1 @@
{"version":3,"file":"getFirstIteratorResult.d.ts","sourceRoot":"","sources":["../../../../src/common/actions/getFirstIteratorResult.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,GAChC,CAAC,GAAG,SAAS,CAYf"}
@@ -0,0 +1,24 @@
var baseInvoke = require('./_baseInvoke'),
baseRest = require('./_baseRest');
/**
* Invokes the method at `path` of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
* @example
*
* var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
*
* _.invoke(object, 'a[0].b.c.slice', 1, 3);
* // => [2, 3]
*/
var invoke = baseRest(baseInvoke);
module.exports = invoke;
@@ -0,0 +1,64 @@
# strip-json-comments [![Build Status](https://travis-ci.org/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-json-comments)
> Strip comments from JSON. Lets you use comments in your JSON files!
This is now possible:
```js
{
// rainbows
"unicorn": /* ❤ */ "cake"
}
```
It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.
Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin.
## Install
```
$ npm install --save strip-json-comments
```
## Usage
```js
const json = '{/*rainbows*/"unicorn":"cake"}';
JSON.parse(stripJsonComments(json));
//=> {unicorn: 'cake'}
```
## API
### stripJsonComments(input, [options])
#### input
Type: `string`
Accepts a string with JSON and returns a string without comments.
#### options
##### whitespace
Type: `boolean`
Default: `true`
Replace comments with whitespace instead of stripping them entirely.
## Related
- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module
- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('delay', require('../delay'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,415 @@
import {ContextualKeyword} from "../parser/tokenizer/keywords";
import {TokenType as tt} from "../parser/tokenizer/types";
import elideImportEquals from "../util/elideImportEquals";
import getDeclarationInfo, {
EMPTY_DECLARATION_INFO,
} from "../util/getDeclarationInfo";
import getImportExportSpecifierInfo from "../util/getImportExportSpecifierInfo";
import {getNonTypeIdentifiers} from "../util/getNonTypeIdentifiers";
import isExportFrom from "../util/isExportFrom";
import {removeMaybeImportAttributes} from "../util/removeMaybeImportAttributes";
import shouldElideDefaultExport from "../util/shouldElideDefaultExport";
import Transformer from "./Transformer";
/**
* Class for editing import statements when we are keeping the code as ESM. We still need to remove
* type-only imports in TypeScript and Flow.
*/
export default class ESMImportTransformer extends Transformer {
constructor(
tokens,
nameManager,
helperManager,
reactHotLoaderTransformer,
isTypeScriptTransformEnabled,
isFlowTransformEnabled,
keepUnusedImports,
options,
) {
super();this.tokens = tokens;this.nameManager = nameManager;this.helperManager = helperManager;this.reactHotLoaderTransformer = reactHotLoaderTransformer;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.isFlowTransformEnabled = isFlowTransformEnabled;this.keepUnusedImports = keepUnusedImports;;
this.nonTypeIdentifiers =
isTypeScriptTransformEnabled && !keepUnusedImports
? getNonTypeIdentifiers(tokens, options)
: new Set();
this.declarationInfo =
isTypeScriptTransformEnabled && !keepUnusedImports
? getDeclarationInfo(tokens)
: EMPTY_DECLARATION_INFO;
this.injectCreateRequireForImportRequire = Boolean(options.injectCreateRequireForImportRequire);
}
process() {
// TypeScript `import foo = require('foo');` should always just be translated to plain require.
if (this.tokens.matches3(tt._import, tt.name, tt.eq)) {
return this.processImportEquals();
}
if (
this.tokens.matches4(tt._import, tt.name, tt.name, tt.eq) &&
this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._type)
) {
// import type T = require('T')
this.tokens.removeInitialToken();
// This construct is always exactly 8 tokens long, so remove the 7 remaining tokens.
for (let i = 0; i < 7; i++) {
this.tokens.removeToken();
}
return true;
}
if (this.tokens.matches2(tt._export, tt.eq)) {
this.tokens.replaceToken("module.exports");
return true;
}
if (
this.tokens.matches5(tt._export, tt._import, tt.name, tt.name, tt.eq) &&
this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, ContextualKeyword._type)
) {
// export import type T = require('T')
this.tokens.removeInitialToken();
// This construct is always exactly 9 tokens long, so remove the 8 remaining tokens.
for (let i = 0; i < 8; i++) {
this.tokens.removeToken();
}
return true;
}
if (this.tokens.matches1(tt._import)) {
return this.processImport();
}
if (this.tokens.matches2(tt._export, tt._default)) {
return this.processExportDefault();
}
if (this.tokens.matches2(tt._export, tt.braceL)) {
return this.processNamedExports();
}
if (
this.tokens.matches2(tt._export, tt.name) &&
this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._type)
) {
// export type {a};
// export type {a as b};
// export type {a} from './b';
// export type * from './b';
// export type * as ns from './b';
this.tokens.removeInitialToken();
this.tokens.removeToken();
if (this.tokens.matches1(tt.braceL)) {
while (!this.tokens.matches1(tt.braceR)) {
this.tokens.removeToken();
}
this.tokens.removeToken();
} else {
// *
this.tokens.removeToken();
if (this.tokens.matches1(tt._as)) {
// as
this.tokens.removeToken();
// ns
this.tokens.removeToken();
}
}
// Remove type re-export `... } from './T'`
if (
this.tokens.matchesContextual(ContextualKeyword._from) &&
this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, tt.string)
) {
this.tokens.removeToken();
this.tokens.removeToken();
removeMaybeImportAttributes(this.tokens);
}
return true;
}
return false;
}
processImportEquals() {
const importName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1);
if (this.shouldAutomaticallyElideImportedName(importName)) {
// If this name is only used as a type, elide the whole import.
elideImportEquals(this.tokens);
} else if (this.injectCreateRequireForImportRequire) {
// We're using require in an environment (Node ESM) that doesn't provide
// it as a global, so generate a helper to import it.
// import -> const
this.tokens.replaceToken("const");
// Foo
this.tokens.copyToken();
// =
this.tokens.copyToken();
// require
this.tokens.replaceToken(this.helperManager.getHelperName("require"));
} else {
// Otherwise, just switch `import` to `const`.
this.tokens.replaceToken("const");
}
return true;
}
processImport() {
if (this.tokens.matches2(tt._import, tt.parenL)) {
// Dynamic imports don't need to be transformed.
return false;
}
const snapshot = this.tokens.snapshot();
const allImportsRemoved = this.removeImportTypeBindings();
if (allImportsRemoved) {
this.tokens.restoreToSnapshot(snapshot);
while (!this.tokens.matches1(tt.string)) {
this.tokens.removeToken();
}
this.tokens.removeToken();
removeMaybeImportAttributes(this.tokens);
if (this.tokens.matches1(tt.semi)) {
this.tokens.removeToken();
}
}
return true;
}
/**
* Remove type bindings from this import, leaving the rest of the import intact.
*
* Return true if this import was ONLY types, and thus is eligible for removal. This will bail out
* of the replacement operation, so we can return early here.
*/
removeImportTypeBindings() {
this.tokens.copyExpectedToken(tt._import);
if (
this.tokens.matchesContextual(ContextualKeyword._type) &&
!this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, tt.comma) &&
!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._from)
) {
// This is an "import type" statement, so exit early.
return true;
}
if (this.tokens.matches1(tt.string)) {
// This is a bare import, so we should proceed with the import.
this.tokens.copyToken();
return false;
}
// Skip the "module" token in import reflection.
if (
this.tokens.matchesContextual(ContextualKeyword._module) &&
this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, ContextualKeyword._from)
) {
this.tokens.copyToken();
}
let foundNonTypeImport = false;
let foundAnyNamedImport = false;
let needsComma = false;
// Handle default import.
if (this.tokens.matches1(tt.name)) {
if (this.shouldAutomaticallyElideImportedName(this.tokens.identifierName())) {
this.tokens.removeToken();
if (this.tokens.matches1(tt.comma)) {
this.tokens.removeToken();
}
} else {
foundNonTypeImport = true;
this.tokens.copyToken();
if (this.tokens.matches1(tt.comma)) {
// We're in a statement like:
// import A, * as B from './A';
// or
// import A, {foo} from './A';
// where the `A` is being kept. The comma should be removed if an only
// if the next part of the import statement is elided, but that's hard
// to determine at this point in the code. Instead, always remove it
// and set a flag to add it back if necessary.
needsComma = true;
this.tokens.removeToken();
}
}
}
if (this.tokens.matches1(tt.star)) {
if (this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2))) {
this.tokens.removeToken();
this.tokens.removeToken();
this.tokens.removeToken();
} else {
if (needsComma) {
this.tokens.appendCode(",");
}
foundNonTypeImport = true;
this.tokens.copyExpectedToken(tt.star);
this.tokens.copyExpectedToken(tt.name);
this.tokens.copyExpectedToken(tt.name);
}
} else if (this.tokens.matches1(tt.braceL)) {
if (needsComma) {
this.tokens.appendCode(",");
}
this.tokens.copyToken();
while (!this.tokens.matches1(tt.braceR)) {
foundAnyNamedImport = true;
const specifierInfo = getImportExportSpecifierInfo(this.tokens);
if (
specifierInfo.isType ||
this.shouldAutomaticallyElideImportedName(specifierInfo.rightName)
) {
while (this.tokens.currentIndex() < specifierInfo.endIndex) {
this.tokens.removeToken();
}
if (this.tokens.matches1(tt.comma)) {
this.tokens.removeToken();
}
} else {
foundNonTypeImport = true;
while (this.tokens.currentIndex() < specifierInfo.endIndex) {
this.tokens.copyToken();
}
if (this.tokens.matches1(tt.comma)) {
this.tokens.copyToken();
}
}
}
this.tokens.copyExpectedToken(tt.braceR);
}
if (this.keepUnusedImports) {
return false;
}
if (this.isTypeScriptTransformEnabled) {
return !foundNonTypeImport;
} else if (this.isFlowTransformEnabled) {
// In Flow, unlike TS, `import {} from 'foo';` preserves the import.
return foundAnyNamedImport && !foundNonTypeImport;
} else {
return false;
}
}
shouldAutomaticallyElideImportedName(name) {
return (
this.isTypeScriptTransformEnabled &&
!this.keepUnusedImports &&
!this.nonTypeIdentifiers.has(name)
);
}
processExportDefault() {
if (
shouldElideDefaultExport(
this.isTypeScriptTransformEnabled,
this.keepUnusedImports,
this.tokens,
this.declarationInfo,
)
) {
// If the exported value is just an identifier and should be elided by TypeScript
// rules, then remove it entirely. It will always have the form `export default e`,
// where `e` is an identifier.
this.tokens.removeInitialToken();
this.tokens.removeToken();
this.tokens.removeToken();
return true;
}
const alreadyHasName =
this.tokens.matches4(tt._export, tt._default, tt._function, tt.name) ||
// export default async function
(this.tokens.matches5(tt._export, tt._default, tt.name, tt._function, tt.name) &&
this.tokens.matchesContextualAtIndex(
this.tokens.currentIndex() + 2,
ContextualKeyword._async,
)) ||
this.tokens.matches4(tt._export, tt._default, tt._class, tt.name) ||
this.tokens.matches5(tt._export, tt._default, tt._abstract, tt._class, tt.name);
if (!alreadyHasName && this.reactHotLoaderTransformer) {
// This is a plain "export default E" statement and we need to assign E to a variable.
// Change "export default E" to "let _default; export default _default = E"
const defaultVarName = this.nameManager.claimFreeName("_default");
this.tokens.replaceToken(`let ${defaultVarName}; export`);
this.tokens.copyToken();
this.tokens.appendCode(` ${defaultVarName} =`);
this.reactHotLoaderTransformer.setExtractedDefaultExportName(defaultVarName);
return true;
}
return false;
}
/**
* Handle a statement with one of these forms:
* export {a, type b};
* export {c, type d} from 'foo';
*
* In both cases, any explicit type exports should be removed. In the first
* case, we also need to handle implicit export elision for names declared as
* types. In the second case, we must NOT do implicit named export elision,
* but we must remove the runtime import if all exports are type exports.
*/
processNamedExports() {
if (!this.isTypeScriptTransformEnabled) {
return false;
}
this.tokens.copyExpectedToken(tt._export);
this.tokens.copyExpectedToken(tt.braceL);
const isReExport = isExportFrom(this.tokens);
let foundNonTypeExport = false;
while (!this.tokens.matches1(tt.braceR)) {
const specifierInfo = getImportExportSpecifierInfo(this.tokens);
if (
specifierInfo.isType ||
(!isReExport && this.shouldElideExportedName(specifierInfo.leftName))
) {
// Type export, so remove all tokens, including any comma.
while (this.tokens.currentIndex() < specifierInfo.endIndex) {
this.tokens.removeToken();
}
if (this.tokens.matches1(tt.comma)) {
this.tokens.removeToken();
}
} else {
// Non-type export, so copy all tokens, including any comma.
foundNonTypeExport = true;
while (this.tokens.currentIndex() < specifierInfo.endIndex) {
this.tokens.copyToken();
}
if (this.tokens.matches1(tt.comma)) {
this.tokens.copyToken();
}
}
}
this.tokens.copyExpectedToken(tt.braceR);
if (!this.keepUnusedImports && isReExport && !foundNonTypeExport) {
// This is a type-only re-export, so skip evaluating the other module. Technically this
// leaves the statement as `export {}`, but that's ok since that's a no-op.
this.tokens.removeToken();
this.tokens.removeToken();
removeMaybeImportAttributes(this.tokens);
}
return true;
}
/**
* ESM elides all imports with the rule that we only elide if we see that it's
* a type and never see it as a value. This is in contrast to CJS, which
* elides imports that are completely unknown.
*/
shouldElideExportedName(name) {
return (
this.isTypeScriptTransformEnabled &&
!this.keepUnusedImports &&
this.declarationInfo.typeDeclarations.has(name) &&
!this.declarationInfo.valueDeclarations.has(name)
);
}
}
@@ -0,0 +1,15 @@
import nativeCreate from './_nativeCreate.js';
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
export default hashClear;
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var rowRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author', 'contents'],
prohibitedProps: [],
props: {
'aria-colindex': null,
'aria-expanded': null,
'aria-level': null,
'aria-posinset': null,
'aria-rowindex': null,
'aria-selected': null,
'aria-setsize': null
},
relatedConcepts: [{
concept: {
name: 'tr'
},
module: 'HTML'
}],
requireContextRole: ['grid', 'rowgroup', 'table', 'treegrid'],
requiredContextRole: ['grid', 'rowgroup', 'table', 'treegrid'],
requiredOwnedElements: [['cell'], ['columnheader'], ['gridcell'], ['rowheader']],
requiredProps: {},
superClass: [['roletype', 'structure', 'section', 'group'], ['roletype', 'widget']]
};
var _default = exports.default = rowRole;
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more