@putout/operator-json 1.0.0 → 1.0.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.
package/README.md CHANGED
@@ -15,18 +15,18 @@ npm i putout @putout/operator-json
15
15
 
16
16
  ### `__json`
17
17
 
18
- ```
19
- export const traverse = ({
20
- [__json]: (path) => {
21
- },
18
+ ```js
19
+ export const traverse = ({push}) => ({
20
+ [__json]: push,
22
21
  });
23
22
  ```
24
23
 
25
24
  ### `__filesystem`
26
25
 
27
- ```
28
- export const traverse = ({
26
+ ```js
27
+ export const traverse = ({push}) => ({
29
28
  [__filesystem]: (path) => {
29
+ push(path);
30
30
  },
31
31
  });
32
32
  ```
@@ -46,7 +46,7 @@ toJS('{"hello": "world"}', __filesystem);
46
46
  ### `fromJS(source: string, name?: string)`;
47
47
 
48
48
  ```js
49
- fromJS(`__putout_processor_json('{"hello": "world"}');
49
+ fromJS(`__putout_processor_json('{"hello": "world"}'`);
50
50
  // returns
51
51
  `{"hello": "world"}`;
52
52
  ```
package/lib/json.js CHANGED
@@ -1,3 +1,5 @@
1
+ 'use strict';
2
+
1
3
  const removeBlankLines = require('remove-blank-lines');
2
4
 
3
5
  const maybeNewline = (a) => a.at(-1) === '\n' ? a : `${a}\n`;
@@ -25,4 +27,3 @@ module.exports.fromJS = (source, name = __json) => {
25
27
 
26
28
  return maybeNewline(removeBlankLines(sliced));
27
29
  };
28
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/operator-json",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout operator adds ability to json referenced variables that was not defined",