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

ascii-grid

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ascii-grid - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "ascii-grid",
"version": "0.1.0",
"version": "0.1.1",
"description": "Identify and Read an ARC/INFO ASCII Grid",

@@ -5,0 +5,0 @@ "main": "src",

@@ -1,8 +0,8 @@

const MAX_READ_LENGTH = 500;
module.exports = (input, options = {}) => {
const debug = options.debug || false;
const max_read_length = options.max_read_length || 500;
if (typeof Buffer !== "undefined" && Buffer.isBuffer(input)) {
if (input.toString) {
input = input.toString("utf8", 0, MAX_READ_LENGTH);
input = input.toString("utf8", 0, max_read_length);
if (debug) console.log("converted input to a string");

@@ -20,3 +20,3 @@ } else {

const decoded = "";
const length = Math.min(MAX_READ_LENGTH, input.byteLength);
const length = Math.min(max_read_length, input.byteLength);
for (let i = 0; i < length; i++) {

@@ -29,4 +29,4 @@ decoded += String.fromCharCode(input.getUint8(i));

if (input instanceof Uint8Array) {
const decoded = "";
for (let i = 0; i < Math.min(MAX_READ_LENGTH, input.length); i++) {
let decoded = "";
for (let i = 0; i < Math.min(max_read_length, input.length); i++) {
decoded += String.fromCharCode(input[i]);

@@ -33,0 +33,0 @@ }

@@ -19,3 +19,4 @@ const { readFileSync } = require("fs");

const bufferIsAsciiGrid = isAsciiGrid(buffer, { debug: false });
t.is(bufferIsAsciiGrid, true);
t.true(bufferIsAsciiGrid);
t.true(isAsciiGrid(Uint8Array.from(buffer)));
});

@@ -22,0 +23,0 @@

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