fixed-width-parser
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -196,2 +196,9 @@ "use strict"; | ||
var strippedDecimals = numAsStr.slice(0, numAsStr.indexOf('.') + ((_a = config.decimalCount) !== null && _a !== void 0 ? _a : 2) + 1); | ||
// Add expected decimal places | ||
var currentDecimals = strippedDecimals.slice(strippedDecimals.indexOf('.') + 1) | ||
.length; | ||
if (config.decimalCount > currentDecimals) { | ||
var decimalsNeeded = config.decimalCount - currentDecimals; | ||
strippedDecimals = strippedDecimals.padEnd(strippedDecimals.length + decimalsNeeded, '0'); | ||
} | ||
value = | ||
@@ -198,0 +205,0 @@ ((_b = config.insertDecimal) !== null && _b !== void 0 ? _b : true) ? strippedDecimals |
{ | ||
"name": "fixed-width-parser", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "A fixed width data parser", | ||
@@ -28,7 +28,7 @@ "main": "dist/index.js", | ||
"@types/date-fns": "^2.6.0", | ||
"@types/jest": "^26.0.0", | ||
"@types/node": "^14.0.13", | ||
"@typescript-eslint/eslint-plugin": "^3.3.0", | ||
"@typescript-eslint/parser": "^3.3.0", | ||
"eslint": "^7.3.0", | ||
"@types/jest": "^26.0.3", | ||
"@types/node": "^14.0.14", | ||
"@typescript-eslint/eslint-plugin": "^3.4.0", | ||
"@typescript-eslint/parser": "^3.4.0", | ||
"eslint": "^7.3.1", | ||
"eslint-config-airbnb-base": "^14.2.0", | ||
@@ -38,5 +38,5 @@ "eslint-config-prettier": "^6.11.0", | ||
"husky": "3.1.0", | ||
"jest": "^26.0.1", | ||
"jest": "^26.1.0", | ||
"prettier": "^2.0.5", | ||
"ts-jest": "^26.1.0", | ||
"ts-jest": "^26.1.1", | ||
"typescript": "^3.9.5" | ||
@@ -43,0 +43,0 @@ }, |
# fixed-width-parser | ||
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/keawade/fixed-width-parser/npm-publish/master) | ||
![npm](https://img.shields.io/npm/v/fixed-width-parser) | ||
![NPM](https://img.shields.io/npm/l/fixed-width-parser) | ||
![Snyk Vulnerabilities for npm package version](https://img.shields.io/snyk/vulnerabilities/npm/fixed-width-parser) | ||
`fixed-width-parser` is a node module for parsing data to and from fixed width string | ||
@@ -4,0 +9,0 @@ formats. |
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
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
27255
422
259