defuss-runtime 1.2.1 → 1.3.1

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/dist/index.cjs CHANGED
@@ -278,7 +278,7 @@ function createTimeoutPromise(timeoutMs, operation, timeoutCallback) {
278
278
  reject(new Error(`Timeout after ${timeoutMs}ms`));
279
279
  }
280
280
  }, timeoutMs);
281
- Promise.resolve().then(async () => {
281
+ (async () => {
282
282
  try {
283
283
  const result = await operation();
284
284
  if (!completed) {
@@ -293,12 +293,12 @@ function createTimeoutPromise(timeoutMs, operation, timeoutCallback) {
293
293
  reject(error);
294
294
  }
295
295
  }
296
- });
296
+ })();
297
297
  });
298
298
  }
299
299
  async function waitForWithPolling(check, timeout, interval = 1) {
300
300
  const start = Date.now();
301
- let timer;
301
+ let timer = null;
302
302
  const cleanup = () => {
303
303
  if (timer) {
304
304
  clearInterval(timer);
@@ -337,7 +337,6 @@ async function waitForRef(ref, timeout) {
337
337
  return waitForWithPolling(() => {
338
338
  if (ref.orphan) {
339
339
  console.log("\u26A0\uFE0F waitForRef() - ref is marked as orphaned, failing fast");
340
- throw new Error("Ref has been orphaned from component unmount");
341
340
  }
342
341
  return ref.current;
343
342
  }, timeout);
package/dist/index.d.cts CHANGED
@@ -571,4 +571,5 @@ declare const isNull: ValidatorPrimitiveFn;
571
571
  type PreloadAs = "image" | "script" | "style" | "fetch" | "track" | "font";
572
572
  declare function preload(url: string | string[], as?: PreloadAs): void;
573
573
 
574
- export { type DateValue, type Dynamic, PATH_ACCESSOR_SYMBOL, type PathAccessor, type PreloadAs, type SingleValidationResult, type ValidationFnResult, type ValidationMessage, type ValidationStep, type ValidatorFn, type ValidatorPrimitiveFn, _BASE64_CHARS, _HEX_PREFIX, _base64LookupMap, _getBase64LookupMap, access, asArray, asBoolean, asDate, asInteger, asNumber, asString, base64ToBinary, binaryToBase64, binaryToHex, binaryToText, createTimeoutPromise, debounce, ensureKey, equalsJSON, getAllKeysFromPath, getByPath, getDateValue, hasDateFormat, hasPattern, hexToBinary, is, isAfter, isArray, isBefore, isBoolean, isDate, isDefined, isEmail, isEmpty, isEqual, isFalse, isFalsy, isGreaterThan, isInstanceOf, isInteger, isLessThan, isLongerThan, isNull, isObject, isOneOf, isPathAccessor, isPhoneNumber, isRequired, isSafeNumber, isSafeNumeric, isShorterThan, isSlug, isString, isTrue, isTruthy, isTypeOf, isUrl, isUrlPath, omit, pick, preload, setByPath, textToBinary, throttle, unique, wait, waitForRef, waitForWithPolling };
574
+ export { PATH_ACCESSOR_SYMBOL, _BASE64_CHARS, _HEX_PREFIX, _base64LookupMap, _getBase64LookupMap, access, asArray, asBoolean, asDate, asInteger, asNumber, asString, base64ToBinary, binaryToBase64, binaryToHex, binaryToText, createTimeoutPromise, debounce, ensureKey, equalsJSON, getAllKeysFromPath, getByPath, getDateValue, hasDateFormat, hasPattern, hexToBinary, is, isAfter, isArray, isBefore, isBoolean, isDate, isDefined, isEmail, isEmpty, isEqual, isFalse, isFalsy, isGreaterThan, isInstanceOf, isInteger, isLessThan, isLongerThan, isNull, isObject, isOneOf, isPathAccessor, isPhoneNumber, isRequired, isSafeNumber, isSafeNumeric, isShorterThan, isSlug, isString, isTrue, isTruthy, isTypeOf, isUrl, isUrlPath, omit, pick, preload, setByPath, textToBinary, throttle, unique, wait, waitForRef, waitForWithPolling };
575
+ export type { DateValue, Dynamic, PathAccessor, PreloadAs, SingleValidationResult, ValidationFnResult, ValidationMessage, ValidationStep, ValidatorFn, ValidatorPrimitiveFn };
package/dist/index.d.mts CHANGED
@@ -571,4 +571,5 @@ declare const isNull: ValidatorPrimitiveFn;
571
571
  type PreloadAs = "image" | "script" | "style" | "fetch" | "track" | "font";
572
572
  declare function preload(url: string | string[], as?: PreloadAs): void;
573
573
 
574
- export { type DateValue, type Dynamic, PATH_ACCESSOR_SYMBOL, type PathAccessor, type PreloadAs, type SingleValidationResult, type ValidationFnResult, type ValidationMessage, type ValidationStep, type ValidatorFn, type ValidatorPrimitiveFn, _BASE64_CHARS, _HEX_PREFIX, _base64LookupMap, _getBase64LookupMap, access, asArray, asBoolean, asDate, asInteger, asNumber, asString, base64ToBinary, binaryToBase64, binaryToHex, binaryToText, createTimeoutPromise, debounce, ensureKey, equalsJSON, getAllKeysFromPath, getByPath, getDateValue, hasDateFormat, hasPattern, hexToBinary, is, isAfter, isArray, isBefore, isBoolean, isDate, isDefined, isEmail, isEmpty, isEqual, isFalse, isFalsy, isGreaterThan, isInstanceOf, isInteger, isLessThan, isLongerThan, isNull, isObject, isOneOf, isPathAccessor, isPhoneNumber, isRequired, isSafeNumber, isSafeNumeric, isShorterThan, isSlug, isString, isTrue, isTruthy, isTypeOf, isUrl, isUrlPath, omit, pick, preload, setByPath, textToBinary, throttle, unique, wait, waitForRef, waitForWithPolling };
574
+ export { PATH_ACCESSOR_SYMBOL, _BASE64_CHARS, _HEX_PREFIX, _base64LookupMap, _getBase64LookupMap, access, asArray, asBoolean, asDate, asInteger, asNumber, asString, base64ToBinary, binaryToBase64, binaryToHex, binaryToText, createTimeoutPromise, debounce, ensureKey, equalsJSON, getAllKeysFromPath, getByPath, getDateValue, hasDateFormat, hasPattern, hexToBinary, is, isAfter, isArray, isBefore, isBoolean, isDate, isDefined, isEmail, isEmpty, isEqual, isFalse, isFalsy, isGreaterThan, isInstanceOf, isInteger, isLessThan, isLongerThan, isNull, isObject, isOneOf, isPathAccessor, isPhoneNumber, isRequired, isSafeNumber, isSafeNumeric, isShorterThan, isSlug, isString, isTrue, isTruthy, isTypeOf, isUrl, isUrlPath, omit, pick, preload, setByPath, textToBinary, throttle, unique, wait, waitForRef, waitForWithPolling };
575
+ export type { DateValue, Dynamic, PathAccessor, PreloadAs, SingleValidationResult, ValidationFnResult, ValidationMessage, ValidationStep, ValidatorFn, ValidatorPrimitiveFn };
package/dist/index.mjs CHANGED
@@ -276,7 +276,7 @@ function createTimeoutPromise(timeoutMs, operation, timeoutCallback) {
276
276
  reject(new Error(`Timeout after ${timeoutMs}ms`));
277
277
  }
278
278
  }, timeoutMs);
279
- Promise.resolve().then(async () => {
279
+ (async () => {
280
280
  try {
281
281
  const result = await operation();
282
282
  if (!completed) {
@@ -291,12 +291,12 @@ function createTimeoutPromise(timeoutMs, operation, timeoutCallback) {
291
291
  reject(error);
292
292
  }
293
293
  }
294
- });
294
+ })();
295
295
  });
296
296
  }
