@xh/hoist 77.0.0-SNAPSHOT.1761102084750 → 77.0.0-SNAPSHOT.1761141053211

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "77.0.0-SNAPSHOT.1761102084750",
3
+ "version": "77.0.0-SNAPSHOT.1761141053211",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
@@ -132,15 +132,15 @@ export function waitFor(
132
132
  condition: () => boolean,
133
133
  {interval = 50, timeout = 5 * SECONDS}: {interval?: number; timeout?: number} = {}
134
134
  ): Promise<void> {
135
- if (!isNumber(interval) || interval <= 0) throw new Error('Invalid interval');
136
- if (!isNumber(timeout) || timeout <= 0) throw new Error('Invalid timeout');
135
+ if (interval <= 0) throw new Error('Invalid interval');
136
+ if (timeout != null && timeout <= 0) throw new Error('Invalid timeout');
137
137
 
138
138
  const startTime = Date.now();
139
139
  return new Promise((resolve, reject) => {
140
140
  const resolveOnMet = () => {
141
141
  if (condition()) {
142
142
  resolve();
143
- } else if (olderThan(startTime, timeout)) {
143
+ } else if (timeout != null && olderThan(startTime, timeout)) {
144
144
  reject(Exception.timeout({interval: Date.now() - startTime}));
145
145
  } else {
146
146
  setTimeout(resolveOnMet, interval);