@xylabs/function-name 4.13.19 → 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 CHANGED
@@ -12,7 +12,7 @@
12
12
  [![snyk-badge][]][snyk-link]
13
13
  [![socket-badge][]][socket-link]
14
14
 
15
- Version: 4.13.15
15
+ Version: 4.13.19
16
16
 
17
17
  Primary SDK for using XYO Protocol 2.0
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/function-name",
3
- "version": "4.13.19",
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
- "types": "dist/neutral/index.d.ts",
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.19",
41
- "@xylabs/typeof": "^4.13.19"
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-rc.27",
45
- "@xylabs/tsconfig": "^7.0.0-rc.27",
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
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://typedoc.org/schema.json",
3
- "entryPoints": ["./src/index.ts"],
4
- "tsconfig": "./tsconfig.typedoc.json"
5
- }
package/types.d.ts DELETED
@@ -1,3 +0,0 @@
1
- declare global {
2
- let console: Logger
3
- }
package/xy.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
- const config: XyTsupConfig = {
3
- compile: {
4
- browser: {},
5
- neutral: { src: true },
6
- node: {},
7
- },
8
- }
9
-
10
- export default config