@kasko/quote-calculator-js
Advanced tools
Comparing version 1.0.12 to 1.1.0
# Changelog | ||
## [v1.1.0](https://github.com/kasko/quote-calculator-js-lib/compare/v1.0.12...v1.1.0) (2023-10-20) | ||
## Feature | ||
- `calculator` - Adds `CalculatorAndTests` class that will read pricing tests sheet; | ||
## Other | ||
- `parser` - Publish xlsx to json parser binaries; | ||
## [v1.0.12](https://github.com/kasko/quote-calculator-js-lib/compare/v1.0.11...v1.0.12) (2023-03-21) | ||
@@ -3,0 +10,0 @@ ## Bugfix |
@@ -96,2 +96,3 @@ import { parseXLSX } from '../../sheet-reader/src/parser.js'; | ||
getExtra(): Record<string, any>; | ||
getSheet(name: string): Worksheet; | ||
private setupParser; | ||
@@ -101,3 +102,9 @@ private fillConfig; | ||
private fillCells; | ||
private getTable; | ||
getTable(header: string, sheetName?: string): { | ||
source: { | ||
c: number; | ||
r: number; | ||
}; | ||
fields: string[]; | ||
}; | ||
private calculate; | ||
@@ -132,2 +139,10 @@ private getFieldsWithValues; | ||
} | ||
export declare class CalculatorAndTests<I = Record<string, any>, O = Record<string, any>, C = IConfig> extends Calculator<I, O, C> { | ||
init(spreadSheetPath: string): Promise<void>; | ||
getTestTable(source: { | ||
c: number; | ||
r: number; | ||
}): Record<string, any>; | ||
getTestData(): Record<string, any>; | ||
} | ||
export { parseXLSX }; |
{ | ||
"name": "@kasko/quote-calculator-js", | ||
"version": "1.0.12", | ||
"version": "1.1.0", | ||
"description": "KASKO Spreadsheet Quote Calculator", | ||
@@ -8,6 +8,8 @@ "main": "dist/calculator.js", | ||
"scripts": { | ||
"build": "yarn generate && yarn build:calculator && yarn declarations", | ||
"build": "yarn generate && yarn build:calculator && yarn build:parser && yarn declarations", | ||
"generate": "cd packages/formula-parser/src/grammar-parser && jison grammar-parser.jison", | ||
"build:calculator": "esbuild --log-level=error --bundle packages/calculator/src/calculator.ts --outdir=dist --minify --format=cjs --target=es2015 --platform=node --sourcemap", | ||
"parse": "node bin/parse-xlsx.js ./test-files ./pricing ./lambda/visana-private-liability", | ||
"build:calculator": "esbuild --log-level=info --bundle packages/calculator/src/calculator.ts --outdir=dist --minify --format=cjs --target=es2015 --platform=node --sourcemap", | ||
"build:parser": "esbuild --log-level=info --bundle --platform=node --minify --outdir=bin packages/bin/parse-xlsx.js", | ||
"build:binary:parser": "yarn build:parser && npx pkg bin/parse-xlsx.js -t node18-linux,node18-macos -o binaries/parse-xlsx", | ||
"parse": "node packages/bin/parse-xlsx.js ./test-files ./pricing ./lambda/visana-private-liability", | ||
"start": "node index.js", | ||
@@ -37,3 +39,3 @@ "test": "uvu test", | ||
"typescript": "^4.2.3", | ||
"uvu": "^0.5.1" | ||
"uvu": "^0.5.6" | ||
}, | ||
@@ -40,0 +42,0 @@ "files": [ |
@@ -79,3 +79,12 @@ # quote-calculator-js-lib | ||
In case of loading parsed xlsx file as json: | ||
```diff | ||
+const workbook = require('./kasko-demo.json'); | ||
-const path = './kasko-demo.xlsx'; | ||
... | ||
+await calculator.init(workbook, input, config); | ||
-await calculator.init(path, input, config); | ||
``` | ||
## Development | ||
@@ -82,0 +91,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1589916
1666
136
3
9