Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 2.0.0 to 2.1.0

4

lib/index.d.ts

@@ -128,4 +128,4 @@ /// <reference types="node" />

len: number;
encoding: string;
constructor(len: number, encoding: string);
encoding: BufferEncoding;
constructor(len: number, encoding: BufferEncoding);
get(buf: Buffer, off: number): string;

@@ -132,0 +132,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
exports.writeIntBE = exports.readIntBE = exports.writeUIntBE = exports.readUIntBE = exports.writeIntLE = exports.AnsiStringType = exports.StringType = exports.BufferType = 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");

@@ -15,7 +15,2 @@ // Primitive types

put(buf, off, v) {
assert.equal(typeof off, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= 0 && v <= 0xff);
assert.ok(off >= 0);
assert.ok(this.len <= buf.length);
return buf.writeUInt8(v, off);

@@ -33,7 +28,2 @@ }

put(buf, off, v) {
assert.equal(typeof off, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= 0 && v <= 0xffff);
assert.ok(off >= 0);
assert.ok(this.len <= buf.length);
return buf.writeUInt16LE(v, off);

@@ -51,7 +41,2 @@ }

put(buf, off, v) {
assert.equal(typeof off, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= 0 && v <= 0xffff);
assert.ok(off >= 0);
assert.ok(this.len <= buf.length);
return buf.writeUInt16BE(v, off);

@@ -69,7 +54,2 @@ }

put(buf, off, v) {
assert.equal(typeof off, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= 0 && v <= 0xffffff);
assert.ok(off >= 0);
assert.ok(this.len <= buf.length);
return buf.writeUIntLE(v, off, 3);

@@ -87,7 +67,2 @@ }

put(buf, off, v) {
assert.equal(typeof off, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= 0 && v <= 0xffffff);
assert.ok(off >= 0);
assert.ok(this.len <= buf.length);
return buf.writeUIntBE(v, off, 3);

@@ -105,7 +80,2 @@ }

put(b, o, v) {
assert.equal(typeof o, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= 0 && v <= 0xffffffff);
assert.ok(o >= 0);
assert.ok(this.len <= b.length);
return b.writeUInt32LE(v, o);

@@ -123,7 +93,2 @@ }

put(buf, off, v) {
assert.equal(typeof off, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= 0 && v <= 0xffffffff);
assert.ok(off >= 0);
assert.ok(this.len <= buf.length);
return buf.writeUInt32BE(v, off);

@@ -141,7 +106,2 @@ }

put(buf, off, v) {
assert.equal(typeof off, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= -128 && v <= 127);
assert.ok(off >= 0);
assert.ok(this.len <= buf.length);
return buf.writeInt8(v, off);

@@ -159,7 +119,2 @@ }

put(b, o, v) {
assert.equal(typeof o, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= -32768 && v <= 32767);
assert.ok(o >= 0);
assert.ok(this.len <= b.length);
return b.writeInt16BE(v, o);

@@ -177,7 +132,2 @@ }

put(b, o, v) {
assert.equal(typeof o, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= -32768 && v <= 32767);
assert.ok(o >= 0);
assert.ok(this.len <= b.length);
return b.writeInt16LE(v, o);

@@ -195,7 +145,2 @@ }

put(b, o, v) {
assert.equal(typeof o, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= -0x800000 && v <= 0x7fffff);
assert.ok(o >= 0);
assert.ok(this.len <= b.length);
return b.writeIntLE(v, o, 3);

@@ -213,7 +158,2 @@ }

put(b, o, v) {
assert.equal(typeof o, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= -0x800000 && v <= 0x7fffff);
assert.ok(o >= 0);
assert.ok(this.len <= b.length);
return b.writeIntBE(v, o, 3);

@@ -231,7 +171,2 @@ }

put(b, o, v) {
assert.equal(typeof o, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= -2147483648 && v <= 2147483647);
assert.ok(o >= 0);
assert.ok(this.len <= b.length);
return b.writeInt32BE(v, o);

@@ -249,7 +184,2 @@ }

put(b, o, v) {
assert.equal(typeof o, 'number');
assert.equal(typeof v, 'number');
assert.ok(v >= -2147483648 && v <= 2147483647);
assert.ok(o >= 0);
assert.ok(this.len <= b.length);
return b.writeInt32LE(v, o);

@@ -256,0 +186,0 @@ }

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

@@ -9,2 +9,6 @@ "author": {

},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Borewit"
},
"scripts": {

@@ -36,3 +40,3 @@ "clean": "del-cli lib/**/*.js lib/***.js.map *.d.ts test/**/*.d.ts test/**/*.js test/**/*.js.map .nyc_output",

"main": "lib/index.js",
"typings": "lib/index.d.ts",
"types": "lib/index.d.ts",
"bugs": {

@@ -42,19 +46,19 @@ "url": "https://github.com/Borewit/token-types/issues"

"devDependencies": {
"@types/chai": "^4.2.5",
"@types/chai": "^4.2.12",
"@types/mocha": "^5.2.5",
"@types/node": "^13.1.0",
"@types/node": "^14.6.4",
"chai": "^4.2.0",
"coveralls": "^3.0.7",
"coveralls": "^3.1.0",
"del-cli": "^3.0.0",
"mocha": "^6.2.2",
"mocha": "^7.2.0",
"nyc": "^15.0.0",
"remark-cli": "^7.0.1",
"remark-preset-lint-recommended": "^3.0.3",
"source-map-support": "^0.5.16",
"ts-node": "^8.5.2",
"tslint": "^5.20.1",
"typescript": "^3.7.4"
"source-map-support": "^0.5.19",
"ts-node": "^9.0.0",
"tslint": "^6.0.0",
"typescript": "^4.0.2"
},
"dependencies": {
"@tokenizer/token": "^0.1.0",
"@tokenizer/token": "^0.1.1",
"ieee754": "^1.1.13"

@@ -61,0 +65,0 @@ },

@@ -1,2 +0,2 @@

[![Build Status](https://travis-ci.org/Borewit/token-types.svg?branch=master)](https://travis-ci.org/Borewit/token-types)
![Node.js CI](https://github.com/Borewit/token-types/workflows/Node.js%20CI/badge.svg)
[![NPM version](https://badge.fury.io/js/token-types.svg)](https://npmjs.org/package/token-types)

@@ -3,0 +3,0 @@ [![npm downloads](http://img.shields.io/npm/dm/token-types.svg)](https://npmcharts.com/compare/token-types,strtok3?start=1200&interval=30)

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