@prisma/extension-accelerate
Advanced tools
Comparing version 0.0.0-experimental-c97eb6d to 0.0.0-experimental-ccb98ba
@@ -7,4 +7,5 @@ "use strict"; | ||
function withAccelerate() { | ||
return (0, extension_js_1.makeAccelerateExtension)(node_fetch_js_1.fetch); | ||
const fetch = "fetch" in globalThis ? globalThis.fetch : node_fetch_js_1.fetch; | ||
return (0, extension_js_1.makeAccelerateExtension)(fetch); | ||
} | ||
exports.withAccelerate = withAccelerate; |
@@ -7,5 +7,9 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
var _NodeHeaders_headers; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fetch = void 0; | ||
const node_https_1 = __importDefault(require("node:https")); | ||
/** | ||
@@ -23,6 +27,5 @@ * Imitates `fetch` via `https` to only suit our needs, it does nothing more. | ||
const { origin } = new URL(url); | ||
const https = await import("node:https"); | ||
return new Promise((resolve, reject) => { | ||
// we execute the https request and build a fetch response out of it | ||
const request = https.request(url, httpsOptions, (response) => { | ||
const request = node_https_1.default.request(url, httpsOptions, (response) => { | ||
const { statusCode = 200, headers: { location }, } = response; | ||
@@ -29,0 +32,0 @@ if (statusCode >= 301 && statusCode <= 399 && location) { |
import { makeAccelerateExtension } from "./extension.js"; | ||
import { fetch } from "./node-fetch.js"; | ||
import { fetch as nodeFetch } from "./node-fetch.js"; | ||
export function withAccelerate() { | ||
const fetch = "fetch" in globalThis ? globalThis.fetch : nodeFetch; | ||
return makeAccelerateExtension(fetch); | ||
} |
@@ -0,1 +1,2 @@ | ||
import https from "node:https"; | ||
/** | ||
@@ -13,3 +14,2 @@ * Imitates `fetch` via `https` to only suit our needs, it does nothing more. | ||
const { origin } = new URL(url); | ||
const https = await import("node:https"); | ||
return new Promise((resolve, reject) => { | ||
@@ -16,0 +16,0 @@ // we execute the https request and build a fetch response out of it |
{ | ||
"name": "@prisma/extension-accelerate", | ||
"type": "module", | ||
"version": "0.0.0-experimental-c97eb6d", | ||
"version": "0.0.0-experimental-ccb98ba", | ||
"description": "Prisma Client extension for Accelerate", | ||
@@ -12,2 +12,3 @@ "sideEffects": false, | ||
}, | ||
"import": "./dist/esm/entry.fetch.js", | ||
"require": "./dist/cjs/entry.fetch.js", | ||
@@ -14,0 +15,0 @@ "default": "./dist/esm/entry.fetch.js" |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
59466
1112