@taquito/michel-codec 24.2.0 → 24.3.0-beta.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.
@@ -234,8 +234,7 @@ function assertStringOrBytes(ex) {
234
234
  throw new MichelsonValidationError(ex, 'string or bytes literal expected');
235
235
  }
236
236
  function assertArgs(ex, n) {
237
- var _a;
238
- if ((n === 0 && ex.args === undefined) || ((_a = ex.args) === null || _a === void 0 ? void 0 : _a.length) === n) {
237
+ if ((n === 0 && ex.args === undefined) || ex.args?.length === n) {
239
238
  return true;
240
239
  }
241
240
  throw new MichelsonValidationError(ex, `${n} arguments expected`);
@@ -246,7 +245,6 @@ function assertArgs(ex, n) {
246
245
  * @param ex An AST node
247
246
  */
248
247
  function assertMichelsonInstruction(ex) {
249
- var _a, _b;
250
248
  if (Array.isArray(ex)) {
251
249
  for (const n of ex) {
252
250
  if (!Array.isArray(n) && !isPrim(n)) {
@@ -340,7 +338,7 @@ function assertMichelsonInstruction(ex) {
340
338
  }
341
339
  break;
342
340
  case 'DIP':
343
- if (((_a = ex.args) === null || _a === void 0 ? void 0 : _a.length) === 2) {
341
+ if (ex.args?.length === 2) {
344
342
  /* istanbul ignore else */
345
343
  if (assertIntLiteral(ex.args[0])) {
346
344
  assertNatural(ex.args[0]);
@@ -350,7 +348,7 @@ function assertMichelsonInstruction(ex) {
350
348
  assertMichelsonInstruction(ex.args[1]);
351
349
  }
352
350
  }
353
- else if (((_b = ex.args) === null || _b === void 0 ? void 0 : _b.length) === 1) {
351
+ else if (ex.args?.length === 1) {
354
352
  /* istanbul ignore else */
355
353
  if (assertSeq(ex.args[0])) {
356
354
  assertMichelsonInstruction(ex.args[0]);
@@ -771,7 +769,7 @@ function isMichelsonScript(ex) {
771
769
  assertMichelsonContract(ex);
772
770
  return true;
773
771
  }
774
- catch (_a) {
772
+ catch {
775
773
  return false;
776
774
  }
777
775
  }
@@ -784,7 +782,7 @@ function isMichelsonData(ex) {
784
782
  assertMichelsonData(ex);
785
783
  return true;
786
784
  }
787
- catch (_a) {
785
+ catch {
788
786
  return false;
789
787
  }
790
788
  }
@@ -797,7 +795,7 @@ function isMichelsonCode(ex) {
797
795
  assertMichelsonInstruction(ex);
798
796
  return true;
799
797
  }
800
- catch (_a) {
798
+ catch {
801
799
  return false;
802
800
  }
803
801
  }
@@ -810,7 +808,7 @@ function isMichelsonType(ex) {
810
808
  assertMichelsonType(ex);
811
809
  return true;
812
810
  }
813
- catch (_a) {
811
+ catch {
814
812
  return false;
815
813
  }
816
814
  }
package/dist/lib/scan.js CHANGED
@@ -5,7 +5,7 @@ exports.scan = scan;
5
5
  const core_1 = require("@taquito/core");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure when performing the scan step when parsing Michelson
8
+ * Error that indicates a failure when performing the scan step when parsing Michelson
9
9
  */
10
10
  class ScanError extends core_1.TaquitoError {
11
11
  constructor(src, idx, message) {
package/dist/lib/utils.js CHANGED
@@ -20,12 +20,11 @@ const errors_1 = require("./errors");
20
20
  const core_1 = require("@taquito/core");
21
21
  /**
22
22
  * @category Error
23
- * @description Error that indicates a Michelson failure occurring
23
+ * Error that indicates a Michelson failure occurring
24
24
  */
25
25
  class MichelsonError extends core_1.TaquitoError {
26
26
  /**
27
27
  * @param val Value of a AST node caused the error
28
- * @param path Path to a node caused the error
29
28
  * @param message An error message
30
29
  */
31
30
  constructor(val, message) {
@@ -149,7 +148,7 @@ function isDecimal(x) {
149
148
  new LongInteger(x);
150
149
  return true;
151
150
  }
152
- catch (_a) {
151
+ catch {
153
152
  return false;
154
153
  }
155
154
  }
@@ -157,7 +156,7 @@ function isNatural(x) {
157
156
  try {
158
157
  return new LongInteger(x).sign >= 0;
159
158
  }
160
- catch (_a) {
159
+ catch {
161
160
  return false;
162
161
  }
163
162
  }
@@ -173,13 +172,13 @@ function unpackAnnotations(p, opt) {
173
172
  for (const v of p.annots) {
174
173
  if (v.length !== 0) {
175
174
  if (!annRe.test(v) ||
176
- (!(opt === null || opt === void 0 ? void 0 : opt.specialVar) && (v === '@%' || v === '@%%')) ||
177
- (!(opt === null || opt === void 0 ? void 0 : opt.specialFields) && v === '%@')) {
175
+ (!opt?.specialVar && (v === '@%' || v === '@%%')) ||
176
+ (!opt?.specialFields && v === '%@')) {
178
177
  throw new MichelsonError(p, `${p.prim}: unexpected annotation: ${v}`);
179
178
  }
180
179
  switch (v[0]) {
181
180
  case '%':
182
- if ((opt === null || opt === void 0 ? void 0 : opt.emptyFields) || v.length > 1) {
181
+ if (opt?.emptyFields || v.length > 1) {
183
182
  field = field || [];
184
183
  field.push(v);
185
184
  }
@@ -191,7 +190,7 @@ function unpackAnnotations(p, opt) {
191
190
  }
192
191
  break;
193
192
  case '@':
194
- if ((opt === null || opt === void 0 ? void 0 : opt.emptyVar) || v.length > 1) {
193
+ if (opt?.emptyVar || v.length > 1) {
195
194
  vars = vars || [];
196
195
  vars.push(v);
197
196
  }
@@ -272,13 +271,16 @@ function unpackComb(id, v) {
272
271
  };
273
272
  return ret;
274
273
  }
275
- return Object.assign(Object.assign({}, (Array.isArray(vv) ? { prim: id } : vv)), { args: [
274
+ return {
275
+ ...(Array.isArray(vv) ? { prim: id } : vv),
276
+ args: [
276
277
  args[0],
277
278
  {
278
279
  prim: id,
279
280
  args: args.slice(1),
280
281
  },
281
- ] });
282
+ ],
283
+ };
282
284
  }
283
285
  function isPairType(t) {
284
286
  return Array.isArray(t) || t.prim === 'pair';
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT!
5
5
  exports.VERSION = {
6
- "commitHash": "105a7b15cfb862a0732c204e0e9741098d697775",
7
- "version": "24.2.0"
6
+ "commitHash": "27675679db6515e8b092195ef5c58c2c0ea5f5c8",
7
+ "version": "24.3.0-beta.0"
8
8
  };