@netlify/blobs
Advanced tools
Comparing version
@@ -14,3 +14,2 @@ import { | ||
import { createReadStream, promises as fs } from "fs"; | ||
import { tmpdir } from "os"; | ||
import { dirname, join, relative, resolve, sep } from "path"; | ||
@@ -203,6 +202,6 @@ import { HTTPServer } from "@netlify/dev-utils"; | ||
const metadata = decodeMetadata(metadataHeader); | ||
const tempPath = join(tmpdir(), Math.random().toString()); | ||
const tempPath = join(dirname(dataPath), `.${Math.random().toString(36).slice(2)}`); | ||
const body = await req.arrayBuffer(); | ||
await fs.mkdir(dirname(dataPath), { recursive: true }); | ||
await fs.writeFile(tempPath, Buffer.from(body)); | ||
await fs.mkdir(dirname(dataPath), { recursive: true }); | ||
await fs.rename(tempPath, dataPath); | ||
@@ -209,0 +208,0 @@ if (metadata) { |
{ | ||
"name": "@netlify/blobs", | ||
"version": "10.0.3", | ||
"version": "10.0.4", | ||
"description": "TypeScript client for Netlify Blobs", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
122341
-0.01%2853
-0.07%