@c9up/chronos 0.1.6 → 0.1.7
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/dist/atlas.d.ts +8 -15
- package/dist/atlas.d.ts.map +1 -1
- package/dist/atlas.js +8 -15
- package/dist/atlas.js.map +1 -1
- package/index.darwin-arm64.node +0 -0
- package/index.darwin-x64.node +0 -0
- package/index.linux-arm64-gnu.node +0 -0
- package/index.linux-x64-gnu.node +0 -0
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
- package/src/atlas.ts +8 -15
package/dist/atlas.d.ts
CHANGED
|
@@ -80,21 +80,14 @@ import { DateTime } from "./DateTime.js";
|
|
|
80
80
|
* this adapter; configure your DB / driver to emit Z-suffixed strings or
|
|
81
81
|
* `Date` instances, or pre-process via `DateTime.fromSQL`.
|
|
82
82
|
*
|
|
83
|
-
* **
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* `
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* - **Adapter only**: drop `@column.dateTime({ autoCreate, autoUpdate })`
|
|
92
|
-
* and assign manually (e.g., in a model hook:
|
|
93
|
-
* `entity.createdAt = DateTime.now()`).
|
|
94
|
-
* - **`@column.dateTime({ ... })` only**: drop the adapter and manually
|
|
95
|
-
* wrap reads with `new DateTime(row.createdAt)` at the call site.
|
|
96
|
-
* The adapter does NOT silently coerce `Date` → `DateTime` because that
|
|
97
|
-
* would mask the inconsistency between the two mechanisms.
|
|
83
|
+
* **Auto-timestamps stack cleanly.** As of the atlas date-engine switch, atlas
|
|
84
|
+
* hydrates every `@column.date()` / `@column.dateTime()` to a Chronos `DateTime`
|
|
85
|
+
* by default and `@column.dateTime({ autoCreate, autoUpdate })` stamps
|
|
86
|
+
* `DateTime.now()` (not a JS `Date`). So tagging the same property with this
|
|
87
|
+
* adapter is redundant (the default already produces DateTime) and no longer
|
|
88
|
+
* throws — `prepare` receives a `DateTime`. Reach for this explicit adapter only
|
|
89
|
+
* when you want DateTime semantics on a column atlas would NOT treat as a date
|
|
90
|
+
* column (e.g. a plain `@Column()` storing a timestamp).
|
|
98
91
|
*
|
|
99
92
|
* The shape `{ prepare, consume }` is **passable directly** to `@Column(...)`:
|
|
100
93
|
* `@Column(dateTimeAtlasAdapter)` is identical to
|
package/dist/atlas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlas.d.ts","sourceRoot":"","sources":["../src/atlas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAsBzC
|
|
1
|
+
{"version":3,"file":"atlas.d.ts","sourceRoot":"","sources":["../src/atlas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAsBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,eAAO,MAAM,oBAAoB;iBACnB,OAAO,GAAG,QAAQ,GAAG,IAAI;mBAWvB,OAAO,GAAG,MAAM,GAAG,IAAI;EAUrC,CAAC"}
|
package/dist/atlas.js
CHANGED
|
@@ -101,21 +101,14 @@ function isDateTimeLike(value) {
|
|
|
101
101
|
* this adapter; configure your DB / driver to emit Z-suffixed strings or
|
|
102
102
|
* `Date` instances, or pre-process via `DateTime.fromSQL`.
|
|
103
103
|
*
|
|
104
|
-
* **
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* `
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* - **Adapter only**: drop `@column.dateTime({ autoCreate, autoUpdate })`
|
|
113
|
-
* and assign manually (e.g., in a model hook:
|
|
114
|
-
* `entity.createdAt = DateTime.now()`).
|
|
115
|
-
* - **`@column.dateTime({ ... })` only**: drop the adapter and manually
|
|
116
|
-
* wrap reads with `new DateTime(row.createdAt)` at the call site.
|
|
117
|
-
* The adapter does NOT silently coerce `Date` → `DateTime` because that
|
|
118
|
-
* would mask the inconsistency between the two mechanisms.
|
|
104
|
+
* **Auto-timestamps stack cleanly.** As of the atlas date-engine switch, atlas
|
|
105
|
+
* hydrates every `@column.date()` / `@column.dateTime()` to a Chronos `DateTime`
|
|
106
|
+
* by default and `@column.dateTime({ autoCreate, autoUpdate })` stamps
|
|
107
|
+
* `DateTime.now()` (not a JS `Date`). So tagging the same property with this
|
|
108
|
+
* adapter is redundant (the default already produces DateTime) and no longer
|
|
109
|
+
* throws — `prepare` receives a `DateTime`. Reach for this explicit adapter only
|
|
110
|
+
* when you want DateTime semantics on a column atlas would NOT treat as a date
|
|
111
|
+
* column (e.g. a plain `@Column()` storing a timestamp).
|
|
119
112
|
*
|
|
120
113
|
* The shape `{ prepare, consume }` is **passable directly** to `@Column(...)`:
|
|
121
114
|
* `@Column(dateTimeAtlasAdapter)` is identical to
|
package/dist/atlas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlas.js","sourceRoot":"","sources":["../src/atlas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,SAAS,cAAc,CAAC,KAAc;IACrC,IAAI,KAAK,YAAY,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,GAAG,GAAG,KAA8C,CAAC;IAC3D,OAAO,OAAO,GAAG,CAAC,KAAK,KAAK,UAAU,IAAI,OAAO,GAAG,CAAC,MAAM,K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AG,CAAC,CAAC,CAAC;QACrE,MAAM,IAAI,SAAS,CAClB,iGAAiG,OAAO,GAAG,EAAE,CAC7G,CAAC;IACH,CAAC;IACD,OAAO,CAAC,KAAc;QACrB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACvD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,SAAS,CAClB,mEAAmE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,IAAI;gBACtJ,gGAAgG,CACjG,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACD,CAAC,CAAC"}
|
package/index.darwin-arm64.node
CHANGED
|
Binary file
|
package/index.darwin-x64.node
CHANGED
|
Binary file
|
|
Binary file
|
package/index.linux-x64-gnu.node
CHANGED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/src/atlas.ts
CHANGED
|
@@ -102,21 +102,14 @@ function isDateTimeLike(value: unknown): value is DateTime {
|
|
|
102
102
|
* this adapter; configure your DB / driver to emit Z-suffixed strings or
|
|
103
103
|
* `Date` instances, or pre-process via `DateTime.fromSQL`.
|
|
104
104
|
*
|
|
105
|
-
* **
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* `
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* - **Adapter only**: drop `@column.dateTime({ autoCreate, autoUpdate })`
|
|
114
|
-
* and assign manually (e.g., in a model hook:
|
|
115
|
-
* `entity.createdAt = DateTime.now()`).
|
|
116
|
-
* - **`@column.dateTime({ ... })` only**: drop the adapter and manually
|
|
117
|
-
* wrap reads with `new DateTime(row.createdAt)` at the call site.
|
|
118
|
-
* The adapter does NOT silently coerce `Date` → `DateTime` because that
|
|
119
|
-
* would mask the inconsistency between the two mechanisms.
|
|
105
|
+
* **Auto-timestamps stack cleanly.** As of the atlas date-engine switch, atlas
|
|
106
|
+
* hydrates every `@column.date()` / `@column.dateTime()` to a Chronos `DateTime`
|
|
107
|
+
* by default and `@column.dateTime({ autoCreate, autoUpdate })` stamps
|
|
108
|
+
* `DateTime.now()` (not a JS `Date`). So tagging the same property with this
|
|
109
|
+
* adapter is redundant (the default already produces DateTime) and no longer
|
|
110
|
+
* throws — `prepare` receives a `DateTime`. Reach for this explicit adapter only
|
|
111
|
+
* when you want DateTime semantics on a column atlas would NOT treat as a date
|
|
112
|
+
* column (e.g. a plain `@Column()` storing a timestamp).
|
|
120
113
|
*
|
|
121
114
|
* The shape `{ prepare, consume }` is **passable directly** to `@Column(...)`:
|
|
122
115
|
* `@Column(dateTimeAtlasAdapter)` is identical to
|