node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) 2021 FormatJS
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.

3
server/node_modules/@formatjs/fast-memoize/README.md generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# @formatjs/fast-memoize
This is just a fork of `fast-memoize`.

32
server/node_modules/@formatjs/fast-memoize/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,32 @@
type Func = (...args: any[]) => any;
export interface Cache<K, V> {
create: CacheCreateFunc<K, V>;
}
interface CacheCreateFunc<K, V> {
(): DefaultCache<K, V>;
}
interface DefaultCache<K, V> {
get(key: K): V | undefined;
set(key: K, value: V | undefined): void;
}
export type Serializer = (args: any[]) => string;
export interface Options<F extends Func> {
cache?: Cache<string, ReturnType<F>>;
serializer?: Serializer;
strategy?: MemoizeFunc<F>;
}
export interface ResolvedOptions<F extends Func> {
cache: Cache<string, ReturnType<F>>;
serializer: Serializer;
}
export interface MemoizeFunc<F extends Func> {
(fn: F, options?: Options<F>): F;
}
export declare function memoize<F extends Func>(fn: F, options?: Options<F>): F | ((arg: any) => any);
export type StrategyFn = <F extends Func>(this: unknown, fn: F, cache: DefaultCache<string, ReturnType<F>>, serializer: Serializer, arg: any) => any;
export interface Strategies<F extends Func> {
variadic: MemoizeFunc<F>;
monadic: MemoizeFunc<F>;
}
export declare const strategies: Strategies<Func>;
export {};

82
server/node_modules/@formatjs/fast-memoize/index.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
"use strict";
//
// Main
//
Object.defineProperty(exports, "__esModule", { value: true });
exports.strategies = exports.memoize = void 0;
function memoize(fn, options) {
var cache = options && options.cache ? options.cache : cacheDefault;
var serializer = options && options.serializer ? options.serializer : serializerDefault;
var strategy = options && options.strategy ? options.strategy : strategyDefault;
return strategy(fn, {
cache: cache,
serializer: serializer,
});
}
exports.memoize = memoize;
//
// Strategy
//
function isPrimitive(value) {
return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === "string" 'unsafe' primitive for our needs
}
function monadic(fn, cache, serializer, arg) {
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
var computedValue = cache.get(cacheKey);
if (typeof computedValue === 'undefined') {
computedValue = fn.call(this, arg);
cache.set(cacheKey, computedValue);
}
return computedValue;
}
function variadic(fn, cache, serializer) {
var args = Array.prototype.slice.call(arguments, 3);
var cacheKey = serializer(args);
var computedValue = cache.get(cacheKey);
if (typeof computedValue === 'undefined') {
computedValue = fn.apply(this, args);
cache.set(cacheKey, computedValue);
}
return computedValue;
}
function assemble(fn, context, strategy, cache, serialize) {
return strategy.bind(context, fn, cache, serialize);
}
function strategyDefault(fn, options) {
var strategy = fn.length === 1 ? monadic : variadic;
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
}
function strategyVariadic(fn, options) {
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
}
function strategyMonadic(fn, options) {
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
}
//
// Serializer
//
var serializerDefault = function () {
return JSON.stringify(arguments);
};
//
// Cache
//
function ObjectWithoutPrototypeCache() {
this.cache = Object.create(null);
}
ObjectWithoutPrototypeCache.prototype.get = function (key) {
return this.cache[key];
};
ObjectWithoutPrototypeCache.prototype.set = function (key, value) {
this.cache[key] = value;
};
var cacheDefault = {
create: function create() {
// @ts-ignore
return new ObjectWithoutPrototypeCache();
},
};
exports.strategies = {
variadic: strategyVariadic,
monadic: strategyMonadic,
};

View File

@@ -0,0 +1,32 @@
type Func = (...args: any[]) => any;
export interface Cache<K, V> {
create: CacheCreateFunc<K, V>;
}
interface CacheCreateFunc<K, V> {
(): DefaultCache<K, V>;
}
interface DefaultCache<K, V> {
get(key: K): V | undefined;
set(key: K, value: V | undefined): void;
}
export type Serializer = (args: any[]) => string;
export interface Options<F extends Func> {
cache?: Cache<string, ReturnType<F>>;
serializer?: Serializer;
strategy?: MemoizeFunc<F>;
}
export interface ResolvedOptions<F extends Func> {
cache: Cache<string, ReturnType<F>>;
serializer: Serializer;
}
export interface MemoizeFunc<F extends Func> {
(fn: F, options?: Options<F>): F;
}
export declare function memoize<F extends Func>(fn: F, options?: Options<F>): F | ((arg: any) => any);
export type StrategyFn = <F extends Func>(this: unknown, fn: F, cache: DefaultCache<string, ReturnType<F>>, serializer: Serializer, arg: any) => any;
export interface Strategies<F extends Func> {
variadic: MemoizeFunc<F>;
monadic: MemoizeFunc<F>;
}
export declare const strategies: Strategies<Func>;
export {};

View File

@@ -0,0 +1,78 @@
//
// Main
//
export function memoize(fn, options) {
var cache = options && options.cache ? options.cache : cacheDefault;
var serializer = options && options.serializer ? options.serializer : serializerDefault;
var strategy = options && options.strategy ? options.strategy : strategyDefault;
return strategy(fn, {
cache: cache,
serializer: serializer,
});
}
//
// Strategy
//
function isPrimitive(value) {
return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === "string" 'unsafe' primitive for our needs
}
function monadic(fn, cache, serializer, arg) {
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
var computedValue = cache.get(cacheKey);
if (typeof computedValue === 'undefined') {
computedValue = fn.call(this, arg);
cache.set(cacheKey, computedValue);
}
return computedValue;
}
function variadic(fn, cache, serializer) {
var args = Array.prototype.slice.call(arguments, 3);
var cacheKey = serializer(args);
var computedValue = cache.get(cacheKey);
if (typeof computedValue === 'undefined') {
computedValue = fn.apply(this, args);
cache.set(cacheKey, computedValue);
}
return computedValue;
}
function assemble(fn, context, strategy, cache, serialize) {
return strategy.bind(context, fn, cache, serialize);
}
function strategyDefault(fn, options) {
var strategy = fn.length === 1 ? monadic : variadic;
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
}
function strategyVariadic(fn, options) {
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
}
function strategyMonadic(fn, options) {
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
}
//
// Serializer
//
var serializerDefault = function () {
return JSON.stringify(arguments);
};
//
// Cache
//
function ObjectWithoutPrototypeCache() {
this.cache = Object.create(null);
}
ObjectWithoutPrototypeCache.prototype.get = function (key) {
return this.cache[key];
};
ObjectWithoutPrototypeCache.prototype.set = function (key, value) {
this.cache[key] = value;
};
var cacheDefault = {
create: function create() {
// @ts-ignore
return new ObjectWithoutPrototypeCache();
},
};
export var strategies = {
variadic: strategyVariadic,
monadic: strategyMonadic,
};

View File

@@ -0,0 +1,26 @@
{
"name": "@formatjs/fast-memoize",
"version": "2.2.0",
"description": "fork of fast-memoize and support esm",
"main": "index.js",
"module": "lib/index.js",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/formatjs/formatjs.git"
},
"keywords": [
"intl",
"fast-memoize",
"memoize",
"i18n"
],
"author": "Long Ho <holevietlong@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/formatjs/formatjs/issues"
},
"homepage": "https://github.com/formatjs/formatjs#readme",
"dependencies": {
"tslib": "^2.4.0"
}
}