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,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PasswordRecipientInfo = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const types_1 = require("./types");
class PasswordRecipientInfo {
constructor(params = {}) {
this.version = types_1.CMSVersion.v0;
this.keyEncryptionAlgorithm = new types_1.KeyEncryptionAlgorithmIdentifier();
this.encryptedKey = new asn1_schema_1.OctetString();
Object.assign(this, params);
}
}
exports.PasswordRecipientInfo = PasswordRecipientInfo;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })
], PasswordRecipientInfo.prototype, "version", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: types_1.KeyDerivationAlgorithmIdentifier, context: 0, optional: true })
], PasswordRecipientInfo.prototype, "keyDerivationAlgorithm", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: types_1.KeyEncryptionAlgorithmIdentifier })
], PasswordRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })
], PasswordRecipientInfo.prototype, "encryptedKey", void 0);
@@ -0,0 +1,6 @@
module.exports = {
"dismiss": `Dispensar`
};
//# sourceMappingURL=pt-PT.main.js.map
@@ -0,0 +1 @@
const o=new WeakMap;let u=0;export function stableHash(t){const i=typeof t,s=t&&t.constructor,c=s==Date;if(Object(t)===t&&!c&&s!=RegExp){let e=o.get(t);if(e)return e;e=++u+"~",o.set(t,e);let n;if(s==Array){for(e="@",n=0;n<t.length;n++)e+=stableHash(t[n])+",";o.set(t,e)}else if(s==Object){e="#";const f=Object.keys(t).sort();for(;(n=f.pop())!==void 0;)t[n]!==void 0&&(e+=n+":"+stableHash(t[n])+",");o.set(t,e)}return e}return c?t.toJSON():i=="symbol"?t.toString():i=="string"?JSON.stringify(t):""+t}export default stableHash;
@@ -0,0 +1,174 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.verifyAuthenticationResponse = verifyAuthenticationResponse;
const decodeClientDataJSON_js_1 = require("../helpers/decodeClientDataJSON.js");
const toHash_js_1 = require("../helpers/toHash.js");
const verifySignature_js_1 = require("../helpers/verifySignature.js");
const parseAuthenticatorData_js_1 = require("../helpers/parseAuthenticatorData.js");
const parseBackupFlags_js_1 = require("../helpers/parseBackupFlags.js");
const matchExpectedRPID_js_1 = require("../helpers/matchExpectedRPID.js");
const index_js_1 = require("../helpers/iso/index.js");
/**
* Verify that the user has legitimately completed the authentication process
*
* **Options:**
*
* @param response - Response returned by **@simplewebauthn/browser**'s `startAssertion()`
* @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateAuthenticationOptions()`
* @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
* @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
* @param credential - An internal {@link WebAuthnCredential} corresponding to `id` in the authentication response
* @param expectedType **(Optional)** - The response type expected ('webauthn.get')
* @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
* @param advancedFIDOConfig **(Optional)** - Options for satisfying more stringent FIDO RP feature requirements
* @param advancedFIDOConfig.userVerification **(Optional)** - Enable alternative rules for evaluating the User Presence and User Verified flags in authenticator data: UV (and UP) flags are optional unless this value is `"required"`
*/
async function verifyAuthenticationResponse(options) {
const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, credential, requireUserVerification = true, advancedFIDOConfig, } = options;
const { id, rawId, type: credentialType, response: assertionResponse } = response;
// Ensure credential specified an ID
if (!id) {
throw new Error('Missing credential ID');
}
// Ensure ID is base64url-encoded
if (id !== rawId) {
throw new Error('Credential ID was not base64url-encoded');
}
// Make sure credential type is public-key
if (credentialType !== 'public-key') {
throw new Error(`Unexpected credential type ${credentialType}, expected "public-key"`);
}
if (!response) {
throw new Error('Credential missing response');
}
if (typeof assertionResponse?.clientDataJSON !== 'string') {
throw new Error('Credential response clientDataJSON was not a string');
}
const clientDataJSON = (0, decodeClientDataJSON_js_1.decodeClientDataJSON)(assertionResponse.clientDataJSON);
const { type, origin, challenge, tokenBinding } = clientDataJSON;
// Make sure we're handling an authentication
if (Array.isArray(expectedType)) {
if (!expectedType.includes(type)) {
const joinedExpectedType = expectedType.join(', ');
throw new Error(`Unexpected authentication response type "${type}", expected one of: ${joinedExpectedType}`);
}
}
else if (expectedType) {
if (type !== expectedType) {
throw new Error(`Unexpected authentication response type "${type}", expected "${expectedType}"`);
}
}
else if (type !== 'webauthn.get') {
throw new Error(`Unexpected authentication response type: ${type}`);
}
// Ensure the device provided the challenge we gave it
if (typeof expectedChallenge === 'function') {
if (!(await expectedChallenge(challenge))) {
throw new Error(`Custom challenge verifier returned false for registration response challenge "${challenge}"`);
}
}
else if (challenge !== expectedChallenge) {
throw new Error(`Unexpected authentication response challenge "${challenge}", expected "${expectedChallenge}"`);
}
// Check that the origin is our site
if (Array.isArray(expectedOrigin)) {
if (!expectedOrigin.includes(origin)) {
const joinedExpectedOrigin = expectedOrigin.join(', ');
throw new Error(`Unexpected authentication response origin "${origin}", expected one of: ${joinedExpectedOrigin}`);
}
}
else {
if (origin !== expectedOrigin) {
throw new Error(`Unexpected authentication response origin "${origin}", expected "${expectedOrigin}"`);
}
}
if (!index_js_1.isoBase64URL.isBase64URL(assertionResponse.authenticatorData)) {
throw new Error('Credential response authenticatorData was not a base64url string');
}
if (!index_js_1.isoBase64URL.isBase64URL(assertionResponse.signature)) {
throw new Error('Credential response signature was not a base64url string');
}
if (assertionResponse.userHandle &&
typeof assertionResponse.userHandle !== 'string') {
throw new Error('Credential response userHandle was not a string');
}
if (tokenBinding) {
if (typeof tokenBinding !== 'object') {
throw new Error('ClientDataJSON tokenBinding was not an object');
}
if (['present', 'supported', 'notSupported'].indexOf(tokenBinding.status) < 0) {
throw new Error(`Unexpected tokenBinding status ${tokenBinding.status}`);
}
}
const authDataBuffer = index_js_1.isoBase64URL.toBuffer(assertionResponse.authenticatorData);
const parsedAuthData = (0, parseAuthenticatorData_js_1.parseAuthenticatorData)(authDataBuffer);
const { rpIdHash, flags, counter, extensionsData } = parsedAuthData;
// Make sure the response's RP ID is ours
let expectedRPIDs = [];
if (typeof expectedRPID === 'string') {
expectedRPIDs = [expectedRPID];
}
else {
expectedRPIDs = expectedRPID;
}
const matchedRPID = await (0, matchExpectedRPID_js_1.matchExpectedRPID)(rpIdHash, expectedRPIDs);
if (advancedFIDOConfig !== undefined) {
const { userVerification: fidoUserVerification } = advancedFIDOConfig;
/**
* Use FIDO Conformance-defined rules for verifying UP and UV flags
*/
if (fidoUserVerification === 'required') {
// Require `flags.uv` be true (implies `flags.up` is true)
if (!flags.uv) {
throw new Error('User verification required, but user could not be verified');
}
}
else if (fidoUserVerification === 'preferred' ||
fidoUserVerification === 'discouraged') {
// Ignore `flags.uv`
}
}
else {
/**
* Use WebAuthn spec-defined rules for verifying UP and UV flags
*/
// WebAuthn only requires the user presence flag be true
if (!flags.up) {
throw new Error('User not present during authentication');
}
// Enforce user verification if required
if (requireUserVerification && !flags.uv) {
throw new Error('User verification required, but user could not be verified');
}
}
const clientDataHash = await (0, toHash_js_1.toHash)(index_js_1.isoBase64URL.toBuffer(assertionResponse.clientDataJSON));
const signatureBase = index_js_1.isoUint8Array.concat([authDataBuffer, clientDataHash]);
const signature = index_js_1.isoBase64URL.toBuffer(assertionResponse.signature);
if ((counter > 0 || credential.counter > 0) &&
counter <= credential.counter) {
// Error out when the counter in the DB is greater than or equal to the counter in the
// dataStruct. It's related to how the authenticator maintains the number of times its been
// used for this client. If this happens, then someone's somehow increased the counter
// on the device without going through this site
throw new Error(`Response counter value ${counter} was lower than expected ${credential.counter}`);
}
const { credentialDeviceType, credentialBackedUp } = (0, parseBackupFlags_js_1.parseBackupFlags)(flags);
const toReturn = {
verified: await (0, verifySignature_js_1.verifySignature)({
signature,
data: signatureBase,
credentialPublicKey: credential.publicKey,
}),
authenticationInfo: {
newCounter: counter,
credentialID: credential.id,
userVerified: flags.uv,
credentialDeviceType,
credentialBackedUp,
authenticatorExtensionResults: extensionsData,
origin: clientDataJSON.origin,
rpID: matchedRPID,
},
};
return toReturn;
}
@@ -0,0 +1,9 @@
/**
* Determines if the theme is a base theme
*
* @param theme string
* @returns "light" | "dark
*/
declare const isBaseTheme: (theme: string) => boolean;
export { isBaseTheme };
@@ -0,0 +1,25 @@
"use client";
// src/dimensions.ts
var getCSSStyleVal = (str, parentNum) => {
if (!str)
return 0;
const strVal = str.includes("px") ? +str.split("px")[0] : str.includes("%") ? +str.split("%")[0] * parentNum * 0.01 : str;
return Number.isNaN(+strVal) ? 0 : +strVal;
};
var getRealShape = (el) => {
const defaultShape = { width: 0, height: 0 };
if (!el || typeof window === "undefined")
return defaultShape;
const rect = el.getBoundingClientRect();
const { width, height } = window.getComputedStyle(el);
return {
width: getCSSStyleVal(`${width}`, rect.width),
height: getCSSStyleVal(`${height}`, rect.height)
};
};
export {
getCSSStyleVal,
getRealShape
};
@@ -0,0 +1,24 @@
# @heroui/form
A Quick description of the component
> This is an internal utility, not intended for public usage.
## Installation
```sh
yarn add @heroui/form
# or
npm i @heroui/form
```
## Contribution
Yes please! See the
[contributing guidelines](https://github.com/frontio-ai/heroui/blob/master/CONTRIBUTING.md)
for details.
## License
This project is licensed under the terms of the
[MIT license](https://github.com/frontio-ai/heroui/blob/master/LICENSE).
@@ -0,0 +1,2 @@
"use strict";var De=Object.create;var Z=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var Se=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty;var Ae=(e,s)=>{for(var Q in s)Z(e,Q,{get:s[Q],enumerable:!0})},G=(e,s,Q,T)=>{if(s&&typeof s=="object"||typeof s=="function")for(let h of me(s))!Be.call(e,h)&&h!==Q&&Z(e,h,{get:()=>s[h],enumerable:!(T=xe(s,h))||T.enumerable});return e},k=(e,s,Q)=>(G(e,s,"default"),Q&&G(Q,s,"default")),Pe=(e,s,Q)=>(Q=e!=null?De(Se(e)):{},G(s||!e||!e.__esModule?Z(Q,"default",{value:e,enumerable:!0}):Q,e)),he=e=>G(Z({},"__esModule",{value:!0}),e);var b={};Ae(b,{ApiProvider:()=>ce,UNINITIALIZED_VALUE:()=>q,createApi:()=>ve,reactHooksModule:()=>ue,reactHooksModuleName:()=>ae});module.exports=he(b);var c=require("@reduxjs/toolkit/query");var at=require("@reduxjs/toolkit"),M=require("react-redux"),de=require("reselect");function j(e){return e.replace(e[0],e[0].toUpperCase())}var Ie="query",Ue="mutation",be="infinitequery";function ye(e){return e.type===Ie}function oe(e){return e.type===Ue}function Y(e){return e.type===be}function z(e,...s){return Object.assign(e,...s)}var Qe=require("@reduxjs/toolkit");var t=require("react");var S=require("react-redux");var q=Symbol();function J(e){let s=(0,t.useRef)(e),Q=(0,t.useMemo)(()=>(0,c.copyWithStructuralSharing)(s.current,e),[e]);return(0,t.useEffect)(()=>{s.current!==Q&&(s.current=Q)},[Q]),Q}function W(e){let s=(0,t.useRef)(e);return(0,t.useEffect)(()=>{(0,S.shallowEqual)(s.current,e)||(s.current=e)},[e]),(0,S.shallowEqual)(s.current,e)?s.current:e}var Ee=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ke=Ee(),Me=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Oe=Me(),Fe=()=>ke||Oe?t.useLayoutEffect:t.useEffect,we=Fe(),pe=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:c.QueryStatus.pending}:e;function ie(e,...s){let Q={};return s.forEach(T=>{Q[T]=e[T]}),Q}var se=["data","status","isLoading","isSuccess","isError","error"];function fe({api:e,moduleOptions:{batch:s,hooks:{useDispatch:Q,useSelector:T,useStore:h},unstable__sideEffectsInRender:I,createSelector:N},serializeQueryArgs:E,context:L}){let O=I?n=>n():t.useEffect,C=n=>n.current?.unsubscribe?.(),K=L.endpointDefinitions;return{buildQueryHooks:ne,buildInfiniteQueryHooks:le,buildMutationHook:Re,usePrefetch:V};function te(n,a,d){if(a?.endpointName&&n.isUninitialized){let{endpointName:y}=a,p=K[y];d!==c.skipToken&&E({queryArgs:a.originalArgs,endpointDefinition:p,endpointName:y})===E({queryArgs:d,endpointDefinition:p,endpointName:y})&&(a=void 0)}let o=n.isSuccess?n.data:a?.data;o===void 0&&(o=n.data);let u=o!==void 0,r=n.isLoading,i=(!a||a.isLoading||a.isUninitialized)&&!u&&r,f=n.isSuccess||u&&(r&&!a?.isError||n.isUninitialized);return{...n,data:o,currentData:n.data,isFetching:r,isLoading:i,isSuccess:f}}function A(n,a,d){if(a?.endpointName&&n.isUninitialized){let{endpointName:y}=a,p=K[y];d!==c.skipToken&&E({queryArgs:a.originalArgs,endpointDefinition:p,endpointName:y})===E({queryArgs:d,endpointDefinition:p,endpointName:y})&&(a=void 0)}let o=n.isSuccess?n.data:a?.data;o===void 0&&(o=n.data);let u=o!==void 0,r=n.isLoading,i=(!a||a.isLoading||a.isUninitialized)&&!u&&r,f=n.isSuccess||r&&u;return{...n,data:o,currentData:n.data,isFetching:r,isLoading:i,isSuccess:f}}function V(n,a){let d=Q(),o=W(a);return(0,t.useCallback)((u,r)=>d(e.util.prefetch(n,u,{...o,...r})),[n,d,o])}function P(n,a,{refetchOnReconnect:d,refetchOnFocus:o,refetchOnMountOrArgChange:u,skip:r=!1,pollingInterval:i=0,skipPollingIfUnfocused:f=!1,...y}={}){let{initiate:p}=e.endpoints[n],R=Q(),B=(0,t.useRef)(void 0);if(!B.current){let v=R(e.internalActions.internal_getRTKQSubscriptions());B.current=v}let l=J(r?c.skipToken:a),g=W({refetchOnReconnect:d,refetchOnFocus:o,pollingInterval:i,skipPollingIfUnfocused:f}),D=y.initialPageParam,x=W(D),m=(0,t.useRef)(void 0),{queryCacheKey:U,requestId:w}=m.current||{},_=!1;U&&w&&(_=B.current.isRequestSubscribed(U,w));let re=!_&&m.current!==void 0;return O(()=>{re&&(m.current=void 0)},[re]),O(()=>{let v=m.current;if(typeof process<"u",l===c.skipToken){v?.unsubscribe(),m.current=void 0;return}let ge=m.current?.subscriptionOptions;if(!v||v.arg!==l){v?.unsubscribe();let Te=R(p(l,{subscriptionOptions:g,forceRefetch:u,...Y(K[n])?{initialPageParam:x}:{}}));m.current=Te}else g!==ge&&v.updateSubscriptionOptions(g)},[R,p,u,l,g,re,x,n]),[m,R,p,g]}function F(n,a){return(o,{skip:u=!1,selectFromResult:r}={})=>{let{select:i}=e.endpoints[n],f=J(u?c.skipToken:o),y=(0,t.useRef)(void 0),p=(0,t.useMemo)(()=>N([i(f),(D,x)=>x,D=>f],a,{memoizeOptions:{resultEqualityCheck:S.shallowEqual}}),[i,f]),R=(0,t.useMemo)(()=>r?N([p],r,{devModeChecks:{identityFunctionCheck:"never"}}):p,[p,r]),B=T(D=>R(D,y.current),S.shallowEqual),l=h(),g=p(l.getState(),y.current);return we(()=>{y.current=g},[g]),B}}function H(n){(0,t.useEffect)(()=>()=>{C(n),n.current=void 0},[n])}function $(n){if(!n.currLine truncated
//# sourceMappingURL=rtk-query-react.production.min.cjs.map
@@ -0,0 +1,118 @@
/**
* Info on a property.
*/
export interface Info {
/**
* Attribute name for the property that could be used in markup
* (such as `'aria-describedby'`, `'allowfullscreen'`, `'xml:lang'`,
* `'for'`, or `'charoff'`).
*/
attribute: string
/**
* The property is *like* a `boolean`
* (such as `draggable`);
* these properties have both an on and off state when defined,
* *and* another state when not defined.
*/
booleanish: boolean
/**
* The property is a `boolean`
* (such as `hidden`);
* these properties have an on state when defined and an off state when not
* defined.
*/
boolean: boolean
/**
* The property is a list separated by spaces or commas
* (such as `strokeDashArray`).
*/
commaOrSpaceSeparated: boolean
/**
* The property is a list separated by commas
* (such as `coords`).
*/
commaSeparated: boolean
/**
* The property is defined by a space;
* this is the case for values in HTML
* (including data and ARIA),
* SVG, XML, XMLNS, and XLink;
* not defined properties can only be found through `find`.
*/
defined: boolean
/**
* When working with the DOM,
* this property has to be changed as a field on the element,
* instead of through `setAttribute`
* (this is true only for `'checked'`, `'multiple'`, `'muted'`, and
* `'selected'`).
*/
mustUseProperty: boolean
/**
* The property is a `number` (such as `height`).
*/
number: boolean
/**
* The property is *like* a `boolean` (such as `download`);
* these properties have an on state *and* more states when defined and an
* off state when not defined.
*/
overloadedBoolean: boolean
/**
* JavaScript-style camel-cased name;
* based on the DOM but sometimes different
* (such as `'ariaDescribedBy'`, `'allowFullScreen'`, `'xmlLang'`,
* `'htmlFor'`, `'charOff'`).
*/
property: string
/**
* The property is a list separated by spaces
* (such as `className`).
*/
spaceSeparated: boolean
/**
* Space of the property.
*/
space: Space | undefined
}
/**
* Schema for a primary space.
*/
export interface Schema {
/**
* Object mapping normalized attributes and properties to properly cased
* properties.
*/
normal: Record<string, string>
/**
* Object mapping properties to info.
*/
property: Record<string, Info>
space: Space | undefined
}
/**
* Space of a property.
*/
export type Space = 'html' | 'svg' | 'xlink' | 'xmlns' | 'xml'
export {find} from './lib/find.js'
export {hastToReact} from './lib/hast-to-react.js'
/**
* `Schema` for HTML,
* with info on properties from HTML itself and related embedded spaces
* (ARIA, XML, XMLNS, XLink).
*/
export const html: Schema
export {normalize} from './lib/normalize.js'
/**
* `Schema` for SVG,
* with info on properties from SVG itself and related embedded spaces
* (ARIA, XML, XMLNS, XLink).
*/
export const svg: Schema
@@ -0,0 +1 @@
{"version":3,"names":["_arrayWithHoles","require","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","_slicedToArray","arr","i","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest"],"sources":["../../src/helpers/slicedToArray.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayWithHoles from \"./arrayWithHoles.ts\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.ts\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n// @ts-expect-error nonIterableRest is still being converted to TS.\nimport nonIterableRest from \"./nonIterableRest.ts\";\n\nexport default function _slicedToArray<T>(arr: any, i: number): T[] {\n return (\n arrayWithHoles<T>(arr) ||\n iterableToArrayLimit<T>(arr, i) ||\n unsupportedIterableToArray<T>(arr, i) ||\n nonIterableRest()\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAEe,SAASI,cAAcA,CAAIC,GAAQ,EAAEC,CAAS,EAAO;EAClE,OACE,IAAAC,uBAAc,EAAIF,GAAG,CAAC,IACtB,IAAAG,6BAAoB,EAAIH,GAAG,EAAEC,CAAC,CAAC,IAC/B,IAAAG,mCAA0B,EAAIJ,GAAG,EAAEC,CAAC,CAAC,IACrC,IAAAI,wBAAe,EAAC,CAAC;AAErB","ignoreList":[]}
@@ -0,0 +1,3 @@
declare const _default: <T>(data: T) => boolean;
export default _default;
//# sourceMappingURL=objectHasFunction.d.ts.map
@@ -0,0 +1,8 @@
import Decimal from 'decimal.js';
import { NumberFormatInternal, NumberFormatPart } from '../types/number';
/**
* https://tc39.es/ecma402/#sec-partitionnumberrangepattern
*/
export declare function PartitionNumberRangePattern(numberFormat: Intl.NumberFormat, x: Decimal, y: Decimal, { getInternalSlots, }: {
getInternalSlots(nf: Intl.NumberFormat): NumberFormatInternal;
}): NumberFormatPart[];
@@ -0,0 +1,9 @@
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
/**
* This is a compatibility ruleset that:
* - disables rules from eslint:recommended which are already handled by TypeScript.
* - enables rules that make sense due to TS's typechecking / transpilation.
* @see {@link https://typescript-eslint.io/users/configs/#eslint-recommended}
*/
declare const _default: (_plugin: FlatConfig.Plugin, _parser: FlatConfig.Parser) => FlatConfig.Config;
export default _default;
@@ -0,0 +1,6 @@
<svg viewbox="0 0 18 18">
<rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"></rect>
<rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"></rect>
<path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"></path>
<path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"></path>
</svg>

After

Width:  |  Height:  |  Size: 334 B

@@ -0,0 +1,18 @@
import { __decorate } from "tslib";
import { AsnProp, OctetString } from "@peculiar/asn1-schema";
import { AlgorithmIdentifier } from "@peculiar/asn1-x509";
export class EncryptedData extends OctetString {
}
export class EncryptedPrivateKeyInfo {
constructor(params = {}) {
this.encryptionAlgorithm = new AlgorithmIdentifier();
this.encryptedData = new EncryptedData();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AlgorithmIdentifier })
], EncryptedPrivateKeyInfo.prototype, "encryptionAlgorithm", void 0);
__decorate([
AsnProp({ type: EncryptedData })
], EncryptedPrivateKeyInfo.prototype, "encryptedData", void 0);
@@ -0,0 +1,3 @@
declare function clsx(...args: any[]): string;
export { clsx };
@@ -0,0 +1 @@
{"version":3,"file":"toHash.d.ts","sourceRoot":"","sources":["../../src/helpers/toHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;GAGG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,WAAW,GAAG,MAAM,EAC1B,SAAS,GAAE,OAAY,GACtB,OAAO,CAAC,WAAW,CAAC,CAQtB"}
@@ -0,0 +1,10 @@
'use strict';
/* eslint-env browser */
var inspect = require('../');
var d = document.createElement('div');
d.setAttribute('id', 'beep');
d.innerHTML = '<b>wooo</b><i>iiiii</i>';
console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]));
@@ -0,0 +1,211 @@
/**
* @fileoverview Prevent usage of this.state within setState
* @author Rolf Erik Lekang, Jørgen Aaberg
*/
'use strict';
const docsUrl = require('../util/docsUrl');
const astUtil = require('../util/ast');
const componentUtil = require('../util/componentUtil');
const report = require('../util/report');
const getScope = require('../util/eslint').getScope;
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
const messages = {
useCallback: 'Use callback in setState when referencing the previous state.',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Disallow when this.state is accessed within setState',
category: 'Possible Errors',
recommended: false,
url: docsUrl('no-access-state-in-setstate'),
},
messages,
},
create(context) {
function isSetStateCall(node) {
return astUtil.isCallExpression(node)
&& node.callee.property
&& node.callee.property.name === 'setState'
&& node.callee.object.type === 'ThisExpression';
}
function isFirstArgumentInSetStateCall(current, node) {
if (!isSetStateCall(current)) {
return false;
}
while (node && node.parent !== current) {
node = node.parent;
}
return current.arguments[0] === node;
}
/**
* @param {ASTNode} node
* @returns {boolean}
*/
function isClassComponent(node) {
return !!(
componentUtil.getParentES6Component(context, node)
|| componentUtil.getParentES5Component(context, node)
);
}
// The methods array contains all methods or functions that are using this.state
// or that are calling another method or function using this.state
const methods = [];
// The vars array contains all variables that contains this.state
const vars = [];
return {
CallExpression(node) {
if (!isClassComponent(node)) {
return;
}
// Appends all the methods that are calling another
// method containing this.state to the methods array
methods.forEach((method) => {
if ('name' in node.callee && node.callee.name === method.methodName) {
let current = node.parent;
while (current.type !== 'Program') {
if (current.type === 'MethodDefinition') {
methods.push({
methodName: 'name' in current.key ? current.key.name : undefined,
node: method.node,
});
break;
}
current = current.parent;
}
}
});
// Finding all CallExpressions that is inside a setState
// to further check if they contains this.state
let current = node.parent;
while (current.type !== 'Program') {
if (isFirstArgumentInSetStateCall(current, node)) {
const methodName = 'name' in node.callee ? node.callee.name : undefined;
methods.forEach((method) => {
if (method.methodName === methodName) {
report(context, messages.useCallback, 'useCallback', {
node: method.node,
});
}
});
break;
}
current = current.parent;
}
},
MemberExpression(node) {
if (
'name' in node.property
&& node.property.name === 'state'
&& node.object.type === 'ThisExpression'
&& isClassComponent(node)
) {
/** @type {import('eslint').Rule.Node} */
let current = node;
while (current.type !== 'Program') {
// Reporting if this.state is directly within this.setState
if (isFirstArgumentInSetStateCall(current, node)) {
report(context, messages.useCallback, 'useCallback', {
node,
});
break;
}
// Storing all functions and methods that contains this.state
if (current.type === 'MethodDefinition') {
methods.push({
methodName: 'name' in current.key ? current.key.name : undefined,
node,
});
break;
} else if (
current.type === 'FunctionExpression'
&& 'key' in current.parent
&& current.parent.key
) {
methods.push({
methodName: 'name' in current.parent.key ? current.parent.key.name : undefined,
node,
});
break;
}
// Storing all variables containing this.state
if (current.type === 'VariableDeclarator') {
vars.push({
node,
scope: getScope(context, node),
variableName: 'name' in current.id ? current.id.name : undefined,
});
break;
}
current = current.parent;
}
}
},
Identifier(node) {
// Checks if the identifier is a variable within an object
/** @type {import('eslint').Rule.Node} */
let current = node;
while (current.parent.type === 'BinaryExpression') {
current = current.parent;
}
if (
('value' in current.parent && current.parent.value === current)
|| ('object' in current.parent && current.parent.object === current)
) {
while (current.type !== 'Program') {
if (isFirstArgumentInSetStateCall(current, node)) {
vars
.filter((v) => v.scope === getScope(context, node) && v.variableName === node.name)
.forEach((v) => {
report(context, messages.useCallback, 'useCallback', {
node: v.node,
});
});
}
current = current.parent;
}
}
},
ObjectPattern(node) {
const isDerivedFromThis = 'init' in node.parent && node.parent.init && node.parent.init.type === 'ThisExpression';
node.properties.forEach((property) => {
if (
property
&& 'key' in property
&& property.key
&& 'name' in property.key
&& property.key.name === 'state'
&& isDerivedFromThis
) {
vars.push({
node: property.key,
scope: getScope(context, node),
variableName: property.key.name,
});
}
});
},
};
},
};
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=PlanServiceNodeBindingRemovedResult.js.map
@@ -0,0 +1,28 @@
import { AsnArray } from "@peculiar/asn1-schema";
import { CertPolicyId } from "./certificate_policies";
/**
* ```asn1
* id-ce-policyMappings OBJECT IDENTIFIER ::= { id-ce 33 }
* ```
*/
export declare const id_ce_policyMappings = "2.5.29.33";
/**
* ```asn1
* PolicyMapping ::= SEQUENCE {
* issuerDomainPolicy CertPolicyId,
* subjectDomainPolicy CertPolicyId }
* ```
*/
export declare class PolicyMapping {
issuerDomainPolicy: CertPolicyId;
subjectDomainPolicy: CertPolicyId;
constructor(params?: Partial<PolicyMappings>);
}
/**
* ```asn1
* PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF PolicyMapping
* ```
*/
export declare class PolicyMappings extends AsnArray<PolicyMapping> {
constructor(items?: PolicyMapping[]);
}
@@ -0,0 +1,42 @@
"use strict"
const { READ } = require("@eslint-community/eslint-utils")
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
const url = {
domainToASCII: { [READ]: { supported: ["7.4.0", "6.13.0"] } },
domainToUnicode: { [READ]: { supported: ["7.4.0", "6.13.0"] } },
fileURLToPath: { [READ]: { supported: ["10.12.0"] } },
format: { [READ]: { supported: ["7.6.0"] } },
pathToFileURL: { [READ]: { supported: ["10.12.0"] } },
urlToHttpOptions: { [READ]: { supported: ["15.7.0", "14.18.0"] } },
URL: {
[READ]: { supported: ["7.0.0", "6.13.0"] },
canParse: { [READ]: { supported: ["19.9.0"] } },
createObjectURL: {
[READ]: { experimental: ["16.7.0"], supported: ["22.17.0"] },
},
revokeObjectURL: {
[READ]: { experimental: ["16.7.0"], supported: ["22.17.0"] },
},
},
URLPattern: { [READ]: { experimental: ["23.8.0"] } },
URLSearchParams: { [READ]: { supported: ["7.5.0", "6.13.0"] } },
Url: { [READ]: { supported: ["0.1.25"] } },
}
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
module.exports = {
url: {
[READ]: { supported: ["0.1.25"] },
...url,
},
"node:url": {
[READ]: { supported: ["14.13.1", "12.20.0"] },
...url,
},
}
@@ -0,0 +1,15 @@
Copyright (c) 2024, Borewit
All rights reserved.
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,11 @@
import type { TSESLint } from '@typescript-eslint/utils';
export interface Options {
src?: string[];
ignoreExports?: string[];
missingExports?: true;
unusedExports?: boolean;
ignoreUnusedTypeExports?: boolean;
}
type MessageId = 'notFound' | 'unused';
declare const _default: TSESLint.RuleModule<MessageId, Options[], import("../utils/create-rule.ts").ImportXPluginDocs, TSESLint.RuleListener>;
export default _default;
@@ -0,0 +1,91 @@
import { PluginRouterRegistry, PluginRequestHandler, PluginPageDefinition, HttpMethod, MemoryStaticFile } from './types';
/**
* 插件路由注册器实现
* 为每个插件创建独立的路由注册器,收集路由定义
*/
/** 内存静态路由定义 */
interface MemoryStaticRoute {
urlPath: string;
files: MemoryStaticFile[];
}
export declare class PluginRouterRegistryImpl implements PluginRouterRegistry {
private readonly pluginId;
private readonly pluginPath;
private apiRoutes;
private apiNoAuthRoutes;
private pageDefinitions;
private staticRoutes;
private memoryStaticRoutes;
constructor(pluginId: string, pluginPath: string);
api(method: HttpMethod, routePath: string, handler: PluginRequestHandler): void;
get(routePath: string, handler: PluginRequestHandler): void;
post(routePath: string, handler: PluginRequestHandler): void;
put(routePath: string, handler: PluginRequestHandler): void;
delete(routePath: string, handler: PluginRequestHandler): void;
apiNoAuth(method: HttpMethod, routePath: string, handler: PluginRequestHandler): void;
getNoAuth(routePath: string, handler: PluginRequestHandler): void;
postNoAuth(routePath: string, handler: PluginRequestHandler): void;
putNoAuth(routePath: string, handler: PluginRequestHandler): void;
deleteNoAuth(routePath: string, handler: PluginRequestHandler): void;
page(pageDef: PluginPageDefinition): void;
pages(pageDefs: PluginPageDefinition[]): void;
static(urlPath: string, localPath: string): void;
staticOnMem(urlPath: string, files: MemoryStaticFile[]): void;
/**
* 构建 Express Router(用于 API 路由)
* 注意:静态资源路由不在此处挂载,由 webui-backend 直接在不需要鉴权的路径下处理
*/
buildApiRouter(): Router;
/**
* 包装处理器,添加错误处理和请求/响应包装
*/
private wrapHandler;
/**
* 检查是否有注册的 API 路由(需要认证)
*/
hasApiRoutes(): boolean;
/**
* 检查是否有注册的无认证 API 路由
*/
hasApiNoAuthRoutes(): boolean;
/**
* 构建无认证 Express Router(用于 /plugin/{pluginId}/api/ 路径)
*/
buildApiNoAuthRouter(): Router;
/**
* 检查是否有注册的静态资源路由
*/
hasStaticRoutes(): boolean;
/**
* 检查是否有注册的页面
*/
hasPages(): boolean;
/**
* 获取所有注册的页面定义
*/
getPages(): PluginPageDefinition[];
/**
* 获取插件 ID
*/
getPluginId(): string;
/**
* 获取插件路径
*/
getPluginPath(): string;
/**
* 获取所有注册的静态路由
*/
getStaticRoutes(): Array<{
urlPath: string;
localPath: string;
}>;
/**
* 获取所有注册的内存静态路由
*/
getMemoryStaticRoutes(): MemoryStaticRoute[];
/**
* 清空路由(用于插件卸载)
*/
clear(): void;
}
export {};
@@ -0,0 +1,50 @@
import Delta from 'quill-delta';
import type { Blot, ScrollBlot } from 'parchment';
import Inline from '../blots/inline.js';
import Quill from '../core/quill.js';
import Module from '../core/module.js';
import CodeBlock, { CodeBlockContainer } from '../formats/code.js';
declare class CodeToken extends Inline {
static formats(node: Element, scroll: ScrollBlot): any;
constructor(scroll: ScrollBlot, domNode: Node, value: unknown);
format(format: string, value: unknown): void;
optimize(...args: unknown[]): void;
}
declare class SyntaxCodeBlock extends CodeBlock {
static create(value: unknown): HTMLElement;
static formats(domNode: Node): any;
static register(): void;
format(name: string, value: unknown): void;
replaceWith(name: string | Blot, value?: any): Blot;
}
declare class SyntaxCodeBlockContainer extends CodeBlockContainer {
forceNext?: boolean;
cachedText?: string | null;
attach(): void;
format(name: string, value: unknown): void;
formatAt(index: number, length: number, name: string, value: unknown): void;
highlight(highlight: (text: string, language: string) => Delta, forced?: boolean): void;
html(index: number, length: number): string;
optimize(context: Record<string, any>): void;
}
interface SyntaxOptions {
interval: number;
languages: {
key: string;
label: string;
}[];
hljs: any;
}
declare class Syntax extends Module<SyntaxOptions> {
static DEFAULTS: SyntaxOptions & {
hljs: any;
};
static register(): void;
languages: Record<string, true>;
constructor(quill: Quill, options: Partial<SyntaxOptions>);
initListener(): void;
initTimer(): void;
highlight(blot?: SyntaxCodeBlockContainer | null, force?: boolean): void;
highlightBlot(text: string, language?: string): Delta;
}
export { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default };
@@ -0,0 +1,42 @@
'use strict';
var stringifyNumber = require('../../stringify/stringifyNumber.js');
const intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);
const intResolve = (str, offset, radix, { intAsBigInt }) => (intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix));
function intStringify(node, radix, prefix) {
const { value } = node;
if (intIdentify(value) && value >= 0)
return prefix + value.toString(radix);
return stringifyNumber.stringifyNumber(node);
}
const intOct = {
identify: value => intIdentify(value) && value >= 0,
default: true,
tag: 'tag:yaml.org,2002:int',
format: 'OCT',
test: /^0o[0-7]+$/,
resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt),
stringify: node => intStringify(node, 8, '0o')
};
const int = {
identify: intIdentify,
default: true,
tag: 'tag:yaml.org,2002:int',
test: /^[-+]?[0-9]+$/,
resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
stringify: stringifyNumber.stringifyNumber
};
const intHex = {
identify: value => intIdentify(value) && value >= 0,
default: true,
tag: 'tag:yaml.org,2002:int',
format: 'HEX',
test: /^0x[0-9a-fA-F]+$/,
resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
stringify: node => intStringify(node, 16, '0x')
};
exports.int = int;
exports.intHex = intHex;
exports.intOct = intOct;
@@ -0,0 +1,3 @@
import type { FieldValues } from '../types';
export declare const flatten: (obj: FieldValues) => FieldValues;
//# sourceMappingURL=flatten.d.ts.map
@@ -0,0 +1,57 @@
var arrayMap = require('./_arrayMap'),
baseClone = require('./_baseClone'),
baseUnset = require('./_baseUnset'),
castPath = require('./_castPath'),
copyObject = require('./_copyObject'),
customOmitClone = require('./_customOmitClone'),
flatRest = require('./_flatRest'),
getAllKeysIn = require('./_getAllKeysIn');
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable property paths of `object` that are not omitted.
*
* **Note:** This method is considerably slower than `_.pick`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to omit.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
var omit = flatRest(function(object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function(path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
}
var length = paths.length;
while (length--) {
baseUnset(result, paths[length]);
}
return result;
});
module.exports = omit;
@@ -0,0 +1,7 @@
import * as core from "../core/index.js";
import * as schemas from "./schemas.js";
export declare function string<T = unknown>(params?: string | core.$ZodStringParams): schemas.ZodMiniString<T>;
export declare function number<T = unknown>(params?: string | core.$ZodNumberParams): schemas.ZodMiniNumber<T>;
export declare function boolean<T = unknown>(params?: string | core.$ZodBooleanParams): schemas.ZodMiniBoolean<T>;
export declare function bigint<T = unknown>(params?: string | core.$ZodBigIntParams): schemas.ZodMiniBigInt<T>;
export declare function date<T = unknown>(params?: string | core.$ZodDateParams): schemas.ZodMiniDate<T>;
@@ -0,0 +1,3 @@
import { MaybeClassElementMetadata } from '../models/MaybeClassElementMetadata';
export declare function decrementPendingClassMetadataCount(type: object): (metadata: MaybeClassElementMetadata | undefined) => void;
//# sourceMappingURL=decrementPendingClassMetadataCount.d.ts.map
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=PlanServiceNodeParent.js.map
@@ -0,0 +1,150 @@
import { isCollection, isNode, isScalar, isSeq } from '../nodes/identity.js';
import { Scalar } from '../nodes/Scalar.js';
import { stringify } from './stringify.js';
import { lineComment, indentComment } from './stringifyComment.js';
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
let keyComment = (isNode(key) && key.comment) || null;
if (simpleKeys) {
if (keyComment) {
throw new Error('With simple keys, key nodes cannot have comments');
}
if (isCollection(key) || (!isNode(key) && typeof key === 'object')) {
const msg = 'With simple keys, collection cannot be used as a key value';
throw new Error(msg);
}
}
let explicitKey = !simpleKeys &&
(!key ||
(keyComment && value == null && !ctx.inFlow) ||
isCollection(key) ||
(isScalar(key)
? key.type === Scalar.BLOCK_FOLDED || key.type === Scalar.BLOCK_LITERAL
: typeof key === 'object'));
ctx = Object.assign({}, ctx, {
allNullValues: false,
implicitKey: !explicitKey && (simpleKeys || !allNullValues),
indent: indent + indentStep
});
let keyCommentDone = false;
let chompKeep = false;
let str = stringify(key, ctx, () => (keyCommentDone = true), () => (chompKeep = true));
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
if (simpleKeys)
throw new Error('With simple keys, single line scalar must not span more than 1024 characters');
explicitKey = true;
}
if (ctx.inFlow) {
if (allNullValues || value == null) {
if (keyCommentDone && onComment)
onComment();
return str === '' ? '?' : explicitKey ? `? ${str}` : str;
}
}
else if ((allNullValues && !simpleKeys) || (value == null && explicitKey)) {
str = `? ${str}`;
if (keyComment && !keyCommentDone) {
str += lineComment(str, ctx.indent, commentString(keyComment));
}
else if (chompKeep && onChompKeep)
onChompKeep();
return str;
}
if (keyCommentDone)
keyComment = null;
if (explicitKey) {
if (keyComment)
str += lineComment(str, ctx.indent, commentString(keyComment));
str = `? ${str}\n${indent}:`;
}
else {
str = `${str}:`;
if (keyComment)
str += lineComment(str, ctx.indent, commentString(keyComment));
}
let vsb, vcb, valueComment;
if (isNode(value)) {
vsb = !!value.spaceBefore;
vcb = value.commentBefore;
valueComment = value.comment;
}
else {
vsb = false;
vcb = null;
valueComment = null;
if (value && typeof value === 'object')
value = doc.createNode(value);
}
ctx.implicitKey = false;
if (!explicitKey && !keyComment && isScalar(value))
ctx.indentAtStart = str.length + 1;
chompKeep = false;
if (!indentSeq &&
indentStep.length >= 2 &&
!ctx.inFlow &&
!explicitKey &&
isSeq(value) &&
!value.flow &&
!value.tag &&
!value.anchor) {
// If indentSeq === false, consider '- ' as part of indentation where possible
ctx.indent = ctx.indent.substring(2);
}
let valueCommentDone = false;
const valueStr = stringify(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true));
let ws = ' ';
if (keyComment || vsb || vcb) {
ws = vsb ? '\n' : '';
if (vcb) {
const cs = commentString(vcb);
ws += `\n${indentComment(cs, ctx.indent)}`;
}
if (valueStr === '' && !ctx.inFlow) {
if (ws === '\n' && valueComment)
ws = '\n\n';
}
else {
ws += `\n${ctx.indent}`;
}
}
else if (!explicitKey && isCollection(value)) {
const vs0 = valueStr[0];
const nl0 = valueStr.indexOf('\n');
const hasNewline = nl0 !== -1;
const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;
if (hasNewline || !flow) {
let hasPropsLine = false;
if (hasNewline && (vs0 === '&' || vs0 === '!')) {
let sp0 = valueStr.indexOf(' ');
if (vs0 === '&' &&
sp0 !== -1 &&
sp0 < nl0 &&
valueStr[sp0 + 1] === '!') {
sp0 = valueStr.indexOf(' ', sp0 + 1);
}
if (sp0 === -1 || nl0 < sp0)
hasPropsLine = true;
}
if (!hasPropsLine)
ws = `\n${ctx.indent}`;
}
}
else if (valueStr === '' || valueStr[0] === '\n') {
ws = '';
}
str += ws + valueStr;
if (ctx.inFlow) {
if (valueCommentDone && onComment)
onComment();
}
else if (valueComment && !valueCommentDone) {
str += lineComment(str, ctx.indent, commentString(valueComment));
}
else if (chompKeep && onChompKeep) {
onChompKeep();
}
return str;
}
export { stringifyPair };
@@ -0,0 +1,32 @@
import {useToggle as $ifSyJ$useToggle} from "@react-aria/toggle";
/*
* 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 $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {
let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled, isReadOnly: isReadOnly } = (0, $ifSyJ$useToggle)(props, state, ref);
return {
labelProps: labelProps,
inputProps: {
...inputProps,
role: 'switch',
checked: isSelected
},
isSelected: isSelected,
isPressed: isPressed,
isDisabled: isDisabled,
isReadOnly: isReadOnly
};
}
export {$b418ec0c85c52f27$export$d853f7095ae95f88 as useSwitch};
//# sourceMappingURL=useSwitch.module.js.map
@@ -0,0 +1,42 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.0.4](https://github.com/ljharb/call-bound/compare/v1.0.3...v1.0.4) - 2025-03-03
### Commits
- [types] improve types [`e648922`](https://github.com/ljharb/call-bound/commit/e6489222a9e54f350fbf952ceabe51fd8b6027ff)
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`a42a5eb`](https://github.com/ljharb/call-bound/commit/a42a5ebe6c1b54fcdc7997c7dc64fdca9e936719)
- [Deps] update `call-bind-apply-helpers`, `get-intrinsic` [`f529eac`](https://github.com/ljharb/call-bound/commit/f529eac132404c17156bbc23ab2297a25d0f20b8)
## [v1.0.3](https://github.com/ljharb/call-bound/compare/v1.0.2...v1.0.3) - 2024-12-15
### Commits
- [Refactor] use `call-bind-apply-helpers` instead of `call-bind` [`5e0b134`](https://github.com/ljharb/call-bound/commit/5e0b13496df14fb7d05dae9412f088da8d3f75be)
- [Deps] update `get-intrinsic` [`41fc967`](https://github.com/ljharb/call-bound/commit/41fc96732a22c7b7e8f381f93ccc54bb6293be2e)
- [readme] fix example [`79a0137`](https://github.com/ljharb/call-bound/commit/79a0137723f7c6d09c9c05452bbf8d5efb5d6e49)
- [meta] add `sideEffects` flag [`08b07be`](https://github.com/ljharb/call-bound/commit/08b07be7f1c03f67dc6f3cdaf0906259771859f7)
## [v1.0.2](https://github.com/ljharb/call-bound/compare/v1.0.1...v1.0.2) - 2024-12-10
### Commits
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `gopd` [`e6a5ffe`](https://github.com/ljharb/call-bound/commit/e6a5ffe849368fe4f74dfd6cdeca1b9baa39e8d5)
- [Deps] update `call-bind`, `get-intrinsic` [`2aeb5b5`](https://github.com/ljharb/call-bound/commit/2aeb5b521dc2b2683d1345c753ea1161de2d1c14)
- [types] improve return type [`1a0c9fe`](https://github.com/ljharb/call-bound/commit/1a0c9fe3114471e7ca1f57d104e2efe713bb4871)
## v1.0.1 - 2024-12-05
### Commits
- Initial implementation, tests, readme, types [`6d94121`](https://github.com/ljharb/call-bound/commit/6d94121a9243602e506334069f7a03189fe3363d)
- Initial commit [`0eae867`](https://github.com/ljharb/call-bound/commit/0eae867334ea025c33e6e91cdecfc9df96680cf9)
- npm init [`71b2479`](https://github.com/ljharb/call-bound/commit/71b2479c6723e0b7d91a6b663613067e98b7b275)
- Only apps should have lockfiles [`c3754a9`](https://github.com/ljharb/call-bound/commit/c3754a949b7f9132b47e2d18c1729889736741eb)
- [actions] skip `npm ls` in node &lt; 10 [`74275a5`](https://github.com/ljharb/call-bound/commit/74275a5186b8caf6309b6b97472bdcb0df4683a8)
- [Dev Deps] add missing peer dep [`1354de8`](https://github.com/ljharb/call-bound/commit/1354de8679413e4ae9c523d85f76fa7a5e032d97)
@@ -0,0 +1,65 @@
{
"name": "postcss-import",
"version": "15.1.0",
"description": "PostCSS plugin to import CSS files",
"keywords": [
"css",
"postcss",
"postcss-plugin",
"import",
"node modules",
"npm"
],
"author": "Maxime Thirouin",
"license": "MIT",
"repository": "https://github.com/postcss/postcss-import.git",
"files": [
"index.js",
"lib"
],
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"postcss-value-parser": "^4.0.0",
"read-cache": "^1.0.0",
"resolve": "^1.1.7"
},
"devDependencies": {
"ava": "^5.0.0",
"eslint": "^8.2.0",
"eslint-config-problems": "^7.0.0",
"eslint-plugin-prettier": "^4.0.0",
"postcss": "^8.0.0",
"postcss-scss": "^4.0.0",
"prettier": "~2.8.0",
"sugarss": "^4.0.0"
},
"peerDependencies": {
"postcss": "^8.0.0"
},
"scripts": {
"ci": "eslint . && ava",
"lint": "eslint . --fix",
"pretest": "npm run lint",
"test": "ava"
},
"eslintConfig": {
"extends": "eslint-config-problems",
"env": {
"node": true
},
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"semi": false,
"arrowParens": "avoid"
}
]
}
}
}
@@ -0,0 +1,38 @@
import crypto from 'crypto';
import URLSearchParams from './classes/URLSearchParams.js'
import FormData from './classes/FormData.js'
const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
const DIGIT = '0123456789';
const ALPHABET = {
DIGIT,
ALPHA,
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
}
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
let str = '';
const {length} = alphabet;
const randomValues = new Uint32Array(size);
crypto.randomFillSync(randomValues);
for (let i = 0; i < size; i++) {
str += alphabet[randomValues[i] % length];
}
return str;
}
export default {
isNode: true,
classes: {
URLSearchParams,
FormData,
Blob: typeof Blob !== 'undefined' && Blob || null
},
ALPHABET,
generateString,
protocols: [ 'http', 'https', 'file', 'data' ]
};
@@ -0,0 +1,169 @@
# http-errors
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][node-url]
[![Node.js Version][node-image]][node-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Create HTTP errors for Express, Koa, Connect, etc. with ease.
## 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):
```console
$ npm install http-errors
```
## Example
```js
var createError = require('http-errors')
var express = require('express')
var app = express()
app.use(function (req, res, next) {
if (!req.user) return next(createError(401, 'Please login to view this page.'))
next()
})
```
## API
This is the current API, currently extracted from Koa and subject to change.
### Error Properties
- `expose` - can be used to signal if `message` should be sent to the client,
defaulting to `false` when `status` >= 500
- `headers` - can be an object of header names to values to be sent to the
client, defaulting to `undefined`. When defined, the key names should all
be lower-cased
- `message` - the traditional error message, which should be kept short and all
single line
- `status` - the status code of the error, mirroring `statusCode` for general
compatibility
- `statusCode` - the status code of the error, defaulting to `500`
### createError([status], [message], [properties])
Create a new error object with the given message `msg`.
The error object inherits from `createError.HttpError`.
```js
var err = createError(404, 'This video does not exist!')
```
- `status: 500` - the status code as a number
- `message` - the message of the error, defaulting to node's text for that status code.
- `properties` - custom properties to attach to the object
### createError([status], [error], [properties])
Extend the given `error` object with `createError.HttpError`
properties. This will not alter the inheritance of the given
`error` object, and the modified `error` object is the
return value.
<!-- eslint-disable no-redeclare -->
```js
fs.readFile('foo.txt', function (err, buf) {
if (err) {
if (err.code === 'ENOENT') {
var httpError = createError(404, err, { expose: false })
} else {
var httpError = createError(500, err)
}
}
})
```
- `status` - the status code as a number
- `error` - the error object to extend
- `properties` - custom properties to attach to the object
### createError.isHttpError(val)
Determine if the provided `val` is an `HttpError`. This will return `true`
if the error inherits from the `HttpError` constructor of this module or
matches the "duck type" for an error this module creates. All outputs from
the `createError` factory will return `true` for this function, including
if an non-`HttpError` was passed into the factory.
### new createError\[code || name\](\[msg]\))
Create a new error object with the given message `msg`.
The error object inherits from `createError.HttpError`.
```js
var err = new createError.NotFound()
```
- `code` - the status code as a number
- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`.
#### List of all constructors
|Status Code|Constructor Name |
|-----------|-----------------------------|
|400 |BadRequest |
|401 |Unauthorized |
|402 |PaymentRequired |
|403 |Forbidden |
|404 |NotFound |
|405 |MethodNotAllowed |
|406 |NotAcceptable |
|407 |ProxyAuthenticationRequired |
|408 |RequestTimeout |
|409 |Conflict |
|410 |Gone |
|411 |LengthRequired |
|412 |PreconditionFailed |
|413 |PayloadTooLarge |
|414 |URITooLong |
|415 |UnsupportedMediaType |
|416 |RangeNotSatisfiable |
|417 |ExpectationFailed |
|418 |ImATeapot |
|421 |MisdirectedRequest |
|422 |UnprocessableEntity |
|423 |Locked |
|424 |FailedDependency |
|425 |TooEarly |
|426 |UpgradeRequired |
|428 |PreconditionRequired |
|429 |TooManyRequests |
|431 |RequestHeaderFieldsTooLarge |
|451 |UnavailableForLegalReasons |
|500 |InternalServerError |
|501 |NotImplemented |
|502 |BadGateway |
|503 |ServiceUnavailable |
|504 |GatewayTimeout |
|505 |HTTPVersionNotSupported |
|506 |VariantAlsoNegotiates |
|507 |InsufficientStorage |
|508 |LoopDetected |
|509 |BandwidthLimitExceeded |
|510 |NotExtended |
|511 |NetworkAuthenticationRequired|
## License
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/jshttp/http-errors/master?label=ci
[ci-url]: https://github.com/jshttp/http-errors/actions?query=workflow%3Aci
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master
[coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master
[node-image]: https://badgen.net/npm/node/http-errors
[node-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/http-errors
[npm-url]: https://npmjs.org/package/http-errors
[npm-version-image]: https://badgen.net/npm/v/http-errors
[travis-image]: https://badgen.net/travis/jshttp/http-errors/master
[travis-url]: https://travis-ci.org/jshttp/http-errors
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isStructurallySame = exports._Parser = void 0;
exports.parse = parse;
var tslib_1 = require("tslib");
function parse() {
throw new Error("You're trying to format an uncompiled message with react-intl without parser, please import from 'react-intl' instead");
}
tslib_1.__exportStar(require("./types"), exports);
exports._Parser = undefined;
var manipulator_1 = require("./manipulator");
Object.defineProperty(exports, "isStructurallySame", { enumerable: true, get: function () { return manipulator_1.isStructurallySame; } });
@@ -0,0 +1,39 @@
@protobuf-ts/runtime
====================
Runtime library for code generated by [protobuf-ts](https://github.com/timostamm/protobuf-ts/).
Create, clone, serialize, and compare protobuf messages. Get reflection
information about message fields and custom options.
Installation:
```shell script
# with npm:
npm install @protobuf-ts/runtime
# with yarn:
yarn add @protobuf-ts/runtime
```
You probably want the protoc plugin as well:
```shell script
# with npm:
npm install -D @protobuf-ts/plugin
# with yarn:
yarn add --dev @protobuf-ts/plugin
```
To learn more, please read the [MANUAL](https://github.com/timostamm/protobuf-ts/blob/master/MANUAL.md#imessagetype)
or check the repository [README](https://github.com/timostamm/protobuf-ts/README.md) for a quick overview.
### Copyright
- The [code to decode UTF8](https://github.com/timostamm/protobuf-ts/blob/master/packages/runtime/src/protobufjs-utf8.ts) is Copyright 2016 by Daniel Wirtz, licensed under BSD-3-Clause.
- The [code to encode and decode varint](https://github.com/timostamm/protobuf-ts/blob/master/packages/runtime/src/goog-varint.ts) is Copyright 2008 Google Inc., licensed under BSD-3-Clause.
- All other files are licensed under Apache-2.0, see [LICENSE](https://github.com/timostamm/protobuf-ts/blob/master/packages/runtime/LICENSE).
@@ -0,0 +1,11 @@
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
import type { TProperties } from '../object/index.mjs';
import { type TMappedResult } from '../mapped/index.mjs';
import { type TExtends } from './extends.mjs';
type TFromProperties<P extends TProperties, Right extends TSchema, False extends TSchema, True extends TSchema> = ({
[K2 in keyof P]: TExtends<P[K2], Right, False, True>;
});
type TFromMappedResult<Left extends TMappedResult, Right extends TSchema, True extends TSchema, False extends TSchema> = (TFromProperties<Left['properties'], Right, True, False>);
export type TExtendsFromMappedResult<Left extends TMappedResult, Right extends TSchema, True extends TSchema, False extends TSchema, P extends TProperties = TFromMappedResult<Left, Right, True, False>> = (TMappedResult<P>);
export declare function ExtendsFromMappedResult<Left extends TMappedResult, Right extends TSchema, True extends TSchema, False extends TSchema, P extends TProperties = TFromMappedResult<Left, Right, True, False>>(Left: Left, Right: Right, True: True, False: False, options?: SchemaOptions): TMappedResult<P>;
export {};
@@ -0,0 +1,16 @@
'use strict'
module.exports = {
// Export promiseified graceful-fs:
...require('./fs'),
// Export extra methods:
...require('./copy'),
...require('./empty'),
...require('./ensure'),
...require('./json'),
...require('./mkdirs'),
...require('./move'),
...require('./output-file'),
...require('./path-exists'),
...require('./remove')
}
@@ -0,0 +1,17 @@
const { join, resolve } = require('path');
const { readdirSync, statSync } = require('fs');
function totalist(dir, callback, pre='') {
dir = resolve('.', dir);
let arr = readdirSync(dir);
let i=0, abs, stats;
for (; i < arr.length; i++) {
abs = join(dir, arr[i]);
stats = statSync(abs);
stats.isDirectory()
? totalist(abs, callback, join(pre, arr[i]))
: callback(join(pre, arr[i]), abs, stats);
}
}
exports.totalist = totalist;
@@ -0,0 +1,30 @@
import Module, { createRequire } from 'node:module';
import path from 'node:path';
import { cjsRequire } from '../require.js';
function createModule(filename) {
const mod = new Module(filename);
mod.filename = filename;
mod.paths = Module._nodeModulePaths(path.dirname(filename));
return mod;
}
export function moduleRequire(p, sourceFile) {
try {
const eslintPath = cjsRequire.resolve('eslint');
const eslintModule = createModule(eslintPath);
return cjsRequire(Module._resolveFilename(p, eslintModule));
}
catch {
}
try {
return cjsRequire.main.require(p);
}
catch {
}
try {
return createRequire(sourceFile)(p);
}
catch {
}
return cjsRequire(p);
}
//# sourceMappingURL=module-require.js.map
@@ -0,0 +1,33 @@
import baseUpdate from './_baseUpdate.js';
import castFunction from './_castFunction.js';
/**
* This method is like `_.update` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {Function} updater The function to produce the updated value.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* var object = {};
*
* _.updateWith(object, '[0][1]', _.constant('a'), Object);
* // => { '0': { '1': 'a' } }
*/
function updateWith(object, path, updater, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
}
export default updateWith;
@@ -0,0 +1,7 @@
/**
* The symbol used as a key on message objects to store the message type.
*
* Note that this is an experimental feature - it is here to stay, but
* implementation details may change without notice.
*/
export const MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type");
@@ -0,0 +1,273 @@
import {NumberFormatter as $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5} from "./NumberFormatter.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX = new RegExp('^.*\\(.*\\).*$');
const $6c7bd7858deea686$var$NUMBERING_SYSTEMS = [
'latn',
'arab',
'hanidec',
'deva',
'beng',
'fullwide'
];
class $6c7bd7858deea686$export$cd11ab140839f11d {
/**
* Parses the given string to a number. Returns NaN if a valid number could not be parsed.
*/ parse(value) {
return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).parse(value);
}
/**
* Returns whether the given string could potentially be a valid number. This should be used to
* validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity
* of the minus/plus sign characters can be checked.
*/ isValidPartialNumber(value, minValue, maxValue) {
return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).isValidPartialNumber(value, minValue, maxValue);
}
/**
* Returns a numbering system for which the given string is valid in the current locale.
* If no numbering system could be detected, the default numbering system for the current
* locale is returned.
*/ getNumberingSystem(value) {
return $6c7bd7858deea686$var$getNumberParserImpl(this.locale, this.options, value).options.numberingSystem;
}
constructor(locale, options = {}){
this.locale = locale;
this.options = options;
}
}
const $6c7bd7858deea686$var$numberParserCache = new Map();
function $6c7bd7858deea686$var$getNumberParserImpl(locale, options, value) {
// First try the default numbering system for the provided locale
let defaultParser = $6c7bd7858deea686$var$getCachedNumberParser(locale, options);
// If that doesn't match, and the locale doesn't include a hard coded numbering system,
// try each of the other supported numbering systems until we find one that matches.
if (!locale.includes('-nu-') && !defaultParser.isValidPartialNumber(value)) {
for (let numberingSystem of $6c7bd7858deea686$var$NUMBERING_SYSTEMS)if (numberingSystem !== defaultParser.options.numberingSystem) {
let parser = $6c7bd7858deea686$var$getCachedNumberParser(locale + (locale.includes('-u-') ? '-nu-' : '-u-nu-') + numberingSystem, options);
if (parser.isValidPartialNumber(value)) return parser;
}
}
return defaultParser;
}
function $6c7bd7858deea686$var$getCachedNumberParser(locale, options) {
let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : '');
let parser = $6c7bd7858deea686$var$numberParserCache.get(cacheKey);
if (!parser) {
parser = new $6c7bd7858deea686$var$NumberParserImpl(locale, options);
$6c7bd7858deea686$var$numberParserCache.set(cacheKey, parser);
}
return parser;
}
// The actual number parser implementation. Instances of this class are cached
// based on the locale, options, and detected numbering system.
class $6c7bd7858deea686$var$NumberParserImpl {
parse(value) {
// to parse the number, we need to remove anything that isn't actually part of the number, for example we want '-10.40' not '-10.40 USD'
let fullySanitizedValue = this.sanitize(value);
if (this.symbols.group) // Remove group characters, and replace decimal points and numerals with ASCII values.
fullySanitizedValue = $6c7bd7858deea686$var$replaceAll(fullySanitizedValue, this.symbols.group, '');
if (this.symbols.decimal) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.decimal, '.');
if (this.symbols.minusSign) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.minusSign, '-');
fullySanitizedValue = fullySanitizedValue.replace(this.symbols.numeral, this.symbols.index);
if (this.options.style === 'percent') {
// javascript is bad at dividing by 100 and maintaining the same significant figures, so perform it on the string before parsing
let isNegative = fullySanitizedValue.indexOf('-');
fullySanitizedValue = fullySanitizedValue.replace('-', '');
fullySanitizedValue = fullySanitizedValue.replace('+', '');
let index = fullySanitizedValue.indexOf('.');
if (index === -1) index = fullySanitizedValue.length;
fullySanitizedValue = fullySanitizedValue.replace('.', '');
if (index - 2 === 0) fullySanitizedValue = `0.${fullySanitizedValue}`;
else if (index - 2 === -1) fullySanitizedValue = `0.0${fullySanitizedValue}`;
else if (index - 2 === -2) fullySanitizedValue = '0.00';
else fullySanitizedValue = `${fullySanitizedValue.slice(0, index - 2)}.${fullySanitizedValue.slice(index - 2)}`;
if (isNegative > -1) fullySanitizedValue = `-${fullySanitizedValue}`;
}
let newValue = fullySanitizedValue ? +fullySanitizedValue : NaN;
if (isNaN(newValue)) return NaN;
if (this.options.style === 'percent') {
var _this_options_minimumFractionDigits, _this_options_maximumFractionDigits;
// extra step for rounding percents to what our formatter would output
let options = {
...this.options,
style: 'decimal',
minimumFractionDigits: Math.min(((_this_options_minimumFractionDigits = this.options.minimumFractionDigits) !== null && _this_options_minimumFractionDigits !== void 0 ? _this_options_minimumFractionDigits : 0) + 2, 20),
maximumFractionDigits: Math.min(((_this_options_maximumFractionDigits = this.options.maximumFractionDigits) !== null && _this_options_maximumFractionDigits !== void 0 ? _this_options_maximumFractionDigits : 0) + 2, 20)
};
return new $6c7bd7858deea686$export$cd11ab140839f11d(this.locale, options).parse(new (0, $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5)(this.locale, options).format(newValue));
}
// accounting will always be stripped to a positive number, so if it's accounting and has a () around everything, then we need to make it negative again
if (this.options.currencySign === 'accounting' && $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX.test(value)) newValue = -1 * newValue;
return newValue;
}
sanitize(value) {
// Remove literals and whitespace, which are allowed anywhere in the string
value = value.replace(this.symbols.literals, '');
// Replace the ASCII minus sign with the minus sign used in the current locale
// so that both are allowed in case the user's keyboard doesn't have the locale's minus sign.
if (this.symbols.minusSign) value = value.replace('-', this.symbols.minusSign);
// In arab numeral system, their decimal character is 1643, but most keyboards don't type that
// instead they use the , (44) character or apparently the (1548) character.
if (this.options.numberingSystem === 'arab') {
if (this.symbols.decimal) {
value = value.replace(',', this.symbols.decimal);
value = value.replace(String.fromCharCode(1548), this.symbols.decimal);
}
if (this.symbols.group) value = $6c7bd7858deea686$var$replaceAll(value, '.', this.symbols.group);
}
// In some locale styles, such as swiss currency, the group character can be a special single quote
// that keyboards don't typically have. This expands the character to include the easier to type single quote.
if (this.symbols.group === "\u2019" && value.includes("'")) value = $6c7bd7858deea686$var$replaceAll(value, "'", this.symbols.group);
// fr-FR group character is narrow non-breaking space, char code 8239 (U+202F), but that's not a key on the french keyboard,
// so allow space and non-breaking space as a group char as well
if (this.options.locale === 'fr-FR' && this.symbols.group) {
value = $6c7bd7858deea686$var$replaceAll(value, ' ', this.symbols.group);
value = $6c7bd7858deea686$var$replaceAll(value, /\u00A0/g, this.symbols.group);
}
return value;
}
isValidPartialNumber(value, minValue = -Infinity, maxValue = Infinity) {
value = this.sanitize(value);
// Remove minus or plus sign, which must be at the start of the string.
if (this.symbols.minusSign && value.startsWith(this.symbols.minusSign) && minValue < 0) value = value.slice(this.symbols.minusSign.length);
else if (this.symbols.plusSign && value.startsWith(this.symbols.plusSign) && maxValue > 0) value = value.slice(this.symbols.plusSign.length);
// Numbers cannot start with a group separator
if (this.symbols.group && value.startsWith(this.symbols.group)) return false;
// Numbers that can't have any decimal values fail if a decimal character is typed
if (this.symbols.decimal && value.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0) return false;
// Remove numerals, groups, and decimals
if (this.symbols.group) value = $6c7bd7858deea686$var$replaceAll(value, this.symbols.group, '');
value = value.replace(this.symbols.numeral, '');
if (this.symbols.decimal) value = value.replace(this.symbols.decimal, '');
// The number is valid if there are no remaining characters
return value.length === 0;
}
constructor(locale, options = {}){
this.locale = locale;
// see https://tc39.es/ecma402/#sec-setnfdigitoptions, when using roundingIncrement, the maximumFractionDigits and minimumFractionDigits must be equal
// by default, they are 0 and 3 respectively, so we set them to 0 if neither are set
if (options.roundingIncrement !== 1 && options.roundingIncrement != null) {
if (options.maximumFractionDigits == null && options.minimumFractionDigits == null) {
options.maximumFractionDigits = 0;
options.minimumFractionDigits = 0;
} else if (options.maximumFractionDigits == null) options.maximumFractionDigits = options.minimumFractionDigits;
else if (options.minimumFractionDigits == null) options.minimumFractionDigits = options.maximumFractionDigits;
// if both are specified, let the normal Range Error be thrown
}
this.formatter = new Intl.NumberFormat(locale, options);
this.options = this.formatter.resolvedOptions();
this.symbols = $6c7bd7858deea686$var$getSymbols(locale, this.formatter, this.options, options);
var _this_options_minimumFractionDigits, _this_options_maximumFractionDigits;
if (this.options.style === 'percent' && (((_this_options_minimumFractionDigits = this.options.minimumFractionDigits) !== null && _this_options_minimumFractionDigits !== void 0 ? _this_options_minimumFractionDigits : 0) > 18 || ((_this_options_maximumFractionDigits = this.options.maximumFractionDigits) !== null && _this_options_maximumFractionDigits !== void 0 ? _this_options_maximumFractionDigits : 0) > 18)) console.warn('NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.');
}
}
const $6c7bd7858deea686$var$nonLiteralParts = new Set([
'decimal',
'fraction',
'integer',
'minusSign',
'plusSign',
'group'
]);
// This list is derived from https://www.unicode.org/cldr/charts/43/supplemental/language_plural_rules.html#comparison and includes
// all unique numbers which we need to check in order to determine all the plural forms for a given locale.
// See: https://github.com/adobe/react-spectrum/pull/5134/files#r1337037855 for used script
const $6c7bd7858deea686$var$pluralNumbers = [
0,
4,
2,
1,
11,
20,
3,
7,
100,
21,
0.1,
1.1
];
function $6c7bd7858deea686$var$getSymbols(locale, formatter, intlOptions, originalOptions) {
var _allParts_find, _posAllParts_find, _decimalParts_find, _allParts_find1;
// formatter needs access to all decimal places in order to generate the correct literal strings for the plural set
let symbolFormatter = new Intl.NumberFormat(locale, {
...intlOptions,
// Resets so we get the full range of symbols
minimumSignificantDigits: 1,
maximumSignificantDigits: 21,
roundingIncrement: 1,
roundingPriority: 'auto',
roundingMode: 'halfExpand'
});
// Note: some locale's don't add a group symbol until there is a ten thousands place
let allParts = symbolFormatter.formatToParts(-10000.111);
let posAllParts = symbolFormatter.formatToParts(10000.111);
let pluralParts = $6c7bd7858deea686$var$pluralNumbers.map((n)=>symbolFormatter.formatToParts(n));
var _allParts_find_value;
let minusSign = (_allParts_find_value = (_allParts_find = allParts.find((p)=>p.type === 'minusSign')) === null || _allParts_find === void 0 ? void 0 : _allParts_find.value) !== null && _allParts_find_value !== void 0 ? _allParts_find_value : '-';
let plusSign = (_posAllParts_find = posAllParts.find((p)=>p.type === 'plusSign')) === null || _posAllParts_find === void 0 ? void 0 : _posAllParts_find.value;
// Safari does not support the signDisplay option, but our number parser polyfills it.
// If no plus sign was returned, but the original options contained signDisplay, default to the '+' character.
if (!plusSign && ((originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === 'exceptZero' || (originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === 'always')) plusSign = '+';
// If maximumSignificantDigits is 1 (the minimum) then we won't get decimal characters out of the above formatters
// Percent also defaults to 0 fractionDigits, so we need to make a new one that isn't percent to get an accurate decimal
let decimalParts = new Intl.NumberFormat(locale, {
...intlOptions,
minimumFractionDigits: 2,
maximumFractionDigits: 2
}).formatToParts(0.001);
let decimal = (_decimalParts_find = decimalParts.find((p)=>p.type === 'decimal')) === null || _decimalParts_find === void 0 ? void 0 : _decimalParts_find.value;
let group = (_allParts_find1 = allParts.find((p)=>p.type === 'group')) === null || _allParts_find1 === void 0 ? void 0 : _allParts_find1.value;
// this set is also for a regex, it's all literals that might be in the string we want to eventually parse that
// don't contribute to the numerical value
let allPartsLiterals = allParts.filter((p)=>!$6c7bd7858deea686$var$nonLiteralParts.has(p.type)).map((p)=>$6c7bd7858deea686$var$escapeRegex(p.value));
let pluralPartsLiterals = pluralParts.flatMap((p)=>p.filter((p)=>!$6c7bd7858deea686$var$nonLiteralParts.has(p.type)).map((p)=>$6c7bd7858deea686$var$escapeRegex(p.value)));
let sortedLiterals = [
...new Set([
...allPartsLiterals,
...pluralPartsLiterals
])
].sort((a, b)=>b.length - a.length);
let literals = sortedLiterals.length === 0 ? new RegExp('[\\p{White_Space}]', 'gu') : new RegExp(`${sortedLiterals.join('|')}|[\\p{White_Space}]`, 'gu');
// These are for replacing non-latn characters with the latn equivalent
let numerals = [
...new Intl.NumberFormat(intlOptions.locale, {
useGrouping: false
}).format(9876543210)
].reverse();
let indexes = new Map(numerals.map((d, i)=>[
d,
i
]));
let numeral = new RegExp(`[${numerals.join('')}]`, 'g');
let index = (d)=>String(indexes.get(d));
return {
minusSign: minusSign,
plusSign: plusSign,
decimal: decimal,
group: group,
literals: literals,
numeral: numeral,
index: index
};
}
function $6c7bd7858deea686$var$replaceAll(str, find, replace) {
if (str.replaceAll) return str.replaceAll(find, replace);
return str.split(find).join(replace);
}
function $6c7bd7858deea686$var$escapeRegex(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
export {$6c7bd7858deea686$export$cd11ab140839f11d as NumberParser};
//# sourceMappingURL=NumberParser.module.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","isNode","node","VISITOR_KEYS","type"],"sources":["../../src/validators/isNode.ts"],"sourcesContent":["import { VISITOR_KEYS } from \"../definitions/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function isNode(node: any): node is t.Node {\n return !!(node && VISITOR_KEYS[node.type]);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGe,SAASC,MAAMA,CAACC,IAAS,EAAkB;EACxD,OAAO,CAAC,EAAEA,IAAI,IAAIC,mBAAY,CAACD,IAAI,CAACE,IAAI,CAAC,CAAC;AAC5C","ignoreList":[]}
@@ -0,0 +1,14 @@
import 'vite/module-runner';
export { b as VitestModuleEvaluator, a as VitestModuleEvaluatorOptions, c as createImportMetaEnvProxy, g as getDefaultRequestStubs, i as isPrimitive, u as unwrapId, w as wrapId } from './chunks/moduleRunner.d.BxT-OjLR.js';
import 'node:vm';
import '@vitest/spy';
import './chunks/worker.d.ZGohxCEd.js';
import '@vitest/runner';
import './chunks/config.d.BTfZNUu9.js';
import '@vitest/pretty-format';
import '@vitest/snapshot';
import '@vitest/utils/diff';
import './chunks/environment.d.CrsxCzP1.js';
import '@vitest/utils';
import '@vitest/mocker';
import './chunks/mocker.d.BE_2ls6u.js';
@@ -0,0 +1,103 @@
// Copyright (c) 2011-2016 Ryan Prichard
//
// 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.
#include "Buffer.h"
#include <stdint.h>
#include "DebugClient.h"
#include "WinptyAssert.h"
// Define the READ_BUFFER_CHECK() macro. It *must* evaluate its condition,
// exactly once.
#define READ_BUFFER_CHECK(cond) \
do { \
if (!(cond)) { \
trace("decode error: %s", #cond); \
throw DecodeError(); \
} \
} while (false)
enum class Piece : uint8_t { Int32, Int64, WString };
void WriteBuffer::putRawData(const void *data, size_t len) {
const auto p = reinterpret_cast<const char*>(data);
m_buf.insert(m_buf.end(), p, p + len);
}
void WriteBuffer::replaceRawData(size_t pos, const void *data, size_t len) {
ASSERT(pos <= m_buf.size() && len <= m_buf.size() - pos);
const auto p = reinterpret_cast<const char*>(data);
std::copy(p, p + len, &m_buf[pos]);
}
void WriteBuffer::putInt32(int32_t i) {
putRawValue(Piece::Int32);
putRawValue(i);
}
void WriteBuffer::putInt64(int64_t i) {
putRawValue(Piece::Int64);
putRawValue(i);
}
// len is in characters, excluding NUL, i.e. the number of wchar_t elements
void WriteBuffer::putWString(const wchar_t *str, size_t len) {
putRawValue(Piece::WString);
putRawValue(static_cast<uint64_t>(len));
putRawData(str, sizeof(wchar_t) * len);
}
void ReadBuffer::getRawData(void *data, size_t len) {
ASSERT(m_off <= m_buf.size());
READ_BUFFER_CHECK(len <= m_buf.size() - m_off);
const char *const inp = &m_buf[m_off];
std::copy(inp, inp + len, reinterpret_cast<char*>(data));
m_off += len;
}
int32_t ReadBuffer::getInt32() {
READ_BUFFER_CHECK(getRawValue<Piece>() == Piece::Int32);
return getRawValue<int32_t>();
}
int64_t ReadBuffer::getInt64() {
READ_BUFFER_CHECK(getRawValue<Piece>() == Piece::Int64);
return getRawValue<int64_t>();
}
std::wstring ReadBuffer::getWString() {
READ_BUFFER_CHECK(getRawValue<Piece>() == Piece::WString);
const uint64_t charLen = getRawValue<uint64_t>();
READ_BUFFER_CHECK(charLen <= SIZE_MAX / sizeof(wchar_t));
// To be strictly conforming, we can't use the convenient wstring
// constructor, because the string in m_buf mightn't be aligned.
std::wstring ret;
if (charLen > 0) {
const size_t byteLen = charLen * sizeof(wchar_t);
ret.resize(charLen);
getRawData(&ret[0], byteLen);
}
return ret;
}
void ReadBuffer::assertEof() {
READ_BUFFER_CHECK(m_off == m_buf.size());
}
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var MenuListPopupRole = {
relatedConcepts: [],
type: 'widget'
};
var _default = MenuListPopupRole;
exports.default = _default;
@@ -0,0 +1,59 @@
'use strict';
var $TypeError = require('es-errors/type');
var Call = require('es-abstract/2024/Call');
var GetIteratorDirect = require('../aos/GetIteratorDirect');
var IsCallable = require('es-abstract/2024/IsCallable');
var IteratorClose = require('es-abstract/2024/IteratorClose');
var IteratorStepValue = require('es-abstract/2024/IteratorStepValue');
var NormalCompletion = require('es-abstract/2024/NormalCompletion');
var ThrowCompletion = require('es-abstract/2024/ThrowCompletion');
var ToBoolean = require('es-abstract/2024/ToBoolean');
var Type = require('es-abstract/2024/Type');
module.exports = function find(predicate) {
if (this instanceof find) {
throw new $TypeError('`find` is not a constructor');
}
var O = this; // step 1
if (Type(O) !== 'Object') {
throw new $TypeError('`this` value must be an Object'); // step 2
}
if (!IsCallable(predicate)) {
throw new $TypeError('`predicate` must be a function'); // step 3
}
var iterated = GetIteratorDirect(O); // step 4
var counter = 0; // step 5
// eslint-disable-next-line no-constant-condition
while (true) { // step 6
var value = IteratorStepValue(iterated); // step 6.a
if (iterated['[[Done]]']) {
return void undefined; // step 6.b
}
var result;
try {
result = Call(predicate, void undefined, [value, counter]); // step 6.c
} catch (e) {
// close iterator // step 6.d
IteratorClose(
iterated,
ThrowCompletion(e)
);
} finally {
counter += 1; // step 6.f
}
if (ToBoolean(result)) {
return IteratorClose(
iterated,
NormalCompletion(value)
); // step 6.e
}
}
};
@@ -0,0 +1,7 @@
"use strict";
const constants = require("./constants-DR3SPJ7u.js");
const addMilliseconds = require("./addMilliseconds.js");
function addHours(date, hours) {
return addMilliseconds(date, hours * constants.MS_IN_HOUR);
}
module.exports = addHours;
@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefinitionBase = void 0;
const ID_1 = require("../ID");
const generator = (0, ID_1.createIdGenerator)();
class DefinitionBase {
/**
* A unique ID for this instance - primarily used to help debugging and testing
*/
$id = generator();
type;
/**
* The `Identifier` node of this definition
* @public
*/
name;
/**
* The enclosing node of the name.
* @public
*/
node;
/**
* the enclosing statement node of the identifier.
* @public
*/
parent;
constructor(type, name, node, parent) {
this.type = type;
this.name = name;
this.node = node;
this.parent = parent;
}
}
exports.DefinitionBase = DefinitionBase;
@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("dayjs")):"function"==typeof define&&define.amd?define(["exports","dayjs"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_ku={},e.dayjs)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t),d={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},o={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},u=["کانوونی دووەم","شوبات","ئادار","نیسان","ئایار","حوزەیران","تەممووز","ئاب","ئەیلوول","تشرینی یەکەم","تشرینی دووەم","کانوونی یەکەم"],i={name:"ku",months:u,monthsShort:u,weekdays:"یەکشەممە_دووشەممە_سێشەممە_چوارشەممە_پێنجشەممە_هەینی_شەممە".split("_"),weekdaysShort:"یەکشەم_دووشەم_سێشەم_چوارشەم_پێنجشەم_هەینی_شەممە".split("_"),weekStart:6,weekdaysMin:"ی_د_س_چ_پ_هـ_ش".split("_"),preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return o[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return d[e]})).replace(/,/g,"،")},ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiem:function(e){return e<12?"پ.ن":"د.ن"},relativeTime:{future:"لە %s",past:"لەمەوپێش %s",s:"چەند چرکەیەک",m:"یەک خولەک",mm:"%d خولەک",h:"یەک کاتژمێر",hh:"%d کاتژمێر",d:"یەک ڕۆژ",dd:"%d ڕۆژ",M:"یەک مانگ",MM:"%d مانگ",y:"یەک ساڵ",yy:"%d ساڵ"}};r.default.locale(i,null,!0),e.default=i,e.englishToArabicNumbersMap=d,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -0,0 +1,49 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/utilities/custom.ts
var custom_exports = {};
__export(custom_exports, {
default: () => custom_default
});
module.exports = __toCommonJS(custom_exports);
var custom_default = {
".leading-inherit": {
"line-height": "inherit"
},
".bg-img-inherit": {
"background-image": "inherit"
},
".bg-clip-inherit": {
"background-clip": "inherit"
},
".text-fill-inherit": {
"-webkit-text-fill-color": "inherit"
},
".tap-highlight-transparent": {
"-webkit-tap-highlight-color": "transparent"
},
".input-search-cancel-button-none": {
"&::-webkit-search-cancel-button": {
"-webkit-appearance": "none"
}
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
@@ -0,0 +1,56 @@
let Declaration = require('../declaration')
let flexSpec = require('./flex-spec')
class AlignSelf extends Declaration {
check(decl) {
return (
decl.parent &&
!decl.parent.some(i => {
return i.prop && i.prop.startsWith('grid-')
})
)
}
/**
* Return property name by final spec
*/
normalize() {
return 'align-self'
}
/**
* Change property name for 2012 specs
*/
prefixed(prop, prefix) {
let spec
;[spec, prefix] = flexSpec(prefix)
if (spec === 2012) {
return prefix + 'flex-item-align'
}
return super.prefixed(prop, prefix)
}
/**
* Change value for 2012 spec and ignore prefix for 2009
*/
set(decl, prefix) {
let spec = flexSpec(prefix)[0]
if (spec === 2012) {
decl.value = AlignSelf.oldValues[decl.value] || decl.value
return super.set(decl, prefix)
}
if (spec === 'final') {
return super.set(decl, prefix)
}
return undefined
}
}
AlignSelf.names = ['align-self', 'flex-item-align']
AlignSelf.oldValues = {
'flex-end': 'end',
'flex-start': 'start'
}
module.exports = AlignSelf
@@ -0,0 +1,146 @@
export let name: string;
export let plugins: {
'@stylistic': import("eslint").ESLint.Plugin;
};
export let rules: {
'@stylistic/array-bracket-spacing': ["error", string];
'@stylistic/arrow-spacing': ["error", {
before: boolean;
after: boolean;
}];
'@stylistic/block-spacing': ["error", string];
'@stylistic/brace-style': ["error", string, {
allowSingleLine: boolean;
}];
'@stylistic/comma-dangle': ["error", {
arrays: string;
objects: string;
imports: string;
exports: string;
functions: string;
}];
'@stylistic/comma-spacing': ["error", {
before: boolean;
after: boolean;
}];
'@stylistic/comma-style': ["error", string];
'@stylistic/computed-property-spacing': ["error", string, {
enforceForClassMembers: boolean;
}];
'@stylistic/dot-location': ["error", string];
'@stylistic/eol-last': "error";
'@stylistic/func-call-spacing': ["error", string];
'@stylistic/generator-star-spacing': ["error", {
before: boolean;
after: boolean;
}];
'@stylistic/indent': ["error", number, {
SwitchCase: number;
VariableDeclarator: number;
outerIIFEBody: number;
MemberExpression: number;
FunctionDeclaration: {
parameters: number;
body: number;
};
FunctionExpression: {
parameters: number;
body: number;
};
CallExpression: {
arguments: number;
};
ArrayExpression: number;
ObjectExpression: number;
ImportDeclaration: number;
flatTernaryExpressions: boolean;
ignoreComments: boolean;
ignoredNodes: string[];
offsetTernaryExpressions: boolean;
}];
'@stylistic/key-spacing': ["error", {
beforeColon: boolean;
afterColon: boolean;
}];
'@stylistic/keyword-spacing': ["error", {
before: boolean;
after: boolean;
}];
'@stylistic/lines-between-class-members': ["error", string, {
exceptAfterSingleLine: boolean;
}];
'@stylistic/multiline-ternary': ["error", string];
'@stylistic/new-parens': "error";
'@stylistic/no-extra-parens': ["error", string];
'@stylistic/no-floating-decimal': "error";
'@stylistic/no-mixed-operators': ["error", {
groups: string[][];
allowSamePrecedence: boolean;
}];
'@stylistic/no-mixed-spaces-and-tabs': "error";
'@stylistic/no-multi-spaces': "error";
'@stylistic/no-multiple-empty-lines': ["error", {
max: number;
maxBOF: number;
maxEOF: number;
}];
'@stylistic/no-tabs': "error";
'@stylistic/no-trailing-spaces': "error";
'@stylistic/no-whitespace-before-property': "error";
'@stylistic/object-curly-newline': ["error", {
multiline: boolean;
consistent: boolean;
}];
'@stylistic/object-curly-spacing': ["error", string];
'@stylistic/object-property-newline': ["error", {
allowMultiplePropertiesPerLine: boolean;
}];
'@stylistic/operator-linebreak': ["error", string, {
overrides: {
'?': string;
':': string;
'|>': string;
};
}];
'@stylistic/padded-blocks': ["error", {
blocks: string;
switches: string;
classes: string;
}];
'@stylistic/quote-props': ["error", string];
'@stylistic/quotes': ["error", string, {
avoidEscape: boolean;
allowTemplateLiterals: boolean;
}];
'@stylistic/rest-spread-spacing': ["error", string];
'@stylistic/semi': ["error", string];
'@stylistic/semi-spacing': ["error", {
before: boolean;
after: boolean;
}];
'@stylistic/space-before-blocks': ["error", string];
'@stylistic/space-before-function-paren': ["error", string];
'@stylistic/space-in-parens': ["error", string];
'@stylistic/space-infix-ops': "error";
'@stylistic/space-unary-ops': ["error", {
words: boolean;
nonwords: boolean;
}];
'@stylistic/spaced-comment': ["error", string, {
line: {
markers: string[];
};
block: {
balanced: boolean;
markers: string[];
exceptions: string[];
};
}];
'@stylistic/template-curly-spacing': ["error", string];
'@stylistic/template-tag-spacing': ["error", string];
'@stylistic/wrap-iife': ["error", string, {
functionPrototypeMethods: boolean;
}];
'@stylistic/yield-star-spacing': ["error", string];
};
//# sourceMappingURL=style.d.ts.map
@@ -0,0 +1,331 @@
'use strict';
const stringify = require('./stringify');
/**
* Constants
*/
const {
MAX_LENGTH,
CHAR_BACKSLASH, /* \ */
CHAR_BACKTICK, /* ` */
CHAR_COMMA, /* , */
CHAR_DOT, /* . */
CHAR_LEFT_PARENTHESES, /* ( */
CHAR_RIGHT_PARENTHESES, /* ) */
CHAR_LEFT_CURLY_BRACE, /* { */
CHAR_RIGHT_CURLY_BRACE, /* } */
CHAR_LEFT_SQUARE_BRACKET, /* [ */
CHAR_RIGHT_SQUARE_BRACKET, /* ] */
CHAR_DOUBLE_QUOTE, /* " */
CHAR_SINGLE_QUOTE, /* ' */
CHAR_NO_BREAK_SPACE,
CHAR_ZERO_WIDTH_NOBREAK_SPACE
} = require('./constants');
/**
* parse
*/
const parse = (input, options = {}) => {
if (typeof input !== 'string') {
throw new TypeError('Expected a string');
}
const opts = options || {};
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
if (input.length > max) {
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
}
const ast = { type: 'root', input, nodes: [] };
const stack = [ast];
let block = ast;
let prev = ast;
let brackets = 0;
const length = input.length;
let index = 0;
let depth = 0;
let value;
/**
* Helpers
*/
const advance = () => input[index++];
const push = node => {
if (node.type === 'text' && prev.type === 'dot') {
prev.type = 'text';
}
if (prev && prev.type === 'text' && node.type === 'text') {
prev.value += node.value;
return;
}
block.nodes.push(node);
node.parent = block;
node.prev = prev;
prev = node;
return node;
};
push({ type: 'bos' });
while (index < length) {
block = stack[stack.length - 1];
value = advance();
/**
* Invalid chars
*/
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
continue;
}
/**
* Escaped chars
*/
if (value === CHAR_BACKSLASH) {
push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() });
continue;
}
/**
* Right square bracket (literal): ']'
*/
if (value === CHAR_RIGHT_SQUARE_BRACKET) {
push({ type: 'text', value: '\\' + value });
continue;
}
/**
* Left square bracket: '['
*/
if (value === CHAR_LEFT_SQUARE_BRACKET) {
brackets++;
let next;
while (index < length && (next = advance())) {
value += next;
if (next === CHAR_LEFT_SQUARE_BRACKET) {
brackets++;
continue;
}
if (next === CHAR_BACKSLASH) {
value += advance();
continue;
}
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
brackets--;
if (brackets === 0) {
break;
}
}
}
push({ type: 'text', value });
continue;
}
/**
* Parentheses
*/
if (value === CHAR_LEFT_PARENTHESES) {
block = push({ type: 'paren', nodes: [] });
stack.push(block);
push({ type: 'text', value });
continue;
}
if (value === CHAR_RIGHT_PARENTHESES) {
if (block.type !== 'paren') {
push({ type: 'text', value });
continue;
}
block = stack.pop();
push({ type: 'text', value });
block = stack[stack.length - 1];
continue;
}
/**
* Quotes: '|"|`
*/
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
const open = value;
let next;
if (options.keepQuotes !== true) {
value = '';
}
while (index < length && (next = advance())) {
if (next === CHAR_BACKSLASH) {
value += next + advance();
continue;
}
if (next === open) {
if (options.keepQuotes === true) value += next;
break;
}
value += next;
}
push({ type: 'text', value });
continue;
}
/**
* Left curly brace: '{'
*/
if (value === CHAR_LEFT_CURLY_BRACE) {
depth++;
const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
const brace = {
type: 'brace',
open: true,
close: false,
dollar,
depth,
commas: 0,
ranges: 0,
nodes: []
};
block = push(brace);
stack.push(block);
push({ type: 'open', value });
continue;
}
/**
* Right curly brace: '}'
*/
if (value === CHAR_RIGHT_CURLY_BRACE) {
if (block.type !== 'brace') {
push({ type: 'text', value });
continue;
}
const type = 'close';
block = stack.pop();
block.close = true;
push({ type, value });
depth--;
block = stack[stack.length - 1];
continue;
}
/**
* Comma: ','
*/
if (value === CHAR_COMMA && depth > 0) {
if (block.ranges > 0) {
block.ranges = 0;
const open = block.nodes.shift();
block.nodes = [open, { type: 'text', value: stringify(block) }];
}
push({ type: 'comma', value });
block.commas++;
continue;
}
/**
* Dot: '.'
*/
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
const siblings = block.nodes;
if (depth === 0 || siblings.length === 0) {
push({ type: 'text', value });
continue;
}
if (prev.type === 'dot') {
block.range = [];
prev.value += value;
prev.type = 'range';
if (block.nodes.length !== 3 && block.nodes.length !== 5) {
block.invalid = true;
block.ranges = 0;
prev.type = 'text';
continue;
}
block.ranges++;
block.args = [];
continue;
}
if (prev.type === 'range') {
siblings.pop();
const before = siblings[siblings.length - 1];
before.value += prev.value + value;
prev = before;
block.ranges--;
continue;
}
push({ type: 'dot', value });
continue;
}
/**
* Text
*/
push({ type: 'text', value });
}
// Mark imbalanced braces and brackets as invalid
do {
block = stack.pop();
if (block.type !== 'root') {
block.nodes.forEach(node => {
if (!node.nodes) {
if (node.type === 'open') node.isOpen = true;
if (node.type === 'close') node.isClose = true;
if (!node.nodes) node.type = 'text';
node.invalid = true;
}
});
// get the location of the block on parent.nodes (block's siblings)
const parent = stack[stack.length - 1];
const index = parent.nodes.indexOf(block);
// replace the (invalid) block with it's nodes
parent.nodes.splice(index, 1, ...block.nodes);
}
} while (stack.length > 0);
push({ type: 'eos' });
return ast;
};
module.exports = parse;
@@ -0,0 +1,8 @@
"use strict";
function _class_private_method_get(receiver, privateSet, fn) {
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
return fn;
}
exports._ = _class_private_method_get;
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,QAAQ,CAAC;IACzC,iBAAiB,CAAC,OAAS,CAAC,sBAAmB,EAAE,KAAK,UAAU,CAAC,mBAAmB,CAAC;IACrF,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,OAAO,CAAC;IAC9C,cAAc,CAAC,QAAQ,CAAC;IACxB,kBAAkB,CAAC,OAAS,CAAC,sBAAmB,EAAE,KAAK,UAAU,CAAC,mBAAmB,CAAC;IACtF,sBAAsB,CAAC,sDAA0C,CAAC;IAClE,UAAU,CAAC,OAAO,CAAC;IACnB,aAAa,CAAC,YAAY,CAAC;IAC3B,YAAY,CAAC,gBAAgB,CAAC;AAChC","sources":["packages/@react-aria/table/intl/sv-SE.json"],"sourcesContent":["{\n \"ascending\": \"stigande\",\n \"ascendingSort\": \"sorterat på kolumn {columnName} i stigande ordning\",\n \"columnSize\": \"{value} pixlar\",\n \"descending\": \"fallande\",\n \"descendingSort\": \"sorterat på kolumn {columnName} i fallande ordning\",\n \"resizerDescription\": \"Tryck på Retur för att börja ändra storlek\",\n \"select\": \"Markera\",\n \"selectAll\": \"Markera allt\",\n \"sortable\": \"sorterbar kolumn\"\n}\n"],"names":[],"version":3,"file":"sv-SE.module.js.map"}
@@ -0,0 +1,90 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { ZodError } from "../ZodError.js";
import { util } from "../helpers/util.js";
const testTuple = z.tuple([z.string(), z.object({ name: z.literal("Rudy") }), z.array(z.literal("blue"))]);
const testData = ["asdf", { name: "Rudy" }, ["blue"]];
const badData = [123, { name: "Rudy2" }, ["blue", "red"]];
test("tuple inference", () => {
const args1 = z.tuple([z.string()]);
const returns1 = z.number();
const func1 = z.function(args1, returns1);
type func1 = z.TypeOf<typeof func1>;
util.assertEqual<func1, (k: string) => number>(true);
});
test("successful validation", () => {
const val = testTuple.parse(testData);
expect(val).toEqual(["asdf", { name: "Rudy" }, ["blue"]]);
});
test("successful async validation", async () => {
const val = await testTuple.parseAsync(testData);
return expect(val).toEqual(testData);
});
test("failed validation", () => {
const checker = () => {
testTuple.parse([123, { name: "Rudy2" }, ["blue", "red"]] as any);
};
try {
checker();
} catch (err) {
if (err instanceof ZodError) {
expect(err.issues.length).toEqual(3);
}
}
});
test("failed async validation", async () => {
const res = await testTuple.safeParse(badData);
expect(res.success).toEqual(false);
if (!res.success) {
expect(res.error.issues.length).toEqual(3);
}
// try {
// checker();
// } catch (err) {
// if (err instanceof ZodError) {
// expect(err.issues.length).toEqual(3);
// }
// }
});
test("tuple with transformers", () => {
const stringToNumber = z.string().transform((val) => val.length);
const val = z.tuple([stringToNumber]);
type t1 = z.input<typeof val>;
util.assertEqual<t1, [string]>(true);
type t2 = z.output<typeof val>;
util.assertEqual<t2, [number]>(true);
expect(val.parse(["1234"])).toEqual([4]);
});
test("tuple with rest schema", () => {
const myTuple = z.tuple([z.string(), z.number()]).rest(z.boolean());
expect(myTuple.parse(["asdf", 1234, true, false, true])).toEqual(["asdf", 1234, true, false, true]);
expect(myTuple.parse(["asdf", 1234])).toEqual(["asdf", 1234]);
expect(() => myTuple.parse(["asdf", 1234, "asdf"])).toThrow();
type t1 = z.output<typeof myTuple>;
util.assertEqual<t1, [string, number, ...boolean[]]>(true);
});
test("parse should fail given sparse array as tuple", () => {
expect(() => testTuple.parse(new Array(3))).toThrow();
});
// test('tuple with optional elements', () => {
// const result = z
// .tuple([z.string(), z.number().optional()])
// .safeParse(['asdf']);
// expect(result).toEqual(['asdf']);
// });
@@ -0,0 +1,26 @@
/**
* @file Unicode Platform-specific Encoding Identifiers
* @author mengke01(kekee000@gmail.com)
*/
// mac encoding id
export const mac = {
'Default': 0, // default use
'Version1.1': 1,
'ISO10646': 2,
'UnicodeBMP': 3,
'UnicodenonBMP': 4,
'UnicodeVariationSequences': 5,
'FullUnicodecoverage': 6
};
// windows encoding id
export const win = {
Symbol: 0,
UCS2: 1, // default use
ShiftJIS: 2,
PRC: 3,
BigFive: 4,
Johab: 5,
UCS4: 6
};
@@ -0,0 +1,106 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Op_1 = require("./Op");
class Iterator {
constructor(ops) {
this.ops = ops;
this.index = 0;
this.offset = 0;
}
hasNext() {
return this.peekLength() < Infinity;
}
next(length) {
if (!length) {
length = Infinity;
}
const nextOp = this.ops[this.index];
if (nextOp) {
const offset = this.offset;
const opLength = Op_1.default.length(nextOp);
if (length >= opLength - offset) {
length = opLength - offset;
this.index += 1;
this.offset = 0;
}
else {
this.offset += length;
}
if (typeof nextOp.delete === 'number') {
return { delete: length };
}
else {
const retOp = {};
if (nextOp.attributes) {
retOp.attributes = nextOp.attributes;
}
if (typeof nextOp.retain === 'number') {
retOp.retain = length;
}
else if (typeof nextOp.retain === 'object' &&
nextOp.retain !== null) {
// offset should === 0, length should === 1
retOp.retain = nextOp.retain;
}
else if (typeof nextOp.insert === 'string') {
retOp.insert = nextOp.insert.substr(offset, length);
}
else {
// offset should === 0, length should === 1
retOp.insert = nextOp.insert;
}
return retOp;
}
}
else {
return { retain: Infinity };
}
}
peek() {
return this.ops[this.index];
}
peekLength() {
if (this.ops[this.index]) {
// Should never return 0 if our index is being managed correctly
return Op_1.default.length(this.ops[this.index]) - this.offset;
}
else {
return Infinity;
}
}
peekType() {
const op = this.ops[this.index];
if (op) {
if (typeof op.delete === 'number') {
return 'delete';
}
else if (typeof op.retain === 'number' ||
(typeof op.retain === 'object' && op.retain !== null)) {
return 'retain';
}
else {
return 'insert';
}
}
return 'retain';
}
rest() {
if (!this.hasNext()) {
return [];
}
else if (this.offset === 0) {
return this.ops.slice(this.index);
}
else {
const offset = this.offset;
const index = this.index;
const next = this.next();
const rest = this.ops.slice(this.index);
this.offset = offset;
this.index = index;
return [next].concat(rest);
}
}
}
exports.default = Iterator;
//# sourceMappingURL=OpIterator.js.map
@@ -0,0 +1,5 @@
declare module 'emoji-regex/es2015/text' {
function emojiRegex(): RegExp;
export = emojiRegex;
}
@@ -0,0 +1,82 @@
{
"name": "micromark-extension-gfm-tagfilter",
"version": "2.0.0",
"description": "micromark extension to support GFM tagfilter",
"license": "MIT",
"keywords": [
"micromark",
"micromark-extension",
"tagfilter",
"tag",
"filter",
"dangerous",
"html",
"gfm",
"markdown",
"unified"
],
"repository": "micromark/micromark-extension-gfm-tagfilter",
"bugs": "https://github.com/micromark/micromark-extension-gfm-tagfilter/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
"index.js"
],
"dependencies": {
"micromark-util-types": "^2.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"c8": "^8.0.0",
"micromark": "^4.0.0",
"prettier": "^2.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.54.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "remark . -qfo && prettier . -w --loglevel 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
}
}
@@ -0,0 +1,4 @@
/**
* 获取旋转后的宽高
*/
export default function getRotateSize(rotate: number, width: number, height: number): readonly [number, number, true] | readonly [number, number, false];
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
const fs = require("fs");
exports.FILE_SYSTEM_ADAPTER = {
lstat: fs.lstat,
stat: fs.stat,
lstatSync: fs.lstatSync,
statSync: fs.statSync,
readdir: fs.readdir,
readdirSync: fs.readdirSync
};
function createFileSystemAdapter(fsMethods) {
if (fsMethods === undefined) {
return exports.FILE_SYSTEM_ADAPTER;
}
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
}
exports.createFileSystemAdapter = createFileSystemAdapter;
@@ -0,0 +1,27 @@
import { PluginFunc, OpUnitType, ConfigType } from 'dayjs/esm'
declare const plugin: PluginFunc
export = plugin
type ISOUnitType = OpUnitType | 'isoWeek';
declare module 'dayjs/esm' {
interface Dayjs {
isoWeekYear(): number
isoWeek(): number
isoWeek(value: number): Dayjs
isoWeekday(): number
isoWeekday(value: number): Dayjs
startOf(unit: ISOUnitType): Dayjs
endOf(unit: ISOUnitType): Dayjs
isSame(date?: ConfigType, unit?: ISOUnitType): boolean
isBefore(date?: ConfigType, unit?: ISOUnitType): boolean
isAfter(date?: ConfigType, unit?: ISOUnitType): boolean
}
}
@@ -0,0 +1,42 @@
/**
Create a union of the given object's values, and optionally specify which keys to get the values from.
Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript.
@example
```
// data.json
{
'foo': 1,
'bar': 2,
'biz': 3
}
// main.ts
import {ValueOf} from 'type-fest';
import data = require('./data.json');
export function getData(name: string): ValueOf<typeof data> {
return data[name];
}
export function onlyBar(name: string): ValueOf<typeof data, 'bar'> {
return data[name];
}
// file.ts
import {getData, onlyBar} from './main';
getData('foo');
//=> 1
onlyBar('foo');
//=> TypeError ...
onlyBar('bar');
//=> 2
```
@category Utilities
*/
export type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
@@ -0,0 +1 @@
{"version":3,"file":"verifyAttestationPacked.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationPacked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAYtF;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CAyJlB"}
@@ -0,0 +1,71 @@
/* eslint-disable @definitelytyped/no-self-import -- self-imports in module augmentations aren't self-imports */
/* eslint-disable @definitelytyped/no-declare-current-package -- The module augmentations are optional */
/**
* These are types for things that are present in the upcoming React 18 release.
*
* Once React 18 is released they can just be moved to the main index file.
*
* To load the types declared here in an actual project, there are three ways. The easiest one,
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
* is to add `"react-dom/canary"` to the `"types"` array.
*
* Alternatively, a specific import syntax can to be used from a typescript file.
* This module does not exist in reality, which is why the {} is important:
*
* ```ts
* import {} from 'react-dom/canary'
* ```
*
* It is also possible to include it through a triple-slash reference:
*
* ```ts
* /// <reference types="react-dom/canary" />
* ```
*
* Either the import or the reference only needs to appear once, anywhere in the project.
*/
// See https://github.com/facebook/react/blob/main/packages/react-dom/index.js to see how the exports are declared,
// but confirm with published source code (e.g. https://unpkg.com/react-dom@canary) that these exports end up in the published code
import React = require("react");
import ReactDOM = require(".");
export {};
declare module "react" {
// @enableViewTransition
interface ViewTransitionPseudoElement extends Animatable {
getComputedStyle: () => CSSStyleDeclaration;
}
interface ViewTransitionInstance {
group: ViewTransitionPseudoElement;
imagePair: ViewTransitionPseudoElement;
old: ViewTransitionPseudoElement;
new: ViewTransitionPseudoElement;
}
// @enableFragmentRefs
interface FragmentInstance {
blur: () => void;
focus: (focusOptions?: FocusOptions | undefined) => void;
focusLast: (focusOptions?: FocusOptions | undefined) => void;
observeUsing(observer: IntersectionObserver | ResizeObserver): void;
unobserveUsing(observer: IntersectionObserver | ResizeObserver): void;
getClientRects(): Array<DOMRect>;
getRootNode(getRootNodeOptions?: GetRootNodeOptions | undefined): Document | ShadowRoot | FragmentInstance;
addEventListener(
type: string,
listener: EventListener,
optionsOrUseCapture?: Parameters<Element["addEventListener"]>[2],
): void;
removeEventListener(
type: string,
listener: EventListener,
optionsOrUseCapture?: Parameters<Element["removeEventListener"]>[2],
): void;
dispatchEvent(event: Event): boolean;
scrollIntoView(alignToTop?: boolean): void;
}
}
@@ -0,0 +1,18 @@
import { MappedResult } from '../mapped/index.mjs';
import { Optional } from './optional.mjs';
// prettier-ignore
function FromProperties(P, F) {
const Acc = {};
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
Acc[K2] = Optional(P[K2], F);
return Acc;
}
// prettier-ignore
function FromMappedResult(R, F) {
return FromProperties(R.properties, F);
}
// prettier-ignore
export function OptionalFromMappedResult(R, F) {
const P = FromMappedResult(R, F);
return MappedResult(P);
}
@@ -0,0 +1,5 @@
import { Extract } from './extract.mjs';
import { TemplateLiteralToUnion } from '../template-literal/index.mjs';
export function ExtractFromTemplateLiteral(L, R) {
return Extract(TemplateLiteralToUnion(L), R);
}
@@ -0,0 +1,128 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/use-accordion-item.ts
var use_accordion_item_exports = {};
__export(use_accordion_item_exports, {
useReactAriaAccordionItem: () => useReactAriaAccordionItem
});
module.exports = __toCommonJS(use_accordion_item_exports);
var import_focus = require("@react-aria/focus");
var import_react = require("react");
var import_button = require("@react-aria/button");
function useReactAriaAccordionItem(props, state, ref) {
let { item, isDisabled: isDisabledProp } = props;
let key = item.key;
let manager = state.selectionManager;
let buttonId = (0, import_react.useId)();
let regionId = (0, import_react.useId)();
let isDisabled = state.disabledKeys.has(item.key) || isDisabledProp;
(0, import_react.useEffect)(() => {
let isFocused = key === state.focusedKey;
if (isFocused && document.activeElement !== ref.current) {
ref.current && (0, import_focus.focusSafely)(ref.current);
}
}, [ref, key, state.focusedKey]);
let onSelect = (0, import_react.useCallback)(
(e) => {
if (!manager.canSelectItem(key)) {
return;
}
manager.select(key, e);
state.toggleKey(key);
},
[key, manager]
);
const extendFocusSelection = (0, import_react.useCallback)(
(toKey) => {
if (manager.selectionBehavior === "replace") {
manager.extendSelection(toKey);
}
manager.setFocusedKey(toKey);
},
[manager]
);
const onKeyDown = (0, import_react.useCallback)(
(event) => {
const keyMap = {
ArrowDown: () => {
const nextKey = state.collection.getKeyAfter(key);
if (nextKey && state.disabledKeys.has(nextKey)) {
const nextEnabledKey = state.collection.getKeyAfter(nextKey);
nextEnabledKey && extendFocusSelection(nextEnabledKey);
} else {
nextKey && extendFocusSelection(nextKey);
}
},
ArrowUp: () => {
const prevKey = state.collection.getKeyBefore(key);
if (prevKey && state.disabledKeys.has(prevKey)) {
const prevEnabledKey = state.collection.getKeyBefore(prevKey);
prevEnabledKey && extendFocusSelection(prevEnabledKey);
} else {
prevKey && extendFocusSelection(prevKey);
}
},
Home: () => {
const firstKey = state.collection.getFirstKey();
firstKey && extendFocusSelection(firstKey);
},
End: () => {
const lastKey = state.collection.getLastKey();
lastKey && extendFocusSelection(lastKey);
}
};
const action = keyMap[event.key];
if (action) {
event.preventDefault();
if (manager.canSelectItem(key)) {
action(event);
}
}
},
[key, manager]
);
let { buttonProps } = (0, import_button.useButton)(
{
id: buttonId,
elementType: "button",
isDisabled,
onKeyDown,
onPress: onSelect
},
ref
);
let isExpanded = state.selectionManager.isSelected(item.key);
return {
buttonProps: {
...buttonProps,
"aria-expanded": isExpanded,
"aria-controls": isExpanded ? regionId : void 0
},
regionProps: {
id: regionId,
role: "region",
"aria-labelledby": buttonId
}
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useReactAriaAccordionItem
});
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('overEvery', require('../overEvery'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,3 @@
# @react-aria/tooltip
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1,6 @@
module.exports = {
"dismiss": `Rejeter`
};
//# sourceMappingURL=fr-FR.main.js.map
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OptionalFromMappedResult = OptionalFromMappedResult;
const index_1 = require("../mapped/index");
const optional_1 = require("./optional");
// prettier-ignore
function FromProperties(P, F) {
const Acc = {};
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
Acc[K2] = (0, optional_1.Optional)(P[K2], F);
return Acc;
}
// prettier-ignore
function FromMappedResult(R, F) {
return FromProperties(R.properties, F);
}
// prettier-ignore
function OptionalFromMappedResult(R, F) {
const P = FromMappedResult(R, F);
return (0, index_1.MappedResult)(P);
}
@@ -0,0 +1,5 @@
var classPrivateFieldGet2 = require("./classPrivateFieldGet2.js");
function _classExtractFieldDescriptor(e, t) {
return classPrivateFieldGet2(t, e);
}
module.exports = _classExtractFieldDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,2 @@
import type { TSESTree } from '@typescript-eslint/utils';
export declare function isUndefinedIdentifier(i: TSESTree.Node): boolean;
@@ -0,0 +1,32 @@
{
"name": "@types/connect",
"version": "3.4.38",
"description": "TypeScript definitions for connect",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect",
"license": "MIT",
"contributors": [
{
"name": "Maxime LUCE",
"githubUsername": "SomaticIT",
"url": "https://github.com/SomaticIT"
},
{
"name": "Evan Hahn",
"githubUsername": "EvanHahn",
"url": "https://github.com/EvanHahn"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/connect"
},
"scripts": {},
"dependencies": {
"@types/node": "*"
},
"typesPublisherContentHash": "8990242237504bdec53088b79e314b94bec69286df9de56db31f22de403b4092",
"typeScriptVersion": "4.5"
}
@@ -0,0 +1 @@
{"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"attach-listener.js","sourceRoot":"","sources":["../../src/lib/attach-listener.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,yCAAgD;AAChD,yCAAwC;AACxC,yCAKqB;AAErB,+BAA2C;AAO3C,IAAM,kBAAkB,GAAG,UACzB,iBAAgC,EAChC,UAAqC,EACrC,cAAyC,EACzC,eAAyC;IAEzC,iBAAiB,CAAC,SAAS,GAAG,UAAC,OAAqC;;QAClE,UAAU,CAAC,OAAO,CAAC,SAAS,IAAI,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAEtE,IAAI,OAAO,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,OAAO,CAAA,KAAK,QAAQ,EAAE,CAAC;YACjD,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvC,CAAC;QAED,IAAI,OAAO,UAAU,CAAC,OAAO,CAAC,MAAM,KAAK,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;YACnG,OAAO;QACT,CAAC;QACD,IACE,UAAU,CAAC,OAAO,CAAC,SAAS;YAC5B,OAAO,UAAU,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS;YACjD,CAAA,MAAA,UAAU,CAAC,OAAO,CAAC,SAAS,0CAAE,aAAa,MAAK,OAAO,CAAC,IAAI,EAC5D,CAAC;YACD,OAAO;QACT,CAAC;QAED,cAAc,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,eAAe,GAAG,UACtB,iBAAgC,EAChC,UAAqC,EACrC,aAAuC,EACvC,cAAwC,EACxC,eAAyC;IAEzC,iBAAiB,CAAC,MAAM,GAAG,UAAC,KAAgC;QAC1D,UAAU,CAAC,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9D,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC;QAC3B,aAAa,CAAC,sBAAU,CAAC,IAAI,CAAC,CAAC;QAC/B,uBAAuB;QACvB,IAAI,UAAU,CAAC,OAAO,CAAC,SAAS,IAAI,iBAAiB,YAAY,SAAS,EAAE,CAAC;YAC3E,IAAM,gBAAgB,GACpB,OAAO,UAAU,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS;gBAC/C,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC;YACnC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACrC,IAAA,qBAAS,EAAC,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC;QAClE,CAAC;IAEH,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,gBAAgB,GAAG,UACvB,iBAAgC,EAChC,UAAqC,EACrC,aAAuC,EACvC,SAAqB,EACrB,cAAwC;IAExC,IAAI,kCAAsB,IAAI,iBAAiB,YAAY,WAAW,EAAE,CAAC;QACvE,OAAO,cAAQ,CAAC,CAAC;IACnB,CAAC;IACD,IAAA,wBAAiB,EAAC,iBAAiB,EAAE,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACpE,IAAI,gBAAwB,CAAC;IAE7B,iBAAiB,CAAC,OAAO,GAAG,UAAC,KAAiC;;QAC5D,UAAU,CAAC,OAAO,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChE,aAAa,CAAC,sBAAU,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,UAAU,CAAC,OAAO,CAAC,eAAe,IAAI,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;YACpF,IAAM,iBAAiB,GAAG,MAAA,UAAU,CAAC,OAAO,CAAC,iBAAiB,mCAAI,mCAAuB,CAAC;YAC1F,IAAI,cAAc,CAAC,OAAO,GAAG,iBAAiB,EAAE,CAAC;gBAC/C,IAAM,qBAAqB,GAAG,OAAO,UAAU,CAAC,OAAO,CAAC,iBAAiB,KAAK,UAAU,CAAC,CAAC;oBACxF,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;oBAC9D,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC;gBAEvC,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC;oBACnC,cAAc,CAAC,OAAO,EAAE,CAAC;oBACzB,SAAS,EAAE,CAAC;gBACd,CAAC,EAAE,qBAAqB,aAArB,qBAAqB,cAArB,qBAAqB,GAAI,yCAA6B,CAAC,CAAC;YAC7D,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,OAAO,CAAC,eAAe,IAAI,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;gBAC5F,OAAO,CAAC,IAAI,CAAC,oCAA6B,iBAAiB,cAAW,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,cAAM,OAAA,gBAAgB,IAAI,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAzD,CAAyD,CAAC;AACzE,CAAC,CAAC;AAEF,IAAM,gBAAgB,GAAG,UACvB,iBAAgC,EAChC,UAAqC,EACrC,aAAuC,EACvC,SAAqB,EACrB,cAAwC;IAExC,IAAI,gBAAwB,CAAC;IAE7B,iBAAiB,CAAC,OAAO,GAAG,UAAC,KAAiC;;QAC5D,UAAU,CAAC,OAAO,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChE,IAAI,kCAAsB,IAAI,iBAAiB,YAAY,WAAW,EAAE,CAAC;YACvE,UAAU,CAAC,OAAO,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,uBACnD,KAAK,KACR,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,kDAA2C,KAAK,CAAE,EAC1D,QAAQ,EAAE,KAAK,IACf,CAAC;YAEH,aAAa,CAAC,sBAAU,CAAC,MAAM,CAAC,CAAC;YACjC,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;QAED,IAAI,UAAU,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YACpC,IAAI,cAAc,CAAC,OAAO,GAAG,CAAC,MAAA,UAAU,CAAC,OAAO,CAAC,iBAAiB,mCAAI,mCAAuB,CAAC,EAAE,CAAC;gBAC/F,IAAM,qBAAqB,GAAG,OAAO,UAAU,CAAC,OAAO,CAAC,iBAAiB,KAAK,UAAU,CAAC,CAAC;oBACxF,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;oBAC9D,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC;gBAEvC,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC;oBACnC,cAAc,CAAC,OAAO,EAAE,CAAC;oBACzB,SAAS,EAAE,CAAC;gBACd,CAAC,EAAE,qBAAqB,aAArB,qBAAqB,cAArB,qBAAqB,GAAI,yCAA6B,CAAC,CAAC;YAC7D,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,OAAO,CAAC,eAAe,IAAI,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,iBAA2B,CAAC,CAAC;gBACzH,OAAO,CAAC,IAAI,CAAC,oCAA6B,UAAU,CAAC,OAAO,CAAC,iBAAiB,cAAW,CAAC,CAAC;YAC7F,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,cAAM,OAAA,gBAAgB,IAAI,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAzD,CAAyD,CAAC;AACzE,CAAC,CAAC;AAEK,IAAM,eAAe,GAAG,UAC7B,iBAAgC,EAChC,OAAgB,EAChB,UAAqC,EACrC,SAAqB,EACrB,cAAwC,EACxC,eAAyC,EACzC,WAAwB;IAEhB,IAAA,cAAc,GAAoB,OAAO,eAA3B,EAAE,aAAa,GAAK,OAAO,cAAZ,CAAa;IAElD,IAAI,QAAgB,CAAC;IACrB,IAAI,sBAAkC,CAAC;IACvC,IAAI,sBAAkC,CAAC;IAEvC,IAAI,UAAU,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QACpC,QAAQ,GAAG,IAAA,6BAAiB,EAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;IAED,kBAAkB,CAChB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,eAAe,CAChB,CAAC;IAEF,eAAe,CACb,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,CAChB,CAAC;IAEF,sBAAsB,GAAG,gBAAgB,CACvC,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,SAAS,EACT,cAAc,CACf,CAAC;IAEF,sBAAsB,GAAG,gBAAgB,CACvC,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,SAAS,EACT,cAAc,CACf,CAAC;IAEF,OAAO;QACL,aAAa,CAAC,sBAAU,CAAC,OAAO,CAAC,CAAC;QAClC,sBAAsB,EAAE,CAAC;QACzB,sBAAsB,EAAE,CAAC;QACzB,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC1B,IAAI,QAAQ;YAAE,aAAa,CAAC,QAAQ,Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAeA;;;;;;;;;;;;;AAaG;AACW,SAAU,aAAa,CACnC,KAAa,EACb,QAAmB,EAAA;IAEnB,IAAI,WAAW,GAAuB,IAAI;IAE1C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAAA,OAAO,WAAW;IACpB;AAEA,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;AACjC,IAAA,MAAM,WAAW,GAAG,OAAO,QAAQ,KAAK,UAAU;AAElD,IAAA,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,KAAI;AACnC,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,aAAa,EAAE;YACtC;QACF;AAEA,QAAA,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,WAAW;QAEvC,IAAI,WAAW,EAAE;AACf,YAAA,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC;QACxC;aAAO,IAAI,KAAK,EAAE;AAChB,YAAA,WAAW,GAAG,WAAW,IAAI,EAAE;AAC/B,YAAA,WAAW,CAAC,QAAQ,CAAC,GAAG,KAAK;QAC/B;AACF,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,WAAW;AACpB;;;;"}
@@ -0,0 +1 @@
export { _ as default } from "../esm/_ts_add_disposable_resource.js";
@@ -0,0 +1,182 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _directory = _interopRequireDefault(require("./table/directory"));
var _supportOtf = _interopRequireDefault(require("./table/support-otf"));
var _reader = _interopRequireDefault(require("./reader"));
var _error = _interopRequireDefault(require("./error"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
* @file otf字体读取
* @author mengke01(kekee000@gmail.com)
*/
var OTFReader = exports.default = /*#__PURE__*/function () {
/**
* OTF读取函数
*
* @param {Object} options 写入参数
* @constructor
*/
function OTFReader() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, OTFReader);
options.subset = options.subset || [];
this.options = options;
}
/**
* 初始化
*
* @param {ArrayBuffer} buffer buffer对象
* @return {Object} ttf对象
*/
return _createClass(OTFReader, [{
key: "readBuffer",
value: function readBuffer(buffer) {
var reader = new _reader.default(buffer, 0, buffer.byteLength, false);
var font = {};
// version
font.version = reader.readString(0, 4);
if (font.version !== 'OTTO') {
_error.default.raise(10301);
}
// num tables
font.numTables = reader.readUint16();
if (font.numTables <= 0 || font.numTables > 100) {
_error.default.raise(10302);
}
// searchRange
font.searchRange = reader.readUint16();
// entrySelector
font.entrySelector = reader.readUint16();
// rangeShift
font.rangeShift = reader.readUint16();
font.tables = new _directory.default(reader.offset).read(reader, font);
if (!font.tables.head || !font.tables.cmap || !font.tables.CFF) {
_error.default.raise(10302);
}
font.readOptions = this.options;
// 读取支持的表数据
Object.keys(_supportOtf.default).forEach(function (tableName) {
if (font.tables[tableName]) {
var offset = font.tables[tableName].offset;
font[tableName] = new _supportOtf.default[tableName](offset).read(reader, font);
}
});
if (!font.CFF.glyf) {
_error.default.raise(10303);
}
reader.dispose();
return font;
}
/**
* 关联glyf相关的信息
*
* @param {Object} font font对象
*/
}, {
key: "resolveGlyf",
value: function resolveGlyf(font) {
var codes = font.cmap;
var glyf = font.CFF.glyf;
var subsetMap = font.readOptions.subset ? font.subsetMap : null; // 当前ttf的子集列表
// unicode
Object.keys(codes).forEach(function (c) {
var i = codes[c];
if (subsetMap && !subsetMap[i]) {
return;
}
if (!glyf[i].unicode) {
glyf[i].unicode = [];
}
glyf[i].unicode.push(+c);
});
// leftSideBearing
font.hmtx.forEach(function (item, i) {
if (subsetMap && !subsetMap[i]) {
return;
}
glyf[i].advanceWidth = glyf[i].advanceWidth || item.advanceWidth || 0;
glyf[i].leftSideBearing = item.leftSideBearing;
});
// 设置了subsetMap之后需要选取subset中的字形
if (subsetMap) {
var subGlyf = [];
Object.keys(subsetMap).forEach(function (i) {
subGlyf.push(glyf[+i]);
});
glyf = subGlyf;
}
font.glyf = glyf;
}
/**
* 清除非必须的表
*
* @param {Object} font font对象
*/
}, {
key: "cleanTables",
value: function cleanTables(font) {
delete font.readOptions;
delete font.tables;
delete font.hmtx;
delete font.post.glyphNameIndex;
delete font.post.names;
delete font.subsetMap;
// 删除无用的表
var cff = font.CFF;
delete cff.glyf;
delete cff.charset;
delete cff.encoding;
delete cff.gsubrs;
delete cff.gsubrsBias;
delete cff.subrs;
delete cff.subrsBias;
}
/**
* 获取解析后的ttf文档
*
* @param {ArrayBuffer} buffer buffer对象
*
* @return {Object} ttf文档
*/
}, {
key: "read",
value: function read(buffer) {
this.font = this.readBuffer(buffer);
this.resolveGlyf(this.font);
this.cleanTables(this.font);
return this.font;
}
/**
* 注销
*/
}, {
key: "dispose",
value: function dispose() {
delete this.font;
delete this.options;
}
}]);
}();
@@ -0,0 +1,9 @@
'use strict';
var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor');
// https://262.ecma-international.org/6.0/#sec-iscompatiblepropertydescriptor
module.exports = function IsCompatiblePropertyDescriptor(Extensible, Desc, Current) {
return ValidateAndApplyPropertyDescriptor(undefined, undefined, Extensible, Desc, Current);
};
@@ -0,0 +1,36 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
/**
* Generates report loc suitable for reporting on how a class member is
* declared, rather than how it's implemented.
*
* ```ts
* class A {
* abstract method(): void;
* ~~~~~~~~~~~~~~~
*
* concreteMethod(): void {
* ~~~~~~~~~~~~~~
* // code
* }
*
* abstract private property?: string;
* ~~~~~~~~~~~~~~~~~~~~~~~~~
*
* @decorator override concreteProperty = 'value';
* ~~~~~~~~~~~~~~~~~~~~~~~~~
* }
* ```
*/
export declare function getMemberHeadLoc(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.AccessorProperty | TSESTree.MethodDefinition | TSESTree.PropertyDefinition | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractMethodDefinition | TSESTree.TSAbstractPropertyDefinition): TSESTree.SourceLocation;
/**
* Generates report loc suitable for reporting on how a parameter property is
* declared.
*
* ```ts
* class A {
* constructor(private property: string = 'value') {
* ~~~~~~~~~~~~~~~~
* }
* ```
*/
export declare function getParameterPropertyHeadLoc(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.TSParameterProperty, nodeName: string): TSESTree.SourceLocation;
@@ -0,0 +1,84 @@
module.exports = {
"39": "0.20",
"40": "0.21",
"41": "0.21",
"42": "0.25",
"43": "0.27",
"44": "0.30",
"45": "0.31",
"47": "0.36",
"49": "0.37",
"50": "1.1",
"51": "1.2",
"52": "1.3",
"53": "1.4",
"54": "1.4",
"56": "1.6",
"58": "1.7",
"59": "1.8",
"61": "2.0",
"66": "3.0",
"69": "4.0",
"72": "5.0",
"73": "5.0",
"76": "6.0",
"78": "7.0",
"79": "8.0",
"80": "8.0",
"82": "9.0",
"83": "9.0",
"84": "10.0",
"85": "10.0",
"86": "11.0",
"87": "11.0",
"89": "12.0",
"90": "13.0",
"91": "13.0",
"92": "14.0",
"93": "14.0",
"94": "15.0",
"95": "16.0",
"96": "16.0",
"98": "17.0",
"99": "18.0",
"100": "18.0",
"102": "19.0",
"103": "20.0",
"104": "20.0",
"105": "21.0",
"106": "21.0",
"107": "22.0",
"108": "22.0",
"110": "23.0",
"111": "24.0",
"112": "24.0",
"114": "25.0",
"116": "26.0",
"118": "27.0",
"119": "28.0",
"120": "28.0",
"121": "29.0",
"122": "29.0",
"123": "30.0",
"124": "30.0",
"125": "31.0",
"126": "31.0",
"127": "32.0",
"128": "32.0",
"129": "33.0",
"130": "33.0",
"131": "34.0",
"132": "34.0",
"133": "35.0",
"134": "35.0",
"135": "36.0",
"136": "36.0",
"137": "37.0",
"138": "37.0",
"139": "38.0",
"140": "38.0",
"141": "39.0",
"142": "39.0",
"143": "40.0",
"144": "40.0"
};
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stringifyBinding = stringifyBinding;
const common_1 = require("@inversifyjs/common");
const BindingType_1 = require("../models/BindingType");
function stringifyBinding(binding) {
switch (binding.type) {
case BindingType_1.bindingTypeValues.Instance:
return `[ type: "${binding.type}", serviceIdentifier: "${(0, common_1.stringifyServiceIdentifier)(binding.serviceIdentifier)}", scope: "${binding.scope}", implementationType: "${binding.implementationType.name}" ]`;
case BindingType_1.bindingTypeValues.ServiceRedirection:
return `[ type: "${binding.type}", serviceIdentifier: "${(0, common_1.stringifyServiceIdentifier)(binding.serviceIdentifier)}", redirection: "${(0, common_1.stringifyServiceIdentifier)(binding.targetServiceIdentifier)}" ]`;
default:
return `[ type: "${binding.type}", serviceIdentifier: "${(0, common_1.stringifyServiceIdentifier)(binding.serviceIdentifier)}", scope: "${binding.scope}" ]`;
}
}
//# sourceMappingURL=stringifyBinding.js.map
@@ -0,0 +1,34 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export {useTable} from './useTable';
export {useTableColumnHeader} from './useTableColumnHeader';
export {useTableRow} from './useTableRow';
export {useTableHeaderRow} from './useTableHeaderRow';
export {useTableCell} from './useTableCell';
export {useTableSelectionCheckbox, useTableSelectAllCheckbox} from './useTableSelectionCheckbox';
export {useTableColumnResize} from './useTableColumnResize';
// Workaround for a Parcel bug where re-exports don't work in the CommonJS output format...
// export {useGridRowGroup as useTableRowGroup} from '@react-aria/grid';
import {GridRowGroupAria, useGridRowGroup} from '@react-aria/grid';
export function useTableRowGroup(): GridRowGroupAria {
return useGridRowGroup();
}
export type {AriaTableProps} from './useTable';
export type {GridAria, GridRowAria, GridRowProps} from '@react-aria/grid';
export type {AriaTableColumnHeaderProps, TableColumnHeaderAria} from './useTableColumnHeader';
export type {AriaTableCellProps, TableCellAria} from './useTableCell';
export type {TableHeaderRowAria} from './useTableHeaderRow';
export type {AriaTableSelectionCheckboxProps, TableSelectionCheckboxAria, TableSelectAllCheckboxAria} from './useTableSelectionCheckbox';
export type {AriaTableColumnResizeProps, TableColumnResizeAria} from './useTableColumnResize';
@@ -0,0 +1,42 @@
import * as scopeManager from '@typescript-eslint/scope-manager';
export declare namespace Scope {
type ScopeManager = scopeManager.ScopeManager;
type Reference = scopeManager.Reference;
type Variable = scopeManager.ScopeVariable;
type Scope = scopeManager.Scope;
const ScopeType: typeof scopeManager.ScopeType;
type DefinitionType = scopeManager.Definition;
type Definition = scopeManager.Definition;
const DefinitionType: typeof scopeManager.DefinitionType;
namespace Definitions {
type CatchClauseDefinition = scopeManager.CatchClauseDefinition;
type ClassNameDefinition = scopeManager.ClassNameDefinition;
type FunctionNameDefinition = scopeManager.FunctionNameDefinition;
type ImplicitGlobalVariableDefinition = scopeManager.ImplicitGlobalVariableDefinition;
type ImportBindingDefinition = scopeManager.ImportBindingDefinition;
type ParameterDefinition = scopeManager.ParameterDefinition;
type TSEnumMemberDefinition = scopeManager.TSEnumMemberDefinition;
type TSEnumNameDefinition = scopeManager.TSEnumNameDefinition;
type TSModuleNameDefinition = scopeManager.TSModuleNameDefinition;
type TypeDefinition = scopeManager.TypeDefinition;
type VariableDefinition = scopeManager.VariableDefinition;
}
namespace Scopes {
type BlockScope = scopeManager.BlockScope;
type CatchScope = scopeManager.CatchScope;
type ClassScope = scopeManager.ClassScope;
type ConditionalTypeScope = scopeManager.ConditionalTypeScope;
type ForScope = scopeManager.ForScope;
type FunctionExpressionNameScope = scopeManager.FunctionExpressionNameScope;
type FunctionScope = scopeManager.FunctionScope;
type FunctionTypeScope = scopeManager.FunctionTypeScope;
type GlobalScope = scopeManager.GlobalScope;
type MappedTypeScope = scopeManager.MappedTypeScope;
type ModuleScope = scopeManager.ModuleScope;
type SwitchScope = scopeManager.SwitchScope;
type TSEnumScope = scopeManager.TSEnumScope;
type TSModuleScope = scopeManager.TSModuleScope;
type TypeScope = scopeManager.TypeScope;
type WithScope = scopeManager.WithScope;
}
}
@@ -0,0 +1 @@
{"name":"mdast-util-mdx-expression","version":"2.0.1","requiresBuild":false,"files":{"license":{"checkedAt":1794532112717,"integrity":"sha512-fzvkEDDVqhfCJpKNt4nSfCdql95dXnYBu6QTwaEDV5dX/EtSGYys2u3y/9LaRjp4jUgB4qbz5csHGjJjcZAb2Q==","mode":420,"size":1099},"index.js":{"checkedAt":1794532112767,"integrity":"sha512-I8cpoNt2HmvmRTcXM2HsHLvLBN76GgLqK0TlNLe443SOmX0PxRCaQ97bEEv5rjS/TVy33uV+2E8pyWWdyHvnwA==","mode":420,"size":130},"lib/index.js":{"checkedAt":1794532112768,"integrity":"sha512-/yX15Z/GImyFTzqpFg7FUMIhNlrvx9Dtaw3+5Yq/Bhrt6PxCrSGbA9oyWelXdBn/OD9Ojx+tiv1raCTm9oUEPQ==","mode":420,"size":3403},"package.json":{"checkedAt":1794532112768,"integrity":"sha512-fP1TpLyLpcP1UiUaOW5JwT8ZVKCOaOxGzuieUKYm8DmvJN7e5Zm9BpRT6xDn5rMVy4FBe2I9Oj2Y7rVX4w5roQ==","mode":420,"size":2745},"lib/index.d.ts.map":{"checkedAt":1794532112768,"integrity":"sha512-cdH/UuU+JqDkx6JdKNZ01w4JvKk5lXEfzP+aQMHgLUagWyl/zK/0+B89JYBCEVkDN1//FgZwn49TqQJ5CdMC1Q==","mode":420,"size":207},"readme.md":{"checkedAt":1794532112768,"integrity":"sha512-eavE2pMXgAemM6Nt523YKAe+mYxfOVs2cnSZZFJHoEXD6QWfDC/7EA8AddkzCtJffMZFl9PCwcw2vdLybF8LLw==","mode":420,"size":13653},"index.d.ts":{"checkedAt":1794532112768,"integrity":"sha512-695fJmuwLeFSc1obbTmlUQnoSJdkzbXPGQ0egwbMz/QrSlrhbic9Jjnfhhk0d+cYk7Sw4SYCjqQvCqHsFKHoiw==","mode":420,"size":3596},"lib/index.d.ts":{"checkedAt":1794532112768,"integrity":"sha512-Ddq6sMso8G5fUCOmeYLCNlLiD+hcijphzedLDNvsVw+CezpOpeyhIE3pACrk0PvH2o+k+AOh9P5ACYxmh6k3NQ==","mode":420,"size":895}}}
@@ -0,0 +1,365 @@
<!DOCTYPE html>
<html>
<head>
<title>js-naturalsort test suite</title>
<script src='http://code.jquery.com/jquery-latest.js'></script>
<link rel='stylesheet' href='http://code.jquery.com/qunit/git/qunit.css' type='text/css' media='screen' />
<script type='text/javascript' src='http://code.jquery.com/qunit/git/qunit.js'></script>
<script src='naturalSort.js' type='text/javascript'></script>
<script type='text/javascript'>
$(function () {
test('different values types', function () {
wrapTest(
['a',1],
[1,'a'],
'number always comes first');
wrapTest(
['1',1],
['1',1],
'number vs numeric string - should remain unchanged (error in chrome)');
wrapTest(
['02',3,2,'01'],
['01','02',2,3],
'padding numeric string vs number');
});
test('datetime', function () {
wrapTest(
['10/12/2008','10/11/2008','10/11/2007','10/12/2007'],
['10/11/2007','10/12/2007','10/11/2008','10/12/2008'],
'similar dates');
wrapTest(
['01/01/2008','01/10/2008','01/01/1992','01/01/1991'],
['01/01/1991','01/01/1992','01/01/2008','01/10/2008'],
'similar dates');
wrapTest(
[
'Wed Jan 01 2010 00:00:00 GMT-0800 (Pacific Standard Time)',
'Thu Dec 31 2009 00:00:00 GMT-0800 (Pacific Standard Time)',
'Wed Jan 01 2010 00:00:00 GMT-0500 (Eastern Standard Time)'
],[
'Thu Dec 31 2009 00:00:00 GMT-0800 (Pacific Standard Time)',
'Wed Jan 01 2010 00:00:00 GMT-0500 (Eastern Standard Time)',
'Wed Jan 01 2010 00:00:00 GMT-0800 (Pacific Standard Time)'
], 'javascript toString(), different timezones');
wrapTest(
[
'Saturday, July 3, 2010',
'Monday, August 2, 2010',
'Monday, May 3, 2010'
],[
'Monday, May 3, 2010',
'Saturday, July 3, 2010',
'Monday, August 2, 2010'
], 'Date.toString(), Date.toLocaleString()');
wrapTest(
[
'Mon, 15 Jun 2009 20:45:30 GMT',
'Mon, 3 May 2010 17:45:30 GMT',
'Mon, 15 Jun 2009 17:45:30 GMT'
],[
'Mon, 15 Jun 2009 17:45:30 GMT',
'Mon, 15 Jun 2009 20:45:30 GMT',
'Mon, 3 May 2010 17:45:30 GMT'
], 'Date.toUTCString()');
wrapTest(
[
'Saturday, July 3, 2010 1:45 PM',
'Saturday, July 3, 2010 1:45 AM',
'Monday, August 2, 2010 1:45 PM',
'Monday, May 3, 2010 1:45 PM'
],[
'Monday, May 3, 2010 1:45 PM',
'Saturday, July 3, 2010 1:45 AM',
'Saturday, July 3, 2010 1:45 PM',
'Monday, August 2, 2010 1:45 PM'
], '');
wrapTest(
[
'Saturday, July 3, 2010 1:45:30 PM',
'Saturday, July 3, 2010 1:45:29 PM',
'Monday, August 2, 2010 1:45:01 PM',
'Monday, May 3, 2010 1:45:00 PM'
],[
'Monday, May 3, 2010 1:45:00 PM',
'Saturday, July 3, 2010 1:45:29 PM',
'Saturday, July 3, 2010 1:45:30 PM',
'Monday, August 2, 2010 1:45:01 PM'
], '');
wrapTest(
[
'2/15/2009 1:45 PM',
'1/15/2009 1:45 PM',
'2/15/2009 1:45 AM'
],[
'1/15/2009 1:45 PM',
'2/15/2009 1:45 AM',
'2/15/2009 1:45 PM'
], '');
wrapTest(
[
'2010-06-15T13:45:30',
'2009-06-15T13:45:30',
'2009-06-15T01:45:30.2',
'2009-01-15T01:45:30'
],[
'2009-01-15T01:45:30',
'2009-06-15T01:45:30.2',
'2009-06-15T13:45:30',
'2010-06-15T13:45:30'
], 'ISO8601 Dates');
wrapTest(
[
'2010-06-15 13:45:30',
'2009-06-15 13:45:30',
'2009-01-15 01:45:30'
],[
'2009-01-15 01:45:30',
'2009-06-15 13:45:30',
'2010-06-15 13:45:30'
], 'ISO8601-ish YYYY-MM-DDThh:mm:ss - which does not parse into a Date instance');
wrapTest(
[
'Mon, 15 Jun 2009 20:45:30 GMT',
'Mon, 15 Jun 2009 20:45:30 PDT',
'Mon, 15 Jun 2009 20:45:30 EST',
],[
'Mon, 15 Jun 2009 20:45:30 GMT',
'Mon, 15 Jun 2009 20:45:30 EST',
'Mon, 15 Jun 2009 20:45:30 PDT'
], 'RFC1123 testing different timezones');
wrapTest(
[
'1245098730000',
'14330728000',
'1245098728000'
],[
'14330728000',
'1245098728000',
'1245098730000'
], 'unix epoch, Date.getTime()');
});
test('version number strings', function () {
wrapTest(
['1.0.2','1.0.1','1.0.0','1.0.9'],
['1.0.0','1.0.1','1.0.2','1.0.9'],
'close version numbers');
wrapTest(
['1.0.03','1.0.003','1.0.002','1.0.0001'],
['1.0.0001','1.0.002','1.0.003','1.0.03'],
'multi-digit branch release');
wrapTest(
['1.1beta','1.1.2alpha3','1.0.2alpha3','1.0.2alpha1','1.0.1alpha4','2.1.2','2.1.1'],
['1.0.1alpha4','1.0.2alpha1','1.0.2alpha3','1.1.2alpha3','1.1beta','2.1.1','2.1.2'],
'close version numbers');
wrapTest(
['myrelease-1.1.3','myrelease-1.2.3','myrelease-1.1.4','myrelease-1.1.1','myrelease-1.0.5'],
['myrelease-1.0.5','myrelease-1.1.1','myrelease-1.1.3','myrelease-1.1.4','myrelease-1.2.3'],
'string first');
});
test('numerics', function () {
wrapTest(
['10',9,2,'1','4'],
['1',2,'4',9,'10'],
'string vs number');
wrapTest(
['0001','002','001'],
['0001','001','002'],
'0 left-padded numbers');
wrapTest(
[2,1,'1','0001','002','02','001'],
['0001','001','002','02',1,'1',2],
'0 left-padded numbers and regular numbers');
wrapTest(
['10.0401',10.022,10.042,'10.021999'],
['10.021999',10.022,'10.0401',10.042],
'decimal string vs decimal, different precision');
wrapTest(
['10.04',10.02,10.03,'10.01'],
['10.01',10.02,10.03,'10.04'],
'decimal string vs decimal, same precision');
wrapTest(
['10.04f','10.039F','10.038d','10.037D'],
['10.037D','10.038d','10.039F','10.04f'],
'float/decimal with \'F\' or \'D\' notation');
wrapTest(
['10.004Z','10.039T','10.038ooo','10.037g'],
['10.004Z','10.037g','10.038ooo','10.039T'],
'not foat/decimal notation');
wrapTest(
['1.528535047e5','1.528535047e7','1.52e15','1.528535047e3','1.59e-3'],
['1.59e-3','1.528535047e3','1.528535047e5','1.528535047e7','1.52e15'],
'scientific notation');
wrapTest(
['-1','-2','4','-3','0','-5'],
['-5','-3','-2','-1','0','4'],
'negative numbers as strings');
wrapTest(
[-1,'-2',4,-3,'0','-5'],
['-5',-3,'-2',-1,'0',4],
'negative numbers as strings - mixed input type, string + numeric');
wrapTest(
[-2.01,-2.1,4.144,4.1,-2.001,-5],
[-5,-2.1,-2.01,-2.001,4.1,4.144],
'negative floats - all numeric');
});
test('IP addresses', function () {
wrapTest(
[
'192.168.0.100',
'192.168.0.1',
'192.168.1.1',
'192.168.0.250',
'192.168.1.123',
'10.0.0.2',
'10.0.0.1'
],
[
'10.0.0.1',
'10.0.0.2',
'192.168.0.1',
'192.168.0.100',
'192.168.0.250',
'192.168.1.1',
'192.168.1.123'
]);
});
test('filenames', function () {
wrapTest(
['img12.png','img10.png','img2.png','img1.png'],
['img1.png','img2.png','img10.png','img12.png'],
'simple image filenames');
wrapTest(
['car.mov','01alpha.sgi','001alpha.sgi','my.string_41299.tif','organic2.0001.sgi'],
['001alpha.sgi','01alpha.sgi','car.mov','my.string_41299.tif','organic2.0001.sgi'],
'complex filenames');
wrapTest([
'./system/kernel/js/01_ui.core.js',
'./system/kernel/js/00_jquery-1.3.2.js',
'./system/kernel/js/02_my.desktop.js'
],[
'./system/kernel/js/00_jquery-1.3.2.js',
'./system/kernel/js/01_ui.core.js',
'./system/kernel/js/02_my.desktop.js'
], 'unix filenames');
});
test('space(s) as first character(s)', function () {
wrapTest(
['alpha',' 1',' 3',' 2',0],
[0,' 1',' 2',' 3','alpha']);
});
test('empty strings and space character', function () {
wrapTest(
['10023','999','',2,5.663,5.6629],
['',2,5.6629,5.663,'999','10023']);
wrapTest(
[0,'0',''],
[0,'0','']);
});
test('hex', function () {
wrapTest(
[ '0xA','0x9','0x99' ],
[ '0x9','0xA','0x99'],
'real hex numbers');
wrapTest(
[ '0xZZ','0xVVV','0xVEV','0xUU' ],
[ '0xUU','0xVEV','0xVVV','0xZZ' ],'fake hex numbers');
});
test('unicode', function () {
wrapTest(
[ '\u0044', '\u0055', '\u0054', '\u0043' ],
[ '\u0043', '\u0044', '\u0054', '\u0055' ],
'basic latin');
});
test('sparse array sort', function () {
var sarray = [3, 2]
sarrayOutput = [1, 2, 3];
sarray[10] = 1;
for (var i=0; i < 8; i++)
sarrayOutput.push(undefined);
wrapTest(sarray, sarrayOutput,'simple sparse array');
});
test('case insensitive support', function () {
naturalSort.insensitive = true;
wrapTest(
['A', 'b', 'C', 'd', 'E', 'f'],
['A', 'b', 'C', 'd', 'E', 'f'],
'case sensitive pre-sorted array');
wrapTest(
['A', 'C', 'E', 'b', 'd', 'f'],
['A', 'b', 'C', 'd', 'E', 'f'],
'case sensitive un-sorted array');
naturalSort.insensitive = false;
wrapTest(
['A', 'C', 'E', 'b', 'd', 'f'],
['A', 'C', 'E', 'b', 'd', 'f'],
'case sensitive pre-sorted array');
wrapTest(
['A', 'b', 'C', 'd', 'E', 'f'],
['A', 'C', 'E', 'b', 'd', 'f'],
'case sensitive un-sorted array');
});
test('contributed tests', function () {
wrapTest(
['T78','U17','U10','U12','U14','745','U7','01','485','S16','S2','S22','1081','S25','1055','779','776','771','44','4','87','1091','42','480','952','951','756','1000','824','770','666','633','619','1','991','77H','PIER-7','47','29','9','77L','433'],
['01','1','4','9','29','42','44','47','77H','77L','87','433','480','485','619','633','666','745','756','770','771','776','779','824','951','952','991','1000','1055','1081','1091','PIER-7','S2','S16','S22','S25','T78','U7','U10','U12','U14','U17'],
'contributed by Bob Zeiner');
wrapTest(
[
'FSI stop, Position: 5',
'Mail Group stop, Position: 5',
'Mail Group stop, Position: 5',
'FSI stop, Position: 6',
'FSI stop, Position: 6',
'Newsstand stop, Position: 4',
'Newsstand stop, Position: 4',
'FSI stop, Position: 5'
],[
'FSI stop, Position: 5',
'FSI stop, Position: 5',
'FSI stop, Position: 6',
'FSI stop, Position: 6',
'Mail Group stop, Position: 5',
'Mail Group stop, Position: 5',
'Newsstand stop, Position: 4',
'Newsstand stop, Position: 4'
],'contributed by Scott');
wrapTest(
[2, 10, 1, 'azd', undefined, 'asd'],
[1, 2, 10, 'asd', 'azd', undefined],
'issue #2 - undefined support - jarvinen pekka');
wrapTest(
[undefined, undefined, undefined, 1, undefined],
[1, undefined, undefined, undefined],
'issue #2 - undefined support - jarvinen pekka');
wrapTest(
['-1', '-2', '4', '-3', '0', '-5'],
['-5', '-3', '-2', '-1', '0', '4'],
'issue #3 - invalid numeric string sorting - guilermo.dev');
naturalSort.insensitive = true;
wrapTest(
['9','11','22','99','A','aaaa','bbbb','Aaaa','aAaa','aa','AA','Aa','aA','BB','bB','aaA','AaA','aaa'],
['9', '11', '22', '99', 'A', 'aa', 'AA', 'Aa', 'aA', 'aaA', 'AaA', 'aaa', 'aaaa', 'Aaaa', 'aAaa', 'BB', 'bB', 'bbbb'],
'issue #5 - invalid sort order - Howie Schecter');
naturalSort.insensitive = false;
wrapTest(
['9','11','22','99','A','aaaa','bbbb','Aaaa','aAaa','aa','AA','Aa','aA','BB','bB','aaA','AaA','aaa'],
['9', '11', '22', '99', 'A', 'AA', 'Aa', 'AaA', 'Aaaa', 'BB', 'aA', 'aAaa', 'aa', 'aaA', 'aaa', 'aaaa', 'bB', 'bbbb'],
'issue #5 - invalid sort order - Howie Schecter');
wrapTest(
['5D','1A','2D','33A','5E','33K','33D','5S','2C','5C','5F','1D','2M'],
['1A','1D','2C','2D','2M','5C','5D','5E','5F','5S','33A','33D','33K'],
'alphanumeric - number first');
});
});
function wrapTest(origArray, sortArray, message) {
deepEqual($.extend([], origArray).sort(naturalSort), sortArray, (message ? message + ' - ' : '') + QUnit.jsDump.parse(origArray));
}
</script>
</head>
<body>
<h1 id='qunit-header'>js-naturalsort test suite</h1>
<h2 id='qunit-banner'></h2>
<h2 id='qunit-userAgent'></h2>
<ol id='qunit-tests' />
</body>
</html>
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more