@fedify/sqlite 1.8.11 → 1.8.12

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/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/sqlite",
3
- "version": "1.8.11",
3
+ "version": "1.8.12",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./src/mod.ts",
package/dist/kv.js CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
 
4
- import { qi } from "./node_modules/.pnpm/@js-temporal_polyfill@0.5.1/node_modules/@js-temporal/polyfill/dist/index.esm.js";
5
4
  import { SqliteDatabase } from "#sqlite";
5
+ import { Temporal } from "@js-temporal/polyfill";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { isEqual } from "es-toolkit";
8
8
 
@@ -53,7 +53,7 @@ var SqliteKvStore = class SqliteKvStore {
53
53
  async get(key) {
54
54
  this.initialize();
55
55
  const encodedKey = this.#encodeKey(key);
56
- const now = qi.Now.instant().epochMilliseconds;
56
+ const now = Temporal.Now.instant().epochMilliseconds;
57
57
  const result = this.#db.prepare(`
58
58
  SELECT value
59
59
  FROM "${this.#tableName}"
@@ -70,7 +70,7 @@ var SqliteKvStore = class SqliteKvStore {
70
70
  if (value === void 0) return;
71
71
  const encodedKey = this.#encodeKey(key);
72
72
  const encodedValue = this.#encodeValue(value);
73
- const now = qi.Now.instant().epochMilliseconds;
73
+ const now = Temporal.Now.instant().epochMilliseconds;
74
74
  const expiresAt = options?.ttl !== void 0 ? now + options.ttl.total({ unit: "milliseconds" }) : null;
75
75
  this.#db.prepare(`INSERT INTO "${this.#tableName}" (key, value, created, expires)
76
76
  VALUES (?, ?, ?, ?)
@@ -98,7 +98,7 @@ var SqliteKvStore = class SqliteKvStore {
98
98
  async cas(key, expectedValue, newValue, options) {
99
99
  this.initialize();
100
100
  const encodedKey = this.#encodeKey(key);
101
- const now = qi.Now.instant().epochMilliseconds;
101
+ const now = Temporal.Now.instant().epochMilliseconds;
102
102
  const expiresAt = options?.ttl !== void 0 ? now + options.ttl.total({ unit: "milliseconds" }) : null;
103
103
  try {
104
104
  this.#db.exec("BEGIN IMMEDIATE");
@@ -156,7 +156,7 @@ var SqliteKvStore = class SqliteKvStore {
156
156
  logger.debug("Initialized the key–value store table {tableName}.", { tableName: this.#tableName });
157
157
  }
158
158
  #expire() {
159
- const now = qi.Now.instant().epochMilliseconds;
159
+ const now = Temporal.Now.instant().epochMilliseconds;
160
160
  this.#db.prepare(`
161
161
  DELETE FROM "${this.#tableName}"
162
162
  WHERE expires IS NOT NULL AND expires <= ?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/sqlite",
3
- "version": "1.8.11",
3
+ "version": "1.8.12",
4
4
  "description": "SQLite drivers for Fedify",
5
5
  "keywords": [
6
6
  "fedify",
@@ -47,14 +47,14 @@
47
47
  }
48
48
  },
49
49
  "dependencies": {
50
+ "@js-temporal/polyfill": "^0.5.1",
50
51
  "@logtape/logtape": "^1.0.0",
51
52
  "es-toolkit": "^1.31.0"
52
53
  },
53
54
  "peerDependencies": {
54
- "@fedify/fedify": "^1.8.11"
55
+ "@fedify/fedify": "^1.8.12"
55
56
  },
56
57
  "devDependencies": {
57
- "@js-temporal/polyfill": "^0.5.1",
58
58
  "@std/async": "npm:@jsr/std__async@^1.0.13",
59
59
  "tsdown": "^0.12.9",
60
60
  "typescript": "^5.8.3"
@@ -1,30 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
-
4
- //#region rolldown:runtime
5
- var __create = Object.create;
6
- var __defProp = Object.defineProperty;
7
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
- var __getOwnPropNames = Object.getOwnPropertyNames;
9
- var __getProtoOf = Object.getPrototypeOf;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __commonJS = (cb, mod) => function() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
16
- key = keys[i];
17
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: ((k) => from[k]).bind(null, key),
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
25
- value: mod,
26
- enumerable: true
27
- }) : target, mod));
28
-
29
- //#endregion
30
- export { __commonJS, __toESM };