zeed 0.10.21 → 0.10.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/chunk-FXACG46Y.js +16 -0
- package/dist/chunk-FXACG46Y.js.map +1 -0
- package/dist/index.all.d.ts +17 -13
- package/dist/index.browser.cjs +156 -155
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.ts +2 -2
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +277 -275
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +3 -2
- package/dist/index.node.js +11 -10
- package/dist/index.node.js.map +1 -1
- package/dist/{uuid-a8aab0ad.d.ts → uuid-e68c76fc.d.ts} +16 -13
- package/package.json +7 -7
- package/dist/chunk-ONVG2KLG.js +0 -16
- package/dist/chunk-ONVG2KLG.js.map +0 -1
package/dist/index.all.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
|
+
import { Buffer } from 'node:buffer';
|
|
2
3
|
|
|
3
4
|
/** Always throws. */
|
|
4
5
|
declare function fatal(...messages: any[]): never;
|
|
@@ -178,7 +179,7 @@ declare function encodeBase62(bin: BinInput, padding?: number): string;
|
|
|
178
179
|
declare function decodeBase62(s: string, padding?: number): Uint8Array;
|
|
179
180
|
declare function estimateSizeForBase(bytes: number, base: number): number;
|
|
180
181
|
|
|
181
|
-
declare
|
|
182
|
+
declare function toCamelCase(s: string): string;
|
|
182
183
|
declare function toCapitalize(s: string): string;
|
|
183
184
|
declare function toCapitalizeWords(s: string): string;
|
|
184
185
|
declare function fromCamelCase(str: string, separator?: string): string;
|
|
@@ -312,8 +313,8 @@ interface Options {
|
|
|
312
313
|
*/
|
|
313
314
|
declare function diffObjects(obj: Record<string, any> | any[], newObj: Record<string, any> | any[], options?: Partial<Options>, _stack?: Record<string, any>[]): Difference[];
|
|
314
315
|
|
|
315
|
-
declare
|
|
316
|
-
declare
|
|
316
|
+
declare function escapeHTML(s: string): string;
|
|
317
|
+
declare function unescapeHTML(s: string): string;
|
|
317
318
|
|
|
318
319
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
319
320
|
declare function isObject(obj: unknown): obj is object;
|
|
@@ -412,8 +413,8 @@ declare function toValidFilename(string: string, replacement?: string): string |
|
|
|
412
413
|
declare function escapeRegExp(value: RegExp | string): string;
|
|
413
414
|
|
|
414
415
|
type RoundingMode = (value: number) => number;
|
|
415
|
-
declare
|
|
416
|
-
declare
|
|
416
|
+
declare function isHalf(value: number): boolean;
|
|
417
|
+
declare function isEven(value: number): boolean;
|
|
417
418
|
declare const roundUp: RoundingMode;
|
|
418
419
|
declare const roundDown: RoundingMode;
|
|
419
420
|
declare const roundHalfUp: RoundingMode;
|
|
@@ -748,7 +749,7 @@ interface MessageHub {
|
|
|
748
749
|
listen<L extends MessageDefinitions>(newHandlers: L): void;
|
|
749
750
|
send<L extends MessageDefinitions>(): MessagesMethods<L>;
|
|
750
751
|
}
|
|
751
|
-
declare
|
|
752
|
+
declare function createPromiseProxy<P extends object>(fn: (name: string, args: any[], opt: any) => Promise<unknown>, opt: MessagesOptions, predefinedMethods?: any): P;
|
|
752
753
|
/**
|
|
753
754
|
* RPC
|
|
754
755
|
*
|
|
@@ -790,11 +791,9 @@ declare function usePubSub<L extends ListenerSignature<L> = DefaultListener>(opt
|
|
|
790
791
|
|
|
791
792
|
type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never;
|
|
792
793
|
type ReturnType$1<T> = T extends (...args: any) => infer R ? R : never;
|
|
793
|
-
interface
|
|
794
|
+
interface RPCOptionsBasic {
|
|
794
795
|
/** No return values expected */
|
|
795
796
|
onlyEvents?: boolean;
|
|
796
|
-
/** Names of remote functions that do not need response. */
|
|
797
|
-
eventNames?: (keyof Remote)[];
|
|
798
797
|
/** Function to post raw message */
|
|
799
798
|
post: (data: any) => void;
|
|
800
799
|
/** Listener to receive raw message */
|
|
@@ -804,6 +803,10 @@ interface RPCOptions<Remote> {
|
|
|
804
803
|
/** Custom function to deserialize data */
|
|
805
804
|
deserialize?: (data: any) => any;
|
|
806
805
|
}
|
|
806
|
+
interface RPCOptions<Remote> extends RPCOptionsBasic {
|
|
807
|
+
/** Names of remote functions that do not need response. */
|
|
808
|
+
eventNames?: (keyof Remote)[];
|
|
809
|
+
}
|
|
807
810
|
interface RPCFn<T> {
|
|
808
811
|
/** Call the remote function and wait for the result. */
|
|
809
812
|
(...args: ArgumentsType<T>): Promise<Awaited<ReturnType$1<T>>>;
|
|
@@ -814,6 +817,7 @@ type RPCReturn<RemoteFunctions> = {
|
|
|
814
817
|
[K in keyof RemoteFunctions]: RPCFn<RemoteFunctions[K]>;
|
|
815
818
|
};
|
|
816
819
|
declare function useRPC<RemoteFunctions = {}, LocalFunctions = {}>(functions: LocalFunctions, options: RPCOptions<RemoteFunctions>): RPCReturn<RemoteFunctions>;
|
|
820
|
+
declare function useRPCHub(options: RPCOptionsBasic): <RemoteFunctions = {}, LocalFunctions = {}>(additionalFunctions?: LocalFunctions | undefined, additionalEventNames?: string[]) => RPCReturn<RemoteFunctions>;
|
|
817
821
|
|
|
818
822
|
interface ProgressOptions {
|
|
819
823
|
totalUnits?: number;
|
|
@@ -1225,16 +1229,16 @@ declare class MemStorage<T = Json> implements ObjectStorage<T> {
|
|
|
1225
1229
|
/**
|
|
1226
1230
|
* @returns Timestamp in miliseconds
|
|
1227
1231
|
*/
|
|
1228
|
-
declare
|
|
1232
|
+
declare function getTimestamp(): number;
|
|
1229
1233
|
declare function formatMilliseconds(ms: number): string;
|
|
1230
1234
|
declare function parseDate(...dateCandidates: (string | Date)[]): Date | undefined;
|
|
1231
1235
|
/**
|
|
1232
1236
|
* @returns Timestamp in miliseconds
|
|
1233
1237
|
*/
|
|
1234
|
-
declare
|
|
1238
|
+
declare function getPerformanceTimestamp(): number;
|
|
1235
1239
|
declare function duration(): () => string;
|
|
1236
1240
|
|
|
1237
|
-
declare
|
|
1241
|
+
declare function noop(): void;
|
|
1238
1242
|
|
|
1239
1243
|
declare function uuidBytes(): Uint8Array;
|
|
1240
1244
|
declare function uuidB62(bytes?: Uint8Array): string;
|
|
@@ -1429,4 +1433,4 @@ declare function browserSupportsColors(): boolean;
|
|
|
1429
1433
|
|
|
1430
1434
|
declare function Logger(name?: string, level?: LogLevelAliasType): LoggerInterface;
|
|
1431
1435
|
|
|
1432
|
-
export { ArgumentsType, AsyncMutex, AsyncReturnType, BinInput, BinaryEncoder, CRYPTO_DEFAULT_ALG, CRYPTO_DEFAULT_DERIVE_ALG, CRYPTO_DEFAULT_DERIVE_ITERATIONS, CRYPTO_DEFAULT_HASH_ALG, Channel, ChannelMessageEvent, CryptoEncoder, DAY_MS, Day, DayInput, DayInputLegacy, DayValue, DecimalInput, DecimalValue, DefaultListener, DefaultLogger, Difference, DifferenceType, Disposable, Disposer, DisposerFunction, Emitter, EmitterAllHandler, EmitterHandler, Encoder, FileStorage, FileStorageOptions, FilterFunction, Json, JsonEncoder, ListenerSignature, LocalChannel, LocalStorage, LocalStorageOptions, LogHandler, LogHandlerOptions, LogLevel, LogLevelAlias, LogLevelAliasKey, LogLevelAliasType, LogLevelAll, LogLevelDebug, LogLevelError, LogLevelFatal, LogLevelInfo, LogLevelOff, LogLevelWarn, LogMessage, Logger, LoggerBrowserHandler, LoggerBrowserSetupDebugFactory, LoggerConsoleHandler, LoggerContext, LoggerContextInterface, LoggerFileHandler, LoggerInterface, LoggerMemoryHandler, LoggerNodeHandler, MapperFunction, MemStorage, MemStorageOptions, Message, MessageAction, MessageDefinitions, MessageHub, MessageResult, MessagesDefaultMethods, MessagesMethods, MessagesOptions, Mutex, NestedArray, NoopEncoder, ObjectStorage, PoolConfig, PoolTask, PoolTaskEvents, PoolTaskFn, PoolTaskIdConflictResolution, PoolTaskState, Primitive, Progress, PubSub, RPCFn, RPCOptions, RPCReturn, RenderMessagesOptions, ReturnType$1 as ReturnType, RoundingMode, SerialQueue, SortableItem, TaskEvents, TaskFn, Uint8ArrayToDataUri, Uint8ArrayToHexDump, Uint8ArrayToJson, Uint8ArrayToString, UseDefer, UseDispose, XRX, _decodeUtf8Polyfill, _encodeUtf8Polyfill, _useBase, activateConsoleDebug, arrayAvg, arrayBatches, arrayEmptyInPlace, arrayFilterInPlace, arrayFlatten, arrayIntersection, arrayIsEqual, arrayMax, arrayMin, arrayMinus, arrayRandomElement, arrayRemoveElement, arraySetElement, arrayShuffle, arrayShuffleForce, arrayShuffleInPlace, arraySorted, arraySortedNumbers, arraySum, arraySymmetricDifference, arrayToggleInPlace, arrayUnion, arrayUnique, assert, assertCondition, avg, between, bitfield, blobToArrayBuffer, blobToDataUri, blobToUint8Array, browserSelectColorByName, browserSupportsColors, cloneJsonObject, cloneObject, cmp, colorString, colorStringList, composeOrderby, createArray, createBinaryStreamDecoder, createBinaryStreamEncoder, createLocalChannelPair, createPromise, createPromiseProxy, csvParse, csvParseToObjects, csvStringify, dataUriToBlob, dataUriToMimeType, dataUriToUint8Array, dateStringToDays, day, dayDay, dayDiff, dayFromAny, dayFromDate, dayFromDateGMT, dayFromParts, dayFromString, dayFromTimestamp, dayFromToday, dayIterator, dayMonth, dayMonthStart, dayOffset, dayRange, dayToDate, dayToDateGMT, dayToParts, dayToString, dayToTimestamp, dayYear, dayYearStart, debounce, decimal, decimalCentsPart, decimalFromCents, decimalToCents, decodeBase16, decodeBase32, decodeBase58, decodeBase62, decodeJson, decrypt, deepEqual, deepMerge, deepStripUndefinedInPlace, deriveKeyPbkdf2, detect, diffObjects, digest, duration, empty, encodeBase16, encodeBase32, encodeBase58, encodeBase62, encodeJson, encodeQuery, encrypt, endSortWeight, ensureFolder, ensureKey, ensureKeyAsync, equalBinary, escapeHTML, escapeRegExp, estimateSizeForBase, exists, fatal, fetchBasic, fetchJson, fetchOptionsBasicAuth, fetchOptionsFormURLEncoded, fetchOptionsJson, fetchText, files, filesAsync, first, fixBrokenUth8String, forEachDay, forTimes, formatMessages, formatMilliseconds, fromBase64, fromBase64String, fromCamelCase, fromHex, getEnvVariableRelaxed, getFingerprint, getFingerprintAsync, getGlobal, getGlobalContext, getGlobalEmitter, getGlobalLogger, getGlobalLoggerIfExists, getNamespaceFilterString, getNavigator, getPerformanceTimestamp, getSecureRandom, getSecureRandomIfPossible, getSourceLocation, getSourceLocationByPrecedingPattern, getStack, getStackLlocationList, getStat, getStatAsync, getTimestamp, getWebCrypto, getWindow, globToRegExp, gravatarURLByEmail, httpMethod, immediate, isArray, isBoolean, isBrowser, isEmpty, isEven, isHalf, isHiddenPath, isInteger, isLocalHost, isNotEmpty, isNotNull, isNull, isNullOrUndefined, isNumber, isObject, isPrime, isPrimeRX, isPrimitive, isPromise, isRecord, isRecordPlain, isSafeInteger, isString, isTimeout, isTruthy, isUint8Array, isValue, joinToUint8Array, jsonStringify, jsonStringifySafe, jsonStringifySorted, jsonToUint8Array, last, lazyListener, linkifyPlainText, listDistinctUnion, listGroupBy, listOfKey, listQuery, loggerStackTraceDebug, memoize, memoizeAsync, moveSortWeight, noop, objectIsEmpty, objectMap, objectMergeDisposable, parseArgs, parseBasicAuth, parseDate, parseLogLevel, parseOrderby, parseQuery, pbcopy, promisify, qid, randomBoolean, randomFloat, randomInt, randomUint8Array, readText, regExpEscape, regExpString, removeFolder, renderMessages, roundDown, roundHalfAwayFromZero, roundHalfDown, roundHalfEven, roundHalfOdd, roundHalfTowardsZero, roundHalfUp, roundUp, seededRandom, setUuidDefaultEncoding, setupEnv, setupWebCrypto, size, sleep, sortedItems, sortedOrderby, startSortWeight, stringToBoolean, stringToFloat, stringToInteger, stringToPath, stringToUInt8Array, suid, suidBytes, suidBytesDate, suidDate, sum, throttle, timeout, toBase64, toBase64Url, toBool, toCamelCase, toCapitalize, toCapitalizeWords, toFloat, toHex, toHumanReadableFilePath, toHumanReadableUrl, toInt, toPath, toString, toUint8Array, toValidFilename, today, tryTimeout, uname, unescapeHTML, urlBase64ToUint8Array, useAsyncMutex, useBase, useDefer, useDispose, useDisposer, useEventListener, useExitHandler, useInterval, useLevelFilter, useMessageHub, useMutex, useNamespaceFilter, usePool, usePubSub, useRPC, useSorted, useTimeout, uuid, uuid32bit, uuidB32, uuidB62, uuidBytes, uuidDecode, uuidDecodeB32, uuidDecodeB62, uuidDecodeV4, uuidEncode, uuidEncodeB32, uuidEncodeB62, uuidEncodeV4, uuidIsValid, uuidv4, valueToBoolean, valueToFloat, valueToInteger, valueToPath, valueToString, waitOn, walkSync, walkSyncAsync, writeText };
|
|
1436
|
+
export { ArgumentsType, AsyncMutex, AsyncReturnType, BinInput, BinaryEncoder, CRYPTO_DEFAULT_ALG, CRYPTO_DEFAULT_DERIVE_ALG, CRYPTO_DEFAULT_DERIVE_ITERATIONS, CRYPTO_DEFAULT_HASH_ALG, Channel, ChannelMessageEvent, CryptoEncoder, DAY_MS, Day, DayInput, DayInputLegacy, DayValue, DecimalInput, DecimalValue, DefaultListener, DefaultLogger, Difference, DifferenceType, Disposable, Disposer, DisposerFunction, Emitter, EmitterAllHandler, EmitterHandler, Encoder, FileStorage, FileStorageOptions, FilterFunction, Json, JsonEncoder, ListenerSignature, LocalChannel, LocalStorage, LocalStorageOptions, LogHandler, LogHandlerOptions, LogLevel, LogLevelAlias, LogLevelAliasKey, LogLevelAliasType, LogLevelAll, LogLevelDebug, LogLevelError, LogLevelFatal, LogLevelInfo, LogLevelOff, LogLevelWarn, LogMessage, Logger, LoggerBrowserHandler, LoggerBrowserSetupDebugFactory, LoggerConsoleHandler, LoggerContext, LoggerContextInterface, LoggerFileHandler, LoggerInterface, LoggerMemoryHandler, LoggerNodeHandler, MapperFunction, MemStorage, MemStorageOptions, Message, MessageAction, MessageDefinitions, MessageHub, MessageResult, MessagesDefaultMethods, MessagesMethods, MessagesOptions, Mutex, NestedArray, NoopEncoder, ObjectStorage, PoolConfig, PoolTask, PoolTaskEvents, PoolTaskFn, PoolTaskIdConflictResolution, PoolTaskState, Primitive, Progress, PubSub, RPCFn, RPCOptions, RPCOptionsBasic, RPCReturn, RenderMessagesOptions, ReturnType$1 as ReturnType, RoundingMode, SerialQueue, SortableItem, TaskEvents, TaskFn, Uint8ArrayToDataUri, Uint8ArrayToHexDump, Uint8ArrayToJson, Uint8ArrayToString, UseDefer, UseDispose, XRX, _decodeUtf8Polyfill, _encodeUtf8Polyfill, _useBase, activateConsoleDebug, arrayAvg, arrayBatches, arrayEmptyInPlace, arrayFilterInPlace, arrayFlatten, arrayIntersection, arrayIsEqual, arrayMax, arrayMin, arrayMinus, arrayRandomElement, arrayRemoveElement, arraySetElement, arrayShuffle, arrayShuffleForce, arrayShuffleInPlace, arraySorted, arraySortedNumbers, arraySum, arraySymmetricDifference, arrayToggleInPlace, arrayUnion, arrayUnique, assert, assertCondition, avg, between, bitfield, blobToArrayBuffer, blobToDataUri, blobToUint8Array, browserSelectColorByName, browserSupportsColors, cloneJsonObject, cloneObject, cmp, colorString, colorStringList, composeOrderby, createArray, createBinaryStreamDecoder, createBinaryStreamEncoder, createLocalChannelPair, createPromise, createPromiseProxy, csvParse, csvParseToObjects, csvStringify, dataUriToBlob, dataUriToMimeType, dataUriToUint8Array, dateStringToDays, day, dayDay, dayDiff, dayFromAny, dayFromDate, dayFromDateGMT, dayFromParts, dayFromString, dayFromTimestamp, dayFromToday, dayIterator, dayMonth, dayMonthStart, dayOffset, dayRange, dayToDate, dayToDateGMT, dayToParts, dayToString, dayToTimestamp, dayYear, dayYearStart, debounce, decimal, decimalCentsPart, decimalFromCents, decimalToCents, decodeBase16, decodeBase32, decodeBase58, decodeBase62, decodeJson, decrypt, deepEqual, deepMerge, deepStripUndefinedInPlace, deriveKeyPbkdf2, detect, diffObjects, digest, duration, empty, encodeBase16, encodeBase32, encodeBase58, encodeBase62, encodeJson, encodeQuery, encrypt, endSortWeight, ensureFolder, ensureKey, ensureKeyAsync, equalBinary, escapeHTML, escapeRegExp, estimateSizeForBase, exists, fatal, fetchBasic, fetchJson, fetchOptionsBasicAuth, fetchOptionsFormURLEncoded, fetchOptionsJson, fetchText, files, filesAsync, first, fixBrokenUth8String, forEachDay, forTimes, formatMessages, formatMilliseconds, fromBase64, fromBase64String, fromCamelCase, fromHex, getEnvVariableRelaxed, getFingerprint, getFingerprintAsync, getGlobal, getGlobalContext, getGlobalEmitter, getGlobalLogger, getGlobalLoggerIfExists, getNamespaceFilterString, getNavigator, getPerformanceTimestamp, getSecureRandom, getSecureRandomIfPossible, getSourceLocation, getSourceLocationByPrecedingPattern, getStack, getStackLlocationList, getStat, getStatAsync, getTimestamp, getWebCrypto, getWindow, globToRegExp, gravatarURLByEmail, httpMethod, immediate, isArray, isBoolean, isBrowser, isEmpty, isEven, isHalf, isHiddenPath, isInteger, isLocalHost, isNotEmpty, isNotNull, isNull, isNullOrUndefined, isNumber, isObject, isPrime, isPrimeRX, isPrimitive, isPromise, isRecord, isRecordPlain, isSafeInteger, isString, isTimeout, isTruthy, isUint8Array, isValue, joinToUint8Array, jsonStringify, jsonStringifySafe, jsonStringifySorted, jsonToUint8Array, last, lazyListener, linkifyPlainText, listDistinctUnion, listGroupBy, listOfKey, listQuery, loggerStackTraceDebug, memoize, memoizeAsync, moveSortWeight, noop, objectIsEmpty, objectMap, objectMergeDisposable, parseArgs, parseBasicAuth, parseDate, parseLogLevel, parseOrderby, parseQuery, pbcopy, promisify, qid, randomBoolean, randomFloat, randomInt, randomUint8Array, readText, regExpEscape, regExpString, removeFolder, renderMessages, roundDown, roundHalfAwayFromZero, roundHalfDown, roundHalfEven, roundHalfOdd, roundHalfTowardsZero, roundHalfUp, roundUp, seededRandom, setUuidDefaultEncoding, setupEnv, setupWebCrypto, size, sleep, sortedItems, sortedOrderby, startSortWeight, stringToBoolean, stringToFloat, stringToInteger, stringToPath, stringToUInt8Array, suid, suidBytes, suidBytesDate, suidDate, sum, throttle, timeout, toBase64, toBase64Url, toBool, toCamelCase, toCapitalize, toCapitalizeWords, toFloat, toHex, toHumanReadableFilePath, toHumanReadableUrl, toInt, toPath, toString, toUint8Array, toValidFilename, today, tryTimeout, uname, unescapeHTML, urlBase64ToUint8Array, useAsyncMutex, useBase, useDefer, useDispose, useDisposer, useEventListener, useExitHandler, useInterval, useLevelFilter, useMessageHub, useMutex, useNamespaceFilter, usePool, usePubSub, useRPC, useRPCHub, useSorted, useTimeout, uuid, uuid32bit, uuidB32, uuidB62, uuidBytes, uuidDecode, uuidDecodeB32, uuidDecodeB62, uuidDecodeV4, uuidEncode, uuidEncodeB32, uuidEncodeB62, uuidEncodeV4, uuidIsValid, uuidv4, valueToBoolean, valueToFloat, valueToInteger, valueToPath, valueToString, waitOn, walkSync, walkSyncAsync, writeText };
|