@guihz/trading-vue-editor-tes 0.1.62 → 0.1.64

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.
@@ -60092,12 +60092,17 @@ Input files:
60092
60092
  const i = [];
60093
60093
  for (; n < t.length; n++) {
60094
60094
  const s = t[n];
60095
- s.ruleIndex === e0.RULE_formalParameterArg && i.push(this.visit(s));
60095
+ if (s.ruleIndex === e0.RULE_formalParameterArg) {
60096
+ const o = this.visit(s);
60097
+ o && i.push(o);
60098
+ }
60096
60099
  }
60097
60100
  return i;
60098
60101
  };
60099
60102
  visitFormalParameterArg = (e) => {
60100
60103
  const { children: t } = e;
60104
+ if (!t)
60105
+ return;
60101
60106
  let n = 0;
60102
60107
  const i = {};
60103
60108
  for (; n < t.length; n++) {
@@ -77692,12 +77697,17 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
77692
77697
  const i = [];
77693
77698
  for (; n < t.length; n++) {
77694
77699
  const s = t[n];
77695
- s.ruleIndex === I.RULE_formalParameterArg && i.push(this.visit(s));
77700
+ if (s.ruleIndex === I.RULE_formalParameterArg) {
77701
+ const o = this.visit(s);
77702
+ o && i.push(o);
77703
+ }
77696
77704
  }
77697
77705
  return i;
77698
77706
  };
77699
77707
  visitFormalParameterArg = (e) => {
77700
77708
  const { children: t } = e;
77709
+ if (!t)
77710
+ return;
77701
77711
  let n = 0;
77702
77712
  const i = {};
77703
77713
  for (; n < t.length; n++) {
@@ -96426,12 +96436,17 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
96426
96436
  const i = [];
96427
96437
  for (; n < t.length; n++) {
96428
96438
  const s = t[n];
96429
- s.ruleIndex === N.RULE_formalParameterArg && i.push(this.visit(s));
96439
+ if (s.ruleIndex === N.RULE_formalParameterArg) {
96440
+ const o = this.visit(s);
96441
+ o && i.push(o);
96442
+ }
96430
96443
  }
96431
96444
  return i;
96432
96445
  };
96433
96446
  visitFormalParameterArg = (e) => {
96434
96447
  const { children: t } = e;
96448
+ if (!t)
96449
+ return;
96435
96450
  let n = 0;
96436
96451
  const i = {};
96437
96452
  for (; n < t.length; n++) {
@@ -98482,7 +98497,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
98482
98497
  const C = `var ${E} = Date.now()`;
98483
98498
  let K = `for (let ${s}=${q};(${this._prefixNameVar}.compareDataHandle(${s}) - ${R}) * ${z} >= 0; ${s}-=(${S || "1"}) * ${z}){
98484
98499
  if (Date.now() - ${E} > 500) {
98485
- throw new Error('${d0.loopRuntimeErr}')
98500
+ throw new Error('${d0.loopRuntimeErr}-${p.start.line}')
98486
98501
  }
98487
98502
  ${x}++
98488
98503
  ${L}
@@ -45024,11 +45024,11 @@ ${z}`), z;
45024
45024
  const t = e.hasOwnProperty("replacement"), { source: r, replacement: i } = e;
45025
45025
  return r !== void 0 && !(typeof r == "number" && isNaN(r)) ? r : t ? i : 0;
45026
45026
  }
45027
- time({ timeframe: e = "", session: t, timezone: r = this._variables.syminfo.timezone, bars_back: i = 0 }, s) {
45028
- return this._timeHandle(this._variables.time, s, e, t, r, i);
45027
+ time({ timeframe: e = "", session: t, timezone: r = this._variables.syminfo.timezone, bars_back: i = 0, timeframe_bars_back: s = 0 }, o) {
45028
+ return this._timeHandle(this._variables.time, o, e, t, r, i, s);
45029
45029
  }
45030
- time_close({ timeframe: e = "", session: t, timezone: r = this._variables.syminfo.timezone, bars_back: i = 0 }, s) {
45031
- return this._timeHandle(this._variables.time, s, e, t, r, i, !0);
45030
+ time_close({ timeframe: e = "", session: t, timezone: r = this._variables.syminfo.timezone, bars_back: i = 0, timeframe_bars_back: s = 0 }, o) {
45031
+ return this._timeHandle(this._variables.time, o, e, t, r, i, s, !0);
45032
45032
  }
45033
45033
  timestamp(e) {
45034
45034
  const { dateString: t, timezone: r = this._variables.syminfo.timezone, year: i, month: s, day: o, hour: a = 0, minute: c = 0, second: p = 0 } = e;
@@ -45070,96 +45070,96 @@ ${z}`), z;
45070
45070
  const r = this._variables.getTimeTradingday(e, this._variables.timeframe.period), i = I0(t, e) * 1e3;
45071
45071
  return e - r - Math.floor((e - r) / i) * i;
45072
45072
  }
45073
- _timeHandle(e, t, r = "", i, s, o = 0, a = !1) {
45074
- const c = r || this._variables.__period, p = I0(c, e), b = I0(this._variables.__period, e);
45075
- let M;
45076
- if (s = s?.trim(), p <= b)
45077
- M = e, a && (M += b * 1e3);
45073
+ _timeHandle(e, t, r = "", i, s, o = 0, a = 0, c = !1) {
45074
+ const p = r || this._variables.__period, b = I0(p, e), M = I0(this._variables.__period, e);
45075
+ let l;
45076
+ if (s = s?.trim(), b <= M)
45077
+ l = e, c && (l += M * 1e3);
45078
45078
  else {
45079
- const l = `time_${t}`, z = this._cacheData[l];
45080
- if (z) {
45081
- const { unit: O } = z;
45082
- switch (z.type) {
45079
+ const z = `time_${t}`, O = this._cacheData[z];
45080
+ if (O) {
45081
+ const { unit: d } = O;
45082
+ switch (O.type) {
45083
45083
  case 1:
45084
- const { time: d, nextTime: _, preNum: f } = z;
45085
- e >= _ ? (M = _, this._cacheData[l] = {
45084
+ const { time: _, nextTime: f, preNum: A } = O;
45085
+ e >= f ? (l = f, this._cacheData[z] = {
45086
45086
  type: 1,
45087
- time: M,
45088
- nextTime: p0(_).add(f, O).startOf(O).add(this._variables._offsetTime, "hour").valueOf(),
45089
- unit: O,
45090
- preNum: f
45091
- }) : M = d;
45087
+ time: l,
45088
+ nextTime: p0(f).add(A, d).startOf(d).add(this._variables._offsetTime, "hour").valueOf(),
45089
+ unit: d,
45090
+ preNum: A
45091
+ }) : l = _;
45092
45092
  break;
45093
45093
  case 2:
45094
- M = p0(e).startOf(O).add(this._variables._offsetTime, "hour").valueOf();
45094
+ l = p0(e).startOf(d).add(this._variables._offsetTime, "hour").valueOf();
45095
45095
  break;
45096
45096
  case 4:
45097
- this._variables.__isWeekChange && O === "w" || this._variables.__isMonthChange && O === "M" ? (M = e, this._cacheData[l] = {
45097
+ this._variables.__isWeekChange && d === "w" || this._variables.__isMonthChange && d === "M" ? (l = e, this._cacheData[z] = {
45098
45098
  type: 4,
45099
- time: M,
45100
- unit: O
45101
- }) : M = z.time;
45099
+ time: l,
45100
+ unit: d
45101
+ }) : l = O.time;
45102
45102
  break;
45103
45103
  default:
45104
- z.currentTime + p * 1e3 - z.offset <= e ? (M = e, this._cacheData[l] = {
45104
+ O.currentTime + b * 1e3 - O.offset <= e ? (l = e, this._cacheData[z] = {
45105
45105
  type: 3,
45106
45106
  currentTime: e,
45107
45107
  offset: 0
45108
- }) : M = z.currentTime;
45108
+ }) : l = O.currentTime;
45109
45109
  break;
45110
45110
  }
45111
45111
  } else {
45112
- const [O, d] = Me(c);
45113
- if (/[DWM]/.test(c))
45114
- if (M = p0(e).startOf(d).add(this._variables._offsetTime, "hour").valueOf(), !a && O === 1 && ["w", "M"].includes(d))
45115
- (this._variables.__isWeekChange && d === "w" || this._variables.__isMonthChange && d === "M") && (M = e), this._cacheData[l] = {
45112
+ const [d, _] = Me(p);
45113
+ if (/[DWM]/.test(p))
45114
+ if (l = p0(e).startOf(_).add(this._variables._offsetTime, "hour").valueOf(), !c && d === 1 && ["w", "M"].includes(_))
45115
+ (this._variables.__isWeekChange && _ === "w" || this._variables.__isMonthChange && _ === "M") && (l = e), this._cacheData[z] = {
45116
45116
  type: 4,
45117
- time: M,
45118
- unit: d
45117
+ time: l,
45118
+ unit: _
45119
45119
  };
45120
- else if (O > 1) {
45121
- const _ = p0(M).add(O, d).startOf(d).add(this._variables._offsetTime, "hour").valueOf();
45122
- this._cacheData[l] = {
45120
+ else if (d > 1) {
45121
+ const f = p0(l).add(d, _).startOf(_).add(this._variables._offsetTime, "hour").valueOf();
45122
+ this._cacheData[z] = {
45123
45123
  type: 1,
45124
- time: M,
45125
- nextTime: _,
45126
- unit: d,
45127
- preNum: O
45124
+ time: l,
45125
+ nextTime: f,
45126
+ unit: _,
45127
+ preNum: d
45128
45128
  };
45129
45129
  } else
45130
- this._cacheData[l] = {
45130
+ this._cacheData[z] = {
45131
45131
  type: 2,
45132
- unit: d
45132
+ unit: _
45133
45133
  };
45134
45134
  else {
45135
- const _ = this._calcTimeOffset(e, c);
45136
- this._cacheData[l] = {
45135
+ const f = this._calcTimeOffset(e, p);
45136
+ this._cacheData[z] = {
45137
45137
  type: 3,
45138
45138
  currentTime: e,
45139
- offset: _
45140
- }, M = e;
45139
+ offset: f
45140
+ }, l = e;
45141
45141
  }
45142
45142
  }
45143
- a && (M += p * 1e3);
45143
+ c && (l += b * 1e3);
45144
45144
  }
45145
45145
  if (typeof o == "string" && (i === void 0 ? i = o : s = o, o = 0), i && i !== ts.regular && i !== ts.extended) {
45146
- const { timePeriods: l, weeks: z } = this._parserSession(i, t), O = z1(e, s), d = O.format("YYYY-MM-DD HH:mm");
45147
- let _ = O.format("YYYY-MM-DD");
45148
- const f = Number(O.format("HHmm"));
45149
- M = void 0;
45150
- for (const q of l) {
45151
- const [m, W] = q;
45152
- let v = _;
45153
- const y = Number(m?.replace(":", "")), N = Number(W?.replace(":", ""));
45154
- if ((m === W || y > N) && (f >= y ? v = O.add(1, "day").format("YYYY-MM-DD") : f < N && (_ = O.subtract(1, "day").format("YYYY-MM-DD"))), z1(d, s).isBetween(`${_} ${m}`, `${v} ${W}`, "minute", "[)")) {
45155
- M = ps(`${_} ${m}`, s);
45146
+ const { timePeriods: z, weeks: O } = this._parserSession(i, t), d = z1(e, s), _ = d.format("YYYY-MM-DD HH:mm");
45147
+ let f = d.format("YYYY-MM-DD");
45148
+ const A = Number(d.format("HHmm"));
45149
+ l = void 0;
45150
+ for (const m of z) {
45151
+ const [W, v] = m;
45152
+ let y = f;
45153
+ const N = Number(W?.replace(":", "")), w = Number(v?.replace(":", ""));
45154
+ if ((W === v || N > w) && (A >= N ? y = d.add(1, "day").format("YYYY-MM-DD") : A < w && (f = d.subtract(1, "day").format("YYYY-MM-DD"))), z1(_, s).isBetween(`${f} ${W}`, `${y} ${v}`, "minute", "[)")) {
45155
+ l = ps(`${f} ${W}`, s);
45156
45156
  break;
45157
45157
  }
45158
45158
  }
45159
- const A = this._variables.dayofweek;
45160
- M && !z.includes(A) && (M = void 0);
45159
+ const q = this._variables.dayofweek;
45160
+ l && !O.includes(q) && (l = void 0);
45161
45161
  }
45162
- return Number(M && M - o * b * 1e3);
45162
+ return Number(l && l - o * M * 1e3 - a * b * 1e3);
45163
45163
  }
45164
45164
  _seriesColorHandle(e, t, r) {
45165
45165
  if (r && t?.length)
@@ -207,7 +207,7 @@ export default class ParserVisitor extends ParserUtils {
207
207
  visitArrowFunction: (ctx: IKeyObjectValue) => IKeyObjectValue;
208
208
  visitArrowFunctionParameters: (ctx: IKeyObjectValue) => IKeyObjectValue[];
209
209
  visitFormalParameterList: (ctx: IKeyObjectValue) => IKeyObjectValue[];
210
- visitFormalParameterArg: (ctx: IKeyObjectValue) => IKeyObjectValue;
210
+ visitFormalParameterArg: (ctx: IKeyObjectValue) => IKeyObjectValue | undefined;
211
211
  private _verifyArgsDefaultValue;
212
212
  visitAssignmentOperator: (ctx: IKeyObjectValue) => any;
213
213
  visitTypeArray: (ctx: IKeyObjectValue) => string;
@@ -238,7 +238,7 @@ export default class ParserVisitor extends ParserUtils {
238
238
  visitArrowFunction: (ctx: IKeyObjectValue) => IKeyObjectValue;
239
239
  visitArrowFunctionParameters: (ctx: IKeyObjectValue) => IKeyObjectValue[];
240
240
  visitFormalParameterList: (ctx: IKeyObjectValue) => IKeyObjectValue[];
241
- visitFormalParameterArg: (ctx: IKeyObjectValue) => IKeyObjectValue;
241
+ visitFormalParameterArg: (ctx: IKeyObjectValue) => IKeyObjectValue | undefined;
242
242
  private _verifyArgsDefaultValue;
243
243
  visitArrowMethod: (ctx: IKeyObjectValue) => IKeyObjectValue;
244
244
  private _exportArgsTypeVerify;
@@ -242,7 +242,7 @@ export default class ParserVisitor extends ParserUtils {
242
242
  visitArrowFunction: (ctx: IKeyObjectValue) => IKeyObjectValue;
243
243
  visitArrowFunctionParameters: (ctx: IKeyObjectValue) => IKeyObjectValue[];
244
244
  visitFormalParameterList: (ctx: IKeyObjectValue) => IKeyObjectValue[];
245
- visitFormalParameterArg: (ctx: IKeyObjectValue) => IKeyObjectValue;
245
+ visitFormalParameterArg: (ctx: IKeyObjectValue) => IKeyObjectValue | undefined;
246
246
  private _verifyArgsDefaultValue;
247
247
  visitArrowMethod: (ctx: IKeyObjectValue) => IKeyObjectValue;
248
248
  private _exportArgsTypeVerify;