@fkui/logic 6.19.1 → 6.21.0

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/lib/cjs/index.js CHANGED
@@ -199,7 +199,7 @@ class DecoratedError extends Error {
199
199
  super(message);
200
200
  Object.setPrototypeOf(this, DecoratedError.prototype);
201
201
  /* eslint-disable-next-line @typescript-eslint/restrict-plus-operands -- technical debt */
202
- this.stack += `\nCaused by: ${cause.stack}`;
202
+ this.stack += `\nCaused by: ${String(cause.stack)}`;
203
203
  this.cause = cause;
204
204
  }
205
205
  /**
@@ -2198,7 +2198,7 @@ function setCookie(options) {
2198
2198
  return;
2199
2199
  }
2200
2200
  const timeout = timeLimitSeconds ?? TWELVE_HOURS;
2201
- const cookieString = `${name}=${encodeURIComponent(value)}; path=/; max-age=${timeout};`;
2201
+ const cookieString = `${name}=${encodeURIComponent(value)}; path=/; max-age=${String(timeout)};`;
2202
2202
  document.cookie = cookieString;
2203
2203
  }
2204
2204
  /**
@@ -2593,7 +2593,7 @@ class FDate {
2593
2593
  static fromYearMonthDay(year, month, day) {
2594
2594
  const paddedMonth = month.toString().padStart(2, "0");
2595
2595
  const paddedDay = day.toString().padStart(2, "0");
2596
- const iso = `${year}-${paddedMonth}-${paddedDay}`;
2596
+ const iso = `${String(year)}-${paddedMonth}-${paddedDay}`;
2597
2597
  return FDate.fromIso(iso);
2598
2598
  }
2599
2599
  /**
@@ -3529,7 +3529,7 @@ function popFocus(handle) {
3529
3529
  }
3530
3530
  const top = _focusElementStack.pop();
3531
3531
  if (top?.id !== handle[sym]) {
3532
- const outOfOrderErrorMsg = `push/pop called out-of-order. Expected stack handle id: ${top?.id} but got ${handle[sym]}`;
3532
+ const outOfOrderErrorMsg = `push/pop called out-of-order. Expected stack handle id: ${String(top?.id)} but got ${String(handle[sym])}`;
3533
3533
  if (configLogic.production) {
3534
3534
  // eslint-disable-next-line no-console -- expected to log
3535
3535
  console.error(outOfOrderErrorMsg);
@@ -4722,7 +4722,7 @@ const dateFormatValidator = {
4722
4722
  };
4723
4723
 
4724
4724
  function createNumberRegexp(minDecimals = 0, maxDecimals = 2) {
4725
- return new RegExp(`^([-\u2212]?[0-9]+)([,.][0-9]{${minDecimals},${maxDecimals}})(?<![,.])$`);
4725
+ return new RegExp(`^([-\u2212]?[0-9]+)([,.][0-9]{${String(minDecimals)},${String(maxDecimals)}})(?<![,.])$`);
4726
4726
  }
4727
4727
  const decimalValidator = {
4728
4728
  name: "decimal",
@@ -4756,7 +4756,7 @@ const emailValidator = {
4756
4756
  name: "email",
4757
4757
  validation(value, _element, config) {
4758
4758
  const maxLength = config.maxLength ?? 254;
4759
- const EMAIL_REGEXP = new RegExp(`^(?=.{1,${maxLength}}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_\`a-z{|}~åäöÅÄÖ]+(\\.[-!#$%&'*+/0-9=?A-Z^_\`a-z{|}~åäöÅÄÖ]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$`);
4759
+ const EMAIL_REGEXP = new RegExp(`^(?=.{1,${String(maxLength)}}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_\`a-z{|}~åäöÅÄÖ]+(\\.[-!#$%&'*+/0-9=?A-Z^_\`a-z{|}~åäöÅÄÖ]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$`);
4760
4760
  return isEmpty(value) || EMAIL_REGEXP.test(value);
4761
4761
  },
4762
4762
  };
package/lib/esm/index.js CHANGED
@@ -197,7 +197,7 @@ class DecoratedError extends Error {
197
197
  super(message);
198
198
  Object.setPrototypeOf(this, DecoratedError.prototype);
199
199
  /* eslint-disable-next-line @typescript-eslint/restrict-plus-operands -- technical debt */
