You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@netlify/blobs

Package Overview
Dependencies
Maintainers
18
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/blobs - npm Package Compare versions

Comparing version

to
5.0.0

3

dist/main.d.ts

@@ -9,3 +9,3 @@ import http from 'node:http';

type BlobInput = ReadableStream | string | ArrayBuffer | Blob;
type BlobInput = string | ArrayBuffer | Blob;
type Fetcher = typeof globalThis.fetch;

@@ -61,3 +61,2 @@ declare enum HTTPMethod {

etag?: string;
fresh: boolean;
metadata: Metadata;

@@ -64,0 +63,0 @@ }

@@ -243,3 +243,3 @@ // src/environment.ts

const res = await this.client.makeRequest({ key, method: "delete" /* DELETE */, storeName: this.name });
if (res.status !== 200 && res.status !== 204 && res.status !== 404) {
if (![200, 202, 404].includes(res.status)) {
throw new BlobsInternalError(res.status);

@@ -304,7 +304,6 @@ }

etag: responseETag,
fresh: false,
metadata
};
if (res.status === 304 && requestETag) {
return { data: null, ...result, fresh: true };
return { data: null, ...result };
}

@@ -311,0 +310,0 @@ if (type === void 0 || type === "text") {

{
"name": "@netlify/blobs",
"version": "4.2.0",
"version": "5.0.0",
"description": "A JavaScript client for the Netlify Blob Store",

@@ -5,0 +5,0 @@ "type": "module",

@@ -224,5 +224,5 @@ [![Build](https://github.com/netlify/blobs/workflows/Build/badge.svg)](https://github.com/netlify/blobs/actions)

// have locally, which means the entry has changed since you last obtained it
const { data, etag, fresh } = await store.getWithMetadata('some-key', { etag: cachedETag })
const { data, etag } = await store.getWithMetadata('some-key', { etag: cachedETag })
if (fresh) {
if (etag === cachedETag) {
// `data` is `null` because the local blob is fresh

@@ -235,3 +235,3 @@ } else {

### `getMetadata(key: string, { etag?: string, type?: string }): Promise<{ data: any, etag: string, metadata: object }>`
### `getMetadata(key: string, { etag?: string, type?: string }): Promise<{ etag: string, metadata: object }>`

@@ -252,3 +252,3 @@ Retrieves any metadata associated with a given key and its

### `set(key: string, value: ArrayBuffer | Blob | ReadableStream | string, { metadata?: object }): Promise<void>`
### `set(key: string, value: ArrayBuffer | Blob | string, { metadata?: object }): Promise<void>`

@@ -277,3 +277,4 @@ Creates an object with the given key and value.

Deletes an object with the given key, if one exists.
Deletes an object with the given key, if one exists. The return value is always `undefined`, regardless of whether or
not there was an object to delete.

@@ -280,0 +281,0 @@ ```javascript

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet