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

xy-parser

Package Overview
Dependencies
Maintainers
4
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xy-parser - npm Package Compare versions

Comparing version 3.1.1 to 3.2.0

7

CHANGELOG.md
# Changelog
## [3.2.0](https://www.github.com/cheminfo/xy-parser/compare/v3.1.1...v3.2.0) (2021-07-14)
### Features
* automatically convert arrayBuffer to text ([aa2e6d4](https://www.github.com/cheminfo/xy-parser/commit/aa2e6d41f16360240cda56e5ef15a5b735a2f9ef))
### [3.1.1](https://www.github.com/cheminfo/xy-parser/compare/v3.1.0...v3.1.1) (2021-03-19)

@@ -4,0 +11,0 @@

21

lib/index.js

@@ -5,2 +5,19 @@ 'use strict';

/**
* Ensure that the data is string. If it is an ArrayBuffer it will be converted to string using TextDecoder.
* @param {string|ArrayBuffer} blob
* @param {object} [options={}]
* @param {string} [options.encoding='utf8']
* @returns {string}
*/
function ensureString(blob, options = {}) {
const { encoding = 'utf8' } = options;
if (ArrayBuffer.isView(blob) || blob instanceof ArrayBuffer) {
const decoder = new TextDecoder(encoding);
return decoder.decode(blob);
}
return blob;
}
const toString$1 = Object.prototype.toString;

@@ -690,2 +707,4 @@

text = ensureString(text);
maxNumberColumns = Math.max(maxNumberColumns, xColumn + 1, yColumn + 1);

@@ -712,3 +731,3 @@ minNumberColumns = Math.max(xColumn + 1, yColumn + 1, minNumberColumns);

) {
matrix.push(fields.map((value) => parseFloat(value.replace(',', '.'))));
matrix.push(fields.map((value) => parseFloat(value.replace(",", "."))));
position++;

@@ -715,0 +734,0 @@ }

31

package.json
{
"name": "xy-parser",
"version": "3.1.1",
"version": "3.2.0",
"description": "Parse a text-file and convert it to an array of XY points",

@@ -39,16 +39,16 @@ "main": "lib/index.js",

"devDependencies": {
"@types/jest": "^26.0.21",
"@types/jest": "^26.0.24",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"cheminfo-build": "^1.1.10",
"cheminfo-build": "^1.1.11",
"cheminfo-tools": "^1.23.3",
"codecov": "^3.8.1",
"eslint": "^7.22.0",
"eslint-config-cheminfo": "^5.2.3",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.2",
"eslint-plugin-no-only-tests": "^2.4.0",
"eslint-plugin-prettier": "^3.3.1",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"rollup": "^2.42.0",
"codecov": "^3.8.2",
"eslint": "^7.30.0",
"eslint-config-cheminfo": "^5.2.4",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-no-only-tests": "^2.6.0",
"eslint-plugin-prettier": "^3.4.0",
"jest": "^27.0.6",
"prettier": "^2.3.2",
"rollup": "^2.53.1",
"rollup-plugin-commonjs": "^10.1.0",

@@ -58,6 +58,7 @@ "rollup-plugin-node-resolve": "^5.2.0"

"dependencies": {
"ml-array-max": "^1.2.2",
"ensure-string": "^0.1.1",
"ml-array-max": "^1.2.3",
"ml-arrayxy-uniquex": "1.0.2",
"ml-spectra-processing": "^5.8.0"
"ml-spectra-processing": "^6.7.1"
}
}
# xy-parser
[![NPM version][npm-image]][npm-url]
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
Parse a text-file and convert it to an array of XY points.
<h3 align="center">
<a href="https://www.zakodium.com">
<img src="https://www.zakodium.com/brand/zakodium-logo-white.svg" width="50" alt="Zakodium logo" />
</a>
<p>
Maintained by <a href="https://www.zakodium.com">Zakodium</a>
</p>
[![NPM version][npm-image]][npm-url]
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
</h3>
## Installation

@@ -10,0 +22,0 @@

@@ -1,4 +0,6 @@

import mlArrayMax from 'ml-array-max';
import uniqueXFunction from 'ml-arrayxy-uniquex';
import { xIsMonotone } from 'ml-spectra-processing';
import { ensureString } from "ensure-string";
import mlArrayMax from "ml-array-max";
import uniqueXFunction from "ml-arrayxy-uniquex";
import { xIsMonotone } from "ml-spectra-processing";
/**

@@ -32,2 +34,4 @@ * Parse a text-file and convert it to an array of XY points

text = ensureString(text);
maxNumberColumns = Math.max(maxNumberColumns, xColumn + 1, yColumn + 1);

@@ -54,3 +58,3 @@ minNumberColumns = Math.max(xColumn + 1, yColumn + 1, minNumberColumns);

) {
matrix.push(fields.map((value) => parseFloat(value.replace(',', '.'))));
matrix.push(fields.map((value) => parseFloat(value.replace(",", "."))));
position++;

@@ -57,0 +61,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