New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cborg

Package Overview
Dependencies
Maintainers
1
Versions
79
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 1.5.0 to 1.5.1

6

cjs/browser-test/node-test-bin.js

@@ -16,4 +16,4 @@ 'use strict';

const {assert} = chai__default['default'];
const binPath = path__default['default'].join(path__default['default'].dirname(url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('browser-test/node-test-bin.js', document.baseURI).href)))), '../lib/bin.js');
const {assert} = chai__default["default"];
const binPath = path__default["default"].join(path__default["default"].dirname(url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('browser-test/node-test-bin.js', document.baseURI).href)))), '../lib/bin.js');
function fromHex(hex) {

@@ -24,3 +24,3 @@ return new Uint8Array(hex.split('').map((c, i, d) => i % 2 === 0 ? `0x${ c }${ d[i + 1] }` : '').filter(Boolean).map(e => parseInt(e, 16)));

return new Promise((resolve, reject) => {
const cp = child_process.exec(`"${ process__default['default'].execPath }" "${ binPath }" ${ cmd }`, (err, stdout, stderr) => {
const cp = child_process.exec(`"${ process__default["default"].execPath }" "${ binPath }" ${ cmd }`, (err, stdout, stderr) => {
if (err) {

@@ -27,0 +27,0 @@ err.stdout = stdout;

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -14,3 +14,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
function dateDecoder(obj) {

@@ -17,0 +17,0 @@ if (typeof obj !== 'string') {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -10,3 +10,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
describe('Internal bytes list', () => {

@@ -13,0 +13,0 @@ describe('push', () => {

@@ -16,3 +16,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const tags = [];

@@ -19,0 +19,0 @@ const typeEncoders = {};

@@ -12,3 +12,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
describe('decode errors', () => {

@@ -15,0 +15,0 @@ it('not Uint8Array', () => {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
describe('Fuzz round-trip', () => {

@@ -16,0 +16,0 @@ it('random objects', function () {

@@ -27,7 +27,7 @@ 'use strict';

console.error('Input may either be supplied as an argument or piped via stdin');
process__default['default'].exit(code || 0);
process__default["default"].exit(code || 0);
}
async function fromStdin() {
const chunks = [];
for await (const chunk of process__default['default'].stdin) {
for await (const chunk of process__default["default"].stdin) {
chunks.push(chunk);

@@ -45,4 +45,4 @@ }

function argvPretty() {
const argv = process__default['default'].argv.filter(s => s !== '--pretty');
const pretty = argv.length !== process__default['default'].argv.length;
const argv = process__default["default"].argv.filter(s => s !== '--pretty');
const pretty = argv.length !== process__default["default"].argv.length;
return {

@@ -54,3 +54,3 @@ argv,

async function run() {
const cmd = process__default['default'].argv[2];
const cmd = process__default["default"].argv[2];
switch (cmd) {

@@ -66,3 +66,3 @@ case 'help': {

case 'hex2diag': {
const bin = fromHex(process__default['default'].argv.length < 4 ? (await fromStdin()).toString() : process__default['default'].argv[3]);
const bin = fromHex(process__default["default"].argv.length < 4 ? (await fromStdin()).toString() : process__default["default"].argv[3]);
for (const line of diagnostic.tokensToDiagnostic(bin)) {

@@ -74,7 +74,7 @@ console.log(line);

case 'hex2bin': {
const bin = fromHex(process__default['default'].argv.length < 4 ? (await fromStdin()).toString() : process__default['default'].argv[3]);
return process__default['default'].stdout.write(bin);
const bin = fromHex(process__default["default"].argv.length < 4 ? (await fromStdin()).toString() : process__default["default"].argv[3]);
return process__default["default"].stdout.write(bin);
}
case 'bin2hex': {
const bin = process__default['default'].argv.length < 4 ? await fromStdin() : new TextEncoder().encode(process__default['default'].argv[3]);
const bin = process__default["default"].argv.length < 4 ? await fromStdin() : new TextEncoder().encode(process__default["default"].argv[3]);
return console.log(byteUtils.toHex(bin));

@@ -88,3 +88,3 @@ }

case 'bin2diag': {
const bin = process__default['default'].argv.length < 4 ? await fromStdin() : new TextEncoder().encode(process__default['default'].argv[3]);
const bin = process__default["default"].argv.length < 4 ? await fromStdin() : new TextEncoder().encode(process__default["default"].argv[3]);
for (const line of diagnostic.tokensToDiagnostic(bin)) {

@@ -96,3 +96,3 @@ console.log(line);

case 'json2hex': {
const inp = process__default['default'].argv.length < 4 ? (await fromStdin()).toString() : process__default['default'].argv[3];
const inp = process__default["default"].argv.length < 4 ? (await fromStdin()).toString() : process__default["default"].argv[3];
const obj = JSON.parse(inp);

@@ -102,3 +102,3 @@ return console.log(byteUtils.toHex(encode.encode(obj)));

case 'json2diag': {
const inp = process__default['default'].argv.length < 4 ? (await fromStdin()).toString() : process__default['default'].argv[3];
const inp = process__default["default"].argv.length < 4 ? (await fromStdin()).toString() : process__default["default"].argv[3];
const obj = JSON.parse(inp);

@@ -111,8 +111,8 @@ for (const line of diagnostic.tokensToDiagnostic(encode.encode(obj))) {

case 'json2bin': {
const inp = process__default['default'].argv.length < 4 ? (await fromStdin()).toString() : process__default['default'].argv[3];
const inp = process__default["default"].argv.length < 4 ? (await fromStdin()).toString() : process__default["default"].argv[3];
const obj = JSON.parse(inp);
return process__default['default'].stdout.write(encode.encode(obj));
return process__default["default"].stdout.write(encode.encode(obj));
}
default: {
if (process__default['default'].argv.findIndex(a => a.endsWith('mocha')) === -1) {
if (process__default["default"].argv.findIndex(a => a.endsWith('mocha')) === -1) {
if (cmd) {

@@ -128,3 +128,3 @@ console.error(`Unknown command: '${ cmd }'`);

console.error(err);
process__default['default'].exit(1);
process__default["default"].exit(1);
});

@@ -131,0 +131,0 @@ var bin = true;

@@ -16,4 +16,4 @@ 'use strict';

const {assert} = chai__default['default'];
const binPath = path__default['default'].join(path__default['default'].dirname(url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('node-test/node-test-bin.js', document.baseURI).href)))), '../lib/bin.js');
const {assert} = chai__default["default"];
const binPath = path__default["default"].join(path__default["default"].dirname(url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('node-test/node-test-bin.js', document.baseURI).href)))), '../lib/bin.js');
function fromHex(hex) {

@@ -24,3 +24,3 @@ return new Uint8Array(hex.split('').map((c, i, d) => i % 2 === 0 ? `0x${ c }${ d[i + 1] }` : '').filter(Boolean).map(e => parseInt(e, 16)));

return new Promise((resolve, reject) => {
const cp = child_process.exec(`"${ process__default['default'].execPath }" "${ binPath }" ${ cmd }`, (err, stdout, stderr) => {
const cp = child_process.exec(`"${ process__default["default"].execPath }" "${ binPath }" ${ cmd }`, (err, stdout, stderr) => {
if (err) {

@@ -27,0 +27,0 @@ err.stdout = stdout;

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -14,3 +14,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
function dateDecoder(obj) {

@@ -17,0 +17,0 @@ if (typeof obj !== 'string') {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const fixtures = [

@@ -16,0 +16,0 @@ {

@@ -10,3 +10,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
describe('Internal bytes list', () => {

@@ -13,0 +13,0 @@ describe('push', () => {

@@ -16,3 +16,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
const tags = [];

@@ -19,0 +19,0 @@ const typeEncoders = {};

@@ -12,3 +12,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
describe('decode errors', () => {

@@ -15,0 +15,0 @@ it('not Uint8Array', () => {

@@ -13,3 +13,3 @@ 'use strict';

const {assert} = chai__default['default'];
const {assert} = chai__default["default"];
describe('Fuzz round-trip', () => {

@@ -16,0 +16,0 @@ it('random objects', function () {

{
"name": "cborg",
"version": "1.5.0",
"version": "1.5.1",
"description": "Fast CBOR with a focus on strictness",

@@ -5,0 +5,0 @@ "main": "./cjs/cborg.js",

export const decodeErrPrefix: "CBOR decode error:";
export const encodeErrPrefix: "CBOR encode error:";
export let uintMinorPrefixBytes: any[];
export const uintMinorPrefixBytes: any[];
/**

@@ -5,0 +5,0 @@ * @param {Uint8Array} data

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