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

@platformatic/itc

Package Overview
Dependencies
Maintainers
9
Versions
261
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platformatic/itc - npm Package Compare versions

Comparing version
3.13.1
to
3.14.0
+60
-14
lib/index.js

@@ -100,11 +100,13 @@ import { Unpromise } from '@watchable/unpromise'

let sanitized
if (Buffer.isBuffer(data) || data instanceof Uint8Array) {
// This will convert as Uint8Array
return data
} else if (Array.isArray(data)) {
sanitized = []
}
for (const value of data) {
if (Array.isArray(data)) {
let sanitized = null
let needsSanitization = false
for (let i = 0; i < data.length; i++) {
const value = data[i]
const valueType = typeof value

@@ -114,22 +116,66 @@

if (valueType === 'function' || valueType === 'symbol') {
if (!needsSanitization) {
sanitized = data.slice(0, i)
needsSanitization = true
}
continue
}
sanitized.push(value && typeof value === 'object' ? sanitize(value, transferList) : value)
let sanitizedValue = value
if (value && typeof value === 'object') {
sanitizedValue = sanitize(value, transferList)
if (sanitizedValue !== value && !needsSanitization) {
sanitized = data.slice(0, i)
needsSanitization = true
}
}
if (needsSanitization) {
sanitized.push(sanitizedValue)
}
}
} else {
sanitized = {}
for (const [key, value] of Object.entries(data)) {
const valueType = typeof value
return needsSanitization ? sanitized : data
}
if (valueType === 'function' || valueType === 'symbol') {
continue
// Handle plain objects
let sanitized = null
let needsSanitization = false
for (const [key, value] of Object.entries(data)) {
const valueType = typeof value
if (valueType === 'function' || valueType === 'symbol') {
if (!needsSanitization) {
sanitized = {}
// Copy all previous properties
for (const [k] of Object.entries(data)) {
if (k === key) break
sanitized[k] = data[k]
}
needsSanitization = true
}
continue
}
sanitized[key] = value && typeof value === 'object' ? sanitize(value, transferList) : value
let sanitizedValue = value
if (value && typeof value === 'object') {
sanitizedValue = sanitize(value, transferList)
if (sanitizedValue !== value && !needsSanitization) {
sanitized = {}
// Copy all previous properties
for (const [k] of Object.entries(data)) {
if (k === key) break
sanitized[k] = data[k]
}
needsSanitization = true
}
}
if (needsSanitization) {
sanitized[key] = sanitizedValue
}
}
return sanitized
return needsSanitization ? sanitized : data
}

@@ -136,0 +182,0 @@

+1
-1
{
"name": "@platformatic/itc",
"version": "3.13.1",
"version": "3.14.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",