@putout/engine-parser 6.3.0 → 6.4.1

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.
@@ -2,7 +2,9 @@
2
2
 
3
3
  module.exports = [
4
4
  'importMeta',
5
- 'importAttributes',
5
+ ['importAttributes', {
6
+ deprecatedAssertSyntax: true,
7
+ }],
6
8
  'dynamicImport',
7
9
  'bigInt',
8
10
  'classProperties',
package/lib/print.js CHANGED
@@ -8,6 +8,7 @@ const {stringify} = JSON;
8
8
  const {isArray} = Array;
9
9
 
10
10
  const maybeArray = (a) => isArray(a) ? a : [a, {}];
11
+
11
12
  const btoa = (a) => Buffer.from(a, 'binary').toString('base64');
12
13
 
13
14
  const addSourceMap = (sourceMapName, {code, map}) => !sourceMapName ? code : `${code}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(stringify(map))}\n`;
package/lib/template.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const template = require('@babel/template').default;
4
- const memo = require('nano-memoize');
4
+ const {nanomemoize} = require('nano-memoize');
5
5
  const plugins = require('./parsers/babel/plugins');
6
6
  const options = require('./parsers/babel/options');
7
7
 
@@ -14,7 +14,7 @@ const defaults = {
14
14
  ],
15
15
  };
16
16
 
17
- module.exports = memo((value, options) => {
17
+ module.exports = nanomemoize((value, options) => {
18
18
  const fn = template(value, {
19
19
  ...defaults,
20
20
  ...options,
@@ -23,7 +23,7 @@ module.exports = memo((value, options) => {
23
23
  return fn;
24
24
  });
25
25
 
26
- module.exports.ast = memo((value, options) => {
26
+ module.exports.ast = nanomemoize((value, options) => {
27
27
  const result = template.ast(value, {
28
28
  ...defaults,
29
29
  ...options,
@@ -32,7 +32,7 @@ module.exports.ast = memo((value, options) => {
32
32
  return result.expression || result;
33
33
  });
34
34
 
35
- module.exports.program = memo((value, options) => {
35
+ module.exports.program = nanomemoize((value, options) => {
36
36
  const result = template.program(value, {
37
37
  ...defaults,
38
38
  ...options,
@@ -41,7 +41,7 @@ module.exports.program = memo((value, options) => {
41
41
  return result;
42
42
  });
43
43
 
44
- module.exports.program.ast = memo((value, options) => {
44
+ module.exports.program.ast = nanomemoize((value, options) => {
45
45
  const result = template.program.ast(value, {
46
46
  ...defaults,
47
47
  ...options,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/engine-parser",
3
- "version": "6.3.0",
3
+ "version": "6.4.1",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout parser",
@@ -40,7 +40,7 @@
40
40
  "@putout/printer": "^1.20.0",
41
41
  "@putout/recast": "^1.12.1",
42
42
  "estree-to-babel": "^5.0.0",
43
- "nano-memoize": "^2.0.0",
43
+ "nano-memoize": "^3.0.11",
44
44
  "once": "^1.4.0",
45
45
  "try-catch": "^3.0.0"
46
46
  },