@8ms/helpers 1.32.0 → 1.33.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "1.32.0",
4
+ "version": "1.33.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
@@ -1,9 +1,3 @@
1
- /**
2
- * Prevent too many connections
3
- * https://github.com/prisma/prisma/issues/1983#issuecomment-620621213
4
- * https://next-auth.js.org/schemas/adapters
5
- * Library: @prisma/client, prisma-query-log
6
- */
7
1
  type InitClient = {
8
2
  debug?: boolean;
9
3
  planetScale?: boolean;
@@ -1,26 +1,20 @@
1
1
  "use strict";
2
- /**
3
- * Prevent too many connections
4
- * https://github.com/prisma/prisma/issues/1983#issuecomment-620621213
5
- * https://next-auth.js.org/schemas/adapters
6
- * Library: @prisma/client, prisma-query-log
7
- */
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  global.prisma = null;
10
4
  const initClient = (props = {}) => {
11
5
  if (!global.prisma) {
12
- const { Client } = require("@planetscale/database");
13
6
  const { PrismaClient } = require("@prisma/client");
14
- const { PrismaPlanetScale } = require("@prisma/adapter-planetscale");
15
- const client = new Client({
16
- url: process.env.DATABASE_URL
17
- });
18
- let adapter;
19
- if (props?.planetScale) {
7
+ let adapter = null;
8
+ if (true === props?.planetScale) {
9
+ const { Client } = require("@planetscale/database");
10
+ const client = new Client({
11
+ url: process.env.DATABASE_URL
12
+ });
13
+ const { PrismaPlanetScale } = require("@prisma/adapter-planetscale");
20
14
  adapter = new PrismaPlanetScale(client);
21
15
  }
22
16
  // Show the full query if debugging
23
- if (props?.debug) {
17
+ if (true === props?.debug) {
24
18
  global.prisma = new PrismaClient({
25
19
  adapter,
26
20
  log: [