token-types
Advanced tools
Comparing version 4.1.1 to 5.0.0-alpha.0
/// <reference types="node" /> | ||
import { IToken, IGetToken } from '@tokenizer/token'; | ||
import { Buffer } from 'node:buffer'; | ||
/** | ||
@@ -4,0 +5,0 @@ * 8-bit unsigned integer |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12
Yes
24728
3
599
2
+ Addedc8@^7.10.0
+ Added@bcoe/v8-coverage@0.2.3(transitive)
+ Added@istanbuljs/schema@0.1.3(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@types/istanbul-lib-coverage@2.0.6(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedc8@7.14.0(transitive)
+ Addedcliui@7.0.4(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconvert-source-map@2.0.0(transitive)
+ Addedcross-spawn@7.0.3(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedforeground-child@2.0.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhtml-escaper@2.0.2(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedistanbul-lib-coverage@3.2.2(transitive)
+ Addedistanbul-lib-report@3.0.1(transitive)
+ Addedistanbul-reports@3.1.7(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedmake-dir@4.0.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtest-exclude@6.0.0(transitive)
+ Addedv8-to-istanbul@9.3.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyargs@16.2.0(transitive)
+ Addedyargs-parser@20.2.9(transitive)
+ Addedyocto-queue@0.1.0(transitive)