kcommons 13.12.2 → 13.12.4
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/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/utils/validators/cin.validator.d.ts +13 -0
- package/build/utils/validators/cin.validator.js +15 -4
- package/build/utils/validators/udyam.validator.d.ts +13 -0
- package/build/utils/validators/udyam.validator.js +19 -0
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -133,6 +133,7 @@ export * from "./typings/plugins/plugin.typings";
|
|
|
133
133
|
export * from "./utils/validators/gst.validator";
|
|
134
134
|
export * from "./utils/validators/pan.validator";
|
|
135
135
|
export * from "./utils/validators/cin.validator";
|
|
136
|
+
export * from "./utils/validators/udyam.validator";
|
|
136
137
|
export interface ITesting {
|
|
137
138
|
message: string;
|
|
138
139
|
age: number;
|
package/build/index.js
CHANGED
|
@@ -169,3 +169,4 @@ __exportStar(require("./typings/plugins/plugin.typings"), exports);
|
|
|
169
169
|
__exportStar(require("./utils/validators/gst.validator"), exports);
|
|
170
170
|
__exportStar(require("./utils/validators/pan.validator"), exports);
|
|
171
171
|
__exportStar(require("./utils/validators/cin.validator"), exports);
|
|
172
|
+
__exportStar(require("./utils/validators/udyam.validator"), exports);
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
export declare const CIN_REGEX: RegExp;
|
|
2
|
+
/**
|
|
3
|
+
* Returns boolean based on whether the provided CIN is valid or not.
|
|
4
|
+
* * @param cin_no CIN no. to be validated
|
|
5
|
+
* @returns Boolean
|
|
6
|
+
*
|
|
7
|
+
* Validation Rules:
|
|
8
|
+
* 1. ^[LU] → First character is L (listed) or U (unlisted)
|
|
9
|
+
* 2. [0-9]{5} → Next 5 digits = industry code
|
|
10
|
+
* 3. [A-Z]{2} → Next 2 letters = state code (e.g. MH, DL, KA)
|
|
11
|
+
* 4. [0-9]{4} → Next 4 digits = year of incorporation
|
|
12
|
+
* 5. [A-Z]{3} → Next 3 letters = company type (e.g. PTC, PLC, FTC, GOI etc.)
|
|
13
|
+
* 6. [0-9]{6}$ → Last 6 digits = registration number
|
|
14
|
+
*/
|
|
2
15
|
export declare function isValidCIN(cin_no: string): boolean;
|
|
@@ -2,9 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CIN_REGEX = void 0;
|
|
4
4
|
exports.isValidCIN = isValidCIN;
|
|
5
|
-
exports.CIN_REGEX = /^[LU][
|
|
5
|
+
exports.CIN_REGEX = /^[LU][0-9]{5}[A-Z]{2}[0-9]{4}[A-Z]{3}[0-9]{6}$/;
|
|
6
|
+
/**
|
|
7
|
+
* Returns boolean based on whether the provided CIN is valid or not.
|
|
8
|
+
* * @param cin_no CIN no. to be validated
|
|
9
|
+
* @returns Boolean
|
|
10
|
+
*
|
|
11
|
+
* Validation Rules:
|
|
12
|
+
* 1. ^[LU] → First character is L (listed) or U (unlisted)
|
|
13
|
+
* 2. [0-9]{5} → Next 5 digits = industry code
|
|
14
|
+
* 3. [A-Z]{2} → Next 2 letters = state code (e.g. MH, DL, KA)
|
|
15
|
+
* 4. [0-9]{4} → Next 4 digits = year of incorporation
|
|
16
|
+
* 5. [A-Z]{3} → Next 3 letters = company type (e.g. PTC, PLC, FTC, GOI etc.)
|
|
17
|
+
* 6. [0-9]{6}$ → Last 6 digits = registration number
|
|
18
|
+
*/
|
|
6
19
|
function isValidCIN(cin_no) {
|
|
7
|
-
|
|
8
|
-
return true;
|
|
9
|
-
// return CIN_REGEX.test(cin_no);
|
|
20
|
+
return exports.CIN_REGEX.test(cin_no);
|
|
10
21
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const UDYAM_REGEX: RegExp;
|
|
2
|
+
/**
|
|
3
|
+
* Returns boolean based on whether the provided UDYAM is valid or not.
|
|
4
|
+
* * @param udyam_no UDYAM no. to be validated
|
|
5
|
+
* @returns Boolean
|
|
6
|
+
*
|
|
7
|
+
* Validation Rules:
|
|
8
|
+
* 1. UDYAM- → fixed prefix
|
|
9
|
+
* 2. [A-Z]{2} → valid 2-letter state code
|
|
10
|
+
* 3. \d{2} → 2 digits for district code
|
|
11
|
+
* 4. \d{7} → 7-digit unique number
|
|
12
|
+
*/
|
|
13
|
+
export declare function isValidUdyam(udyam_no: string): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UDYAM_REGEX = void 0;
|
|
4
|
+
exports.isValidUdyam = isValidUdyam;
|
|
5
|
+
exports.UDYAM_REGEX = /^UDYAM-[A-Z]{2}-\d{2}-\d{7}$/;
|
|
6
|
+
/**
|
|
7
|
+
* Returns boolean based on whether the provided UDYAM is valid or not.
|
|
8
|
+
* * @param udyam_no UDYAM no. to be validated
|
|
9
|
+
* @returns Boolean
|
|
10
|
+
*
|
|
11
|
+
* Validation Rules:
|
|
12
|
+
* 1. UDYAM- → fixed prefix
|
|
13
|
+
* 2. [A-Z]{2} → valid 2-letter state code
|
|
14
|
+
* 3. \d{2} → 2 digits for district code
|
|
15
|
+
* 4. \d{7} → 7-digit unique number
|
|
16
|
+
*/
|
|
17
|
+
function isValidUdyam(udyam_no) {
|
|
18
|
+
return exports.UDYAM_REGEX.test(udyam_no);
|
|
19
|
+
}
|