@xylabs/function-name 2.13.20 → 2.13.22
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/dist/browser/index.cjs +2 -2
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +2 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +2 -2
- package/dist/node/index.js.map +1 -1
- package/package.json +19 -8
- package/src/functionName.ts +2 -2
package/dist/browser/index.cjs
CHANGED
|
@@ -28,10 +28,10 @@ module.exports = __toCommonJS(src_exports);
|
|
|
28
28
|
var import_error = require("@xylabs/error");
|
|
29
29
|
var functionName = (depth = 2) => {
|
|
30
30
|
try {
|
|
31
|
-
throw Error();
|
|
31
|
+
throw new Error("Getting function name");
|
|
32
32
|
} catch (ex) {
|
|
33
33
|
return (0, import_error.handleError)(ex, (error) => {
|
|
34
|
-
let newIndex
|
|
34
|
+
let newIndex;
|
|
35
35
|
const stackParts = error.stack?.split("\n")[depth].split(" ");
|
|
36
36
|
const funcName = stackParts?.find((item, index) => {
|
|
37
37
|
if (item.length > 0 && item !== "at") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/functionName.ts"],"sourcesContent":["export * from './functionName'\n","import { handleError } from '@xylabs/error'\n\nexport const functionName = (depth = 2) => {\n try {\n throw Error()\n } catch (ex) {\n return handleError(ex, (error) => {\n let newIndex: number | undefined
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/functionName.ts"],"sourcesContent":["export * from './functionName'\n","import { handleError } from '@xylabs/error'\n\nexport const functionName = (depth = 2) => {\n try {\n throw new Error('Getting function name')\n } catch (ex) {\n return handleError(ex, (error) => {\n let newIndex: number | undefined\n const stackParts = error.stack?.split('\\n')[depth].split(' ')\n const funcName =\n stackParts?.find((item, index) => {\n if (item.length > 0 && item !== 'at') {\n //check if constructor\n if (item === 'new') {\n newIndex = index\n }\n return item\n }\n }) ?? '<unknown>'\n return newIndex ? `${funcName} ${stackParts?.[newIndex + 1]}` : funcName\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA4B;AAErB,IAAM,eAAe,CAAC,QAAQ,MAAM;AACzC,MAAI;AACF,UAAM,IAAI,MAAM,uBAAuB;AAAA,EACzC,SAAS,IAAI;AACX,eAAO,0BAAY,IAAI,CAAC,UAAU;AAChC,UAAI;AACJ,YAAM,aAAa,MAAM,OAAO,MAAM,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG;AAC5D,YAAM,WACJ,YAAY,KAAK,CAAC,MAAM,UAAU;AAChC,YAAI,KAAK,SAAS,KAAK,SAAS,MAAM;AAEpC,cAAI,SAAS,OAAO;AAClB,uBAAW;AAAA,UACb;AACA,iBAAO;AAAA,QACT;AAAA,MACF,CAAC,KAAK;AACR,aAAO,WAAW,GAAG,QAAQ,IAAI,aAAa,WAAW,CAAC,CAAC,KAAK;AAAA,IAClE,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/dist/browser/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { handleError } from "@xylabs/error";
|
|
3
3
|
var functionName = (depth = 2) => {
|
|
4
4
|
try {
|
|
5
|
-
throw Error();
|
|
5
|
+
throw new Error("Getting function name");
|
|
6
6
|
} catch (ex) {
|
|
7
7
|
return handleError(ex, (error) => {
|
|
8
|
-
let newIndex
|
|
8
|
+
let newIndex;
|
|
9
9
|
const stackParts = error.stack?.split("\n")[depth].split(" ");
|
|
10
10
|
const funcName = stackParts?.find((item, index) => {
|
|
11
11
|
if (item.length > 0 && item !== "at") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/functionName.ts"],"sourcesContent":["import { handleError } from '@xylabs/error'\n\nexport const functionName = (depth = 2) => {\n try {\n throw Error()\n } catch (ex) {\n return handleError(ex, (error) => {\n let newIndex: number | undefined
|
|
1
|
+
{"version":3,"sources":["../../src/functionName.ts"],"sourcesContent":["import { handleError } from '@xylabs/error'\n\nexport const functionName = (depth = 2) => {\n try {\n throw new Error('Getting function name')\n } catch (ex) {\n return handleError(ex, (error) => {\n let newIndex: number | undefined\n const stackParts = error.stack?.split('\\n')[depth].split(' ')\n const funcName =\n stackParts?.find((item, index) => {\n if (item.length > 0 && item !== 'at') {\n //check if constructor\n if (item === 'new') {\n newIndex = index\n }\n return item\n }\n }) ?? '<unknown>'\n return newIndex ? `${funcName} ${stackParts?.[newIndex + 1]}` : funcName\n })\n }\n}\n"],"mappings":";AAAA,SAAS,mBAAmB;AAErB,IAAM,eAAe,CAAC,QAAQ,MAAM;AACzC,MAAI;AACF,UAAM,IAAI,MAAM,uBAAuB;AAAA,EACzC,SAAS,IAAI;AACX,WAAO,YAAY,IAAI,CAAC,UAAU;AAChC,UAAI;AACJ,YAAM,aAAa,MAAM,OAAO,MAAM,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG;AAC5D,YAAM,WACJ,YAAY,KAAK,CAAC,MAAM,UAAU;AAChC,YAAI,KAAK,SAAS,KAAK,SAAS,MAAM;AAEpC,cAAI,SAAS,OAAO;AAClB,uBAAW;AAAA,UACb;AACA,iBAAO;AAAA,QACT;AAAA,MACF,CAAC,KAAK;AACR,aAAO,WAAW,GAAG,QAAQ,IAAI,aAAa,WAAW,CAAC,CAAC,KAAK;AAAA,IAClE,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/dist/node/index.cjs
CHANGED
|
@@ -28,11 +28,11 @@ module.exports = __toCommonJS(src_exports);
|
|
|
28
28
|
var import_error = require("@xylabs/error");
|
|
29
29
|
var functionName = (depth = 2) => {
|
|
30
30
|
try {
|
|
31
|
-
throw Error();
|
|
31
|
+
throw new Error("Getting function name");
|
|
32
32
|
} catch (ex) {
|
|
33
33
|
return (0, import_error.handleError)(ex, (error) => {
|
|
34
34
|
var _a;
|
|
35
|
-
let newIndex
|
|
35
|
+
let newIndex;
|
|
36
36
|
const stackParts = (_a = error.stack) == null ? void 0 : _a.split("\n")[depth].split(" ");
|
|
37
37
|
const funcName = (stackParts == null ? void 0 : stackParts.find((item, index) => {
|
|
38
38
|
if (item.length > 0 && item !== "at") {
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/functionName.ts"],"sourcesContent":["export * from './functionName'\n","import { handleError } from '@xylabs/error'\n\nexport const functionName = (depth = 2) => {\n try {\n throw Error()\n } catch (ex) {\n return handleError(ex, (error) => {\n let newIndex: number | undefined
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/functionName.ts"],"sourcesContent":["export * from './functionName'\n","import { handleError } from '@xylabs/error'\n\nexport const functionName = (depth = 2) => {\n try {\n throw new Error('Getting function name')\n } catch (ex) {\n return handleError(ex, (error) => {\n let newIndex: number | undefined\n const stackParts = error.stack?.split('\\n')[depth].split(' ')\n const funcName =\n stackParts?.find((item, index) => {\n if (item.length > 0 && item !== 'at') {\n //check if constructor\n if (item === 'new') {\n newIndex = index\n }\n return item\n }\n }) ?? '<unknown>'\n return newIndex ? `${funcName} ${stackParts?.[newIndex + 1]}` : funcName\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA4B;AAErB,IAAM,eAAe,CAAC,QAAQ,MAAM;AACzC,MAAI;AACF,UAAM,IAAI,MAAM,uBAAuB;AAAA,EACzC,SAAS,IAAI;AACX,eAAO,0BAAY,IAAI,CAAC,UAAU;AANtC;AAOM,UAAI;AACJ,YAAM,cAAa,WAAM,UAAN,mBAAa,MAAM,MAAM,OAAO,MAAM;AACzD,YAAM,YACJ,yCAAY,KAAK,CAAC,MAAM,UAAU;AAChC,YAAI,KAAK,SAAS,KAAK,SAAS,MAAM;AAEpC,cAAI,SAAS,OAAO;AAClB,uBAAW;AAAA,UACb;AACA,iBAAO;AAAA,QACT;AAAA,MACF,OAAM;AACR,aAAO,WAAW,GAAG,QAAQ,IAAI,yCAAa,WAAW,EAAE,KAAK;AAAA,IAClE,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/dist/node/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { handleError } from "@xylabs/error";
|
|
3
3
|
var functionName = (depth = 2) => {
|
|
4
4
|
try {
|
|
5
|
-
throw Error();
|
|
5
|
+
throw new Error("Getting function name");
|
|
6
6
|
} catch (ex) {
|
|
7
7
|
return handleError(ex, (error) => {
|
|
8
8
|
var _a;
|
|
9
|
-
let newIndex
|
|
9
|
+
let newIndex;
|
|
10
10
|
const stackParts = (_a = error.stack) == null ? void 0 : _a.split("\n")[depth].split(" ");
|
|
11
11
|
const funcName = (stackParts == null ? void 0 : stackParts.find((item, index) => {
|
|
12
12
|
if (item.length > 0 && item !== "at") {
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/functionName.ts"],"sourcesContent":["import { handleError } from '@xylabs/error'\n\nexport const functionName = (depth = 2) => {\n try {\n throw Error()\n } catch (ex) {\n return handleError(ex, (error) => {\n let newIndex: number | undefined
|
|
1
|
+
{"version":3,"sources":["../../src/functionName.ts"],"sourcesContent":["import { handleError } from '@xylabs/error'\n\nexport const functionName = (depth = 2) => {\n try {\n throw new Error('Getting function name')\n } catch (ex) {\n return handleError(ex, (error) => {\n let newIndex: number | undefined\n const stackParts = error.stack?.split('\\n')[depth].split(' ')\n const funcName =\n stackParts?.find((item, index) => {\n if (item.length > 0 && item !== 'at') {\n //check if constructor\n if (item === 'new') {\n newIndex = index\n }\n return item\n }\n }) ?? '<unknown>'\n return newIndex ? `${funcName} ${stackParts?.[newIndex + 1]}` : funcName\n })\n }\n}\n"],"mappings":";AAAA,SAAS,mBAAmB;AAErB,IAAM,eAAe,CAAC,QAAQ,MAAM;AACzC,MAAI;AACF,UAAM,IAAI,MAAM,uBAAuB;AAAA,EACzC,SAAS,IAAI;AACX,WAAO,YAAY,IAAI,CAAC,UAAU;AANtC;AAOM,UAAI;AACJ,YAAM,cAAa,WAAM,UAAN,mBAAa,MAAM,MAAM,OAAO,MAAM;AACzD,YAAM,YACJ,yCAAY,KAAK,CAAC,MAAM,UAAU;AAChC,YAAI,KAAK,SAAS,KAAK,SAAS,MAAM;AAEpC,cAAI,SAAS,OAAO;AAClB,uBAAW;AAAA,UACb;AACA,iBAAO;AAAA,QACT;AAAA,MACF,OAAM;AACR,aAAO,WAAW,GAAG,QAAQ,IAAI,yCAAa,WAAW,EAAE,KAAK;AAAA,IAClE,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/function-name",
|
|
3
3
|
"author": {
|
|
4
|
-
"email": "support@
|
|
5
|
-
"name": "
|
|
6
|
-
"url": "https://
|
|
4
|
+
"email": "support@xylabs.com",
|
|
5
|
+
"name": "XY Labs Development Team",
|
|
6
|
+
"url": "https://xylabs.com"
|
|
7
7
|
},
|
|
8
8
|
"bugs": {
|
|
9
9
|
"email": "support@xyo.network",
|
|
@@ -11,12 +11,15 @@
|
|
|
11
11
|
},
|
|
12
12
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@xylabs/error": "~2.13.
|
|
14
|
+
"@xylabs/error": "~2.13.22"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@xylabs/ts-scripts-yarn3": "^3.2.
|
|
18
|
-
"@xylabs/tsconfig": "^3.2.
|
|
19
|
-
"typescript": "^5.3.
|
|
17
|
+
"@xylabs/ts-scripts-yarn3": "^3.2.25",
|
|
18
|
+
"@xylabs/tsconfig": "^3.2.25",
|
|
19
|
+
"typescript": "^5.3.3"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
20
23
|
},
|
|
21
24
|
"exports": {
|
|
22
25
|
".": {
|
|
@@ -55,7 +58,15 @@
|
|
|
55
58
|
"type": "git",
|
|
56
59
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
57
60
|
},
|
|
61
|
+
"keywords": [
|
|
62
|
+
"function",
|
|
63
|
+
"name",
|
|
64
|
+
"xylabs",
|
|
65
|
+
"utility",
|
|
66
|
+
"typescript",
|
|
67
|
+
"esm"
|
|
68
|
+
],
|
|
58
69
|
"sideEffects": false,
|
|
59
|
-
"version": "2.13.
|
|
70
|
+
"version": "2.13.22",
|
|
60
71
|
"type": "module"
|
|
61
72
|
}
|
package/src/functionName.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { handleError } from '@xylabs/error'
|
|
|
2
2
|
|
|
3
3
|
export const functionName = (depth = 2) => {
|
|
4
4
|
try {
|
|
5
|
-
throw Error()
|
|
5
|
+
throw new Error('Getting function name')
|
|
6
6
|
} catch (ex) {
|
|
7
7
|
return handleError(ex, (error) => {
|
|
8
|
-
let newIndex: number | undefined
|
|
8
|
+
let newIndex: number | undefined
|
|
9
9
|
const stackParts = error.stack?.split('\n')[depth].split(' ')
|
|
10
10
|
const funcName =
|
|
11
11
|
stackParts?.find((item, index) => {
|