From aee64dcefdaf07748866d281606bb223d5b9c428 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 2 Oct 2020 18:29:03 +0100 Subject: [PATCH] Terrain50.Validate: Allow 'e' in data lines --- Changelog.md | 3 +++ package-lock.json | 2 +- package.json | 2 +- src/static/Terrain50Validate.mjs | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 4681d48..609d5f7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -13,6 +13,9 @@ npm install --save terrain50 ----- +## v1.8.3 + - Allow the character `e` when validating with `Terrain50.Validate(string)` to allow for very small numbers + ## v1.8.2 - Add new `quiet` argument to `Terrain50.AnalyseFrequencies()` diff --git a/package-lock.json b/package-lock.json index 112bba2..acd5e9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "terrain50", - "version": "1.8.2", + "version": "1.8.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7c8d746..8769e6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "terrain50", - "version": "1.8.2", + "version": "1.8.3", "description": "Library for parsing Ordnance Survey Digital Elevation Model files", "main": "src/index.mjs", "scripts": { diff --git a/src/static/Terrain50Validate.mjs b/src/static/Terrain50Validate.mjs index 9e00b51..1c44228 100644 --- a/src/static/Terrain50Validate.mjs +++ b/src/static/Terrain50Validate.mjs @@ -40,7 +40,7 @@ function terrain50_validate(str) { let parts = line.split(/\s+/); - if(line.search(/^[0-9-.]+\s+/) !== -1) { + if(line.search(/^[0-9-.e]+\s+/) !== -1) { // It's a data line if(col_count === null) col_count = parts.length; if(!col_counts_seen.includes(parts.length))