@fileverse-dev/formula-parser 0.2.16 → 0.2.17-patch-2

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/es/parser.js CHANGED
@@ -24,6 +24,9 @@ import { trimEdges } from "./helper/string";
24
24
  import { toNumber, invertNumber } from "./helper/number";
25
25
  import errorParser, { isValidStrict as isErrorValid, ERROR, ERROR_NAME, ERROR_VALUE } from "./error";
26
26
  import { extractLabel, toLabel } from "./helper/cell";
27
+ function normalizeQuotes(text) {
28
+ return text.replace(/[\u201C\u201D]/g, '"').replace(/[\u2018\u2019]/g, "'");
29
+ }
27
30
 
28
31
  /**
29
32
  * @class Parser
@@ -74,6 +77,7 @@ var Parser = /*#__PURE__*/function (_Emitter) {
74
77
  return _createClass(Parser, [{
75
78
  key: "parse",
76
79
  value: function parse(expression, options) {
80
+ expression = normalizeQuotes(expression);
77
81
  var result = null;
78
82
  var error = null;
79
83
  this.options = options;
package/lib/parser.js CHANGED
@@ -32,6 +32,10 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
32
32
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
33
33
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
34
34
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
35
+ function normalizeQuotes(text) {
36
+ return text.replace(/[\u201C\u201D]/g, '"').replace(/[\u2018\u2019]/g, "'");
37
+ }
38
+
35
39
  /**
36
40
  * @class Parser
37
41
  */
@@ -81,6 +85,7 @@ var Parser = /*#__PURE__*/function (_Emitter) {
81
85
  return _createClass(Parser, [{
82
86
  key: "parse",
83
87
  value: function parse(expression, options) {
88
+ expression = normalizeQuotes(expression);
84
89
  var result = null;
85
90
  var error = null;
86
91
  this.options = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/formula-parser",
3
- "version": "0.2.16",
3
+ "version": "0.2.17-patch-2",
4
4
  "description": "Formula parser",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -48,7 +48,7 @@
48
48
  "webpack-cli": "^4.2.0"
49
49
  },
50
50
  "dependencies": {
51
- "@fileverse-dev/formulajs": "4.4.11-mod-64",
51
+ "@fileverse-dev/formulajs": "4.4.11-mod-64-patch-2",
52
52
  "tiny-emitter": "^2.1.0"
53
53
  },
54
54
  "jest": {