typescript-class-helpers 21.0.34 → 21.0.35
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/browser/fesm2022/typescript-class-helpers-browser.mjs +11 -0
- package/browser/fesm2022/typescript-class-helpers-browser.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/browser/types/typescript-class-helpers-browser.d.ts +1 -0
- package/browser-prod/fesm2022/typescript-class-helpers-browser.mjs +12 -2
- package/browser-prod/fesm2022/typescript-class-helpers-browser.mjs.map +1 -1
- package/browser-prod/package.json +1 -1
- package/browser-prod/types/typescript-class-helpers-browser.d.ts +2 -1
- package/browser-prod.split-namespaces.json +2 -0
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/package.json +1 -1
- package/lib/typescript-class-helpers.d.ts +1 -0
- package/lib/typescript-class-helpers.js +11 -0
- package/lib/typescript-class-helpers.js.map +1 -1
- package/lib-prod/build-info._auto-generated_.d.ts +1 -1
- package/lib-prod/build-info._auto-generated_.js +1 -1
- package/lib-prod/package.json +1 -1
- package/lib-prod/typescript-class-helpers.d.ts +1 -0
- package/lib-prod/typescript-class-helpers.js +11 -1
- package/lib-prod/typescript-class-helpers.js.map +1 -1
- package/lib-prod.split-namespaces.json +2 -0
- package/package.json +1 -1
- package/websql/fesm2022/typescript-class-helpers-websql.mjs +11 -0
- package/websql/fesm2022/typescript-class-helpers-websql.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/websql/types/typescript-class-helpers-websql.d.ts +1 -0
- package/websql-prod/fesm2022/typescript-class-helpers-websql.mjs +12 -2
- package/websql-prod/fesm2022/typescript-class-helpers-websql.mjs.map +1 -1
- package/websql-prod/package.json +1 -1
- package/websql-prod/types/typescript-class-helpers-websql.d.ts +2 -1
- package/websql-prod.split-namespaces.json +2 -0
|
@@ -125,6 +125,17 @@ var CLASS;
|
|
|
125
125
|
return classFromMap ? classFromMap : res;
|
|
126
126
|
}
|
|
127
127
|
CLASS.getBy = getBy;
|
|
128
|
+
function getFromObject(o) {
|
|
129
|
+
if (_.isUndefined(o) || _.isNull(o)) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (o.constructor) {
|
|
133
|
+
return o.constructor;
|
|
134
|
+
}
|
|
135
|
+
const p = Object.getPrototypeOf(o);
|
|
136
|
+
return p && p.constructor;
|
|
137
|
+
}
|
|
138
|
+
CLASS.getFromObject = getFromObject;
|
|
128
139
|
function getName(target) {
|
|
129
140
|
return getClassName(target);
|
|
130
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-class-helpers-browser.mjs","sources":["../../../tmp-libs-for-dist/typescript-class-helpers/projects/typescript-class-helpers/src/lib/typescript-class-helpers.ts","../../../tmp-libs-for-dist/typescript-class-helpers/projects/typescript-class-helpers/src/typescript-class-helpers-browser.ts"],"sourcesContent":["/* */ \nimport { _, CoreModels, UtilsOs } from 'tnp-core/browser';\nimport { Helpers } from 'tnp-core/browser';\n\nconst REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');\n\ntype Registry = Map<string, Function>;\n\nfunction getRegistry(): Registry {\n const g = globalThis as any;\n\n if (!g[REGISTRY_SYMBOL]) {\n g[REGISTRY_SYMBOL] = new Map<string, Function>();\n }\n\n return g[REGISTRY_SYMBOL];\n}\n\nconst classes = getRegistry();\n\nexport function getClassName(target: Function): string | undefined {\n if (_.isNil(target)) {\n return void 0;\n }\n if (_.isString(target)) {\n return target;\n }\n\n if (target === Date) {\n return 'Date';\n }\n\n if ((target as any) === FormData) {\n return 'FormData';\n }\n\n if (!_.isFunction(target)) {\n // console.log(target);\n Helpers.log(\n `[typescript-class-helpers][getClassName] target is not a class`,\n );\n return void 0;\n }\n\n if (!_.isNil(target[CoreModels.ClassNameStaticProperty])) {\n return target[CoreModels.ClassNameStaticProperty];\n }\n\n // special thing when cloning classes\n if (target.name?.startsWith('class_')) {\n return '';\n }\n\n return;\n}\n\nexport function getFromObject(o: Object) {\n if (_.isUndefined(o) || _.isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n}\n\nconst notAllowedAsMethodName = [\n 'length',\n 'name',\n 'arguments',\n 'caller',\n 'constructor',\n 'apply',\n 'bind',\n 'call',\n 'toString',\n '__defineGetter__',\n '__defineSetter__',\n 'hasOwnProperty',\n '__lookupGetter__',\n '__lookupSetter__',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n '__proto__',\n 'toLocaleString',\n];\n\nexport namespace CLASS {\n /**\n * PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE\n * Decorator requred for production mode\n * @param name Name of class\n */\n export function NAME(className: string) {\n return function (target: Function) {\n return setClassName(target, className);\n } as any;\n }\n\n export function setName(target: Function, className: string) {\n setClassName(target, className);\n }\n\n export function getClassNameFromObjInstanceOrClassFn(\n target: any,\n ): string | undefined {\n if (typeof target === 'object') {\n return getNameFromObject(target);\n }\n return getClassName(target);\n }\n\n export function setClassName(target: Function, className: string): void {\n target[CoreModels.ClassNameStaticProperty] = className;\n classes.set(className, target);\n }\n export function getBy(className: string | Function): Function {\n let res;\n if (Array.isArray(className)) {\n if (className.length !== 1) {\n throw `Mapping error... please use proper class names:\n {\n propertyObject: 'MyClassName',\n propertyWithArray: ['MyClassName']\n }\n\n `;\n }\n className = className[0];\n }\n if (typeof className === 'function') {\n // TODO QUICK_FIX\n res = className;\n }\n if (className === 'Date') {\n res = Date;\n }\n\n if (className === 'FormData') {\n res = FormData;\n }\n\n const classFromMap = classes.get(className as string);\n return classFromMap ? classFromMap : res;\n }\n\n export function getName(target: Function): string | undefined {\n return getClassName(target) as string;\n }\n export function getNameFromObject(o: Object): string | undefined {\n const fnCLass = getFromObject(o);\n return getName(fnCLass);\n }\n\n export const getMethodsNames = (\n classOrClassInstance: any,\n allMethodsNames = [],\n ): string[] => {\n if (!classOrClassInstance) {\n return allMethodsNames;\n }\n\n const isClassFunction = _.isFunction(classOrClassInstance);\n const classFun = isClassFunction\n ? classOrClassInstance\n : Object.getPrototypeOf(classOrClassInstance);\n const objectToCheck = isClassFunction\n ? (classOrClassInstance as Function)?.prototype\n : classOrClassInstance;\n const prototypeObj = Object.getPrototypeOf(objectToCheck || {});\n\n const properties = _.uniq([\n ...Object.getOwnPropertyNames(objectToCheck || {}),\n ...Object.getOwnPropertyNames(prototypeObj || {}),\n ...Object.keys(objectToCheck || {}),\n ...Object.keys(prototypeObj || {}),\n ]).filter(f => !!f && !notAllowedAsMethodName.includes(f));\n\n properties\n .filter(methodName => typeof objectToCheck[methodName] === 'function')\n .forEach(p => allMethodsNames.push(p));\n\n if (\n !classFun ||\n !classFun.constructor ||\n classFun?.constructor?.name === 'Object'\n ) {\n return allMethodsNames;\n }\n return getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);\n };\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AAIA,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC;AAIzD,SAAS,WAAW,GAAA;IAClB,MAAM,CAAC,GAAG,UAAiB;AAE3B,IAAA,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE;AACvB,QAAA,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,EAAoB;IAClD;AAEA,IAAA,OAAO,CAAC,CAAC,eAAe,CAAC;AAC3B;AAEA,MAAM,OAAO,GAAG,WAAW,EAAE;AAEvB,SAAU,YAAY,CAAC,MAAgB,EAAA;AAC3C,IAAA,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QACnB,OAAO,KAAK,CAAC;IACf;AACA,IAAA,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACtB,QAAA,OAAO,MAAM;IACf;AAEA,IAAA,IAAI,MAAM,KAAK,IAAI,EAAE;AACnB,Q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MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE1D;AACG,aAAA,MAAM,CAAC,UAAU,IAAI,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,UAAU;AACpE,aAAA,OAAO,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAExC,QAAA,IACE,CAAC,QAAQ;YACT,CAAC,QAAQ,CAAC,WAAW;AACrB,YAAA,QAAQ,EAAE,WAAW,EAAE,IAAI,KAAK,QAAQ,EACxC;AACA,YAAA,OAAO,eAAe;QACxB;AACA,QAAA,OAAO,KAAA,CAAA,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;AAC1E,IAAA,CAAC;AACH,CAAC,EAxGgB,KAAK,KAAL,KAAK,GAAA,EAAA,CAAA,CAAA;;ACzFtB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"typescript-class-helpers-browser.mjs","sources":["../../../tmp-libs-for-dist/typescript-class-helpers/projects/typescript-class-helpers/src/lib/typescript-class-helpers.ts","../../../tmp-libs-for-dist/typescript-class-helpers/projects/typescript-class-helpers/src/typescript-class-helpers-browser.ts"],"sourcesContent":["/* */ \nimport { _, CoreModels, UtilsOs } from 'tnp-core/browser';\nimport { Helpers } from 'tnp-core/browser';\n\nconst REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');\n\ntype Registry = Map<string, Function>;\n\nfunction getRegistry(): Registry {\n const g = globalThis as any;\n\n if (!g[REGISTRY_SYMBOL]) {\n g[REGISTRY_SYMBOL] = new Map<string, Function>();\n }\n\n return g[REGISTRY_SYMBOL];\n}\n\nconst classes = getRegistry();\n\nexport function getClassName(target: Function): string | undefined {\n if (_.isNil(target)) {\n return void 0;\n }\n if (_.isString(target)) {\n return target;\n }\n\n if (target === Date) {\n return 'Date';\n }\n\n if ((target as any) === FormData) {\n return 'FormData';\n }\n\n if (!_.isFunction(target)) {\n // console.log(target);\n Helpers.log(\n `[typescript-class-helpers][getClassName] target is not a class`,\n );\n return void 0;\n }\n\n if (!_.isNil(target[CoreModels.ClassNameStaticProperty])) {\n return target[CoreModels.ClassNameStaticProperty];\n }\n\n // special thing when cloning classes\n if (target.name?.startsWith('class_')) {\n return '';\n }\n\n return;\n}\n\nexport function getFromObject(o: Object) {\n if (_.isUndefined(o) || _.isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n}\n\nconst notAllowedAsMethodName = [\n 'length',\n 'name',\n 'arguments',\n 'caller',\n 'constructor',\n 'apply',\n 'bind',\n 'call',\n 'toString',\n '__defineGetter__',\n '__defineSetter__',\n 'hasOwnProperty',\n '__lookupGetter__',\n '__lookupSetter__',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n '__proto__',\n 'toLocaleString',\n];\n\nexport namespace CLASS {\n /**\n * PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE\n * Decorator requred for production mode\n * @param name Name of class\n */\n export function NAME(className: string) {\n return function (target: Function) {\n return setClassName(target, className);\n } as any;\n }\n\n export function setName(target: Function, className: string) {\n setClassName(target, className);\n }\n\n export function getClassNameFromObjInstanceOrClassFn(\n target: any,\n ): string | undefined {\n if (typeof target === 'object') {\n return getNameFromObject(target);\n }\n return getClassName(target);\n }\n\n export function setClassName(target: Function, className: string): void {\n target[CoreModels.ClassNameStaticProperty] = className;\n classes.set(className, target);\n }\n export function getBy(className: string | Function): Function {\n let res;\n if (Array.isArray(className)) {\n if (className.length !== 1) {\n throw `Mapping error... please use proper class names:\n {\n propertyObject: 'MyClassName',\n propertyWithArray: ['MyClassName']\n }\n\n `;\n }\n className = className[0];\n }\n if (typeof className === 'function') {\n // TODO QUICK_FIX\n res = className;\n }\n if (className === 'Date') {\n res = Date;\n }\n\n if (className === 'FormData') {\n res = FormData;\n }\n\n const classFromMap = classes.get(className as string);\n return classFromMap ? classFromMap : res;\n }\n\n export function getFromObject(o: Object): Function | undefined{\n if (_.isUndefined(o) || _.isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n }\n\n export function getName(target: Function): string | undefined {\n return getClassName(target) as string;\n }\n export function getNameFromObject(o: Object): string | undefined {\n const fnCLass = getFromObject(o);\n return getName(fnCLass);\n }\n\n export const getMethodsNames = (\n classOrClassInstance: any,\n allMethodsNames = [],\n ): string[] => {\n if (!classOrClassInstance) {\n return allMethodsNames;\n }\n\n const isClassFunction = _.isFunction(classOrClassInstance);\n const classFun = isClassFunction\n ? classOrClassInstance\n : Object.getPrototypeOf(classOrClassInstance);\n const objectToCheck = isClassFunction\n ? (classOrClassInstance as Function)?.prototype\n : classOrClassInstance;\n const prototypeObj = Object.getPrototypeOf(objectToCheck || {});\n\n const properties = _.uniq([\n ...Object.getOwnPropertyNames(objectToCheck || {}),\n ...Object.getOwnPropertyNames(prototypeObj || {}),\n ...Object.keys(objectToCheck || {}),\n ...Object.keys(prototypeObj || {}),\n ]).filter(f => !!f && !notAllowedAsMethodName.includes(f));\n\n properties\n .filter(methodName => typeof objectToCheck[methodName] === 'function')\n .forEach(p => allMethodsNames.push(p));\n\n if (\n !classFun ||\n !classFun.constructor ||\n classFun?.constructor?.name === 'Object'\n ) {\n return allMethodsNames;\n }\n return getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);\n };\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AAIA,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC;AAIzD,SAAS,WAAW,GAAA;IAClB,MAAM,CAAC,GAAG,UAAiB;AAE3B,IAAA,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE;AACvB,QAAA,CAAC,CAAC,eAAe,CAAC,GAAG,IA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,QAAQ,CAAC,EAAE,eAAe,CAAC;AAC1E,IAAA,CAAC;AACH,CAAC,EAnHgB,KAAK,KAAL,KAAK,GAAA,EAAA,CAAA,CAAA;;ACzFtB;;AAEG;;;;"}
|
package/browser/package.json
CHANGED
|
@@ -12,6 +12,7 @@ declare namespace CLASS {
|
|
|
12
12
|
function getClassNameFromObjInstanceOrClassFn(target: any): string | undefined;
|
|
13
13
|
function setClassName(target: Function, className: string): void;
|
|
14
14
|
function getBy(className: string | Function): Function;
|
|
15
|
+
function getFromObject(o: Object): Function | undefined;
|
|
15
16
|
function getName(target: Function): string | undefined;
|
|
16
17
|
function getNameFromObject(o: Object): string | undefined;
|
|
17
18
|
const getMethodsNames: (classOrClassInstance: any, allMethodsNames?: any[]) => string[];
|
|
@@ -119,11 +119,21 @@ function CLASS__NS__getBy(className) {
|
|
|
119
119
|
const classFromMap = classes.get(className);
|
|
120
120
|
return classFromMap ? classFromMap : res;
|
|
121
121
|
}
|
|
122
|
+
function CLASS__NS__getFromObject(o) {
|
|
123
|
+
if (___NS__isUndefined(o) || ___NS__isNull(o)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (o.constructor) {
|
|
127
|
+
return o.constructor;
|
|
128
|
+
}
|
|
129
|
+
const p = Object.getPrototypeOf(o);
|
|
130
|
+
return p && p.constructor;
|
|
131
|
+
}
|
|
122
132
|
function CLASS__NS__getName(target) {
|
|
123
133
|
return getClassName(target);
|
|
124
134
|
}
|
|
125
135
|
function CLASS__NS__getNameFromObject(o) {
|
|
126
|
-
const fnCLass =
|
|
136
|
+
const fnCLass = CLASS__NS__getFromObject(o);
|
|
127
137
|
return CLASS__NS__getName(fnCLass);
|
|
128
138
|
}
|
|
129
139
|
const CLASS__NS__getMethodsNames = (classOrClassInstance, allMethodsNames = []) => {
|
|
@@ -160,5 +170,5 @@ const CLASS__NS__getMethodsNames = (classOrClassInstance, allMethodsNames = [])
|
|
|
160
170
|
* Generated bundle index. Do not edit.
|
|
161
171
|
*/
|
|
162
172
|
|
|
163
|
-
export { CLASS__NS__NAME, CLASS__NS__getBy, CLASS__NS__getClassNameFromObjInstanceOrClassFn, CLASS__NS__getMethodsNames, CLASS__NS__getName, CLASS__NS__getNameFromObject, CLASS__NS__setClassName, CLASS__NS__setName, getClassName, getFromObject };
|
|
173
|
+
export { CLASS__NS__NAME, CLASS__NS__getBy, CLASS__NS__getClassNameFromObjInstanceOrClassFn, CLASS__NS__getFromObject, CLASS__NS__getMethodsNames, CLASS__NS__getName, CLASS__NS__getNameFromObject, CLASS__NS__setClassName, CLASS__NS__setName, getClassName, getFromObject };
|
|
164
174
|
//# sourceMappingURL=typescript-class-helpers-browser.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-class-helpers-browser.mjs","sources":["../../../tmp-libs-for-dist-prod/typescript-class-helpers/projects/typescript-class-helpers/src/lib/typescript-class-helpers.ts","../../../tmp-libs-for-dist-prod/typescript-class-helpers/projects/typescript-class-helpers/src/typescript-class-helpers-browser.ts"],"sourcesContent":["/* */ \nimport { ___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__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__CfontAlign, CoreModels__NS__CfontStyle, CoreModels__NS__ClassNameStaticProperty, CoreModels__NS__ContentType, CoreModels__NS__ContentTypeKeys, CoreModels__NS__CoreLibCategory, CoreModels__NS__CutableFileExt, CoreModels__NS__DatabaseType, CoreModels__NS__EnvironmentName, CoreModels__NS__EnvironmentNameTaon, CoreModels__NS__ExecuteOptions, CoreModels__NS__FileEvent, CoreModels__NS__FileExtension, CoreModels__NS__FrameworkVersion, CoreModels__NS__GitConnection, CoreModels__NS__GitConnectionArr, CoreModels__NS__GlobalDependencies, 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__MimeType, CoreModels__NS__mimeTypes, CoreModels__NS__MimeTypesObj, CoreModels__NS__NewFactoryType, CoreModels__NS__NpmInstallOptions, 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__tagForTaskName, CoreModels__NS__TaonHttpErrorCustomProp, CoreModels__NS__TsUsage, CoreModels__NS__UIFramework, CoreModels__NS__UploadedBackendFile, CoreModels__NS__VSCodeSettings, UtilsOs__NS__commandExistsAsync, UtilsOs__NS__commandExistsSync, UtilsOs__NS__detectEditor, UtilsOs__NS__Editor, UtilsOs__NS__EDITOR_PROCESSES, UtilsOs__NS__EditorArr, UtilsOs__NS__EditorProcess, UtilsOs__NS__getEditorSettingsJsonPath, 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__isRunningInDocker, UtilsOs__NS__isRunningInElectron, 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__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 } from 'tnp-core/browser-prod';\nimport { Helpers__NS___fixCommand, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__compilationWrapper, 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__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__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';\n\nconst REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');\n\ntype Registry = Map<string, Function>;\n\nfunction getRegistry(): Registry {\n const g = globalThis as any;\n\n if (!g[REGISTRY_SYMBOL]) {\n g[REGISTRY_SYMBOL] = new Map<string, Function>();\n }\n\n return g[REGISTRY_SYMBOL];\n}\n\nconst classes = getRegistry();\n\nexport function getClassName(target: Function): string | undefined {\n if (___NS__isNil(target)) {\n return void 0;\n }\n if (___NS__isString(target)) {\n return target;\n }\n\n if (target === Date) {\n return 'Date';\n }\n\n if ((target as any) === FormData) {\n return 'FormData';\n }\n\n if (!___NS__isFunction(target)) {\n // console.log(target);\n Helpers__NS__log(\n `[typescript-class-helpers][getClassName] target is not a class`,\n );\n return void 0;\n }\n\n if (!___NS__isNil(target[CoreModels__NS__ClassNameStaticProperty])) {\n return target[CoreModels__NS__ClassNameStaticProperty];\n }\n\n // special thing when cloning classes\n if (target.name?.startsWith('class_')) {\n return '';\n }\n\n return;\n}\n\nexport function getFromObject(o: Object) {\n if (___NS__isUndefined(o) || ___NS__isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n}\n\nconst notAllowedAsMethodName = [\n 'length',\n 'name',\n 'arguments',\n 'caller',\n 'constructor',\n 'apply',\n 'bind',\n 'call',\n 'toString',\n '__defineGetter__',\n '__defineSetter__',\n 'hasOwnProperty',\n '__lookupGetter__',\n '__lookupSetter__',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n '__proto__',\n 'toLocaleString',\n];\n\n//namespace CLASS\n\n /**\n * PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE\n * Decorator requred for production mode\n * @param name Name of class\n */\n export function CLASS__NS__NAME(className: string) {\n return function (target: Function) {\n return CLASS__NS__setClassName(target, className);\n } as any;\n }\n\n export function CLASS__NS__setName(target: Function, className: string) {\n CLASS__NS__setClassName(target, className);\n }\n\n export function CLASS__NS__getClassNameFromObjInstanceOrClassFn(\n target: any,\n ): string | undefined {\n if (typeof target === 'object') {\n return CLASS__NS__getNameFromObject(target);\n }\n return getClassName(target);\n }\n\n export function CLASS__NS__setClassName(target: Function, className: string): void {\n target[CoreModels__NS__ClassNameStaticProperty] = className;\n classes.set(className, target);\n }\n export function CLASS__NS__getBy(className: string | Function): Function {\n let res;\n if (Array.isArray(className)) {\n if (className.length !== 1) {\n throw `Mapping error... please use proper class names:\n {\n propertyObject: 'MyClassName',\n propertyWithArray: ['MyClassName']\n }\n\n `;\n }\n className = className[0];\n }\n if (typeof className === 'function') {\n // TODO QUICK_FIX\n res = className;\n }\n if (className === 'Date') {\n res = Date;\n }\n\n if (className === 'FormData') {\n res = FormData;\n }\n\n const classFromMap = classes.get(className as string);\n return classFromMap ? classFromMap : res;\n }\n\n export function CLASS__NS__getName(target: Function): string | undefined {\n return getClassName(target) as string;\n }\n export function CLASS__NS__getNameFromObject(o: Object): string | undefined {\n const fnCLass = getFromObject(o);\n return CLASS__NS__getName(fnCLass);\n }\n\n export const CLASS__NS__getMethodsNames = (\n classOrClassInstance: any,\n allMethodsNames = [],\n ): string[] => {\n if (!classOrClassInstance) {\n return allMethodsNames;\n }\n\n const isClassFunction = ___NS__isFunction(classOrClassInstance);\n const classFun = isClassFunction\n ? classOrClassInstance\n : Object.getPrototypeOf(classOrClassInstance);\n const objectToCheck = isClassFunction\n ? (classOrClassInstance as Function)?.prototype\n : classOrClassInstance;\n const prototypeObj = Object.getPrototypeOf(objectToCheck || {});\n\n const properties = ___NS__uniq([\n ...Object.getOwnPropertyNames(objectToCheck || {}),\n ...Object.getOwnPropertyNames(prototypeObj || {}),\n ...Object.keys(objectToCheck || {}),\n ...Object.keys(prototypeObj || {}),\n ]).filter(f => !!f && !notAllowedAsMethodName.includes(f));\n\n properties\n .filter(methodName => typeof objectToCheck[methodName] === 'function')\n .forEach(p => allMethodsNames.push(p));\n\n if (\n !classFun ||\n !classFun.constructor ||\n classFun?.constructor?.name === 'Object'\n ) {\n return allMethodsNames;\n }\n return CLASS__NS__getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);\n };\n\n//end of namespace CLASS","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AAIA,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC;AAIzD,SAAS,WAAW,GAAA;IAClB,MAAM,CAAC,GAAG,UAAiB;AAE3B,IAAA,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE;AACvB,QAAA,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,EAAoB;IAClD;AAEA,IAAA,OAAO,CAAC,CAAC,eAAe,CAAC;AAC3B;AAE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AAU,CAAC,KAAK,UAAU;AACpE,SAAA,OAAO,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAExC,IAAA,IACE,CAAC,QAAQ;QACT,CAAC,QAAQ,CAAC,WAAW;AACrB,QAAA,QAAQ,EAAE,WAAW,EAAE,IAAI,KAAK,QAAQ,EACxC;AACA,QAAA,OAAO,eAAe;IACxB;IACA,OAAO,0BAA0B,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;AACrF;AAEF;;ACnMA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"typescript-class-helpers-browser.mjs","sources":["../../../tmp-libs-for-dist-prod/typescript-class-helpers/projects/typescript-class-helpers/src/lib/typescript-class-helpers.ts","../../../tmp-libs-for-dist-prod/typescript-class-helpers/projects/typescript-class-helpers/src/typescript-class-helpers-browser.ts"],"sourcesContent":["/* */ \nimport { ___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__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__CfontAlign, CoreModels__NS__CfontStyle, CoreModels__NS__ClassNameStaticProperty, CoreModels__NS__ContentType, CoreModels__NS__ContentTypeKeys, CoreModels__NS__CoreLibCategory, CoreModels__NS__CutableFileExt, CoreModels__NS__DatabaseType, CoreModels__NS__EnvironmentName, CoreModels__NS__EnvironmentNameTaon, CoreModels__NS__ExecuteOptions, CoreModels__NS__FileEvent, CoreModels__NS__FileExtension, CoreModels__NS__FrameworkVersion, CoreModels__NS__GitConnection, CoreModels__NS__GitConnectionArr, CoreModels__NS__GlobalDependencies, 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__MimeType, CoreModels__NS__mimeTypes, CoreModels__NS__MimeTypesObj, CoreModels__NS__NewFactoryType, CoreModels__NS__NpmInstallOptions, 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__tagForTaskName, CoreModels__NS__TaonHttpErrorCustomProp, CoreModels__NS__TsUsage, CoreModels__NS__UIFramework, CoreModels__NS__UploadedBackendFile, CoreModels__NS__VSCodeSettings, UtilsOs__NS__commandExistsAsync, UtilsOs__NS__commandExistsSync, UtilsOs__NS__detectEditor, UtilsOs__NS__Editor, UtilsOs__NS__EDITOR_PROCESSES, UtilsOs__NS__EditorArr, UtilsOs__NS__EditorProcess, UtilsOs__NS__getEditorSettingsJsonPath, 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__isRunningInDocker, UtilsOs__NS__isRunningInElectron, 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__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 } from 'tnp-core/browser-prod';\nimport { Helpers__NS___fixCommand, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__compilationWrapper, 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__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__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';\n\nconst REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');\n\ntype Registry = Map<string, Function>;\n\nfunction getRegistry(): Registry {\n const g = globalThis as any;\n\n if (!g[REGISTRY_SYMBOL]) {\n g[REGISTRY_SYMBOL] = new Map<string, Function>();\n }\n\n return g[REGISTRY_SYMBOL];\n}\n\nconst classes = getRegistry();\n\nexport function getClassName(target: Function): string | undefined {\n if (___NS__isNil(target)) {\n return void 0;\n }\n if (___NS__isString(target)) {\n return target;\n }\n\n if (target === Date) {\n return 'Date';\n }\n\n if ((target as any) === FormData) {\n return 'FormData';\n }\n\n if (!___NS__isFunction(target)) {\n // console.log(target);\n Helpers__NS__log(\n `[typescript-class-helpers][getClassName] target is not a class`,\n );\n return void 0;\n }\n\n if (!___NS__isNil(target[CoreModels__NS__ClassNameStaticProperty])) {\n return target[CoreModels__NS__ClassNameStaticProperty];\n }\n\n // special thing when cloning classes\n if (target.name?.startsWith('class_')) {\n return '';\n }\n\n return;\n}\n\nexport function getFromObject(o: Object) {\n if (___NS__isUndefined(o) || ___NS__isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n}\n\nconst notAllowedAsMethodName = [\n 'length',\n 'name',\n 'arguments',\n 'caller',\n 'constructor',\n 'apply',\n 'bind',\n 'call',\n 'toString',\n '__defineGetter__',\n '__defineSetter__',\n 'hasOwnProperty',\n '__lookupGetter__',\n '__lookupSetter__',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n '__proto__',\n 'toLocaleString',\n];\n\n//namespace CLASS\n\n /**\n * PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE\n * Decorator requred for production mode\n * @param name Name of class\n */\n export function CLASS__NS__NAME(className: string) {\n return function (target: Function) {\n return CLASS__NS__setClassName(target, className);\n } as any;\n }\n\n export function CLASS__NS__setName(target: Function, className: string) {\n CLASS__NS__setClassName(target, className);\n }\n\n export function CLASS__NS__getClassNameFromObjInstanceOrClassFn(\n target: any,\n ): string | undefined {\n if (typeof target === 'object') {\n return CLASS__NS__getNameFromObject(target);\n }\n return getClassName(target);\n }\n\n export function CLASS__NS__setClassName(target: Function, className: string): void {\n target[CoreModels__NS__ClassNameStaticProperty] = className;\n classes.set(className, target);\n }\n export function CLASS__NS__getBy(className: string | Function): Function {\n let res;\n if (Array.isArray(className)) {\n if (className.length !== 1) {\n throw `Mapping error... please use proper class names:\n {\n propertyObject: 'MyClassName',\n propertyWithArray: ['MyClassName']\n }\n\n `;\n }\n className = className[0];\n }\n if (typeof className === 'function') {\n // TODO QUICK_FIX\n res = className;\n }\n if (className === 'Date') {\n res = Date;\n }\n\n if (className === 'FormData') {\n res = FormData;\n }\n\n const classFromMap = classes.get(className as string);\n return classFromMap ? classFromMap : res;\n }\n\n export function CLASS__NS__getFromObject(o: Object): Function | undefined{\n if (___NS__isUndefined(o) || ___NS__isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n }\n\n export function CLASS__NS__getName(target: Function): string | undefined {\n return getClassName(target) as string;\n }\n export function CLASS__NS__getNameFromObject(o: Object): string | undefined {\n const fnCLass = CLASS__NS__getFromObject(o);\n return CLASS__NS__getName(fnCLass);\n }\n\n export const CLASS__NS__getMethodsNames = (\n classOrClassInstance: any,\n allMethodsNames = [],\n ): string[] => {\n if (!classOrClassInstance) {\n return allMethodsNames;\n }\n\n const isClassFunction = ___NS__isFunction(classOrClassInstance);\n const classFun = isClassFunction\n ? classOrClassInstance\n : Object.getPrototypeOf(classOrClassInstance);\n const objectToCheck = isClassFunction\n ? (classOrClassInstance as Function)?.prototype\n : classOrClassInstance;\n const prototypeObj = Object.getPrototypeOf(objectToCheck || {});\n\n const properties = ___NS__uniq([\n ...Object.getOwnPropertyNames(objectToCheck || {}),\n ...Object.getOwnPropertyNames(prototypeObj || {}),\n ...Object.keys(objectToCheck || {}),\n ...Object.keys(prototypeObj || {}),\n ]).filter(f => !!f && !notAllowedAsMethodName.includes(f));\n\n properties\n .filter(methodName => typeof objectToCheck[methodName] === 'function')\n .forEach(p => allMethodsNames.push(p));\n\n if (\n !classFun ||\n !classFun.constructor ||\n classFun?.constructor?.name === 'Object'\n ) {\n return allMethodsNames;\n }\n return CLASS__NS__getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);\n };\n\n//end of namespace CLASS","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AAIA,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC;AAIzD,SAAS,WAAW,GAAA;IAClB,MAAM,CAAC,GAAG,UAAiB;AAE3B,IAAA,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE;AACvB,QAAA,CAAC,CAAC,eAAe,CAAC,GAAG,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EAAE,CAAC;AAClD,QAAA,GAAG,MAAM,CAAC,mBAAmB,CAAC,YAAY,IAAI,EAAE,CAAC;AACjD,QAAA,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC;AACnC,QAAA,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;AACnC,KAAA,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE1D;AACG,SAAA,MAAM,CAAC,UAAU,IAAI,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,UAAU;AACpE,SAAA,OAAO,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAExC,IAAA,IACE,CAAC,QAAQ;QACT,CAAC,QAAQ,CAAC,WAAW;AACrB,QAAA,QAAQ,EAAE,WAAW,EAAE,IAAI,KAAK,QAAQ,EACxC;AACA,QAAA,OAAO,eAAe;IACxB;IACA,OAAO,0BAA0B,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;AACrF;AAEF;;AC9MA;;AAEG;;;;"}
|
|
@@ -11,8 +11,9 @@ declare function CLASS__NS__setName(target: Function, className: string): void;
|
|
|
11
11
|
declare function CLASS__NS__getClassNameFromObjInstanceOrClassFn(target: any): string | undefined;
|
|
12
12
|
declare function CLASS__NS__setClassName(target: Function, className: string): void;
|
|
13
13
|
declare function CLASS__NS__getBy(className: string | Function): Function;
|
|
14
|
+
declare function CLASS__NS__getFromObject(o: Object): Function | undefined;
|
|
14
15
|
declare function CLASS__NS__getName(target: Function): string | undefined;
|
|
15
16
|
declare function CLASS__NS__getNameFromObject(o: Object): string | undefined;
|
|
16
17
|
declare const CLASS__NS__getMethodsNames: (classOrClassInstance: any, allMethodsNames?: any[]) => string[];
|
|
17
18
|
|
|
18
|
-
export { CLASS__NS__NAME, CLASS__NS__getBy, CLASS__NS__getClassNameFromObjInstanceOrClassFn, CLASS__NS__getMethodsNames, CLASS__NS__getName, CLASS__NS__getNameFromObject, CLASS__NS__setClassName, CLASS__NS__setName, getClassName, getFromObject };
|
|
19
|
+
export { CLASS__NS__NAME, CLASS__NS__getBy, CLASS__NS__getClassNameFromObjInstanceOrClassFn, CLASS__NS__getFromObject, CLASS__NS__getMethodsNames, CLASS__NS__getName, CLASS__NS__getNameFromObject, CLASS__NS__setClassName, CLASS__NS__setName, getClassName, getFromObject };
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"CLASS.getClassNameFromObjInstanceOrClassFn": "CLASS__NS__getClassNameFromObjInstanceOrClassFn",
|
|
6
6
|
"CLASS.setClassName": "CLASS__NS__setClassName",
|
|
7
7
|
"CLASS.getBy": "CLASS__NS__getBy",
|
|
8
|
+
"CLASS.getFromObject": "CLASS__NS__getFromObject",
|
|
8
9
|
"CLASS.getName": "CLASS__NS__getName",
|
|
9
10
|
"CLASS.getNameFromObject": "CLASS__NS__getNameFromObject",
|
|
10
11
|
"CLASS.getMethodsNames": "CLASS__NS__getMethodsNames"
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
"CLASS__NS__NAME",
|
|
15
16
|
"CLASS__NS__getBy",
|
|
16
17
|
"CLASS__NS__getClassNameFromObjInstanceOrClassFn",
|
|
18
|
+
"CLASS__NS__getFromObject",
|
|
17
19
|
"CLASS__NS__getMethodsNames",
|
|
18
20
|
"CLASS__NS__getName",
|
|
19
21
|
"CLASS__NS__getNameFromObject",
|
|
@@ -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.
|
|
28
|
+
exports.CURRENT_PACKAGE_VERSION = '21.0.35';
|
|
29
29
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
30
30
|
//# sourceMappingURL=build-info._auto-generated_.js.map
|
package/lib/package.json
CHANGED
|
@@ -11,6 +11,7 @@ export declare namespace CLASS {
|
|
|
11
11
|
function getClassNameFromObjInstanceOrClassFn(target: any): string | undefined;
|
|
12
12
|
function setClassName(target: Function, className: string): void;
|
|
13
13
|
function getBy(className: string | Function): Function;
|
|
14
|
+
function getFromObject(o: Object): Function | undefined;
|
|
14
15
|
function getName(target: Function): string | undefined;
|
|
15
16
|
function getNameFromObject(o: Object): string | undefined;
|
|
16
17
|
const getMethodsNames: (classOrClassInstance: any, allMethodsNames?: any[]) => string[];
|
|
@@ -130,6 +130,17 @@ var CLASS;
|
|
|
130
130
|
return classFromMap ? classFromMap : res;
|
|
131
131
|
}
|
|
132
132
|
CLASS.getBy = getBy;
|
|
133
|
+
function getFromObject(o) {
|
|
134
|
+
if (lib_1._.isUndefined(o) || lib_1._.isNull(o)) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (o.constructor) {
|
|
138
|
+
return o.constructor;
|
|
139
|
+
}
|
|
140
|
+
const p = Object.getPrototypeOf(o);
|
|
141
|
+
return p && p.constructor;
|
|
142
|
+
}
|
|
143
|
+
CLASS.getFromObject = getFromObject;
|
|
133
144
|
function getName(target) {
|
|
134
145
|
return getClassName(target);
|
|
135
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-class-helpers.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAoBA,oCAkCC;AAED,sCASC;AAjED,sCAAsC,CAAC,WAAW;AAClD,sCAAsD;AACtD,sCAAuC;AAEvC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAI1D,SAAS,WAAW;IAClB,MAAM,CAAC,GAAG,UAAiB,CAAC;IAE5B,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC;QACxB,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,GAA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
|
/**
|
|
23
23
|
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
24
24
|
*/
|
|
25
|
-
export const CURRENT_PACKAGE_VERSION = '21.0.
|
|
25
|
+
export const CURRENT_PACKAGE_VERSION = '21.0.35';
|
|
26
26
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
27
27
|
//# sourceMappingURL=build-info._auto-generated_.js.map
|
package/lib-prod/package.json
CHANGED
|
@@ -10,6 +10,7 @@ export declare function CLASS__NS__setName(target: Function, className: string):
|
|
|
10
10
|
export declare function CLASS__NS__getClassNameFromObjInstanceOrClassFn(target: any): string | undefined;
|
|
11
11
|
export declare function CLASS__NS__setClassName(target: Function, className: string): void;
|
|
12
12
|
export declare function CLASS__NS__getBy(className: string | Function): Function;
|
|
13
|
+
export declare function CLASS__NS__getFromObject(o: Object): Function | undefined;
|
|
13
14
|
export declare function CLASS__NS__getName(target: Function): string | undefined;
|
|
14
15
|
export declare function CLASS__NS__getNameFromObject(o: Object): string | undefined;
|
|
15
16
|
export declare const CLASS__NS__getMethodsNames: (classOrClassInstance: any, allMethodsNames?: any[]) => string[];
|
|
@@ -119,11 +119,21 @@ export function CLASS__NS__getBy(className) {
|
|
|
119
119
|
const classFromMap = classes.get(className);
|
|
120
120
|
return classFromMap ? classFromMap : res;
|
|
121
121
|
}
|
|
122
|
+
export function CLASS__NS__getFromObject(o) {
|
|
123
|
+
if (___NS__isUndefined(o) || ___NS__isNull(o)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (o.constructor) {
|
|
127
|
+
return o.constructor;
|
|
128
|
+
}
|
|
129
|
+
const p = Object.getPrototypeOf(o);
|
|
130
|
+
return p && p.constructor;
|
|
131
|
+
}
|
|
122
132
|
export function CLASS__NS__getName(target) {
|
|
123
133
|
return getClassName(target);
|
|
124
134
|
}
|
|
125
135
|
export function CLASS__NS__getNameFromObject(o) {
|
|
126
|
-
const fnCLass =
|
|
136
|
+
const fnCLass = CLASS__NS__getFromObject(o);
|
|
127
137
|
return CLASS__NS__getName(fnCLass);
|
|
128
138
|
}
|
|
129
139
|
export const CLASS__NS__getMethodsNames = (classOrClassInstance, allMethodsNames = []) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-class-helpers.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC,CAAC,WAAW;AAClD,OAAO,EAA6+D,iBAAiB,EAAsH,YAAY,EAAE,aAAa,EAAoI,eAAe,EAAwC,kBAAkB,EAA2tE,WAAW,EAA8d,uCAAuC,EAAk/F,MAAM,mBAAmB,CAAC;AAC1lQ,OAAO,EAA+xC,gBAAgB,EAAixC,MAAM,mBAAmB,CAAC;AAEjmF,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAI1D,SAAS,WAAW;IAClB,MAAM,CAAC,GAAG,UAAiB,CAAC;IAE5B,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC;QACxB,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,EAAoB,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,CAAC,eAAe,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;AAE9B,MAAM,UAAU,YAAY,CAAC,MAAgB;IAC3C,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,CAAC;IAChB,CAAC;IACD,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAK,MAAc,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE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C,YAAY,IAAI,EAAE,CAAC;KACnC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3D,UAAU;SACP,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,UAAU,CAAC;SACrE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,IACE,CAAC,QAAQ;QACT,CAAC,QAAQ,CAAC,WAAW;QACrB,QAAQ,EAAE,WAAW,EAAE,IAAI,KAAK,QAAQ,EACxC,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,OAAO,0BAA0B,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC,CAAC;AACtF,CAAC,CAAC;AAEJ,wBAAwB"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"CLASS.getClassNameFromObjInstanceOrClassFn": "CLASS__NS__getClassNameFromObjInstanceOrClassFn",
|
|
6
6
|
"CLASS.setClassName": "CLASS__NS__setClassName",
|
|
7
7
|
"CLASS.getBy": "CLASS__NS__getBy",
|
|
8
|
+
"CLASS.getFromObject": "CLASS__NS__getFromObject",
|
|
8
9
|
"CLASS.getName": "CLASS__NS__getName",
|
|
9
10
|
"CLASS.getNameFromObject": "CLASS__NS__getNameFromObject",
|
|
10
11
|
"CLASS.getMethodsNames": "CLASS__NS__getMethodsNames"
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
"CLASS__NS__NAME",
|
|
15
16
|
"CLASS__NS__getBy",
|
|
16
17
|
"CLASS__NS__getClassNameFromObjInstanceOrClassFn",
|
|
18
|
+
"CLASS__NS__getFromObject",
|
|
17
19
|
"CLASS__NS__getMethodsNames",
|
|
18
20
|
"CLASS__NS__getName",
|
|
19
21
|
"CLASS__NS__getNameFromObject",
|
package/package.json
CHANGED
|
@@ -125,6 +125,17 @@ var CLASS;
|
|
|
125
125
|
return classFromMap ? classFromMap : res;
|
|
126
126
|
}
|
|
127
127
|
CLASS.getBy = getBy;
|
|
128
|
+
function getFromObject(o) {
|
|
129
|
+
if (_.isUndefined(o) || _.isNull(o)) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (o.constructor) {
|
|
133
|
+
return o.constructor;
|
|
134
|
+
}
|
|
135
|
+
const p = Object.getPrototypeOf(o);
|
|
136
|
+
return p && p.constructor;
|
|
137
|
+
}
|
|
138
|
+
CLASS.getFromObject = getFromObject;
|
|
128
139
|
function getName(target) {
|
|
129
140
|
return getClassName(target);
|
|
130
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-class-helpers-websql.mjs","sources":["../../../tmp-libs-for-dist-websql/typescript-class-helpers/projects/typescript-class-helpers/src/lib/typescript-class-helpers.ts","../../../tmp-libs-for-dist-websql/typescript-class-helpers/projects/typescript-class-helpers/src/typescript-class-helpers-websql.ts"],"sourcesContent":["/* */ \nimport { _, CoreModels, UtilsOs } from 'tnp-core/websql';\nimport { Helpers } from 'tnp-core/websql';\n\nconst REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');\n\ntype Registry = Map<string, Function>;\n\nfunction getRegistry(): Registry {\n const g = globalThis as any;\n\n if (!g[REGISTRY_SYMBOL]) {\n g[REGISTRY_SYMBOL] = new Map<string, Function>();\n }\n\n return g[REGISTRY_SYMBOL];\n}\n\nconst classes = getRegistry();\n\nexport function getClassName(target: Function): string | undefined {\n if (_.isNil(target)) {\n return void 0;\n }\n if (_.isString(target)) {\n return target;\n }\n\n if (target === Date) {\n return 'Date';\n }\n\n if ((target as any) === FormData) {\n return 'FormData';\n }\n\n if (!_.isFunction(target)) {\n // console.log(target);\n Helpers.log(\n `[typescript-class-helpers][getClassName] target is not a class`,\n );\n return void 0;\n }\n\n if (!_.isNil(target[CoreModels.ClassNameStaticProperty])) {\n return target[CoreModels.ClassNameStaticProperty];\n }\n\n // special thing when cloning classes\n if (target.name?.startsWith('class_')) {\n return '';\n }\n\n return;\n}\n\nexport function getFromObject(o: Object) {\n if (_.isUndefined(o) || _.isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n}\n\nconst notAllowedAsMethodName = [\n 'length',\n 'name',\n 'arguments',\n 'caller',\n 'constructor',\n 'apply',\n 'bind',\n 'call',\n 'toString',\n '__defineGetter__',\n '__defineSetter__',\n 'hasOwnProperty',\n '__lookupGetter__',\n '__lookupSetter__',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n '__proto__',\n 'toLocaleString',\n];\n\nexport namespace CLASS {\n /**\n * PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE\n * Decorator requred for production mode\n * @param name Name of class\n */\n export function NAME(className: string) {\n return function (target: Function) {\n return setClassName(target, className);\n } as any;\n }\n\n export function setName(target: Function, className: string) {\n setClassName(target, className);\n }\n\n export function getClassNameFromObjInstanceOrClassFn(\n target: any,\n ): string | undefined {\n if (typeof target === 'object') {\n return getNameFromObject(target);\n }\n return getClassName(target);\n }\n\n export function setClassName(target: Function, className: string): void {\n target[CoreModels.ClassNameStaticProperty] = className;\n classes.set(className, target);\n }\n export function getBy(className: string | Function): Function {\n let res;\n if (Array.isArray(className)) {\n if (className.length !== 1) {\n throw `Mapping error... please use proper class names:\n {\n propertyObject: 'MyClassName',\n propertyWithArray: ['MyClassName']\n }\n\n `;\n }\n className = className[0];\n }\n if (typeof className === 'function') {\n // TODO QUICK_FIX\n res = className;\n }\n if (className === 'Date') {\n res = Date;\n }\n\n if (className === 'FormData') {\n res = FormData;\n }\n\n const classFromMap = classes.get(className as string);\n return classFromMap ? classFromMap : res;\n }\n\n export function getName(target: Function): string | undefined {\n return getClassName(target) as string;\n }\n export function getNameFromObject(o: Object): string | undefined {\n const fnCLass = getFromObject(o);\n return getName(fnCLass);\n }\n\n export const getMethodsNames = (\n classOrClassInstance: any,\n allMethodsNames = [],\n ): string[] => {\n if (!classOrClassInstance) {\n return allMethodsNames;\n }\n\n const isClassFunction = _.isFunction(classOrClassInstance);\n const classFun = isClassFunction\n ? classOrClassInstance\n : Object.getPrototypeOf(classOrClassInstance);\n const objectToCheck = isClassFunction\n ? (classOrClassInstance as Function)?.prototype\n : classOrClassInstance;\n const prototypeObj = Object.getPrototypeOf(objectToCheck || {});\n\n const properties = _.uniq([\n ...Object.getOwnPropertyNames(objectToCheck || {}),\n ...Object.getOwnPropertyNames(prototypeObj || {}),\n ...Object.keys(objectToCheck || {}),\n ...Object.keys(prototypeObj || {}),\n ]).filter(f => !!f && !notAllowedAsMethodName.includes(f));\n\n properties\n .filter(methodName => typeof objectToCheck[methodName] === 'function')\n .forEach(p => allMethodsNames.push(p));\n\n if (\n !classFun ||\n !classFun.constructor ||\n classFun?.constructor?.name === 'Object'\n ) {\n return allMethodsNames;\n }\n return getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);\n };\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AAIA,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC;AAIzD,SAAS,WAAW,GAAA;IAClB,MAAM,CAAC,GAAG,UAAiB;AAE3B,IAAA,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE;AACvB,QAAA,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,EAAoB;IAClD;AAEA,IAAA,OAAO,CAAC,CAAC,eAAe,CAAC;AAC3B;AAEA,MAAM,OAAO,GAAG,WAAW,EAAE;AAEvB,SAAU,YAAY,CAAC,MAAgB,EAAA;AAC3C,IAAA,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QACnB,OAAO,KAAK,CAAC;IACf;AACA,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,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC;AACnC,YAAA,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;AACnC,SAAA,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE1D;AACG,aAAA,MAAM,CAAC,UAAU,IAAI,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,UAAU;AACpE,aAAA,OAAO,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAExC,QAAA,IACE,CAAC,QAAQ;YACT,CAAC,QAAQ,CAAC,WAAW;AACrB,YAAA,QAAQ,EAAE,WAAW,EAAE,IAAI,KAAK,QAAQ,EACxC;AACA,YAAA,OAAO,eAAe;QACxB;AACA,QAAA,OAAO,KAAA,CAAA,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;AAC1E,IAAA,CAAC;AACH,CAAC,EAxGgB,KAAK,KAAL,KAAK,GAAA,EAAA,CAAA,CAAA;;ACzFtB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"typescript-class-helpers-websql.mjs","sources":["../../../tmp-libs-for-dist-websql/typescript-class-helpers/projects/typescript-class-helpers/src/lib/typescript-class-helpers.ts","../../../tmp-libs-for-dist-websql/typescript-class-helpers/projects/typescript-class-helpers/src/typescript-class-helpers-websql.ts"],"sourcesContent":["/* */ \nimport { _, CoreModels, UtilsOs } from 'tnp-core/websql';\nimport { Helpers } from 'tnp-core/websql';\n\nconst REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');\n\ntype Registry = Map<string, Function>;\n\nfunction getRegistry(): Registry {\n const g = globalThis as any;\n\n if (!g[REGISTRY_SYMBOL]) {\n g[REGISTRY_SYMBOL] = new Map<string, Function>();\n }\n\n return g[REGISTRY_SYMBOL];\n}\n\nconst classes = getRegistry();\n\nexport function getClassName(target: Function): string | undefined {\n if (_.isNil(target)) {\n return void 0;\n }\n if (_.isString(target)) {\n return target;\n }\n\n if (target === Date) {\n return 'Date';\n }\n\n if ((target as any) === FormData) {\n return 'FormData';\n }\n\n if (!_.isFunction(target)) {\n // console.log(target);\n Helpers.log(\n `[typescript-class-helpers][getClassName] target is not a class`,\n );\n return void 0;\n }\n\n if (!_.isNil(target[CoreModels.ClassNameStaticProperty])) {\n return target[CoreModels.ClassNameStaticProperty];\n }\n\n // special thing when cloning classes\n if (target.name?.startsWith('class_')) {\n return '';\n }\n\n return;\n}\n\nexport function getFromObject(o: Object) {\n if (_.isUndefined(o) || _.isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n}\n\nconst notAllowedAsMethodName = [\n 'length',\n 'name',\n 'arguments',\n 'caller',\n 'constructor',\n 'apply',\n 'bind',\n 'call',\n 'toString',\n '__defineGetter__',\n '__defineSetter__',\n 'hasOwnProperty',\n '__lookupGetter__',\n '__lookupSetter__',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n '__proto__',\n 'toLocaleString',\n];\n\nexport namespace CLASS {\n /**\n * PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE\n * Decorator requred for production mode\n * @param name Name of class\n */\n export function NAME(className: string) {\n return function (target: Function) {\n return setClassName(target, className);\n } as any;\n }\n\n export function setName(target: Function, className: string) {\n setClassName(target, className);\n }\n\n export function getClassNameFromObjInstanceOrClassFn(\n target: any,\n ): string | undefined {\n if (typeof target === 'object') {\n return getNameFromObject(target);\n }\n return getClassName(target);\n }\n\n export function setClassName(target: Function, className: string): void {\n target[CoreModels.ClassNameStaticProperty] = className;\n classes.set(className, target);\n }\n export function getBy(className: string | Function): Function {\n let res;\n if (Array.isArray(className)) {\n if (className.length !== 1) {\n throw `Mapping error... please use proper class names:\n {\n propertyObject: 'MyClassName',\n propertyWithArray: ['MyClassName']\n }\n\n `;\n }\n className = className[0];\n }\n if (typeof className === 'function') {\n // TODO QUICK_FIX\n res = className;\n }\n if (className === 'Date') {\n res = Date;\n }\n\n if (className === 'FormData') {\n res = FormData;\n }\n\n const classFromMap = classes.get(className as string);\n return classFromMap ? classFromMap : res;\n }\n\n export function getFromObject(o: Object): Function | undefined{\n if (_.isUndefined(o) || _.isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n }\n\n export function getName(target: Function): string | undefined {\n return getClassName(target) as string;\n }\n export function getNameFromObject(o: Object): string | undefined {\n const fnCLass = getFromObject(o);\n return getName(fnCLass);\n }\n\n export const getMethodsNames = (\n classOrClassInstance: any,\n allMethodsNames = [],\n ): string[] => {\n if (!classOrClassInstance) {\n return allMethodsNames;\n }\n\n const isClassFunction = _.isFunction(classOrClassInstance);\n const classFun = isClassFunction\n ? classOrClassInstance\n : Object.getPrototypeOf(classOrClassInstance);\n const objectToCheck = isClassFunction\n ? (classOrClassInstance as Function)?.prototype\n : classOrClassInstance;\n const prototypeObj = Object.getPrototypeOf(objectToCheck || {});\n\n const properties = _.uniq([\n ...Object.getOwnPropertyNames(objectToCheck || {}),\n ...Object.getOwnPropertyNames(prototypeObj || {}),\n ...Object.keys(objectToCheck || {}),\n ...Object.keys(prototypeObj || {}),\n ]).filter(f => !!f && !notAllowedAsMethodName.includes(f));\n\n properties\n .filter(methodName => typeof objectToCheck[methodName] === 'function')\n .forEach(p => allMethodsNames.push(p));\n\n if (\n !classFun ||\n !classFun.constructor ||\n classFun?.constructor?.name === 'Object'\n ) {\n return allMethodsNames;\n }\n return getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);\n };\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AAIA,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC;AAIzD,SAAS,WA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AQ,EAAE,WAAW,EAAE,IAAI,KAAK,QAAQ,EACxC;AACA,YAAA,OAAO,eAAe;QACxB;AACA,QAAA,OAAO,KAAA,CAAA,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;AAC1E,IAAA,CAAC;AACH,CAAC,EAnHgB,KAAK,KAAL,KAAK,GAAA,EAAA,CAAA,CAAA;;ACzFtB;;AAEG;;;;"}
|
package/websql/package.json
CHANGED
|
@@ -12,6 +12,7 @@ declare namespace CLASS {
|
|
|
12
12
|
function getClassNameFromObjInstanceOrClassFn(target: any): string | undefined;
|
|
13
13
|
function setClassName(target: Function, className: string): void;
|
|
14
14
|
function getBy(className: string | Function): Function;
|
|
15
|
+
function getFromObject(o: Object): Function | undefined;
|
|
15
16
|
function getName(target: Function): string | undefined;
|
|
16
17
|
function getNameFromObject(o: Object): string | undefined;
|
|
17
18
|
const getMethodsNames: (classOrClassInstance: any, allMethodsNames?: any[]) => string[];
|
|
@@ -119,11 +119,21 @@ function CLASS__NS__getBy(className) {
|
|
|
119
119
|
const classFromMap = classes.get(className);
|
|
120
120
|
return classFromMap ? classFromMap : res;
|
|
121
121
|
}
|
|
122
|
+
function CLASS__NS__getFromObject(o) {
|
|
123
|
+
if (___NS__isUndefined(o) || ___NS__isNull(o)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (o.constructor) {
|
|
127
|
+
return o.constructor;
|
|
128
|
+
}
|
|
129
|
+
const p = Object.getPrototypeOf(o);
|
|
130
|
+
return p && p.constructor;
|
|
131
|
+
}
|
|
122
132
|
function CLASS__NS__getName(target) {
|
|
123
133
|
return getClassName(target);
|
|
124
134
|
}
|
|
125
135
|
function CLASS__NS__getNameFromObject(o) {
|
|
126
|
-
const fnCLass =
|
|
136
|
+
const fnCLass = CLASS__NS__getFromObject(o);
|
|
127
137
|
return CLASS__NS__getName(fnCLass);
|
|
128
138
|
}
|
|
129
139
|
const CLASS__NS__getMethodsNames = (classOrClassInstance, allMethodsNames = []) => {
|
|
@@ -160,5 +170,5 @@ const CLASS__NS__getMethodsNames = (classOrClassInstance, allMethodsNames = [])
|
|
|
160
170
|
* Generated bundle index. Do not edit.
|
|
161
171
|
*/
|
|
162
172
|
|
|
163
|
-
export { CLASS__NS__NAME, CLASS__NS__getBy, CLASS__NS__getClassNameFromObjInstanceOrClassFn, CLASS__NS__getMethodsNames, CLASS__NS__getName, CLASS__NS__getNameFromObject, CLASS__NS__setClassName, CLASS__NS__setName, getClassName, getFromObject };
|
|
173
|
+
export { CLASS__NS__NAME, CLASS__NS__getBy, CLASS__NS__getClassNameFromObjInstanceOrClassFn, CLASS__NS__getFromObject, CLASS__NS__getMethodsNames, CLASS__NS__getName, CLASS__NS__getNameFromObject, CLASS__NS__setClassName, CLASS__NS__setName, getClassName, getFromObject };
|
|
164
174
|
//# sourceMappingURL=typescript-class-helpers-websql.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-class-helpers-websql.mjs","sources":["../../../tmp-libs-for-dist-websql-prod/typescript-class-helpers/projects/typescript-class-helpers/src/lib/typescript-class-helpers.ts","../../../tmp-libs-for-dist-websql-prod/typescript-class-helpers/projects/typescript-class-helpers/src/typescript-class-helpers-websql.ts"],"sourcesContent":["/* */ \nimport { ___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__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__CfontAlign, CoreModels__NS__CfontStyle, CoreModels__NS__ClassNameStaticProperty, CoreModels__NS__ContentType, CoreModels__NS__ContentTypeKeys, CoreModels__NS__CoreLibCategory, CoreModels__NS__CutableFileExt, CoreModels__NS__DatabaseType, CoreModels__NS__EnvironmentName, CoreModels__NS__EnvironmentNameTaon, CoreModels__NS__ExecuteOptions, CoreModels__NS__FileEvent, CoreModels__NS__FileExtension, CoreModels__NS__FrameworkVersion, CoreModels__NS__GitConnection, CoreModels__NS__GitConnectionArr, CoreModels__NS__GlobalDependencies, 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__MimeType, CoreModels__NS__mimeTypes, CoreModels__NS__MimeTypesObj, CoreModels__NS__NewFactoryType, CoreModels__NS__NpmInstallOptions, 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__tagForTaskName, CoreModels__NS__TaonHttpErrorCustomProp, CoreModels__NS__TsUsage, CoreModels__NS__UIFramework, CoreModels__NS__UploadedBackendFile, CoreModels__NS__VSCodeSettings, UtilsOs__NS__commandExistsAsync, UtilsOs__NS__commandExistsSync, UtilsOs__NS__detectEditor, UtilsOs__NS__Editor, UtilsOs__NS__EDITOR_PROCESSES, UtilsOs__NS__EditorArr, UtilsOs__NS__EditorProcess, UtilsOs__NS__getEditorSettingsJsonPath, 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__isRunningInDocker, UtilsOs__NS__isRunningInElectron, 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__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 } from 'tnp-core/websql-prod';\nimport { Helpers__NS___fixCommand, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__compilationWrapper, 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__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__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';\n\nconst REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');\n\ntype Registry = Map<string, Function>;\n\nfunction getRegistry(): Registry {\n const g = globalThis as any;\n\n if (!g[REGISTRY_SYMBOL]) {\n g[REGISTRY_SYMBOL] = new Map<string, Function>();\n }\n\n return g[REGISTRY_SYMBOL];\n}\n\nconst classes = getRegistry();\n\nexport function getClassName(target: Function): string | undefined {\n if (___NS__isNil(target)) {\n return void 0;\n }\n if (___NS__isString(target)) {\n return target;\n }\n\n if (target === Date) {\n return 'Date';\n }\n\n if ((target as any) === FormData) {\n return 'FormData';\n }\n\n if (!___NS__isFunction(target)) {\n // console.log(target);\n Helpers__NS__log(\n `[typescript-class-helpers][getClassName] target is not a class`,\n );\n return void 0;\n }\n\n if (!___NS__isNil(target[CoreModels__NS__ClassNameStaticProperty])) {\n return target[CoreModels__NS__ClassNameStaticProperty];\n }\n\n // special thing when cloning classes\n if (target.name?.startsWith('class_')) {\n return '';\n }\n\n return;\n}\n\nexport function getFromObject(o: Object) {\n if (___NS__isUndefined(o) || ___NS__isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n}\n\nconst notAllowedAsMethodName = [\n 'length',\n 'name',\n 'arguments',\n 'caller',\n 'constructor',\n 'apply',\n 'bind',\n 'call',\n 'toString',\n '__defineGetter__',\n '__defineSetter__',\n 'hasOwnProperty',\n '__lookupGetter__',\n '__lookupSetter__',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n '__proto__',\n 'toLocaleString',\n];\n\n//namespace CLASS\n\n /**\n * PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE\n * Decorator requred for production mode\n * @param name Name of class\n */\n export function CLASS__NS__NAME(className: string) {\n return function (target: Function) {\n return CLASS__NS__setClassName(target, className);\n } as any;\n }\n\n export function CLASS__NS__setName(target: Function, className: string) {\n CLASS__NS__setClassName(target, className);\n }\n\n export function CLASS__NS__getClassNameFromObjInstanceOrClassFn(\n target: any,\n ): string | undefined {\n if (typeof target === 'object') {\n return CLASS__NS__getNameFromObject(target);\n }\n return getClassName(target);\n }\n\n export function CLASS__NS__setClassName(target: Function, className: string): void {\n target[CoreModels__NS__ClassNameStaticProperty] = className;\n classes.set(className, target);\n }\n export function CLASS__NS__getBy(className: string | Function): Function {\n let res;\n if (Array.isArray(className)) {\n if (className.length !== 1) {\n throw `Mapping error... please use proper class names:\n {\n propertyObject: 'MyClassName',\n propertyWithArray: ['MyClassName']\n }\n\n `;\n }\n className = className[0];\n }\n if (typeof className === 'function') {\n // TODO QUICK_FIX\n res = className;\n }\n if (className === 'Date') {\n res = Date;\n }\n\n if (className === 'FormData') {\n res = FormData;\n }\n\n const classFromMap = classes.get(className as string);\n return classFromMap ? classFromMap : res;\n }\n\n export function CLASS__NS__getName(target: Function): string | undefined {\n return getClassName(target) as string;\n }\n export function CLASS__NS__getNameFromObject(o: Object): string | undefined {\n const fnCLass = getFromObject(o);\n return CLASS__NS__getName(fnCLass);\n }\n\n export const CLASS__NS__getMethodsNames = (\n classOrClassInstance: any,\n allMethodsNames = [],\n ): string[] => {\n if (!classOrClassInstance) {\n return allMethodsNames;\n }\n\n const isClassFunction = ___NS__isFunction(classOrClassInstance);\n const classFun = isClassFunction\n ? classOrClassInstance\n : Object.getPrototypeOf(classOrClassInstance);\n const objectToCheck = isClassFunction\n ? (classOrClassInstance as Function)?.prototype\n : classOrClassInstance;\n const prototypeObj = Object.getPrototypeOf(objectToCheck || {});\n\n const properties = ___NS__uniq([\n ...Object.getOwnPropertyNames(objectToCheck || {}),\n ...Object.getOwnPropertyNames(prototypeObj || {}),\n ...Object.keys(objectToCheck || {}),\n ...Object.keys(prototypeObj || {}),\n ]).filter(f => !!f && !notAllowedAsMethodName.includes(f));\n\n properties\n .filter(methodName => typeof objectToCheck[methodName] === 'function')\n .forEach(p => allMethodsNames.push(p));\n\n if (\n !classFun ||\n !classFun.constructor ||\n classFun?.constructor?.name === 'Object'\n ) {\n return allMethodsNames;\n }\n return CLASS__NS__getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);\n };\n\n//end of namespace CLASS","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AAIA,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC;AAIzD,SAAS,WAAW,GAAA;IAClB,MAAM,CAAC,GAAG,UAAiB;AAE3B,IAAA,IAAI,CAAC,CA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AAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE1D;AACG,SAAA,MAAM,CAAC,UAAU,IAAI,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,UAAU;AACpE,SAAA,OAAO,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAExC,IAAA,IACE,CAAC,QAAQ;QACT,CAAC,QAAQ,CAAC,WAAW;AACrB,QAAA,QAAQ,EAAE,WAAW,EAAE,IAAI,KAAK,QAAQ,EACxC;AACA,QAAA,OAAO,eAAe;IACxB;IACA,OAAO,0BAA0B,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;AACrF;AAEF;;ACnMA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"typescript-class-helpers-websql.mjs","sources":["../../../tmp-libs-for-dist-websql-prod/typescript-class-helpers/projects/typescript-class-helpers/src/lib/typescript-class-helpers.ts","../../../tmp-libs-for-dist-websql-prod/typescript-class-helpers/projects/typescript-class-helpers/src/typescript-class-helpers-websql.ts"],"sourcesContent":["/* */ \nimport { ___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__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__CfontAlign, CoreModels__NS__CfontStyle, CoreModels__NS__ClassNameStaticProperty, CoreModels__NS__ContentType, CoreModels__NS__ContentTypeKeys, CoreModels__NS__CoreLibCategory, CoreModels__NS__CutableFileExt, CoreModels__NS__DatabaseType, CoreModels__NS__EnvironmentName, CoreModels__NS__EnvironmentNameTaon, CoreModels__NS__ExecuteOptions, CoreModels__NS__FileEvent, CoreModels__NS__FileExtension, CoreModels__NS__FrameworkVersion, CoreModels__NS__GitConnection, CoreModels__NS__GitConnectionArr, CoreModels__NS__GlobalDependencies, 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__MimeType, CoreModels__NS__mimeTypes, CoreModels__NS__MimeTypesObj, CoreModels__NS__NewFactoryType, CoreModels__NS__NpmInstallOptions, 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__tagForTaskName, CoreModels__NS__TaonHttpErrorCustomProp, CoreModels__NS__TsUsage, CoreModels__NS__UIFramework, CoreModels__NS__UploadedBackendFile, CoreModels__NS__VSCodeSettings, UtilsOs__NS__commandExistsAsync, UtilsOs__NS__commandExistsSync, UtilsOs__NS__detectEditor, UtilsOs__NS__Editor, UtilsOs__NS__EDITOR_PROCESSES, UtilsOs__NS__EditorArr, UtilsOs__NS__EditorProcess, UtilsOs__NS__getEditorSettingsJsonPath, 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__isRunningInDocker, UtilsOs__NS__isRunningInElectron, 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__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 } from 'tnp-core/websql-prod';\nimport { Helpers__NS___fixCommand, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__compilationWrapper, 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__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__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';\n\nconst REGISTRY_SYMBOL = Symbol.for('TAON.CLASS_REGISTRY');\n\ntype Registry = Map<string, Function>;\n\nfunction getRegistry(): Registry {\n const g = globalThis as any;\n\n if (!g[REGISTRY_SYMBOL]) {\n g[REGISTRY_SYMBOL] = new Map<string, Function>();\n }\n\n return g[REGISTRY_SYMBOL];\n}\n\nconst classes = getRegistry();\n\nexport function getClassName(target: Function): string | undefined {\n if (___NS__isNil(target)) {\n return void 0;\n }\n if (___NS__isString(target)) {\n return target;\n }\n\n if (target === Date) {\n return 'Date';\n }\n\n if ((target as any) === FormData) {\n return 'FormData';\n }\n\n if (!___NS__isFunction(target)) {\n // console.log(target);\n Helpers__NS__log(\n `[typescript-class-helpers][getClassName] target is not a class`,\n );\n return void 0;\n }\n\n if (!___NS__isNil(target[CoreModels__NS__ClassNameStaticProperty])) {\n return target[CoreModels__NS__ClassNameStaticProperty];\n }\n\n // special thing when cloning classes\n if (target.name?.startsWith('class_')) {\n return '';\n }\n\n return;\n}\n\nexport function getFromObject(o: Object) {\n if (___NS__isUndefined(o) || ___NS__isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n}\n\nconst notAllowedAsMethodName = [\n 'length',\n 'name',\n 'arguments',\n 'caller',\n 'constructor',\n 'apply',\n 'bind',\n 'call',\n 'toString',\n '__defineGetter__',\n '__defineSetter__',\n 'hasOwnProperty',\n '__lookupGetter__',\n '__lookupSetter__',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n '__proto__',\n 'toLocaleString',\n];\n\n//namespace CLASS\n\n /**\n * PLEASE PROVIDE NAME AS TYPED STRING, NOT VARIABLE\n * Decorator requred for production mode\n * @param name Name of class\n */\n export function CLASS__NS__NAME(className: string) {\n return function (target: Function) {\n return CLASS__NS__setClassName(target, className);\n } as any;\n }\n\n export function CLASS__NS__setName(target: Function, className: string) {\n CLASS__NS__setClassName(target, className);\n }\n\n export function CLASS__NS__getClassNameFromObjInstanceOrClassFn(\n target: any,\n ): string | undefined {\n if (typeof target === 'object') {\n return CLASS__NS__getNameFromObject(target);\n }\n return getClassName(target);\n }\n\n export function CLASS__NS__setClassName(target: Function, className: string): void {\n target[CoreModels__NS__ClassNameStaticProperty] = className;\n classes.set(className, target);\n }\n export function CLASS__NS__getBy(className: string | Function): Function {\n let res;\n if (Array.isArray(className)) {\n if (className.length !== 1) {\n throw `Mapping error... please use proper class names:\n {\n propertyObject: 'MyClassName',\n propertyWithArray: ['MyClassName']\n }\n\n `;\n }\n className = className[0];\n }\n if (typeof className === 'function') {\n // TODO QUICK_FIX\n res = className;\n }\n if (className === 'Date') {\n res = Date;\n }\n\n if (className === 'FormData') {\n res = FormData;\n }\n\n const classFromMap = classes.get(className as string);\n return classFromMap ? classFromMap : res;\n }\n\n export function CLASS__NS__getFromObject(o: Object): Function | undefined{\n if (___NS__isUndefined(o) || ___NS__isNull(o)) {\n return;\n }\n if (o.constructor) {\n return o.constructor;\n }\n const p = Object.getPrototypeOf(o);\n return p && p.constructor;\n }\n\n export function CLASS__NS__getName(target: Function): string | undefined {\n return getClassName(target) as string;\n }\n export function CLASS__NS__getNameFromObject(o: Object): string | undefined {\n const fnCLass = CLASS__NS__getFromObject(o);\n return CLASS__NS__getName(fnCLass);\n }\n\n export const CLASS__NS__getMethodsNames = (\n classOrClassInstance: any,\n allMethodsNames = [],\n ): string[] => {\n if (!classOrClassInstance) {\n return allMethodsNames;\n }\n\n const isClassFunction = ___NS__isFunction(classOrClassInstance);\n const classFun = isClassFunction\n ? classOrClassInstance\n : Object.getPrototypeOf(classOrClassInstance);\n const objectToCheck = isClassFunction\n ? (classOrClassInstance as Function)?.prototype\n : classOrClassInstance;\n const prototypeObj = Object.getPrototypeOf(objectToCheck || {});\n\n const properties = ___NS__uniq([\n ...Object.getOwnPropertyNames(objectToCheck || {}),\n ...Object.getOwnPropertyNames(prototypeObj || {}),\n ...Object.keys(objectToCheck || {}),\n ...Object.keys(prototypeObj || {}),\n ]).filter(f => !!f && !notAllowedAsMethodName.includes(f));\n\n properties\n .filter(methodName => typeof objectToCheck[methodName] === 'function')\n .forEach(p => allMethodsNames.push(p));\n\n if (\n !classFun ||\n !classFun.constructor ||\n classFun?.constructor?.name === 'Object'\n ) {\n return allMethodsNames;\n }\n return CLASS__NS__getMethodsNames(Object.getPrototypeOf(classFun), allMethodsNames);\n };\n\n//end of namespace CLASS","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AAIA,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC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YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,aAAa,IAAI,EAAE,CAAC;IAE/D,MAAM,UAAU,GAAG,WAAW,CAAC;AAC7B,QAAA,GAAG,MAAM,CAAC,mBAAmB,CAAC,aAAa,IAAI,EAAE,CAAC;AAClD,QAAA,GAAG,MAAM,CAAC,mBAAmB,CAAC,YAAY,IAAI,EAAE,CAAC;AACjD,QAAA,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC;AACnC,QAAA,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;AACnC,KAAA,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE1D;AACG,SAAA,MAAM,CAAC,UAAU,IAAI,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,UAAU;AACpE,SAAA,OAAO,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAExC,IAAA,IACE,CAAC,QAAQ;QACT,CAAC,QAAQ,CAAC,WAAW;AACrB,QAAA,QAAQ,EAAE,WAAW,EAAE,IAAI,KAAK,QAAQ,EACxC;AACA,QAAA,OAAO,eAAe;IACxB;IACA,OAAO,0BAA0B,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;AACrF;AAEF;;AC9MA;;AAEG;;;;"}
|
package/websql-prod/package.json
CHANGED
|
@@ -11,8 +11,9 @@ declare function CLASS__NS__setName(target: Function, className: string): void;
|
|
|
11
11
|
declare function CLASS__NS__getClassNameFromObjInstanceOrClassFn(target: any): string | undefined;
|
|
12
12
|
declare function CLASS__NS__setClassName(target: Function, className: string): void;
|
|
13
13
|
declare function CLASS__NS__getBy(className: string | Function): Function;
|
|
14
|
+
declare function CLASS__NS__getFromObject(o: Object): Function | undefined;
|
|
14
15
|
declare function CLASS__NS__getName(target: Function): string | undefined;
|
|
15
16
|
declare function CLASS__NS__getNameFromObject(o: Object): string | undefined;
|
|
16
17
|
declare const CLASS__NS__getMethodsNames: (classOrClassInstance: any, allMethodsNames?: any[]) => string[];
|
|
17
18
|
|
|
18
|
-
export { CLASS__NS__NAME, CLASS__NS__getBy, CLASS__NS__getClassNameFromObjInstanceOrClassFn, CLASS__NS__getMethodsNames, CLASS__NS__getName, CLASS__NS__getNameFromObject, CLASS__NS__setClassName, CLASS__NS__setName, getClassName, getFromObject };
|
|
19
|
+
export { CLASS__NS__NAME, CLASS__NS__getBy, CLASS__NS__getClassNameFromObjInstanceOrClassFn, CLASS__NS__getFromObject, CLASS__NS__getMethodsNames, CLASS__NS__getName, CLASS__NS__getNameFromObject, CLASS__NS__setClassName, CLASS__NS__setName, getClassName, getFromObject };
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"CLASS.getClassNameFromObjInstanceOrClassFn": "CLASS__NS__getClassNameFromObjInstanceOrClassFn",
|
|
6
6
|
"CLASS.setClassName": "CLASS__NS__setClassName",
|
|
7
7
|
"CLASS.getBy": "CLASS__NS__getBy",
|
|
8
|
+
"CLASS.getFromObject": "CLASS__NS__getFromObject",
|
|
8
9
|
"CLASS.getName": "CLASS__NS__getName",
|
|
9
10
|
"CLASS.getNameFromObject": "CLASS__NS__getNameFromObject",
|
|
10
11
|
"CLASS.getMethodsNames": "CLASS__NS__getMethodsNames"
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
"CLASS__NS__NAME",
|
|
15
16
|
"CLASS__NS__getBy",
|
|
16
17
|
"CLASS__NS__getClassNameFromObjInstanceOrClassFn",
|
|
18
|
+
"CLASS__NS__getFromObject",
|
|
17
19
|
"CLASS__NS__getMethodsNames",
|
|
18
20
|
"CLASS__NS__getName",
|
|
19
21
|
"CLASS__NS__getNameFromObject",
|