simple-compare
Advanced tools
+1
-1
| { | ||
| "name": "simple-compare", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "简单的 JS 对象比较器", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
+3
-17
| # simple-compare | ||
| 简单的 JS 对象比较器 | ||
| ## 安装 | ||
| ``` | ||
@@ -9,18 +11,2 @@ npm install simple-compare | ||
| ## 示例 | ||
| ``` | ||
| // 本插件为 es6 模块 请在 babel 环境下使用 | ||
| import compare from 'simple-compare' | ||
| compare({ a: 1, b: 2 }, { a: 1, b: 3, c: 4 }) | ||
| ``` | ||
| 返回: | ||
| ``` | ||
| { | ||
| // 差异总数 | ||
| count: 2, | ||
| // 差异部分 | ||
| difference: { b: 3, c: 4}, | ||
| // 原始数据 | ||
| raw: { a: 1, b: 2 } | ||
| } | ||
| ``` | ||
| [文档地址](https://aweiu.com/documents/simple-compare/) |
2465
-5.56%12
-53.85%