typescript-class-helpers 21.0.64 → 21.0.66

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.
Files changed (51) hide show
  1. package/VERIFIED-BUILD-DATA.jsonc +3 -3
  2. package/browser/package.json +1 -1
  3. package/browser-prod/package.json +1 -1
  4. package/full-dts/build-info._auto-generated_.d.ts +1 -1
  5. package/lib/build-info._auto-generated_.d.ts +1 -1
  6. package/lib/build-info._auto-generated_.js +1 -1
  7. package/lib/package.json +1 -1
  8. package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
  9. package/lib-esm/lib/build-info._auto-generated_.js +1 -1
  10. package/lib-prod/build-info._auto-generated_.d.ts +1 -1
  11. package/lib-prod/build-info._auto-generated_.js +1 -1
  12. package/lib-prod/package.json +1 -1
  13. package/package.json +1 -1
  14. package/ts-source/browser-code/build-info._auto-generated_.ts +18 -0
  15. package/ts-source/browser-code/index._auto-generated_.ts +12 -0
  16. package/ts-source/browser-code/index.scss +11 -0
  17. package/ts-source/browser-code/index.ts +13 -0
  18. package/ts-source/browser-code/lib-info.md +8 -0
  19. package/ts-source/browser-code/migrations/migrations-info.md +6 -0
  20. package/ts-source/browser-code/typescript-class-helpers.ts +160 -0
  21. package/ts-source/browser-code-prod/build-info._auto-generated_.split-namespaces.json +4 -0
  22. package/ts-source/browser-code-prod/build-info._auto-generated_.ts +18 -0
  23. package/ts-source/browser-code-prod/index._auto-generated_.split-namespaces.json +4 -0
  24. package/ts-source/browser-code-prod/index._auto-generated_.ts +12 -0
  25. package/ts-source/browser-code-prod/index.scss +11 -0
  26. package/ts-source/browser-code-prod/index.split-namespaces.json +4 -0
  27. package/ts-source/browser-code-prod/index.ts +13 -0
  28. package/ts-source/browser-code-prod/lib-info.md +8 -0
  29. package/ts-source/browser-code-prod/migrations/migrations-info.md +6 -0
  30. package/ts-source/browser-code-prod/typescript-class-helpers.split-namespaces.json +26 -0
  31. package/ts-source/browser-code-prod/typescript-class-helpers.ts +158 -0
  32. package/ts-source/websql-code/build-info._auto-generated_.ts +18 -0
  33. package/ts-source/websql-code/index._auto-generated_.ts +12 -0
  34. package/ts-source/websql-code/index.scss +11 -0
  35. package/ts-source/websql-code/index.ts +13 -0
  36. package/ts-source/websql-code/lib-info.md +8 -0
  37. package/ts-source/websql-code/migrations/migrations-info.md +6 -0
  38. package/ts-source/websql-code/typescript-class-helpers.ts +160 -0
  39. package/ts-source/websql-code-prod/build-info._auto-generated_.split-namespaces.json +4 -0
  40. package/ts-source/websql-code-prod/build-info._auto-generated_.ts +18 -0
  41. package/ts-source/websql-code-prod/index._auto-generated_.split-namespaces.json +4 -0
  42. package/ts-source/websql-code-prod/index._auto-generated_.ts +12 -0
  43. package/ts-source/websql-code-prod/index.scss +11 -0
  44. package/ts-source/websql-code-prod/index.split-namespaces.json +4 -0
  45. package/ts-source/websql-code-prod/index.ts +13 -0
  46. package/ts-source/websql-code-prod/lib-info.md +8 -0
  47. package/ts-source/websql-code-prod/migrations/migrations-info.md +6 -0
  48. package/ts-source/websql-code-prod/typescript-class-helpers.split-namespaces.json +26 -0
  49. package/ts-source/websql-code-prod/typescript-class-helpers.ts +158 -0
  50. package/websql/package.json +1 -1
  51. package/websql-prod/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  {
2
- "commitHash": "963d9c0b81ae3273bec8b1ef7ea5b27c92c55f6a",
3
- "commitName": "release: v21.0.63",
4
- "commitDate": "13-10-2026 17:50:02"
2
+ "commitHash": "f1ed36c1bbf123db32c1a753bace81a34e78d051",
3
+ "commitName": "release: v21.0.65",
4
+ "commitDate": "18-10-2026 20:35:27"
5
5
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-class-helpers/browser",
3
- "version": "21.0.64",
3
+ "version": "21.0.66",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-class-helpers/browser-prod",
3
- "version": "21.0.64",
3
+ "version": "21.0.66",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0"
@@ -22,4 +22,4 @@ export declare const CURRENT_PACKAGE_TAON_VERSION = "v21";
22
22
  /**
23
23
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
24
24
  */
25
- export declare const CURRENT_PACKAGE_VERSION = "21.0.64";
25
+ export declare const CURRENT_PACKAGE_VERSION = "21.0.66";
@@ -21,4 +21,4 @@ export declare const CURRENT_PACKAGE_TAON_VERSION = "v21";
21
21
  /**
22
22
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
23
23
  */
24
- export declare const CURRENT_PACKAGE_VERSION = "21.0.64";
24
+ export declare const CURRENT_PACKAGE_VERSION = "21.0.66";
@@ -25,6 +25,6 @@ exports.CURRENT_PACKAGE_TAON_VERSION = 'v21';
25
25
  /**
26
26
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
27
27
  */
28
- exports.CURRENT_PACKAGE_VERSION = '21.0.64';
28
+ exports.CURRENT_PACKAGE_VERSION = '21.0.66';
29
29
  // THIS FILE IS GENERATED - DO NOT MODIFY
30
30
  //# sourceMappingURL=build-info._auto-generated_.js.map
package/lib/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "typescript-class-helpers/lib",
3
- "version": "21.0.64"
3
+ "version": "21.0.66"
4
4
  }
@@ -21,4 +21,4 @@ export declare const CURRENT_PACKAGE_TAON_VERSION = "v21";
21
21
  /**
22
22
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
23
23
  */
24
- export declare const CURRENT_PACKAGE_VERSION = "21.0.64";
24
+ export declare const CURRENT_PACKAGE_VERSION = "21.0.66";
@@ -22,6 +22,6 @@ export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
22
22
  /**
23
23
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
24
24
  */
25
- export const CURRENT_PACKAGE_VERSION = '21.0.64';
25
+ export const CURRENT_PACKAGE_VERSION = '21.0.66';
26
26
  // THIS FILE IS GENERATED - DO NOT MODIFY
27
27
  //# sourceMappingURL=build-info._auto-generated_.js.map
@@ -21,4 +21,4 @@ export declare const CURRENT_PACKAGE_TAON_VERSION = "v21";
21
21
  /**
22
22
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
23
23
  */
24
- export declare const CURRENT_PACKAGE_VERSION = "21.0.64";
24
+ export declare const CURRENT_PACKAGE_VERSION = "21.0.66";
@@ -22,6 +22,6 @@ export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
22
22
  /**
23
23
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
24
24
  */
25
- export const CURRENT_PACKAGE_VERSION = '21.0.64';
25
+ export const CURRENT_PACKAGE_VERSION = '21.0.66';
26
26
  // THIS FILE IS GENERATED - DO NOT MODIFY
