@prisma/get-platform
Advanced tools
Comparing version
@@ -27,42 +27,2 @@ "use strict"; | ||
var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js"); | ||
var require_replace_string = (0, import_chunk_2ESYSVXG.__commonJS)({ | ||
"../../node_modules/.pnpm/replace-string@3.1.0/node_modules/replace-string/index.js"(exports, module2) { | ||
"use strict"; | ||
module2.exports = (string, needle, replacement, options = {}) => { | ||
if (typeof string !== "string") { | ||
throw new TypeError(`Expected input to be a string, got ${typeof string}`); | ||
} | ||
if (!(typeof needle === "string" && needle.length > 0) || !(typeof replacement === "string" || typeof replacement === "function")) { | ||
return string; | ||
} | ||
let result = ""; | ||
let matchCount = 0; | ||
let prevIndex = options.fromIndex > 0 ? options.fromIndex : 0; | ||
if (prevIndex > string.length) { | ||
return string; | ||
} | ||
while (true) { | ||
const index = options.caseInsensitive ? string.toLowerCase().indexOf(needle.toLowerCase(), prevIndex) : string.indexOf(needle, prevIndex); | ||
if (index === -1) { | ||
break; | ||
} | ||
matchCount++; | ||
const replaceStr = typeof replacement === "string" ? replacement : replacement( | ||
// If `caseInsensitive`` is enabled, the matched substring may be different from the needle. | ||
string.slice(index, index + needle.length), | ||
matchCount, | ||
string, | ||
index | ||
); | ||
const beginSlice = matchCount === 1 ? 0 : prevIndex; | ||
result += string.slice(beginSlice, index) + replaceStr; | ||
prevIndex = index + needle.length; | ||
} | ||
if (matchCount === 0) { | ||
return string; | ||
} | ||
return result + string.slice(prevIndex); | ||
}; | ||
} | ||
}); | ||
var require_ansi_regex = (0, import_chunk_2ESYSVXG.__commonJS)({ | ||
@@ -90,3 +50,2 @@ "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports, module2) { | ||
var path = (0, import_chunk_2ESYSVXG.__require)("path"); | ||
var replaceAll = require_replace_string(); | ||
var stripAnsi = require_strip_ansi(); | ||
@@ -109,6 +68,6 @@ var { binaryTargetRegex } = ((0, import_chunk_B23KD6U3.init_binaryTargetRegex)(), (0, import_chunk_2ESYSVXG.__toCommonJS)(import_chunk_B23KD6U3.binaryTargetRegex_exports)); | ||
const parentDir = path.dirname(path.dirname(path.dirname(__dirname))); | ||
return replaceAll(str, parentDir, ""); | ||
return str.replaceAll(parentDir, ""); | ||
} | ||
function normalizeToUnixPaths(str) { | ||
return replaceAll(str, path.sep, "/"); | ||
return str.replaceAll(path.sep, "/"); | ||
} | ||
@@ -115,0 +74,0 @@ function normalizeGitHubLinks(str) { |
{ | ||
"name": "@prisma/get-platform", | ||
"version": "6.5.0-integration-fix-e2e-prisma-config-2.9", | ||
"version": "6.5.0-integration-fix-export-index-js.1", | ||
"description": "This package is intended for Prisma's internal use", | ||
@@ -17,7 +17,7 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@codspeed/benchmark.js-plugin": "3.1.1", | ||
"@swc/core": "1.10.11", | ||
"@codspeed/benchmark.js-plugin": "4.0.0", | ||
"@swc/core": "1.11.5", | ||
"@swc/jest": "0.2.37", | ||
"@types/jest": "29.5.14", | ||
"@types/node": "18.19.31", | ||
"@types/node": "18.19.76", | ||
"benchmark": "2.1.4", | ||
@@ -31,3 +31,2 @@ "jest": "29.7.0", | ||
"kleur": "4.1.5", | ||
"replace-string": "3.1.0", | ||
"strip-ansi": "6.0.1", | ||
@@ -39,3 +38,3 @@ "tempy": "1.0.1", | ||
"dependencies": { | ||
"@prisma/debug": "6.5.0-integration-fix-e2e-prisma-config-2.9" | ||
"@prisma/debug": "6.5.0-integration-fix-export-index-js.1" | ||
}, | ||
@@ -42,0 +41,0 @@ "files": [ |
17
-5.56%615166
-0.28%17053
-0.24%+ Added
- Removed
Updated