@xylabs/function-name 4.13.18 → 4.13.20
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/README.md +1 -1
- package/package.json +13 -7
- package/src/spec/functionName.spec.ts +58 -0
- package/typedoc.json +0 -5
- package/types.d.ts +0 -3
- package/xy.config.ts +0 -10
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/function-name",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.20",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"function",
|
|
@@ -30,19 +30,25 @@
|
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
32
|
"types": "./dist/neutral/index.d.ts",
|
|
33
|
+
"source": "./src/index.ts",
|
|
33
34
|
"default": "./dist/neutral/index.mjs"
|
|
34
35
|
},
|
|
35
36
|
"./package.json": "./package.json"
|
|
36
37
|
},
|
|
37
|
-
"module": "dist/neutral/index.mjs",
|
|
38
|
-
"
|
|
38
|
+
"module": "./dist/neutral/index.mjs",
|
|
39
|
+
"source": "./src/index.ts",
|
|
40
|
+
"types": "./dist/neutral/index.d.ts",
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"src"
|
|
44
|
+
],
|
|
39
45
|
"dependencies": {
|
|
40
|
-
"@xylabs/error": "^4.13.
|
|
41
|
-
"@xylabs/typeof": "^4.13.
|
|
46
|
+
"@xylabs/error": "^4.13.20",
|
|
47
|
+
"@xylabs/typeof": "^4.13.20"
|
|
42
48
|
},
|
|
43
49
|
"devDependencies": {
|
|
44
|
-
"@xylabs/ts-scripts-yarn3": "^7.0.0
|
|
45
|
-
"@xylabs/tsconfig": "^7.0.0
|
|
50
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0",
|
|
51
|
+
"@xylabs/tsconfig": "^7.0.0",
|
|
46
52
|
"typescript": "^5.8.3",
|
|
47
53
|
"vitest": "^3.2.4"
|
|
48
54
|
},
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
describe, expect, test,
|
|
3
|
+
} from 'vitest'
|
|
4
|
+
|
|
5
|
+
import { functionName } from '../functionName.ts'
|
|
6
|
+
|
|
7
|
+
describe('Logger', () => {
|
|
8
|
+
test('getFunctionName:function', () => {
|
|
9
|
+
const test = () => {
|
|
10
|
+
return functionName()
|
|
11
|
+
}
|
|
12
|
+
const funcName = test()
|
|
13
|
+
expect(funcName).toBe('test')
|
|
14
|
+
})
|
|
15
|
+
test('getFunctionName:constructor', () => {
|
|
16
|
+
class Foo {
|
|
17
|
+
funcName: string
|
|
18
|
+
constructor() {
|
|
19
|
+
this.funcName = functionName()
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const foo = new Foo()
|
|
24
|
+
expect(foo.funcName).toBe('new Foo')
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
test('getFunctionName:method', () => {
|
|
28
|
+
class Foo {
|
|
29
|
+
funcName: string
|
|
30
|
+
constructor() {
|
|
31
|
+
this.funcName = this.test()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
test() {
|
|
35
|
+
return functionName()
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const foo = new Foo()
|
|
40
|
+
expect(foo.funcName).toBe('Foo.test')
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
test('getFunctionName:static', () => {
|
|
44
|
+
class Foo {
|
|
45
|
+
funcName: string
|
|
46
|
+
constructor() {
|
|
47
|
+
this.funcName = Foo.test()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static test() {
|
|
51
|
+
return functionName()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const foo = new Foo()
|
|
56
|
+
expect(foo.funcName).toBe('Function.test')
|
|
57
|
+
})
|
|
58
|
+
})
|
package/typedoc.json
DELETED
package/types.d.ts
DELETED