timeout-flow 0.0.18 → 0.0.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/package.json CHANGED
@@ -1,60 +1,75 @@
1
- {
2
- "name": "timeout-flow",
3
- "version": "0.0.18",
4
- "type": "module",
5
- "description": "Fluent, composable, pauseable JavaScript timers and time control flows — plus RAF utilities for frame-based logic.",
6
- "keywords": [
7
- "timeout",
8
- "interval",
9
- "flow",
10
- "raf",
11
- "animationframe",
12
- "debounce",
13
- "retry",
14
- "javascript",
15
- "timers",
16
- "throttle",
17
- "asynchronous",
18
- "control-flow",
19
- "utilities"
20
- ],
21
- "author": "DR.WATT",
22
- "license": "DR.WATT License v3.0",
23
- "repository": {
24
- "type": "git",
25
- "url": "git+https://github.com/iWhatty/TimeoutFlow-js.git"
26
- },
27
- "sideEffects": false,
28
- "main": "./dist/timeout-flow.min.js",
29
- "module": "./src/index.js",
30
- "browser": "./dist/timeout-flow.min.js",
31
- "exports": {
32
- ".": {
33
- "browser": {
34
- "import": "./dist/timeout-flow.min.js",
35
- "require": "./dist/timeout-flow.min.js"
36
- },
37
- "import": "./src/index.js",
38
- "require": "./dist/timeout-flow.min.js"
39
- }
40
- },
41
- "files": [
42
- "dist/",
43
- "src/",
44
- "types/",
45
- "robots.txt"
46
- ],
47
- "types": "./types/index.d.ts",
48
- "scripts": {
49
- "dev": "serve testing",
50
- "test:node": "node testing/node-harness.mjs",
51
- "build": "node build.js",
52
- "types": "tsc",
53
- "prepub": "npm run build && npm run types"
54
- },
55
- "devDependencies": {
56
- "esbuild": "^0.25.3",
57
- "serve": "^14.2.4",
58
- "typescript": "^5.8.3"
59
- }
1
+ {
2
+ "name": "timeout-flow",
3
+ "version": "0.0.20",
4
+ "type": "module",
5
+ "description": "Fluent, composable, pauseable JavaScript timers and time control flows, plus RAF utilities for frame-based logic.",
6
+ "keywords": [
7
+ "timeout",
8
+ "interval",
9
+ "flow",
10
+ "raf",
11
+ "animationframe",
12
+ "debounce",
13
+ "retry",
14
+ "javascript",
15
+ "timers",
16
+ "throttle",
17
+ "asynchronous",
18
+ "control-flow",
19
+ "utilities"
20
+ ],
21
+ "author": "WATT3D <WATT3D@protonmail.com>",
22
+ "license": "SEE LICENSE IN LICENSE",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/iWhatty/timeout-flow.git"
26
+ },
27
+ "sideEffects": false,
28
+ "engines": {
29
+ "node": ">=18"
30
+ },
31
+ "main": "./dist/timeout-flow.min.js",
32
+ "module": "./src/index.js",
33
+ "browser": "./dist/timeout-flow.min.js",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./types/index.d.ts",
37
+ "import": "./src/index.js",
38
+ "require": "./dist/timeout-flow.min.js",
39
+ "default": "./src/index.js"
40
+ },
41
+ "./after": "./src/after.js",
42
+ "./every": "./src/every.js",
43
+ "./debounce": "./src/debounce.js",
44
+ "./throttle": "./src/throttle.js",
45
+ "./sleep": "./src/sleep.js",
46
+ "./retry": "./src/retry.js",
47
+ "./wait-for": "./src/waitFor.js",
48
+ "./flow": "./src/TimeoutFlow.js",
49
+ "./parse-duration": "./src/parseDuration.js",
50
+ "./raf": "./src/raf/index.js",
51
+ "./min": "./dist/timeout-flow.min.js"
52
+ },
53
+ "files": [
54
+ "dist",
55
+ "src",
56
+ "types",
57
+ "robots.txt",
58
+ "ADDITIONAL_TERMS.md"
59
+ ],
60
+ "types": "./types/index.d.ts",
61
+ "scripts": {
62
+ "dev": "serve testing",
63
+ "test": "node --test testing/*.test.mjs && npm run build && npm run test:node",
64
+ "test:unit": "node --test testing/*.test.mjs",
65
+ "test:node": "node testing/node-harness.mjs",
66
+ "build": "node build.js",
67
+ "types": "tsc",
68
+ "prepub": "npm run build && npm run types"
69
+ },
70
+ "devDependencies": {
71
+ "esbuild": "^0.25.3",
72
+ "serve": "^14.2.4",
73
+ "typescript": "^5.8.3"
74
+ }
60
75
  }
