@putout/printer 6.1.0 → 6.2.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.
Files changed (3) hide show
  1. package/ChangeLog +10 -0
  2. package/lib/json.js +10 -1
  3. package/package.json +2 -1
package/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2023.11.09, v6.2.0
2
+
3
+ feature:
4
+ - 6892d1c @putout/printer: json: add support of @putout/processor-filesystem
5
+
6
+ 2023.11.03, v6.1.1
7
+
8
+ fix:
9
+ - 558127e @putout/printer: json: override
10
+
1
11
  2023.11.02, v6.1.0
2
12
 
3
13
  feature:
package/lib/json.js CHANGED
@@ -6,15 +6,18 @@ const {
6
6
  } = require('@putout/babel').types;
7
7
 
8
8
  const {isJSON} = require('@putout/processor-json/is-json');
9
+ const {isFilesystem} = require('@putout/processor-filesystem/is-filesystem');
9
10
 
10
11
  module.exports.maybeJSON = (ast, overrides) => {
11
12
  if (isASTJSON(ast)) {
12
13
  return {
13
14
  ...overrides,
14
15
  format: {
16
+ ...overrides?.format,
15
17
  quote: `"`,
16
18
  },
17
19
  semantics: {
20
+ ...overrides?.semantics,
18
21
  trailingComma: false,
19
22
  },
20
23
  };
@@ -44,5 +47,11 @@ function isASTJSON(ast) {
44
47
  if (!isIdentifier(callee))
45
48
  return false;
46
49
 
47
- return isJSON(callee.name);
50
+ const {name} = callee;
51
+
52
+ if (isJSON(name))
53
+ return true;
54
+
55
+ if (isFilesystem(name))
56
+ return true;
48
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "6.1.0",
3
+ "version": "6.2.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",
@@ -30,6 +30,7 @@
30
30
  "@putout/babel": "^1.1.1",
31
31
  "@putout/compare": "^13.0.0",
32
32
  "@putout/operate": "^11.0.0",
33
+ "@putout/processor-filesystem": "^1.1.0",
33
34
  "@putout/processor-json": "^7.0.0",
34
35
  "fullstore": "^3.0.0",
35
36
  "just-snake-case": "^3.2.0",