@valkyriestudios/utils 12.41.3 → 12.42.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.
@@ -78,7 +78,7 @@ function toObject(form, config) {
78
78
  break;
79
79
  default: {
80
80
  if (typeof value === 'string' && value) {
81
- if (nNumber) {
81
+ if (nNumber && value[0] !== '0') {
82
82
  const nVal = Number(value);
83
83
  if (!isNaN(nVal)) {
84
84
  assign(acc, key, nVal, single);
@@ -74,7 +74,7 @@ function toObject(form, config) {
74
74
  break;
75
75
  default: {
76
76
  if (typeof value === 'string' && value) {
77
- if (nNumber) {
77
+ if (nNumber && value[0] !== '0') {
78
78
  const nVal = Number(value);
79
79
  if (!isNaN(nVal)) {
80
80
  assign(acc, key, nVal, single);
@@ -2,7 +2,7 @@ type ToObjectConfig = {
2
2
  /**
3
3
  * Pass array of keys that should not be normalized into number/bool when seen
4
4
  */
5
- raw?: string[] | true;
5
+ raw?: string[] | boolean;
6
6
  /**
7
7
  * Pass array of keys that should only have a single value (e.g., 'action')
8
8
  */
package/index.d.ts CHANGED
@@ -287,7 +287,7 @@ declare module "date/index" {
287
287
  }
288
288
  declare module "formdata/toObject" {
289
289
  type ToObjectConfig = {
290
- raw?: string[] | true;
290
+ raw?: string[] | boolean;
291
291
  single?: string[];
292
292
  normalize_bool?: boolean;
293
293
  normalize_null?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valkyriestudios/utils",
3
- "version": "12.41.3",
3
+ "version": "12.42.0",
4
4
  "description": "A collection of single-function utilities for common tasks",
5
5
  "author": {
6
6
  "name": "Peter Vermeulen",
@@ -514,12 +514,12 @@
514
514
  }
515
515
  },
516
516
  "devDependencies": {
517
- "@types/node": "^22.15.30",
518
- "@vitest/coverage-v8": "^3.2.2",
517
+ "@types/node": "^22.15.31",
518
+ "@vitest/coverage-v8": "^3.2.3",
519
519
  "esbuild-register": "^3.6.0",
520
- "eslint": "^9.28.0",
520
+ "eslint": "^9.29.0",
521
521
  "typescript": "^5.8.3",
522
- "typescript-eslint": "^8.33.1",
523
- "vitest": "^3.2.2"
522
+ "typescript-eslint": "^8.34.0",
523
+ "vitest": "^3.2.3"
524
524
  }
525
525
  }