200
- this.stack += `\nCaused by: ${cause.stack}`;
200
+ this.stack += `\nCaused by: ${String(cause.stack)}`;
201
201
  this.cause = cause;
202
202
  }
203
203
  /**
@@ -2196,7 +2196,7 @@ function setCookie(options) {
2196
2196
  return;
2197
2197
  }
2198
2198
  const timeout = timeLimitSeconds ?? TWELVE_HOURS;
2199
- const cookieString = `${name}=${encodeURIComponent(value)}; path=/; max-age=${timeout};`;
2199
+ const cookieString = `${name}=${encodeURIComponent(value)}; path=/; max-age=${String(timeout)};`;
2200
2200
  document.cookie = cookieString;
2201
2201
  }
2202
2202
  /**
@@ -2591,7 +2591,7 @@ class FDate {
2591
2591
  static fromYearMonthDay(year, month, day) {
2592
2592
  const paddedMonth = month.toString().padStart(2, "0");
2593
2593
  const paddedDay = day.toString().padStart(2, "0");
2594
- const iso = `${year}-${paddedMonth}-${paddedDay}`;
2594
+ const iso = `${String(year)}-${paddedMonth}-${paddedDay}`;
2595
2595
  return FDate.fromIso(iso);
2596
2596
  }
2597
2597
  /**
@@ -3527,7 +3527,7 @@ function popFocus(handle) {
3527
3527
  }
3528
3528
  const top = _focusElementStack.pop();
3529
3529
  if (top?.id !== handle[sym]) {
3530
- const outOfOrderErrorMsg = `push/pop called out-of-order. Expected stack handle id: ${top?.id} but got ${handle[sym]}`;
3530
+ const outOfOrderErrorMsg = `push/pop called out-of-order. Expected stack handle id: ${String(top?.id)} but got ${String(handle[sym])}`;
3531
3531
  if (configLogic.production) {
3532
3532
  // eslint-disable-next-line no-console -- expected to log
3533
3533
  console.error(outOfOrderErrorMsg);
@@ -4720,7 +4720,7 @@ const dateFormatValidator = {
4720
4720
  };
4721
4721
 
4722
4722
  function createNumberRegexp(minDecimals = 0, maxDecimals = 2) {
4723
- return new RegExp(`^([-\u2212]?[0-9]+)([,.][0-9]{${minDecimals},${maxDecimals}})(?<![,.])$`);
4723
+ return new RegExp(`^([-\u2212]?[0-9]+)([,.][0-9]{${String(minDecimals)},${String(maxDecimals)}})(?<![,.])$`);
4724
4724
  }
4725
4725
  const decimalValidator = {
4726
4726
  name: "decimal",
@@ -4754,7 +4754,7 @@ const emailValidator = {
4754
4754
  name: "email",
4755
4755
  validation(value, _element, config) {
4756
4756
  const maxLength = config.maxLength ?? 254;
4757
- const EMAIL_REGEXP = new RegExp(`^(?=.{1,${maxLength}}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_\`a-z{|}~åäöÅÄÖ]+(\\.[-!#$%&'*+/0-9=?A-Z^_\`a-z{|}~åäöÅÄÖ]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$`);
4757
+ const EMAIL_REGEXP = new RegExp(`^(?=.{1,${String(maxLength)}}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_\`a-z{|}~åäöÅÄÖ]+(\\.[-!#$%&'*+/0-9=?A-Z^_\`a-z{|}~åäöÅÄÖ]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$`);
4758
4758
  return isEmpty(value) || EMAIL_REGEXP.test(value);
4759
4759
  },
4760
4760
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fkui/logic",
3
- "version": "6.19.1",
3
+ "version": "6.21.0",
4
4
  "description": "Logic",
5
5
  "keywords": [
6
6
  "fkui",
@@ -61,11 +61,11 @@
61
61
  "watch": "rollup --config --watch"
62
62
  },
63
63
  "peerDependencies": {
64
- "@fkui/date": "^6.19.1"
64
+ "@fkui/date": "^6.21.0"
65
65
  },
66
66
  "engines": {
67
67
  "node": ">= 20",
68
68
  "npm": ">= 7"
69
69
  },
70
- "gitHead": "722f1b407dd9a8afc9bb3164ed5c085aa85f2ba2"
70
+ "gitHead": "300d22abdfd674d0d2aad5e710773cb83b38152a"
71
71
  }