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.5
to
4.5.6
+2
-0
CHANGELOG.md

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

## [4.5.6](https://github.com/rvagg/cborg/compare/v4.5.5...v4.5.6) (2026-01-21)
## [4.5.5](https://github.com/rvagg/cborg/compare/v4.5.4...v4.5.5) (2026-01-20)

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

+2
-2
import { Token, Type } from './token.js'
import { assertEnoughData, decodeErrPrefix } from './common.js'
import * as uint from './0uint.js'
import { compare, fromString, slice } from './byte-utils.js'
import { compare, fromString } from './byte-utils.js'

@@ -20,3 +20,3 @@ /**

assertEnoughData(data, pos, prefix + length)
const buf = slice(data, pos + prefix, pos + prefix + length)
const buf = data.slice(pos + prefix, pos + prefix + length)
return new Token(Type.bytes, buf, prefix + length)

@@ -23,0 +23,0 @@ }

@@ -5,3 +5,2 @@ import { Token, Type } from './token.js'

import { encodeBytes } from './2bytes.js'
import { slice } from './byte-utils.js'

@@ -56,3 +55,3 @@ const textDecoder = new TextDecoder()

if (options.retainStringBytes === true) {
tok.byteValue = slice(data, pos + prefix, pos + totLength)
tok.byteValue = data.slice(pos + prefix, pos + totLength)
}

@@ -59,0 +58,0 @@ return tok

import { decodeErrPrefix } from './common.js'
import { Type } from './token.js'
import { jump, quick } from './jump.js'
import { asU8A } from './byte-utils.js'

@@ -186,3 +187,5 @@ /**

options = Object.assign({}, defaultDecodeOptions, options)
const tokeniser = options.tokenizer || new Tokeniser(data, options)
// Convert Buffer to plain Uint8Array for faster slicing in decode path
const u8aData = asU8A(data)
const tokeniser = options.tokenizer || new Tokeniser(u8aData, options)
const decoded = tokensToObject(tokeniser, options)

@@ -189,0 +192,0 @@ if (decoded === DONE) {

{
"name": "cborg",
"version": "4.5.5",
"version": "4.5.6",
"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

Sorry, the diff of this file is not supported yet