Comparing version 0.0.5 to 0.0.7
@@ -1,2 +0,2 @@ | ||
declare namespace a_calc { | ||
export declare namespace a_calc { | ||
export function calc (...args: any): string; | ||
@@ -7,2 +7,1 @@ | ||
export default a_calc; |
{ | ||
"name": "a-calc", | ||
"version": "0.0.5", | ||
"version": "0.0.7", | ||
"description": "JavaScript的字符串四则运算库, 支持格式化操作例如: 千分位格式化, 灵活指定小数点位数", | ||
"main": "./dist/calc.js", | ||
"main": "./es/index.js", | ||
"type": "module", | ||
"typings": "./calc.d.ts", | ||
"scripts": { | ||
"build": "webpack --watch" | ||
"dev": "rollup -c -w --environment build:dev", | ||
"build": "rollup -c -w --environment build:build", | ||
"test": "cross-env ava" | ||
}, | ||
"files": [ | ||
"example", | ||
"dist", | ||
"es", | ||
"cjs", | ||
"browser", | ||
"calc.d.ts" | ||
@@ -32,9 +37,17 @@ ], | ||
"homepage": "https://github.com/Autumn-one/a-calc#readme", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^22.0.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^13.2.1", | ||
"ava": "^4.2.0", | ||
"cross-env": "^7.0.3", | ||
"npm-run-all": "^4.1.5", | ||
"rollup": "^2.70.2", | ||
"rollup-plugin-livereload": "^2.0.5", | ||
"rollup-plugin-serve": "^1.1.0", | ||
"rollup-plugin-terser": "^7.0.2" | ||
}, | ||
"dependencies": { | ||
"numbro": "^2.3.6" | ||
}, | ||
"devDependencies": { | ||
"webpack": "^5.69.1", | ||
"webpack-cli": "^4.9.2" | ||
"decimal.js": "^10.3.1" | ||
} | ||
} |
@@ -19,3 +19,3 @@ # a-calc | ||
```js | ||
const {calc, fmt} = require("a-calc") | ||
const {calc, fmt} = require("a-calc/cjs") | ||
``` | ||
@@ -26,5 +26,5 @@ | ||
```js | ||
import a_calc from "a-calc" | ||
const {calc, fmt} = a_calc | ||
import {calc, fmt} from "a-calc" | ||
// 或者 | ||
import {calc, fmt} from "a-calc/es" | ||
``` | ||
@@ -35,4 +35,3 @@ | ||
```html | ||
<script src="node_modules/numbro/dist/numbro.js"></script> | ||
<script src="node_modules/a-calc/dist/calc.js"></script> | ||
<script src="node_modules/a-calc/browser/index.js"></script> | ||
<script> | ||
@@ -51,2 +50,6 @@ const {calc, fmt} = a_calc | ||
calc("0.1 + 0.2 * 0.3 / 0.4 * (0.5 + 0.6)") // 0.265 | ||
let a = 0.000001 | ||
let b = 888.789 | ||
calc("a + b", {a,b}) // 888.789001 | ||
``` | ||
@@ -53,0 +56,0 @@ |
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
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
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
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
11
3
94
0
Yes
66422
10
186
1
+ Addeddecimal.js@^10.3.1
+ Addeddecimal.js@10.4.3(transitive)
- Removednumbro@^2.3.6
- Removedbignumber.js@9.1.2(transitive)
- Removednumbro@2.5.0(transitive)