@thi.ng/date 2.7.7 → 2.7.9

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**: 2024-03-13T14:04:31Z
3
+ - **Last updated**: 2024-03-18T08:40:00Z
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.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [2.7.9](https://github.com/thi-ng/umbrella/tree/@thi.ng/date@2.7.9) (2024-03-18)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update defFormat() internals ([cf5890c](https://github.com/thi-ng/umbrella/commit/cf5890c))
17
+
12
18
  ## [2.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/date@2.7.0) (2024-02-22)
13
19
 
14
20
  #### 🚀 Features
package/format.js CHANGED
@@ -154,10 +154,9 @@ const FORMATTERS = {
154
154
  const defFormat = (fmt) => (x = Date.now(), utc = false) => {
155
155
  let d = ensureDate(x);
156
156
  utc && (d = new Date(d.getTime() + d.getTimezoneOffset() * MINUTE));
157
- return fmt.map((x2) => {
158
- let fn;
159
- return isString(x2) ? x2.startsWith("\\") ? x2.substring(1) : (fn = FORMATTERS[x2]) ? fn(d, utc) : x2 : isFunction(x2) ? x2(d, utc) : x2;
160
- }).join("");
157
+ return fmt.map(
158
+ (x2) => isString(x2) ? x2.startsWith("\\") ? x2.substring(1) : FORMATTERS[x2]?.(d, utc) ?? x2 : isFunction(x2) ? x2(d, utc) : x2
159
+ ).join("");
161
160
  };
162
161
  const FMT_yyyyMMdd = defFormat(["yyyy", "-", "MM", "-", "dd"]);
163
162
  const FMT_yyyyMMdd_ALT = defFormat(["yyyy", "MM", "dd"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/date",
3
- "version": "2.7.7",
3
+ "version": "2.7.9",
4
4
  "description": "Datetime types, relative dates, math, iterators, composable formatters, locales",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@thi.ng/api": "^8.9.30",
40
- "@thi.ng/checks": "^3.5.3",
41
- "@thi.ng/strings": "^3.7.23"
40
+ "@thi.ng/checks": "^3.5.4",
41
+ "@thi.ng/strings": "^3.7.25"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@microsoft/api-extractor": "^7.42.3",
@@ -133,5 +133,5 @@
133
133
  "thi.ng": {
134
134
  "year": 2020
135
135
  },
136
- "gitHead": "7f3fcbd6c0462b0ce45afa141fe163d1f297fd51\n"
136
+ "gitHead": "4b3d4ab6ce373ca817ad780f679572169a9ed733\n"
137
137
  }