@xylabs/function-name 4.13.19 → 4.13.21

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,13 +12,41 @@
12
12
  [![snyk-badge][]][snyk-link]
13
13
  [![socket-badge][]][socket-link]
14
14
 
15
- Version: 4.13.15
16
15
 
17
- Primary SDK for using XYO Protocol 2.0
16
+ Base functionality used throughout XY Labs TypeScript/JavaScript libraries
18
17
 
19
- ## Documentation
18
+ ## API Documentation
19
+
20
+ **@xylabs/function-name**
21
+
22
+ ***
23
+
24
+ ## Functions
25
+
26
+ - [functionName](#functions/functionName)
27
+
28
+ ### functions
29
+
30
+ ### <a id="functionName"></a>functionName
31
+
32
+ [**@xylabs/function-name**](#../README)
33
+
34
+ ***
35
+
36
+ ```ts
37
+ function functionName(depth): string;
38
+ ```
39
+
40
+ ## Parameters
41
+
42
+ ### depth
43
+
44
+ `number` = `2`
45
+
46
+ ## Returns
47
+
48
+ `string`
20
49
 
21
- Coming Soon!
22
50
 
23
51
  Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
24
52
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xylabs/function-name",
3
- "version": "4.13.19",
4
- "description": "Primary SDK for using XYO Protocol 2.0",
3
+ "version": "4.13.21",
4
+ "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "function",
7
7
  "name",
@@ -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.21",
47
+ "@xylabs/typeof": "^4.13.21"
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