Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/wwwroot/mifepriston.org/node_modules/mem/ |
Upload File : |
declare namespace mem { interface CacheStorage<KeyType extends unknown, ValueType extends unknown> { has(key: KeyType): boolean; get(key: KeyType): ValueType | undefined; set(key: KeyType, value: ValueType): void; delete(key: KeyType): void; clear?: () => void; } interface Options< ArgumentsType extends unknown[], CacheKeyType extends unknown, ReturnType extends unknown > { /** Milliseconds until the cache expires. @default Infinity */ readonly maxAge?: number; /** Determines the cache key for storing the result based on the function arguments. By default, if there's only one argument and it's a [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive), it's used directly as a key, otherwise it's all the function arguments JSON stringified as an array. You could for example change it to only cache on the first argument `x => JSON.stringify(x)`. */ readonly cacheKey?: (...arguments: ArgumentsType) => CacheKeyType; /** Use a different cache storage. You could for example use a `WeakMap` instead or [`quick-lru`](https://github.com/sindresorhus/quick-lru) for a LRU cache. @default new Map() */ readonly cache?: CacheStorage<CacheKeyType, {data: ReturnType; maxAge: number}>; /** Cache rejected promises. @default false */ readonly cachePromiseRejection?: boolean; } } declare const mem: { /** [Memoize](https://en.wikipedia.org/wiki/Memoization) functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input. @param fn - Function to be memoized. @example ``` import mem = require('mem'); let i = 0; const counter = () => ++i; const memoized = mem(counter); memoized('foo'); //=> 1 // Cached as it's the same arguments memoized('foo'); //=> 1 // Not cached anymore as the arguments changed memoized('bar'); //=> 2 memoized('bar'); //=> 2 ``` */ < ArgumentsType extends unknown[], ReturnType extends unknown, CacheKeyType extends unknown >( fn: (...arguments: ArgumentsType) => ReturnType, options?: mem.Options<ArgumentsType, CacheKeyType, ReturnType> ): (...arguments: ArgumentsType) => ReturnType; /** Clear all cached data of a memoized function. @param fn - Memoized function. */ clear<ArgumentsType extends unknown[], ReturnType extends unknown>( fn: (...arguments: ArgumentsType) => ReturnType ): void; // TODO: Remove this for the next major release default: typeof mem; }; export = mem;