@xylabs/delay 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
  Base functionality used throughout XY Labs TypeScript/JavaScript libraries
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/delay",
3
- "version": "4.13.19",
3
+ "version": "4.13.20",
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.20"
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