namirasoft-site 1.4.22 → 1.4.24

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.
@@ -0,0 +1,25 @@
1
+ export type NSNameParserStructure = {
2
+ name_namirasoft: string;
3
+ name_short: string;
4
+ title_namirasoft: string;
5
+ title_short: string;
6
+ class_namirasoft: string;
7
+ class_short: string;
8
+ };
9
+ export declare class NSNameParser {
10
+ name_full: string;
11
+ title_full: string;
12
+ isAPI: boolean;
13
+ isConsole: boolean;
14
+ isLibrary: boolean;
15
+ isNPM: boolean;
16
+ isPHP: boolean;
17
+ isAccountAPI: boolean;
18
+ api: NSNameParserStructure;
19
+ console: NSNameParserStructure;
20
+ library: NSNameParserStructure;
21
+ command: {
22
+ name: string;
23
+ };
24
+ constructor(name_full: string, title_full: string);
25
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NSNameParser = void 0;
4
+ const namirasoft_core_1 = require("namirasoft-core");
5
+ class NSNameParser {
6
+ constructor(name_full, title_full) {
7
+ this.api = {
8
+ name_namirasoft: "",
9
+ name_short: "",
10
+ title_namirasoft: "",
11
+ title_short: "",
12
+ class_namirasoft: "",
13
+ class_short: "",
14
+ };
15
+ this.console = {
16
+ name_namirasoft: "",
17
+ name_short: "",
18
+ title_namirasoft: "",
19
+ title_short: "",
20
+ class_namirasoft: "",
21
+ class_short: "",
22
+ };
23
+ this.library = {
24
+ name_namirasoft: "",
25
+ name_short: "",
26
+ title_namirasoft: "",
27
+ title_short: "",
28
+ class_namirasoft: "",
29
+ class_short: "",
30
+ };
31
+ this.command = { name: "" };
32
+ this.name_full = name_full;
33
+ this.title_full = title_full;
34
+ this.isAPI = /^namirasoft(-\w*)*-api(-\w*)*-v\d+$/gm.test(name_full);
35
+ this.isConsole = /^namirasoft-(\w+-)+console$/gm.test(name_full);
36
+ this.isLibrary = !this.isAPI && !this.isConsole && /^namirasoft-\w+/gm.test(name_full);
37
+ this.isNPM = this.isLibrary && /NPM Package$/gm.test(title_full);
38
+ this.isPHP = this.isLibrary && /PHP Package$/gm.test(title_full);
39
+ this.isAccountAPI = /^namirasoft-account-api-v\d+$/gm.test(name_full);
40
+ if (this.isAPI) {
41
+ this.api.name_namirasoft = this.name_full.replace(/(-api)?-v\d+$/gm, "");
42
+ this.api.name_short = this.api.name_namirasoft.replace(/^namirasoft-/gm, "");
43
+ this.api.title_namirasoft = this.title_full.replace(/(\sAPI)?\sV\d+$/gm, "");
44
+ this.api.title_short = this.api.title_namirasoft.replace(/^Namirasoft\s/gm, "");
45
+ this.api.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.api.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
46
+ this.api.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.api.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
47
+ this.command.name = this.api.name_namirasoft;
48
+ }
49
+ if (this.isConsole) {
50
+ this.console.name_namirasoft = this.name_full.replace(/-console$/gm, "");
51
+ this.console.name_short = this.console.name_namirasoft.replace(/^namirasoft-/gm, "");
52
+ this.console.title_namirasoft = this.title_full.replace(/\sConsole$/gm, "");
53
+ this.console.title_short = this.console.title_namirasoft.replace(/^Namirasoft\s/gm, "");
54
+ this.console.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.console.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
55
+ this.console.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.console.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
56
+ }
57
+ if (this.isLibrary) {
58
+ this.library.name_namirasoft = this.name_full;
59
+ this.library.name_short = this.library.name_namirasoft.replace(/^namirasoft-/gm, "");
60
+ this.library.title_namirasoft = this.title_full.replace(/\s(NPM|PHP)\sPackage$/gm, "");
61
+ this.library.title_short = this.library.title_namirasoft.replace(/^Namirasoft\s/gm, "");
62
+ this.library.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.library.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
63
+ this.library.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.library.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
64
+ this.command.name = this.library.name_namirasoft;
65
+ }
66
+ this.command.name = this.command.name.replace("namirasoft-", "ns-");
67
+ }
68
+ }
69
+ exports.NSNameParser = NSNameParser;
70
+ ;
71
+ //# sourceMappingURL=NSNameParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NSNameParser.js","sourceRoot":"","sources":["../src/NSNameParser.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAiBnD,MAAa,YAAY;IA2DrB,YAAY,SAAiB,EAAE,UAAkB;QA7C1C,QAAG,GAA0B;YAEhC,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YAGd,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;YAGf,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;SAClB,CAAC;QAEK,YAAO,GAA0B;YAEpC,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YAGd,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;YAGf,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;SAClB,CAAC;QAEK,YAAO,GAA0B;YAEpC,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YAGd,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;YAGf,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;SAClB,CAAC;QACK,YAAO,GAEV,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QAKb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAG7B,IAAI,CAAC,KAAK,GAAG,uCAAuC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrE,IAAI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O,CAAC,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;YACvF,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;YAGxF,IAAI,CAAC,OAAO,CAAC,gBAAgB,GAAG,kCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,kCAAgB,CAAC,WAAW,CAAC,CAAC;YAC3H,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,kCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,kCAAgB,CAAC,WAAW,CAAC,CAAC;YAGjH,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;QACrD,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC;CACJ;AA9HD,oCA8HC;AAAA,CAAC"}
@@ -0,0 +1,22 @@
1
+ export type NameParserStructure = {
2
+ name_namirasoft: string;
3
+ name_short: string;
4
+ title_namirasoft: string;
5
+ title_short: string;
6
+ class_namirasoft: string;
7
+ class_short: string;
8
+ };
9
+ export declare class NameParser {
10
+ name_full: string;
11
+ title_full: string;
12
+ isAPI: boolean;
13
+ isConsole: boolean;
14
+ isLibrary: boolean;
15
+ isNPM: boolean;
16
+ isPHP: boolean;
17
+ isAccountAPI: boolean;
18
+ api: NameParserStructure;
19
+ console: NameParserStructure;
20
+ library: NameParserStructure;
21
+ constructor(name_full: string, title_full: string);
22
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NameParser = void 0;
4
+ const namirasoft_core_1 = require("namirasoft-core");
5
+ class NameParser {
6
+ constructor(name_full, title_full) {
7
+ this.api = {
8
+ name_namirasoft: "",
9
+ name_short: "",
10
+ title_namirasoft: "",
11
+ title_short: "",
12
+ class_namirasoft: "",
13
+ class_short: "",
14
+ };
15
+ this.console = {
16
+ name_namirasoft: "",
17
+ name_short: "",
18
+ title_namirasoft: "",
19
+ title_short: "",
20
+ class_namirasoft: "",
21
+ class_short: "",
22
+ };
23
+ this.library = {
24
+ name_namirasoft: "",
25
+ name_short: "",
26
+ title_namirasoft: "",
27
+ title_short: "",
28
+ class_namirasoft: "",
29
+ class_short: "",
30
+ };
31
+ this.name_full = name_full;
32
+ this.title_full = title_full;
33
+ this.isAPI = /^namirasoft(-\w*)*-api(-\w*)*-v\d+$/gm.test(name_full);
34
+ this.isConsole = /^namirasoft-(\w+-)+console$/gm.test(name_full);
35
+ this.isLibrary = !this.isAPI && !this.isConsole && /^namirasoft-\w+/gm.test(name_full);
36
+ this.isNPM = this.isLibrary && /NPM Package$/gm.test(title_full);
37
+ this.isPHP = this.isLibrary && /PHP Package$/gm.test(title_full);
38
+ this.isAccountAPI = /^namirasoft-account-api-v\d+$/gm.test(name_full);
39
+ if (this.isAPI) {
40
+ this.api.name_namirasoft = this.name_full.replace(/(-api)?-v\d+$/gm, "");
41
+ this.api.name_short = this.api.name_namirasoft.replace(/^namirasoft-/gm, "");
42
+ this.api.title_namirasoft = this.title_full.replace(/(\sAPI)?\sV\d+$/gm, "");
43
+ this.api.title_short = this.api.title_namirasoft.replace(/^Namirasoft\s/gm, "");
44
+ this.api.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.api.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
45
+ this.api.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.api.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
46
+ }
47
+ if (this.isConsole) {
48
+ this.console.name_namirasoft = this.name_full.replace(/-console$/gm, "");
49
+ this.console.name_short = this.console.name_namirasoft.replace(/^namirasoft-/gm, "");
50
+ this.console.title_namirasoft = this.title_full.replace(/\sConsole$/gm, "");
51
+ this.console.title_short = this.console.title_namirasoft.replace(/^Namirasoft\s/gm, "");
52
+ this.console.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.console.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
53
+ this.console.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.console.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
54
+ }
55
+ if (this.isLibrary) {
56
+ this.library.name_namirasoft = this.name_full;
57
+ this.library.name_short = this.library.name_namirasoft.replace(/^namirasoft-/gm, "");
58
+ this.library.title_namirasoft = this.title_full.replace(/\s(NPM|PHP)\sPackage$/gm, "");
59
+ this.library.title_short = this.library.title_namirasoft.replace(/^Namirasoft\s/gm, "");
60
+ this.library.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.library.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
61
+ this.library.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.library.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
62
+ }
63
+ }
64
+ }
65
+ exports.NameParser = NameParser;
66
+ ;
67
+ //# sourceMappingURL=NameParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NameParser.js","sourceRoot":"","sources":["../src/NameParser.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAiBnD,MAAa,UAAU;IAyDnB,YAAY,SAAiB,EAAE,UAAkB;QA1C1C,QAAG,GAAwB;YAE9B,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YAGd,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;YAGf,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;SAClB,CAAC;QAEK,YAAO,GAAwB;YAElC,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YAGd,gBAAgB,EAA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AgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,kCAAgB,CAAC,WAAW,CAAC,CAAC;QACrH,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,EAClB,CAAC;YAEG,IAAI,CAAC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC;YAC9C,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;YAGrF,IAAI,CAAC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;YACvF,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;YAGxF,IAAI,CAAC,OAAO,CAAC,gBAAgB,GAAG,kCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,kCAAgB,CAAC,WAAW,CAAC,CAAC;YAC3H,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,kCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,kCAAgB,CAAC,WAAW,CAAC,CAAC;QACrH,CAAC;IACL,CAAC;CACJ;AApHD,gCAoHC;AAAA,CAAC"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./NSBaseMetaDatabase";
3
3
  export * from "./NSBaseMetaTable";
4
4
  export * from "./NSCookiesHeader";
5
5
  export * from "./NSHeader";
6
+ export * from "./NSNameParser";
6
7
  export * from "./NSReqHeader";
7
8
  export * from "./NSResHeader";
8
9
  export * from "./ProductUUID";
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ __exportStar(require("./NSBaseMetaDatabase"), exports);
19
19
  __exportStar(require("./NSBaseMetaTable"), exports);
20
20
  __exportStar(require("./NSCookiesHeader"), exports);
21
21
  __exportStar(require("./NSHeader"), exports);
22
+ __exportStar(require("./NSNameParser"), exports);
22
23
  __exportStar(require("./NSReqHeader"), exports);
23
24
  __exportStar(require("./NSResHeader"), exports);
24
25
  __exportStar(require("./ProductUUID"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,oDAAkC;AAClC,oDAAkC;AAClC,6CAA2B;AAC3B,gDAA8B;AAC9B,gDAA8B;AAC9B,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,oDAAkC;AAClC,oDAAkC;AAClC,6CAA2B;AAC3B,iDAA+B;AAC/B,gDAA8B;AAC9B,gDAA8B;AAC9B,gDAA8B"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.22",
11
+ "version": "1.4.24",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -0,0 +1,144 @@
1
+ import { NamingConvention } from "namirasoft-core";
2
+
3
+ export type NSNameParserStructure =
4
+ {
5
+ // Name
6
+ name_namirasoft: string;
7
+ name_short: string;
8
+
9
+ // Title
10
+ title_namirasoft: string;
11
+ title_short: string;
12
+
13
+ // Class
14
+ class_namirasoft: string;
15
+ class_short: string;
16
+ };
17
+
18
+ export class NSNameParser
19
+ {
20
+ // Input
21
+ public name_full: string;
22
+ public title_full: string;
23
+
24
+ // Is
25
+ public isAPI: boolean;
26
+ public isConsole: boolean;
27
+ public isLibrary: boolean;
28
+ public isNPM: boolean;
29
+ public isPHP: boolean;
30
+ public isAccountAPI: boolean;
31
+
32
+ public api: NSNameParserStructure = {
33
+ // Name
34
+ name_namirasoft: "",
35
+ name_short: "",
36
+
37
+ // Title
38
+ title_namirasoft: "",
39
+ title_short: "",
40
+
41
+ // Class
42
+ class_namirasoft: "",
43
+ class_short: "",
44
+ };
45
+
46
+ public console: NSNameParserStructure = {
47
+ // Name
48
+ name_namirasoft: "",
49
+ name_short: "",
50
+
51
+ // Title
52
+ title_namirasoft: "",
53
+ title_short: "",
54
+
55
+ // Class
56
+ class_namirasoft: "",
57
+ class_short: "",
58
+ };
59
+
60
+ public library: NSNameParserStructure = {
61
+ // Name
62
+ name_namirasoft: "",
63
+ name_short: "",
64
+
65
+ // Title
66
+ title_namirasoft: "",
67
+ title_short: "",
68
+
69
+ // Class
70
+ class_namirasoft: "",
71
+ class_short: "",
72
+ };
73
+ public command: {
74
+ name: string
75
+ } = { name: "" };
76
+
77
+ constructor(name_full: string, title_full: string)
78
+ {
79
+ // Input
80
+ this.name_full = name_full;
81
+ this.title_full = title_full;
82
+
83
+ // Is
84
+ this.isAPI = /^namirasoft(-\w*)*-api(-\w*)*-v\d+$/gm.test(name_full);
85
+ this.isConsole = /^namirasoft-(\w+-)+console$/gm.test(name_full);
86
+ this.isLibrary = !this.isAPI && !this.isConsole && /^namirasoft-\w+/gm.test(name_full);
87
+ this.isNPM = this.isLibrary && /NPM Package$/gm.test(title_full);
88
+ this.isPHP = this.isLibrary && /PHP Package$/gm.test(title_full);
89
+ this.isAccountAPI = /^namirasoft-account-api-v\d+$/gm.test(name_full);
90
+
91
+ if (this.isAPI)
92
+ {
93
+ // Name
94
+ this.api.name_namirasoft = this.name_full.replace(/(-api)?-v\d+$/gm, "");
95
+ this.api.name_short = this.api.name_namirasoft.replace(/^namirasoft-/gm, "");
96
+
97
+ // Title
98
+ this.api.title_namirasoft = this.title_full.replace(/(\sAPI)?\sV\d+$/gm, "");
99
+ this.api.title_short = this.api.title_namirasoft.replace(/^Namirasoft\s/gm, "");
100
+
101
+ // Class
102
+ this.api.class_namirasoft = NamingConvention.auto.convert(this.api.title_namirasoft, NamingConvention.Pascal_Case);
103
+ this.api.class_short = NamingConvention.auto.convert(this.api.title_short, NamingConvention.Pascal_Case);
104
+
105
+ // Command
106
+ this.command.name = this.api.name_namirasoft;
107
+ }
108
+
109
+ if (this.isConsole)
110
+ {
111
+ // Name
112
+ this.console.name_namirasoft = this.name_full.replace(/-console$/gm, "");
113
+ this.console.name_short = this.console.name_namirasoft.replace(/^namirasoft-/gm, "");
114
+
115
+ // Title
116
+ this.console.title_namirasoft = this.title_full.replace(/\sConsole$/gm, "");
117
+ this.console.title_short = this.console.title_namirasoft.replace(/^Namirasoft\s/gm, "");
118
+
119
+ // Class
120
+ this.console.class_namirasoft = NamingConvention.auto.convert(this.console.title_namirasoft, NamingConvention.Pascal_Case);
121
+ this.console.class_short = NamingConvention.auto.convert(this.console.title_short, NamingConvention.Pascal_Case);
122
+ }
123
+
124
+ if (this.isLibrary)
125
+ {
126
+ // Name
127
+ this.library.name_namirasoft = this.name_full;
128
+ this.library.name_short = this.library.name_namirasoft.replace(/^namirasoft-/gm, "");
129
+
130
+ // Title
131
+ this.library.title_namirasoft = this.title_full.replace(/\s(NPM|PHP)\sPackage$/gm, "");
132
+ this.library.title_short = this.library.title_namirasoft.replace(/^Namirasoft\s/gm, "");
133
+
134
+ // Class
135
+ this.library.class_namirasoft = NamingConvention.auto.convert(this.library.title_namirasoft, NamingConvention.Pascal_Case);
136
+ this.library.class_short = NamingConvention.auto.convert(this.library.title_short, NamingConvention.Pascal_Case);
137
+
138
+ // Command
139
+ this.command.name = this.library.name_namirasoft;
140
+ }
141
+
142
+ this.command.name = this.command.name.replace("namirasoft-", "ns-");
143
+ }
144
+ };
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./NSBaseMetaDatabase";
3
3
  export * from "./NSBaseMetaTable";
4
4
  export * from "./NSCookiesHeader";
5
5
  export * from "./NSHeader";
6
+ export * from "./NSNameParser";
6
7
  export * from "./NSReqHeader";
7
8
  export * from "./NSResHeader";
8
9
  export * from "./ProductUUID";