amis-formula 1.3.13 → 1.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # amis-tpl
1
+ # amis-formula
2
2
 
3
3
  负责 amis 里面的表达式、公式及模板的实现
4
4
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v1.3.13
2
+ * amis-formula v1.3.14
3
3
  * Copyright 2021-2022 fex
4
4
  */
5
5
 
@@ -2168,6 +2168,12 @@ var Evaluator = /** @class */ (function () {
2168
2168
  ? sessionStorage.getItem(name)
2169
2169
  : localStorage.getItem(name);
2170
2170
  if (typeof raw === 'string') {
2171
+ // 判断字符串是否一个纯数字字符串,如果是,则对比parse后的值和原值是否相同,
2172
+ // 如果不同则返回原值,因为原值如果是一个很长的纯数字字符串,则 parse 后可能会丢失精度
2173
+ if (/^\d+$/.test(raw)) {
2174
+ var parsed = JSON.parse(raw);
2175
+ return "".concat(parsed) === raw ? parsed : raw;
2176
+ }
2171
2177
  return parseJson(raw, raw);
2172
2178
  }
2173
2179
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amis-formula",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "负责 amis 里面的表达式实现,内置公式,编辑器等",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -29,6 +29,7 @@
29
29
  },
30
30
  "homepage": "https://github.com/aisuda/amis-tpl#readme",
31
31
  "dependencies": {
32
+ "core-js": "3.22.5",
32
33
  "lodash": "^4.17.15",
33
34
  "moment": "^2.29.1",
34
35
  "tslib": "^2.3.1"
package/rollup.config.js CHANGED
@@ -30,6 +30,7 @@ export default {
30
30
  plugins: [
31
31
  isForLib && terser()
32
32
  ],
33
+ strict: !isForLib,
33
34
  footer: isForLib ? `var evaluate = formula.evaluate;
34
35
  var momentFormat = formula.momentFormat;
35
36
  var parse = formula.parse;` : '',
@@ -67,7 +68,8 @@ export default {
67
68
  json(),
68
69
  resolve({
69
70
  jsnext: true,
70
- main: true
71
+ main: true,
72
+ browser: true
71
73
  }),
72
74
  typescript({
73
75
  typescript: require('typescript')