Socket
Socket
Sign inDemoInstall

token-types

Package Overview
Dependencies
Maintainers
1
Versions
39
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 4.1.1 to 5.0.0-alpha.0

1

lib/index.d.ts
/// <reference types="node" />
import { IToken, IGetToken } from '@tokenizer/token';
import { Buffer } from 'node:buffer';
/**

@@ -4,0 +5,0 @@ * 8-bit unsigned integer

77

lib/index.js

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AnsiStringType = exports.StringType = exports.BufferType = exports.Uint8ArrayType = exports.IgnoreType = exports.Float80_LE = exports.Float80_BE = exports.Float64_LE = exports.Float64_BE = exports.Float32_LE = exports.Float32_BE = exports.Float16_LE = exports.Float16_BE = exports.INT64_BE = exports.UINT64_BE = exports.INT64_LE = exports.UINT64_LE = exports.INT32_LE = exports.INT32_BE = exports.INT24_BE = exports.INT24_LE = exports.INT16_LE = exports.INT16_BE = exports.INT8 = exports.UINT32_BE = exports.UINT32_LE = exports.UINT24_BE = exports.UINT24_LE = exports.UINT16_BE = exports.UINT16_LE = exports.UINT8 = void 0;
const ieee754 = require("ieee754");
import * as ieee754 from 'ieee754';
import { Buffer } from 'node:buffer';
// Primitive types

@@ -12,3 +10,3 @@ function dv(array) {

*/
exports.UINT8 = {
export const UINT8 = {
len: 1,

@@ -26,3 +24,3 @@ get(array, offset) {

*/
exports.UINT16_LE = {
export const UINT16_LE = {
len: 2,

@@ -40,3 +38,3 @@ get(array, offset) {

*/
exports.UINT16_BE = {
export const UINT16_BE = {
len: 2,

@@ -54,3 +52,3 @@ get(array, offset) {

*/
exports.UINT24_LE = {
export const UINT24_LE = {
len: 3,

@@ -71,3 +69,3 @@ get(array, offset) {

*/
exports.UINT24_BE = {
export const UINT24_BE = {
len: 3,

@@ -88,3 +86,3 @@ get(array, offset) {

*/
exports.UINT32_LE = {
export const UINT32_LE = {
len: 4,

@@ -102,3 +100,3 @@ get(array, offset) {

*/
exports.UINT32_BE = {
export const UINT32_BE = {
len: 4,

@@ -116,3 +114,3 @@ get(array, offset) {

*/
exports.INT8 = {
export const INT8 = {
len: 1,

@@ -130,3 +128,3 @@ get(array, offset) {

*/
exports.INT16_BE = {
export const INT16_BE = {
len: 2,

@@ -144,3 +142,3 @@ get(array, offset) {

*/
exports.INT16_LE = {
export const INT16_LE = {
len: 2,

@@ -158,6 +156,6 @@ get(array, offset) {

*/
exports.INT24_LE = {
export const INT24_LE = {
len: 3,
get(array, offset) {
const unsigned = exports.UINT24_LE.get(array, offset);
const unsigned = UINT24_LE.get(array, offset);
return unsigned > 0x7fffff ? unsigned - 0x1000000 : unsigned;

@@ -175,6 +173,6 @@ },

*/
exports.INT24_BE = {
export const INT24_BE = {
len: 3,
get(array, offset) {
const unsigned = exports.UINT24_BE.get(array, offset);
const unsigned = UINT24_BE.get(array, offset);
return unsigned > 0x7fffff ? unsigned - 0x1000000 : unsigned;

@@ -192,3 +190,3 @@ },

*/
exports.INT32_BE = {
export const INT32_BE = {
len: 4,

@@ -206,3 +204,3 @@ get(array, offset) {

*/
exports.INT32_LE = {
export const INT32_LE = {
len: 4,

@@ -220,3 +218,3 @@ get(array, offset) {

*/
exports.UINT64_LE = {
export const UINT64_LE = {
len: 8,

@@ -234,3 +232,3 @@ get(array, offset) {

*/
exports.INT64_LE = {
export const INT64_LE = {
len: 8,

@@ -248,3 +246,3 @@ get(array, offset) {

*/
exports.UINT64_BE = {
export const UINT64_BE = {
len: 8,

@@ -262,3 +260,3 @@ get(array, offset) {

*/
exports.INT64_BE = {
export const INT64_BE = {
len: 8,

@@ -276,3 +274,3 @@ get(array, offset) {

*/
exports.Float16_BE = {
export const Float16_BE = {
len: 2,

@@ -290,3 +288,3 @@ get(dataView, offset) {

*/
exports.Float16_LE = {
export const Float16_LE = {
len: 2,

@@ -304,3 +302,3 @@ get(array, offset) {

*/
exports.Float32_BE = {
export const Float32_BE = {
len: 4,

@@ -318,3 +316,3 @@ get(array, offset) {

*/
exports.Float32_LE = {
export const Float32_LE = {
len: 4,

@@ -332,3 +330,3 @@ get(array, offset) {

*/
exports.Float64_BE = {
export const Float64_BE = {
len: 8,

@@ -346,3 +344,3 @@ get(array, offset) {

*/
exports.Float64_LE = {
export const Float64_LE = {
len: 8,

@@ -360,3 +358,3 @@ get(array, offset) {

*/
exports.Float80_BE = {
export const Float80_BE = {
len: 10,

@@ -374,3 +372,3 @@ get(array, offset) {

*/
exports.Float80_LE = {
export const Float80_LE = {
len: 10,

@@ -388,3 +386,3 @@ get(array, offset) {

*/
class IgnoreType {
export class IgnoreType {
/**

@@ -400,4 +398,3 @@ * @param len number of bytes to ignore

}
exports.IgnoreType = IgnoreType;
class Uint8ArrayType {
export class Uint8ArrayType {
constructor(len) {

@@ -410,4 +407,3 @@ this.len = len;

}
exports.Uint8ArrayType = Uint8ArrayType;
class BufferType {
export class BufferType {
constructor(len) {

@@ -420,7 +416,6 @@ this.len = len;

}
exports.BufferType = BufferType;
/**
* Consume a fixed number of bytes from the stream and return a string with a specified encoding.
*/
class StringType {
export class StringType {
constructor(len, encoding) {

@@ -434,3 +429,2 @@ this.len = len;

}
exports.StringType = StringType;
/**

@@ -440,3 +434,3 @@ * ANSI Latin 1 String

*/
class AnsiStringType {
export class AnsiStringType {
constructor(len) {

@@ -478,3 +472,2 @@ this.len = len;

}
exports.AnsiStringType = AnsiStringType;
AnsiStringType.windows1252 = [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352,

@@ -481,0 +474,0 @@ 8249, 338, 141, 381, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732,

{
"name": "token-types",
"version": "4.1.1",
"version": "5.0.0-alpha.0",
"description": "Common token types for decoding and encoding numeric and string values",

@@ -22,8 +22,9 @@ "author": {

"lint": "npm run lint-ts && npm run lint-md",
"test": "mocha --require ts-node/register --require source-map-support/register --full-trace --recursive test/test-*.ts",
"test-coverage": "nyc npm run test",
"coveralls": "npm run test-coverage && nyc report --reporter=text-lcov | coveralls"
"test": "mocha",
"test-coverage": "c8 npm run test",
"send-codacy": "c8 report --reports-dir=./.coverage --reporter=text-lcov | codacy-coverage",
"send-coveralls": "c8 report --reporter=text-lcov | coveralls"
},
"engines": {
"node": ">=10"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},

@@ -39,3 +40,10 @@ "repository": {

"license": "MIT",
"main": "lib/index.js",
"type": "module",
"exports": {
".": {
"node": "./lib/index.js",
"default": "./lib/core.js"
},
"./core": "./lib/core.js"
},
"types": "lib/index.d.ts",

@@ -46,19 +54,18 @@ "bugs": {

"devDependencies": {
"@types/chai": "^4.2.21",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"@types/node": "^16.4.6",
"@types/node": "^16.11.12",
"chai": "^4.3.4",
"coveralls": "^3.1.1",
"del-cli": "^4.0.1",
"mocha": "^9.0.3",
"nyc": "^15.1.0",
"remark-cli": "^9.0.0",
"remark-preset-lint-recommended": "^5.0.0",
"source-map-support": "^0.5.19",
"ts-node": "^10.1.0",
"mocha": "^9.1.3",
"remark-cli": "^10.0.1",
"remark-preset-lint-recommended": "^6.1.2",
"ts-node": "^10.4.0",
"tslint": "^6.1.3",
"typescript": "^4.3.5"
"typescript": "^4.5.4"
},
"dependencies": {
"@tokenizer/token": "^0.3.0",
"c8": "^7.10.0",
"ieee754": "^1.2.1"

@@ -71,18 +78,2 @@ },

},
"nyc": {
"exclude": [
"test/**/*.ts",
"lib/**/*.*.js"
],
"extension": [
".ts"
],
"sourceMap": true,
"instrument": true,
"reporter": [
"lcov",
"text"
],
"report-dir": "coverage"
},
"keywords": [

@@ -89,0 +80,0 @@ "token",

@@ -0,0 +0,0 @@ ![Node.js CI](https://github.com/Borewit/token-types/workflows/Node.js%20CI/badge.svg)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc