Comparing version 0.0.5 to 0.0.26
@@ -1,7 +0,7 @@ | ||
declare namespace a_calc { | ||
export function calc (...args: any): string; | ||
export function calc (...args: any): string; | ||
export function fmt (...args: any): string; | ||
} | ||
export function fmt (...args: any): string; | ||
export default a_calc; | ||
export const version: string; | ||
{ | ||
"name": "a-calc", | ||
"version": "0.0.5", | ||
"version": "0.0.26", | ||
"description": "JavaScript的字符串四则运算库, 支持格式化操作例如: 千分位格式化, 灵活指定小数点位数", | ||
"main": "./dist/calc.js", | ||
"main": "./es/index.js", | ||
"exports": { | ||
".": { | ||
"import": "./es/index.js", | ||
"require": "./cjs/index.js" | ||
}, | ||
"./es": { | ||
"import": "./es/index.js", | ||
"default": "./es/index.js" | ||
}, | ||
"./cjs": { | ||
"require": "./cjs/index.js", | ||
"default": "./cjs/index.js" | ||
} | ||
}, | ||
"browser": "./browser/index.js", | ||
"module": "./es/index.js", | ||
"typings": "./calc.d.ts", | ||
"scripts": { | ||
"build": "webpack --watch" | ||
"dev": "rollup -c -w --environment build:dev", | ||
"build": "rollup -c --environment build:build", | ||
"build:w": "rollup -c -w --environment build:build", | ||
"test": "cross-env ava" | ||
}, | ||
"files": [ | ||
"example", | ||
"dist", | ||
"es", | ||
"cjs", | ||
"browser", | ||
"calc.d.ts" | ||
@@ -32,9 +53,22 @@ ], | ||
"homepage": "https://github.com/Autumn-one/a-calc#readme", | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.17.10", | ||
"@rollup/plugin-babel": "^5.3.1", | ||
"@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", | ||
"glob": "^8.0.1", | ||
"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", | ||
"rollup-plugin-uglify": "^6.0.4" | ||
}, | ||
"dependencies": { | ||
"numbro": "^2.3.6" | ||
}, | ||
"devDependencies": { | ||
"webpack": "^5.69.1", | ||
"webpack-cli": "^4.9.2" | ||
"@babel/core": "^7.17.10", | ||
"decimal.js": "^10.3.1" | ||
} | ||
} |
@@ -6,3 +6,7 @@ # a-calc | ||
> 支持的运算符: + - * / % | ||
> Supported operators(支持的运算符): + - * / | ||
> | ||
> If you have any questions, please send email to 718879459@qq.com as soon as possible to give me feedback | ||
> | ||
> (如果遇到了什么问题, 请第一时间向我发送反馈邮件, 718879459@qq.com 对于bug我会第一时间修复他) | ||
@@ -26,5 +30,3 @@ ## Install(安装) | ||
```js | ||
import a_calc from "a-calc" | ||
const {calc, fmt} = a_calc | ||
import {calc, fmt} from "a-calc" | ||
``` | ||
@@ -35,4 +37,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> | ||
@@ -50,6 +51,13 @@ const {calc, fmt} = a_calc | ||
// 复杂一点的计算 | ||
calc("0.1 + 0.2 * 0.3 / 0.4 * (0.5 + 0.6)") // 0.265 | ||
``` | ||
**Fill and calculate(填充变量并计算)** | ||
```js | ||
let a = 0.000001 | ||
let b = 888.789 | ||
calc("a + b", {a,b}) // 0.000001 + 888.789 = 888.789001 | ||
``` | ||
@@ -93,3 +101,3 @@ ## Calculate & Format (计算并格式化) | ||
https://www.bilibili.com/video/BV17R4y1G7DS?from=search&seid=11611588186602414425&spm_id_from=333.337.0.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
12
259
3
99
0
70834
2
14
1
+ Added@babel/core@^7.17.10
+ Addeddecimal.js@^10.3.1
+ Added@ampproject/remapping@2.3.0(transitive)
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/compat-data@7.26.2(transitive)
+ Added@babel/core@7.26.0(transitive)
+ Added@babel/generator@7.26.2(transitive)
+ Added@babel/helper-compilation-targets@7.25.9(transitive)
+ Added@babel/helper-module-imports@7.25.9(transitive)
+ Added@babel/helper-module-transforms@7.26.0(transitive)
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/helper-validator-option@7.25.9(transitive)
+ Added@babel/helpers@7.26.0(transitive)
+ Added@babel/parser@7.26.2(transitive)
+ Added@babel/template@7.25.9(transitive)
+ Added@babel/traverse@7.25.9(transitive)
+ Added@babel/types@7.26.0(transitive)
+ Added@jridgewell/gen-mapping@0.3.5(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Addedbrowserslist@4.24.2(transitive)
+ Addedcaniuse-lite@1.0.30001683(transitive)
+ Addedconvert-source-map@2.0.0(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddecimal.js@10.4.3(transitive)
+ Addedelectron-to-chromium@1.5.64(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedgensync@1.0.0-beta.2(transitive)
+ Addedglobals@11.12.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjsesc@3.0.2(transitive)
+ Addedjson5@2.2.3(transitive)
+ Addedlru-cache@5.1.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addednode-releases@2.0.18(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedupdate-browserslist-db@1.1.1(transitive)
+ Addedyallist@3.1.1(transitive)
- Removednumbro@^2.3.6
- Removedbignumber.js@9.1.2(transitive)
- Removednumbro@2.5.0(transitive)