27
27
  //# sourceMappingURL=build-info._auto-generated_.js.map
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "typescript-class-helpers/lib-prod",
3
- "version": "21.0.64"
3
+ "version": "21.0.66"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-class-helpers",
3
- "version": "21.0.64",
3
+ "version": "21.0.66",
4
4
  "scripts": {
5
5
  "test": "mocha --require ts-node/register src/**/*.spec.ts",
6
6
  "test:watch": "mocha --compilers ts-node/register src/**/*.spec.ts --watch",
@@ -0,0 +1,18 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ export const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
14
+ export const APP_ID = 'com.domain.example.typescript-class-helpers';
15
+ export const BUILD_BASE_HREF = '';
16
+ export const PROJECT_NPM_NAME = 'typescript-class-helpers';
17
+ export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
18
+ export const CURRENT_PACKAGE_VERSION = '21.0.66';
@@ -0,0 +1,12 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
@@ -0,0 +1,11 @@
1
+ /* ============================================================================
2
+
3
+ - TAON READONLY SOURCE
4
+ - DO NOT MODIFY THIS FILE.
5
+ - Changes may be overwritten.
6
+ - Use command: taon build:lib:watch
7
+ inside typescript-class-helpers project repository
8
+ for watch development of third party modules like this.
9
+
10
+ * ========================================================================== */
11
+
@@ -0,0 +1,13 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ export * from './typescript-class-helpers';
@@ -0,0 +1,8 @@
1
+ THIS FILE IS GENERATED - DO NOT MODIFY
2
+
3
+ This folder is an entry point for npm Angular/NodeJS library
4
+
5
+ DON'T USE STUFF FROM PARENT FOLDER app.* FILES HERE (except src/migrations/** files).
6
+
7
+ THIS FILE IS GENERATED - DO NOT MODIFY
8
+
@@ -0,0 +1,6 @@
1
+ THIS FILE IS GENERATED - DO NOT MODIFY
2
+
3
+ This folder is only for storing migration files with auto-generated names.
4
+
5
+ THIS FILE IS GENERATED - DO NOT MODIFY
6
+
@@ -0,0 +1,160 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ import { _, CoreModels, UtilsOs } from 'tnp-core/browser';
14
+ import { Helpers } from 'tnp-core/browser';
15
+ const REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');
16
+ type Registry = Map<string, Function>;
17
+ function getRegistry(): Registry {
18
+ const g = globalThis as any;
19
+ if (!g[REGISTRY_SYMBOL]) {
20
+ g[REGISTRY_SYMBOL] = new Map<string, Function>();
21
+ }
22
+ return g[REGISTRY_SYMBOL];
23
+ }
24
+ const classes = getRegistry();
25
+ export function getClassName(target: Function): string | undefined {
26
+ if (_.isNil(target)) {
27
+ return void 0;
28
+ }
29
+ if (_.isString(target)) {
30
+ return target;
31
+ }
32
+ if (target === Date) {
33
+ return 'Date';
34
+ }
35
+ if ((target as any) === FormData) {
36
+ return 'FormData';
37
+ }
38
+ if (!_.isFunction(target)) {
39
+ Helpers.log(`[typescript-class-helpers][getClassName] target is not a class`);
40
+ return void 0;
41
+ }
42
+ if (!_.isNil(target[CoreModels.ClassNameStaticProperty])) {
43
+ return target[CoreModels.ClassNameStaticProperty];
44
+ }
45
+ if (target.name?.startsWith('class_')) {
46
+ return '';
47
+ }
48
+ return undefined;
49
+ }
50
+ export function getClassFnFromObject(obj: object): Function | undefined {
51
+ if (_.isNil(obj)) {
52
+ return undefined;
53
+ }
54
+ return Object.getPrototypeOf(obj)?.constructor;
55
+ }
56
+ const notAllowedAsMethodNames = new Set([
57
+ 'length',
58
+ 'name',
59
+ 'arguments',
60
+ 'caller',
61
+ 'constructor',
62
+ 'apply',
63
+ 'bind',
64
+ 'call',
65
+ 'toString',
66
+ '__defineGetter__',
67
+ '__defineSetter__',
68
+ 'hasOwnProperty',
69
+ '__lookupGetter__',
70
+ '__lookupSetter__',
71
+ 'isPrototypeOf',
72
+ 'propertyIsEnumerable',
73
+ 'valueOf',
74
+ '__proto__',
75
+ 'toLocaleString',
76
+ ]);
77
+ export namespace CLASS {
78
+ export function NAME(className: string) {
79
+ return function (target: Function) {
80
+ return setClassName(target, className);
81
+ } as any;
82
+ }
83
+ export function setName(target: Function, className: string) {
84
+ setClassName(target, className);
85
+ }
86
+ export function getClassNameFromObjInstanceOrClassFn(target: any): string | undefined {
87
+ if (typeof target === 'object') {
88
+ return getNameFromObject(target);
89
+ }
90
+ return getClassName(target);
91
+ }
92
+ export function setClassName(target: Function, className: string): void {
93
+ target[CoreModels.ClassNameStaticProperty] = className;
94
+ classes.set(className, target);
95
+ }
96
+ export function getBy(className: string | Function): Function | undefined {
97
+ let res;
98
+ if (Array.isArray(className)) {
99
+ if (className.length !== 1) {
100
+ throw new Error(`Mapping error... please use proper class names:
101
+ {
102
+ propertyObject: 'MyClassName',
103
+ propertyWithArray: ['MyClassName']
104
+ }
105
+
106
+ `);
107
+ }
108
+ className = className[0];
109
+ }
110
+ if (typeof className === 'function') {
111
+ res = className;
112
+ }
113
+ if (className === 'Date') {
114
+ res = Date;
115
+ }
116
+ if (className === 'FormData') {
117
+ res = FormData;
118
+ }
119
+ const classFromMap = classes.get(className as string);
120
+ return classFromMap ? classFromMap : res;
121
+ }
122
+ export function getFromObject(o: Object): Function | undefined {
123
+ return getClassFnFromObject(o);
124
+ }
125
+ export function getName(target: Function): string | undefined {
126
+ return getClassName(target) as string;
127
+ }
128
+ export function getNameFromObject(o: Object): string | undefined {
129
+ const fnCLass = getFromObject(o);
130
+ return getName(fnCLass);
131
+ }
132
+ export const getMethodsNames = (classOrClassInstance: any, allMethodsNames = []): string[] => {
133
+ if (!classOrClassInstance) {
134
+ return allMethodsNames;
135
+ }
136
+ const isClassFunction = _.isFunction(classOrClassInstance);
137
+ const classFun = isClassFunction
138
+ ? classOrClassInstance
139
+ : Object.getPrototypeOf(classOrClassInstance);
140
+ const objectToCheck = isClassFunction
141
+ ? (classOrClassInstance as Function)?.prototype
142
+ : classOrClassInstance;
143
+ const prototypeObj = Object.getPrototypeOf(objectToCheck || {});
144
+ const properties = _.uniq([
145
+ ...Object.getOwnPropertyNames(objectToCheck || {}),
146
+ ...Object.getOwnPropertyNames(prototypeObj || {}),
147
+ ...Object.keys(objectToCheck || {}),
148
+ ...Object.keys(prototypeObj || {}),
149
+ ]).filter(f => !!f && !notAllowedAsMethodNames.has(f));
150
+ properties
151
+ .filter(methodName => typeof objectToCheck[methodName] === 'function')
152
+ .forEach(p => allMethodsNames.push(p));
153
+ if (!classFun ||
154
+ !classFun.constructor ||
155
+ classFun?.constructor?.name === 'Object') {
156
+ return allMethodsNames;
157
+ }
158
+ return getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);
159
+ };
160
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }
@@ -0,0 +1,18 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ export const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
14
+ export const APP_ID = 'com.domain.example.typescript-class-helpers';
15
+ export const BUILD_BASE_HREF = '';
16
+ export const PROJECT_NPM_NAME = 'typescript-class-helpers';
17
+ export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
18
+ export const CURRENT_PACKAGE_VERSION = '21.0.66';
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }
@@ -0,0 +1,12 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
@@ -0,0 +1,11 @@
1
+ /* ============================================================================
2
+
3
+ - TAON READONLY SOURCE
4
+ - DO NOT MODIFY THIS FILE.
5
+ - Changes may be overwritten.
6
+ - Use command: taon build:lib:watch
7
+ inside typescript-class-helpers project repository
8
+ for watch development of third party modules like this.
9
+
10
+ * ========================================================================== */
11
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }
@@ -0,0 +1,13 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ export * from './typescript-class-helpers';
@@ -0,0 +1,8 @@
1
+ THIS FILE IS GENERATED - DO NOT MODIFY
2
+
3
+ This folder is an entry point for npm Angular/NodeJS library
4
+
5
+ DON'T USE STUFF FROM PARENT FOLDER app.* FILES HERE (except src/migrations/** files).
6
+
7
+ THIS FILE IS GENERATED - DO NOT MODIFY
8
+
@@ -0,0 +1,6 @@
1
+ THIS FILE IS GENERATED - DO NOT MODIFY
2
+
3
+ This folder is only for storing migration files with auto-generated names.
4
+
5
+ THIS FILE IS GENERATED - DO NOT MODIFY
6
+
@@ -0,0 +1,26 @@
1
+ {
2
+ "namespacesMapObj": {
3
+ "CLASS.NAME": "CLASS__NS__NAME",
4
+ "CLASS.setName": "CLASS__NS__setName",
5
+ "CLASS.getClassNameFromObjInstanceOrClassFn": "CLASS__NS__getClassNameFromObjInstanceOrClassFn",
6
+ "CLASS.setClassName": "CLASS__NS__setClassName",
7
+ "CLASS.getBy": "CLASS__NS__getBy",
8
+ "CLASS.getFromObject": "CLASS__NS__getFromObject",
9
+ "CLASS.getName": "CLASS__NS__getName",
10
+ "CLASS.getNameFromObject": "CLASS__NS__getNameFromObject",
11
+ "CLASS.getMethodsNames": "CLASS__NS__getMethodsNames"
12
+ },
13
+ "namespacesReplace": {
14
+ "CLASS": [
15
+ "CLASS__NS__NAME",
16
+ "CLASS__NS__getBy",
17
+ "CLASS__NS__getClassNameFromObjInstanceOrClassFn",
18
+ "CLASS__NS__getFromObject",
19
+ "CLASS__NS__getMethodsNames",
20
+ "CLASS__NS__getName",
21
+ "CLASS__NS__getNameFromObject",
22
+ "CLASS__NS__setClassName",
23
+ "CLASS__NS__setName"
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,158 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ import { ___NS__add, ___NS__after, ___NS__ary, ___NS__assign, ___NS__assignIn, ___NS__assignInWith, ___NS__assignWith, ___NS__at, ___NS__attempt, ___NS__before, ___NS__bind, ___NS__bindAll, ___NS__bindKey, ___NS__camelCase, ___NS__capitalize, ___NS__castArray, ___NS__ceil, ___NS__chain, ___NS__chunk, ___NS__clamp, ___NS__clone, ___NS__cloneDeep, ___NS__cloneDeepWith, ___NS__cloneWith, ___NS__compact, ___NS__concat, ___NS__cond, ___NS__conforms, ___NS__conformsTo, ___NS__constant, ___NS__countBy, ___NS__create, ___NS__curry, ___NS__curryRight, ___NS__debounce, ___NS__deburr, ___NS__defaults, ___NS__defaultsDeep, ___NS__defaultTo, ___NS__defer, ___NS__delay, ___NS__difference, ___NS__differenceBy, ___NS__differenceWith, ___NS__divide, ___NS__drop, ___NS__dropRight, ___NS__dropRightWhile, ___NS__dropWhile, ___NS__each, ___NS__eachRight, ___NS__endsWith, ___NS__entries, ___NS__entriesIn, ___NS__eq, ___NS__escape, ___NS__escapeRegExp, ___NS__every, ___NS__extend, ___NS__extendWith, ___NS__fill, ___NS__filter, ___NS__find, ___NS__findIndex, ___NS__findKey, ___NS__findLast, ___NS__findLastIndex, ___NS__findLastKey, ___NS__first, ___NS__flatMap, ___NS__flatMapDeep, ___NS__flatMapDepth, ___NS__flatten, ___NS__flattenDeep, ___NS__flattenDepth, ___NS__flip, ___NS__floor, ___NS__flow, ___NS__flowRight, ___NS__forEach, ___NS__forEachRight, ___NS__forIn, ___NS__forInRight, ___NS__forOwn, ___NS__forOwnRight, ___NS__fromPairs, ___NS__functions, ___NS__functionsIn, ___NS__get, ___NS__groupBy, ___NS__gt, ___NS__gte, ___NS__has, ___NS__hasIn, ___NS__head, ___NS__identity, ___NS__includes, ___NS__indexOf, ___NS__initial, ___NS__inRange, ___NS__intersection, ___NS__intersectionBy, ___NS__intersectionWith, ___NS__invert, ___NS__invertBy, ___NS__invoke, ___NS__invokeMap, ___NS__isArguments, ___NS__isArray, ___NS__isArrayBuffer, ___NS__isArrayLike, ___NS__isArrayLikeObject, ___NS__isBoolean, ___NS__isBuffer, ___NS__isDate, ___NS__isElement, ___NS__isEmpty, ___NS__isEqual, ___NS__isEqualWith, ___NS__isError, ___NS__isFinite, ___NS__isFunction, ___NS__isInteger, ___NS__isLeafObject, ___NS__isLength, ___NS__isMap, ___NS__isMatch, ___NS__isMatchWith, ___NS__isNaN, ___NS__isNative, ___NS__isNil, ___NS__isNull, ___NS__isNumber, ___NS__isObject, ___NS__isObjectLike, ___NS__isPlainObject, ___NS__isRegExp, ___NS__isSafeInteger, ___NS__isSet, ___NS__isString, ___NS__isSymbol, ___NS__isTypedArray, ___NS__isUndefined, ___NS__isWeakMap, ___NS__isWeakSet, ___NS__iteratee, ___NS__join, ___NS__kebabCase, ___NS__keyBy, ___NS__keys, ___NS__keysIn, ___NS__last, ___NS__lastIndexOf, ___NS__lowerCase, ___NS__lowerFirst, ___NS__lt, ___NS__lte, ___NS__map, ___NS__mapKeys, ___NS__mapValues, ___NS__matches, ___NS__matchesProperty, ___NS__max, ___NS__maxBy, ___NS__mean, ___NS__meanBy, ___NS__memoize, ___NS__merge, ___NS__mergeWith, ___NS__method, ___NS__methodOf, ___NS__min, ___NS__minBy, ___NS__mixin, ___NS__multiply, ___NS__negate, ___NS__noop, ___NS__now, ___NS__nth, ___NS__nthArg, ___NS__omit, ___NS__omitBy, ___NS__once, ___NS__orderBy, ___NS__over, ___NS__overArgs, ___NS__overEvery, ___NS__overSome, ___NS__pad, ___NS__padEnd, ___NS__padStart, ___NS__parseInt, ___NS__partial, ___NS__partialRight, ___NS__partition, ___NS__pick, ___NS__pickBy, ___NS__property, ___NS__propertyOf, ___NS__pull, ___NS__pullAll, ___NS__pullAllBy, ___NS__pullAllWith, ___NS__pullAt, ___NS__random, ___NS__range, ___NS__rangeRight, ___NS__rearg, ___NS__reduce, ___NS__reduceRight, ___NS__reject, ___NS__remove, ___NS__repeat, ___NS__replace, ___NS__rest, ___NS__result, ___NS__reverse, ___NS__round, ___NS__sample, ___NS__sampleSize, ___NS__set, ___NS__setWith, ___NS__shuffle, ___NS__size, ___NS__slice, ___NS__snakeCase, ___NS__some, ___NS__sortBy, ___NS__sortedIndex, ___NS__sortedIndexBy, ___NS__sortedIndexOf, ___NS__sortedLastIndex, ___NS__sortedLastIndexBy, ___NS__sortedLastIndexOf, ___NS__sortedUniq, ___NS__sortedUniqBy, ___NS__split, ___NS__spread, ___NS__startCase, ___NS__startsWith, ___NS__stubArray, ___NS__stubFalse, ___NS__stubObject, ___NS__stubString, ___NS__stubTrue, ___NS__subtract, ___NS__sum, ___NS__sumBy, ___NS__tail, ___NS__take, ___NS__takeRight, ___NS__takeRightWhile, ___NS__takeWhile, ___NS__tap, ___NS__template, ___NS__templateSettings, ___NS__throttle, ___NS__thru, ___NS__times, ___NS__toArray, ___NS__toFinite, ___NS__toInteger, ___NS__toLength, ___NS__toLower, ___NS__toNumber, ___NS__toPairs, ___NS__toPairsIn, ___NS__toPath, ___NS__toPlainObject, ___NS__toSafeInteger, ___NS__toString, ___NS__toUpper, ___NS__transform, ___NS__trim, ___NS__trimEnd, ___NS__trimStart, ___NS__truncate, ___NS__unary, ___NS__unescape, ___NS__union, ___NS__unionBy, ___NS__unionWith, ___NS__uniq, ___NS__uniqBy, ___NS__uniqueId, ___NS__uniqWith, ___NS__unset, ___NS__unzip, ___NS__unzipWith, ___NS__update, ___NS__updateWith, ___NS__upperCase, ___NS__upperFirst, ___NS__values, ___NS__valuesIn, ___NS__without, ___NS__words, ___NS__wrap, ___NS__xor, ___NS__xorBy, ___NS__xorWith, ___NS__zip, ___NS__zipObject, ___NS__zipObjectDeep, ___NS__zipWith, CoreModels__NS__BaseProjectType, CoreModels__NS__BaseProjectTypeArr, CoreModels__NS__BuildType, CoreModels__NS__BuildTypeArr, CoreModels__NS__buildTypeToWatcherFn, CoreModels__NS__BuildWatcherErrorType, CoreModels__NS__BuildWatcherType, CoreModels__NS__BuildWatcherTypeArr, CoreModels__NS__CfontAlign, CoreModels__NS__CfontStyle, CoreModels__NS__ClassNameStaticProperty, CoreModels__NS__ContentType, CoreModels__NS__ContentTypeKeys, CoreModels__NS__CoreLibCategory, CoreModels__NS__CutableFileExt, CoreModels__NS__DatabaseType, CoreModels__NS__DeepPartial, CoreModels__NS__FileEvent, CoreModels__NS__FileExtension, CoreModels__NS__FirstParamsFrom, CoreModels__NS__FrameworkVersion, CoreModels__NS__GitConnection, CoreModels__NS__GitConnectionArr, CoreModels__NS__GlobalDependencies, CoreModels__NS__hasExitCleaningFunction, CoreModels__NS__HttpCode, CoreModels__NS__HttpMethod, CoreModels__NS__HttpMethodArr, CoreModels__NS__ImageFileExtension, CoreModels__NS__ImageFileExtensionArr, CoreModels__NS__InstalationType, CoreModels__NS__InstalationTypeArr, CoreModels__NS__LibType, CoreModels__NS__localhostDomain, CoreModels__NS__localhostIp127, CoreModels__NS__ManifestIcon, CoreModels__NS__MediaType, CoreModels__NS__MediaTypeAllArr, CoreModels__NS__mimeTypes, CoreModels__NS__NewFactoryType, CoreModels__NS__NpmInstallOptions, CoreModels__NS__NpmPublishOptions, CoreModels__NS__NpmSpecialVersions, CoreModels__NS__OrignalClassKey, CoreModels__NS__OutFolder, CoreModels__NS__Package, CoreModels__NS__ParamType, CoreModels__NS__parentLocation, CoreModels__NS__pathToChildren, CoreModels__NS__Position, CoreModels__NS__PreReleaseVersionTag, CoreModels__NS__PROGRESS_DATA_TYPE, CoreModels__NS__PUSHTYPE, CoreModels__NS__PwaManifest, CoreModels__NS__ReleaseVersionType, CoreModels__NS__ReleaseVersionTypeEnum, CoreModels__NS__RunOptions, CoreModels__NS__Size, CoreModels__NS__SPECIAL_APP_READY_MESSAGE, CoreModels__NS__SPECIAL_WORKER_READY_MESSAGE, CoreModels__NS__StatusCode401, CoreModels__NS__tagForTaskName, CoreModels__NS__TaonHttpErrorCustomProp, CoreModels__NS__TsUsage, CoreModels__NS__UIFramework, CoreModels__NS__ValueOf, CoreModels__NS__VSCodeSettings, UtilsOs__NS__commandExistsAsync, UtilsOs__NS__commandExistsSync, UtilsOs__NS__detectEditor, UtilsOs__NS__drawHorizontalLine, UtilsOs__NS__drawVerticalLine, UtilsOs__NS__Editor, UtilsOs__NS__EDITOR_PROCESSES, UtilsOs__NS__EditorArr, UtilsOs__NS__EditorProcess, UtilsOs__NS__getEditorKeybindingPath, UtilsOs__NS__getEditorSettingsJsonPath, UtilsOs__NS__getInotifyWatchCount, UtilsOs__NS__getRealHomeDir, UtilsOs__NS__isBrowser, UtilsOs__NS__isDockerAvailable, UtilsOs__NS__isElectron, UtilsOs__NS__isNode, UtilsOs__NS__isNodeVersionOk, UtilsOs__NS__isPortInUse, UtilsOs__NS__isRunningInBrowser, UtilsOs__NS__isRunningInCliMode, UtilsOs__NS__isRunningInCloudflareWorker, UtilsOs__NS__isRunningInDocker, UtilsOs__NS__isRunningInElectron, UtilsOs__NS__isRunningInLinuxDistro, UtilsOs__NS__isRunningInLinuxGraphicsCapableEnvironment, UtilsOs__NS__isRunningInMochaTest, UtilsOs__NS__isRunningInNode, UtilsOs__NS__isRunningInOsWithGraphicsCapableEnvironment, UtilsOs__NS__isRunningInSSRMode, UtilsOs__NS__isRunningInVscodeExtension, UtilsOs__NS__isRunningInWebSQL, UtilsOs__NS__isRunningInWindows, UtilsOs__NS__isRunningInWindowsCmd, UtilsOs__NS__isRunningInWindowsGitBash, UtilsOs__NS__isRunningInWindowsPowerShell, UtilsOs__NS__isRunningInWsl, UtilsOs__NS__isRunningNodeDebugger, UtilsOs__NS__isSSRMode, UtilsOs__NS__isVscodeExtension, UtilsOs__NS__isWebSQL, UtilsOs__NS__killAllEditor, UtilsOs__NS__openFolderInFileExplorer, UtilsOs__NS__pipxNestedPackageExists, UtilsOs__NS__pipxPackageExists, UtilsOs__NS__pythonModuleExists, UtilsOs__NS__safeExitProgramCleanUp, UtilsOs__NS__sendNotification, UtilsOs__NS__whichOrWherePackageLocated } from 'tnp-core/browser-prod';
14
+ import { Helpers__NS___fixCommand, Helpers__NS__ActionInstance, Helpers__NS__actionStarted, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__contain, Helpers__NS__createFolder, Helpers__NS__createSymLink, Helpers__NS__error, Helpers__NS__execute, Helpers__NS__exists, Helpers__NS__filesFrom, Helpers__NS__foldersFrom, Helpers__NS__getFilesFrom, Helpers__NS__getFoldersFrom, Helpers__NS__getIsBrowser, Helpers__NS__getIsElectron, Helpers__NS__getIsNode, Helpers__NS__getIsRunningInGitBash, Helpers__NS__getIsSupportedTaonTerminal, Helpers__NS__getIsVerboseMode, Helpers__NS__getIsVerboseModeOrTnp, Helpers__NS__getIsWebSQL, Helpers__NS__getIsWsl, Helpers__NS__getStdio, Helpers__NS__hideNodeWarnings, Helpers__NS__info, Helpers__NS__isBlob, Helpers__NS__isBuffer, Helpers__NS__isClass, Helpers__NS__isExistedSymlink, Helpers__NS__isFile, Helpers__NS__isFolder, Helpers__NS__isRunningInDocker, Helpers__NS__isRunningInLinuxGraphicsCapableEnvironment, Helpers__NS__isSymlinkFileExitedOrUnexisted, Helpers__NS__isSymlinkThatMatchesUrl, Helpers__NS__isUnexistedLink, Helpers__NS__killOnPort, Helpers__NS__killProcess, Helpers__NS__killProcessByPort, Helpers__NS__linksToFolderFrom, Helpers__NS__linksToFoldersFrom, Helpers__NS__log, Helpers__NS__logError, Helpers__NS__logInfo, Helpers__NS__logProc, Helpers__NS__logSuccess, Helpers__NS__logTaskDone, Helpers__NS__logTaskStarted, Helpers__NS__logWarn, Helpers__NS__mediaTypeFromSrc, Helpers__NS__mkdirp, Helpers__NS__modifyLineByLine, Helpers__NS__msgCacheClear, Helpers__NS__openFolderInFileExplorer, Helpers__NS__parse, Helpers__NS__pathContainLink, Helpers__NS__questionYesNo, Helpers__NS__readFile, Helpers__NS__readJson, Helpers__NS__readJson5, Helpers__NS__readJsonC, Helpers__NS__relative, Helpers__NS__remove, Helpers__NS__removeEmptyLineFromString, Helpers__NS__removeFileIfExists, Helpers__NS__removeFolderIfExists, Helpers__NS__removeIfExists, Helpers__NS__removeSlashAtBegin, Helpers__NS__removeSlashAtEnd, Helpers__NS__removeSymlinks, Helpers__NS__renderError, Helpers__NS__replaceLinesInFile, Helpers__NS__run, Helpers__NS__runAsyncIn, Helpers__NS__runSyncIn, Helpers__NS__runSyncOrAsync, Helpers__NS__sleep, Helpers__NS__stopApplication, Helpers__NS__stringify, Helpers__NS__success, Helpers__NS__taskDone, Helpers__NS__taskStarted, Helpers__NS__throwError, Helpers__NS__timeout, Helpers__NS__tryCatchError, Helpers__NS__tryReadFile, Helpers__NS__tryRemoveDir, Helpers__NS__values, Helpers__NS__wait, Helpers__NS__warn, Helpers__NS__writeFile, Helpers__NS__writeJson, Helpers__NS__writeJson5, Helpers__NS__writeJsonC } from 'tnp-core/browser-prod';
15
+ const REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');
16
+ type Registry = Map<string, Function>;
17
+ function getRegistry(): Registry {
18
+ const g = globalThis as any;
19
+ if (!g[REGISTRY_SYMBOL]) {
20
+ g[REGISTRY_SYMBOL] = new Map<string, Function>();
21
+ }
22
+ return g[REGISTRY_SYMBOL];
23
+ }
24
+ const classes = getRegistry();
25
+ export function getClassName(target: Function): string | undefined {
26
+ if (___NS__isNil(target)) {
27
+ return void 0;
28
+ }
29
+ if (___NS__isString(target)) {
30
+ return target;
31
+ }
32
+ if (target === Date) {
33
+ return 'Date';
34
+ }
35
+ if ((target as any) === FormData) {
36
+ return 'FormData';
37
+ }
38
+ if (!___NS__isFunction(target)) {
39
+ Helpers__NS__log(`[typescript-class-helpers][getClassName] target is not a class`);
40
+ return void 0;
41
+ }
42
+ if (!___NS__isNil(target[CoreModels__NS__ClassNameStaticProperty])) {
43
+ return target[CoreModels__NS__ClassNameStaticProperty];
44
+ }
45
+ if (target.name?.startsWith('class_')) {
46
+ return '';
47
+ }
48
+ return undefined;
49
+ }
50
+ export function getClassFnFromObject(obj: object): Function | undefined {
51
+ if (___NS__isNil(obj)) {
52
+ return undefined;
53
+ }
54
+ return Object.getPrototypeOf(obj)?.constructor;
55
+ }
56
+ const notAllowedAsMethodNames = new Set([
57
+ 'length',
58
+ 'name',
59
+ 'arguments',
60
+ 'caller',
61
+ 'constructor',
62
+ 'apply',
63
+ 'bind',
64
+ 'call',
65
+ 'toString',
66
+ '__defineGetter__',
67
+ '__defineSetter__',
68
+ 'hasOwnProperty',
69
+ '__lookupGetter__',
70
+ '__lookupSetter__',
71
+ 'isPrototypeOf',
72
+ 'propertyIsEnumerable',
73
+ 'valueOf',
74
+ '__proto__',
75
+ 'toLocaleString',
76
+ ]);
77
+ export function CLASS__NS__NAME(className: string) {
78
+ return function (target: Function) {
79
+ return CLASS__NS__setClassName(target, className);
80
+ } as any;
81
+ }
82
+ export function CLASS__NS__setName(target: Function, className: string) {
83
+ CLASS__NS__setClassName(target, className);
84
+ }
85
+ export function CLASS__NS__getClassNameFromObjInstanceOrClassFn(target: any): string | undefined {
86
+ if (typeof target === 'object') {
87
+ return CLASS__NS__getNameFromObject(target);
88
+ }
89
+ return getClassName(target);
90
+ }
91
+ export function CLASS__NS__setClassName(target: Function, className: string): void {
92
+ target[CoreModels__NS__ClassNameStaticProperty] = className;
93
+ classes.set(className, target);
94
+ }
95
+ export function CLASS__NS__getBy(className: string | Function): Function | undefined {
96
+ let res;
97
+ if (Array.isArray(className)) {
98
+ if (className.length !== 1) {
99
+ throw new Error(`Mapping error... please use proper class names:
100
+ {
101
+ propertyObject: 'MyClassName',
102
+ propertyWithArray: ['MyClassName']
103
+ }
104
+
105
+ `);
106
+ }
107
+ className = className[0];
108
+ }
109
+ if (typeof className === 'function') {
110
+ res = className;
111
+ }
112
+ if (className === 'Date') {
113
+ res = Date;
114
+ }
115
+ if (className === 'FormData') {
116
+ res = FormData;
117
+ }
118
+ const classFromMap = classes.get(className as string);
119
+ return classFromMap ? classFromMap : res;
120
+ }
121
+ export function CLASS__NS__getFromObject(o: Object): Function | undefined {
122
+ return getClassFnFromObject(o);
123
+ }
124
+ export function CLASS__NS__getName(target: Function): string | undefined {
125
+ return getClassName(target) as string;
126
+ }
127
+ export function CLASS__NS__getNameFromObject(o: Object): string | undefined {
128
+ const fnCLass = CLASS__NS__getFromObject(o);
129
+ return CLASS__NS__getName(fnCLass);
130
+ }
131
+ export const CLASS__NS__getMethodsNames = (classOrClassInstance: any, allMethodsNames = []): string[] => {
132
+ if (!classOrClassInstance) {
133
+ return allMethodsNames;
134
+ }
135
+ const isClassFunction = ___NS__isFunction(classOrClassInstance);
136
+ const classFun = isClassFunction
137
+ ? classOrClassInstance
138
+ : Object.getPrototypeOf(classOrClassInstance);
139
+ const objectToCheck = isClassFunction
140
+ ? (classOrClassInstance as Function)?.prototype
141
+ : classOrClassInstance;
142
+ const prototypeObj = Object.getPrototypeOf(objectToCheck || {});
143
+ const properties = ___NS__uniq([
144
+ ...Object.getOwnPropertyNames(objectToCheck || {}),
145
+ ...Object.getOwnPropertyNames(prototypeObj || {}),
146
+ ...Object.keys(objectToCheck || {}),
147
+ ...Object.keys(prototypeObj || {}),
148
+ ]).filter(f => !!f && !notAllowedAsMethodNames.has(f));
149
+ properties
150
+ .filter(methodName => typeof objectToCheck[methodName] === 'function')
151
+ .forEach(p => allMethodsNames.push(p));
152
+ if (!classFun ||
153
+ !classFun.constructor ||
154
+ classFun?.constructor?.name === 'Object') {
155
+ return allMethodsNames;
156
+ }
157
+ return CLASS__NS__getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);
158
+ };
@@ -0,0 +1,18 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ export const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
14
+ export const APP_ID = 'com.domain.example.typescript-class-helpers';
15
+ export const BUILD_BASE_HREF = '';
16
+ export const PROJECT_NPM_NAME = 'typescript-class-helpers';
17
+ export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
18
+ export const CURRENT_PACKAGE_VERSION = '21.0.66';
@@ -0,0 +1,12 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
@@ -0,0 +1,11 @@
1
+ /* ============================================================================
2
+
3
+ - TAON READONLY SOURCE
4
+ - DO NOT MODIFY THIS FILE.
5
+ - Changes may be overwritten.
6
+ - Use command: taon build:lib:watch
7
+ inside typescript-class-helpers project repository
8
+ for watch development of third party modules like this.
9
+
10
+ * ========================================================================== */
11
+
@@ -0,0 +1,13 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ export * from './typescript-class-helpers';
@@ -0,0 +1,8 @@
1
+ THIS FILE IS GENERATED - DO NOT MODIFY
2
+
3
+ This folder is an entry point for npm Angular/NodeJS library
4
+
5
+ DON'T USE STUFF FROM PARENT FOLDER app.* FILES HERE (except src/migrations/** files).
6
+
7
+ THIS FILE IS GENERATED - DO NOT MODIFY
8
+
@@ -0,0 +1,6 @@
1
+ THIS FILE IS GENERATED - DO NOT MODIFY
2
+
3
+ This folder is only for storing migration files with auto-generated names.
4
+
5
+ THIS FILE IS GENERATED - DO NOT MODIFY
6
+
@@ -0,0 +1,160 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ import { _, CoreModels, UtilsOs } from 'tnp-core/websql';
14
+ import { Helpers } from 'tnp-core/websql';
15
+ const REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');
16
+ type Registry = Map<string, Function>;
17
+ function getRegistry(): Registry {
18
+ const g = globalThis as any;
19
+ if (!g[REGISTRY_SYMBOL]) {
20
+ g[REGISTRY_SYMBOL] = new Map<string, Function>();
21
+ }
22
+ return g[REGISTRY_SYMBOL];
23
+ }
24
+ const classes = getRegistry();
25
+ export function getClassName(target: Function): string | undefined {
26
+ if (_.isNil(target)) {
27
+ return void 0;
28
+ }
29
+ if (_.isString(target)) {
30
+ return target;
31
+ }
32
+ if (target === Date) {
33
+ return 'Date';
34
+ }
35
+ if ((target as any) === FormData) {
36
+ return 'FormData';
37
+ }
38
+ if (!_.isFunction(target)) {
39
+ Helpers.log(`[typescript-class-helpers][getClassName] target is not a class`);
40
+ return void 0;
41
+ }
42
+ if (!_.isNil(target[CoreModels.ClassNameStaticProperty])) {
43
+ return target[CoreModels.ClassNameStaticProperty];
44
+ }
45
+ if (target.name?.startsWith('class_')) {
46
+ return '';
47
+ }
48
+ return undefined;
49
+ }
50
+ export function getClassFnFromObject(obj: object): Function | undefined {
51
+ if (_.isNil(obj)) {
52
+ return undefined;
53
+ }
54
+ return Object.getPrototypeOf(obj)?.constructor;
55
+ }
56
+ const notAllowedAsMethodNames = new Set([
57
+ 'length',
58
+ 'name',
59
+ 'arguments',
60
+ 'caller',
61
+ 'constructor',
62
+ 'apply',
63
+ 'bind',
64
+ 'call',
65
+ 'toString',
66
+ '__defineGetter__',
67
+ '__defineSetter__',
68
+ 'hasOwnProperty',
69
+ '__lookupGetter__',
70
+ '__lookupSetter__',
71
+ 'isPrototypeOf',
72
+ 'propertyIsEnumerable',
73
+ 'valueOf',
74
+ '__proto__',
75
+ 'toLocaleString',
76
+ ]);
77
+ export namespace CLASS {
78
+ export function NAME(className: string) {
79
+ return function (target: Function) {
80
+ return setClassName(target, className);
81
+ } as any;
82
+ }
83
+ export function setName(target: Function, className: string) {
84
+ setClassName(target, className);
85
+ }
86
+ export function getClassNameFromObjInstanceOrClassFn(target: any): string | undefined {
87
+ if (typeof target === 'object') {
88
+ return getNameFromObject(target);
89
+ }
90
+ return getClassName(target);
91
+ }
92
+ export function setClassName(target: Function, className: string): void {
93
+ target[CoreModels.ClassNameStaticProperty] = className;
94
+ classes.set(className, target);
95
+ }
96
+ export function getBy(className: string | Function): Function | undefined {
97
+ let res;
98
+ if (Array.isArray(className)) {
99
+ if (className.length !== 1) {
100
+ throw new Error(`Mapping error... please use proper class names:
101
+ {
102
+ propertyObject: 'MyClassName',
103
+ propertyWithArray: ['MyClassName']
104
+ }
105
+
106
+ `);
107
+ }
108
+ className = className[0];
109
+ }
110
+ if (typeof className === 'function') {
111
+ res = className;
112
+ }
113
+ if (className === 'Date') {
114
+ res = Date;
115
+ }
116
+ if (className === 'FormData') {
117
+ res = FormData;
118
+ }
119
+ const classFromMap = classes.get(className as string);
120
+ return classFromMap ? classFromMap : res;
121
+ }
122
+ export function getFromObject(o: Object): Function | undefined {
123
+ return getClassFnFromObject(o);
124
+ }
125
+ export function getName(target: Function): string | undefined {
126
+ return getClassName(target) as string;
127
+ }
128
+ export function getNameFromObject(o: Object): string | undefined {
129
+ const fnCLass = getFromObject(o);
130
+ return getName(fnCLass);
131
+ }
132
+ export const getMethodsNames = (classOrClassInstance: any, allMethodsNames = []): string[] => {
133
+ if (!classOrClassInstance) {
134
+ return allMethodsNames;
135
+ }
136
+ const isClassFunction = _.isFunction(classOrClassInstance);
137
+ const classFun = isClassFunction
138
+ ? classOrClassInstance
139
+ : Object.getPrototypeOf(classOrClassInstance);
140
+ const objectToCheck = isClassFunction
141
+ ? (classOrClassInstance as Function)?.prototype
142
+ : classOrClassInstance;
143
+ const prototypeObj = Object.getPrototypeOf(objectToCheck || {});
144
+ const properties = _.uniq([
145
+ ...Object.getOwnPropertyNames(objectToCheck || {}),
146
+ ...Object.getOwnPropertyNames(prototypeObj || {}),
147
+ ...Object.keys(objectToCheck || {}),
148
+ ...Object.keys(prototypeObj || {}),
149
+ ]).filter(f => !!f && !notAllowedAsMethodNames.has(f));
150
+ properties
151
+ .filter(methodName => typeof objectToCheck[methodName] === 'function')
152
+ .forEach(p => allMethodsNames.push(p));
153
+ if (!classFun ||
154
+ !classFun.constructor ||
155
+ classFun?.constructor?.name === 'Object') {
156
+ return allMethodsNames;
157
+ }
158
+ return getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);
159
+ };
160
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }
@@ -0,0 +1,18 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ export const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
14
+ export const APP_ID = 'com.domain.example.typescript-class-helpers';
15
+ export const BUILD_BASE_HREF = '';
16
+ export const PROJECT_NPM_NAME = 'typescript-class-helpers';
17
+ export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
18
+ export const CURRENT_PACKAGE_VERSION = '21.0.66';
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }
@@ -0,0 +1,12 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
@@ -0,0 +1,11 @@
1
+ /* ============================================================================
2
+
3
+ - TAON READONLY SOURCE
4
+ - DO NOT MODIFY THIS FILE.
5
+ - Changes may be overwritten.
6
+ - Use command: taon build:lib:watch
7
+ inside typescript-class-helpers project repository
8
+ for watch development of third party modules like this.
9
+
10
+ * ========================================================================== */
11
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }
@@ -0,0 +1,13 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ export * from './typescript-class-helpers';
@@ -0,0 +1,8 @@
1
+ THIS FILE IS GENERATED - DO NOT MODIFY
2
+
3
+ This folder is an entry point for npm Angular/NodeJS library
4
+
5
+ DON'T USE STUFF FROM PARENT FOLDER app.* FILES HERE (except src/migrations/** files).
6
+
7
+ THIS FILE IS GENERATED - DO NOT MODIFY
8
+
@@ -0,0 +1,6 @@
1
+ THIS FILE IS GENERATED - DO NOT MODIFY
2
+
3
+ This folder is only for storing migration files with auto-generated names.
4
+
5
+ THIS FILE IS GENERATED - DO NOT MODIFY
6
+
@@ -0,0 +1,26 @@
1
+ {
2
+ "namespacesMapObj": {
3
+ "CLASS.NAME": "CLASS__NS__NAME",
4
+ "CLASS.setName": "CLASS__NS__setName",
5
+ "CLASS.getClassNameFromObjInstanceOrClassFn": "CLASS__NS__getClassNameFromObjInstanceOrClassFn",
6
+ "CLASS.setClassName": "CLASS__NS__setClassName",
7
+ "CLASS.getBy": "CLASS__NS__getBy",
8
+ "CLASS.getFromObject": "CLASS__NS__getFromObject",
9
+ "CLASS.getName": "CLASS__NS__getName",
10
+ "CLASS.getNameFromObject": "CLASS__NS__getNameFromObject",
11
+ "CLASS.getMethodsNames": "CLASS__NS__getMethodsNames"
12
+ },
13
+ "namespacesReplace": {
14
+ "CLASS": [
15
+ "CLASS__NS__NAME",
16
+ "CLASS__NS__getBy",
17
+ "CLASS__NS__getClassNameFromObjInstanceOrClassFn",
18
+ "CLASS__NS__getFromObject",
19
+ "CLASS__NS__getMethodsNames",
20
+ "CLASS__NS__getName",
21
+ "CLASS__NS__getNameFromObject",
22
+ "CLASS__NS__setClassName",
23
+ "CLASS__NS__setName"
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,158 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+
4
+ - TAON READONLY SOURCE
5
+ - DO NOT MODIFY THIS FILE.
6
+ - Changes may be overwritten.
7
+ - Use command: taon build:lib:watch
8
+ inside typescript-class-helpers project repository
9
+ for watch development of third party modules like this.
10
+
11
+ * ========================================================================== */
12
+
13
+ import { ___NS__add, ___NS__after, ___NS__ary, ___NS__assign, ___NS__assignIn, ___NS__assignInWith, ___NS__assignWith, ___NS__at, ___NS__attempt, ___NS__before, ___NS__bind, ___NS__bindAll, ___NS__bindKey, ___NS__camelCase, ___NS__capitalize, ___NS__castArray, ___NS__ceil, ___NS__chain, ___NS__chunk, ___NS__clamp, ___NS__clone, ___NS__cloneDeep, ___NS__cloneDeepWith, ___NS__cloneWith, ___NS__compact, ___NS__concat, ___NS__cond, ___NS__conforms, ___NS__conformsTo, ___NS__constant, ___NS__countBy, ___NS__create, ___NS__curry, ___NS__curryRight, ___NS__debounce, ___NS__deburr, ___NS__defaults, ___NS__defaultsDeep, ___NS__defaultTo, ___NS__defer, ___NS__delay, ___NS__difference, ___NS__differenceBy, ___NS__differenceWith, ___NS__divide, ___NS__drop, ___NS__dropRight, ___NS__dropRightWhile, ___NS__dropWhile, ___NS__each, ___NS__eachRight, ___NS__endsWith, ___NS__entries, ___NS__entriesIn, ___NS__eq, ___NS__escape, ___NS__escapeRegExp, ___NS__every, ___NS__extend, ___NS__extendWith, ___NS__fill, ___NS__filter, ___NS__find, ___NS__findIndex, ___NS__findKey, ___NS__findLast, ___NS__findLastIndex, ___NS__findLastKey, ___NS__first, ___NS__flatMap, ___NS__flatMapDeep, ___NS__flatMapDepth, ___NS__flatten, ___NS__flattenDeep, ___NS__flattenDepth, ___NS__flip, ___NS__floor, ___NS__flow, ___NS__flowRight, ___NS__forEach, ___NS__forEachRight, ___NS__forIn, ___NS__forInRight, ___NS__forOwn, ___NS__forOwnRight, ___NS__fromPairs, ___NS__functions, ___NS__functionsIn, ___NS__get, ___NS__groupBy, ___NS__gt, ___NS__gte, ___NS__has, ___NS__hasIn, ___NS__head, ___NS__identity, ___NS__includes, ___NS__indexOf, ___NS__initial, ___NS__inRange, ___NS__intersection, ___NS__intersectionBy, ___NS__intersectionWith, ___NS__invert, ___NS__invertBy, ___NS__invoke, ___NS__invokeMap, ___NS__isArguments, ___NS__isArray, ___NS__isArrayBuffer, ___NS__isArrayLike, ___NS__isArrayLikeObject, ___NS__isBoolean, ___NS__isBuffer, ___NS__isDate, ___NS__isElement, ___NS__isEmpty, ___NS__isEqual, ___NS__isEqualWith, ___NS__isError, ___NS__isFinite, ___NS__isFunction, ___NS__isInteger, ___NS__isLeafObject, ___NS__isLength, ___NS__isMap, ___NS__isMatch, ___NS__isMatchWith, ___NS__isNaN, ___NS__isNative, ___NS__isNil, ___NS__isNull, ___NS__isNumber, ___NS__isObject, ___NS__isObjectLike, ___NS__isPlainObject, ___NS__isRegExp, ___NS__isSafeInteger, ___NS__isSet, ___NS__isString, ___NS__isSymbol, ___NS__isTypedArray, ___NS__isUndefined, ___NS__isWeakMap, ___NS__isWeakSet, ___NS__iteratee, ___NS__join, ___NS__kebabCase, ___NS__keyBy, ___NS__keys, ___NS__keysIn, ___NS__last, ___NS__lastIndexOf, ___NS__lowerCase, ___NS__lowerFirst, ___NS__lt, ___NS__lte, ___NS__map, ___NS__mapKeys, ___NS__mapValues, ___NS__matches, ___NS__matchesProperty, ___NS__max, ___NS__maxBy, ___NS__mean, ___NS__meanBy, ___NS__memoize, ___NS__merge, ___NS__mergeWith, ___NS__method, ___NS__methodOf, ___NS__min, ___NS__minBy, ___NS__mixin, ___NS__multiply, ___NS__negate, ___NS__noop, ___NS__now, ___NS__nth, ___NS__nthArg, ___NS__omit, ___NS__omitBy, ___NS__once, ___NS__orderBy, ___NS__over, ___NS__overArgs, ___NS__overEvery, ___NS__overSome, ___NS__pad, ___NS__padEnd, ___NS__padStart, ___NS__parseInt, ___NS__partial, ___NS__partialRight, ___NS__partition, ___NS__pick, ___NS__pickBy, ___NS__property, ___NS__propertyOf, ___NS__pull, ___NS__pullAll, ___NS__pullAllBy, ___NS__pullAllWith, ___NS__pullAt, ___NS__random, ___NS__range, ___NS__rangeRight, ___NS__rearg, ___NS__reduce, ___NS__reduceRight, ___NS__reject, ___NS__remove, ___NS__repeat, ___NS__replace, ___NS__rest, ___NS__result, ___NS__reverse, ___NS__round, ___NS__sample, ___NS__sampleSize, ___NS__set, ___NS__setWith, ___NS__shuffle, ___NS__size, ___NS__slice, ___NS__snakeCase, ___NS__some, ___NS__sortBy, ___NS__sortedIndex, ___NS__sortedIndexBy, ___NS__sortedIndexOf, ___NS__sortedLastIndex, ___NS__sortedLastIndexBy, ___NS__sortedLastIndexOf, ___NS__sortedUniq, ___NS__sortedUniqBy, ___NS__split, ___NS__spread, ___NS__startCase, ___NS__startsWith, ___NS__stubArray, ___NS__stubFalse, ___NS__stubObject, ___NS__stubString, ___NS__stubTrue, ___NS__subtract, ___NS__sum, ___NS__sumBy, ___NS__tail, ___NS__take, ___NS__takeRight, ___NS__takeRightWhile, ___NS__takeWhile, ___NS__tap, ___NS__template, ___NS__templateSettings, ___NS__throttle, ___NS__thru, ___NS__times, ___NS__toArray, ___NS__toFinite, ___NS__toInteger, ___NS__toLength, ___NS__toLower, ___NS__toNumber, ___NS__toPairs, ___NS__toPairsIn, ___NS__toPath, ___NS__toPlainObject, ___NS__toSafeInteger, ___NS__toString, ___NS__toUpper, ___NS__transform, ___NS__trim, ___NS__trimEnd, ___NS__trimStart, ___NS__truncate, ___NS__unary, ___NS__unescape, ___NS__union, ___NS__unionBy, ___NS__unionWith, ___NS__uniq, ___NS__uniqBy, ___NS__uniqueId, ___NS__uniqWith, ___NS__unset, ___NS__unzip, ___NS__unzipWith, ___NS__update, ___NS__updateWith, ___NS__upperCase, ___NS__upperFirst, ___NS__values, ___NS__valuesIn, ___NS__without, ___NS__words, ___NS__wrap, ___NS__xor, ___NS__xorBy, ___NS__xorWith, ___NS__zip, ___NS__zipObject, ___NS__zipObjectDeep, ___NS__zipWith, CoreModels__NS__BaseProjectType, CoreModels__NS__BaseProjectTypeArr, CoreModels__NS__BuildType, CoreModels__NS__BuildTypeArr, CoreModels__NS__buildTypeToWatcherFn, CoreModels__NS__BuildWatcherErrorType, CoreModels__NS__BuildWatcherType, CoreModels__NS__BuildWatcherTypeArr, CoreModels__NS__CfontAlign, CoreModels__NS__CfontStyle, CoreModels__NS__ClassNameStaticProperty, CoreModels__NS__ContentType, CoreModels__NS__ContentTypeKeys, CoreModels__NS__CoreLibCategory, CoreModels__NS__CutableFileExt, CoreModels__NS__DatabaseType, CoreModels__NS__DeepPartial, CoreModels__NS__FileEvent, CoreModels__NS__FileExtension, CoreModels__NS__FirstParamsFrom, CoreModels__NS__FrameworkVersion, CoreModels__NS__GitConnection, CoreModels__NS__GitConnectionArr, CoreModels__NS__GlobalDependencies, CoreModels__NS__hasExitCleaningFunction, CoreModels__NS__HttpCode, CoreModels__NS__HttpMethod, CoreModels__NS__HttpMethodArr, CoreModels__NS__ImageFileExtension, CoreModels__NS__ImageFileExtensionArr, CoreModels__NS__InstalationType, CoreModels__NS__InstalationTypeArr, CoreModels__NS__LibType, CoreModels__NS__localhostDomain, CoreModels__NS__localhostIp127, CoreModels__NS__ManifestIcon, CoreModels__NS__MediaType, CoreModels__NS__MediaTypeAllArr, CoreModels__NS__mimeTypes, CoreModels__NS__NewFactoryType, CoreModels__NS__NpmInstallOptions, CoreModels__NS__NpmPublishOptions, CoreModels__NS__NpmSpecialVersions, CoreModels__NS__OrignalClassKey, CoreModels__NS__OutFolder, CoreModels__NS__Package, CoreModels__NS__ParamType, CoreModels__NS__parentLocation, CoreModels__NS__pathToChildren, CoreModels__NS__Position, CoreModels__NS__PreReleaseVersionTag, CoreModels__NS__PROGRESS_DATA_TYPE, CoreModels__NS__PUSHTYPE, CoreModels__NS__PwaManifest, CoreModels__NS__ReleaseVersionType, CoreModels__NS__ReleaseVersionTypeEnum, CoreModels__NS__RunOptions, CoreModels__NS__Size, CoreModels__NS__SPECIAL_APP_READY_MESSAGE, CoreModels__NS__SPECIAL_WORKER_READY_MESSAGE, CoreModels__NS__StatusCode401, CoreModels__NS__tagForTaskName, CoreModels__NS__TaonHttpErrorCustomProp, CoreModels__NS__TsUsage, CoreModels__NS__UIFramework, CoreModels__NS__ValueOf, CoreModels__NS__VSCodeSettings, UtilsOs__NS__commandExistsAsync, UtilsOs__NS__commandExistsSync, UtilsOs__NS__detectEditor, UtilsOs__NS__drawHorizontalLine, UtilsOs__NS__drawVerticalLine, UtilsOs__NS__Editor, UtilsOs__NS__EDITOR_PROCESSES, UtilsOs__NS__EditorArr, UtilsOs__NS__EditorProcess, UtilsOs__NS__getEditorKeybindingPath, UtilsOs__NS__getEditorSettingsJsonPath, UtilsOs__NS__getInotifyWatchCount, UtilsOs__NS__getRealHomeDir, UtilsOs__NS__isBrowser, UtilsOs__NS__isDockerAvailable, UtilsOs__NS__isElectron, UtilsOs__NS__isNode, UtilsOs__NS__isNodeVersionOk, UtilsOs__NS__isPortInUse, UtilsOs__NS__isRunningInBrowser, UtilsOs__NS__isRunningInCliMode, UtilsOs__NS__isRunningInCloudflareWorker, UtilsOs__NS__isRunningInDocker, UtilsOs__NS__isRunningInElectron, UtilsOs__NS__isRunningInLinuxDistro, UtilsOs__NS__isRunningInLinuxGraphicsCapableEnvironment, UtilsOs__NS__isRunningInMochaTest, UtilsOs__NS__isRunningInNode, UtilsOs__NS__isRunningInOsWithGraphicsCapableEnvironment, UtilsOs__NS__isRunningInSSRMode, UtilsOs__NS__isRunningInVscodeExtension, UtilsOs__NS__isRunningInWebSQL, UtilsOs__NS__isRunningInWindows, UtilsOs__NS__isRunningInWindowsCmd, UtilsOs__NS__isRunningInWindowsGitBash, UtilsOs__NS__isRunningInWindowsPowerShell, UtilsOs__NS__isRunningInWsl, UtilsOs__NS__isRunningNodeDebugger, UtilsOs__NS__isSSRMode, UtilsOs__NS__isVscodeExtension, UtilsOs__NS__isWebSQL, UtilsOs__NS__killAllEditor, UtilsOs__NS__openFolderInFileExplorer, UtilsOs__NS__pipxNestedPackageExists, UtilsOs__NS__pipxPackageExists, UtilsOs__NS__pythonModuleExists, UtilsOs__NS__safeExitProgramCleanUp, UtilsOs__NS__sendNotification, UtilsOs__NS__whichOrWherePackageLocated } from 'tnp-core/websql-prod';
14
+ import { Helpers__NS___fixCommand, Helpers__NS__ActionInstance, Helpers__NS__actionStarted, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__contain, Helpers__NS__createFolder, Helpers__NS__createSymLink, Helpers__NS__error, Helpers__NS__execute, Helpers__NS__exists, Helpers__NS__filesFrom, Helpers__NS__foldersFrom, Helpers__NS__getFilesFrom, Helpers__NS__getFoldersFrom, Helpers__NS__getIsBrowser, Helpers__NS__getIsElectron, Helpers__NS__getIsNode, Helpers__NS__getIsRunningInGitBash, Helpers__NS__getIsSupportedTaonTerminal, Helpers__NS__getIsVerboseMode, Helpers__NS__getIsVerboseModeOrTnp, Helpers__NS__getIsWebSQL, Helpers__NS__getIsWsl, Helpers__NS__getStdio, Helpers__NS__hideNodeWarnings, Helpers__NS__info, Helpers__NS__isBlob, Helpers__NS__isBuffer, Helpers__NS__isClass, Helpers__NS__isExistedSymlink, Helpers__NS__isFile, Helpers__NS__isFolder, Helpers__NS__isRunningInDocker, Helpers__NS__isRunningInLinuxGraphicsCapableEnvironment, Helpers__NS__isSymlinkFileExitedOrUnexisted, Helpers__NS__isSymlinkThatMatchesUrl, Helpers__NS__isUnexistedLink, Helpers__NS__killOnPort, Helpers__NS__killProcess, Helpers__NS__killProcessByPort, Helpers__NS__linksToFolderFrom, Helpers__NS__linksToFoldersFrom, Helpers__NS__log, Helpers__NS__logError, Helpers__NS__logInfo, Helpers__NS__logProc, Helpers__NS__logSuccess, Helpers__NS__logTaskDone, Helpers__NS__logTaskStarted, Helpers__NS__logWarn, Helpers__NS__mediaTypeFromSrc, Helpers__NS__mkdirp, Helpers__NS__modifyLineByLine, Helpers__NS__msgCacheClear, Helpers__NS__openFolderInFileExplorer, Helpers__NS__parse, Helpers__NS__pathContainLink, Helpers__NS__questionYesNo, Helpers__NS__readFile, Helpers__NS__readJson, Helpers__NS__readJson5, Helpers__NS__readJsonC, Helpers__NS__relative, Helpers__NS__remove, Helpers__NS__removeEmptyLineFromString, Helpers__NS__removeFileIfExists, Helpers__NS__removeFolderIfExists, Helpers__NS__removeIfExists, Helpers__NS__removeSlashAtBegin, Helpers__NS__removeSlashAtEnd, Helpers__NS__removeSymlinks, Helpers__NS__renderError, Helpers__NS__replaceLinesInFile, Helpers__NS__run, Helpers__NS__runAsyncIn, Helpers__NS__runSyncIn, Helpers__NS__runSyncOrAsync, Helpers__NS__sleep, Helpers__NS__stopApplication, Helpers__NS__stringify, Helpers__NS__success, Helpers__NS__taskDone, Helpers__NS__taskStarted, Helpers__NS__throwError, Helpers__NS__timeout, Helpers__NS__tryCatchError, Helpers__NS__tryReadFile, Helpers__NS__tryRemoveDir, Helpers__NS__values, Helpers__NS__wait, Helpers__NS__warn, Helpers__NS__writeFile, Helpers__NS__writeJson, Helpers__NS__writeJson5, Helpers__NS__writeJsonC } from 'tnp-core/websql-prod';
15
+ const REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');
16
+ type Registry = Map<string, Function>;
17
+ function getRegistry(): Registry {
18
+ const g = globalThis as any;
19
+ if (!g[REGISTRY_SYMBOL]) {
20
+ g[REGISTRY_SYMBOL] = new Map<string, Function>();
21
+ }
22
+ return g[REGISTRY_SYMBOL];
23
+ }
24
+ const classes = getRegistry();
25
+ export function getClassName(target: Function): string | undefined {
26
+ if (___NS__isNil(target)) {
27
+ return void 0;
28
+ }
29
+ if (___NS__isString(target)) {
30
+ return target;
31
+ }
32
+ if (target === Date) {
33
+ return 'Date';
34
+ }
35
+ if ((target as any) === FormData) {
36
+ return 'FormData';
37
+ }
38
+ if (!___NS__isFunction(target)) {
39
+ Helpers__NS__log(`[typescript-class-helpers][getClassName] target is not a class`);
40
+ return void 0;
41
+ }
42
+ if (!___NS__isNil(target[CoreModels__NS__ClassNameStaticProperty])) {
43
+ return target[CoreModels__NS__ClassNameStaticProperty];
44
+ }
45
+ if (target.name?.startsWith('class_')) {
46
+ return '';
47
+ }
48
+ return undefined;
49
+ }
50
+ export function getClassFnFromObject(obj: object): Function | undefined {
51
+ if (___NS__isNil(obj)) {
52
+ return undefined;
53
+ }
54
+ return Object.getPrototypeOf(obj)?.constructor;
55
+ }
56
+ const notAllowedAsMethodNames = new Set([
57
+ 'length',
58
+ 'name',
59
+ 'arguments',
60
+ 'caller',
61
+ 'constructor',
62
+ 'apply',
63
+ 'bind',
64
+ 'call',
65
+ 'toString',
66
+ '__defineGetter__',
67
+ '__defineSetter__',
68
+ 'hasOwnProperty',
69
+ '__lookupGetter__',
70
+ '__lookupSetter__',
71
+ 'isPrototypeOf',
72
+ 'propertyIsEnumerable',
73
+ 'valueOf',
74
+ '__proto__',
75
+ 'toLocaleString',
76
+ ]);
77
+ export function CLASS__NS__NAME(className: string) {
78
+ return function (target: Function) {
79
+ return CLASS__NS__setClassName(target, className);
80
+ } as any;
81
+ }
82
+ export function CLASS__NS__setName(target: Function, className: string) {
83
+ CLASS__NS__setClassName(target, className);
84
+ }
85
+ export function CLASS__NS__getClassNameFromObjInstanceOrClassFn(target: any): string | undefined {
86
+ if (typeof target === 'object') {
87
+ return CLASS__NS__getNameFromObject(target);
88
+ }
89
+ return getClassName(target);
90
+ }
91
+ export function CLASS__NS__setClassName(target: Function, className: string): void {
92
+ target[CoreModels__NS__ClassNameStaticProperty] = className;
93
+ classes.set(className, target);
94
+ }
95
+ export function CLASS__NS__getBy(className: string | Function): Function | undefined {
96
+ let res;
97
+ if (Array.isArray(className)) {
98
+ if (className.length !== 1) {
99
+ throw new Error(`Mapping error... please use proper class names:
100
+ {
101
+ propertyObject: 'MyClassName',
102
+ propertyWithArray: ['MyClassName']
103
+ }
104
+
105
+ `);
106
+ }
107
+ className = className[0];
108
+ }
109
+ if (typeof className === 'function') {
110
+ res = className;
111
+ }
112
+ if (className === 'Date') {
113
+ res = Date;
114
+ }
115
+ if (className === 'FormData') {
116
+ res = FormData;
117
+ }
118
+ const classFromMap = classes.get(className as string);
119
+ return classFromMap ? classFromMap : res;
120
+ }
121
+ export function CLASS__NS__getFromObject(o: Object): Function | undefined {
122
+ return getClassFnFromObject(o);
123
+ }
124
+ export function CLASS__NS__getName(target: Function): string | undefined {
125
+ return getClassName(target) as string;
126
+ }
127
+ export function CLASS__NS__getNameFromObject(o: Object): string | undefined {
128
+ const fnCLass = CLASS__NS__getFromObject(o);
129
+ return CLASS__NS__getName(fnCLass);
130
+ }
131
+ export const CLASS__NS__getMethodsNames = (classOrClassInstance: any, allMethodsNames = []): string[] => {
132
+ if (!classOrClassInstance) {
133
+ return allMethodsNames;
134
+ }
135
+ const isClassFunction = ___NS__isFunction(classOrClassInstance);
136
+ const classFun = isClassFunction
137
+ ? classOrClassInstance
138
+ : Object.getPrototypeOf(classOrClassInstance);
139
+ const objectToCheck = isClassFunction
140
+ ? (classOrClassInstance as Function)?.prototype
141
+ : classOrClassInstance;
142
+ const prototypeObj = Object.getPrototypeOf(objectToCheck || {});
143
+ const properties = ___NS__uniq([
144
+ ...Object.getOwnPropertyNames(objectToCheck || {}),
145
+ ...Object.getOwnPropertyNames(prototypeObj || {}),
146
+ ...Object.keys(objectToCheck || {}),
147
+ ...Object.keys(prototypeObj || {}),
148
+ ]).filter(f => !!f && !notAllowedAsMethodNames.has(f));
149
+ properties
150
+ .filter(methodName => typeof objectToCheck[methodName] === 'function')
151
+ .forEach(p => allMethodsNames.push(p));
152
+ if (!classFun ||
153
+ !classFun.constructor ||
154
+ classFun?.constructor?.name === 'Object') {
155
+ return allMethodsNames;
156
+ }
157
+ return CLASS__NS__getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);
158
+ };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-class-helpers/websql",
3
- "version": "21.0.64",
3
+ "version": "21.0.66",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-class-helpers/websql-prod",
3
- "version": "21.0.64",
3
+ "version": "21.0.66",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0"