@thi.ng/checks 3.6.24 → 3.7.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-02-19T20:59:58Z
3
+ - **Last updated**: 2025-02-25T13:25:07Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -11,6 +11,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
11
11
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
12
12
  and/or version bumps of transitive dependencies.
13
13
 
14
+ ## [3.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/checks@3.7.0) (2025-02-21)
15
+
16
+ #### 🚀 Features
17
+
18
+ - add `isDarkMode()` ([c42a738](https://github.com/thi-ng/umbrella/commit/c42a738))
19
+
14
20
  ### [3.6.19](https://github.com/thi-ng/umbrella/tree/@thi.ng/checks@3.6.19) (2025-01-14)
15
21
 
16
22
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -49,6 +49,7 @@ Collection of 70+ type, feature & value checks.
49
49
  - [`isBlob`](https://docs.thi.ng/umbrella/checks/functions/isBlob.html)
50
50
  - [`isBoolean`](https://docs.thi.ng/umbrella/checks/functions/isBoolean.html)
51
51
  - [`isChrome`](https://docs.thi.ng/umbrella/checks/functions/isChrome.html)
52
+ - [`isDarkMode`](https://docs.thi.ng/umbrella/checks/functions/isDarkMode.html)
52
53
  - [`isDataURL`](https://docs.thi.ng/umbrella/checks/functions/isDataURL.html)
53
54
  - [`isDate`](https://docs.thi.ng/umbrella/checks/functions/isDate.html)
54
55
  - [`isEven`](https://docs.thi.ng/umbrella/checks/functions/isEven.html)
@@ -134,7 +135,7 @@ For Node.js REPL:
134
135
  const ch = await import("@thi.ng/checks");
135
136
  ```
136
137
 
137
- Package sizes (brotli'd, pre-treeshake): ESM: 1.65 KB
138
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.70 KB
138
139
 
139
140
  ## Dependencies
140
141
 
package/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export * from "./is-bigint.js";
20
20
  export * from "./is-blob.js";
21
21
  export * from "./is-boolean.js";
22
22
  export * from "./is-chrome.js";
23
+ export * from "./is-dark-mode.js";
23
24
  export * from "./is-data-url.js";
24
25
  export * from "./is-date.js";
25
26
  export * from "./is-even.js";
package/index.js CHANGED
@@ -20,6 +20,7 @@ export * from "./is-bigint.js";
20
20
  export * from "./is-blob.js";
21
21
  export * from "./is-boolean.js";
22
22
  export * from "./is-chrome.js";
23
+ export * from "./is-dark-mode.js";
23
24
  export * from "./is-data-url.js";
24
25
  export * from "./is-date.js";
25
26
  export * from "./is-even.js";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Browser only. Returns true if client has currently dark mode enabled. Always
3
+ * returns false if no global `window` object is available.
4
+ */
5
+ export declare const isDarkMode: () => boolean;
6
+ //# sourceMappingURL=is-dark-mode.d.ts.map
@@ -0,0 +1,4 @@
1
+ const isDarkMode = () => typeof window !== "undefined" ? window?.matchMedia?.("(prefers-color-scheme:dark)").matches ?? false : false;
2
+ export {
3
+ isDarkMode
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/checks",
3
- "version": "3.6.24",
3
+ "version": "3.7.1",
4
4
  "description": "Collection of 70+ type, feature & value checks",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -142,6 +142,9 @@
142
142
  "./is-chrome": {
143
143
  "default": "./is-chrome.js"
144
144
  },
145
+ "./is-dark-mode": {
146
+ "default": "./is-dark-mode.js"
147
+ },
145
148
  "./is-data-url": {
146
149
  "default": "./is-data-url.js"
147
150
  },
@@ -290,5 +293,5 @@
290
293
  "thi.ng": {
291
294
  "alias": "ch"
292
295
  },
293
- "gitHead": "bee617702ac61d093465b967f8f973dc566faa6b\n"
296
+ "gitHead": "5084790092321b8654373237225c5f428f092782\n"
294
297
  }