You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@sanity/export

Package Overview
Dependencies
Maintainers
114
Versions
1068
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/export - npm Package Compare versions

Comparing version
6.0.2
to
6.0.3
+5
-1
dist/util/streamHelpers.js
import { Transform } from 'node:stream';
import { StringDecoder } from 'node:string_decoder';
export function through(transformFn) {

@@ -49,6 +50,7 @@ return new Transform({

const splitRegex = /\r?\n/;
const decoder = new StringDecoder('utf8');
return new Transform({
objectMode: Boolean(transformFn),
transform(chunk, _encoding, callback) {
buffer += chunk.toString();
buffer += decoder.write(chunk);
const lines = buffer.split(splitRegex);

@@ -79,2 +81,4 @@ // Keep the last line in buffer as it might be incomplete

flush(callback) {
// Flush any remaining bytes from the decoder
buffer += decoder.end();
if (buffer.length === 0) {

@@ -81,0 +85,0 @@ callback();

+1
-1
MIT License
Copyright (c) 2025 - 2024 Sanity.io
Copyright (c) 2026 - 2024 Sanity.io

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

{
"name": "@sanity/export",
"version": "6.0.2",
"version": "6.0.3",
"description": "Export Sanity documents and assets",

@@ -5,0 +5,0 @@ "keywords": [

import {Transform, type TransformCallback, type Writable} from 'node:stream'
import {StringDecoder} from 'node:string_decoder'

@@ -69,2 +70,3 @@ type TransformFunction = (

const splitRegex = /\r?\n/
const decoder = new StringDecoder('utf8')

@@ -74,3 +76,3 @@ return new Transform({

transform(chunk: Buffer, _encoding: BufferEncoding, callback: TransformCallback) {
buffer += chunk.toString()
buffer += decoder.write(chunk)
const lines = buffer.split(splitRegex)

@@ -101,2 +103,5 @@

flush(callback: TransformCallback) {
// Flush any remaining bytes from the decoder
buffer += decoder.end()
if (buffer.length === 0) {

@@ -103,0 +108,0 @@ callback()

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet