form-payload 1.7.4 → 1.8.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/package.json +28 -27
- package/src/libs/constants/value-as-array-identifier.constant.d.ts.map +1 -1
- package/src/libs/exceptions/form-payload-error.exception.d.ts.map +1 -1
- package/src/libs/helpers/check-is-one-of/check-is-one-of.helper.d.ts +3 -4
- package/src/libs/helpers/check-is-one-of/check-is-one-of.helper.d.ts.map +1 -1
- package/src/libs/helpers/check-is-one-of/check-is-one-of.helper.js +3 -4
- package/src/packages/get-form-control-payload/get-form-control-payload.d.ts.map +1 -1
- package/src/packages/get-form-control-payload/get-form-control-payload.js +33 -33
- package/src/packages/get-form-control-payload/libs/helpers/get-fieldset-control-element-value/get-fieldset-control-element-value.helper.d.ts.map +1 -1
- package/src/packages/get-form-control-payload/libs/helpers/get-form-control-elements-payload/get-form-control-elements-payload.d.ts.map +1 -1
- package/src/packages/get-form-control-payload/libs/helpers/get-operational-control-elements/helpers/helpers.d.ts +1 -1
- package/src/packages/get-form-control-payload/libs/helpers/get-operational-control-elements/helpers/helpers.js +1 -1
- package/src/packages/get-form-payload/get-form-payload.d.ts.map +1 -1
- package/src/packages.d.ts +0 -72
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "form-payload",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Gets form-payload via form.elements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"form",
|
|
@@ -48,33 +48,34 @@
|
|
|
48
48
|
"build": "npm run build:clean && npm run build:dist && npm run build:pkg && npm run build:cp"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@commitlint/cli": "
|
|
52
|
-
"@commitlint/config-conventional": "
|
|
53
|
-
"@commitlint/
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "
|
|
60
|
-
"@typescript-eslint/parser": "
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"eslint
|
|
64
|
-
"eslint-
|
|
65
|
-
"eslint-plugin-
|
|
66
|
-
"eslint-plugin-
|
|
67
|
-
"eslint-plugin-
|
|
68
|
-
"eslint-plugin-
|
|
69
|
-
"
|
|
70
|
-
"
|
|
51
|
+
"@commitlint/cli": "20.1.0",
|
|
52
|
+
"@commitlint/config-conventional": "20.0.0",
|
|
53
|
+
"@commitlint/lint": "20.0.0",
|
|
54
|
+
"@commitlint/load": "20.1.0",
|
|
55
|
+
"@commitlint/types": "20.0.0",
|
|
56
|
+
"@eslint/js": "9.39.0",
|
|
57
|
+
"@ls-lint/ls-lint": "2.3.1",
|
|
58
|
+
"@testing-library/dom": "10.4.1",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "8.46.2",
|
|
60
|
+
"@typescript-eslint/parser": "8.46.2",
|
|
61
|
+
"danger": "13.0.4",
|
|
62
|
+
"editorconfig-checker": "6.1.1",
|
|
63
|
+
"eslint": "9.39.0",
|
|
64
|
+
"eslint-import-resolver-typescript": "4.4.4",
|
|
65
|
+
"eslint-plugin-import": "2.32.0",
|
|
66
|
+
"eslint-plugin-jsdoc": "61.1.11",
|
|
67
|
+
"eslint-plugin-perfectionist": "4.15.1",
|
|
68
|
+
"eslint-plugin-sonarjs": "3.0.5",
|
|
69
|
+
"eslint-plugin-unicorn": "62.0.0",
|
|
70
|
+
"globals": "16.5.0",
|
|
71
|
+
"jsdom": "27.1.0",
|
|
71
72
|
"jsdom-global": "3.0.2",
|
|
72
|
-
"knip": "
|
|
73
|
-
"lint-staged": "
|
|
74
|
-
"prettier": "3.
|
|
75
|
-
"prettier-plugin-jsdoc": "1.
|
|
76
|
-
"simple-git-hooks": "2.
|
|
77
|
-
"typescript": "5.3
|
|
73
|
+
"knip": "5.67.1",
|
|
74
|
+
"lint-staged": "16.2.6",
|
|
75
|
+
"prettier": "3.6.2",
|
|
76
|
+
"prettier-plugin-jsdoc": "1.5.0",
|
|
77
|
+
"simple-git-hooks": "2.13.1",
|
|
78
|
+
"typescript": "5.9.3"
|
|
78
79
|
},
|
|
79
80
|
"simple-git-hooks": {
|
|
80
81
|
"pre-commit": "npm run git:hook:precommit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-as-array-identifier.constant.d.ts","sourceRoot":"","sources":["../../../../src/libs/constants/value-as-array-identifier.constant.js"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"value-as-array-identifier.constant.d.ts","sourceRoot":"","sources":["../../../../src/libs/constants/value-as-array-identifier.constant.js"],"names":[],"mappings":"AAAA,wCAAwD,IAAI,CAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-payload-error.exception.d.ts","sourceRoot":"","sources":["../../../../src/libs/exceptions/form-payload-error.exception.js"],"names":[],"mappings":"AAAA;IACC;;;;OAIG;IACH,yBAJW;
|
|
1
|
+
{"version":3,"file":"form-payload-error.exception.d.ts","sourceRoot":"","sources":["../../../../src/libs/exceptions/form-payload-error.exception.js"],"names":[],"mappings":"AAAA;IACC;;;;OAIG;IACH,yBAJW;QACP,OAAO,EAAE,MAAM,CAAC;KAChB,EAMH;CACD"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @template {unknown} T
|
|
3
2
|
* @param {unknown} value
|
|
4
|
-
* @param {...
|
|
5
|
-
* @returns {
|
|
3
|
+
* @param {...unknown} validValues
|
|
4
|
+
* @returns {boolean}
|
|
6
5
|
*/
|
|
7
|
-
export function checkIsOnOf
|
|
6
|
+
export function checkIsOnOf(value: unknown, ...validValues: unknown[]): boolean;
|
|
8
7
|
//# sourceMappingURL=check-is-one-of.helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-is-one-of.helper.d.ts","sourceRoot":"","sources":["../../../../../src/libs/helpers/check-is-one-of/check-is-one-of.helper.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"check-is-one-of.helper.d.ts","sourceRoot":"","sources":["../../../../../src/libs/helpers/check-is-one-of/check-is-one-of.helper.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mCAJW,OAAO,kBACJ,OAAO,EAAA,GACR,OAAO,CAInB"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @template {unknown} T
|
|
3
2
|
* @param {unknown} value
|
|
4
|
-
* @param {...
|
|
5
|
-
* @returns {
|
|
3
|
+
* @param {...unknown} validValues
|
|
4
|
+
* @returns {boolean}
|
|
6
5
|
*/
|
|
7
6
|
const checkIsOnOf = (value, ...validValues) => {
|
|
8
|
-
return
|
|
7
|
+
return validValues.includes(value);
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
export { checkIsOnOf };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-form-control-payload.d.ts","sourceRoot":"","sources":["../../../../src/packages/get-form-control-payload/get-form-control-payload.js"],"names":[],"mappings":";AAgBA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"get-form-control-payload.d.ts","sourceRoot":"","sources":["../../../../src/packages/get-form-control-payload/get-form-control-payload.js"],"names":[],"mappings":";AAgBA;;;;;GAKG;AACH,sCALuB,CAAC,SAAX,OAAS,kBACX,iCAAiC,GAC/B,CAAC,CA2Gb;kDA5HiD,2BAA2B"}
|
|
@@ -30,16 +30,23 @@ const getFormControlPayload = (controlElement) => {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
switch (controlElement.type) {
|
|
33
|
-
case ControlElementType.
|
|
33
|
+
case ControlElementType.CHECKBOX: {
|
|
34
|
+
return /** @type {T} */ (
|
|
35
|
+
getCheckboxControlElementValue(
|
|
36
|
+
/** @type {HTMLInputElement} */ (controlElement),
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
case ControlElementType.COLOR:
|
|
41
|
+
case ControlElementType.HIDDEN:
|
|
42
|
+
case ControlElementType.OUTPUT:
|
|
34
43
|
case ControlElementType.PASSWORD:
|
|
35
44
|
case ControlElementType.SEARCH:
|
|
36
|
-
case ControlElementType.
|
|
45
|
+
case ControlElementType.SELECT_ONE:
|
|
37
46
|
case ControlElementType.TEL:
|
|
38
|
-
case ControlElementType.
|
|
39
|
-
case ControlElementType.HIDDEN:
|
|
47
|
+
case ControlElementType.TEXT:
|
|
40
48
|
case ControlElementType.TEXTAREA:
|
|
41
|
-
case ControlElementType.
|
|
42
|
-
case ControlElementType.OUTPUT: {
|
|
49
|
+
case ControlElementType.URL: {
|
|
43
50
|
return /** @type {T} */ (
|
|
44
51
|
getControlElementValue(
|
|
45
52
|
/**
|
|
@@ -51,55 +58,56 @@ const getFormControlPayload = (controlElement) => {
|
|
|
51
58
|
)
|
|
52
59
|
);
|
|
53
60
|
}
|
|
54
|
-
case ControlElementType.
|
|
61
|
+
case ControlElementType.DATE:
|
|
62
|
+
case ControlElementType.MONTH:
|
|
63
|
+
case ControlElementType.TIME:
|
|
64
|
+
case ControlElementType.WEEK: {
|
|
55
65
|
return /** @type {T} */ (
|
|
56
|
-
|
|
66
|
+
getDateControlElementValue(
|
|
57
67
|
/** @type {HTMLInputElement} */ (controlElement),
|
|
58
68
|
)
|
|
59
69
|
);
|
|
60
70
|
}
|
|
61
|
-
case ControlElementType.
|
|
71
|
+
case ControlElementType.DATETIME_LOCAL: {
|
|
62
72
|
return /** @type {T} */ (
|
|
63
|
-
|
|
73
|
+
getDatetimeLocaControlElementValue(
|
|
64
74
|
/** @type {HTMLInputElement} */ (controlElement),
|
|
65
75
|
)
|
|
66
76
|
);
|
|
67
77
|
}
|
|
68
|
-
case ControlElementType.
|
|
69
|
-
case ControlElementType.RANGE: {
|
|
78
|
+
case ControlElementType.EMAIL: {
|
|
70
79
|
return /** @type {T} */ (
|
|
71
|
-
|
|
80
|
+
getEmailControlElementValue(
|
|
72
81
|
/** @type {HTMLInputElement} */ (controlElement),
|
|
73
82
|
)
|
|
74
83
|
);
|
|
75
84
|
}
|
|
76
|
-
case ControlElementType.
|
|
85
|
+
case ControlElementType.FIELDSET: {
|
|
77
86
|
return /** @type {T} */ (
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
getFieldsetControlElementValue(
|
|
88
|
+
getFormControlPayload,
|
|
89
|
+
/** @type {HTMLFieldSetElement} */ (controlElement),
|
|
80
90
|
)
|
|
81
91
|
);
|
|
82
92
|
}
|
|
83
|
-
case ControlElementType.
|
|
84
|
-
case ControlElementType.TIME:
|
|
85
|
-
case ControlElementType.MONTH:
|
|
86
|
-
case ControlElementType.WEEK: {
|
|
93
|
+
case ControlElementType.FILE: {
|
|
87
94
|
return /** @type {T} */ (
|
|
88
|
-
|
|
95
|
+
getFileControlElementValue(
|
|
89
96
|
/** @type {HTMLInputElement} */ (controlElement),
|
|
90
97
|
)
|
|
91
98
|
);
|
|
92
99
|
}
|
|
93
|
-
case ControlElementType.
|
|
100
|
+
case ControlElementType.NUMBER:
|
|
101
|
+
case ControlElementType.RANGE: {
|
|
94
102
|
return /** @type {T} */ (
|
|
95
|
-
|
|
103
|
+
getNumericControlElementValue(
|
|
96
104
|
/** @type {HTMLInputElement} */ (controlElement),
|
|
97
105
|
)
|
|
98
106
|
);
|
|
99
107
|
}
|
|
100
|
-
case ControlElementType.
|
|
108
|
+
case ControlElementType.RADIO: {
|
|
101
109
|
return /** @type {T} */ (
|
|
102
|
-
|
|
110
|
+
getRadioControlElementValue(
|
|
103
111
|
/** @type {HTMLInputElement} */ (controlElement),
|
|
104
112
|
)
|
|
105
113
|
);
|
|
@@ -111,14 +119,6 @@ const getFormControlPayload = (controlElement) => {
|
|
|
111
119
|
)
|
|
112
120
|
);
|
|
113
121
|
}
|
|
114
|
-
case ControlElementType.FIELDSET: {
|
|
115
|
-
return /** @type {T} */ (
|
|
116
|
-
getFieldsetControlElementValue(
|
|
117
|
-
getFormControlPayload,
|
|
118
|
-
/** @type {HTMLFieldSetElement} */ (controlElement),
|
|
119
|
-
)
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
throw new FormPayloadError({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-fieldset-control-element-value.helper.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/get-form-control-payload/libs/helpers/get-fieldset-control-element-value/get-fieldset-control-element-value.helper.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"get-fieldset-control-element-value.helper.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/get-form-control-payload/libs/helpers/get-fieldset-control-element-value/get-fieldset-control-element-value.helper.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,+CALuC,CAAC,SAA1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,wCAC3B,CAAC,OAAO,EAAE,iCAAiC,KAAK,OAAO,WACvD,mBAAmB,GACjB,CAAC,GAAG,CAAC,CAAC,CAAC,CAcnB;kDArBiD,oCAAoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-form-control-elements-payload.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/get-form-control-payload/libs/helpers/get-form-control-elements-payload/get-form-control-elements-payload.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"get-form-control-elements-payload.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/get-form-control-payload/libs/helpers/get-form-control-elements-payload/get-form-control-elements-payload.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,8CALuC,CAAC,SAA1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,wCAC3B,CAAC,OAAO,EAAE,iCAAiC,KAAK,OAAO,YACvD,0BAA0B,GACxB,CAAC,CAoFb;kDA/FM,oCAAoC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { checkHasControlElementName } from "./check-has-control-element-name/check-has-control-element-name.helper.js";
|
|
2
|
-
export { checkIsAllowedControlElement } from "./check-is-allowed-control-element/check-is-allowed-control-element.helper.js";
|
|
3
2
|
export { checkIsAllowedControlElementType } from "./check-is-allowed-control-element-type/check-is-allowed-control-element-type.helper.js";
|
|
3
|
+
export { checkIsAllowedControlElement } from "./check-is-allowed-control-element/check-is-allowed-control-element.helper.js";
|
|
4
4
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { checkHasControlElementName } from './check-has-control-element-name/check-has-control-element-name.helper.js';
|
|
2
|
-
export { checkIsAllowedControlElement } from './check-is-allowed-control-element/check-is-allowed-control-element.helper.js';
|
|
3
2
|
export { checkIsAllowedControlElementType } from './check-is-allowed-control-element-type/check-is-allowed-control-element-type.helper.js';
|
|
3
|
+
export { checkIsAllowedControlElement } from './check-is-allowed-control-element/check-is-allowed-control-element.helper.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-form-payload.d.ts","sourceRoot":"","sources":["../../../../src/packages/get-form-payload/get-form-payload.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,+
|
|
1
|
+
{"version":3,"file":"get-form-payload.d.ts","sourceRoot":"","sources":["../../../../src/packages/get-form-payload/get-form-payload.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,+BAJuC,CAAC,SAA1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,eAC3B,eAAe,GACb,CAAC,CAOb"}
|
package/src/packages.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
declare module 'eslint-plugin-perfectionist' {
|
|
2
|
-
import { type Linter } from 'eslint';
|
|
3
|
-
|
|
4
|
-
const configs: Record<'recommended-natural', Required<Linter.FlatConfig>>;
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
configs,
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
declare module 'eslint-plugin-unicorn' {
|
|
12
|
-
import { type Linter } from 'eslint';
|
|
13
|
-
|
|
14
|
-
const configs: Record<'recommended', Required<Linter.FlatConfig>>;
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
configs,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare module 'eslint-plugin-import' {
|
|
22
|
-
import { type Linter } from 'eslint';
|
|
23
|
-
|
|
24
|
-
const configs: Record<'recommended', Required<Linter.FlatConfig>>;
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
configs,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare module 'eslint-plugin-jsdoc' {
|
|
32
|
-
import { type Linter } from 'eslint';
|
|
33
|
-
|
|
34
|
-
const configs: Record<
|
|
35
|
-
'recommended-typescript-flavor-error',
|
|
36
|
-
Required<Linter.FlatConfig>
|
|
37
|
-
>;
|
|
38
|
-
|
|
39
|
-
export default {
|
|
40
|
-
configs,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
declare module '@eslint/js' {
|
|
45
|
-
import { type Linter } from 'eslint';
|
|
46
|
-
|
|
47
|
-
const configs: Record<'recommended', Required<Linter.FlatConfig>>;
|
|
48
|
-
|
|
49
|
-
export default {
|
|
50
|
-
configs,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
declare module '@typescript-eslint/eslint-plugin' {
|
|
55
|
-
import { type Linter } from 'eslint';
|
|
56
|
-
|
|
57
|
-
const configs: Record<'strict-type-checked', Required<Linter.FlatConfig>>;
|
|
58
|
-
|
|
59
|
-
export default {
|
|
60
|
-
configs,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
declare module 'eslint-plugin-sonarjs' {
|
|
65
|
-
import { type ESLint, type Rule, type Linter } from 'eslint';
|
|
66
|
-
|
|
67
|
-
const configs: Record<'recommended', Required<Linter.FlatConfig>>;
|
|
68
|
-
|
|
69
|
-
export default {
|
|
70
|
-
configs,
|
|
71
|
-
};
|
|
72
|
-
}
|