@putout/processor-filesystem 1.4.0 → 2.0.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 (2) hide show
  1. package/lib/filesystem.js +8 -14
  2. package/package.json +3 -3
package/lib/filesystem.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import filesystemCLI from '@putout/cli-filesystem';
2
2
  import filesystem from '@putout/operator-filesystem';
3
- import {name} from './name.cjs';
4
- import {isFilesystem} from './is-filesystem.cjs';
3
+ import {
4
+ fromJS,
5
+ toJS,
6
+ __filesystem,
7
+ } from '@putout/operator-json';
5
8
 
6
- const prefix = `${name}(`;
7
- const sufix = ');\n';
9
+ import {isFilesystem} from './is-filesystem.cjs';
8
10
 
9
11
  export const files = [
10
12
  '.filesystem.json',
@@ -13,7 +15,7 @@ export const files = [
13
15
  export const branch = (rawSource) => {
14
16
  filesystem.init(filesystemCLI);
15
17
 
16
- const source = toJS(rawSource);
18
+ const source = toJS(rawSource, __filesystem);
17
19
 
18
20
  return [{
19
21
  source,
@@ -25,13 +27,5 @@ export const merge = (rawSource, list) => {
25
27
 
26
28
  const [source] = list.filter(isFilesystem);
27
29
 
28
- return fromJS(source) + '\n';
29
- };
30
-
31
- const toJS = (source) => `${prefix}${source}${sufix}`;
32
-
33
- const fromJS = (source) => {
34
- const length = source.length - sufix.length;
35
-
36
- return source.slice(prefix.length, length);
30
+ return fromJS(source, __filesystem);
37
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/processor-filesystem",
3
- "version": "1.4.0",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout processor adds ability to lint filesystem",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@putout/cli-filesystem": "^1.0.0",
58
- "@putout/operator-filesystem": "^1.0.0",
59
- "remove-blank-lines": "^1.4.1"
58
+ "@putout/operator-filesystem": "^2.0.0",
59
+ "@putout/operator-json": "^1.0.1"
60
60
  }
61
61
  }