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

token-types

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

token-types - npm Package Compare versions

Comparing version
6.1.0
to
6.1.1
+1
-4
lib/index.d.ts
import type { IToken, IGetToken } from '@tokenizer/token';
/**
* 8-bit unsigned integer
*/
export declare const UINT8: IToken<number>;

@@ -128,3 +125,3 @@ /**

len: number;
private textDecoder;
private encoding?;
constructor(len: number, encoding?: string);

@@ -131,0 +128,0 @@ get(data: Uint8Array, offset?: number): string;

+4
-4
import * as ieee754 from 'ieee754';
import { TextDecoder } from "@kayahr/text-encoding";
import { textDecode } from "@borewit/text-codec";
// Primitive types

@@ -7,3 +7,3 @@ function dv(array) {

}
/**
/*
* 8-bit unsigned integer

@@ -387,7 +387,7 @@ */

this.len = len;
this.textDecoder = new TextDecoder(encoding);
this.encoding = encoding;
}
get(data, offset = 0) {
const bytes = data.subarray(offset, offset + this.len);
return this.textDecoder.decode(bytes);
return textDecode(bytes, this.encoding);
}

@@ -394,0 +394,0 @@ }

{
"name": "token-types",
"version": "6.1.0",
"version": "6.1.1",
"description": "Common token types for decoding and encoding numeric and string values",

@@ -61,3 +61,3 @@ "author": {

"dependencies": {
"@kayahr/text-encoding": "^2.0.1",
"@borewit/text-codec": "^0.1.0",
"@tokenizer/token": "^0.3.0",

@@ -64,0 +64,0 @@ "ieee754": "^1.2.1"

@@ -94,6 +94,4 @@ [![Node.js CI](https://github.com/Borewit/token-types/actions/workflows/nodejs-ci.yml/badge.svg?branch=master)](https://github.com/Borewit/token-types/actions/workflows/nodejs-ci.yml?query=branch%3Amaster)

StringType decoding is using [@kayahr/text-encoding](https://github.com/kayahr/text-encoding).
StringType decoding is using [@borewit/text-codec](https://github.com/Borewit/text-codec).
Check out [Supported encodings](https://github.com/kayahr/text-encoding?tab=readme-ov-file#supported-encodings) for a complete list.
### Custom tokens

@@ -100,0 +98,0 @@