fix(products): fix breadcrumbs and product filtering (backport from main)
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Sergey Melyukov @smelukov
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
const Template = require("../Template");
/** @typedef {import("../Compilation")} Compilation */
class HasOwnPropertyRuntimeModule extends RuntimeModule {
constructor() {
super("hasOwnProperty shorthand");
}
/**
* @returns {string | null} runtime code
*/
generate() {
const compilation = /** @type {Compilation} */ (this.compilation);
const { runtimeTemplate } = compilation;
return Template.asString([
`${RuntimeGlobals.hasOwnProperty} = ${runtimeTemplate.returningFunction(
"Object.prototype.hasOwnProperty.call(obj, prop)",
"obj, prop"
)}`
]);
}
}
module.exports = HasOwnPropertyRuntimeModule;

View File

@@ -0,0 +1,254 @@
A. HISTORY OF THE SOFTWARE
==========================
Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC. Guido remains Python's
principal author, although it includes many contributions from others.
In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.
In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team. In October of the same
year, the PythonLabs team moved to Digital Creations, which became
Zope Corporation. In 2001, the Python Software Foundation (PSF, see
https://www.python.org/psf/) was formed, a non-profit organization
created specifically to own Python-related Intellectual Property.
Zope Corporation was a sponsoring member of the PSF.
All Python releases are Open Source (see http://www.opensource.org for
the Open Source Definition). Historically, most, but not all, Python
releases have also been GPL-compatible; the table below summarizes
the various releases.
Release Derived Year Owner GPL-
from compatible? (1)
0.9.0 thru 1.2 1991-1995 CWI yes
1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
1.6 1.5.2 2000 CNRI no
2.0 1.6 2000 BeOpen.com no
1.6.1 1.6 2001 CNRI yes (2)
2.1 2.0+1.6.1 2001 PSF no
2.0.1 2.0+1.6.1 2001 PSF yes
2.1.1 2.1+2.0.1 2001 PSF yes
2.1.2 2.1.1 2002 PSF yes
2.1.3 2.1.2 2002 PSF yes
2.2 and above 2.1.1 2001-now PSF yes
Footnotes:
(1) GPL-compatible doesn't mean that we're distributing Python under
the GPL. All Python licenses, unlike the GPL, let you distribute
a modified version without making your changes open source. The
GPL-compatible licenses make it possible to combine Python with
other software that is released under the GPL; the others don't.
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
because its license has a choice of law clause. According to
CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
is "not incompatible" with the GPL.
Thanks to the many outside volunteers who have worked under Guido's
direction to make these releases possible.
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
===============================================================
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
-------------------------------------------
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
Individual or Organization ("Licensee") accessing and otherwise using
this software in source or binary form and its associated
documentation ("the Software").
2. Subject to the terms and conditions of this BeOpen Python License
Agreement, BeOpen hereby grants Licensee a non-exclusive,
royalty-free, world-wide license to reproduce, analyze, test, perform
and/or display publicly, prepare derivative works, distribute, and
otherwise use the Software alone or in any derivative version,
provided, however, that the BeOpen Python License is retained in the
Software, alone or in any derivative version prepared by Licensee.
3. BeOpen is making the Software available to Licensee on an "AS IS"
basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
5. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
6. This License Agreement shall be governed by and interpreted in all
respects by the law of the State of California, excluding conflict of
law provisions. Nothing in this License Agreement shall be deemed to
create any relationship of agency, partnership, or joint venture
between BeOpen and Licensee. This License Agreement does not grant
permission to use BeOpen trademarks or trade names in a trademark
sense to endorse or promote products or services of Licensee, or any
third party. As an exception, the "BeOpen Python" logos available at
http://www.pythonlabs.com/logos.html may be used according to the
permissions granted on that web page.
7. By copying, installing or otherwise using the software, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
---------------------------------------
1. This LICENSE AGREEMENT is between the Corporation for National
Research Initiatives, having an office at 1895 Preston White Drive,
Reston, VA 20191 ("CNRI"), and the Individual or Organization
("Licensee") accessing and otherwise using Python 1.6.1 software in
source or binary form and its associated documentation.
2. Subject to the terms and conditions of this License Agreement, CNRI
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python 1.6.1
alone or in any derivative version, provided, however, that CNRI's
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
1995-2001 Corporation for National Research Initiatives; All Rights
Reserved" are retained in Python 1.6.1 alone or in any derivative
version prepared by Licensee. Alternately, in lieu of CNRI's License
Agreement, Licensee may substitute the following text (omitting the
quotes): "Python 1.6.1 is made available subject to the terms and
conditions in CNRI's License Agreement. This Agreement together with
Python 1.6.1 may be located on the Internet using the following
unique, persistent identifier (known as a handle): 1895.22/1013. This
Agreement may also be obtained from a proxy server on the Internet
using the following URL: http://hdl.handle.net/1895.22/1013".
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python 1.6.1 or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python 1.6.1.
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. This License Agreement shall be governed by the federal
intellectual property law of the United States, including without
limitation the federal copyright law, and, to the extent such
U.S. federal law does not apply, by the law of the Commonwealth of
Virginia, excluding Virginia's conflict of law provisions.
Notwithstanding the foregoing, with regard to derivative works based
on Python 1.6.1 that incorporate non-separable material that was
previously distributed under the GNU General Public License (GPL), the
law of the Commonwealth of Virginia shall govern this License
Agreement only as to issues arising under or with respect to
Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
License Agreement shall be deemed to create any relationship of
agency, partnership, or joint venture between CNRI and Licensee. This
License Agreement does not grant permission to use CNRI trademarks or
trade name in a trademark sense to endorse or promote products or
services of Licensee, or any third party.
8. By clicking on the "ACCEPT" button where indicated, or by copying,
installing or otherwise using Python 1.6.1, Licensee agrees to be
bound by the terms and conditions of this License Agreement.
ACCEPT
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
--------------------------------------------------
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
The Netherlands. All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@@ -0,0 +1,79 @@
import { defineIntegration, addVercelAiProcessors } from '@sentry/core';
import { generateInstrumentOnce } from '@sentry/node-core';
import { INTEGRATION_NAME } from './constants.js';
import { SentryVercelAiInstrumentation } from './instrumentation.js';
const instrumentVercelAi = generateInstrumentOnce(INTEGRATION_NAME, () => new SentryVercelAiInstrumentation({}));
/**
* Determines if the integration should be forced based on environment and package availability.
* Returns true if the 'ai' package is available.
*/
function shouldForceIntegration(client) {
const modules = client.getIntegrationByName('Modules');
return !!modules?.getModules?.()?.ai;
}
const _vercelAIIntegration = ((options = {}) => {
let instrumentation;
return {
name: INTEGRATION_NAME,
options,
setupOnce() {
instrumentation = instrumentVercelAi();
},
afterAllSetup(client) {
// Auto-detect if we should force the integration when running with 'ai' package available
// Note that this can only be detected if the 'Modules' integration is available, and running in CJS mode
const shouldForce = options.force ?? shouldForceIntegration(client);
if (shouldForce) {
addVercelAiProcessors(client);
} else {
instrumentation?.callWhenPatched(() => addVercelAiProcessors(client));
}
},
};
}) ;
/**
* Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.
* This integration is not enabled by default, you need to manually add it.
*
* For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
*
* Sentry.init({
* integrations: [Sentry.vercelAIIntegration()],
* });
* ```
*
* This integration adds tracing support to all `ai` function calls.
* You need to opt-in to collecting spans for a specific call,
* you can do so by setting `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.
*
* ```javascript
* const result = await generateText({
* model: openai('gpt-4-turbo'),
* experimental_telemetry: { isEnabled: true },
* });
* ```
*
* If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each
* function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`
* to `true`.
*
* ```javascript
* const result = await generateText({
* model: openai('gpt-4-turbo'),
* experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },
* });
*/
const vercelAIIntegration = defineIntegration(_vercelAIIntegration);
export { instrumentVercelAi, vercelAIIntegration };
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,2 @@
const e=require(`../../utils/throw-if-empty.cjs`),t=t=>()=>(e.throwIfEmpty(t,`Keys cannot be empty`),{path:`/flows`,body:JSON.stringify(t),method:`DELETE`}),n=t=>()=>(e.throwIfEmpty(t,`Key cannot be empty`),{path:`/flows/${t}`,method:`DELETE`});exports.deleteFlow=n,exports.deleteFlows=t;
//# sourceMappingURL=flows.cjs.map

View File

@@ -0,0 +1,26 @@
"use strict";
exports.hoursToMinutes = hoursToMinutes;
var _index = require("./constants.js");
/**
* @name hoursToMinutes
* @category Conversion Helpers
* @summary Convert hours to minutes.
*
* @description
* Convert a number of hours to a full number of minutes.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param hours - number of hours to be converted
*
* @returns The number of hours converted in minutes
*
* @example
* // Convert 2 hours to minutes:
* const result = hoursToMinutes(2)
* //=> 120
*/
function hoursToMinutes(hours) {
return Math.trunc(hours * _index.minutesInHour);
}

View File

@@ -0,0 +1,85 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = parser;
function _parser() {
const data = require("@babel/parser");
_parser = function () {
return data;
};
return data;
}
function _codeFrame() {
const data = require("@babel/code-frame");
_codeFrame = function () {
return data;
};
return data;
}
var _missingPluginHelper = require("./util/missing-plugin-helper.js");
function* parser(pluginPasses, {
parserOpts,
highlightCode = true,
filename = "unknown"
}, code) {
try {
const results = [];
for (const plugins of pluginPasses) {
for (const plugin of plugins) {
const {
parserOverride
} = plugin;
if (parserOverride) {
const ast = parserOverride(code, parserOpts, _parser().parse);
if (ast !== undefined) results.push(ast);
}
}
}
if (results.length === 0) {
return (0, _parser().parse)(code, parserOpts);
} else if (results.length === 1) {
yield* [];
if (typeof results[0].then === "function") {
throw new Error(`You appear to be using an async parser plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);
}
return results[0];
}
throw new Error("More than one plugin attempted to override parsing.");
} catch (err) {
if (err.code === "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED") {
err.message += "\nConsider renaming the file to '.mjs', or setting sourceType:module " + "or sourceType:unambiguous in your Babel config for this file.";
}
const startLine = parserOpts == null ? void 0 : parserOpts.startLine;
const startColumn = parserOpts == null ? void 0 : parserOpts.startColumn;
if (startColumn != null) {
code = " ".repeat(startColumn) + code;
}
const {
loc,
missingPlugin
} = err;
if (loc) {
const codeFrame = (0, _codeFrame().codeFrameColumns)(code, {
start: {
line: loc.line,
column: loc.column + 1
}
}, {
highlightCode,
startLine
});
if (missingPlugin) {
err.message = `${filename}: ` + (0, _missingPluginHelper.default)(missingPlugin[0], loc, codeFrame, filename);
} else {
err.message = `${filename}: ${err.message}\n\n` + codeFrame;
}
err.code = "BABEL_PARSE_ERROR";
}
throw err;
}
}
0 && 0;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,319 @@
NOTE: The default branch has been renamed!
master is now named main
If you have a local clone, you can update it by running:
```shell
git branch -m master main
git fetch origin
git branch -u origin/main main
```
# **node-addon-api module**
This module contains **header-only C++ wrapper classes** which simplify
the use of the C based [Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
provided by Node.js when using C++. It provides a C++ object model
and exception handling semantics with low overhead.
There are three options for implementing addons: Node-API, nan, or direct
use of internal V8, libuv, and Node.js libraries. Unless there is a need for
direct access to functionality that is not exposed by Node-API as outlined
in [C/C++ addons](https://nodejs.org/dist/latest/docs/api/addons.html)
in Node.js core, use Node-API. Refer to
[C/C++ addons with Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
for more information on Node-API.
Node-API is an ABI stable C interface provided by Node.js for building native
addons. It is independent of the underlying JavaScript runtime (e.g. V8 or ChakraCore)
and is maintained as part of Node.js itself. It is intended to insulate
native addons from changes in the underlying JavaScript engine and allow
modules compiled for one version to run on later versions of Node.js without
recompilation.
The `node-addon-api` module, which is not part of Node.js, preserves the benefits
of the Node-API as it consists only of inline code that depends only on the stable API
provided by Node-API. As such, modules built against one version of Node.js
using node-addon-api should run without having to be rebuilt with newer versions
of Node.js.
It is important to remember that *other* Node.js interfaces such as
`libuv` (included in a project via `#include <uv.h>`) are not ABI-stable across
Node.js major versions. Thus, an addon must use Node-API and/or `node-addon-api`
exclusively and build against a version of Node.js that includes an
implementation of Node-API (meaning an active LTS version of Node.js) in
order to benefit from ABI stability across Node.js major versions. Node.js
provides an [ABI stability guide][] containing a detailed explanation of ABI
stability in general, and the Node-API ABI stability guarantee in particular.
As new APIs are added to Node-API, node-addon-api must be updated to provide
wrappers for those new APIs. For this reason, node-addon-api provides
methods that allow callers to obtain the underlying Node-API handles so
direct calls to Node-API and the use of the objects/methods provided by
node-addon-api can be used together. For example, in order to be able
to use an API for which the node-addon-api does not yet provide a wrapper.
APIs exposed by node-addon-api are generally used to create and
manipulate JavaScript values. Concepts and operations generally map
to ideas specified in the **ECMA262 Language Specification**.
The [Node-API Resource](https://nodejs.github.io/node-addon-examples/) offers an
excellent orientation and tips for developers just getting started with Node-API
and node-addon-api.
- **[Setup](#setup)**
- **[API Documentation](#api)**
- **[Examples](#examples)**
- **[Tests](#tests)**
- **[More resource and info about native Addons](#resources)**
- **[Badges](#badges)**
- **[Code of Conduct](CODE_OF_CONDUCT.md)**
- **[Contributors](#contributors)**
- **[License](#license)**
## **Current version: 7.1.1**
(See [CHANGELOG.md](CHANGELOG.md) for complete Changelog)
[![NPM](https://nodei.co/npm/node-addon-api.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-addon-api/) [![NPM](https://nodei.co/npm-dl/node-addon-api.png?months=6&height=1)](https://nodei.co/npm/node-addon-api/)
<a name="setup"></a>
node-addon-api is based on [Node-API](https://nodejs.org/api/n-api.html) and supports using different Node-API versions.
This allows addons built with it to run with Node.js versions which support the targeted Node-API version.
**However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that
every year there will be a new major which drops support for the Node.js LTS version which has gone out of service.
The oldest Node.js version supported by the current version of node-addon-api is Node.js 16.x.
## Setup
- [Installation and usage](doc/setup.md)
- [node-gyp](doc/node-gyp.md)
- [cmake-js](doc/cmake-js.md)
- [Conversion tool](doc/conversion-tool.md)
- [Checker tool](doc/checker-tool.md)
- [Generator](doc/generator.md)
- [Prebuild tools](doc/prebuild_tools.md)
<a name="api"></a>
### **API Documentation**
The following is the documentation for node-addon-api.
- [Full Class Hierarchy](doc/hierarchy.md)
- [Addon Structure](doc/addon.md)
- Data Types:
- [Env](doc/env.md)
- [CallbackInfo](doc/callbackinfo.md)
- [Reference](doc/reference.md)
- [Value](doc/value.md)
- [Name](doc/name.md)
- [Symbol](doc/symbol.md)
- [String](doc/string.md)
- [Number](doc/number.md)
- [Date](doc/date.md)
- [BigInt](doc/bigint.md)
- [Boolean](doc/boolean.md)
- [External](doc/external.md)
- [Object](doc/object.md)
- [Array](doc/array.md)
- [ObjectReference](doc/object_reference.md)
- [PropertyDescriptor](doc/property_descriptor.md)
- [Function](doc/function.md)
- [FunctionReference](doc/function_reference.md)
- [ObjectWrap](doc/object_wrap.md)
- [ClassPropertyDescriptor](doc/class_property_descriptor.md)
- [Buffer](doc/buffer.md)
- [ArrayBuffer](doc/array_buffer.md)
- [TypedArray](doc/typed_array.md)
- [TypedArrayOf](doc/typed_array_of.md)
- [DataView](doc/dataview.md)
- [Error Handling](doc/error_handling.md)
- [Error](doc/error.md)
- [TypeError](doc/type_error.md)
- [RangeError](doc/range_error.md)
- [SyntaxError](doc/syntax_error.md)
- [Object Lifetime Management](doc/object_lifetime_management.md)
- [HandleScope](doc/handle_scope.md)
- [EscapableHandleScope](doc/escapable_handle_scope.md)
- [Memory Management](doc/memory_management.md)
- [Async Operations](doc/async_operations.md)
- [AsyncWorker](doc/async_worker.md)
- [AsyncContext](doc/async_context.md)
- [AsyncWorker Variants](doc/async_worker_variants.md)
- [Thread-safe Functions](doc/threadsafe.md)
- [ThreadSafeFunction](doc/threadsafe_function.md)
- [TypedThreadSafeFunction](doc/typed_threadsafe_function.md)
- [Promises](doc/promises.md)
- [Version management](doc/version_management.md)
<a name="examples"></a>
### **Examples**
Are you new to **node-addon-api**? Take a look at our **[examples](https://github.com/nodejs/node-addon-examples)**
- **[Hello World](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/1_hello_world)**
- **[Pass arguments to a function](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/2_function_arguments/node-addon-api)**
- **[Callbacks](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/3_callbacks/node-addon-api)**
- **[Object factory](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/4_object_factory/node-addon-api)**
- **[Function factory](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/5_function_factory/node-addon-api)**
- **[Wrapping C++ Object](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/6_object_wrap/node-addon-api)**
- **[Factory of wrapped object](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/7_factory_wrap/node-addon-api)**
- **[Passing wrapped object around](https://github.com/nodejs/node-addon-examples/tree/main/src/2-js-to-native-conversion/8_passing_wrapped/node-addon-api)**
<a name="tests"></a>
### **Tests**
To run the **node-addon-api** tests do:
```
npm install
npm test
```
To avoid testing the deprecated portions of the API run
```
npm install
npm test --disable-deprecated
```
To run the tests targeting a specific version of Node-API run
```
npm install
export NAPI_VERSION=X
npm test --NAPI_VERSION=X
```
where X is the version of Node-API you want to target.
To run a specific unit test, filter conditions are available
**Example:**
compile and run only tests on objectwrap.cc and objectwrap.js
```
npm run unit --filter=objectwrap
```
Multiple unit tests cane be selected with wildcards
**Example:**
compile and run all test files ending with "reference" -> function_reference.cc, object_reference.cc, reference.cc
```
npm run unit --filter=*reference
```
Multiple filter conditions can be joined to broaden the test selection
**Example:**
compile and run all tests under folders threadsafe_function and typed_threadsafe_function and also the objectwrap.cc file
npm run unit --filter='*function objectwrap'
### **Debug**
To run the **node-addon-api** tests with `--debug` option:
```
npm run-script dev
```
If you want a faster build, you might use the following option:
```
npm run-script dev:incremental
```
Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/HEAD/test)**
### **Benchmarks**
You can run the available benchmarks using the following command:
```
npm run-script benchmark
```
See [benchmark/README.md](benchmark/README.md) for more details about running and adding benchmarks.
<a name="resources"></a>
### **More resource and info about native Addons**
- **[C++ Addons](https://nodejs.org/dist/latest/docs/api/addons.html)**
- **[Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)**
- **[Node-API - Next Generation Node API for Native Modules](https://youtu.be/-Oniup60Afs)**
- **[How We Migrated Realm JavaScript From NAN to Node-API](https://developer.mongodb.com/article/realm-javascript-nan-to-n-api)**
As node-addon-api's core mission is to expose the plain C Node-API as C++
wrappers, tools that facilitate n-api/node-addon-api providing more
convenient patterns for developing a Node.js add-on with n-api/node-addon-api
can be published to NPM as standalone packages. It is also recommended to tag
such packages with `node-addon-api` to provide more visibility to the community.
Quick links to NPM searches: [keywords:node-addon-api](https://www.npmjs.com/search?q=keywords%3Anode-addon-api).
<a name="other-bindings"></a>
### **Other bindings**
- **[napi-rs](https://napi.rs)** - (`Rust`)
<a name="badges"></a>
### **Badges**
The use of badges is recommended to indicate the minimum version of Node-API
required for the module. This helps to determine which Node.js major versions are
supported. Addon maintainers can consult the [Node-API support matrix][] to determine
which Node.js versions provide a given Node-API version. The following badges are
available:
![Node-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v1%20Badge.svg)
![Node-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v2%20Badge.svg)
![Node-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v3%20Badge.svg)
![Node-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v4%20Badge.svg)
![Node-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v5%20Badge.svg)
![Node-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v6%20Badge.svg)
![Node-API v7 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v7%20Badge.svg)
![Node-API v8 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v8%20Badge.svg)
![Node-API v9 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v9%20Badge.svg)
![Node-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20Experimental%20Version%20Badge.svg)
## **Contributing**
We love contributions from the community to **node-addon-api**!
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around extending this module.
<a name="contributors"></a>
## Team members
### Active
| Name | GitHub Link |
| ------------------- | ----------------------------------------------------- |
| Anna Henningsen | [addaleax](https://github.com/addaleax) |
| Chengzhong Wu | [legendecas](https://github.com/legendecas) |
| Jack Xia | [JckXia](https://github.com/JckXia) |
| Kevin Eady | [KevinEady](https://github.com/KevinEady) |
| Michael Dawson | [mhdawson](https://github.com/mhdawson) |
| Nicola Del Gobbo | [NickNaso](https://github.com/NickNaso) |
| Vladimir Morozov | [vmoroz](https://github.com/vmoroz) |
### Emeritus
| Name | GitHub Link |
| ------------------- | ----------------------------------------------------- |
| Arunesh Chandra | [aruneshchandra](https://github.com/aruneshchandra) |
| Benjamin Byholm | [kkoopa](https://github.com/kkoopa) |
| Gabriel Schulhof | [gabrielschulhof](https://github.com/gabrielschulhof) |
| Hitesh Kanwathirtha | [digitalinfinity](https://github.com/digitalinfinity) |
| Jason Ginchereau | [jasongin](https://github.com/jasongin) |
| Jim Schlight | [jschlight](https://github.com/jschlight) |
| Sampson Gao | [sampsongao](https://github.com/sampsongao) |
| Taylor Woll | [boingoing](https://github.com/boingoing) |
<a name="license"></a>
Licensed under [MIT](./LICENSE.md)
[ABI stability guide]: https://nodejs.org/en/docs/guides/abi-stability/
[Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix

View File

@@ -0,0 +1,36 @@
import { DirectusFile } from "../../../schema/file.js";
import { NestedPartial } from "../../../types/utils.js";
import { ApplyQueryFields } from "../../../types/output.js";
import { Query } from "../../../types/query.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/update/files.d.ts
type UpdateFileOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusFile<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
/**
* Update multiple files at the same time.
* @param keys
* @param item
* @param query
* @returns Returns the file objects for the updated files.
* @throws Will throw if keys is empty
*/
declare const updateFiles: <Schema, const TQuery extends Query<Schema, DirectusFile<Schema>>>(keys: DirectusFile<Schema>["id"][], item: NestedPartial<DirectusFile<Schema>>, query?: TQuery) => RestCommand<UpdateFileOutput<Schema, TQuery>[], Schema>;
/**
* Update multiple files as batch.
* @param items
* @param query
* @returns Returns the file objects for the updated files.
*/
declare const updateFilesBatch: <Schema, const TQuery extends Query<Schema, DirectusFile<Schema>>>(items: NestedPartial<DirectusFile<Schema>>[], query?: TQuery) => RestCommand<UpdateFileOutput<Schema, TQuery>[], Schema>;
/**
* Update an existing file, and/or replace it's file contents.
* @param key
* @param item
* @param query
* @returns Returns the file object for the updated file.
* @throws Will throw if key is empty
*/
declare const updateFile: <Schema, const TQuery extends Query<Schema, DirectusFile<Schema>>>(key: DirectusFile<Schema>["id"], item: NestedPartial<DirectusFile<Schema>> | FormData, query?: TQuery) => RestCommand<UpdateFileOutput<Schema, TQuery>, Schema>;
//#endregion
export { UpdateFileOutput, updateFile, updateFiles, updateFilesBatch };
//# sourceMappingURL=files.d.ts.map

View File

@@ -0,0 +1,81 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const {
JAVASCRIPT_MODULE_TYPE_AUTO,
JAVASCRIPT_MODULE_TYPE_DYNAMIC,
JAVASCRIPT_MODULE_TYPE_ESM
} = require("./ModuleTypeConstants");
const ConstDependency = require("./dependencies/ConstDependency");
/** @typedef {import("../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
/** @typedef {import("./Module").BuildInfo} BuildInfo */
/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */
/** @typedef {import("./javascript/JavascriptParser").Range} Range */
const PLUGIN_NAME = "UseStrictPlugin";
class UseStrictPlugin {
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
/**
* @param {JavascriptParser} parser the parser
* @param {JavascriptParserOptions} parserOptions the javascript parser options
*/
const handler = (parser, parserOptions) => {
parser.hooks.program.tap(PLUGIN_NAME, (ast) => {
const firstNode = ast.body[0];
if (
firstNode &&
firstNode.type === "ExpressionStatement" &&
firstNode.expression.type === "Literal" &&
firstNode.expression.value === "use strict"
) {
// Remove "use strict" expression. It will be added later by the renderer again.
// This is necessary in order to not break the strict mode when webpack prepends code.
// @see https://github.com/webpack/webpack/issues/1970
const dep = new ConstDependency(
"",
/** @type {Range} */ (firstNode.range)
);
dep.loc = /** @type {DependencyLocation} */ (firstNode.loc);
parser.state.module.addPresentationalDependency(dep);
/** @type {BuildInfo} */
(parser.state.module.buildInfo).strict = true;
}
if (parserOptions.overrideStrict) {
/** @type {BuildInfo} */
(parser.state.module.buildInfo).strict =
parserOptions.overrideStrict === "strict";
}
});
};
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_AUTO)
.tap(PLUGIN_NAME, handler);
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_DYNAMIC)
.tap(PLUGIN_NAME, handler);
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_ESM)
.tap(PLUGIN_NAME, handler);
}
);
}
}
module.exports = UseStrictPlugin;

View File

@@ -0,0 +1,7 @@
type CreateUploadTimer = (timeout?: number, callback?: () => void) => {
clear: () => void;
set: () => boolean;
};
export declare const createUploadTimer: CreateUploadTimer;
export {};
//# sourceMappingURL=uploadTimer.d.ts.map

View File

@@ -0,0 +1,272 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { first } = require("./SetHelpers");
const SortableSet = require("./SortableSet");
/**
* @template T
* @template K
* @typedef {(item: T) => K} GetKey
*/
/**
* @template T
* @typedef {(a: T, n: T) => number} Comparator
*/
/**
* @template T
* @template K
* @typedef {LazyBucketSortedSet<T, K> | SortableSet<T>} Entry
*/
/**
* @template T
* @template K
* @typedef {GetKey<T, K> | Comparator<K> | Comparator<T>} Arg
*/
/**
* Multi layer bucket sorted set:
* Supports adding non-existing items (DO NOT ADD ITEM TWICE),
* Supports removing exiting items (DO NOT REMOVE ITEM NOT IN SET),
* Supports popping the first items according to defined order,
* Supports iterating all items without order,
* Supports updating an item in an efficient way,
* Supports size property, which is the number of items,
* Items are lazy partially sorted when needed
* @template T
* @template K
*/
class LazyBucketSortedSet {
/**
* @param {GetKey<T, K>} getKey function to get key from item
* @param {Comparator<K>=} comparator comparator to sort keys
* @param {...Arg<T, K>} args more pairs of getKey and comparator plus optional final comparator for the last layer
*/
constructor(getKey, comparator, ...args) {
this._getKey = getKey;
this._innerArgs = args;
this._leaf = args.length <= 1;
this._keys = new SortableSet(undefined, comparator);
/** @type {Map<K, Entry<T, K>>} */
this._map = new Map();
/** @type {Set<T>} */
this._unsortedItems = new Set();
this.size = 0;
}
/**
* @param {T} item an item
* @returns {void}
*/
add(item) {
this.size++;
this._unsortedItems.add(item);
}
/**
* @param {K} key key of item
* @param {T} item the item
* @returns {void}
*/
_addInternal(key, item) {
let entry = this._map.get(key);
if (entry === undefined) {
entry = this._leaf
? new SortableSet(
undefined,
/** @type {Comparator<T>} */
(this._innerArgs[0])
)
: new LazyBucketSortedSet(
.../** @type {[GetKey<T, K>, Comparator<K>]} */
(this._innerArgs)
);
this._keys.add(key);
this._map.set(key, entry);
}
entry.add(item);
}
/**
* @param {T} item an item
* @returns {void}
*/
delete(item) {
this.size--;
if (this._unsortedItems.has(item)) {
this._unsortedItems.delete(item);
return;
}
const key = this._getKey(item);
const entry = /** @type {Entry<T, K>} */ (this._map.get(key));
entry.delete(item);
if (entry.size === 0) {
this._deleteKey(key);
}
}
/**
* @param {K} key key to be removed
* @returns {void}
*/
_deleteKey(key) {
this._keys.delete(key);
this._map.delete(key);
}
/**
* @returns {T | undefined} an item
*/
popFirst() {
if (this.size === 0) return;
this.size--;
if (this._unsortedItems.size > 0) {
for (const item of this._unsortedItems) {
const key = this._getKey(item);
this._addInternal(key, item);
}
this._unsortedItems.clear();
}
this._keys.sort();
const key = /** @type {K} */ (first(this._keys));
const entry = this._map.get(key);
if (this._leaf) {
const leafEntry = /** @type {SortableSet<T>} */ (entry);
leafEntry.sort();
const item = /** @type {T} */ (first(leafEntry));
leafEntry.delete(item);
if (leafEntry.size === 0) {
this._deleteKey(key);
}
return item;
}
const nodeEntry =
/** @type {LazyBucketSortedSet<T, K>} */
(entry);
const item = nodeEntry.popFirst();
if (nodeEntry.size === 0) {
this._deleteKey(key);
}
return item;
}
/**
* @param {T} item to be updated item
* @returns {(remove?: true) => void} finish update
*/
startUpdate(item) {
if (this._unsortedItems.has(item)) {
return (remove) => {
if (remove) {
this._unsortedItems.delete(item);
this.size--;
}
};
}
const key = this._getKey(item);
if (this._leaf) {
const oldEntry = /** @type {SortableSet<T>} */ (this._map.get(key));
return (remove) => {
if (remove) {
this.size--;
oldEntry.delete(item);
if (oldEntry.size === 0) {
this._deleteKey(key);
}
return;
}
const newKey = this._getKey(item);
if (key === newKey) {
// This flags the sortable set as unordered
oldEntry.add(item);
} else {
oldEntry.delete(item);
if (oldEntry.size === 0) {
this._deleteKey(key);
}
this._addInternal(newKey, item);
}
};
}
const oldEntry =
/** @type {LazyBucketSortedSet<T, K>} */
(this._map.get(key));
const finishUpdate = oldEntry.startUpdate(item);
return (remove) => {
if (remove) {
this.size--;
finishUpdate(true);
if (oldEntry.size === 0) {
this._deleteKey(key);
}
return;
}
const newKey = this._getKey(item);
if (key === newKey) {
finishUpdate();
} else {
finishUpdate(true);
if (oldEntry.size === 0) {
this._deleteKey(key);
}
this._addInternal(newKey, item);
}
};
}
/**
* @param {Iterator<T>[]} iterators list of iterators to append to
* @returns {void}
*/
_appendIterators(iterators) {
if (this._unsortedItems.size > 0) {
iterators.push(this._unsortedItems[Symbol.iterator]());
}
for (const key of this._keys) {
const entry = this._map.get(key);
if (this._leaf) {
const leafEntry = /** @type {SortableSet<T>} */ (entry);
const iterator = leafEntry[Symbol.iterator]();
iterators.push(iterator);
} else {
const nodeEntry =
/** @type {LazyBucketSortedSet<T, K>} */
(entry);
nodeEntry._appendIterators(iterators);
}
}
}
/**
* @returns {Iterator<T>} the iterator
*/
[Symbol.iterator]() {
/** @type {Iterator<T>[]} */
const iterators = [];
this._appendIterators(iterators);
iterators.reverse();
let currentIterator =
/** @type {Iterator<T>} */
(iterators.pop());
return {
next: () => {
const res = currentIterator.next();
if (res.done) {
if (iterators.length === 0) return res;
currentIterator = /** @type {Iterator<T>} */ (iterators.pop());
return currentIterator.next();
}
return res;
}
};
}
}
module.exports = LazyBucketSortedSet;

View File

@@ -0,0 +1,15 @@
declare global {
interface Performance {
interactionCount: number;
}
}
/**
* Returns the `interactionCount` value using the native API (if available)
* or the polyfill estimate in this module.
*/
export declare const getInteractionCount: () => number;
/**
* Feature detects native support or initializes the polyfill if needed.
*/
export declare const initInteractionCountPolyfill: () => void;
//# sourceMappingURL=interactionCountPolyfill.d.ts.map

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { format as fn } from "../format.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const format = convertToFP(fn, 2);
// Fallback for modularized imports:
export default format;

View File

@@ -0,0 +1,73 @@
import { FlattenedSign } from '../flattened/sign.js';
import { JWSInvalid } from '../../util/errors.js';
class IndividualSignature {
parent;
protectedHeader;
unprotectedHeader;
options;
key;
constructor(sig, key, options) {
this.parent = sig;
this.key = key;
this.options = options;
}
setProtectedHeader(protectedHeader) {
if (this.protectedHeader) {
throw new TypeError('setProtectedHeader can only be called once');
}
this.protectedHeader = protectedHeader;
return this;
}
setUnprotectedHeader(unprotectedHeader) {
if (this.unprotectedHeader) {
throw new TypeError('setUnprotectedHeader can only be called once');
}
this.unprotectedHeader = unprotectedHeader;
return this;
}
addSignature(...args) {
return this.parent.addSignature(...args);
}
sign(...args) {
return this.parent.sign(...args);
}
done() {
return this.parent;
}
}
export class GeneralSign {
_payload;
_signatures = [];
constructor(payload) {
this._payload = payload;
}
addSignature(key, options) {
const signature = new IndividualSignature(this, key, options);
this._signatures.push(signature);
return signature;
}
async sign() {
if (!this._signatures.length) {
throw new JWSInvalid('at least one signature must be added');
}
const jws = {
signatures: [],
payload: '',
};
for (let i = 0; i < this._signatures.length; i++) {
const signature = this._signatures[i];
const flattened = new FlattenedSign(this._payload);
flattened.setProtectedHeader(signature.protectedHeader);
flattened.setUnprotectedHeader(signature.unprotectedHeader);
const { payload, ...rest } = await flattened.sign(signature.key, signature.options);
if (i === 0) {
jws.payload = payload;
}
else if (jws.payload !== payload) {
throw new JWSInvalid('inconsistent use of JWS Unencoded Payload (RFC7797)');
}
jws.signatures.push(rest);
}
return jws;
}
}

View File

@@ -0,0 +1,46 @@
{
"name": "get-tsconfig",
"version": "4.13.6",
"description": "Find and parse the tsconfig.json file from a directory path",
"keywords": [
"get-tsconfig",
"get",
"typescript",
"tsconfig",
"tsconfig.json"
],
"license": "MIT",
"repository": "privatenumber/get-tsconfig",
"funding": "https://github.com/privatenumber/get-tsconfig?sponsor=1",
"author": {
"name": "Hiroki Osame",
"email": "hiroki.osame@gmail.com"
},
"files": [
"dist"
],
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",
"exports": {
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
},
"imports": {
"#get-tsconfig": {
"types": "./src/index.ts",
"development": "./src/index.ts",
"default": "./dist/index.mjs"
}
},
"dependencies": {
"resolve-pkg-maps": "^1.0.0"
}
}

View File

@@ -0,0 +1,310 @@
// Type definitions for commander 2.11
// Project: https://github.com/visionmedia/commander.js
// Definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace local {
class Option {
flags: string;
required: boolean;
optional: boolean;
bool: boolean;
short?: string;
long: string;
description: string;
/**
* Initialize a new `Option` with the given `flags` and `description`.
*
* @param {string} flags
* @param {string} [description]
*/
constructor(flags: string, description?: string);
}
class Command extends NodeJS.EventEmitter {
[key: string]: any;
args: string[];
/**
* Initialize a new `Command`.
*
* @param {string} [name]
*/
constructor(name?: string);
/**
* Set the program version to `str`.
*
* This method auto-registers the "-V, --version" flag
* which will print the version number when passed.
*
* @param {string} str
* @param {string} [flags]
* @returns {Command} for chaining
*/
version(str: string, flags?: string): Command;
/**
* Add command `name`.
*
* The `.action()` callback is invoked when the
* command `name` is specified via __ARGV__,
* and the remaining arguments are applied to the
* function for access.
*
* When the `name` is "*" an un-matched command
* will be passed as the first arg, followed by
* the rest of __ARGV__ remaining.
*
* @example
* program
* .version('0.0.1')
* .option('-C, --chdir <path>', 'change the working directory')
* .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
* .option('-T, --no-tests', 'ignore test hook')
*
* program
* .command('setup')
* .description('run remote setup commands')
* .action(function() {
* console.log('setup');
* });
*
* program
* .command('exec <cmd>')
* .description('run the given remote command')
* .action(function(cmd) {
* console.log('exec "%s"', cmd);
* });
*
* program
* .command('teardown <dir> [otherDirs...]')
* .description('run teardown commands')
* .action(function(dir, otherDirs) {
* console.log('dir "%s"', dir);
* if (otherDirs) {
* otherDirs.forEach(function (oDir) {
* console.log('dir "%s"', oDir);
* });
* }
* });
*
* program
* .command('*')
* .description('deploy the given env')
* .action(function(env) {
* console.log('deploying "%s"', env);
* });
*
* program.parse(process.argv);
*
* @param {string} name
* @param {string} [desc] for git-style sub-commands
* @param {CommandOptions} [opts] command options
* @returns {Command} the new command
*/
command(name: string, desc?: string, opts?: commander.CommandOptions): Command;
/**
* Define argument syntax for the top-level command.
*
* @param {string} desc
* @returns {Command} for chaining
*/
arguments(desc: string): Command;
/**
* Parse expected `args`.
*
* For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
*
* @param {string[]} args
* @returns {Command} for chaining
*/
parseExpectedArgs(args: string[]): Command;
/**
* Register callback `fn` for the command.
*
* @example
* program
* .command('help')
* .description('display verbose help')
* .action(function() {
* // output help here
* });
*
* @param {(...args: any[]) => void} fn
* @returns {Command} for chaining
*/
action(fn: (...args: any[]) => void): Command;
/**
* Define option with `flags`, `description` and optional
* coercion `fn`.
*
* The `flags` string should contain both the short and long flags,
* separated by comma, a pipe or space. The following are all valid
* all will output this way when `--help` is used.
*
* "-p, --pepper"
* "-p|--pepper"
* "-p --pepper"
*
* @example
* // simple boolean defaulting to false
* program.option('-p, --pepper', 'add pepper');
*
* --pepper
* program.pepper
* // => Boolean
*
* // simple boolean defaulting to true
* program.option('-C, --no-cheese', 'remove cheese');
*
* program.cheese
* // => true
*
* --no-cheese
* program.cheese
* // => false
*
* // required argument
* program.option('-C, --chdir <path>', 'change the working directory');
*
* --chdir /tmp
* program.chdir
* // => "/tmp"
*
* // optional argument
* program.option('-c, --cheese [type]', 'add cheese [marble]');
*
* @param {string} flags
* @param {string} [description]
* @param {((arg1: any, arg2: any) => void) | RegExp} [fn] function or default
* @param {*} [defaultValue]
* @returns {Command} for chaining
*/
option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command;
option(flags: string, description?: string, defaultValue?: any): Command;
/**
* Allow unknown options on the command line.
*
* @param {boolean} [arg] if `true` or omitted, no error will be thrown for unknown options.
* @returns {Command} for chaining
*/
allowUnknownOption(arg?: boolean): Command;
/**
* Parse `argv`, settings options and invoking commands when defined.
*
* @param {string[]} argv
* @returns {Command} for chaining
*/
parse(argv: string[]): Command;
/**
* Parse options from `argv` returning `argv` void of these options.
*
* @param {string[]} argv
* @returns {ParseOptionsResult}
*/
parseOptions(argv: string[]): commander.ParseOptionsResult;
/**
* Return an object containing options as key-value pairs
*
* @returns {{[key: string]: any}}
*/
opts(): { [key: string]: any };
/**
* Set the description to `str`.
*
* @param {string} str
* @param {{[argName: string]: string}} argsDescription
* @return {(Command | string)}
*/
description(str: string, argsDescription?: {[argName: string]: string}): Command;
description(): string;
/**
* Set an alias for the command.
*
* @param {string} alias
* @return {(Command | string)}
*/
alias(alias: string): Command;
alias(): string;
/**
* Set or get the command usage.
*
* @param {string} str
* @return {(Command | string)}
*/
usage(str: string): Command;
usage(): string;
/**
* Set the name of the command.
*
* @param {string} str
* @return {Command}
*/
name(str: string): Command;
/**
* Get the name of the command.
*
* @return {string}
*/
name(): string;
/**
* Output help information for this command.
*
* @param {(str: string) => string} [cb]
*/
outputHelp(cb?: (str: string) => string): void;
/** Output help information and exit.
*
* @param {(str: string) => string} [cb]
*/
help(cb?: (str: string) => string): never;
}
}
declare namespace commander {
type Command = local.Command
type Option = local.Option
interface CommandOptions {
noHelp?: boolean;
isDefault?: boolean;
}
interface ParseOptionsResult {
args: string[];
unknown: string[];
}
interface CommanderStatic extends Command {
Command: typeof local.Command;
Option: typeof local.Option;
CommandOptions: CommandOptions;
ParseOptionsResult: ParseOptionsResult;
}
}
declare const commander: commander.CommanderStatic;
export = commander;

View File

@@ -0,0 +1,16 @@
import type {SchemaObject} from "../../types"
export type SchemaObjectMap = {[Ref in string]?: SchemaObject}
export const jtdForms = [
"elements",
"values",
"discriminator",
"properties",
"optionalProperties",
"enum",
"type",
"ref",
] as const
export type JTDForm = (typeof jtdForms)[number]

View File

@@ -0,0 +1,7 @@
"use strict";
exports.max = void 0;
var _index = require("../max.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const max = (exports.max = (0, _index2.convertToFP)(_index.max, 1));

View File

@@ -0,0 +1 @@
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/schema/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAKrE,OAAO,KAAK,EACV,cAAc,EACd,MAAM,EACN,SAAS,EACT,aAAa,EACb,QAAQ,EAGR,WAAW,EACX,WAAW,EACZ,MAAM,aAAa,CAAA;AAOpB,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACvC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAC/C;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IACtC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,eAAe,CAAC,EAAE,sBAAsB,EAAE,CAAA;IAC1C,cAAc,EAAE,OAAO,CAAA;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,aAAa,EAAE,OAAO,CAAA;IACtB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC/B,oBAAoB,CAAC,EAAE,WAAW,CAAA;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uBAAuB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACrC,WAAW,EAAE,WAAW,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAA;CACtC,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,2BAA2B,EAAE,OAAO,CAAA;IACpC,yBAAyB,EAAE,OAAO,CAAA;IAClC,6BAA6B,EAAE,OAAO,CAAA;IACtC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAA;IACrC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAA;IACnC,gBAAgB,EAAE,WAAW,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,UAAU,0XAsBpB,IAAI,KAAG,MAgsBT,CAAA"}

View File

@@ -0,0 +1,839 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZodMiniOptional = exports.ZodMiniTransform = exports.ZodMiniFile = exports.ZodMiniLiteral = exports.ZodMiniEnum = exports.ZodMiniSet = exports.ZodMiniMap = exports.ZodMiniRecord = exports.ZodMiniTuple = exports.ZodMiniIntersection = exports.ZodMiniDiscriminatedUnion = exports.ZodMiniUnion = exports.ZodMiniObject = exports.ZodMiniArray = exports.ZodMiniDate = exports.ZodMiniVoid = exports.ZodMiniNever = exports.ZodMiniUnknown = exports.ZodMiniAny = exports.ZodMiniNull = exports.ZodMiniUndefined = exports.ZodMiniSymbol = exports.ZodMiniBigIntFormat = exports.ZodMiniBigInt = exports.ZodMiniBoolean = exports.ZodMiniNumberFormat = exports.ZodMiniNumber = exports.ZodMiniCustomStringFormat = exports.ZodMiniJWT = exports.ZodMiniE164 = exports.ZodMiniBase64URL = exports.ZodMiniBase64 = exports.ZodMiniCIDRv6 = exports.ZodMiniCIDRv4 = exports.ZodMiniIPv6 = exports.ZodMiniIPv4 = exports.ZodMiniKSUID = exports.ZodMiniXID = exports.ZodMiniULID = exports.ZodMiniCUID2 = exports.ZodMiniCUID = exports.ZodMiniNanoID = exports.ZodMiniEmoji = exports.ZodMiniURL = exports.ZodMiniUUID = exports.ZodMiniGUID = exports.ZodMiniEmail = exports.ZodMiniStringFormat = exports.ZodMiniString = exports.ZodMiniType = void 0;
exports.stringbool = exports.ZodMiniCustom = exports.ZodMiniPromise = exports.ZodMiniLazy = exports.ZodMiniTemplateLiteral = exports.ZodMiniReadonly = exports.ZodMiniPipe = exports.ZodMiniNaN = exports.ZodMiniCatch = exports.ZodMiniSuccess = exports.ZodMiniNonOptional = exports.ZodMiniPrefault = exports.ZodMiniDefault = exports.ZodMiniNullable = void 0;
exports.string = string;
exports.email = email;
exports.guid = guid;
exports.uuid = uuid;
exports.uuidv4 = uuidv4;
exports.uuidv6 = uuidv6;
exports.uuidv7 = uuidv7;
exports.url = url;
exports.emoji = emoji;
exports.nanoid = nanoid;
exports.cuid = cuid;
exports.cuid2 = cuid2;
exports.ulid = ulid;
exports.xid = xid;
exports.ksuid = ksuid;
exports.ipv4 = ipv4;
exports.ipv6 = ipv6;
exports.cidrv4 = cidrv4;
exports.cidrv6 = cidrv6;
exports.base64 = base64;
exports.base64url = base64url;
exports.e164 = e164;
exports.jwt = jwt;
exports.stringFormat = stringFormat;
exports.number = number;
exports.int = int;
exports.float32 = float32;
exports.float64 = float64;
exports.int32 = int32;
exports.uint32 = uint32;
exports.boolean = boolean;
exports.bigint = bigint;
exports.int64 = int64;
exports.uint64 = uint64;
exports.symbol = symbol;
exports.undefined = _undefined;
exports.null = _null;
exports.any = any;
exports.unknown = unknown;
exports.never = never;
exports.void = _void;
exports.date = date;
exports.array = array;
exports.keyof = keyof;
exports.object = object;
exports.strictObject = strictObject;
exports.looseObject = looseObject;
exports.extend = extend;
exports.merge = merge;
exports.pick = pick;
exports.omit = omit;
exports.partial = partial;
exports.required = required;
exports.catchall = catchall;
exports.union = union;
exports.discriminatedUnion = discriminatedUnion;
exports.intersection = intersection;
exports.tuple = tuple;
exports.record = record;
exports.partialRecord = partialRecord;
exports.map = map;
exports.set = set;
exports.enum = _enum;
exports.nativeEnum = nativeEnum;
exports.literal = literal;
exports.file = file;
exports.transform = transform;
exports.optional = optional;
exports.nullable = nullable;
exports.nullish = nullish;
exports._default = _default;
exports.prefault = prefault;
exports.nonoptional = nonoptional;
exports.success = success;
exports.catch = _catch;
exports.nan = nan;
exports.pipe = pipe;
exports.readonly = readonly;
exports.templateLiteral = templateLiteral;
exports.lazy = _lazy;
exports.promise = promise;
exports.check = check;
exports.custom = custom;
exports.refine = refine;
exports.instanceof = _instanceof;
exports.json = json;
const core = __importStar(require("../core/index.cjs"));
const index_js_1 = require("../core/index.cjs");
const parse = __importStar(require("./parse.cjs"));
exports.ZodMiniType = core.$constructor("ZodMiniType", (inst, def) => {
if (!inst._zod)
throw new Error("Uninitialized schema in ZodMiniType.");
core.$ZodType.init(inst, def);
inst.def = def;
inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
inst.check = (...checks) => {
return inst.clone({
...def,
checks: [
...(def.checks ?? []),
...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
],
}
// { parent: true }
);
};
inst.clone = (_def, params) => core.clone(inst, _def, params);
inst.brand = () => inst;
inst.register = ((reg, meta) => {
reg.add(inst, meta);
return inst;
});
});
exports.ZodMiniString = core.$constructor("ZodMiniString", (inst, def) => {
core.$ZodString.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function string(params) {
return core._string(exports.ZodMiniString, params);
}
exports.ZodMiniStringFormat = core.$constructor("ZodMiniStringFormat", (inst, def) => {
core.$ZodStringFormat.init(inst, def);
exports.ZodMiniString.init(inst, def);
});
exports.ZodMiniEmail = core.$constructor("ZodMiniEmail", (inst, def) => {
core.$ZodEmail.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function email(params) {
return core._email(exports.ZodMiniEmail, params);
}
exports.ZodMiniGUID = core.$constructor("ZodMiniGUID", (inst, def) => {
core.$ZodGUID.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function guid(params) {
return core._guid(exports.ZodMiniGUID, params);
}
exports.ZodMiniUUID = core.$constructor("ZodMiniUUID", (inst, def) => {
core.$ZodUUID.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function uuid(params) {
return core._uuid(exports.ZodMiniUUID, params);
}
function uuidv4(params) {
return core._uuidv4(exports.ZodMiniUUID, params);
}
// ZodMiniUUIDv6
function uuidv6(params) {
return core._uuidv6(exports.ZodMiniUUID, params);
}
// ZodMiniUUIDv7
function uuidv7(params) {
return core._uuidv7(exports.ZodMiniUUID, params);
}
exports.ZodMiniURL = core.$constructor("ZodMiniURL", (inst, def) => {
core.$ZodURL.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function url(params) {
return core._url(exports.ZodMiniURL, params);
}
exports.ZodMiniEmoji = core.$constructor("ZodMiniEmoji", (inst, def) => {
core.$ZodEmoji.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function emoji(params) {
return core._emoji(exports.ZodMiniEmoji, params);
}
exports.ZodMiniNanoID = core.$constructor("ZodMiniNanoID", (inst, def) => {
core.$ZodNanoID.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function nanoid(params) {
return core._nanoid(exports.ZodMiniNanoID, params);
}
exports.ZodMiniCUID = core.$constructor("ZodMiniCUID", (inst, def) => {
core.$ZodCUID.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function cuid(params) {
return core._cuid(exports.ZodMiniCUID, params);
}
exports.ZodMiniCUID2 = core.$constructor("ZodMiniCUID2", (inst, def) => {
core.$ZodCUID2.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function cuid2(params) {
return core._cuid2(exports.ZodMiniCUID2, params);
}
exports.ZodMiniULID = core.$constructor("ZodMiniULID", (inst, def) => {
core.$ZodULID.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function ulid(params) {
return core._ulid(exports.ZodMiniULID, params);
}
exports.ZodMiniXID = core.$constructor("ZodMiniXID", (inst, def) => {
core.$ZodXID.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function xid(params) {
return core._xid(exports.ZodMiniXID, params);
}
exports.ZodMiniKSUID = core.$constructor("ZodMiniKSUID", (inst, def) => {
core.$ZodKSUID.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function ksuid(params) {
return core._ksuid(exports.ZodMiniKSUID, params);
}
exports.ZodMiniIPv4 = core.$constructor("ZodMiniIPv4", (inst, def) => {
core.$ZodIPv4.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function ipv4(params) {
return core._ipv4(exports.ZodMiniIPv4, params);
}
exports.ZodMiniIPv6 = core.$constructor("ZodMiniIPv6", (inst, def) => {
core.$ZodIPv6.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function ipv6(params) {
return core._ipv6(exports.ZodMiniIPv6, params);
}
exports.ZodMiniCIDRv4 = core.$constructor("ZodMiniCIDRv4", (inst, def) => {
core.$ZodCIDRv4.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function cidrv4(params) {
return core._cidrv4(exports.ZodMiniCIDRv4, params);
}
exports.ZodMiniCIDRv6 = core.$constructor("ZodMiniCIDRv6", (inst, def) => {
core.$ZodCIDRv6.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function cidrv6(params) {
return core._cidrv6(exports.ZodMiniCIDRv6, params);
}
exports.ZodMiniBase64 = core.$constructor("ZodMiniBase64", (inst, def) => {
core.$ZodBase64.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function base64(params) {
return core._base64(exports.ZodMiniBase64, params);
}
exports.ZodMiniBase64URL = core.$constructor("ZodMiniBase64URL", (inst, def) => {
core.$ZodBase64URL.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function base64url(params) {
return core._base64url(exports.ZodMiniBase64URL, params);
}
exports.ZodMiniE164 = core.$constructor("ZodMiniE164", (inst, def) => {
core.$ZodE164.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function e164(params) {
return core._e164(exports.ZodMiniE164, params);
}
exports.ZodMiniJWT = core.$constructor("ZodMiniJWT", (inst, def) => {
core.$ZodJWT.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function jwt(params) {
return core._jwt(exports.ZodMiniJWT, params);
}
exports.ZodMiniCustomStringFormat = core.$constructor("ZodMiniCustomStringFormat", (inst, def) => {
core.$ZodCustomStringFormat.init(inst, def);
exports.ZodMiniStringFormat.init(inst, def);
});
function stringFormat(format, fnOrRegex, _params = {}) {
return core._stringFormat(exports.ZodMiniCustomStringFormat, format, fnOrRegex, _params);
}
exports.ZodMiniNumber = core.$constructor("ZodMiniNumber", (inst, def) => {
core.$ZodNumber.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function number(params) {
return core._number(exports.ZodMiniNumber, params);
}
exports.ZodMiniNumberFormat = core.$constructor("ZodMiniNumberFormat", (inst, def) => {
core.$ZodNumberFormat.init(inst, def);
exports.ZodMiniNumber.init(inst, def);
});
// int
function int(params) {
return core._int(exports.ZodMiniNumberFormat, params);
}
// float32
function float32(params) {
return core._float32(exports.ZodMiniNumberFormat, params);
}
// float64
function float64(params) {
return core._float64(exports.ZodMiniNumberFormat, params);
}
// int32
function int32(params) {
return core._int32(exports.ZodMiniNumberFormat, params);
}
// uint32
function uint32(params) {
return core._uint32(exports.ZodMiniNumberFormat, params);
}
exports.ZodMiniBoolean = core.$constructor("ZodMiniBoolean", (inst, def) => {
core.$ZodBoolean.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function boolean(params) {
return core._boolean(exports.ZodMiniBoolean, params);
}
exports.ZodMiniBigInt = core.$constructor("ZodMiniBigInt", (inst, def) => {
core.$ZodBigInt.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function bigint(params) {
return core._bigint(exports.ZodMiniBigInt, params);
}
exports.ZodMiniBigIntFormat = core.$constructor("ZodMiniBigIntFormat", (inst, def) => {
core.$ZodBigIntFormat.init(inst, def);
exports.ZodMiniBigInt.init(inst, def);
});
// int64
function int64(params) {
return core._int64(exports.ZodMiniBigIntFormat, params);
}
// uint64
function uint64(params) {
return core._uint64(exports.ZodMiniBigIntFormat, params);
}
exports.ZodMiniSymbol = core.$constructor("ZodMiniSymbol", (inst, def) => {
core.$ZodSymbol.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function symbol(params) {
return core._symbol(exports.ZodMiniSymbol, params);
}
exports.ZodMiniUndefined = core.$constructor("ZodMiniUndefined", (inst, def) => {
core.$ZodUndefined.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function _undefined(params) {
return core._undefined(exports.ZodMiniUndefined, params);
}
exports.ZodMiniNull = core.$constructor("ZodMiniNull", (inst, def) => {
core.$ZodNull.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function _null(params) {
return core._null(exports.ZodMiniNull, params);
}
exports.ZodMiniAny = core.$constructor("ZodMiniAny", (inst, def) => {
core.$ZodAny.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function any() {
return core._any(exports.ZodMiniAny);
}
exports.ZodMiniUnknown = core.$constructor("ZodMiniUnknown", (inst, def) => {
core.$ZodUnknown.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function unknown() {
return core._unknown(exports.ZodMiniUnknown);
}
exports.ZodMiniNever = core.$constructor("ZodMiniNever", (inst, def) => {
core.$ZodNever.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function never(params) {
return core._never(exports.ZodMiniNever, params);
}
exports.ZodMiniVoid = core.$constructor("ZodMiniVoid", (inst, def) => {
core.$ZodVoid.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function _void(params) {
return core._void(exports.ZodMiniVoid, params);
}
exports.ZodMiniDate = core.$constructor("ZodMiniDate", (inst, def) => {
core.$ZodDate.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function date(params) {
return core._date(exports.ZodMiniDate, params);
}
exports.ZodMiniArray = core.$constructor("ZodMiniArray", (inst, def) => {
core.$ZodArray.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function array(element, params) {
return new exports.ZodMiniArray({
type: "array",
element: element,
...index_js_1.util.normalizeParams(params),
});
}
// .keyof
function keyof(schema) {
const shape = schema._zod.def.shape;
return literal(Object.keys(shape));
}
exports.ZodMiniObject = core.$constructor("ZodMiniObject", (inst, def) => {
core.$ZodObject.init(inst, def);
exports.ZodMiniType.init(inst, def);
index_js_1.util.defineLazy(inst, "shape", () => def.shape);
});
function object(shape, params) {
const def = {
type: "object",
get shape() {
index_js_1.util.assignProp(this, "shape", { ...shape });
return this.shape;
},
...index_js_1.util.normalizeParams(params),
};
return new exports.ZodMiniObject(def);
}
// strictObject
function strictObject(shape, params) {
return new exports.ZodMiniObject({
type: "object",
// shape: shape as core.$ZodLooseShape,
get shape() {
index_js_1.util.assignProp(this, "shape", { ...shape });
return this.shape;
},
catchall: never(),
...index_js_1.util.normalizeParams(params),
});
}
// looseObject
function looseObject(shape, params) {
return new exports.ZodMiniObject({
type: "object",
// shape: shape as core.$ZodLooseShape,
get shape() {
index_js_1.util.assignProp(this, "shape", { ...shape });
return this.shape;
},
// get optional() {
// return util.optionalKeys(shape);
// },
catchall: unknown(),
...index_js_1.util.normalizeParams(params),
});
}
// object methods
function extend(schema, shape) {
return index_js_1.util.extend(schema, shape);
}
function merge(schema, shape) {
return index_js_1.util.extend(schema, shape);
}
function pick(schema, mask) {
return index_js_1.util.pick(schema, mask);
}
// .omit
function omit(schema, mask) {
return index_js_1.util.omit(schema, mask);
}
function partial(schema, mask) {
return index_js_1.util.partial(exports.ZodMiniOptional, schema, mask);
}
function required(schema, mask) {
return index_js_1.util.required(exports.ZodMiniNonOptional, schema, mask);
}
function catchall(inst, catchall) {
return inst.clone({ ...inst._zod.def, catchall: catchall });
}
exports.ZodMiniUnion = core.$constructor("ZodMiniUnion", (inst, def) => {
core.$ZodUnion.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function union(options, params) {
return new exports.ZodMiniUnion({
type: "union",
options: options,
...index_js_1.util.normalizeParams(params),
});
}
exports.ZodMiniDiscriminatedUnion = core.$constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
core.$ZodDiscriminatedUnion.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function discriminatedUnion(discriminator, options, params) {
return new exports.ZodMiniDiscriminatedUnion({
type: "union",
options,
discriminator,
...index_js_1.util.normalizeParams(params),
});
}
exports.ZodMiniIntersection = core.$constructor("ZodMiniIntersection", (inst, def) => {
core.$ZodIntersection.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function intersection(left, right) {
return new exports.ZodMiniIntersection({
type: "intersection",
left: left,
right: right,
});
}
exports.ZodMiniTuple = core.$constructor("ZodMiniTuple", (inst, def) => {
core.$ZodTuple.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function tuple(items, _paramsOrRest, _params) {
const hasRest = _paramsOrRest instanceof core.$ZodType;
const params = hasRest ? _params : _paramsOrRest;
const rest = hasRest ? _paramsOrRest : null;
return new exports.ZodMiniTuple({
type: "tuple",
items: items,
rest,
...index_js_1.util.normalizeParams(params),
});
}
exports.ZodMiniRecord = core.$constructor("ZodMiniRecord", (inst, def) => {
core.$ZodRecord.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function record(keyType, valueType, params) {
return new exports.ZodMiniRecord({
type: "record",
keyType,
valueType: valueType,
...index_js_1.util.normalizeParams(params),
});
}
function partialRecord(keyType, valueType, params) {
return new exports.ZodMiniRecord({
type: "record",
keyType: union([keyType, never()]),
valueType: valueType,
...index_js_1.util.normalizeParams(params),
});
}
exports.ZodMiniMap = core.$constructor("ZodMiniMap", (inst, def) => {
core.$ZodMap.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function map(keyType, valueType, params) {
return new exports.ZodMiniMap({
type: "map",
keyType: keyType,
valueType: valueType,
...index_js_1.util.normalizeParams(params),
});
}
exports.ZodMiniSet = core.$constructor("ZodMiniSet", (inst, def) => {
core.$ZodSet.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function set(valueType, params) {
return new exports.ZodMiniSet({
type: "set",
valueType: valueType,
...index_js_1.util.normalizeParams(params),
});
}
exports.ZodMiniEnum = core.$constructor("ZodMiniEnum", (inst, def) => {
core.$ZodEnum.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function _enum(values, params) {
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
return new exports.ZodMiniEnum({
type: "enum",
entries,
...index_js_1.util.normalizeParams(params),
});
}
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
*
* ```ts
* enum Colors { red, green, blue }
* z.enum(Colors);
* ```
*/
function nativeEnum(entries, params) {
return new exports.ZodMiniEnum({
type: "enum",
entries,
...index_js_1.util.normalizeParams(params),
});
}
exports.ZodMiniLiteral = core.$constructor("ZodMiniLiteral", (inst, def) => {
core.$ZodLiteral.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function literal(value, params) {
return new exports.ZodMiniLiteral({
type: "literal",
values: Array.isArray(value) ? value : [value],
...index_js_1.util.normalizeParams(params),
});
}
exports.ZodMiniFile = core.$constructor("ZodMiniFile", (inst, def) => {
core.$ZodFile.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function file(params) {
return core._file(exports.ZodMiniFile, params);
}
exports.ZodMiniTransform = core.$constructor("ZodMiniTransform", (inst, def) => {
core.$ZodTransform.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function transform(fn) {
return new exports.ZodMiniTransform({
type: "transform",
transform: fn,
});
}
exports.ZodMiniOptional = core.$constructor("ZodMiniOptional", (inst, def) => {
core.$ZodOptional.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function optional(innerType) {
return new exports.ZodMiniOptional({
type: "optional",
innerType: innerType,
});
}
exports.ZodMiniNullable = core.$constructor("ZodMiniNullable", (inst, def) => {
core.$ZodNullable.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function nullable(innerType) {
return new exports.ZodMiniNullable({
type: "nullable",
innerType: innerType,
});
}
// nullish
function nullish(innerType) {
return optional(nullable(innerType));
}
exports.ZodMiniDefault = core.$constructor("ZodMiniDefault", (inst, def) => {
core.$ZodDefault.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function _default(innerType, defaultValue) {
return new exports.ZodMiniDefault({
type: "default",
innerType: innerType,
get defaultValue() {
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
},
});
}
exports.ZodMiniPrefault = core.$constructor("ZodMiniPrefault", (inst, def) => {
core.$ZodPrefault.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function prefault(innerType, defaultValue) {
return new exports.ZodMiniPrefault({
type: "prefault",
innerType: innerType,
get defaultValue() {
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
},
});
}
exports.ZodMiniNonOptional = core.$constructor("ZodMiniNonOptional", (inst, def) => {
core.$ZodNonOptional.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function nonoptional(innerType, params) {
return new exports.ZodMiniNonOptional({
type: "nonoptional",
innerType: innerType,
...index_js_1.util.normalizeParams(params),
});
}
exports.ZodMiniSuccess = core.$constructor("ZodMiniSuccess", (inst, def) => {
core.$ZodSuccess.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function success(innerType) {
return new exports.ZodMiniSuccess({
type: "success",
innerType: innerType,
});
}
exports.ZodMiniCatch = core.$constructor("ZodMiniCatch", (inst, def) => {
core.$ZodCatch.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function _catch(innerType, catchValue) {
return new exports.ZodMiniCatch({
type: "catch",
innerType: innerType,
catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue),
});
}
exports.ZodMiniNaN = core.$constructor("ZodMiniNaN", (inst, def) => {
core.$ZodNaN.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function nan(params) {
return core._nan(exports.ZodMiniNaN, params);
}
exports.ZodMiniPipe = core.$constructor("ZodMiniPipe", (inst, def) => {
core.$ZodPipe.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function pipe(in_, out) {
return new exports.ZodMiniPipe({
type: "pipe",
in: in_,
out: out,
});
}
exports.ZodMiniReadonly = core.$constructor("ZodMiniReadonly", (inst, def) => {
core.$ZodReadonly.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function readonly(innerType) {
return new exports.ZodMiniReadonly({
type: "readonly",
innerType: innerType,
});
}
exports.ZodMiniTemplateLiteral = core.$constructor("ZodMiniTemplateLiteral", (inst, def) => {
core.$ZodTemplateLiteral.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function templateLiteral(parts, params) {
return new exports.ZodMiniTemplateLiteral({
type: "template_literal",
parts,
...index_js_1.util.normalizeParams(params),
});
}
exports.ZodMiniLazy = core.$constructor("ZodMiniLazy", (inst, def) => {
core.$ZodLazy.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
// export function lazy<T extends object>(getter: () => T): T {
// return util.createTransparentProxy<T>(getter);
// }
function _lazy(getter) {
return new exports.ZodMiniLazy({
type: "lazy",
getter: getter,
});
}
exports.ZodMiniPromise = core.$constructor("ZodMiniPromise", (inst, def) => {
core.$ZodPromise.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
function promise(innerType) {
return new exports.ZodMiniPromise({
type: "promise",
innerType: innerType,
});
}
exports.ZodMiniCustom = core.$constructor("ZodMiniCustom", (inst, def) => {
core.$ZodCustom.init(inst, def);
exports.ZodMiniType.init(inst, def);
});
// custom checks
function check(fn, params) {
const ch = new core.$ZodCheck({
check: "custom",
...index_js_1.util.normalizeParams(params),
});
ch._zod.check = fn;
return ch;
}
// ZodCustom
// custom schema
function custom(fn, _params) {
return core._custom(exports.ZodMiniCustom, fn ?? (() => true), _params);
}
// refine
function refine(fn, _params = {}) {
return core._refine(exports.ZodMiniCustom, fn, _params);
}
// instanceof
class Class {
constructor(..._args) { }
}
function _instanceof(cls, params = {
error: `Input not instance of ${cls.name}`,
}) {
const inst = custom((data) => data instanceof cls, params);
inst._zod.bag.Class = cls;
return inst;
}
// stringbool
const stringbool = (...args) => core._stringbool({
Pipe: exports.ZodMiniPipe,
Boolean: exports.ZodMiniBoolean,
String: exports.ZodMiniString,
Transform: exports.ZodMiniTransform,
}, ...args);
exports.stringbool = stringbool;
function json() {
const jsonSchema = _lazy(() => {
return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
});
return jsonSchema;
}

View File

@@ -0,0 +1,44 @@
const formatRelativeLocale = {
lastWeek: (date) => {
const day = date.getDay();
switch (day) {
case 0:
return "'прошле недеље у' p";
case 3:
return "'прошле среде у' p";
case 6:
return "'прошле суботе у' p";
default:
return "'прошли' EEEE 'у' p";
}
},
yesterday: "'јуче у' p",
today: "'данас у' p",
tomorrow: "'сутра у' p",
nextWeek: (date) => {
const day = date.getDay();
switch (day) {
case 0:
return "'следеће недеље у' p";
case 3:
return "'следећу среду у' p";
case 6:
return "'следећу суботу у' p";
default:
return "'следећи' EEEE 'у' p";
}
},
other: "P",
};
export const formatRelative = (token, date, _baseDate, _options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date);
}
return format;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/combineWhereConstraints.ts"],"sourcesContent":["import type { Where } from '../types/index.js'\n\nexport function combineWhereConstraints(\n constraints: Array<undefined | Where>,\n as: 'and' | 'or' = 'and',\n): Where {\n if (constraints.length === 0) {\n return {}\n }\n\n const reducedConstraints = constraints.reduce<Partial<Where>>(\n (acc: Partial<Where>, constraint) => {\n if (constraint && typeof constraint === 'object' && Object.keys(constraint).length > 0) {\n if (as in constraint) {\n // merge the objects under the shared key\n acc[as] = [...(acc[as] as Where[]), ...(constraint[as] as Where[])]\n } else {\n // the constraint does not share the key\n acc[as]?.push(constraint)\n }\n }\n\n return acc\n },\n { [as]: [] } satisfies Where,\n )\n\n if (reducedConstraints[as]?.length === 0) {\n // If there are no constraints, return an empty object\n return {}\n }\n\n return reducedConstraints as Where\n}\n"],"names":["combineWhereConstraints","constraints","as","length","reducedConstraints","reduce","acc","constraint","Object","keys","push"],"mappings":"AAEA,OAAO,SAASA,wBACdC,WAAqC,EACrCC,KAAmB,KAAK;IAExB,IAAID,YAAYE,MAAM,KAAK,GAAG;QAC5B,OAAO,CAAC;IACV;IAEA,MAAMC,qBAAqBH,YAAYI,MAAM,CAC3C,CAACC,KAAqBC;QACpB,IAAIA,cAAc,OAAOA,eAAe,YAAYC,OAAOC,IAAI,CAACF,YAAYJ,MAAM,GAAG,GAAG;YACtF,IAAID,MAAMK,YAAY;gBACpB,yCAAyC;gBACzCD,GAAG,CAACJ,GAAG,GAAG;uBAAKI,GAAG,CAACJ,GAAG;uBAAkBK,UAAU,CAACL,GAAG;iBAAa;YACrE,OAAO;gBACL,wCAAwC;gBACxCI,GAAG,CAACJ,GAAG,EAAEQ,KAAKH;YAChB;QACF;QAEA,OAAOD;IACT,GACA;QAAE,CAACJ,GAAG,EAAE,EAAE;IAAC;IAGb,IAAIE,kBAAkB,CAACF,GAAG,EAAEC,WAAW,GAAG;QACxC,sDAAsD;QACtD,OAAO,CAAC;IACV;IAEA,OAAOC;AACT"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"generateFieldID.d.ts","sourceRoot":"","sources":["../../src/utilities/generateFieldID.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,SAAU,MAAM,aAAa,MAAM,QAAQ,MAAM,WAK5E,CAAA"}

View File

@@ -0,0 +1 @@
export declare const isDate: import("./types.js").FPFn1<boolean, unknown>;

View File

@@ -0,0 +1,48 @@
'use strict'
const EventEmitter = require('node:events')
const WrapHandler = require('../handler/wrap-handler')
const wrapInterceptor = (dispatch) => (opts, handler) => dispatch(opts, WrapHandler.wrap(handler))
class Dispatcher extends EventEmitter {
dispatch () {
throw new Error('not implemented')
}
close () {
throw new Error('not implemented')
}
destroy () {
throw new Error('not implemented')
}
compose (...args) {
// So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...
const interceptors = Array.isArray(args[0]) ? args[0] : args
let dispatch = this.dispatch.bind(this)
for (const interceptor of interceptors) {
if (interceptor == null) {
continue
}
if (typeof interceptor !== 'function') {
throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)
}
dispatch = interceptor(dispatch)
dispatch = wrapInterceptor(dispatch)
if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {
throw new TypeError('invalid interceptor')
}
}
return new Proxy(this, {
get: (target, key) => key === 'dispatch' ? dispatch : target[key]
})
}
}
module.exports = Dispatcher

View File

@@ -0,0 +1,5 @@
import { IPropertyValueDescriptor } from '../IPropertyDescriptor';
export declare const borderTopWidth: IPropertyValueDescriptor<number>;
export declare const borderRightWidth: IPropertyValueDescriptor<number>;
export declare const borderBottomWidth: IPropertyValueDescriptor<number>;
export declare const borderLeftWidth: IPropertyValueDescriptor<number>;

View File

@@ -0,0 +1,5 @@
export declare const subMonths: import("./types.js").FPFn2<
Date,
number,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,107 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _rng = _interopRequireDefault(require("./rng.js"));
var _stringify = require("./stringify.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// **`v1()` - Generate time-based UUID**
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html
let _nodeId;
let _clockseq; // Previous uuid creation time
let _lastMSecs = 0;
let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
function v1(options, buf, offset) {
let i = buf && offset || 0;
const b = buf || new Array(16);
options = options || {};
let node = options.node || _nodeId;
let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
// specified. We do this lazily to minimize issues related to insufficient
// system entropy. See #189
if (node == null || clockseq == null) {
const seedBytes = options.random || (options.rng || _rng.default)();
if (node == null) {
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
}
if (clockseq == null) {
// Per 4.2.2, randomize (14 bit) clockseq
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
}
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
if (dt < 0 && options.clockseq === undefined) {
clockseq = clockseq + 1 & 0x3fff;
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
// time interval
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
nsecs = 0;
} // Per 4.2.1.2 Throw error if too many uuids are requested
if (nsecs >= 10000) {
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
msecs += 12219292800000; // `time_low`
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
b[i++] = tl >>> 24 & 0xff;
b[i++] = tl >>> 16 & 0xff;
b[i++] = tl >>> 8 & 0xff;
b[i++] = tl & 0xff; // `time_mid`
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
b[i++] = tmh >>> 8 & 0xff;
b[i++] = tmh & 0xff; // `time_high_and_version`
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
b[i++] = clockseq & 0xff; // `node`
for (let n = 0; n < 6; ++n) {
b[i + n] = node[n];
}
return buf || (0, _stringify.unsafeStringify)(b);
}
var _default = v1;
exports.default = _default;

View File

@@ -0,0 +1 @@
{"version":3,"file":"spanstatus.js","sources":["../../../src/tracing/spanstatus.ts"],"sourcesContent":["import type { Span } from '../types-hoist/span';\nimport type { SpanStatus } from '../types-hoist/spanStatus';\n\nexport const SPAN_STATUS_UNSET = 0;\nexport const SPAN_STATUS_OK = 1;\nexport const SPAN_STATUS_ERROR = 2;\n\n/**\n * Converts a HTTP status code into a sentry status with a message.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or internal_error.\n */\n// https://develop.sentry.dev/sdk/event-payloads/span/\nexport function getSpanStatusFromHttpCode(httpStatus: number): SpanStatus {\n if (httpStatus < 400 && httpStatus >= 100) {\n return { code: SPAN_STATUS_OK };\n }\n\n if (httpStatus >= 400 && httpStatus < 500) {\n switch (httpStatus) {\n case 401:\n return { code: SPAN_STATUS_ERROR, message: 'unauthenticated' };\n case 403:\n return { code: SPAN_STATUS_ERROR, message: 'permission_denied' };\n case 404:\n return { code: SPAN_STATUS_ERROR, message: 'not_found' };\n case 409:\n return { code: SPAN_STATUS_ERROR, message: 'already_exists' };\n case 413:\n return { code: SPAN_STATUS_ERROR, message: 'failed_precondition' };\n case 429:\n return { code: SPAN_STATUS_ERROR, message: 'resource_exhausted' };\n case 499:\n return { code: SPAN_STATUS_ERROR, message: 'cancelled' };\n default:\n return { code: SPAN_STATUS_ERROR, message: 'invalid_argument' };\n }\n }\n\n if (httpStatus >= 500 && httpStatus < 600) {\n switch (httpStatus) {\n case 501:\n return { code: SPAN_STATUS_ERROR, message: 'unimplemented' };\n case 503:\n return { code: SPAN_STATUS_ERROR, message: 'unavailable' };\n case 504:\n return { code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' };\n default:\n return { code: SPAN_STATUS_ERROR, message: 'internal_error' };\n }\n }\n\n return { code: SPAN_STATUS_ERROR, message: 'internal_error' };\n}\n\n/**\n * Sets the Http status attributes on the current span based on the http code.\n * Additionally, the span's status is updated, depending on the http code.\n */\nexport function setHttpStatus(span: Span, httpStatus: number): void {\n span.setAttribute('http.response.status_code', httpStatus);\n\n const spanStatus = getSpanStatusFromHttpCode(httpStatus);\n if (spanStatus.message !== 'unknown_error') {\n span.setStatus(spanStatus);\n }\n}\n"],"names":[],"mappings":"AAGO,MAAM,iBAAA,GAAoB;AAC1B,MAAM,cAAA,GAAiB;AACvB,MAAM,iBAAA,GAAoB;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,yBAAyB,CAAC,UAAU,EAAsB;AAC1E,EAAE,IAAI,UAAA,GAAa,OAAO,UAAA,IAAc,GAAG,EAAE;AAC7C,IAAI,OAAO,EAAE,IAAI,EAAE,gBAAgB;AACnC,EAAE;;AAEF,EAAE,IAAI,UAAA,IAAc,OAAO,UAAA,GAAa,GAAG,EAAE;AAC7C,IAAI,QAAQ,UAAU;AACtB,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,iBAAA,EAAmB;AACtE,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,mBAAA,EAAqB;AACxE,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAA,EAAa;AAChE,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAA,EAAkB;AACrE,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,qBAAA,EAAuB;AAC1E,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,oBAAA,EAAsB;AACzE,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAA,EAAa;AAChE,MAAM;AACN,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,kBAAA,EAAoB;AACvE;AACA,EAAE;;AAEF,EAAE,IAAI,UAAA,IAAc,OAAO,UAAA,GAAa,GAAG,EAAE;AAC7C,IAAI,QAAQ,UAAU;AACtB,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,eAAA,EAAiB;AACpE,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAA,EAAe;AAClE,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,mBAAA,EAAqB;AACxE,MAAM;AACN,QAAQ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAA,EAAkB;AACrE;AACA,EAAE;;AAEF,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAA,EAAkB;AAC/D;;AAEA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,IAAI,EAAQ,UAAU,EAAgB;AACpE,EAAE,IAAI,CAAC,YAAY,CAAC,2BAA2B,EAAE,UAAU,CAAC;;AAE5D,EAAE,MAAM,UAAA,GAAa,yBAAyB,CAAC,UAAU,CAAC;AAC1D,EAAE,IAAI,UAAU,CAAC,OAAA,KAAY,eAAe,EAAE;AAC9C,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;AAC9B,EAAE;AACF;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,YAAY,CAAA;AAM3D,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,SAAS,CAsE7C,CAAA"}

View File

@@ -0,0 +1,67 @@
/// <reference lib="esnext"/>
// TODO: This can just be `export type Primitive = not object` when the `not` keyword is out.
/**
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
*/
export type Primitive =
| null
| undefined
| string
| number
| boolean
| symbol
| bigint;
// TODO: Remove the `= unknown` sometime in the future when most users are on TS 3.5 as it's now the default
/**
Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
*/
export type Class<T = unknown, Arguments extends any[] = any[]> = new(...arguments_: Arguments) => T;
/**
Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
*/
export type TypedArray =
| Int8Array
| Uint8Array
| Uint8ClampedArray
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Float32Array
| Float64Array
| BigInt64Array
| BigUint64Array;
/**
Matches a JSON object.
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
*/
export type JsonObject = {[key: string]: JsonValue};
/**
Matches a JSON array.
*/
export interface JsonArray extends Array<JsonValue> {}
/**
Matches any valid JSON value.
*/
export type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
declare global {
interface SymbolConstructor {
readonly observable: symbol;
}
}
/**
Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).
*/
export interface ObservableLike {
subscribe(observer: (value: unknown) => void): void;
[Symbol.observable](): ObservableLike;
}

View File

@@ -0,0 +1,10 @@
import type { InitReqResult } from '../../index.js';
export declare enum EntityType {
collection = "collections",
global = "globals"
}
export type WidgetServerProps = {
widgetData?: Record<string, unknown>;
widgetSlug: string;
} & Pick<InitReqResult, 'cookies' | 'locale' | 'permissions' | 'req'>;
//# sourceMappingURL=dashboard.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"piano.js","sources":["../../../src/icons/piano.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Piano\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTguNSA4Yy0xLjQgMC0yLjYtLjgtMy4yLTJBNi44NyA2Ljg3IDAgMCAwIDIgOXYxMWEyIDIgMCAwIDAgMiAyaDE2YTIgMiAwIDAgMCAyLTJ2LTguNUMyMiA5LjYgMjAuNCA4IDE4LjUgOCIgLz4KICA8cGF0aCBkPSJNMiAxNGgyMCIgLz4KICA8cGF0aCBkPSJNNiAxNHY0IiAvPgogIDxwYXRoIGQ9Ik0xMCAxNHY0IiAvPgogIDxwYXRoIGQ9Ik0xNCAxNHY0IiAvPgogIDxwYXRoIGQ9Ik0xOCAxNHY0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/piano\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Piano = createLucideIcon('Piano', [\n [\n 'path',\n {\n d: 'M18.5 8c-1.4 0-2.6-.8-3.2-2A6.87 6.87 0 0 0 2 9v11a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-8.5C22 9.6 20.4 8 18.5 8',\n key: 'lag0yf',\n },\n ],\n ['path', { d: 'M2 14h20', key: 'myj16y' }],\n ['path', { d: 'M6 14v4', key: '9ng0ue' }],\n ['path', { d: 'M10 14v4', key: '1v8uk5' }],\n ['path', { d: 'M14 14v4', key: '1tqops' }],\n ['path', { d: 'M18 14v4', key: '18uqwm' }],\n]);\n\nexport default Piano;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CACtC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,102 @@
@import '../../../scss/styles.scss';
@layer payload-default {
.blocks-drawer {
&__blocks-wrapper {
padding-top: base(1.5);
}
&__blocks {
position: relative;
padding: 0;
list-style: none;
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: base(1);
}
&__default-image {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
aspect-ratio: 3 / 2;
overflow: hidden;
img,
svg {
width: 100%;
height: 100%;
object-fit: cover;
}
}
&__block-groups {
padding: 0;
display: flex;
flex-direction: column;
gap: base(1.5);
}
&__block-group {
list-style: none;
}
&__block-group-label {
padding-bottom: base(0.5);
}
&__block-group-none {
order: 1;
padding-top: base(1.5);
border-top: 1px solid var(--theme-border-color);
&:only-child {
padding-top: 0;
border-top: 0;
}
}
@include large-break {
&__blocks {
grid-template-columns: repeat(5, 1fr);
}
}
@include mid-break {
&__blocks-wrapper {
padding-top: base(1.75);
}
&__blocks {
grid-template-columns: repeat(3, 1fr);
}
&__block-groups {
gap: base(1.75);
}
&__block-group-none {
padding-top: base(1.75);
}
}
@include small-break {
&__blocks-wrapper {
padding-top: base(0.75);
}
&__blocks {
grid-template-columns: repeat(2, 1fr);
}
&__block-groups {
gap: base(0.75);
}
&__block-group-none {
padding-top: base(0.75);
}
}
}
}

View File

@@ -0,0 +1 @@
import{r}from"./get-pipe-path-BHW2eJdv.mjs";import{globalPreload as w,initialize as y,load as A,resolve as B}from"./esm/index.mjs";import"module";import"node:path";import"./temporary-directory-CwHp0_NW.mjs";import"node:os";import"node:worker_threads";import"./node-features-_8ZFwP_x.mjs";import"./register-B7jrtLTO.mjs";import"node:module";import"./register-CFH5oNdT.mjs";import"node:url";import"get-tsconfig";import"node:fs";import"./index-7AaEi15b.mjs";import"esbuild";import"node:crypto";import"./client-BQVF1NaW.mjs";import"node:net";import"node:util";import"./index-gbaejti9.mjs";import"./require-DQxpCAr4.mjs";import"node:fs/promises";r("./cjs/index.cjs");export{w as globalPreload,y as initialize,A as load,B as resolve};

View File

@@ -0,0 +1,812 @@
function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}function _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 (_window$dateFns) {var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/be/_lib/formatDistance.mjs
var declension = function declension(scheme, count) {
if (scheme.one !== undefined && count === 1) {
return scheme.one;
}
var rem10 = count % 10;
var rem100 = count % 100;
if (rem10 === 1 && rem100 !== 11) {
return scheme.singularNominative.replace("{{count}}", String(count));
} else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) {
return scheme.singularGenitive.replace("{{count}}", String(count));
} else {
return scheme.pluralGenitive.replace("{{count}}", String(count));
}
};
var buildLocalizeTokenFn = function buildLocalizeTokenFn(scheme) {
return function (count, options) {
if (options && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
if (scheme.future) {
return declension(scheme.future, count);
} else {
return "\u043F\u0440\u0430\u0437 " + declension(scheme.regular, count);
}
} else {
if (scheme.past) {
return declension(scheme.past, count);
} else {
return declension(scheme.regular, count) + " \u0442\u0430\u043C\u0443";
}
}
} else {
return declension(scheme.regular, count);
}
};
};
var halfAMinute = function halfAMinute(_, options) {
if (options && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "\u043F\u0440\u0430\u0437 \u043F\u0430\u045E\u0445\u0432\u0456\u043B\u0456\u043D\u044B";
} else {
return "\u043F\u0430\u045E\u0445\u0432\u0456\u043B\u0456\u043D\u044B \u0442\u0430\u043C\u0443";
}
}
return "\u043F\u0430\u045E\u0445\u0432\u0456\u043B\u0456\u043D\u044B";
};
var formatDistanceLocale = {
lessThanXSeconds: buildLocalizeTokenFn({
regular: {
one: "\u043C\u0435\u043D\u0448 \u0437\u0430 \u0441\u0435\u043A\u0443\u043D\u0434\u0443",
singularNominative: "\u043C\u0435\u043D\u0448 \u0437\u0430 {{count}} \u0441\u0435\u043A\u0443\u043D\u0434\u0443",
singularGenitive: "\u043C\u0435\u043D\u0448 \u0437\u0430 {{count}} \u0441\u0435\u043A\u0443\u043D\u0434\u044B",
pluralGenitive: "\u043C\u0435\u043D\u0448 \u0437\u0430 {{count}} \u0441\u0435\u043A\u0443\u043D\u0434"
},
future: {
one: "\u043C\u0435\u043D\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 \u0441\u0435\u043A\u0443\u043D\u0434\u0443",
singularNominative: "\u043C\u0435\u043D\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 {{count}} \u0441\u0435\u043A\u0443\u043D\u0434\u0443",
singularGenitive: "\u043C\u0435\u043D\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 {{count}} \u0441\u0435\u043A\u0443\u043D\u0434\u044B",
pluralGenitive: "\u043C\u0435\u043D\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 {{count}} \u0441\u0435\u043A\u0443\u043D\u0434"
}
}),
xSeconds: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} \u0441\u0435\u043A\u0443\u043D\u0434\u0430",
singularGenitive: "{{count}} \u0441\u0435\u043A\u0443\u043D\u0434\u044B",
pluralGenitive: "{{count}} \u0441\u0435\u043A\u0443\u043D\u0434"
},
past: {
singularNominative: "{{count}} \u0441\u0435\u043A\u0443\u043D\u0434\u0443 \u0442\u0430\u043C\u0443",
singularGenitive: "{{count}} \u0441\u0435\u043A\u0443\u043D\u0434\u044B \u0442\u0430\u043C\u0443",
pluralGenitive: "{{count}} \u0441\u0435\u043A\u0443\u043D\u0434 \u0442\u0430\u043C\u0443"
},
future: {
singularNominative: "\u043F\u0440\u0430\u0437 {{count}} \u0441\u0435\u043A\u0443\u043D\u0434\u0443",
singularGenitive: "\u043F\u0440\u0430\u0437 {{count}} \u0441\u0435\u043A\u0443\u043D\u0434\u044B",
pluralGenitive: "\u043F\u0440\u0430\u0437 {{count}} \u0441\u0435\u043A\u0443\u043D\u0434"
}
}),
halfAMinute: halfAMinute,
lessThanXMinutes: buildLocalizeTokenFn({
regular: {
one: "\u043C\u0435\u043D\u0448 \u0437\u0430 \u0445\u0432\u0456\u043B\u0456\u043D\u0443",
singularNominative: "\u043C\u0435\u043D\u0448 \u0437\u0430 {{count}} \u0445\u0432\u0456\u043B\u0456\u043D\u0443",
singularGenitive: "\u043C\u0435\u043D\u0448 \u0437\u0430 {{count}} \u0445\u0432\u0456\u043B\u0456\u043D\u044B",
pluralGenitive: "\u043C\u0435\u043D\u0448 \u0437\u0430 {{count}} \u0445\u0432\u0456\u043B\u0456\u043D"
},
future: {
one: "\u043C\u0435\u043D\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 \u0445\u0432\u0456\u043B\u0456\u043D\u0443",
singularNominative: "\u043C\u0435\u043D\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 {{count}} \u0445\u0432\u0456\u043B\u0456\u043D\u0443",
singularGenitive: "\u043C\u0435\u043D\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 {{count}} \u0445\u0432\u0456\u043B\u0456\u043D\u044B",
pluralGenitive: "\u043C\u0435\u043D\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 {{count}} \u0445\u0432\u0456\u043B\u0456\u043D"
}
}),
xMinutes: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} \u0445\u0432\u0456\u043B\u0456\u043D\u0430",
singularGenitive: "{{count}} \u0445\u0432\u0456\u043B\u0456\u043D\u044B",
pluralGenitive: "{{count}} \u0445\u0432\u0456\u043B\u0456\u043D"
},
past: {
singularNominative: "{{count}} \u0445\u0432\u0456\u043B\u0456\u043D\u0443 \u0442\u0430\u043C\u0443",
singularGenitive: "{{count}} \u0445\u0432\u0456\u043B\u0456\u043D\u044B \u0442\u0430\u043C\u0443",
pluralGenitive: "{{count}} \u0445\u0432\u0456\u043B\u0456\u043D \u0442\u0430\u043C\u0443"
},
future: {
singularNominative: "\u043F\u0440\u0430\u0437 {{count}} \u0445\u0432\u0456\u043B\u0456\u043D\u0443",
singularGenitive: "\u043F\u0440\u0430\u0437 {{count}} \u0445\u0432\u0456\u043B\u0456\u043D\u044B",
pluralGenitive: "\u043F\u0440\u0430\u0437 {{count}} \u0445\u0432\u0456\u043B\u0456\u043D"
}
}),
aboutXHours: buildLocalizeTokenFn({
regular: {
singularNominative: "\u043A\u0430\u043B\u044F {{count}} \u0433\u0430\u0434\u0437\u0456\u043D\u044B",
singularGenitive: "\u043A\u0430\u043B\u044F {{count}} \u0433\u0430\u0434\u0437\u0456\u043D",
pluralGenitive: "\u043A\u0430\u043B\u044F {{count}} \u0433\u0430\u0434\u0437\u0456\u043D"
},
future: {
singularNominative: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u0437\u0456\u043D\u0443",
singularGenitive: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u0437\u0456\u043D\u044B",
pluralGenitive: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u0437\u0456\u043D"
}
}),
xHours: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} \u0433\u0430\u0434\u0437\u0456\u043D\u0430",
singularGenitive: "{{count}} \u0433\u0430\u0434\u0437\u0456\u043D\u044B",
pluralGenitive: "{{count}} \u0433\u0430\u0434\u0437\u0456\u043D"
},
past: {
singularNominative: "{{count}} \u0433\u0430\u0434\u0437\u0456\u043D\u0443 \u0442\u0430\u043C\u0443",
singularGenitive: "{{count}} \u0433\u0430\u0434\u0437\u0456\u043D\u044B \u0442\u0430\u043C\u0443",
pluralGenitive: "{{count}} \u0433\u0430\u0434\u0437\u0456\u043D \u0442\u0430\u043C\u0443"
},
future: {
singularNominative: "\u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u0437\u0456\u043D\u0443",
singularGenitive: "\u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u0437\u0456\u043D\u044B",
pluralGenitive: "\u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u0437\u0456\u043D"
}
}),
xDays: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} \u0434\u0437\u0435\u043D\u044C",
singularGenitive: "{{count}} \u0434\u043D\u0456",
pluralGenitive: "{{count}} \u0434\u0437\u0451\u043D"
}
}),
aboutXWeeks: buildLocalizeTokenFn({
regular: {
singularNominative: "\u043A\u0430\u043B\u044F {{count}} \u0442\u044B\u0434\u043D\u0456",
singularGenitive: "\u043A\u0430\u043B\u044F {{count}} \u0442\u044B\u0434\u043D\u044F\u045E",
pluralGenitive: "\u043A\u0430\u043B\u044F {{count}} \u0442\u044B\u0434\u043D\u044F\u045E"
},
future: {
singularNominative: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u0442\u044B\u0434\u0437\u0435\u043D\u044C",
singularGenitive: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u0442\u044B\u0434\u043D\u0456",
pluralGenitive: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u0442\u044B\u0434\u043D\u044F\u045E"
}
}),
xWeeks: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} \u0442\u044B\u0434\u0437\u0435\u043D\u044C",
singularGenitive: "{{count}} \u0442\u044B\u0434\u043D\u0456",
pluralGenitive: "{{count}} \u0442\u044B\u0434\u043D\u044F\u045E"
}
}),
aboutXMonths: buildLocalizeTokenFn({
regular: {
singularNominative: "\u043A\u0430\u043B\u044F {{count}} \u043C\u0435\u0441\u044F\u0446\u0430",
singularGenitive: "\u043A\u0430\u043B\u044F {{count}} \u043C\u0435\u0441\u044F\u0446\u0430\u045E",
pluralGenitive: "\u043A\u0430\u043B\u044F {{count}} \u043C\u0435\u0441\u044F\u0446\u0430\u045E"
},
future: {
singularNominative: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u043C\u0435\u0441\u044F\u0446",
singularGenitive: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u043C\u0435\u0441\u044F\u0446\u044B",
pluralGenitive: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u043C\u0435\u0441\u044F\u0446\u0430\u045E"
}
}),
xMonths: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} \u043C\u0435\u0441\u044F\u0446",
singularGenitive: "{{count}} \u043C\u0435\u0441\u044F\u0446\u044B",
pluralGenitive: "{{count}} \u043C\u0435\u0441\u044F\u0446\u0430\u045E"
}
}),
aboutXYears: buildLocalizeTokenFn({
regular: {
singularNominative: "\u043A\u0430\u043B\u044F {{count}} \u0433\u043E\u0434\u0430",
singularGenitive: "\u043A\u0430\u043B\u044F {{count}} \u0433\u0430\u0434\u043E\u045E",
pluralGenitive: "\u043A\u0430\u043B\u044F {{count}} \u0433\u0430\u0434\u043E\u045E"
},
future: {
singularNominative: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u0433\u043E\u0434",
singularGenitive: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u044B",
pluralGenitive: "\u043F\u0440\u044B\u0431\u043B\u0456\u0437\u043D\u0430 \u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u043E\u045E"
}
}),
xYears: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} \u0433\u043E\u0434",
singularGenitive: "{{count}} \u0433\u0430\u0434\u044B",
pluralGenitive: "{{count}} \u0433\u0430\u0434\u043E\u045E"
}
}),
overXYears: buildLocalizeTokenFn({
regular: {
singularNominative: "\u0431\u043E\u043B\u044C\u0448 \u0437\u0430 {{count}} \u0433\u043E\u0434",
singularGenitive: "\u0431\u043E\u043B\u044C\u0448 \u0437\u0430 {{count}} \u0433\u0430\u0434\u044B",
pluralGenitive: "\u0431\u043E\u043B\u044C\u0448 \u0437\u0430 {{count}} \u0433\u0430\u0434\u043E\u045E"
},
future: {
singularNominative: "\u0431\u043E\u043B\u044C\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 {{count}} \u0433\u043E\u0434",
singularGenitive: "\u0431\u043E\u043B\u044C\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u044B",
pluralGenitive: "\u0431\u043E\u043B\u044C\u0448, \u0447\u044B\u043C \u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u043E\u045E"
}
}),
almostXYears: buildLocalizeTokenFn({
regular: {
singularNominative: "\u0430\u043C\u0430\u043B\u044C {{count}} \u0433\u043E\u0434",
singularGenitive: "\u0430\u043C\u0430\u043B\u044C {{count}} \u0433\u0430\u0434\u044B",
pluralGenitive: "\u0430\u043C\u0430\u043B\u044C {{count}} \u0433\u0430\u0434\u043E\u045E"
},
future: {
singularNominative: "\u0430\u043C\u0430\u043B\u044C \u043F\u0440\u0430\u0437 {{count}} \u0433\u043E\u0434",
singularGenitive: "\u0430\u043C\u0430\u043B\u044C \u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u044B",
pluralGenitive: "\u0430\u043C\u0430\u043B\u044C \u043F\u0440\u0430\u0437 {{count}} \u0433\u0430\u0434\u043E\u045E"
}
})
};
var formatDistance = function formatDistance(token, count, options) {
options = options || {};
return formatDistanceLocale[token](count, options);
};
// lib/locale/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/be/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE, d MMMM y '\u0433.'",
long: "d MMMM y '\u0433.'",
medium: "d MMM y '\u0433.'",
short: "dd.MM.y"
};
var timeFormats = {
full: "H:mm:ss zzzz",
long: "H:mm:ss z",
medium: "H:mm:ss",
short: "H:mm"
};
var dateTimeFormats = {
any: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "any"
})
};
// lib/toDate.mjs
function toDate(argument) {
var argStr = Object.prototype.toString.call(argument);
if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
return new argument.constructor(+argument);
} else if (typeof argument === "number" || argStr === "[object Number]" || typeof argument === "string" || argStr === "[object String]") {
return new Date(argument);
} else {
return new Date(NaN);
}
}
// lib/_lib/defaultOptions.mjs
function getDefaultOptions() {
return defaultOptions;
}
function setDefaultOptions(newOptions) {
defaultOptions = newOptions;
}
var defaultOptions = {};
// lib/startOfWeek.mjs
function startOfWeek(date, options) {var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _defaultOptions3$loca;
var defaultOptions3 = getDefaultOptions();
var weekStartsOn = (_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 || (_options$locale = options.locale) === null || _options$locale === void 0 || (_options$locale = _options$locale.options) === null || _options$locale === void 0 ? void 0 : _options$locale.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions3$loca = defaultOptions3.locale) === null || _defaultOptions3$loca === void 0 || (_defaultOptions3$loca = _defaultOptions3$loca.options) === null || _defaultOptions3$loca === void 0 ? void 0 : _defaultOptions3$loca.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0;
var _date = toDate(date);
var day = _date.getDay();
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
_date.setDate(_date.getDate() - diff);
_date.setHours(0, 0, 0, 0);
return _date;
}
// lib/isSameWeek.mjs
function isSameWeek(dateLeft, dateRight, options) {
var dateLeftStartOfWeek = startOfWeek(dateLeft, options);
var dateRightStartOfWeek = startOfWeek(dateRight, options);
return +dateLeftStartOfWeek === +dateRightStartOfWeek;
}
// lib/locale/be/_lib/formatRelative.mjs
var lastWeek = function lastWeek(day) {
var weekday = accusativeWeekdays[day];
switch (day) {
case 0:
case 3:
case 5:
case 6:
return "'\u0443 \u043C\u0456\u043D\u0443\u043B\u0443\u044E " + weekday + " \u0430' p";
case 1:
case 2:
case 4:
return "'\u0443 \u043C\u0456\u043D\u0443\u043B\u044B " + weekday + " \u0430' p";
}
};
var thisWeek = function thisWeek(day) {
var weekday = accusativeWeekdays[day];
return "'\u0443 " + weekday + " \u0430' p";
};
var nextWeek = function nextWeek(day) {
var weekday = accusativeWeekdays[day];
switch (day) {
case 0:
case 3:
case 5:
case 6:
return "'\u0443 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0443\u044E " + weekday + " \u0430' p";
case 1:
case 2:
case 4:
return "'\u0443 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u044B " + weekday + " \u0430' p";
}
};
var accusativeWeekdays = [
"\u043D\u044F\u0434\u0437\u0435\u043B\u044E",
"\u043F\u0430\u043D\u044F\u0434\u0437\u0435\u043B\u0430\u043A",
"\u0430\u045E\u0442\u043E\u0440\u0430\u043A",
"\u0441\u0435\u0440\u0430\u0434\u0443",
"\u0447\u0430\u0446\u0432\u0435\u0440",
"\u043F\u044F\u0442\u043D\u0456\u0446\u0443",
"\u0441\u0443\u0431\u043E\u0442\u0443"];
var lastWeekFormat = function lastWeekFormat(dirtyDate, baseDate, options) {
var date = toDate(dirtyDate);
var day = date.getDay();
if (isSameWeek(date, baseDate, options)) {
return thisWeek(day);
} else {
return lastWeek(day);
}
};
var nextWeekFormat = function nextWeekFormat(dirtyDate, baseDate, options) {
var date = toDate(dirtyDate);
var day = date.getDay();
if (isSameWeek(date, baseDate, options)) {
return thisWeek(day);
} else {
return nextWeek(day);
}
};
var formatRelativeLocale = {
lastWeek: lastWeekFormat,
yesterday: "'\u0443\u0447\u043E\u0440\u0430 \u0430' p",
today: "'\u0441\u0451\u043D\u043D\u044F \u0430' p",
tomorrow: "'\u0437\u0430\u045E\u0442\u0440\u0430 \u0430' p",
nextWeek: nextWeekFormat,
other: "P"
};
var formatRelative = function formatRelative(token, date, baseDate, options) {
var format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date, baseDate, options);
}
return format;
};
// lib/locale/_lib/buildLocalizeFn.mjs
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/be/_lib/localize.mjs
var eraValues = {
narrow: ["\u0434\u0430 \u043D.\u044D.", "\u043D.\u044D."],
abbreviated: ["\u0434\u0430 \u043D. \u044D.", "\u043D. \u044D."],
wide: ["\u0434\u0430 \u043D\u0430\u0448\u0430\u0439 \u044D\u0440\u044B", "\u043D\u0430\u0448\u0430\u0439 \u044D\u0440\u044B"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-\u044B \u043A\u0432.", "2-\u0456 \u043A\u0432.", "3-\u0456 \u043A\u0432.", "4-\u044B \u043A\u0432."],
wide: ["1-\u044B \u043A\u0432\u0430\u0440\u0442\u0430\u043B", "2-\u0456 \u043A\u0432\u0430\u0440\u0442\u0430\u043B", "3-\u0456 \u043A\u0432\u0430\u0440\u0442\u0430\u043B", "4-\u044B \u043A\u0432\u0430\u0440\u0442\u0430\u043B"]
};
var monthValues = {
narrow: ["\u0421", "\u041B", "\u0421", "\u041A", "\u041C", "\u0427", "\u041B", "\u0416", "\u0412", "\u041A", "\u041B", "\u0421"],
abbreviated: [
"\u0441\u0442\u0443\u0434\u0437.",
"\u043B\u044E\u0442.",
"\u0441\u0430\u043A.",
"\u043A\u0440\u0430\u0441.",
"\u043C\u0430\u0439",
"\u0447\u044D\u0440\u0432.",
"\u043B\u0456\u043F.",
"\u0436\u043D.",
"\u0432\u0435\u0440.",
"\u043A\u0430\u0441\u0442\u0440.",
"\u043B\u0456\u0441\u0442.",
"\u0441\u043D\u0435\u0436."],
wide: [
"\u0441\u0442\u0443\u0434\u0437\u0435\u043D\u044C",
"\u043B\u044E\u0442\u044B",
"\u0441\u0430\u043A\u0430\u0432\u0456\u043A",
"\u043A\u0440\u0430\u0441\u0430\u0432\u0456\u043A",
"\u043C\u0430\u0439",
"\u0447\u044D\u0440\u0432\u0435\u043D\u044C",
"\u043B\u0456\u043F\u0435\u043D\u044C",
"\u0436\u043D\u0456\u0432\u0435\u043D\u044C",
"\u0432\u0435\u0440\u0430\u0441\u0435\u043D\u044C",
"\u043A\u0430\u0441\u0442\u0440\u044B\u0447\u043D\u0456\u043A",
"\u043B\u0456\u0441\u0442\u0430\u043F\u0430\u0434",
"\u0441\u043D\u0435\u0436\u0430\u043D\u044C"]
};
var formattingMonthValues = {
narrow: ["\u0421", "\u041B", "\u0421", "\u041A", "\u041C", "\u0427", "\u041B", "\u0416", "\u0412", "\u041A", "\u041B", "\u0421"],
abbreviated: [
"\u0441\u0442\u0443\u0434\u0437.",
"\u043B\u044E\u0442.",
"\u0441\u0430\u043A.",
"\u043A\u0440\u0430\u0441.",
"\u043C\u0430\u044F",
"\u0447\u044D\u0440\u0432.",
"\u043B\u0456\u043F.",
"\u0436\u043D.",
"\u0432\u0435\u0440.",
"\u043A\u0430\u0441\u0442\u0440.",
"\u043B\u0456\u0441\u0442.",
"\u0441\u043D\u0435\u0436."],
wide: [
"\u0441\u0442\u0443\u0434\u0437\u0435\u043D\u044F",
"\u043B\u044E\u0442\u0430\u0433\u0430",
"\u0441\u0430\u043A\u0430\u0432\u0456\u043A\u0430",
"\u043A\u0440\u0430\u0441\u0430\u0432\u0456\u043A\u0430",
"\u043C\u0430\u044F",
"\u0447\u044D\u0440\u0432\u0435\u043D\u044F",
"\u043B\u0456\u043F\u0435\u043D\u044F",
"\u0436\u043D\u0456\u045E\u043D\u044F",
"\u0432\u0435\u0440\u0430\u0441\u043D\u044F",
"\u043A\u0430\u0441\u0442\u0440\u044B\u0447\u043D\u0456\u043A\u0430",
"\u043B\u0456\u0441\u0442\u0430\u043F\u0430\u0434\u0430",
"\u0441\u043D\u0435\u0436\u043D\u044F"]
};
var dayValues = {
narrow: ["\u041D", "\u041F", "\u0410", "\u0421", "\u0427", "\u041F", "\u0421"],
short: ["\u043D\u0434", "\u043F\u043D", "\u0430\u045E", "\u0441\u0440", "\u0447\u0446", "\u043F\u0442", "\u0441\u0431"],
abbreviated: ["\u043D\u044F\u0434\u0437", "\u043F\u0430\u043D", "\u0430\u045E\u0442", "\u0441\u0435\u0440", "\u0447\u0430\u0446", "\u043F\u044F\u0442", "\u0441\u0443\u0431"],
wide: [
"\u043D\u044F\u0434\u0437\u0435\u043B\u044F",
"\u043F\u0430\u043D\u044F\u0434\u0437\u0435\u043B\u0430\u043A",
"\u0430\u045E\u0442\u043E\u0440\u0430\u043A",
"\u0441\u0435\u0440\u0430\u0434\u0430",
"\u0447\u0430\u0446\u0432\u0435\u0440",
"\u043F\u044F\u0442\u043D\u0456\u0446\u0430",
"\u0441\u0443\u0431\u043E\u0442\u0430"]
};
var dayPeriodValues = {
narrow: {
am: "\u0414\u041F",
pm: "\u041F\u041F",
midnight: "\u043F\u043E\u045E\u043D.",
noon: "\u043F\u043E\u045E\u0434.",
morning: "\u0440\u0430\u043D.",
afternoon: "\u0434\u0437\u0435\u043D\u044C",
evening: "\u0432\u0435\u0447.",
night: "\u043D\u043E\u0447"
},
abbreviated: {
am: "\u0414\u041F",
pm: "\u041F\u041F",
midnight: "\u043F\u043E\u045E\u043D.",
noon: "\u043F\u043E\u045E\u0434.",
morning: "\u0440\u0430\u043D.",
afternoon: "\u0434\u0437\u0435\u043D\u044C",
evening: "\u0432\u0435\u0447.",
night: "\u043D\u043E\u0447"
},
wide: {
am: "\u0414\u041F",
pm: "\u041F\u041F",
midnight: "\u043F\u043E\u045E\u043D\u0430\u0447",
noon: "\u043F\u043E\u045E\u0434\u0437\u0435\u043D\u044C",
morning: "\u0440\u0430\u043D\u0456\u0446\u0430",
afternoon: "\u0434\u0437\u0435\u043D\u044C",
evening: "\u0432\u0435\u0447\u0430\u0440",
night: "\u043D\u043E\u0447"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "\u0414\u041F",
pm: "\u041F\u041F",
midnight: "\u043F\u043E\u045E\u043D.",
noon: "\u043F\u043E\u045E\u0434.",
morning: "\u0440\u0430\u043D.",
afternoon: "\u0434\u043D\u044F",
evening: "\u0432\u0435\u0447.",
night: "\u043D\u043E\u0447\u044B"
},
abbreviated: {
am: "\u0414\u041F",
pm: "\u041F\u041F",
midnight: "\u043F\u043E\u045E\u043D.",
noon: "\u043F\u043E\u045E\u0434.",
morning: "\u0440\u0430\u043D.",
afternoon: "\u0434\u043D\u044F",
evening: "\u0432\u0435\u0447.",
night: "\u043D\u043E\u0447\u044B"
},
wide: {
am: "\u0414\u041F",
pm: "\u041F\u041F",
midnight: "\u043F\u043E\u045E\u043D\u0430\u0447",
noon: "\u043F\u043E\u045E\u0434\u0437\u0435\u043D\u044C",
morning: "\u0440\u0430\u043D\u0456\u0446\u044B",
afternoon: "\u0434\u043D\u044F",
evening: "\u0432\u0435\u0447\u0430\u0440\u0430",
night: "\u043D\u043E\u0447\u044B"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, options) {
var unit = String(options === null || options === void 0 ? void 0 : options.unit);
var number = Number(dirtyNumber);
var suffix;
if (unit === "date") {
suffix = "-\u0433\u0430";
} else if (unit === "hour" || unit === "minute" || unit === "second") {
suffix = "-\u044F";
} else {
suffix = (number % 10 === 2 || number % 10 === 3) && number % 100 !== 12 && number % 100 !== 13 ? "-\u0456" : "-\u044B";
}
return number + suffix;
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "any",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.mjs
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
var findKey = function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
};
var findIndex = function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
};
// lib/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/be/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)(-?(е|я|га|і|ы|ае|ая|яя|шы|гі|ці|ты|мы))?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^((да )?н\.?\s?э\.?)/i,
abbreviated: /^((да )?н\.?\s?э\.?)/i,
wide: /^(да нашай эры|нашай эры|наша эра)/i
};
var parseEraPatterns = {
any: [/^д/i, /^н/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234](-?[ыі]?)? кв.?/i,
wide: /^[1234](-?[ыі]?)? квартал/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[слкмчжв]/i,
abbreviated: /^(студз|лют|сак|крас|ма[йя]|чэрв|ліп|жн|вер|кастр|ліст|снеж)\.?/i,
wide: /^(студзен[ья]|лют(ы|ага)|сакавіка?|красавіка?|ма[йя]|чэрвен[ья]|ліпен[ья]|жні(вень|ўня)|верас(ень|ня)|кастрычніка?|лістапада?|снеж(ань|ня))/i
};
var parseMonthPatterns = {
narrow: [
/^с/i,
/^л/i,
/^с/i,
/^к/i,
/^м/i,
/^ч/i,
/^л/i,
/^ж/i,
/^в/i,
/^к/i,
/^л/i,
/^с/i],
any: [
/^ст/i,
/^лю/i,
/^са/i,
/^кр/i,
/^ма/i,
/^ч/i,
/^ліп/i,
/^ж/i,
/^в/i,
/^ка/i,
/^ліс/i,
/^сн/i]
};
var matchDayPatterns = {
narrow: /^[нпасч]/i,
short: /^(нд|ня|пн|па|аў|ат|ср|се|чц|ча|пт|пя|сб|су)\.?/i,
abbreviated: /^(нядз?|ндз|пнд|пан|аўт|срд|сер|чцв|чац|птн|пят|суб).?/i,
wide: /^(нядзел[яі]|панядзел(ак|ка)|аўтор(ак|ка)|серад[аы]|чацв(ер|ярга)|пятніц[аы]|субот[аы])/i
};
var parseDayPatterns = {
narrow: [/^н/i, /^п/i, /^а/i, /^с/i, /^ч/i, /^п/i, /^с/i],
any: [/^н/i, /^п[ан]/i, /^а/i, /^с[ер]/i, /^ч/i, /^п[ят]/i, /^с[уб]/i]
};
var matchDayPeriodPatterns = {
narrow: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
abbreviated: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
wide: /^([дп]п|поўнач|поўдзень|раніц[аы]|дзень|дня|вечара?|ночы?)/i
};
var parseDayPeriodPatterns = {
any: {
am: /^дп/i,
pm: /^пп/i,
midnight: /^поўн/i,
noon: /^поўд/i,
morning: /^р/i,
afternoon: /^д[зн]/i,
evening: /^в/i,
night: /^н/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/be.mjs
var be = {
code: "be",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 1
}
};
// lib/locale/be/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
be: be }) });
//# debugId=9F1F6DB1B0C16D0464756e2164756e21
})();
//# sourceMappingURL=cdn.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ajv.js","sourceRoot":"","sources":["../lib/ajv.ts"],"names":[],"mappings":";;;AACA,iCAA4B;AAC5B,kDAAsD;AACtD,gEAAwD;AACxD,qEAAoE;AAEpE,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,MAAM,cAAc,GAAG,wCAAwC,CAAA;AAE/D,MAAa,GAAI,SAAQ,cAAO;IAC9B,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,gBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACxD,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,UAAU,CAAC,uBAAa,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAM;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK;YAChC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;YAC3D,CAAC,CAAC,gBAAgB,CAAA;QACpB,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,CAAC,CAAA;QACrD,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,cAAc,CAAA;IAC7D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AArBD,kBAqBC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;AACxB,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,GAAG,CAAA;AA0BlB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"}

View File

@@ -0,0 +1,7 @@
import type { UseDraggableArguments } from '@dnd-kit/core';
import React from 'react';
import type { ChildFunction } from './types.js';
export declare const DraggableSortableItem: React.FC<{
children: ChildFunction;
} & UseDraggableArguments>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,42 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
// https://www.unicode.org/cldr/charts/32/summary/sk.html?hide#1986
const dateFormats = {
full: "EEEE d. MMMM y",
long: "d. MMMM y",
medium: "d. M. y",
short: "d. M. y",
};
// https://www.unicode.org/cldr/charts/32/summary/sk.html?hide#2149
const timeFormats = {
full: "H:mm:ss zzzz",
long: "H:mm:ss z",
medium: "H:mm:ss",
short: "H:mm",
};
// https://www.unicode.org/cldr/charts/32/summary/sk.html?hide#1994
const dateTimeFormats = {
full: "{{date}}, {{time}}",
long: "{{date}}, {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

View File

@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './square-parking.js';
//# sourceMappingURL=parking-square.js.map

View File

@@ -0,0 +1,5 @@
export declare const lastDayOfYearWithOptions: import("./types.js").FPFn2<
Date,
import("../lastDayOfYear.js").LastDayOfYearOptions<Date> | undefined,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,4 @@
export declare const endOfWeek: import("./types.js").FPFn1<
Date,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,57 @@
"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);
var roles_exports = {};
__export(roles_exports, {
PgRole: () => PgRole,
pgRole: () => pgRole
});
module.exports = __toCommonJS(roles_exports);
var import_entity = require("../entity.cjs");
class PgRole {
constructor(name, config) {
this.name = name;
if (config) {
this.createDb = config.createDb;
this.createRole = config.createRole;
this.inherit = config.inherit;
}
}
static [import_entity.entityKind] = "PgRole";
/** @internal */
_existing;
/** @internal */
createDb;
/** @internal */
createRole;
/** @internal */
inherit;
existing() {
this._existing = true;
return this;
}
}
function pgRole(name, config) {
return new PgRole(name, config);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PgRole,
pgRole
});
//# sourceMappingURL=roles.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/pg-core/utils/array.ts"],"sourcesContent":["function parsePgArrayValue(arrayString: string, startFrom: number, inQuotes: boolean): [string, number] {\n\tfor (let i = startFrom; i < arrayString.length; i++) {\n\t\tconst char = arrayString[i];\n\n\t\tif (char === '\\\\') {\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === '\"') {\n\t\t\treturn [arrayString.slice(startFrom, i).replace(/\\\\/g, ''), i + 1];\n\t\t}\n\n\t\tif (inQuotes) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === ',' || char === '}') {\n\t\t\treturn [arrayString.slice(startFrom, i).replace(/\\\\/g, ''), i];\n\t\t}\n\t}\n\n\treturn [arrayString.slice(startFrom).replace(/\\\\/g, ''), arrayString.length];\n}\n\nexport function parsePgNestedArray(arrayString: string, startFrom = 0): [any[], number] {\n\tconst result: any[] = [];\n\tlet i = startFrom;\n\tlet lastCharIsComma = false;\n\n\twhile (i < arrayString.length) {\n\t\tconst char = arrayString[i];\n\n\t\tif (char === ',') {\n\t\t\tif (lastCharIsComma || i === startFrom) {\n\t\t\t\tresult.push('');\n\t\t\t}\n\t\t\tlastCharIsComma = true;\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tlastCharIsComma = false;\n\n\t\tif (char === '\\\\') {\n\t\t\ti += 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === '\"') {\n\t\t\tconst [value, startFrom] = parsePgArrayValue(arrayString, i + 1, true);\n\t\t\tresult.push(value);\n\t\t\ti = startFrom;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === '}') {\n\t\t\treturn [result, i + 1];\n\t\t}\n\n\t\tif (char === '{') {\n\t\t\tconst [value, startFrom] = parsePgNestedArray(arrayString, i + 1);\n\t\t\tresult.push(value);\n\t\t\ti = startFrom;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [value, newStartFrom] = parsePgArrayValue(arrayString, i, false);\n\t\tresult.push(value);\n\t\ti = newStartFrom;\n\t}\n\n\treturn [result, i];\n}\n\nexport function parsePgArray(arrayString: string): any[] {\n\tconst [result] = parsePgNestedArray(arrayString, 1);\n\treturn result;\n}\n\nexport function makePgArray(array: any[]): string {\n\treturn `{${\n\t\tarray.map((item) => {\n\t\t\tif (Array.isArray(item)) {\n\t\t\t\treturn makePgArray(item);\n\t\t\t}\n\n\t\t\tif (typeof item === 'string') {\n\t\t\t\treturn `\"${item.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')}\"`;\n\t\t\t}\n\n\t\t\treturn `${item}`;\n\t\t}).join(',')\n\t}}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,kBAAkB,aAAqB,WAAmB,UAAqC;AACvG,WAAS,IAAI,WAAW,IAAI,YAAY,QAAQ,KAAK;AACpD,UAAM,OAAO,YAAY,CAAC;AAE1B,QAAI,SAAS,MAAM;AAClB;AACA;AAAA,IACD;AAEA,QAAI,SAAS,KAAK;AACjB,aAAO,CAAC,YAAY,MAAM,WAAW,CAAC,EAAE,QAAQ,OAAO,EAAE,GAAG,IAAI,CAAC;AAAA,IAClE;AAEA,QAAI,UAAU;AACb;AAAA,IACD;AAEA,QAAI,SAAS,OAAO,SAAS,KAAK;AACjC,aAAO,CAAC,YAAY,MAAM,WAAW,CAAC,EAAE,QAAQ,OAAO,EAAE,GAAG,CAAC;AAAA,IAC9D;AAAA,EACD;AAEA,SAAO,CAAC,YAAY,MAAM,SAAS,EAAE,QAAQ,OAAO,EAAE,GAAG,YAAY,MAAM;AAC5E;AAEO,SAAS,mBAAmB,aAAqB,YAAY,GAAoB;AACvF,QAAM,SAAgB,CAAC;AACvB,MAAI,IAAI;AACR,MAAI,kBAAkB;AAEtB,SAAO,IAAI,YAAY,QAAQ;AAC9B,UAAM,OAAO,YAAY,CAAC;AAE1B,QAAI,SAAS,KAAK;AACjB,UAAI,mBAAmB,MAAM,WAAW;AACvC,eAAO,KAAK,EAAE;AAAA,MACf;AACA,wBAAkB;AAClB;AACA;AAAA,IACD;AAEA,sBAAkB;AAElB,QAAI,SAAS,MAAM;AAClB,WAAK;AACL;AAAA,IACD;AAEA,QAAI,SAAS,KAAK;AACjB,YAAM,CAACA,QAAOC,UAAS,IAAI,kBAAkB,aAAa,IAAI,GAAG,IAAI;AACrE,aAAO,KAAKD,MAAK;AACjB,UAAIC;AACJ;AAAA,IACD;AAEA,QAAI,SAAS,KAAK;AACjB,aAAO,CAAC,QAAQ,IAAI,CAAC;AAAA,IACtB;AAEA,QAAI,SAAS,KAAK;AACjB,YAAM,CAACD,QAAOC,UAAS,IAAI,mBAAmB,aAAa,IAAI,CAAC;AAChE,aAAO,KAAKD,MAAK;AACjB,UAAIC;AACJ;AAAA,IACD;AAEA,UAAM,CAAC,OAAO,YAAY,IAAI,kBAAkB,aAAa,GAAG,KAAK;AACrE,WAAO,KAAK,KAAK;AACjB,QAAI;AAAA,EACL;AAEA,SAAO,CAAC,QAAQ,CAAC;AAClB;AAEO,SAAS,aAAa,aAA4B;AACxD,QAAM,CAAC,MAAM,IAAI,mBAAmB,aAAa,CAAC;AAClD,SAAO;AACR;AAEO,SAAS,YAAY,OAAsB;AACjD,SAAO,IACN,MAAM,IAAI,CAAC,SAAS;AACnB,QAAI,MAAM,QAAQ,IAAI,GAAG;AACxB,aAAO,YAAY,IAAI;AAAA,IACxB;AAEA,QAAI,OAAO,SAAS,UAAU;AAC7B,aAAO,IAAI,KAAK,QAAQ,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAK,CAAC;AAAA,IAC5D;AAEA,WAAO,GAAG,IAAI;AAAA,EACf,CAAC,EAAE,KAAK,GAAG,CACZ;AACD;","names":["value","startFrom"]}

View File

@@ -0,0 +1,94 @@
(function () {
if (typeof Prism === 'undefined') {
return;
}
var autoLinkerProcess = function (grammar) {
if (Prism.plugins.autolinker) {
Prism.plugins.autolinker.processGrammar(grammar);
}
return grammar;
};
var dataURI = {
pattern: /(.)\bdata:[^\/]+\/[^,]+,(?:(?!\1)[\s\S]|\\\1)+(?=\1)/,
lookbehind: true,
inside: {
'language-css': {
pattern: /(data:[^\/]+\/(?:[^+,]+\+)?css,)[\s\S]+/,
lookbehind: true
},
'language-javascript': {
pattern: /(data:[^\/]+\/(?:[^+,]+\+)?javascript,)[\s\S]+/,
lookbehind: true
},
'language-json': {
pattern: /(data:[^\/]+\/(?:[^+,]+\+)?json,)[\s\S]+/,
lookbehind: true
},
'language-markup': {
pattern: /(data:[^\/]+\/(?:[^+,]+\+)?(?:html|xml),)[\s\S]+/,
lookbehind: true
}
}
};
// Tokens that may contain URLs
var candidates = ['url', 'attr-value', 'string'];
Prism.plugins.dataURIHighlight = {
processGrammar: function (grammar) {
// Abort if grammar has already been processed
if (!grammar || grammar['data-uri']) {
return;
}
Prism.languages.DFS(grammar, function (key, def, type) {
if (candidates.indexOf(type) > -1 && !Array.isArray(def)) {
if (!def.pattern) {
def = this[key] = {
pattern: def
};
}
def.inside = def.inside || {};
if (type == 'attr-value') {
Prism.languages.insertBefore('inside', def.inside['url-link'] ? 'url-link' : 'punctuation', {
'data-uri': dataURI
}, def);
} else {
if (def.inside['url-link']) {
Prism.languages.insertBefore('inside', 'url-link', {
'data-uri': dataURI
}, def);
} else {
def.inside['data-uri'] = dataURI;
}
}
}
});
grammar['data-uri'] = dataURI;
}
};
Prism.hooks.add('before-highlight', function (env) {
// Prepare the needed grammars for this code block
if (dataURI.pattern.test(env.code)) {
for (var p in dataURI.inside) {
if (dataURI.inside.hasOwnProperty(p)) {
if (!dataURI.inside[p].inside && dataURI.inside[p].pattern.test(env.code)) {
var lang = p.match(/^language-(.+)/)[1];
if (Prism.languages[lang]) {
dataURI.inside[p].inside = {
rest: autoLinkerProcess(Prism.languages[lang])
};
}
}
}
}
}
Prism.plugins.dataURIHighlight.processGrammar(env.grammar);
});
}());

View File

@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SunMoon = createLucideIcon("SunMoon", [
["path", { d: "M12 8a2.83 2.83 0 0 0 4 4 4 4 0 1 1-4-4", key: "1fu5g2" }],
["path", { d: "M12 2v2", key: "tus03m" }],
["path", { d: "M12 20v2", key: "1lh1kg" }],
["path", { d: "m4.9 4.9 1.4 1.4", key: "b9915j" }],
["path", { d: "m17.7 17.7 1.4 1.4", key: "qc3ed3" }],
["path", { d: "M2 12h2", key: "1t8f8n" }],
["path", { d: "M20 12h2", key: "1q8mjw" }],
["path", { d: "m6.3 17.7-1.4 1.4", key: "5gca6" }],
["path", { d: "m19.1 4.9-1.4 1.4", key: "wpu9u6" }]
]);
export { SunMoon as default };
//# sourceMappingURL=sun-moon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messages-square.js","sources":["../../../src/icons/messages-square.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessagesSquare\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTQgOWEyIDIgMCAwIDEtMiAySDZsLTQgNFY0YzAtMS4xLjktMiAyLTJoOGEyIDIgMCAwIDEgMiAyeiIgLz4KICA8cGF0aCBkPSJNMTggOWgyYTIgMiAwIDAgMSAyIDJ2MTFsLTQtNGgtNmEyIDIgMCAwIDEtMi0ydi0xIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/messages-square\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MessagesSquare = createLucideIcon('MessagesSquare', [\n ['path', { d: 'M14 9a2 2 0 0 1-2 2H6l-4 4V4c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2z', key: 'jj09z8' }],\n ['path', { d: 'M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1', key: '1cx29u' }],\n]);\n\nexport default MessagesSquare;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACpF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,27 @@
import { previousDay } from "./previousDay.mjs";
/**
* @name previousWednesday
* @category Weekday Helpers
* @summary When is the previous Wednesday?
*
* @description
* When is the previous Wednesday?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to start counting from
*
* @returns The previous Wednesday
*
* @example
* // When is the previous Wednesday before Jun, 18, 2021?
* const result = previousWednesday(new Date(2021, 5, 18))
* //=> Wed June 16 2021 00:00:00
*/
export function previousWednesday(date) {
return previousDay(date, 3);
}
// Fallback for modularized imports:
export default previousWednesday;

View File

@@ -0,0 +1,7 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/optimize/LimitChunkCountPlugin").LimitChunkCountPluginOptions) => boolean;
export = check;

View File

@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CloudCog = createLucideIcon("CloudCog", [
["circle", { cx: "12", cy: "17", r: "3", key: "1spfwm" }],
["path", { d: "M4.2 15.1A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2", key: "zaobp" }],
["path", { d: "m15.7 18.4-.9-.3", key: "4qxpbn" }],
["path", { d: "m9.2 15.9-.9-.3", key: "17q7o2" }],
["path", { d: "m10.6 20.7.3-.9", key: "1pf4s2" }],
["path", { d: "m13.1 14.2.3-.9", key: "1mnuqm" }],
["path", { d: "m13.6 20.7-.4-1", key: "1jpd1m" }],
["path", { d: "m10.8 14.3-.4-1", key: "17ugyy" }],
["path", { d: "m8.3 18.6 1-.4", key: "s42vdx" }],
["path", { d: "m14.7 15.8 1-.4", key: "2wizun" }]
]);
export { CloudCog as default };
//# sourceMappingURL=cloud-cog.js.map

View File

@@ -0,0 +1,12 @@
import { MergeCoreCollection } from "../types/schema.js";
//#region src/schema/translation.d.ts
type DirectusTranslation<Schema = any> = MergeCoreCollection<Schema, 'directus_translations', {
id: string;
language: string;
key: string;
value: string;
}>;
//#endregion
export { DirectusTranslation };
//# sourceMappingURL=translation.d.ts.map

View File

@@ -0,0 +1,52 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class MultiHook {
constructor(hooks, name = undefined) {
this.hooks = hooks;
this.name = name;
}
tap(options, fn) {
for (const hook of this.hooks) {
hook.tap(options, fn);
}
}
tapAsync(options, fn) {
for (const hook of this.hooks) {
hook.tapAsync(options, fn);
}
}
tapPromise(options, fn) {
for (const hook of this.hooks) {
hook.tapPromise(options, fn);
}
}
isUsed() {
for (const hook of this.hooks) {
if (hook.isUsed()) return true;
}
return false;
}
intercept(interceptor) {
for (const hook of this.hooks) {
hook.intercept(interceptor);
}
}
withOptions(options) {
return new MultiHook(
this.hooks.map((hook) => hook.withOptions(options)),
this.name
);
}
}
module.exports = MultiHook;

View File

@@ -0,0 +1,28 @@
"use strict";
exports.enGB = void 0;
var _index = require("./en-US/_lib/formatDistance.cjs");
var _index2 = require("./en-US/_lib/formatRelative.cjs");
var _index3 = require("./en-US/_lib/localize.cjs");
var _index4 = require("./en-US/_lib/match.cjs");
var _index5 = require("./en-GB/_lib/formatLong.cjs");
/**
* @category Locales
* @summary English locale (United Kingdom).
* @language English
* @iso-639-2 eng
* @author Alex [@glintik](https://github.com/glintik)
*/
const enGB = (exports.enGB = {
code: "en-GB",
formatDistance: _index.formatDistance,
formatLong: _index5.formatLong,
formatRelative: _index2.formatRelative,
localize: _index3.localize,
match: _index4.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});

View File

@@ -0,0 +1,2 @@
export declare function isNumber(value: unknown): value is number;
//# sourceMappingURL=isNumber.d.ts.map

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('difference', require('../difference'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1,21 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed 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
*
* https://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 CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Split module-level variable definition into separate files to allow
// tree-shaking on each api instance.
import { ContextAPI } from './api/context';
/** Entrypoint for context API */
export var context = ContextAPI.getInstance();
//# sourceMappingURL=context-api.js.map

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-2016 David Clark
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.

View File

@@ -0,0 +1,66 @@
export { getIntrospectionQuery } from './getIntrospectionQuery';
export type {
IntrospectionOptions,
IntrospectionQuery,
IntrospectionSchema,
IntrospectionType,
IntrospectionInputType,
IntrospectionOutputType,
IntrospectionScalarType,
IntrospectionObjectType,
IntrospectionInterfaceType,
IntrospectionUnionType,
IntrospectionEnumType,
IntrospectionInputObjectType,
IntrospectionTypeRef,
IntrospectionInputTypeRef,
IntrospectionOutputTypeRef,
IntrospectionNamedTypeRef,
IntrospectionListTypeRef,
IntrospectionNonNullTypeRef,
IntrospectionField,
IntrospectionInputValue,
IntrospectionEnumValue,
IntrospectionDirective,
} from './getIntrospectionQuery';
export { getOperationAST } from './getOperationAST';
export { getOperationRootType } from './getOperationRootType';
export { introspectionFromSchema } from './introspectionFromSchema';
export { buildClientSchema } from './buildClientSchema';
export { buildASTSchema, buildSchema } from './buildASTSchema';
export type { BuildSchemaOptions } from './buildASTSchema';
export { extendSchema } from './extendSchema';
export { lexicographicSortSchema } from './lexicographicSortSchema';
export {
printSchema,
printType,
printIntrospectionSchema,
} from './printSchema';
export { typeFromAST } from './typeFromAST';
export { valueFromAST } from './valueFromAST';
export { valueFromASTUntyped } from './valueFromASTUntyped';
export { astFromValue } from './astFromValue';
export { TypeInfo, visitWithTypeInfo } from './TypeInfo';
export { coerceInputValue } from './coerceInputValue';
export { concatAST } from './concatAST';
export { separateOperations } from './separateOperations';
export { stripIgnoredCharacters } from './stripIgnoredCharacters';
export {
isEqualType,
isTypeSubTypeOf,
doTypesOverlap,
} from './typeComparators';
export { assertValidName, isValidNameError } from './assertValidName';
export {
BreakingChangeType,
DangerousChangeType,
findBreakingChanges,
findDangerousChanges,
} from './findBreakingChanges';
export type { BreakingChange, DangerousChange } from './findBreakingChanges';
export type { TypedQueryDocumentNode } from './typedQueryDocumentNode';
export {
resolveSchemaCoordinate,
resolveASTSchemaCoordinate,
} from './resolveSchemaCoordinate';
export type { ResolvedSchemaElement } from './resolveSchemaCoordinate';

View File

@@ -0,0 +1 @@
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/fields/config/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACb,cAAc,EACf,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAmCvC,KAAK,IAAI,GAAG;IACV,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAChC,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,aAAa,EAAE,CAAA;IAClC;;;;OAIG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAA;IACzC;;;OAGG;IACH,4BAA4B,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IAChF;;;OAGG;IACH,kBAAkB,EAAE,IAAI,GAAG,MAAM,EAAE,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,cAAc,yQAgBxB,IAAI,KAAG,OAAO,CAAC,KAAK,EAAE,CA0bxB,CAAA"}

View File

@@ -0,0 +1,2 @@
const e=()=>(e=!1)=>({method:`POST`,path:`/utils/cache/clear${e?`?system`:``}`});exports.clearCache=e;
//# sourceMappingURL=cache.cjs.map

View File

@@ -0,0 +1,10 @@
"use strict";
exports.fromUnixTime = void 0;
var _index = require("../fromUnixTime.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const fromUnixTime = (exports.fromUnixTime = (0, _index2.convertToFP)(
_index.fromUnixTime,
1,
));

View File

@@ -0,0 +1,33 @@
var isArrayLike = require('./isArrayLike'),
isObjectLike = require('./isObjectLike');
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
module.exports = isArrayLikeObject;

View File

@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Smile = createLucideIcon("Smile", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
]);
export { Smile as default };
//# sourceMappingURL=smile.js.map

View File

@@ -0,0 +1,412 @@
"use strict";
/* eslint-env browser, es6, node */
import {
defaults,
map_from_object,
map_to_object,
HOP,
} from "./utils/index.js";
import { AST_Toplevel, AST_Node, walk, AST_Scope } from "./ast.js";
import { parse } from "./parse.js";
import { OutputStream } from "./output.js";
import { Compressor } from "./compress/index.js";
import { base54 } from "./scope.js";
import { SourceMap } from "./sourcemap.js";
import {
mangle_properties,
mangle_private_properties,
reserve_quoted_keys,
find_annotated_props,
} from "./propmangle.js";
// to/from base64 functions
// Prefer built-in Buffer, if available, then use hack
// https://developer.mozilla.org/en-US/docs/Glossary/Base64#The_Unicode_Problem
var to_ascii = typeof Buffer !== "undefined"
? (b64) => Buffer.from(b64, "base64").toString()
: (b64) => decodeURIComponent(escape(atob(b64)));
var to_base64 = typeof Buffer !== "undefined"
? (str) => Buffer.from(str).toString("base64")
: (str) => btoa(unescape(encodeURIComponent(str)));
function read_source_map(code) {
var match = /(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(code);
if (!match) {
console.warn("inline source map not found");
return null;
}
return to_ascii(match[2]);
}
function set_shorthand(name, options, keys) {
if (options[name]) {
keys.forEach(function(key) {
if (options[key]) {
if (typeof options[key] != "object") options[key] = {};
if (!(name in options[key])) options[key][name] = options[name];
}
});
}
}
function init_cache(cache) {
if (!cache) return;
if (!("props" in cache)) {
cache.props = new Map();
} else if (!(cache.props instanceof Map)) {
cache.props = map_from_object(cache.props);
}
}
function cache_to_json(cache) {
return {
props: map_to_object(cache.props)
};
}
function log_input(files, options, fs, debug_folder) {
if (!(fs && fs.writeFileSync && fs.mkdirSync)) {
return;
}
try {
fs.mkdirSync(debug_folder);
} catch (e) {
if (e.code !== "EEXIST") throw e;
}
const log_path = `${debug_folder}/terser-debug-${(Math.random() * 9999999) | 0}.log`;
options = options || {};
const options_str = JSON.stringify(options, (_key, thing) => {
if (typeof thing === "function") return "[Function " + thing.toString() + "]";
if (thing instanceof RegExp) return "[RegExp " + thing.toString() + "]";
return thing;
}, 4);
const files_str = (file) => {
if (typeof file === "object" && options.parse && options.parse.spidermonkey) {
return JSON.stringify(file, null, 2);
} else if (typeof file === "object") {
return Object.keys(file)
.map((key) => key + ": " + files_str(file[key]))
.join("\n\n");
} else if (typeof file === "string") {
return "```\n" + file + "\n```";
} else {
return file; // What do?
}
};
fs.writeFileSync(log_path, "Options: \n" + options_str + "\n\nInput files:\n\n" + files_str(files) + "\n");
}
function* minify_sync_or_async(files, options, _fs_module) {
if (
_fs_module
&& typeof process === "object"
&& process.env
&& typeof process.env.TERSER_DEBUG_DIR === "string"
) {
log_input(files, options, _fs_module, process.env.TERSER_DEBUG_DIR);
}
options = defaults(options, {
compress: {},
ecma: undefined,
enclose: false,
ie8: false,
keep_classnames: undefined,
keep_fnames: false,
mangle: {},
module: false,
nameCache: null,
output: null,
format: null,
parse: {},
rename: undefined,
safari10: false,
sourceMap: false,
spidermonkey: false,
timings: false,
toplevel: false,
warnings: false,
wrap: false,
}, true);
var timings = options.timings && {
start: Date.now()
};
if (options.keep_classnames === undefined) {
options.keep_classnames = options.keep_fnames;
}
if (options.rename === undefined) {
options.rename = options.compress && options.mangle;
}
if (options.output && options.format) {
throw new Error("Please only specify either output or format option, preferrably format.");
}
options.format = options.format || options.output || {};
set_shorthand("ecma", options, [ "parse", "compress", "format" ]);
set_shorthand("ie8", options, [ "compress", "mangle", "format" ]);
set_shorthand("keep_classnames", options, [ "compress", "mangle" ]);
set_shorthand("keep_fnames", options, [ "compress", "mangle" ]);
set_shorthand("module", options, [ "parse", "compress", "mangle" ]);
set_shorthand("safari10", options, [ "mangle", "format" ]);
set_shorthand("toplevel", options, [ "compress", "mangle" ]);
set_shorthand("warnings", options, [ "compress" ]); // legacy
var quoted_props;
if (options.mangle) {
options.mangle = defaults(options.mangle, {
cache: options.nameCache && (options.nameCache.vars || {}),
eval: false,
ie8: false,
keep_classnames: false,
keep_fnames: false,
module: false,
nth_identifier: base54,
properties: false,
reserved: [],
safari10: false,
toplevel: false,
}, true);
if (options.mangle.properties) {
if (typeof options.mangle.properties != "object") {
options.mangle.properties = {};
}
if (options.mangle.properties.keep_quoted) {
quoted_props = options.mangle.properties.reserved;
if (!Array.isArray(quoted_props)) quoted_props = [];
options.mangle.properties.reserved = quoted_props;
}
if (options.nameCache && !("cache" in options.mangle.properties)) {
options.mangle.properties.cache = options.nameCache.props || {};
}
}
init_cache(options.mangle.cache);
init_cache(options.mangle.properties.cache);
}
if (options.sourceMap) {
options.sourceMap = defaults(options.sourceMap, {
asObject: false,
content: null,
filename: null,
includeSources: false,
root: null,
url: null,
}, true);
}
// -- Parse phase --
if (timings) timings.parse = Date.now();
var toplevel;
if (files instanceof AST_Toplevel) {
toplevel = files;
} else {
if (typeof files == "string" || (options.parse.spidermonkey && !Array.isArray(files))) {
files = [ files ];
}
options.parse = options.parse || {};
options.parse.toplevel = null;
if (options.parse.spidermonkey) {
options.parse.toplevel = AST_Node.from_mozilla_ast(Object.keys(files).reduce(function(toplevel, name) {
if (!toplevel) return files[name];
toplevel.body = toplevel.body.concat(files[name].body);
return toplevel;
}, null));
} else {
delete options.parse.spidermonkey;
for (var name in files) if (HOP(files, name)) {
options.parse.filename = name;
options.parse.toplevel = parse(files[name], options.parse);
if (options.sourceMap && options.sourceMap.content == "inline") {
if (Object.keys(files).length > 1)
throw new Error("inline source map only works with singular input");
options.sourceMap.content = read_source_map(files[name]);
}
}
}
if (options.parse.toplevel === null) {
throw new Error("no source file given");
}
toplevel = options.parse.toplevel;
}
if (quoted_props && options.mangle.properties.keep_quoted !== "strict") {
reserve_quoted_keys(toplevel, quoted_props);
}
var annotated_props;
if (options.mangle && options.mangle.properties) {
annotated_props = find_annotated_props(toplevel);
}
if (options.wrap) {
toplevel = toplevel.wrap_commonjs(options.wrap);
}
if (options.enclose) {
toplevel = toplevel.wrap_enclose(options.enclose);
}
if (timings) timings.rename = Date.now();
// disable rename on harmony due to expand_names bug in for-of loops
// https://github.com/mishoo/UglifyJS2/issues/2794
if (0 && options.rename) {
toplevel.figure_out_scope(options.mangle);
toplevel.expand_names(options.mangle);
}
// -- Compress phase --
if (timings) timings.compress = Date.now();
if (options.compress) {
toplevel = new Compressor(options.compress, {
mangle_options: options.mangle
}).compress(toplevel);
}
// -- Mangle phase --
if (timings) timings.scope = Date.now();
if (options.mangle) toplevel.figure_out_scope(options.mangle);
if (timings) timings.mangle = Date.now();
if (options.mangle) {
toplevel.compute_char_frequency(options.mangle);
toplevel.mangle_names(options.mangle);
toplevel = mangle_private_properties(toplevel, options.mangle);
}
if (timings) timings.properties = Date.now();
if (options.mangle && options.mangle.properties) {
toplevel = mangle_properties(toplevel, options.mangle.properties, annotated_props);
}
// Format phase
if (timings) timings.format = Date.now();
var result = {};
if (options.format.ast) {
result.ast = toplevel;
}
if (options.format.spidermonkey) {
result.ast = toplevel.to_mozilla_ast();
}
let format_options;
if (!HOP(options.format, "code") || options.format.code) {
// Make a shallow copy so that we can modify without mutating the user's input.
format_options = {...options.format};
if (!format_options.ast) {
// Destroy stuff to save RAM. (unless the deprecated `ast` option is on)
format_options._destroy_ast = true;
walk(toplevel, node => {
if (node instanceof AST_Scope) {
node.variables = undefined;
node.enclosed = undefined;
node.parent_scope = undefined;
}
if (node.block_scope) {
node.block_scope.variables = undefined;
node.block_scope.enclosed = undefined;
node.block_scope.parent_scope = undefined;
}
});
}
if (options.sourceMap) {
if (options.sourceMap.includeSources && files instanceof AST_Toplevel) {
throw new Error("original source content unavailable");
}
format_options.source_map = yield* SourceMap({
file: options.sourceMap.filename,
orig: options.sourceMap.content,
root: options.sourceMap.root,
files: options.sourceMap.includeSources ? files : null,
});
}
delete format_options.ast;
delete format_options.code;
delete format_options.spidermonkey;
var stream = OutputStream(format_options);
toplevel.print(stream);
result.code = stream.get();
if (options.sourceMap) {
Object.defineProperty(result, "map", {
configurable: true,
enumerable: true,
get() {
const map = format_options.source_map.getEncoded();
return (result.map = options.sourceMap.asObject ? map : JSON.stringify(map));
},
set(value) {
Object.defineProperty(result, "map", {
value,
writable: true,
});
}
});
result.decoded_map = format_options.source_map.getDecoded();
if (options.sourceMap.url == "inline") {
var sourceMap = typeof result.map === "object" ? JSON.stringify(result.map) : result.map;
result.code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + to_base64(sourceMap);
} else if (options.sourceMap.url) {
result.code += "\n//# sourceMappingURL=" + options.sourceMap.url;
}
}
}
if (options.nameCache && options.mangle) {
if (options.mangle.cache) options.nameCache.vars = cache_to_json(options.mangle.cache);
if (options.mangle.properties && options.mangle.properties.cache) {
options.nameCache.props = cache_to_json(options.mangle.properties.cache);
}
}
if (format_options && format_options.source_map) {
format_options.source_map.destroy();
}
if (timings) {
timings.end = Date.now();
result.timings = {
parse: 1e-3 * (timings.rename - timings.parse),
rename: 1e-3 * (timings.compress - timings.rename),
compress: 1e-3 * (timings.scope - timings.compress),
scope: 1e-3 * (timings.mangle - timings.scope),
mangle: 1e-3 * (timings.properties - timings.mangle),
properties: 1e-3 * (timings.format - timings.properties),
format: 1e-3 * (timings.end - timings.format),
total: 1e-3 * (timings.end - timings.start)
};
}
return result;
}
async function minify(files, options, _fs_module) {
const gen = minify_sync_or_async(files, options, _fs_module);
let yielded;
let val;
do {
val = gen.next(await yielded);
yielded = val.value;
} while (!val.done);
return val.value;
}
function minify_sync(files, options, _fs_module) {
const gen = minify_sync_or_async(files, options, _fs_module);
let yielded;
let val;
do {
if (yielded && typeof yielded.then === "function") {
throw new Error("minify_sync cannot be used with the legacy source-map module");
}
val = gen.next(yielded);
yielded = val.value;
} while (!val.done);
return val.value;
}
export {
minify,
minify_sync,
to_ascii,
};

View File

@@ -0,0 +1,16 @@
var copyObject = require('./_copyObject'),
getSymbolsIn = require('./_getSymbolsIn');
/**
* Copies own and inherited symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbolsIn(source, object) {
return copyObject(source, getSymbolsIn(source), object);
}
module.exports = copySymbolsIn;

View File

@@ -0,0 +1,23 @@
interface BrowserSessionOptions {
/**
* Controls the session lifecycle - when new sessions are created.
*
* - `'route'`: A session is created on page load and on every navigation.
* This is the default behavior.
* - `'page'`: A session is created once when the page is loaded. Session is not
* updated on navigation. This is useful for webviews or single-page apps where
* URL changes should not trigger new sessions.
*
* @default 'route'
*/
lifecycle?: 'route' | 'page';
}
/**
* When added, automatically creates sessions which allow you to track adoption and crashes (crash free rate) in your Releases in Sentry.
* More information: https://docs.sentry.io/product/releases/health/
*
* Note: In order for session tracking to work, you need to set up Releases: https://docs.sentry.io/product/releases/
*/
export declare const browserSessionIntegration: (options?: BrowserSessionOptions | undefined) => import("@sentry/core").Integration;
export {};
//# sourceMappingURL=browsersession.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"font-variant.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/font-variant.ts"],"names":[],"mappings":";;;AACA,2CAAwD;AAE3C,QAAA,WAAW,GAAsC;IAC1D,IAAI,EAAE,cAAc;IACpB,YAAY,EAAE,MAAM;IACpB,IAAI,cAAoC;IACxC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,MAAM,CAAC,MAAM,CAAC,qBAAY,CAAC,CAAC,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,KAAK,CAAC,KAAK,EAAX,CAAW,CAAC,CAAC;IACnE,CAAC;CACJ,CAAC"}

View File

@@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var bun_sql_exports = {};
module.exports = __toCommonJS(bun_sql_exports);
__reExport(bun_sql_exports, require("./driver.cjs"), module.exports);
__reExport(bun_sql_exports, require("./session.cjs"), module.exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
...require("./driver.cjs"),
...require("./session.cjs")
});
//# sourceMappingURL=index.cjs.map

View File

@@ -0,0 +1,63 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getFunctionName;
var _index = require("../validators/generated/index.js");
function getNameFromLiteralId(id) {
if ((0, _index.isNullLiteral)(id)) {
return "null";
}
if ((0, _index.isRegExpLiteral)(id)) {
return `/${id.pattern}/${id.flags}`;
}
if ((0, _index.isTemplateLiteral)(id)) {
return id.quasis.map(quasi => quasi.value.raw).join("");
}
if (id.value !== undefined) {
return String(id.value);
}
return null;
}
function getObjectMemberKey(node) {
if (!node.computed || (0, _index.isLiteral)(node.key)) {
return node.key;
}
}
function getFunctionName(node, parent) {
if ("id" in node && node.id) {
return {
name: node.id.name,
originalNode: node.id
};
}
let prefix = "";
let id;
if ((0, _index.isObjectProperty)(parent, {
value: node
})) {
id = getObjectMemberKey(parent);
} else if ((0, _index.isObjectMethod)(node) || (0, _index.isClassMethod)(node)) {
id = getObjectMemberKey(node);
if (node.kind === "get") prefix = "get ";else if (node.kind === "set") prefix = "set ";
} else if ((0, _index.isVariableDeclarator)(parent, {
init: node
})) {
id = parent.id;
} else if ((0, _index.isAssignmentExpression)(parent, {
operator: "=",
right: node
})) {
id = parent.left;
}
if (!id) return null;
const name = (0, _index.isLiteral)(id) ? getNameFromLiteralId(id) : (0, _index.isIdentifier)(id) ? id.name : (0, _index.isPrivateName)(id) ? id.id.name : null;
if (name == null) return null;
return {
name: prefix + name,
originalNode: id
};
}
//# sourceMappingURL=getFunctionName.js.map

View File

@@ -0,0 +1,14 @@
export declare const eachWeekOfInterval: import("./types.js").FPFn1<
import("../eachWeekOfInterval.js").EachWeekOfIntervalResult<
import("../fp.js").Interval<
import("../fp.js").DateArg<Date>,
import("../fp.js").DateArg<Date>
>,
| import("../eachWeekOfInterval.js").EachWeekOfIntervalOptions<Date>
| undefined
>,
import("../fp.js").Interval<
import("../fp.js").DateArg<Date>,
import("../fp.js").DateArg<Date>
>
>;

View File

@@ -0,0 +1,65 @@
var castPath = require('./_castPath'),
last = require('./last'),
parent = require('./_parent'),
toKey = require('./_toKey');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = castPath(path, object);
// Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
var index = -1,
length = path.length;
if (!length) {
return true;
}
var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
while (++index < length) {
var key = path[index];
// skip non-string keys (e.g., Symbols, numbers)
if (typeof key !== 'string') {
continue;
}
// Always block "__proto__" anywhere in the path if it's not expected
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
return false;
}
// Block "constructor.prototype" chains
if (key === 'constructor' &&
(index + 1) < length &&
typeof path[index + 1] === 'string' &&
path[index + 1] === 'prototype') {
// Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
if (isRootPrimitive && index === 0) {
continue;
}
return false;
}
}
var obj = parent(object, path);
return obj == null || delete obj[toKey(last(path))];
}
module.exports = baseUnset;

View File

@@ -0,0 +1,27 @@
"use strict";
exports.sk = void 0;
var _index = require("./sk/_lib/formatDistance.js");
var _index2 = require("./sk/_lib/formatLong.js");
var _index3 = require("./sk/_lib/formatRelative.js");
var _index4 = require("./sk/_lib/localize.js");
var _index5 = require("./sk/_lib/match.js");
/**
* @category Locales
* @summary Slovak locale.
* @language Slovak
* @iso-639-2 slk
* @author Marek Suscak [@mareksuscak](https://github.com/mareksuscak)
*/
const sk = (exports.sk = {
code: "sk",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAkBA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yCAAyB,CAAA;AAC3B,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Span } from '@opentelemetry/api';\nimport { InstrumentationConfig } from '@opentelemetry/instrumentation';\n\nexport enum KoaLayerType {\n ROUTER = 'router',\n MIDDLEWARE = 'middleware',\n}\n\n/**\n * Information about the current Koa middleware layer\n * The middleware layer type is any by default.\n * One can install koa types packages `@types/koa` and `@types/koa__router`\n * with compatible versions to the koa version used in the project\n * to get more specific types for the middleware layer property.\n *\n * Example use in a custom attribute function:\n * ```ts\n * import type { Middleware, ParameterizedContext, DefaultState } from 'koa';\n * import type { RouterParamContext } from '@koa/router';\n *\n * type KoaContext = ParameterizedContext<DefaultState, RouterParamContext>;\n * type KoaMiddleware = Middleware<DefaultState, KoaContext>;\n *\n * const koaConfig: KoaInstrumentationConfig<KoaContext, KoaMiddleware> = {\n * requestHook: (span: Span, info: KoaRequestInfo<KoaContext, KoaMiddleware>) => {\n * // custom typescript code that can access the typed into.middlewareLayer and info.context\n * }\n *\n */\nexport type KoaRequestInfo<KoaContextType = any, KoaMiddlewareType = any> = {\n context: KoaContextType;\n middlewareLayer: KoaMiddlewareType;\n layerType: KoaLayerType;\n};\n\n/**\n * Function that can be used to add custom attributes to the current span\n * @param span - The Express middleware layer span.\n * @param context - The current KoaContext.\n */\nexport interface KoaRequestCustomAttributeFunction<\n KoaContextType = any,\n KoaMiddlewareType = any,\n> {\n (span: Span, info: KoaRequestInfo<KoaContextType, KoaMiddlewareType>): void;\n}\n\n/**\n * Options available for the Koa Instrumentation (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-Instrumentation-koa#koa-Instrumentation-options))\n */\nexport interface KoaInstrumentationConfig<\n KoaContextType = any,\n KoaMiddlewareType = any,\n> extends InstrumentationConfig {\n /** Ignore specific layers based on their type */\n ignoreLayersType?: KoaLayerType[];\n /** Function for adding custom attributes to each middleware layer span */\n requestHook?: KoaRequestCustomAttributeFunction<\n KoaContextType,\n KoaMiddlewareType\n >;\n}\n"]}

View File

@@ -0,0 +1,144 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "tecken", verb: "att ha" },
file: { unit: "bytes", verb: "att ha" },
array: { unit: "objekt", verb: "att innehålla" },
set: { unit: "objekt", verb: "att innehålla" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "antal";
}
case "object": {
if (Array.isArray(data)) {
return "lista";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "reguljärt uttryck",
email: "e-postadress",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO-datum och tid",
date: "ISO-datum",
time: "ISO-tid",
duration: "ISO-varaktighet",
ipv4: "IPv4-intervall",
ipv6: "IPv6-intervall",
cidrv4: "IPv4-spektrum",
cidrv6: "IPv6-spektrum",
base64: "base64-kodad sträng",
base64url: "base64url-kodad sträng",
json_string: "JSON-sträng",
e164: "E.164-nummer",
jwt: "JWT",
template_literal: "mall-literal",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Ogiltig inmatning: förväntat ${issue.expected}, fick ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Ogiltig inmatning: förväntat ${util.stringifyPrimitive(issue.values[0])}`;
return `Ogiltigt val: förväntade en av ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `För stor(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
}
return `För stor(t): förväntat ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Ogiltig sträng: måste börja med "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Ogiltig sträng: måste sluta med "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Ogiltig sträng: måste innehålla "${_issue.includes}"`;
if (_issue.format === "regex")
return `Ogiltig sträng: måste matcha mönstret "${_issue.pattern}"`;
return `Ogiltig(t) ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Ogiltigt tal: måste vara en multipel av ${issue.divisor}`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Okända nycklar" : "Okänd nyckel"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Ogiltig nyckel i ${issue.origin ?? "värdet"}`;
case "invalid_union":
return "Ogiltig input";
case "invalid_element":
return `Ogiltigt värde i ${issue.origin ?? "värdet"}`;
default:
return `Ogiltig input`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"search.js","sources":["../../../src/icons/search.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Search\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4IiAvPgogIDxwYXRoIGQ9Im0yMSAyMS00LjMtNC4zIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/search\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Search = createLucideIcon('Search', [\n ['circle', { cx: '11', cy: '11', r: '8', key: '4ej97u' }],\n ['path', { d: 'm21 21-4.3-4.3', key: '1qie3q' }],\n]);\n\nexport default Search;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CACxC,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjD,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,29 @@
import { floatRegex } from '../utils/float-regex.mjs';
import { isNullish } from '../utils/is-nullish.mjs';
import { singleColorRegex } from '../utils/single-color-regex.mjs';
/**
* Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,
* but false if a number or multiple colors
*/
const isColorString = (type, testProp) => (v) => {
return Boolean((typeof v === "string" &&
singleColorRegex.test(v) &&
v.startsWith(type)) ||
(testProp &&
!isNullish(v) &&
Object.prototype.hasOwnProperty.call(v, testProp)));
};
const splitColor = (aName, bName, cName) => (v) => {
if (typeof v !== "string")
return v;
const [a, b, c, alpha] = v.match(floatRegex);
return {
[aName]: parseFloat(a),
[bName]: parseFloat(b),
[cName]: parseFloat(c),
alpha: alpha !== undefined ? parseFloat(alpha) : 1,
};
};
export { isColorString, splitColor };

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B"},E:{"1":"L M G BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D E F A B C 6C bC 7C 8C 9C AD cC PC QC"},F:{"1":"0 1 2 3 4 5 6 7 8 sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB JD KD LD MD PC xC ND QC"},G:{"1":"bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"E bC OD yC PD QD RD SD TD UD VD WD XD YD ZD aD"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D","2":"J tD uD"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"7D","2":"6D"}},B:4,C:"display: flow-root",D:true};

View File

@@ -0,0 +1,121 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import { importDateFNSLocale, t } from '@payloadcms/translations';
import { enUS } from 'date-fns/locale/en-US';
import { useRouter } from 'next/navigation.js';
import React, { createContext, use, useEffect, useState } from 'react';
const Context = /*#__PURE__*/createContext({
// Use `any` here to be replaced later with a more specific type when used
i18n: {
dateFNS: enUS,
dateFNSKey: 'en-US',
fallbackLanguage: 'en',
language: 'en',
t: key => key,
translations: {}
},
languageOptions: undefined,
switchLanguage: undefined,
t: key => undefined
});
export const TranslationProvider = t0 => {
const $ = _c(18);
const {
children,
dateFNSKey,
fallbackLang,
language,
languageOptions,
switchLanguageServerAction,
translations
} = t0;
const router = useRouter();
const [dateFNS, setDateFNS] = useState();
let t1;
if ($[0] !== translations) {
t1 = (key, vars) => t({
key,
translations,
vars
});
$[0] = translations;
$[1] = t1;
} else {
t1 = $[1];
}
const nextT = t1;
let t2;
if ($[2] !== router || $[3] !== switchLanguageServerAction) {
t2 = async lang => {
;
try {
await switchLanguageServerAction(lang);
router.refresh();
} catch (t3) {
const error = t3;
console.error(`Error loading language: "${lang}"`, error);
}
};
$[2] = router;
$[3] = switchLanguageServerAction;
$[4] = t2;
} else {
t2 = $[4];
}
const switchLanguage = t2;
let t3;
let t4;
if ($[5] !== dateFNSKey) {
t3 = () => {
const loadDateFNS = async () => {
const imported = await importDateFNSLocale(dateFNSKey);
setDateFNS(imported);
};
loadDateFNS();
};
t4 = [dateFNSKey];
$[5] = dateFNSKey;
$[6] = t3;
$[7] = t4;
} else {
t3 = $[6];
t4 = $[7];
}
useEffect(t3, t4);
let t5;
if ($[8] !== children || $[9] !== dateFNS || $[10] !== dateFNSKey || $[11] !== fallbackLang || $[12] !== language || $[13] !== languageOptions || $[14] !== nextT || $[15] !== switchLanguage || $[16] !== translations) {
t5 = _jsx(Context, {
value: {
i18n: {
dateFNS,
dateFNSKey,
fallbackLanguage: fallbackLang,
language,
t: nextT,
translations
},
languageOptions,
switchLanguage,
t: nextT
},
children
});
$[8] = children;
$[9] = dateFNS;
$[10] = dateFNSKey;
$[11] = fallbackLang;
$[12] = language;
$[13] = languageOptions;
$[14] = nextT;
$[15] = switchLanguage;
$[16] = translations;
$[17] = t5;
} else {
t5 = $[17];
}
return t5;
};
export const useTranslation = () => use(Context);
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,29 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link isSameYear} function options.
*/
export interface IsSameYearOptions extends ContextOptions<Date> {}
/**
* @name isSameYear
* @category Year Helpers
* @summary Are the given dates in the same year?
*
* @description
* Are the given dates in the same year?
*
* @param laterDate - The first date to check
* @param earlierDate - The second date to check
* @param options - An object with options
*
* @returns The dates are in the same year
*
* @example
* // Are 2 September 2014 and 25 September 2014 in the same year?
* const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
* //=> true
*/
export declare function isSameYear(
laterDate: DateArg<Date> & {},
earlierDate: DateArg<Date> & {},
options?: IsSameYearOptions | undefined,
): boolean;

View File

@@ -0,0 +1,27 @@
import { toDate } from "./toDate.mjs";
/**
* @name isSaturday
* @category Weekday Helpers
* @summary Is the given date Saturday?
*
* @description
* Is the given date Saturday?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to check
*
* @returns The date is Saturday
*
* @example
* // Is 27 September 2014 Saturday?
* const result = isSaturday(new Date(2014, 8, 27))
* //=> true
*/
export function isSaturday(date) {
return toDate(date).getDay() === 6;
}
// Fallback for modularized imports:
export default isSaturday;

View File

@@ -0,0 +1,973 @@
'use strict';
const { EventEmitter } = require('events');
const fs = require('fs');
const sysPath = require('path');
const { promisify } = require('util');
const readdirp = require('readdirp');
const anymatch = require('anymatch').default;
const globParent = require('glob-parent');
const isGlob = require('is-glob');
const braces = require('braces');
const normalizePath = require('normalize-path');
const NodeFsHandler = require('./lib/nodefs-handler');
const FsEventsHandler = require('./lib/fsevents-handler');
const {
EV_ALL,
EV_READY,
EV_ADD,
EV_CHANGE,
EV_UNLINK,
EV_ADD_DIR,
EV_UNLINK_DIR,
EV_RAW,
EV_ERROR,
STR_CLOSE,
STR_END,
BACK_SLASH_RE,
DOUBLE_SLASH_RE,
SLASH_OR_BACK_SLASH_RE,
DOT_RE,
REPLACER_RE,
SLASH,
SLASH_SLASH,
BRACE_START,
BANG,
ONE_DOT,
TWO_DOTS,
GLOBSTAR,
SLASH_GLOBSTAR,
ANYMATCH_OPTS,
STRING_TYPE,
FUNCTION_TYPE,
EMPTY_STR,
EMPTY_FN,
isWindows,
isMacos,
isIBMi
} = require('./lib/constants');
const stat = promisify(fs.stat);
const readdir = promisify(fs.readdir);
/**
* @typedef {String} Path
* @typedef {'all'|'add'|'addDir'|'change'|'unlink'|'unlinkDir'|'raw'|'error'|'ready'} EventName
* @typedef {'readdir'|'watch'|'add'|'remove'|'change'} ThrottleType
*/
/**
*
* @typedef {Object} WatchHelpers
* @property {Boolean} followSymlinks
* @property {'stat'|'lstat'} statMethod
* @property {Path} path
* @property {Path} watchPath
* @property {Function} entryPath
* @property {Boolean} hasGlob
* @property {Object} globFilter
* @property {Function} filterPath
* @property {Function} filterDir
*/
const arrify = (value = []) => Array.isArray(value) ? value : [value];
const flatten = (list, result = []) => {
list.forEach(item => {
if (Array.isArray(item)) {
flatten(item, result);
} else {
result.push(item);
}
});
return result;
};
const unifyPaths = (paths_) => {
/**
* @type {Array<String>}
*/
const paths = flatten(arrify(paths_));
if (!paths.every(p => typeof p === STRING_TYPE)) {
throw new TypeError(`Non-string provided as watch path: ${paths}`);
}
return paths.map(normalizePathToUnix);
};
// If SLASH_SLASH occurs at the beginning of path, it is not replaced
// because "//StoragePC/DrivePool/Movies" is a valid network path
const toUnix = (string) => {
let str = string.replace(BACK_SLASH_RE, SLASH);
let prepend = false;
if (str.startsWith(SLASH_SLASH)) {
prepend = true;
}
while (str.match(DOUBLE_SLASH_RE)) {
str = str.replace(DOUBLE_SLASH_RE, SLASH);
}
if (prepend) {
str = SLASH + str;
}
return str;
};
// Our version of upath.normalize
// TODO: this is not equal to path-normalize module - investigate why
const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path)));
const normalizeIgnored = (cwd = EMPTY_STR) => (path) => {
if (typeof path !== STRING_TYPE) return path;
return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path));
};
const getAbsolutePath = (path, cwd) => {
if (sysPath.isAbsolute(path)) {
return path;
}
if (path.startsWith(BANG)) {
return BANG + sysPath.join(cwd, path.slice(1));
}
return sysPath.join(cwd, path);
};
const undef = (opts, key) => opts[key] === undefined;
/**
* Directory entry.
* @property {Path} path
* @property {Set<Path>} items
*/
class DirEntry {
/**
* @param {Path} dir
* @param {Function} removeWatcher
*/
constructor(dir, removeWatcher) {
this.path = dir;
this._removeWatcher = removeWatcher;
/** @type {Set<Path>} */
this.items = new Set();
}
add(item) {
const {items} = this;
if (!items) return;
if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item);
}
async remove(item) {
const {items} = this;
if (!items) return;
items.delete(item);
if (items.size > 0) return;
const dir = this.path;
try {
await readdir(dir);
} catch (err) {
if (this._removeWatcher) {
this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
}
}
}
has(item) {
const {items} = this;
if (!items) return;
return items.has(item);
}
/**
* @returns {Array<String>}
*/
getChildren() {
const {items} = this;
if (!items) return;
return [...items.values()];
}
dispose() {
this.items.clear();
delete this.path;
delete this._removeWatcher;
delete this.items;
Object.freeze(this);
}
}
const STAT_METHOD_F = 'stat';
const STAT_METHOD_L = 'lstat';
class WatchHelper {
constructor(path, watchPath, follow, fsw) {
this.fsw = fsw;
this.path = path = path.replace(REPLACER_RE, EMPTY_STR);
this.watchPath = watchPath;
this.fullWatchPath = sysPath.resolve(watchPath);
this.hasGlob = watchPath !== path;
/** @type {object|boolean} */
if (path === EMPTY_STR) this.hasGlob = false;
this.globSymlink = this.hasGlob && follow ? undefined : false;
this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false;
this.dirParts = this.getDirParts(path);
this.dirParts.forEach((parts) => {
if (parts.length > 1) parts.pop();
});
this.followSymlinks = follow;
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
}
checkGlobSymlink(entry) {
// only need to resolve once
// first entry should always have entry.parentDir === EMPTY_STR
if (this.globSymlink === undefined) {
this.globSymlink = entry.fullParentDir === this.fullWatchPath ?
false : {realPath: entry.fullParentDir, linkPath: this.fullWatchPath};
}
if (this.globSymlink) {
return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath);
}
return entry.fullPath;
}
entryPath(entry) {
return sysPath.join(this.watchPath,
sysPath.relative(this.watchPath, this.checkGlobSymlink(entry))
);
}
filterPath(entry) {
const {stats} = entry;
if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
const resolvedPath = this.entryPath(entry);
const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ?
this.globFilter(resolvedPath) : true;
return matchesGlob &&
this.fsw._isntIgnored(resolvedPath, stats) &&
this.fsw._hasReadPermissions(stats);
}
getDirParts(path) {
if (!this.hasGlob) return [];
const parts = [];
const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path];
expandedPath.forEach((path) => {
parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE));
});
return parts;
}
filterDir(entry) {
if (this.hasGlob) {
const entryParts = this.getDirParts(this.checkGlobSymlink(entry));
let globstar = false;
this.unmatchedGlob = !this.dirParts.some((parts) => {
return parts.every((part, i) => {
if (part === GLOBSTAR) globstar = true;
return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS);
});
});
}
return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
}
}
/**
* Watches files & directories for changes. Emitted events:
* `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`
*
* new FSWatcher()
* .add(directories)
* .on('add', path => log('File', path, 'was added'))
*/
class FSWatcher extends EventEmitter {
// Not indenting methods for history sake; for now.
constructor(_opts) {
super();
const opts = {};
if (_opts) Object.assign(opts, _opts); // for frozen objects
/** @type {Map<String, DirEntry>} */
this._watched = new Map();
/** @type {Map<String, Array>} */
this._closers = new Map();
/** @type {Set<String>} */
this._ignoredPaths = new Set();
/** @type {Map<ThrottleType, Map>} */
this._throttled = new Map();
/** @type {Map<Path, String|Boolean>} */
this._symlinkPaths = new Map();
this._streams = new Set();
this.closed = false;
// Set up default options.
if (undef(opts, 'persistent')) opts.persistent = true;
if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false;
if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false;
if (undef(opts, 'interval')) opts.interval = 100;
if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300;
if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false;
opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;
// Enable fsevents on OS X when polling isn't explicitly enabled.
if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling;
// If we can't use fsevents, ensure the options reflect it's disabled.
const canUseFsEvents = FsEventsHandler.canUse();
if (!canUseFsEvents) opts.useFsEvents = false;
// Use polling on Mac if not using fsevents.
// Other platforms use non-polling fs_watch.
if (undef(opts, 'usePolling') && !opts.useFsEvents) {
opts.usePolling = isMacos;
}
// Always default to polling on IBM i because fs.watch() is not available on IBM i.
if(isIBMi) {
opts.usePolling = true;
}
// Global override (useful for end-developers that need to force polling for all
// instances of chokidar, regardless of usage/dependency depth)
const envPoll = process.env.CHOKIDAR_USEPOLLING;
if (envPoll !== undefined) {
const envLower = envPoll.toLowerCase();
if (envLower === 'false' || envLower === '0') {
opts.usePolling = false;
} else if (envLower === 'true' || envLower === '1') {
opts.usePolling = true;
} else {
opts.usePolling = !!envLower;
}
}
const envInterval = process.env.CHOKIDAR_INTERVAL;
if (envInterval) {
opts.interval = Number.parseInt(envInterval, 10);
}
// Editor atomic write normalization enabled by default with fs.watch
if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents;
if (opts.atomic) this._pendingUnlinks = new Map();
if (undef(opts, 'followSymlinks')) opts.followSymlinks = true;
if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false;
if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};
const awf = opts.awaitWriteFinish;
if (awf) {
if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000;
if (!awf.pollInterval) awf.pollInterval = 100;
this._pendingWrites = new Map();
}
if (opts.ignored) opts.ignored = arrify(opts.ignored);
let readyCalls = 0;
this._emitReady = () => {
readyCalls++;
if (readyCalls >= this._readyCount) {
this._emitReady = EMPTY_FN;
this._readyEmitted = true;
// use process.nextTick to allow time for listener to be bound
process.nextTick(() => this.emit(EV_READY));
}
};
this._emitRaw = (...args) => this.emit(EV_RAW, ...args);
this._readyEmitted = false;
this.options = opts;
// Initialize with proper watcher.
if (opts.useFsEvents) {
this._fsEventsHandler = new FsEventsHandler(this);
} else {
this._nodeFsHandler = new NodeFsHandler(this);
}
// Youre frozen when your hearts not open.
Object.freeze(opts);
}
// Public methods
/**
* Adds paths to be watched on an existing FSWatcher instance
* @param {Path|Array<Path>} paths_
* @param {String=} _origAdd private; for handling non-existent paths to be watched
* @param {Boolean=} _internal private; indicates a non-user add
* @returns {FSWatcher} for chaining
*/
add(paths_, _origAdd, _internal) {
const {cwd, disableGlobbing} = this.options;
this.closed = false;
let paths = unifyPaths(paths_);
if (cwd) {
paths = paths.map((path) => {
const absPath = getAbsolutePath(path, cwd);
// Check `path` instead of `absPath` because the cwd portion can't be a glob
if (disableGlobbing || !isGlob(path)) {
return absPath;
}
return normalizePath(absPath);
});
}
// set aside negated glob strings
paths = paths.filter((path) => {
if (path.startsWith(BANG)) {
this._ignoredPaths.add(path.slice(1));
return false;
}
// if a path is being added that was previously ignored, stop ignoring it
this._ignoredPaths.delete(path);
this._ignoredPaths.delete(path + SLASH_GLOBSTAR);
// reset the cached userIgnored anymatch fn
// to make ignoredPaths changes effective
this._userIgnored = undefined;
return true;
});
if (this.options.useFsEvents && this._fsEventsHandler) {
if (!this._readyCount) this._readyCount = paths.length;
if (this.options.persistent) this._readyCount += paths.length;
paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path));
} else {
if (!this._readyCount) this._readyCount = 0;
this._readyCount += paths.length;
Promise.all(
paths.map(async path => {
const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd);
if (res) this._emitReady();
return res;
})
).then(results => {
if (this.closed) return;
results.filter(item => item).forEach(item => {
this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
});
});
}
return this;
}
/**
* Close watchers or start ignoring events from specified paths.
* @param {Path|Array<Path>} paths_ - string or array of strings, file/directory paths and/or globs
* @returns {FSWatcher} for chaining
*/
unwatch(paths_) {
if (this.closed) return this;
const paths = unifyPaths(paths_);
const {cwd} = this.options;
paths.forEach((path) => {
// convert to absolute path unless relative path already matches
if (!sysPath.isAbsolute(path) && !this._closers.has(path)) {
if (cwd) path = sysPath.join(cwd, path);
path = sysPath.resolve(path);
}
this._closePath(path);
this._ignoredPaths.add(path);
if (this._watched.has(path)) {
this._ignoredPaths.add(path + SLASH_GLOBSTAR);
}
// reset the cached userIgnored anymatch fn
// to make ignoredPaths changes effective
this._userIgnored = undefined;
});
return this;
}
/**
* Close watchers and remove all listeners from watched paths.
* @returns {Promise<void>}.
*/
close() {
if (this.closed) return this._closePromise;
this.closed = true;
// Memory management.
this.removeAllListeners();
const closers = [];
this._closers.forEach(closerList => closerList.forEach(closer => {
const promise = closer();
if (promise instanceof Promise) closers.push(promise);
}));
this._streams.forEach(stream => stream.destroy());
this._userIgnored = undefined;
this._readyCount = 0;
this._readyEmitted = false;
this._watched.forEach(dirent => dirent.dispose());
['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => {
this[`_${key}`].clear();
});
this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve();
return this._closePromise;
}
/**
* Expose list of watched paths
* @returns {Object} for chaining
*/
getWatched() {
const watchList = {};
this._watched.forEach((entry, dir) => {
const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
watchList[key || ONE_DOT] = entry.getChildren().sort();
});
return watchList;
}
emitWithAll(event, args) {
this.emit(...args);
if (event !== EV_ERROR) this.emit(EV_ALL, ...args);
}
// Common helpers
// --------------
/**
* Normalize and emit events.
* Calling _emit DOES NOT MEAN emit() would be called!
* @param {EventName} event Type of event
* @param {Path} path File or directory path
* @param {*=} val1 arguments to be passed with event
* @param {*=} val2
* @param {*=} val3
* @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
*/
async _emit(event, path, val1, val2, val3) {
if (this.closed) return;
const opts = this.options;
if (isWindows) path = sysPath.normalize(path);
if (opts.cwd) path = sysPath.relative(opts.cwd, path);
/** @type Array<any> */
const args = [event, path];
if (val3 !== undefined) args.push(val1, val2, val3);
else if (val2 !== undefined) args.push(val1, val2);
else if (val1 !== undefined) args.push(val1);
const awf = opts.awaitWriteFinish;
let pw;
if (awf && (pw = this._pendingWrites.get(path))) {
pw.lastChange = new Date();
return this;
}
if (opts.atomic) {
if (event === EV_UNLINK) {
this._pendingUnlinks.set(path, args);
setTimeout(() => {
this._pendingUnlinks.forEach((entry, path) => {
this.emit(...entry);
this.emit(EV_ALL, ...entry);
this._pendingUnlinks.delete(path);
});
}, typeof opts.atomic === 'number' ? opts.atomic : 100);
return this;
}
if (event === EV_ADD && this._pendingUnlinks.has(path)) {
event = args[0] = EV_CHANGE;
this._pendingUnlinks.delete(path);
}
}
if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) {
const awfEmit = (err, stats) => {
if (err) {
event = args[0] = EV_ERROR;
args[1] = err;
this.emitWithAll(event, args);
} else if (stats) {
// if stats doesn't exist the file must have been deleted
if (args.length > 2) {
args[2] = stats;
} else {
args.push(stats);
}
this.emitWithAll(event, args);
}
};
this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);
return this;
}
if (event === EV_CHANGE) {
const isThrottled = !this._throttle(EV_CHANGE, path, 50);
if (isThrottled) return this;
}
if (opts.alwaysStat && val1 === undefined &&
(event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)
) {
const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
let stats;
try {
stats = await stat(fullPath);
} catch (err) {}
// Suppress event when fs_stat fails, to avoid sending undefined 'stat'
if (!stats || this.closed) return;
args.push(stats);
}
this.emitWithAll(event, args);
return this;
}
/**
* Common handler for errors
* @param {Error} error
* @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
*/
_handleError(error) {
const code = error && error.code;
if (error && code !== 'ENOENT' && code !== 'ENOTDIR' &&
(!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES'))
) {
this.emit(EV_ERROR, error);
}
return error || this.closed;
}
/**
* Helper utility for throttling
* @param {ThrottleType} actionType type being throttled
* @param {Path} path being acted upon
* @param {Number} timeout duration of time to suppress duplicate actions
* @returns {Object|false} tracking object or false if action should be suppressed
*/
_throttle(actionType, path, timeout) {
if (!this._throttled.has(actionType)) {
this._throttled.set(actionType, new Map());
}
/** @type {Map<Path, Object>} */
const action = this._throttled.get(actionType);
/** @type {Object} */
const actionPath = action.get(path);
if (actionPath) {
actionPath.count++;
return false;
}
let timeoutObject;
const clear = () => {
const item = action.get(path);
const count = item ? item.count : 0;
action.delete(path);
clearTimeout(timeoutObject);
if (item) clearTimeout(item.timeoutObject);
return count;
};
timeoutObject = setTimeout(clear, timeout);
const thr = {timeoutObject, clear, count: 0};
action.set(path, thr);
return thr;
}
_incrReadyCount() {
return this._readyCount++;
}
/**
* Awaits write operation to finish.
* Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
* @param {Path} path being acted upon
* @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
* @param {EventName} event
* @param {Function} awfEmit Callback to be called when ready for event to be emitted.
*/
_awaitWriteFinish(path, threshold, event, awfEmit) {
let timeoutHandler;
let fullPath = path;
if (this.options.cwd && !sysPath.isAbsolute(path)) {
fullPath = sysPath.join(this.options.cwd, path);
}
const now = new Date();
const awaitWriteFinish = (prevStat) => {
fs.stat(fullPath, (err, curStat) => {
if (err || !this._pendingWrites.has(path)) {
if (err && err.code !== 'ENOENT') awfEmit(err);
return;
}
const now = Number(new Date());
if (prevStat && curStat.size !== prevStat.size) {
this._pendingWrites.get(path).lastChange = now;
}
const pw = this._pendingWrites.get(path);
const df = now - pw.lastChange;
if (df >= threshold) {
this._pendingWrites.delete(path);
awfEmit(undefined, curStat);
} else {
timeoutHandler = setTimeout(
awaitWriteFinish,
this.options.awaitWriteFinish.pollInterval,
curStat
);
}
});
};
if (!this._pendingWrites.has(path)) {
this._pendingWrites.set(path, {
lastChange: now,
cancelWait: () => {
this._pendingWrites.delete(path);
clearTimeout(timeoutHandler);
return event;
}
});
timeoutHandler = setTimeout(
awaitWriteFinish,
this.options.awaitWriteFinish.pollInterval
);
}
}
_getGlobIgnored() {
return [...this._ignoredPaths.values()];
}
/**
* Determines whether user has asked to ignore this path.
* @param {Path} path filepath or dir
* @param {fs.Stats=} stats result of fs.stat
* @returns {Boolean}
*/
_isIgnored(path, stats) {
if (this.options.atomic && DOT_RE.test(path)) return true;
if (!this._userIgnored) {
const {cwd} = this.options;
const ign = this.options.ignored;
const ignored = ign && ign.map(normalizeIgnored(cwd));
const paths = arrify(ignored)
.filter((path) => typeof path === STRING_TYPE && !isGlob(path))
.map((path) => path + SLASH_GLOBSTAR);
const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths);
this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS);
}
return this._userIgnored([path, stats]);
}
_isntIgnored(path, stat) {
return !this._isIgnored(path, stat);
}
/**
* Provides a set of common helpers and properties relating to symlink and glob handling.
* @param {Path} path file, directory, or glob pattern being watched
* @param {Number=} depth at any depth > 0, this isn't a glob
* @returns {WatchHelper} object containing helpers for this path
*/
_getWatchHelpers(path, depth) {
const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path);
const follow = this.options.followSymlinks;
return new WatchHelper(path, watchPath, follow, this);
}
// Directory helpers
// -----------------
/**
* Provides directory tracking objects
* @param {String} directory path of the directory
* @returns {DirEntry} the directory's tracking object
*/
_getWatchedDir(directory) {
if (!this._boundRemove) this._boundRemove = this._remove.bind(this);
const dir = sysPath.resolve(directory);
if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
return this._watched.get(dir);
}
// File helpers
// ------------
/**
* Check for read permissions.
* Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405
* @param {fs.Stats} stats - object, result of fs_stat
* @returns {Boolean} indicates whether the file can be read
*/
_hasReadPermissions(stats) {
if (this.options.ignorePermissionErrors) return true;
// stats.mode may be bigint
const md = stats && Number.parseInt(stats.mode, 10);
const st = md & 0o777;
const it = Number.parseInt(st.toString(8)[0], 10);
return Boolean(4 & it);
}
/**
* Handles emitting unlink events for
* files and directories, and via recursion, for
* files and directories within directories that are unlinked
* @param {String} directory within which the following item is located
* @param {String} item base path of item/directory
* @returns {void}
*/
_remove(directory, item, isDirectory) {
// if what is being deleted is a directory, get that directory's paths
// for recursive deleting and cleaning of watched object
// if it is not a directory, nestedDirectoryChildren will be empty array
const path = sysPath.join(directory, item);
const fullPath = sysPath.resolve(path);
isDirectory = isDirectory != null
? isDirectory
: this._watched.has(path) || this._watched.has(fullPath);
// prevent duplicate handling in case of arriving here nearly simultaneously
// via multiple paths (such as _handleFile and _handleDir)
if (!this._throttle('remove', path, 100)) return;
// if the only watched file is removed, watch for its return
if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) {
this.add(directory, item, true);
}
// This will create a new entry in the watched object in either case
// so we got to do the directory check beforehand
const wp = this._getWatchedDir(path);
const nestedDirectoryChildren = wp.getChildren();
// Recursively remove children directories / files.
nestedDirectoryChildren.forEach(nested => this._remove(path, nested));
// Check if item was on the watched list and remove it
const parent = this._getWatchedDir(directory);
const wasTracked = parent.has(item);
parent.remove(item);
// Fixes issue #1042 -> Relative paths were detected and added as symlinks
// (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612),
// but never removed from the map in case the path was deleted.
// This leads to an incorrect state if the path was recreated:
// https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553
if (this._symlinkPaths.has(fullPath)) {
this._symlinkPaths.delete(fullPath);
}
// If we wait for this file to be fully written, cancel the wait.
let relPath = path;
if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path);
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
const event = this._pendingWrites.get(relPath).cancelWait();
if (event === EV_ADD) return;
}
// The Entry will either be a directory that just got removed
// or a bogus entry to a file, in either case we have to remove it
this._watched.delete(path);
this._watched.delete(fullPath);
const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK;
if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
// Avoid conflicts if we later create another file with the same name
if (!this.options.useFsEvents) {
this._closePath(path);
}
}
/**
* Closes all watchers for a path
* @param {Path} path
*/
_closePath(path) {
this._closeFile(path)
const dir = sysPath.dirname(path);
this._getWatchedDir(dir).remove(sysPath.basename(path));
}
/**
* Closes only file-specific watchers
* @param {Path} path
*/
_closeFile(path) {
const closers = this._closers.get(path);
if (!closers) return;
closers.forEach(closer => closer());
this._closers.delete(path);
}
/**
*
* @param {Path} path
* @param {Function} closer
*/
_addPathCloser(path, closer) {
if (!closer) return;
let list = this._closers.get(path);
if (!list) {
list = [];
this._closers.set(path, list);
}
list.push(closer);
}
_readdirp(root, opts) {
if (this.closed) return;
const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts};
let stream = readdirp(root, options);
this._streams.add(stream);
stream.once(STR_CLOSE, () => {
stream = undefined;
});
stream.once(STR_END, () => {
if (stream) {
this._streams.delete(stream);
stream = undefined;
}
});
return stream;
}
}
// Export FSWatcher class
exports.FSWatcher = FSWatcher;
/**
* Instantiates watcher with paths to be tracked.
* @param {String|Array<String>} paths file/directory paths and/or globs
* @param {Object=} options chokidar opts
* @returns an instance of FSWatcher for chaining.
*/
const watch = (paths, options) => {
const watcher = new FSWatcher(options);
watcher.add(paths);
return watcher;
};
exports.watch = watch;

View File

@@ -0,0 +1,407 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var path = require('path');
var estreeWalker = require('estree-walker');
var pm = require('picomatch');
const addExtension = function addExtension(filename, ext = '.js') {
let result = `${filename}`;
if (!path.extname(filename))
result += ext;
return result;
};
const extractors = {
ArrayPattern(names, param) {
for (const element of param.elements) {
if (element)
extractors[element.type](names, element);
}
},
AssignmentPattern(names, param) {
extractors[param.left.type](names, param.left);
},
Identifier(names, param) {
names.push(param.name);
},
MemberExpression() { },
ObjectPattern(names, param) {
for (const prop of param.properties) {
// @ts-ignore Typescript reports that this is not a valid type
if (prop.type === 'RestElement') {
extractors.RestElement(names, prop);
}
else {
extractors[prop.value.type](names, prop.value);
}
}
},
RestElement(names, param) {
extractors[param.argument.type](names, param.argument);
}
};
const extractAssignedNames = function extractAssignedNames(param) {
const names = [];
extractors[param.type](names, param);
return names;
};
const blockDeclarations = {
const: true,
let: true
};
class Scope {
constructor(options = {}) {
this.parent = options.parent;
this.isBlockScope = !!options.block;
this.declarations = Object.create(null);
if (options.params) {
options.params.forEach((param) => {
extractAssignedNames(param).forEach((name) => {
this.declarations[name] = true;
});
});
}
}
addDeclaration(node, isBlockDeclaration, isVar) {
if (!isBlockDeclaration && this.isBlockScope) {
// it's a `var` or function node, and this
// is a block scope, so we need to go up
this.parent.addDeclaration(node, isBlockDeclaration, isVar);
}
else if (node.id) {
extractAssignedNames(node.id).forEach((name) => {
this.declarations[name] = true;
});
}
}
contains(name) {
return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);
}
}
const attachScopes = function attachScopes(ast, propertyName = 'scope') {
let scope = new Scope();
estreeWalker.walk(ast, {
enter(n, parent) {
const node = n;
// function foo () {...}
// class Foo {...}
if (/(?:Function|Class)Declaration/.test(node.type)) {
scope.addDeclaration(node, false, false);
}
// var foo = 1
if (node.type === 'VariableDeclaration') {
const { kind } = node;
const isBlockDeclaration = blockDeclarations[kind];
node.declarations.forEach((declaration) => {
scope.addDeclaration(declaration, isBlockDeclaration, true);
});
}
let newScope;
// create new function scope
if (node.type.includes('Function')) {
const func = node;
newScope = new Scope({
parent: scope,
block: false,
params: func.params
});
// named function expressions - the name is considered
// part of the function's scope
if (func.type === 'FunctionExpression' && func.id) {
newScope.addDeclaration(func, false, false);
}
}
// create new for scope
if (/For(?:In|Of)?Statement/.test(node.type)) {
newScope = new Scope({
parent: scope,
block: true
});
}
// create new block scope
if (node.type === 'BlockStatement' && !parent.type.includes('Function')) {
newScope = new Scope({
parent: scope,
block: true
});
}
// catch clause has its own block scope
if (node.type === 'CatchClause') {
newScope = new Scope({
parent: scope,
params: node.param ? [node.param] : [],
block: true
});
}
if (newScope) {
Object.defineProperty(node, propertyName, {
value: newScope,
configurable: true
});
scope = newScope;
}
},
leave(n) {
const node = n;
if (node[propertyName])
scope = scope.parent;
}
});
return scope;
};
// Helper since Typescript can't detect readonly arrays with Array.isArray
function isArray(arg) {
return Array.isArray(arg);
}
function ensureArray(thing) {
if (isArray(thing))
return thing;
if (thing == null)
return [];
return [thing];
}
const normalizePathRegExp = new RegExp(`\\${path.win32.sep}`, 'g');
const normalizePath = function normalizePath(filename) {
return filename.replace(normalizePathRegExp, path.posix.sep);
};
function getMatcherString(id, resolutionBase) {
if (resolutionBase === false || path.isAbsolute(id) || id.startsWith('**')) {
return normalizePath(id);
}
// resolve('') is valid and will default to process.cwd()
const basePath = normalizePath(path.resolve(resolutionBase || ''))
// escape all possible (posix + win) path characters that might interfere with regex
.replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
// Note that we use posix.join because:
// 1. the basePath has been normalized to use /
// 2. the incoming glob (id) matcher, also uses /
// otherwise Node will force backslash (\) on windows
return path.posix.join(basePath, normalizePath(id));
}
const createFilter = function createFilter(include, exclude, options) {
const resolutionBase = options && options.resolve;
const getMatcher = (id) => id instanceof RegExp
? id
: {
test: (what) => {
// this refactor is a tad overly verbose but makes for easy debugging
const pattern = getMatcherString(id, resolutionBase);
const fn = pm(pattern, { dot: true });
const result = fn(what);
return result;
}
};
const includeMatchers = ensureArray(include).map(getMatcher);
const excludeMatchers = ensureArray(exclude).map(getMatcher);
if (!includeMatchers.length && !excludeMatchers.length)
return (id) => typeof id === 'string' && !id.includes('\0');
return function result(id) {
if (typeof id !== 'string')
return false;
if (id.includes('\0'))
return false;
const pathId = normalizePath(id);
for (let i = 0; i < excludeMatchers.length; ++i) {
const matcher = excludeMatchers[i];
if (matcher instanceof RegExp) {
matcher.lastIndex = 0;
}
if (matcher.test(pathId))
return false;
}
for (let i = 0; i < includeMatchers.length; ++i) {
const matcher = includeMatchers[i];
if (matcher instanceof RegExp) {
matcher.lastIndex = 0;
}
if (matcher.test(pathId))
return true;
}
return !includeMatchers.length;
};
};
const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));
forbiddenIdentifiers.add('');
const makeLegalIdentifier = function makeLegalIdentifier(str) {
let identifier = str
.replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
.replace(/[^$_a-zA-Z0-9]/g, '_');
if (/\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) {
identifier = `_${identifier}`;
}
return identifier || '_';
};
function stringify(obj) {
return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);
}
function serializeArray(arr, indent, baseIndent) {
let output = '[';
const separator = indent ? `\n${baseIndent}${indent}` : '';
for (let i = 0; i < arr.length; i++) {
const key = arr[i];
output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`;
}
return `${output}${indent ? `\n${baseIndent}` : ''}]`;
}
function serializeObject(obj, indent, baseIndent) {
let output = '{';
const separator = indent ? `\n${baseIndent}${indent}` : '';
const entries = Object.entries(obj);
for (let i = 0; i < entries.length; i++) {
const [key, value] = entries[i];
const stringKey = makeLegalIdentifier(key) === key ? key : stringify(key);
output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`;
}
return `${output}${indent ? `\n${baseIndent}` : ''}}`;
}
function serialize(obj, indent, baseIndent) {
if (typeof obj === 'object' && obj !== null) {
if (Array.isArray(obj))
return serializeArray(obj, indent, baseIndent);
if (obj instanceof Date)
return `new Date(${obj.getTime()})`;
if (obj instanceof RegExp)
return obj.toString();
return serializeObject(obj, indent, baseIndent);
}
if (typeof obj === 'number') {
if (obj === Infinity)
return 'Infinity';
if (obj === -Infinity)
return '-Infinity';
if (obj === 0)
return 1 / obj === Infinity ? '0' : '-0';
if (obj !== obj)
return 'NaN'; // eslint-disable-line no-self-compare
}
if (typeof obj === 'symbol') {
const key = Symbol.keyFor(obj);
// eslint-disable-next-line no-undefined
if (key !== undefined)
return `Symbol.for(${stringify(key)})`;
}
if (typeof obj === 'bigint')
return `${obj}n`;
return stringify(obj);
}
// isWellFormed exists from Node.js 20
const hasStringIsWellFormed = 'isWellFormed' in String.prototype;
function isWellFormedString(input) {
// @ts-expect-error String::isWellFormed exists from ES2024. tsconfig lib is set to ES6
if (hasStringIsWellFormed)
return input.isWellFormed();
// https://github.com/tc39/proposal-is-usv-string/blob/main/README.md#algorithm
return !/\p{Surrogate}/u.test(input);
}
const dataToEsm = function dataToEsm(data, options = {}) {
var _a, _b;
const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
const _ = options.compact ? '' : ' ';
const n = options.compact ? '' : '\n';
const declarationType = options.preferConst ? 'const' : 'var';
if (options.namedExports === false ||
typeof data !== 'object' ||
Array.isArray(data) ||
data instanceof Date ||
data instanceof RegExp ||
data === null) {
const code = serialize(data, options.compact ? null : t, '');
const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape
return `export default${magic}${code};`;
}
let maxUnderbarPrefixLength = 0;
for (const key of Object.keys(data)) {
const underbarPrefixLength = (_b = (_a = /^(_+)/.exec(key)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0;
if (underbarPrefixLength > maxUnderbarPrefixLength) {
maxUnderbarPrefixLength = underbarPrefixLength;
}
}
const arbitraryNamePrefix = `${'_'.repeat(maxUnderbarPrefixLength + 1)}arbitrary`;
let namedExportCode = '';
const defaultExportRows = [];
const arbitraryNameExportRows = [];
for (const [key, value] of Object.entries(data)) {
if (key === makeLegalIdentifier(key)) {
if (options.objectShorthand)
defaultExportRows.push(key);
else
defaultExportRows.push(`${key}:${_}${key}`);
namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
}
else {
defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
if (options.includeArbitraryNames && isWellFormedString(key)) {
const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`);
}
}
}
const arbitraryExportCode = arbitraryNameExportRows.length > 0
? `export${_}{${n}${t}${arbitraryNameExportRows.join(`,${n}${t}`)}${n}};${n}`
: '';
const defaultExportCode = `export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
return `${namedExportCode}${arbitraryExportCode}${defaultExportCode}`;
};
function exactRegex(str, flags) {
return new RegExp(`^${combineMultipleStrings(str)}$`, flags);
}
function prefixRegex(str, flags) {
return new RegExp(`^${combineMultipleStrings(str)}`, flags);
}
function suffixRegex(str, flags) {
return new RegExp(`${combineMultipleStrings(str)}$`, flags);
}
const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
function escapeRegex(str) {
return str.replace(escapeRegexRE, '\\$&');
}
function combineMultipleStrings(str) {
if (Array.isArray(str)) {
const escapeStr = str.map(escapeRegex).join('|');
if (escapeStr && str.length > 1) {
return `(?:${escapeStr})`;
}
return escapeStr;
}
return escapeRegex(str);
}
// TODO: remove this in next major
var index = {
addExtension,
attachScopes,
createFilter,
dataToEsm,
exactRegex,
extractAssignedNames,
makeLegalIdentifier,
normalizePath,
prefixRegex,
suffixRegex
};
exports.addExtension = addExtension;
exports.attachScopes = attachScopes;
exports.createFilter = createFilter;
exports.dataToEsm = dataToEsm;
exports.default = index;
exports.exactRegex = exactRegex;
exports.extractAssignedNames = extractAssignedNames;
exports.makeLegalIdentifier = makeLegalIdentifier;
exports.normalizePath = normalizePath;
exports.prefixRegex = prefixRegex;
exports.suffixRegex = suffixRegex;
module.exports = Object.assign(exports.default, exports);
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,30 @@
import type { ContextOptions } from "./types.js";
/**
* The {@link endOfTomorrow} function options.
*/
export interface EndOfTomorrowOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* @name endOfTomorrow
* @category Day Helpers
* @summary Return the end of tomorrow.
* @pure false
*
* @description
* Return the end of tomorrow.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param options - The options
* @returns The end of tomorrow
*
* @example
* // If today is 6 October 2014:
* const result = endOfTomorrow()
* //=> Tue Oct 7 2014 23:59:59.999
*/
export declare function endOfTomorrow<
DateType extends Date,
ResultDate extends Date = DateType,
>(options?: EndOfTomorrowOptions<ResultDate> | undefined): ResultDate;

View File

@@ -0,0 +1 @@
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/light/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsD,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGvG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAIlD,6EAA6E;AAC7E,qBAAa,eAAgB,SAAQ,mBAAmB,CAAC,iBAAiB,CAAC;IACzE,OAAO,CAAC,qBAAqB,CAA6B;IAC1D,OAAO,CAAC,gCAAgC,CAA2B;IACnE,OAAO,CAAC,uBAAuB,CAA2B;gBAEvC,OAAO,EAAE,iBAAiB;IAqC7C,kBAAkB;IAEL,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;IAQ1D,kBAAkB;IAEL,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC;IAgBtE;;;;;;OAMG;IASI,yBAAyB,IAAI,IAAI;CAiBzC"}

View File

@@ -0,0 +1,13 @@
'use strict';
module.exports = string => {
if (typeof string !== 'string') {
throw new TypeError('Expected a string');
}
// Escape characters with special meaning either inside or outside character sets.
// Use a simple backslash escape when its always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns stricter grammar.
return string
.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
.replace(/-/g, '\\x2d');
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC1B,aAAa,EACb,KAAK,EACL,SAAS,EACT,OAAO,IAAI,WAAW,EACtB,mBAAmB,EACnB,KAAK,EACL,aAAa,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAKL,MAAM,EAEP,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAOlE,KAAK,sBAAsB,GAAG,0BAA0B,GACtD,6BAA6B,GAAG;IAC9B,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;;;;;;;;;;OAgBG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC9B,CAAC;AACJ;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,uBAAuB,CAAC,GAAG,sBAAsB,CAAC;AAE3F;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC,uBAAuB,CAAC,GAAG,sBAAsB,CAAC;AAEnG;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,MAAM,CAAC,oBAAoB,CAAC;IAC7D;;;;OAIG;gBACgB,OAAO,EAAE,oBAAoB;IAoDhD;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAInF;;OAEG;IACI,gBAAgB,CACrB,OAAO,EAAE,mBAAmB,EAC5B,KAAK,GAAE,aAAsB,EAC7B,IAAI,CAAC,EAAE,SAAS,GACf,WAAW,CAAC,KAAK,CAAC;IAIrB;;OAEG;IACH,SAAS,CAAC,aAAa,CACrB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,KAAK,EACnB,cAAc,EAAE,KAAK,GACpB,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC;CAK7B;AAED,+BAA+B;AAC/B,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,OAAO,CAAC,oBAAoB,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAW7F"}

View File

@@ -0,0 +1,4 @@
import { PathLike } from 'node:fs'
export declare function watchFileCreated(filename: PathLike): Promise<void>
export declare function watchForWrite(filename: PathLike, testString: string): Promise<void>

View File

@@ -0,0 +1,15 @@
type VNode = any;
import { FeedbackFormData, FeedbackInternalOptions, FeedbackScreenshotIntegration, SendFeedback } from '@sentry/core';
// replaced import from preact
export interface Props extends Pick<FeedbackInternalOptions, 'showEmail' | 'showName'> {
options: FeedbackInternalOptions;
defaultEmail: string;
defaultName: string;
onFormClose: () => void;
onSubmit: SendFeedback;
onSubmitSuccess: (data: FeedbackFormData, eventId: string) => void;
onSubmitError: (error: Error) => void;
screenshotInput: ReturnType<FeedbackScreenshotIntegration['createInput']> | undefined;
}
export declare function Form({ options, defaultEmail, defaultName, onFormClose, onSubmit, onSubmitSuccess, onSubmitError, showEmail, showName, screenshotInput, }: Props): VNode;
//# sourceMappingURL=Form.d.ts.map

View File

@@ -0,0 +1,82 @@
'use strict'
const bench = require('fastbench')
const pino = require('../')
const bunyan = require('bunyan')
const bole = require('bole')('bench')
const winston = require('winston')
const fs = require('node:fs')
const dest = fs.createWriteStream('/dev/null')
const loglevel = require('./utils/wrap-log-level')(dest)
const plogNodeStream = pino(dest)
delete require.cache[require.resolve('../')]
const plogDest = require('../')(pino.destination('/dev/null'))
delete require.cache[require.resolve('../')]
const plogMinLength = require('../')(pino.destination({ dest: '/dev/null', sync: false, minLength: 4096 }))
const blog = bunyan.createLogger({
name: 'myapp',
streams: [{
level: 'trace',
stream: dest
}]
})
require('bole').output({
level: 'info',
stream: dest
}).setFastTime(true)
const chill = winston.createLogger({
transports: [
new winston.transports.Stream({
stream: fs.createWriteStream('/dev/null')
})
]
})
const max = 10
const run = bench([
function benchBunyanObj (cb) {
for (var i = 0; i < max; i++) {
blog.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchWinstonObj (cb) {
for (var i = 0; i < max; i++) {
chill.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchBoleObj (cb) {
for (var i = 0; i < max; i++) {
bole.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchLogLevelObject (cb) {
for (var i = 0; i < max; i++) {
loglevel.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoObj (cb) {
for (var i = 0; i < max; i++) {
plogDest.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoMinLengthObj (cb) {
for (var i = 0; i < max; i++) {
plogMinLength.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoNodeStreamObj (cb) {
for (var i = 0; i < max; i++) {
plogNodeStream.info({ hello: 'world' })
}
setImmediate(cb)
}
], 10000)
run(run)

View File

@@ -0,0 +1,766 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const { constants } = require("buffer");
const { pipeline } = require("stream");
const {
constants: zConstants,
// eslint-disable-next-line n/no-unsupported-features/node-builtins
createBrotliCompress,
// eslint-disable-next-line n/no-unsupported-features/node-builtins
createBrotliDecompress,
createGunzip,
createGzip
} = require("zlib");
const { DEFAULTS } = require("../config/defaults");
const createHash = require("../util/createHash");
const { dirname, join, mkdirp } = require("../util/fs");
const memoize = require("../util/memoize");
const SerializerMiddleware = require("./SerializerMiddleware");
/** @typedef {import("../util/Hash").HashFunction} HashFunction */
/** @typedef {import("../util/fs").IStats} IStats */
/** @typedef {import("../util/fs").IntermediateFileSystem} IntermediateFileSystem */
/** @typedef {import("./types").BufferSerializableType} BufferSerializableType */
/*
Format:
File -> Header Section*
Version -> u32
AmountOfSections -> u32
SectionSize -> i32 (if less than zero represents lazy value)
Header -> Version AmountOfSections SectionSize*
Buffer -> n bytes
Section -> Buffer
*/
// "wpc" + 1 in little-endian
const VERSION = 0x01637077;
const WRITE_LIMIT_TOTAL = 0x7fff0000;
const WRITE_LIMIT_CHUNK = 511 * 1024 * 1024;
/**
* @param {Buffer[]} buffers buffers
* @param {HashFunction} hashFunction hash function to use
* @returns {string} hash
*/
const hashForName = (buffers, hashFunction) => {
const hash = createHash(hashFunction);
for (const buf of buffers) hash.update(buf);
return hash.digest("hex");
};
const COMPRESSION_CHUNK_SIZE = 100 * 1024 * 1024;
const DECOMPRESSION_CHUNK_SIZE = 100 * 1024 * 1024;
/** @type {(buffer: Buffer, value: number, offset: number) => void} */
const writeUInt64LE = Buffer.prototype.writeBigUInt64LE
? (buf, value, offset) => {
buf.writeBigUInt64LE(BigInt(value), offset);
}
: (buf, value, offset) => {
const low = value % 0x100000000;
const high = (value - low) / 0x100000000;
buf.writeUInt32LE(low, offset);
buf.writeUInt32LE(high, offset + 4);
};
/** @type {(buffer: Buffer, offset: number) => void} */
const readUInt64LE = Buffer.prototype.readBigUInt64LE
? (buf, offset) => Number(buf.readBigUInt64LE(offset))
: (buf, offset) => {
const low = buf.readUInt32LE(offset);
const high = buf.readUInt32LE(offset + 4);
return high * 0x100000000 + low;
};
/** @typedef {Promise<void | void[]>} BackgroundJob */
/**
* @typedef {object} SerializeResult
* @property {string | false} name
* @property {number} size
* @property {BackgroundJob=} backgroundJob
*/
/** @typedef {{ name: string, size: number }} LazyOptions */
/**
* @typedef {import("./SerializerMiddleware").LazyFunction<BufferSerializableType[], Buffer, FileMiddleware, LazyOptions>} LazyFunction
*/
/**
* @param {FileMiddleware} middleware this
* @param {(BufferSerializableType | LazyFunction)[]} data data to be serialized
* @param {string | boolean} name file base name
* @param {(name: string | false, buffers: Buffer[], size: number) => Promise<void>} writeFile writes a file
* @param {HashFunction=} hashFunction hash function to use
* @returns {Promise<SerializeResult>} resulting file pointer and promise
*/
const serialize = async (
middleware,
data,
name,
writeFile,
hashFunction = DEFAULTS.HASH_FUNCTION
) => {
/** @type {(Buffer[] | Buffer | Promise<SerializeResult>)[]} */
const processedData = [];
/** @type {WeakMap<SerializeResult, LazyFunction>} */
const resultToLazy = new WeakMap();
/** @type {Buffer[] | undefined} */
let lastBuffers;
for (const item of await data) {
if (typeof item === "function") {
if (!SerializerMiddleware.isLazy(item)) {
throw new Error("Unexpected function");
}
if (!SerializerMiddleware.isLazy(item, middleware)) {
throw new Error(
"Unexpected lazy value with non-this target (can't pass through lazy values)"
);
}
lastBuffers = undefined;
const serializedInfo = SerializerMiddleware.getLazySerializedValue(item);
if (serializedInfo) {
if (typeof serializedInfo === "function") {
throw new Error(
"Unexpected lazy value with non-this target (can't pass through lazy values)"
);
} else {
processedData.push(serializedInfo);
}
} else {
const content = item();
if (content) {
const options = SerializerMiddleware.getLazyOptions(item);
processedData.push(
serialize(
middleware,
/** @type {BufferSerializableType[]} */
(content),
(options && options.name) || true,
writeFile,
hashFunction
).then((result) => {
/** @type {LazyOptions} */
(item.options).size = result.size;
resultToLazy.set(result, item);
return result;
})
);
} else {
throw new Error(
"Unexpected falsy value returned by lazy value function"
);
}
}
} else if (item) {
if (lastBuffers) {
lastBuffers.push(item);
} else {
lastBuffers = [item];
processedData.push(lastBuffers);
}
} else {
throw new Error("Unexpected falsy value in items array");
}
}
/** @type {BackgroundJob[]} */
const backgroundJobs = [];
const resolvedData = (await Promise.all(processedData)).map((item) => {
if (Array.isArray(item) || Buffer.isBuffer(item)) return item;
backgroundJobs.push(
/** @type {BackgroundJob} */
(item.backgroundJob)
);
// create pointer buffer from size and name
const name = /** @type {string} */ (item.name);
const nameBuffer = Buffer.from(name);
const buf = Buffer.allocUnsafe(8 + nameBuffer.length);
writeUInt64LE(buf, item.size, 0);
nameBuffer.copy(buf, 8, 0);
const lazy =
/** @type {LazyFunction} */
(resultToLazy.get(item));
SerializerMiddleware.setLazySerializedValue(lazy, buf);
return buf;
});
/** @type {number[]} */
const lengths = [];
for (const item of resolvedData) {
if (Array.isArray(item)) {
let l = 0;
for (const b of item) l += b.length;
while (l > 0x7fffffff) {
lengths.push(0x7fffffff);
l -= 0x7fffffff;
}
lengths.push(l);
} else if (item) {
lengths.push(-item.length);
} else {
throw new Error(`Unexpected falsy value in resolved data ${item}`);
}
}
const header = Buffer.allocUnsafe(8 + lengths.length * 4);
header.writeUInt32LE(VERSION, 0);
header.writeUInt32LE(lengths.length, 4);
for (let i = 0; i < lengths.length; i++) {
header.writeInt32LE(lengths[i], 8 + i * 4);
}
/** @type {Buffer[]} */
const buf = [header];
for (const item of resolvedData) {
if (Array.isArray(item)) {
for (const b of item) buf.push(b);
} else if (item) {
buf.push(item);
}
}
if (name === true) {
name = hashForName(buf, hashFunction);
}
let size = 0;
for (const b of buf) size += b.length;
backgroundJobs.push(writeFile(name, buf, size));
return {
size,
name,
backgroundJob:
backgroundJobs.length === 1
? backgroundJobs[0]
: /** @type {BackgroundJob} */ (Promise.all(backgroundJobs))
};
};
/**
* @param {FileMiddleware} middleware this
* @param {string | false} name filename
* @param {(name: string | false) => Promise<Buffer[]>} readFile read content of a file
* @returns {Promise<BufferSerializableType[]>} deserialized data
*/
const deserialize = async (middleware, name, readFile) => {
const contents = await readFile(name);
if (contents.length === 0) throw new Error(`Empty file ${name}`);
let contentsIndex = 0;
let contentItem = contents[0];
let contentItemLength = contentItem.length;
let contentPosition = 0;
if (contentItemLength === 0) throw new Error(`Empty file ${name}`);
const nextContent = () => {
contentsIndex++;
contentItem = contents[contentsIndex];
contentItemLength = contentItem.length;
contentPosition = 0;
};
/**
* @param {number} n number of bytes to ensure
*/
const ensureData = (n) => {
if (contentPosition === contentItemLength) {
nextContent();
}
while (contentItemLength - contentPosition < n) {
const remaining = contentItem.slice(contentPosition);
let lengthFromNext = n - remaining.length;
/** @type {Buffer[]} */
const buffers = [remaining];
for (let i = contentsIndex + 1; i < contents.length; i++) {
const l = contents[i].length;
if (l > lengthFromNext) {
buffers.push(contents[i].slice(0, lengthFromNext));
contents[i] = contents[i].slice(lengthFromNext);
lengthFromNext = 0;
break;
} else {
buffers.push(contents[i]);
contentsIndex = i;
lengthFromNext -= l;
}
}
if (lengthFromNext > 0) throw new Error("Unexpected end of data");
contentItem = Buffer.concat(buffers, n);
contentItemLength = n;
contentPosition = 0;
}
};
/**
* @returns {number} value value
*/
const readUInt32LE = () => {
ensureData(4);
const value = contentItem.readUInt32LE(contentPosition);
contentPosition += 4;
return value;
};
/**
* @returns {number} value value
*/
const readInt32LE = () => {
ensureData(4);
const value = contentItem.readInt32LE(contentPosition);
contentPosition += 4;
return value;
};
/**
* @param {number} l length
* @returns {Buffer} buffer
*/
const readSlice = (l) => {
ensureData(l);
if (contentPosition === 0 && contentItemLength === l) {
const result = contentItem;
if (contentsIndex + 1 < contents.length) {
nextContent();
} else {
contentPosition = l;
}
return result;
}
const result = contentItem.slice(contentPosition, contentPosition + l);
contentPosition += l;
// we clone the buffer here to allow the original content to be garbage collected
return l * 2 < contentItem.buffer.byteLength ? Buffer.from(result) : result;
};
const version = readUInt32LE();
if (version !== VERSION) {
throw new Error("Invalid file version");
}
const sectionCount = readUInt32LE();
/** @type {number[]} */
const lengths = [];
let lastLengthPositive = false;
for (let i = 0; i < sectionCount; i++) {
const value = readInt32LE();
const valuePositive = value >= 0;
if (lastLengthPositive && valuePositive) {
lengths[lengths.length - 1] += value;
} else {
lengths.push(value);
lastLengthPositive = valuePositive;
}
}
/** @type {BufferSerializableType[]} */
const result = [];
for (let length of lengths) {
if (length < 0) {
const slice = readSlice(-length);
const size = Number(readUInt64LE(slice, 0));
const nameBuffer = slice.slice(8);
const name = nameBuffer.toString();
const lazy =
/** @type {LazyFunction} */
(
SerializerMiddleware.createLazy(
memoize(() => deserialize(middleware, name, readFile)),
middleware,
{ name, size },
slice
)
);
result.push(lazy);
} else {
if (contentPosition === contentItemLength) {
nextContent();
} else if (contentPosition !== 0) {
if (length <= contentItemLength - contentPosition) {
result.push(
Buffer.from(
contentItem.buffer,
contentItem.byteOffset + contentPosition,
length
)
);
contentPosition += length;
length = 0;
} else {
const l = contentItemLength - contentPosition;
result.push(
Buffer.from(
contentItem.buffer,
contentItem.byteOffset + contentPosition,
l
)
);
length -= l;
contentPosition = contentItemLength;
}
} else if (length >= contentItemLength) {
result.push(contentItem);
length -= contentItemLength;
contentPosition = contentItemLength;
} else {
result.push(
Buffer.from(contentItem.buffer, contentItem.byteOffset, length)
);
contentPosition += length;
length = 0;
}
while (length > 0) {
nextContent();
if (length >= contentItemLength) {
result.push(contentItem);
length -= contentItemLength;
contentPosition = contentItemLength;
} else {
result.push(
Buffer.from(contentItem.buffer, contentItem.byteOffset, length)
);
contentPosition += length;
length = 0;
}
}
}
}
return result;
};
/** @typedef {BufferSerializableType[]} DeserializedType */
/** @typedef {true} SerializedType */
/** @typedef {{ filename: string, extension?: string }} Context */
/**
* @extends {SerializerMiddleware<DeserializedType, SerializedType, Context>}
*/
class FileMiddleware extends SerializerMiddleware {
/**
* @param {IntermediateFileSystem} fs filesystem
* @param {HashFunction} hashFunction hash function to use
*/
constructor(fs, hashFunction = DEFAULTS.HASH_FUNCTION) {
super();
/** @type {IntermediateFileSystem} */
this.fs = fs;
/** @type {HashFunction} */
this._hashFunction = hashFunction;
}
/**
* @param {DeserializedType} data data
* @param {Context} context context object
* @returns {SerializedType | Promise<SerializedType> | null} serialized data
*/
serialize(data, context) {
const { filename, extension = "" } = context;
return new Promise((resolve, reject) => {
mkdirp(this.fs, dirname(this.fs, filename), (err) => {
if (err) return reject(err);
// It's important that we don't touch existing files during serialization
// because serialize may read existing files (when deserializing)
/** @type {Set<string>} */
const allWrittenFiles = new Set();
/**
* @param {string | false} name name
* @param {Buffer[]} content content
* @param {number} size size
* @returns {Promise<void>}
*/
const writeFile = async (name, content, size) => {
const file = name
? join(this.fs, filename, `../${name}${extension}`)
: filename;
await new Promise(
/**
* @param {(value?: undefined) => void} resolve resolve
* @param {(reason?: Error | null) => void} reject reject
*/
(resolve, reject) => {
let stream = this.fs.createWriteStream(`${file}_`);
/** @type {undefined | import("zlib").Gzip | import("zlib").BrotliCompress} */
let compression;
if (file.endsWith(".gz")) {
compression = createGzip({
chunkSize: COMPRESSION_CHUNK_SIZE,
level: zConstants.Z_BEST_SPEED
});
} else if (file.endsWith(".br")) {
compression = createBrotliCompress({
chunkSize: COMPRESSION_CHUNK_SIZE,
params: {
[zConstants.BROTLI_PARAM_MODE]: zConstants.BROTLI_MODE_TEXT,
[zConstants.BROTLI_PARAM_QUALITY]: 2,
[zConstants.BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING]: true,
[zConstants.BROTLI_PARAM_SIZE_HINT]: size
}
});
}
if (compression) {
pipeline(compression, stream, reject);
stream = compression;
stream.on("finish", () => resolve());
} else {
stream.on("error", (err) => reject(err));
stream.on("finish", () => resolve());
}
// split into chunks for WRITE_LIMIT_CHUNK size
/** @type {Buffer[]} */
const chunks = [];
for (const b of content) {
if (b.length < WRITE_LIMIT_CHUNK) {
chunks.push(b);
} else {
for (let i = 0; i < b.length; i += WRITE_LIMIT_CHUNK) {
chunks.push(b.slice(i, i + WRITE_LIMIT_CHUNK));
}
}
}
const len = chunks.length;
let i = 0;
/**
* @param {(Error | null)=} err err
*/
const batchWrite = (err) => {
// will be handled in "on" error handler
if (err) return;
if (i === len) {
stream.end();
return;
}
// queue up a batch of chunks up to the write limit
// end is exclusive
let end = i;
let sum = chunks[end++].length;
while (end < len) {
sum += chunks[end].length;
if (sum > WRITE_LIMIT_TOTAL) break;
end++;
}
while (i < end - 1) {
stream.write(chunks[i++]);
}
stream.write(chunks[i++], batchWrite);
};
batchWrite();
}
);
if (name) allWrittenFiles.add(file);
};
resolve(
serialize(this, data, false, writeFile, this._hashFunction).then(
async ({ backgroundJob }) => {
await backgroundJob;
// Rename the index file to disallow access during inconsistent file state
await new Promise(
/**
* @param {(value?: undefined) => void} resolve resolve
*/
(resolve) => {
this.fs.rename(filename, `${filename}.old`, (_err) => {
resolve();
});
}
);
// update all written files
await Promise.all(
Array.from(
allWrittenFiles,
(file) =>
new Promise(
/**
* @param {(value?: undefined) => void} resolve resolve
* @param {(reason?: Error | null) => void} reject reject
* @returns {void}
*/
(resolve, reject) => {
this.fs.rename(`${file}_`, file, (err) => {
if (err) return reject(err);
resolve();
});
}
)
)
);
// As final step automatically update the index file to have a consistent pack again
await new Promise(
/**
* @param {(value?: undefined) => void} resolve resolve
* @returns {void}
*/
(resolve) => {
this.fs.rename(`${filename}_`, filename, (err) => {
if (err) return reject(err);
resolve();
});
}
);
return /** @type {true} */ (true);
}
)
);
});
});
}
/**
* @param {SerializedType} data data
* @param {Context} context context object
* @returns {DeserializedType | Promise<DeserializedType>} deserialized data
*/
deserialize(data, context) {
const { filename, extension = "" } = context;
/**
* @param {string | boolean} name name
* @returns {Promise<Buffer[]>} result
*/
const readFile = (name) =>
new Promise((resolve, reject) => {
const file = name
? join(this.fs, filename, `../${name}${extension}`)
: filename;
this.fs.stat(file, (err, stats) => {
if (err) {
reject(err);
return;
}
let remaining = /** @type {IStats} */ (stats).size;
/** @type {Buffer | undefined} */
let currentBuffer;
/** @type {number | undefined} */
let currentBufferUsed;
/** @type {Buffer[]} */
const buf = [];
/** @type {import("zlib").Zlib & import("stream").Transform | undefined} */
let decompression;
if (file.endsWith(".gz")) {
decompression = createGunzip({
chunkSize: DECOMPRESSION_CHUNK_SIZE
});
} else if (file.endsWith(".br")) {
decompression = createBrotliDecompress({
chunkSize: DECOMPRESSION_CHUNK_SIZE
});
}
if (decompression) {
/** @typedef {(value: Buffer[] | PromiseLike<Buffer[]>) => void} NewResolve */
/** @typedef {(reason?: Error) => void} NewReject */
/** @type {NewResolve | undefined} */
let newResolve;
/** @type {NewReject | undefined} */
let newReject;
resolve(
Promise.all([
new Promise((rs, rj) => {
newResolve = rs;
newReject = rj;
}),
new Promise(
/**
* @param {(value?: undefined) => void} resolve resolve
* @param {(reason?: Error) => void} reject reject
*/
(resolve, reject) => {
decompression.on("data", (chunk) => buf.push(chunk));
decompression.on("end", () => resolve());
decompression.on("error", (err) => reject(err));
}
)
]).then(() => buf)
);
resolve = /** @type {NewResolve} */ (newResolve);
reject = /** @type {NewReject} */ (newReject);
}
this.fs.open(file, "r", (err, _fd) => {
if (err) {
reject(err);
return;
}
const fd = /** @type {number} */ (_fd);
const read = () => {
if (currentBuffer === undefined) {
currentBuffer = Buffer.allocUnsafeSlow(
Math.min(
constants.MAX_LENGTH,
remaining,
decompression ? DECOMPRESSION_CHUNK_SIZE : Infinity
)
);
currentBufferUsed = 0;
}
let readBuffer = currentBuffer;
let readOffset = /** @type {number} */ (currentBufferUsed);
let readLength =
currentBuffer.length -
/** @type {number} */ (currentBufferUsed);
// values passed to fs.read must be valid int32 values
if (readOffset > 0x7fffffff) {
readBuffer = currentBuffer.slice(readOffset);
readOffset = 0;
}
if (readLength > 0x7fffffff) {
readLength = 0x7fffffff;
}
this.fs.read(
fd,
readBuffer,
readOffset,
readLength,
null,
(err, bytesRead) => {
if (err) {
this.fs.close(fd, () => {
reject(err);
});
return;
}
/** @type {number} */
(currentBufferUsed) += bytesRead;
remaining -= bytesRead;
if (
currentBufferUsed ===
/** @type {Buffer} */
(currentBuffer).length
) {
if (decompression) {
decompression.write(currentBuffer);
} else {
buf.push(
/** @type {Buffer} */
(currentBuffer)
);
}
currentBuffer = undefined;
if (remaining === 0) {
if (decompression) {
decompression.end();
}
this.fs.close(fd, (err) => {
if (err) {
reject(err);
return;
}
resolve(buf);
});
return;
}
}
read();
}
);
};
read();
});
});
});
return deserialize(this, false, readFile);
}
}
module.exports = FileMiddleware;

View File

@@ -0,0 +1,5 @@
declare class MissingLocaleDataError extends Error {
type: string;
}
export declare function isMissingLocaleDataError(e: Error): e is MissingLocaleDataError;
export {};

Some files were not shown because too many files have changed in this diff Show More