@nuka9510/simple-validation 1.0.7 → 1.0.9

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.
@@ -1,43 +1,38 @@
1
- export = validation;
2
- export as namespace validation;
1
+ export type InputElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
3
2
 
4
- declare namespace validation {
5
- type InputElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
3
+ /** 결과 객체 */
4
+ export interface result {
5
+ /** #default `true` */
6
+ flag: boolean;
7
+ /** #default `null` */
8
+ alertMsg: string | null;
9
+ /** #default `null` */
10
+ el: InputElement | null;
11
+ }
6
12
 
7
- /** 결과 객체 */
8
- interface result {
9
- /** #default `true` */
10
- flag: boolean;
11
- /** #default `null` */
12
- alertMsg: string | null;
13
- /** #default `null` */
14
- el: InputElement | null;
15
- }
13
+ export interface dateEl {
14
+ S?: InputElement;
15
+ E?: InputElement;
16
+ }
16
17
 
17
- interface dateEl {
18
- S?: InputElement;
19
- E?: InputElement;
20
- }
18
+ /** validation check할 Element를 담는 객체 */
19
+ export interface el {
20
+ el?: InputElement[];
21
+ date?: {
22
+ [date: string]: dateEl;
23
+ };
24
+ }
21
25
 
22
- /** validation check할 Element를 담는 객체 */
23
- interface el {
24
- el?: InputElement[];
25
- date?: {
26
- [date: string]: dateEl;
27
- };
28
- }
26
+ export interface radio {
27
+ [required: string]: InputElement[];
28
+ }
29
29
 
30
- interface radio {
31
- [required: string]: InputElement[];
32
- }
30
+ /** validation에 사용할 정규식을 담은 객체 */
31
+ export interface regex {
32
+ [pattern: string]: RegExp;
33
+ }
33
34
 
34
- /** validation 사용할 정규식을 담은 객체 */
35
- interface regex {
36
- [pattern: string]: RegExp;
37
- }
38
-
39
- /** validation 초기화를 위한 객체 */
40
- interface config {
41
- regex?: regex;
42
- }
35
+ /** validation 초기화를 위한 객체 */
36
+ export interface config {
37
+ regex?: regex;
43
38
  }
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "@nuka9510/simple-validation",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "simple validation util for web front-end",
5
5
  "main": "dist/index.js",
6
+ "type": "module",
6
7
  "directories": {
7
8
  "example": "example"
8
9
  },
9
10
  "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1"
11
+ "test": "echo \"Error: no test specified\" && exit 1",
12
+ "build": "rm -r -f dist && tsc",
13
+ "postversion": "git push && git push --tag && npm publish --access=public"
11
14
  },
12
15
  "repository": {
13
16
  "type": "git",
@@ -27,6 +30,6 @@
27
30
  },
28
31
  "homepage": "https://github.com/nuka9510/simple-validation",
29
32
  "dependencies": {
30
- "@nuka9510/js-util": "^1.0.23"
33
+ "@nuka9510/js-util": "^1.0.25"
31
34
  }
32
35
  }
package/src/validation.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { JUtil } from "@nuka9510/js-util";
2
1
  import { config, el, InputElement, radio, regex, result } from "../@types/validation";
2
+ import { JUtil } from "@nuka9510/js-util";
3
3
 
4
4
  /**
5
5
  * Validation Check를 위한 객체
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "typeRoots": ["@types"],
4
- "checkJs": true,
5
- "strictNullChecks": false,
6
- "noPropertyAccessFromIndexSignature": true,
7
- "noUncheckedIndexedAccess": true,
8
- "moduleResolution": "node",
9
- "useDefineForClassFields": true,
10
- "lib": ["ESNext", "DOM", "DOM.Iterable"],
11
- "target": "ESNext",
12
- "declaration": true,
13
- "outDir": "dist"
14
- },
15
- "include": [
16
- "src/index.ts"
17
- ]
18
- }