@xylabs/delay 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
16
  Base functionality used throughout XY Labs TypeScript/JavaScript libraries
18
17
 
19
- ## Documentation
18
+ ## API Documentation
19
+
20
+ **@xylabs/delay**
21
+
22
+ ***
23
+
24
+ ## Functions
25
+
26
+ - [delay](#functions/delay)
27
+
28
+ ### functions
29
+
30
+ ### <a id="delay"></a>delay
31
+
32
+ [**@xylabs/delay**](#../README)
33
+
34
+ ***
35
+
36
+ ```ts
37
+ function delay(ms): Promise<unknown>;
38
+ ```
39
+
40
+ ## Parameters
41
+
42
+ ### ms
43
+
44
+ `number`
45
+
46
+ ## Returns
47
+
48
+ `Promise`\<`unknown`\>
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/delay",
3
- "version": "4.13.19",
3
+ "version": "4.13.21",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "delay",
@@ -29,18 +29,24 @@
29
29
  "exports": {
30
30
  ".": {
31
31
  "types": "./dist/neutral/index.d.ts",
32
+ "source": "./src/index.ts",
32
33
  "default": "./dist/neutral/index.mjs"
33
34
  },
34
35
  "./package.json": "./package.json"
35
36
  },
36
37
  "module": "./dist/neutral/index.mjs",
38
+ "source": "./src/index.ts",
37
39
  "types": "./dist/neutral/index.d.ts",
40
+ "files": [
41
+ "dist",
42
+ "src"
43
+ ],
38
44
  "dependencies": {
39
- "@xylabs/timer": "^4.13.19"
45
+ "@xylabs/timer": "^4.13.21"
40
46
  },
41
47
  "devDependencies": {
42
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.27",
43
- "@xylabs/tsconfig": "^7.0.0-rc.27",
48
+ "@xylabs/ts-scripts-yarn3": "^7.0.0",
49
+ "@xylabs/tsconfig": "^7.0.0",
44
50
  "typescript": "^5.8.3",
45
51
  "vitest": "^3.2.4"
46
52
  },
@@ -0,0 +1,16 @@
1
+ import {
2
+ describe, expect, test,
3
+ } from 'vitest'
4
+
5
+ import { delay } from '../delay.ts'
6
+
7
+ describe('delay', () => {
8
+ test('checking happy path', async () => {
9
+ const testInterval = 500
10
+ const startTime = Date.now()
11
+ await delay(testInterval)
12
+ const passedTime = Date.now() - startTime
13
+ expect(passedTime).toBeGreaterThanOrEqual(testInterval)
14
+ expect(passedTime).toBeLessThan(testInterval * 1.05)
15
+ })
16
+ })
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