297
297
  async function waitForWithPolling(check, timeout, interval = 1) {
298
298
  const start = Date.now();
299
- let timer;
299
+ let timer = null;
300
300
  const cleanup = () => {
301
301
  if (timer) {
302
302
  clearInterval(timer);
@@ -335,7 +335,6 @@ async function waitForRef(ref, timeout) {
335
335
  return waitForWithPolling(() => {
336
336
  if (ref.orphan) {
337
337
  console.log("\u26A0\uFE0F waitForRef() - ref is marked as orphaned, failing fast");
338
- throw new Error("Ref has been orphaned from component unmount");
339
338
  }
340
339
  return ref.current;
341
340
  }, timeout);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "defuss-runtime",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -44,15 +44,17 @@
44
44
  "main": "./dist/index.cjs",
45
45
  "module": "./dist/index.mjs",
46
46
  "types": "./dist/index.d.cts",
47
- "files": ["dist"],
47
+ "files": [
48
+ "dist"
49
+ ],
48
50
  "engines": {
49
51
  "node": "^18.17.1 || ^20.3.0 || >=21.0.0"
50
52
  },
51
53
  "devDependencies": {
52
- "pkgroll": "^2.5.1",
53
- "tsx": "^4.19.2",
54
- "typescript": "^5.6.3",
55
- "vitest": "^3.1.3",
56
- "@vitest/coverage-v8": "^3.1.3"
54
+ "@vitest/coverage-v8": "^4.0.17",
55
+ "pkgroll": "^2.21.5",
56
+ "tsx": "^4.21.0",
57
+ "typescript": "^5.9.3",
58
+ "vitest": "^4.0.17"
57
59
  }
58
- }
60
+ }