@greendrake/util 0.3.0 → 0.4.0
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 +1 -1
- package/package.json +2 -2
- package/src/browser.ts +3 -2
package/README.md
CHANGED
|
@@ -151,7 +151,7 @@ document.documentElement.dir = isRTLLocale(navigator.language) ? 'rtl' : 'ltr'
|
|
|
151
151
|
|
|
152
152
|
## DOM and geolocation
|
|
153
153
|
|
|
154
|
-
The `./browser` entry, apart from the rest because their types are the DOM lib's: a program that type-checks without it — a bun service reaching this package through
|
|
154
|
+
The `./browser` entry, apart from the rest because their types are the DOM lib's: a program that type-checks without it — a bun service reaching this package through a dependency — never compiles them. Importable in Node all the same; they touch `document`, `window` and `navigator` only when called.
|
|
155
155
|
|
|
156
156
|
- `getReadyStatePromise()` — resolves when `document.readyState` reaches `'complete'` (immediately if it already has); one shared promise per module instance.
|
|
157
157
|
- `hasFinePointer()` — `matchMedia('(hover: hover) and (pointer: fine)')`: true where the primary input is a mouse or trackpad rather than a finger. Serves as a proxy for "focusing a field will not raise an on-screen keyboard", which no platform exposes directly.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greendrake/util",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Framework-free, Node-safe utilities: typed event emitter, timing, retry, staleness, comparators, fetch helpers, misc",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Eugene Greendrake <eugene@greendrake.nz>",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"prettier": "@greendrake/dev-config/prettier",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@greendrake/dev-config": "0.
|
|
41
|
+
"@greendrake/dev-config": "0.4.0",
|
|
42
42
|
"typescript": "6.0.3"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/src/browser.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// The helpers that name the document, the window or the navigator. An entry of
|
|
2
2
|
// their own rather than part of the main one: a program that type-checks
|
|
3
|
-
// without the DOM lib — a bun service
|
|
4
|
-
// otherwise have to compile them, and fail to, for helpers
|
|
3
|
+
// without the DOM lib — a bun service reaching this package through a
|
|
4
|
+
// dependency — would otherwise have to compile them, and fail to, for helpers
|
|
5
|
+
// it never calls.
|
|
5
6
|
export { getReadyStatePromise, hasFinePointer, toggleFullscreen } from './dom'
|
|
6
7
|
export { getUserLocation, LOCATION_TIMEOUT_MS, LOCATION_MAX_AGE_MS, type UserLocation } from './geo'
|