@dabble/patches 0.5.0 → 0.5.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/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export { transformPatch } from './json-patch/transformPatch.js';
18
18
  export { JSONPatch, PathLike, WriteOptions } from './json-patch/JSONPatch.js';
19
19
  export { ApplyJSONPatchOptions, JSONPatchOpHandlerMap as JSONPatchCustomTypes, JSONPatchOp } from './json-patch/types.js';
20
20
  export { Branch, BranchStatus, Change, ChangeInput, ChangeMutator, EditableBranchMetadata, EditableVersionMetadata, ListChangesOptions, ListVersionsOptions, PatchesSnapshot, PatchesState, PathProxy, SyncingState, VersionMetadata } from './types.js';
21
+ export { clampTimestamp, createClientTimestamp, createServerTimestamp, extractTimezoneOffset, formatDateWithOffset, getLocalTimezoneOffset, parseTimestamp, timestampDiff } from './utils/dates.js';
21
22
  export { add } from './json-patch/ops/add.js';
22
23
  export { copy } from './json-patch/ops/copy.js';
23
24
  export { increment } from './json-patch/ops/increment.js';
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export * from "./data/change.js";
5
5
  export * from "./data/version.js";
6
6
  export * from "./event-signal.js";
7
7
  export * from "./json-patch/index.js";
8
+ export * from "./utils/dates.js";
8
9
  export {
9
10
  Delta
10
11
  };
@@ -42,11 +42,11 @@ declare function clampTimestamp(timestamp: string, limit: string): string;
42
42
  * Formats a Date with a specific timezone offset string.
43
43
  * The date is adjusted to display the correct local time for that offset.
44
44
  */
45
- declare function formatWithOffset(date: Date, offset: string): string;
45
+ declare function formatDateWithOffset(date: Date, offset: string): string;
46
46
  /**
47
47
  * Gets the local timezone offset string for the current environment.
48
48
  * Returns "+04:00", "-05:00", or "Z" for UTC.
49
49
  */
50
50
  declare function getLocalTimezoneOffset(): string;
51
51
 
52
- export { clampTimestamp, createClientTimestamp, createServerTimestamp, extractTimezoneOffset, formatWithOffset, getLocalTimezoneOffset, parseTimestamp, timestampDiff };
52
+ export { clampTimestamp, createClientTimestamp, createServerTimestamp, extractTimezoneOffset, formatDateWithOffset, getLocalTimezoneOffset, parseTimestamp, timestampDiff };
@@ -1,7 +1,7 @@
1
1
  import "../chunk-IZ2YBCUP.js";
2
2
  function createClientTimestamp() {
3
3
  const now = /* @__PURE__ */ new Date();
4
- return formatWithOffset(now, getLocalTimezoneOffset());
4
+ return formatDateWithOffset(now, getLocalTimezoneOffset());
5
5
  }
6
6
  function createServerTimestamp() {
7
7
  return (/* @__PURE__ */ new Date()).toISOString();
@@ -23,9 +23,9 @@ function clampTimestamp(timestamp, limit) {
23
23
  return timestamp;
24
24
  }
25
25
  const offset = extractTimezoneOffset(timestamp);
26
- return formatWithOffset(limitDate, offset);
26
+ return formatDateWithOffset(limitDate, offset);
27
27
  }
28
- function formatWithOffset(date, offset) {
28
+ function formatDateWithOffset(date, offset) {
29
29
  if (offset === "Z") {
30
30
  return date.toISOString();
31
31
  }
@@ -50,7 +50,7 @@ export {
50
50
  createClientTimestamp,
51
51
  createServerTimestamp,
52
52
  extractTimezoneOffset,
53
- formatWithOffset,
53
+ formatDateWithOffset,
54
54
  getLocalTimezoneOffset,
55
55
  parseTimestamp,
56
56
  timestampDiff
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dabble/patches",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Immutable JSON Patch implementation based on RFC 6902 supporting operational transformation and last-writer-wins",
5
5
  "author": "Jacob Wright <jacwright@gmail.com>",
6
6
  "bugs": {