@valkyriestudios/utils 12.45.0 → 12.46.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.
@@ -58,40 +58,39 @@ function toObject(form, config) {
58
58
  for (const [key, value] of form) {
59
59
  if (set_guard && set.has(key)) {
60
60
  assign(acc, key, value, single);
61
+ continue;
61
62
  }
62
- else {
63
- switch (value) {
64
- case 'true':
65
- case 'TRUE':
66
- case 'True':
67
- assign(acc, key, nBool ? true : value, single);
68
- break;
69
- case 'false':
70
- case 'FALSE':
71
- case 'False':
72
- assign(acc, key, nBool ? false : value, single);
73
- break;
74
- case 'null':
75
- case 'NULL':
76
- case 'Null':
77
- assign(acc, key, nNull ? null : value, single);
78
- break;
79
- default: {
80
- if (typeof value === 'string' && value) {
81
- if (nNumber && value[0] !== '0') {
82
- const nVal = Number(value);
83
- if (!isNaN(nVal)) {
84
- assign(acc, key, nVal, single);
85
- continue;
86
- }
87
- }
88
- if (nDate && (0, isFormat_1.isDateFormat)(value, 'ISO')) {
89
- assign(acc, key, new Date(value), single);
63
+ switch (value) {
64
+ case 'true':
65
+ case 'TRUE':
66
+ case 'True':
67
+ assign(acc, key, nBool ? true : value, single);
68
+ continue;
69
+ case 'false':
70
+ case 'FALSE':
71
+ case 'False':
72
+ assign(acc, key, nBool ? false : value, single);
73
+ continue;
74
+ case 'null':
75
+ case 'NULL':
76
+ case 'Null':
77
+ assign(acc, key, nNull ? null : value, single);
78
+ continue;
79
+ default: {
80
+ if (typeof value === 'string' && value) {
81
+ if (nNumber && value[0] !== '0') {
82
+ const nVal = Number(value);
83
+ if (!isNaN(nVal)) {
84
+ assign(acc, key, nVal, single);
90
85
  continue;
91
86
  }
92
87
  }
93
- assign(acc, key, value, single);
88
+ if (nDate && value[4] === '-' && value[7] === '-' && value[10] === 'T' && (0, isFormat_1.isDateFormat)(value, 'ISO')) {
89
+ assign(acc, key, new Date(value), single);
90
+ continue;
91
+ }
94
92
  }
93
+ assign(acc, key, value, single);
95
94
  }
96
95
  }
97
96
  }
@@ -54,40 +54,39 @@ function toObject(form, config) {
54
54
  for (const [key, value] of form) {
55
55
  if (set_guard && set.has(key)) {
56
56
  assign(acc, key, value, single);
57
+ continue;
57
58
  }
58
- else {
59
- switch (value) {
60
- case 'true':
61
- case 'TRUE':
62
- case 'True':
63
- assign(acc, key, nBool ? true : value, single);
64
- break;
65
- case 'false':
66
- case 'FALSE':
67
- case 'False':
68
- assign(acc, key, nBool ? false : value, single);
69
- break;
70
- case 'null':
71
- case 'NULL':
72
- case 'Null':
73
- assign(acc, key, nNull ? null : value, single);
74
- break;
75
- default: {
76
- if (typeof value === 'string' && value) {
77
- if (nNumber && value[0] !== '0') {
78
- const nVal = Number(value);
79
- if (!isNaN(nVal)) {
80
- assign(acc, key, nVal, single);
81
- continue;
82
- }
83
- }
84
- if (nDate && isDateFormat(value, 'ISO')) {
85
- assign(acc, key, new Date(value), single);
59
+ switch (value) {
60
+ case 'true':
61
+ case 'TRUE':
62
+ case 'True':
63
+ assign(acc, key, nBool ? true : value, single);
64
+ continue;
65
+ case 'false':
66
+ case 'FALSE':
67
+ case 'False':
68
+ assign(acc, key, nBool ? false : value, single);
69
+ continue;
70
+ case 'null':
71
+ case 'NULL':
72
+ case 'Null':
73
+ assign(acc, key, nNull ? null : value, single);
74
+ continue;
75
+ default: {
76
+ if (typeof value === 'string' && value) {
77
+ if (nNumber && value[0] !== '0') {
78
+ const nVal = Number(value);
79
+ if (!isNaN(nVal)) {
80
+ assign(acc, key, nVal, single);
86
81
  continue;
87
82
  }
88
83
  }
89
- assign(acc, key, value, single);
84
+ if (nDate && value[4] === '-' && value[7] === '-' && value[10] === 'T' && isDateFormat(value, 'ISO')) {
85
+ assign(acc, key, new Date(value), single);
86
+ continue;
87
+ }
90
88
  }
89
+ assign(acc, key, value, single);
91
90
  }
92
91
  }
93
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valkyriestudios/utils",
3
- "version": "12.45.0",
3
+ "version": "12.46.0",
4
4
  "description": "A collection of single-function utilities for common tasks",
5
5
  "author": {
6
6
  "name": "Peter Vermeulen",
@@ -519,12 +519,12 @@
519
519
  }
520
520
  },
521
521
  "devDependencies": {
522
- "@types/node": "^22.18.0",
522
+ "@types/node": "^22.18.6",
523
523
  "@vitest/coverage-v8": "^3.2.4",
524
524
  "esbuild-register": "^3.6.0",
525
- "eslint": "^9.34.0",
525
+ "eslint": "^9.36.0",
526
526
  "typescript": "^5.9.2",
527
- "typescript-eslint": "^8.41.0",
527
+ "typescript-eslint": "^8.44.1",
528
528
  "vitest": "^3.2.4"
529
529
  }
530
530
  }