Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

cborg

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cborg - npm Package Compare versions

Comparing version
4.5.1
to
4.5.2
+2
-0
CHANGELOG.md

@@ -0,1 +1,3 @@

## [4.5.2](https://github.com/rvagg/cborg/compare/v4.5.1...v4.5.2) (2026-01-20)
## [4.5.1](https://github.com/rvagg/cborg/compare/v4.5.0...v4.5.1) (2026-01-20)

@@ -2,0 +4,0 @@

+4
-3

@@ -95,2 +95,3 @@ import { decodeErrPrefix } from './common.js'

const useMaps = options.useMaps === true
const rejectDuplicateMapKeys = options.rejectDuplicateMapKeys === true
const obj = useMaps ? undefined : {}

@@ -110,8 +111,8 @@ const m = useMaps ? new Map() : undefined

}
if (useMaps !== true && typeof key !== 'string') {
if (!useMaps && typeof key !== 'string') {
throw new Error(`${decodeErrPrefix} non-string keys not supported (got ${typeof key})`)
}
if (options.rejectDuplicateMapKeys === true) {
if (rejectDuplicateMapKeys) {
// @ts-ignore
if ((useMaps && m.has(key)) || (!useMaps && (key in obj))) {
if ((useMaps && m.has(key)) || (!useMaps && Object.hasOwn(obj, key))) {
throw new Error(`${decodeErrPrefix} found repeat map key "${key}"`)

@@ -118,0 +119,0 @@ }

{
"name": "cborg",
"version": "4.5.1",
"version": "4.5.2",
"description": "Fast CBOR with a focus on strictness",

@@ -5,0 +5,0 @@ "main": "cborg.js",

Sorry, the diff of this file is not supported yet