package/robots.txt CHANGED
@@ -1,3 +1,79 @@
1
- User-agent: *
1
+ # WATT3D — AI scraping policy
2
+ #
3
+ # This file enumerates known AI / LLM training and inference crawlers
4
+ # that the WATT3D AI Training Rider does not consent to. See
5
+ # ./ADDITIONAL_TERMS.md for the legal scope and definitions.
6
+ #
7
+ # Honoring robots.txt is voluntary. The rider applies whether or not
8
+ # a bot respects this file. The enumeration is non-exhaustive — bots
9
+ # not listed here are still bound by the rider if they perform
10
+ # Training Use as defined in ADDITIONAL_TERMS.md §1.
11
+
12
+ User-agent: GPTBot
13
+ Disallow: /
14
+
15
+ User-agent: ChatGPT-User
16
+ Disallow: /
17
+
18
+ User-agent: OAI-SearchBot
19
+ Disallow: /
20
+
21
+ User-agent: anthropic-ai
22
+ Disallow: /
23
+
24
+ User-agent: ClaudeBot
25
+ Disallow: /
26
+
27
+ User-agent: Claude-Web
28
+ Disallow: /
29
+
30
+ User-agent: Claude-SearchBot
31
+ Disallow: /
32
+
33
+ User-agent: Google-Extended
34
+ Disallow: /
35
+
36
+ User-agent: Applebot-Extended
37
+ Disallow: /
38
+
39
+ User-agent: Meta-ExternalAgent
40
+ Disallow: /
41
+
42
+ User-agent: Meta-ExternalFetcher
2
43
  Disallow: /
3
- License: Dr.Watt v3.0
44
+
45
+ User-agent: FacebookBot
46
+ Disallow: /
47
+
48
+ User-agent: CCBot
49
+ Disallow: /
50
+
51
+ User-agent: PerplexityBot
52
+ Disallow: /
53
+
54
+ User-agent: Perplexity-User
55
+ Disallow: /
56
+
57
+ User-agent: cohere-ai
58
+ Disallow: /
59
+
60
+ User-agent: Bytespider
61
+ Disallow: /
62
+
63
+ User-agent: Amazonbot
64
+ Disallow: /
65
+
66
+ User-agent: Omgilibot
67
+ Disallow: /
68
+
69
+ User-agent: AI2Bot
70
+ Disallow: /
71
+
72
+ User-agent: Diffbot
73
+ Disallow: /
74
+
75
+ # Everyone else: full access. Search engines and human-driven crawlers
76
+ # remain welcome.
77
+
78
+ User-agent: *
79
+ Allow: /
package/src/TimerBase.js CHANGED
@@ -78,9 +78,10 @@ export class TimerBase {
78
78
  const rawDelay = overrideDelay ?? this.#remaining;
79
79
 
80
80
  // Reject invalid delays (avoid scheduling with NaN/Infinity/etc.)
81
- if (!Number.isFinite(rawDelay) || rawDelay < 0) return;
81
+ if (!Number.isFinite(rawDelay)) return;
82
82
 
83
- // Support 0ms timers (schedule next macrotask)
83
+ // Negative delays clamp to 0 like setTimeout (next macrotask)
84
+ // instead of silently never firing.
84
85
  const delay = Math.max(0, rawDelay);
85
86
 
86
87
  // Important: remaining must reflect what we actually scheduled,
package/src/abort.js CHANGED
@@ -72,4 +72,16 @@ export function pendingAbort(signal, onAbort) {
72
72
  cleanup = null;
73
73
  },
74
74
  };
75
- }
75
+ }
76
+
77
+ /**
78
+ * The error an aborted operation should reject with: the signal's own
79
+ * `reason` (what `fetch()` and other web APIs use), falling back to a
80
+ * standard AbortError for runtimes without `AbortSignal.reason`.
81
+ *
82
+ * @param {AbortSignal | null | undefined} signal
83
+ * @returns {any}
84
+ */
85
+ export function abortReason(signal) {
86
+ return signal?.reason ?? createAbortError();
87
+ }