clivly 0.25.0 → 0.25.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/drizzle.cjs CHANGED
@@ -330,6 +330,11 @@ function trackedWith(parts, sink) {
330
330
  }
331
331
  return out;
332
332
  }
333
+ /**
334
+ * A callable that is also an object, such as the postgres.js client behind
335
+ * `$client` with its `end()`. Wrapping it would lose everything but the call.
336
+ */
337
+ const carriesMembers = (value) => Object.keys(value).length > 0;
333
338
  function trackClient(db, reporter, emit) {
334
339
  const sink = (write) => emit([write]);
335
340
  const transaction = (original) => async (work, ...rest) => {
@@ -351,7 +356,7 @@ function trackClient(db, reporter, emit) {
351
356
  return new Proxy(db, { get(target, property) {
352
357
  const value = Reflect.get(target, property, target);
353
358
  if (USES_DATABASE.has(property) || WRITES.has(property)) reporter.noteActivity();
354
- if (typeof value !== "function") return value;
359
+ if (typeof value !== "function" || carriesMembers(value)) return value;
355
360
  const call = (...args) => value.apply(target, args);
356
361
  if (WRITES.has(property)) return trackWriteMethod(property, call, sink);
357
362
  switch (property) {
package/drizzle.mjs CHANGED
@@ -329,6 +329,11 @@ function trackedWith(parts, sink) {
329
329
  }
330
330
  return out;
331
331
  }
332
+ /**
333
+ * A callable that is also an object, such as the postgres.js client behind
334
+ * `$client` with its `end()`. Wrapping it would lose everything but the call.
335
+ */
336
+ const carriesMembers = (value) => Object.keys(value).length > 0;
332
337
  function trackClient(db, reporter, emit) {
333
338
  const sink = (write) => emit([write]);
334
339
  const transaction = (original) => async (work, ...rest) => {
@@ -350,7 +355,7 @@ function trackClient(db, reporter, emit) {
350
355
  return new Proxy(db, { get(target, property) {
351
356
  const value = Reflect.get(target, property, target);
352
357
  if (USES_DATABASE.has(property) || WRITES.has(property)) reporter.noteActivity();
353
- if (typeof value !== "function") return value;
358
+ if (typeof value !== "function" || carriesMembers(value)) return value;
354
359
  const call = (...args) => value.apply(target, args);
355
360
  if (WRITES.has(property)) return trackWriteMethod(property, call, sink);
356
361
  switch (property) {
package/kysely.cjs CHANGED
@@ -191,7 +191,7 @@ function trackClient(db, plugin, emit) {
191
191
  return (...args) => trackClient(change.apply(db, args), plugin, emit);
192
192
  }
193
193
  const value = Reflect.get(target, property, target);
194
- return typeof value === "function" && property !== "constructor" ? value.bind(target) : value;
194
+ return typeof value === "function" && property !== "constructor" && property !== "fn" ? value.bind(target) : value;
195
195
  } });
196
196
  }
197
197
  /**
package/kysely.mjs CHANGED
@@ -190,7 +190,7 @@ function trackClient(db, plugin, emit) {
190
190
  return (...args) => trackClient(change.apply(db, args), plugin, emit);
191
191
  }
192
192
  const value = Reflect.get(target, property, target);
193
- return typeof value === "function" && property !== "constructor" ? value.bind(target) : value;
193
+ return typeof value === "function" && property !== "constructor" && property !== "fn" ? value.bind(target) : value;
194
194
  } });
195
195
  }
196
196
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clivly",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Clivly CLI — scaffold a CRM into your app (clivly init).",