zeed 0.8.3 → 0.8.4

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.
@@ -1,4 +1,13 @@
1
- import { Logger, __name, getGlobalContext, getTimestamp, useNamespaceFilter, useLevelFilter, isArray, deepMerge } from './chunk-AM7QCF4I.js';
1
+ import {
2
+ Logger,
3
+ __name,
4
+ deepMerge,
5
+ getGlobalContext,
6
+ getTimestamp,
7
+ isArray,
8
+ useLevelFilter,
9
+ useNamespaceFilter
10
+ } from "./chunk-AM7QCF4I.js";
2
11
 
3
12
  // src/common/data/bin.ts
4
13
  var log = Logger("bin");
@@ -157,7 +166,8 @@ function Uint8ArrayToJson(data) {
157
166
  }
158
167
  __name(Uint8ArrayToJson, "Uint8ArrayToJson");
159
168
  function Uint8ArrayToHexDump(buffer, blockSize) {
160
- if (typeof buffer === "string") ; else if (buffer instanceof ArrayBuffer && buffer.byteLength !== void 0) {
169
+ if (typeof buffer === "string") {
170
+ } else if (buffer instanceof ArrayBuffer && buffer.byteLength !== void 0) {
161
171
  buffer = String.fromCharCode.apply(
162
172
  String,
163
173
  [].slice.call(new Uint8Array(buffer))
@@ -274,6 +284,8 @@ __name(decrypt, "decrypt");
274
284
 
275
285
  // src/common/csv.ts
276
286
  var separator = ",";
287
+ var preventCast = false;
288
+ var ignoreNullOrUndefined = true;
277
289
  function filterFloat(value) {
278
290
  if (/^([-+])?([0-9]+(\.[0-9]+)?|Infinity)$/.test(value)) {
279
291
  return Number(value);
@@ -282,9 +294,12 @@ function filterFloat(value) {
282
294
  }
283
295
  __name(filterFloat, "filterFloat");
284
296
  function escape2(field) {
285
- if (field == void 0) {
297
+ if (ignoreNullOrUndefined && field == void 0) {
286
298
  return "";
287
299
  }
300
+ if (preventCast) {
301
+ return '="' + String(field).replace(/"/g, '""') + '"';
302
+ }
288
303
  if (!isNaN(filterFloat(field)) && isFinite(field)) {
289
304
  return parseFloat(field);
290
305
  }
@@ -2399,7 +2414,10 @@ var SerialQueue = class extends Emitter {
2399
2414
  }
2400
2415
  };
2401
2416
  __name(SerialQueue, "SerialQueue");
2402
- var log6 = () => {
2417
+
2418
+ // src/common/exec/throttle-debounce.ts
2419
+ var DEBUG = false;
2420
+ var log6 = DEBUG ? Logger("zeed:throttle") : () => {
2403
2421
  };
2404
2422
  function throttle(callback, opt = {}) {
2405
2423
  const { delay = 100, trailing = true, leading = true } = opt;
@@ -2432,8 +2450,10 @@ function throttle(callback, opt = {}) {
2432
2450
  __name(exec, "exec");
2433
2451
  trailingExec = exec;
2434
2452
  if (elapsed > delay || !timeoutID) {
2453
+ DEBUG && log6("elapsed", debugElapsed());
2435
2454
  if (leading) {
2436
2455
  if (elapsed > delay) {
2456
+ DEBUG && log6("\u{1F680} leading", debugElapsed());
2437
2457
  exec();
2438
2458
  } else {
2439
2459
  ++visited;
@@ -2444,13 +2464,16 @@ function throttle(callback, opt = {}) {
2444
2464
  clearExistingTimeout();
2445
2465
  checkpoint = now;
2446
2466
  timeoutID = setTimeout(() => {
2467
+ DEBUG && log6("\u23F1 reached timeout", debugElapsed());
2447
2468
  timeoutID = 0;
2448
2469
  if (trailing && (!leading || visited > 0)) {
2470
+ DEBUG && log6("\u{1F680} trailing", debugElapsed());
2449
2471
  trailingExec == null ? void 0 : trailingExec();
2450
2472
  }
2451
2473
  }, timeout2);
2452
2474
  } else {
2453
2475
  ++visited;
2476
+ DEBUG && log6("visited", debugElapsed());
2454
2477
  }
2455
2478
  }
2456
2479
  __name(wrapper, "wrapper");
@@ -3048,7 +3071,7 @@ function useExitHandler(handler) {
3048
3071
  __name(useExitHandler, "useExitHandler");
3049
3072
 
3050
3073
  // src/common/storage/memstorage.ts
3051
- Logger("zeed:memstorage");
3074
+ var log8 = Logger("zeed:memstorage");
3052
3075
  var MemStorage = class {
3053
3076
  constructor(opt = {}) {
3054
3077
  this.store = {};
@@ -3073,5 +3096,231 @@ var MemStorage = class {
3073
3096
  };
3074
3097
  __name(MemStorage, "MemStorage");
3075
3098
 
3076
- export { Channel, CryptoEncoder, Currency, DAY_MS, Day, Emitter, JsonEncoder, LocalChannel, LoggerMemoryHandler, MemStorage, NoopEncoder, PoolTaskIdConflictResolution, PoolTaskState, PubSub, SerialQueue, Uint8ArrayToHexDump, Uint8ArrayToJson, Uint8ArrayToString, XRX, _decodeUtf8Polyfill, _encodeUtf8Polyfill, arrayAvg, arrayBatches, arrayEmptyInPlace, arrayFilterInPlace, arrayFlatten, arrayIntersection, arrayIsEqual, arrayMax, arrayMin, arrayMinus, arrayRandomElement, arrayRemoveElement, arraySetElement, arrayShuffle, arrayShuffleForce, arrayShuffleInPlace, arraySorted, arraySortedNumbers, arraySum, arraySymmetricDifference, arrayToggleInPlace, arrayUnion, arrayUnique, avg, between, cloneJsonObject, cloneObject, cmp, composeOrderby, createArray, createLocalChannelPair, createPromise, createPromiseProxy, csv, currency, dateStringToDays, day, dayDay, dayDiff, dayFromAny, dayFromDate, dayFromDateGMT, dayFromParts, dayFromString, dayFromTimestamp, dayFromToday, dayMonth, dayMonthStart, dayOffset, dayToDate, dayToDateGMT, dayToParts, dayToString, dayToTimestamp, dayYear, dayYearStart, debounce, decimal, decimalCentsPart, decimalFromCents, decimalToCents, decodeBase16, decodeBase32, decodeBase58, decodeBase62, decodeBase64, decrypt, deriveKeyPbkdf2, detect, digest, empty, encodeBase16, encodeBase32, encodeBase58, encodeBase62, encodeBase64, encodeQuery, encrypt, endSortWeight, ensureKey, ensureKeyAsync, equalBinary, escapeHTML, escapeRegExp, fetchBasic, fetchJson, fetchOptionsBasicAuth, fetchOptionsFormURLEncoded, fetchOptionsJson, fetchText, fixBrokenUth8String, forEachDay, forTimes, formatMessages, fromBase64, fromCamelCase, getGlobal, getGlobalEmitter, getNavigator, getSecureRandom, getSecureRandomIfPossible, getWindow, immediate, isBrowser, isEven, isHalf, isLocalHost, isPrime, isPrimeRX, isPromise, isTimeout, joinToUint8Array, jsonStringify, jsonToUint8Array, last, lazyListener, linkifyPlainText, memoize, messages, moveSortWeight, parseBasicAuth, parseOrderby, parseQuery, platform, promisify, qid, randomBoolean, randomFloat, randomInt, randomUint8Array, regExpEscape, regExpString, renderMessages, roundDown, roundHalfAwayFromZero, roundHalfDown, roundHalfEven, roundHalfOdd, roundHalfTowardsZero, roundHalfUp, roundUp, size, sleep, sortedItems, sortedOrderby, startSortWeight, stringToBoolean, stringToFloat, stringToInteger, stringToUInt8Array, suid, suidBytes, suidBytesDate, suidDate, sum, throttle, timeout, timeoutReached, timoutError, toBase64, toBase64Url, toBool, toCamelCase, toCapitalize, toCapitalizeWords, toFloat, toHex, toHumanReadableUrl, toInt, toString, toUint8Array, toValidFilename, today, tryTimeout, uname, unescapeHTML, useAsyncMutex, useBase, useDefer, useDispose, useDisposer, useEventListener, useExitHandler, useInterval, useMessageHub, useMutex, usePool, usePubSub, useRPC, useTimeout, uuid, uuid32Decode, uuid32Encode, uuid32bit, uuidB32, uuidBytes, uuidDecode, uuidEncode, uuidv4, valueToBoolean, valueToFloat, valueToInteger, valueToString, waitOn };
3099
+ export {
3100
+ _encodeUtf8Polyfill,
3101
+ _decodeUtf8Polyfill,
3102
+ stringToUInt8Array,
3103
+ Uint8ArrayToString,
3104
+ toUint8Array,
3105
+ joinToUint8Array,
3106
+ toHex,
3107
+ toBase64,
3108
+ toBase64Url,
3109
+ fromBase64,
3110
+ equalBinary,
3111
+ jsonToUint8Array,
3112
+ Uint8ArrayToJson,
3113
+ Uint8ArrayToHexDump,
3114
+ randomUint8Array,
3115
+ digest,
3116
+ deriveKeyPbkdf2,
3117
+ encrypt,
3118
+ decrypt,
3119
+ csv,
3120
+ getSecureRandom,
3121
+ getSecureRandomIfPossible,
3122
+ randomBoolean,
3123
+ randomInt,
3124
+ randomFloat,
3125
+ between,
3126
+ sum,
3127
+ avg,
3128
+ isPrimeRX,
3129
+ isPrime,
3130
+ parseOrderby,
3131
+ composeOrderby,
3132
+ cmp,
3133
+ sortedOrderby,
3134
+ arrayUnique,
3135
+ arrayMinus,
3136
+ arrayUnion,
3137
+ arrayFlatten,
3138
+ arrayIntersection,
3139
+ arraySymmetricDifference,
3140
+ arrayRemoveElement,
3141
+ arraySetElement,
3142
+ arrayFilterInPlace,
3143
+ arrayToggleInPlace,
3144
+ arrayEmptyInPlace,
3145
+ arraySorted,
3146
+ arraySortedNumbers,
3147
+ arrayIsEqual,
3148
+ arrayShuffleInPlace,
3149
+ arrayShuffle,
3150
+ arrayShuffleForce,
3151
+ arrayRandomElement,
3152
+ arrayMax,
3153
+ arrayMin,
3154
+ arraySum,
3155
+ arrayAvg,
3156
+ arrayBatches,
3157
+ createArray,
3158
+ useBase,
3159
+ encodeBase16,
3160
+ decodeBase16,
3161
+ encodeBase32,
3162
+ decodeBase32,
3163
+ encodeBase58,
3164
+ decodeBase58,
3165
+ encodeBase62,
3166
+ decodeBase62,
3167
+ encodeBase64,
3168
+ decodeBase64,
3169
+ toCamelCase,
3170
+ toCapitalize,
3171
+ toCapitalizeWords,
3172
+ fromCamelCase,
3173
+ jsonStringify,
3174
+ stringToBoolean,
3175
+ stringToInteger,
3176
+ stringToFloat,
3177
+ valueToBoolean,
3178
+ valueToInteger,
3179
+ valueToFloat,
3180
+ valueToString,
3181
+ toFloat,
3182
+ toInt,
3183
+ toString,
3184
+ toBool,
3185
+ formatMessages,
3186
+ renderMessages,
3187
+ fixBrokenUth8String,
3188
+ currency,
3189
+ Currency,
3190
+ DAY_MS,
3191
+ dayYear,
3192
+ dayMonth,
3193
+ dayDay,
3194
+ dayToParts,
3195
+ dayToDate,
3196
+ dayFromToday,
3197
+ dayFromAny,
3198
+ dayToDateGMT,
3199
+ dayFromDate,
3200
+ dayFromDateGMT,
3201
+ dayToTimestamp,
3202
+ dayFromTimestamp,
3203
+ dayToString,
3204
+ dayFromParts,
3205
+ dayFromString,
3206
+ dayMonthStart,
3207
+ dayYearStart,
3208
+ dayOffset,
3209
+ dayDiff,
3210
+ createPromise,
3211
+ sleep,
3212
+ immediate,
3213
+ timeoutReached,
3214
+ timeout,
3215
+ timoutError,
3216
+ isTimeout,
3217
+ tryTimeout,
3218
+ waitOn,
3219
+ isPromise,
3220
+ promisify,
3221
+ Day,
3222
+ forEachDay,
3223
+ today,
3224
+ day,
3225
+ dateStringToDays,
3226
+ decimal,
3227
+ decimalFromCents,
3228
+ decimalToCents,
3229
+ decimalCentsPart,
3230
+ escapeHTML,
3231
+ unescapeHTML,
3232
+ toValidFilename,
3233
+ escapeRegExp,
3234
+ isHalf,
3235
+ isEven,
3236
+ roundUp,
3237
+ roundDown,
3238
+ roundHalfUp,
3239
+ roundHalfOdd,
3240
+ roundHalfAwayFromZero,
3241
+ roundHalfDown,
3242
+ roundHalfEven,
3243
+ roundHalfTowardsZero,
3244
+ startSortWeight,
3245
+ endSortWeight,
3246
+ moveSortWeight,
3247
+ sortedItems,
3248
+ linkifyPlainText,
3249
+ toHumanReadableUrl,
3250
+ encodeQuery,
3251
+ parseQuery,
3252
+ ensureKey,
3253
+ ensureKeyAsync,
3254
+ size,
3255
+ last,
3256
+ empty,
3257
+ cloneObject,
3258
+ cloneJsonObject,
3259
+ memoize,
3260
+ forTimes,
3261
+ regExpString,
3262
+ regExpEscape,
3263
+ XRX,
3264
+ useDispose,
3265
+ useDisposer,
3266
+ useDefer,
3267
+ useTimeout,
3268
+ useInterval,
3269
+ useEventListener,
3270
+ useMutex,
3271
+ useAsyncMutex,
3272
+ Emitter,
3273
+ getGlobalEmitter,
3274
+ messages,
3275
+ lazyListener,
3276
+ uuidBytes,
3277
+ uuid32bit,
3278
+ uuid,
3279
+ uuidEncode,
3280
+ uuidDecode,
3281
+ uuidB32,
3282
+ uuid32Encode,
3283
+ uuid32Decode,
3284
+ uname,
3285
+ qid,
3286
+ uuidv4,
3287
+ suidBytes,
3288
+ suid,
3289
+ suidDate,
3290
+ suidBytesDate,
3291
+ PoolTaskState,
3292
+ PoolTaskIdConflictResolution,
3293
+ usePool,
3294
+ SerialQueue,
3295
+ throttle,
3296
+ debounce,
3297
+ isLocalHost,
3298
+ LoggerMemoryHandler,
3299
+ Channel,
3300
+ LocalChannel,
3301
+ createLocalChannelPair,
3302
+ NoopEncoder,
3303
+ JsonEncoder,
3304
+ CryptoEncoder,
3305
+ createPromiseProxy,
3306
+ useMessageHub,
3307
+ PubSub,
3308
+ usePubSub,
3309
+ useRPC,
3310
+ parseBasicAuth,
3311
+ fetchBasic,
3312
+ fetchJson,
3313
+ fetchText,
3314
+ fetchOptionsFormURLEncoded,
3315
+ fetchOptionsJson,
3316
+ fetchOptionsBasicAuth,
3317
+ getWindow,
3318
+ getNavigator,
3319
+ getGlobal,
3320
+ detect,
3321
+ isBrowser,
3322
+ platform,
3323
+ useExitHandler,
3324
+ MemStorage
3325
+ };
3077
3326
  //# sourceMappingURL=chunk-RIAAIUAZ.js.map