amis-formula 3.2.0 → 3.3.0

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/esm/doc.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/esm/error.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/esm/evalutor.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/esm/filter.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/esm/function.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/esm/lexer.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
@@ -280,10 +280,10 @@ function lexer(input, options) {
280
280
  stringLiteral() ||
281
281
  punctuator() ||
282
282
  char();
283
- if ((token === null || token === void 0 ? void 0 : token.value) === '{') {
283
+ if ((token === null || token === void 0 ? void 0 : token.value) === '{' && token.type == 'Punctuator') {
284
284
  pushState(mainStates.BLOCK);
285
285
  }
286
- else if ((token === null || token === void 0 ? void 0 : token.value) === '}') {
286
+ else if ((token === null || token === void 0 ? void 0 : token.value) === '}' && token.type == 'Punctuator') {
287
287
  if (mainState === mainStates.Filter) {
288
288
  popState();
289
289
  }
@@ -303,7 +303,8 @@ function lexer(input, options) {
303
303
  }
304
304
  // filter 过滤器部分需要特殊处理
305
305
  if (mainState === mainStates.SCRIPT &&
306
- (token === null || token === void 0 ? void 0 : token.value) === '|' &&
306
+ (token === null || token === void 0 ? void 0 : token.type) == 'Punctuator' &&
307
+ token.value === '|' &&
307
308
  allowFilter) {
308
309
  pushState(mainStates.Filter);
309
310
  return {
@@ -313,7 +314,9 @@ function lexer(input, options) {
313
314
  end: position('|')
314
315
  };
315
316
  }
316
- else if (mainState === mainStates.Filter && (token === null || token === void 0 ? void 0 : token.value) === '|') {
317
+ else if (mainState === mainStates.Filter &&
318
+ (token === null || token === void 0 ? void 0 : token.value) === '|' &&
319
+ token.type == 'Punctuator') {
317
320
  return {
318
321
  type: TokenName[16 /* TokenEnum.OpenFilter */],
319
322
  value: '|',
package/esm/parser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/lib/doc.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/lib/error.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/lib/evalutor.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/lib/filter.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/lib/function.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/lib/lexer.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
@@ -284,10 +284,10 @@ function lexer(input, options) {
284
284
  stringLiteral() ||
285
285
  punctuator() ||
286
286
  char();
287
- if ((token === null || token === void 0 ? void 0 : token.value) === '{') {
287
+ if ((token === null || token === void 0 ? void 0 : token.value) === '{' && token.type == 'Punctuator') {
288
288
  pushState(mainStates.BLOCK);
289
289
  }
290
- else if ((token === null || token === void 0 ? void 0 : token.value) === '}') {
290
+ else if ((token === null || token === void 0 ? void 0 : token.value) === '}' && token.type == 'Punctuator') {
291
291
  if (mainState === mainStates.Filter) {
292
292
  popState();
293
293
  }
@@ -307,7 +307,8 @@ function lexer(input, options) {
307
307
  }
308
308
  // filter 过滤器部分需要特殊处理
309
309
  if (mainState === mainStates.SCRIPT &&
310
- (token === null || token === void 0 ? void 0 : token.value) === '|' &&
310
+ (token === null || token === void 0 ? void 0 : token.type) == 'Punctuator' &&
311
+ token.value === '|' &&
311
312
  allowFilter) {
312
313
  pushState(mainStates.Filter);
313
314
  return {
@@ -317,7 +318,9 @@ function lexer(input, options) {
317
318
  end: position('|')
318
319
  };
319
320
  }
320
- else if (mainState === mainStates.Filter && (token === null || token === void 0 ? void 0 : token.value) === '|') {
321
+ else if (mainState === mainStates.Filter &&
322
+ (token === null || token === void 0 ? void 0 : token.value) === '|' &&
323
+ token.type == 'Punctuator') {
321
324
  return {
322
325
  type: TokenName[16 /* TokenEnum.OpenFilter */],
323
326
  value: '|',
package/lib/parser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-formula v3.2.0
2
+ * amis-formula v3.3.0
3
3
  * Copyright 2021-2023 fex
4
4
  */
5
5
 
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "amis-formula",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "负责 amis 里面的表达式实现,内置公式,编辑器等",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "scripts": {
9
9
  "build": "npm run clean-dist && npm run genDoc && cross-env NODE_ENV=production rollup -c && cp src/doc.md lib/doc.md && cp src/doc.md esm/doc.md",
10
+ "build-esm": "npm run clean-dist && cross-env NODE_ENV=production rollup -c rollup.esm.config.js",
10
11
  "lib": "npm run clean-dist && cross-env NODE_ENV=production IS_LIB=1 rollup -c",
11
12
  "clean-dist": "rimraf lib/**",
12
13
  "declaration": "tsc --project tsconfig-for-declaration.json --allowJs --declaration --emitDeclarationOnly --declarationDir ./lib --rootDir ./src",
@@ -81,7 +82,6 @@
81
82
  "browserslist": "IE >= 11",
82
83
  "jest": {
83
84
  "testEnvironment": "jsdom",
84
- "collectCoverage": true,
85
85
  "coverageReporters": [
86
86
  "text",
87
87
  "cobertura"
@@ -118,5 +118,5 @@
118
118
  "printBasicPrototype": false
119
119
  }
120
120
  },
121
- "gitHead": "910dddafdbcaf3b11012ade7c593c24b285dfeb5"
121
+ "gitHead": "b2637905fa258d984cf27b538b25a8db1bf8b5fc"
122
122
  }