@brutalway/check-tree 0.7.0 → 0.8.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @brutalway/check-tree
2
2
 
3
- Checks the folders of a source tree, which a linter does not see: only the folders the layout names, no empty folder, no category folder with a single child, files of one kind grouped in that kind's folder once there are two of them, and no file in a `shared/` folder that a single feature uses.
3
+ Checks the folders of a source tree, which a linter does not see: only the folders the layout names, no empty folder, no category folder with a single child, files of one kind grouped in that kind's folder once there are two of them, no file in a slice of `shared/` that a single feature uses, and no slice whose files never import each other.
4
4
 
5
5
  ## Install
6
6
 
@@ -37,7 +37,7 @@ import { treeViolations } from '@brutalway/check-tree/treeViolations';
37
37
  const violations = treeViolations('src');
38
38
  ```
39
39
 
40
- It takes the category folders as second argument and `{ rootEntries: true }` as third, like `--categories` and `--root-entries`. The check on `shared/` reads the imports, so it has its own export:
40
+ It takes the category folders as second argument and `{ rootEntries: true }` as third, like `--categories` and `--root-entries`. The checks on the slices of `shared/` read the imports, so they have their own export:
41
41
 
42
42
  ```ts
43
43
  import { sharedViolations } from '@brutalway/check-tree/sharedViolations';
@@ -50,9 +50,9 @@ const violations = await sharedViolations('src');
50
50
  ### Rules
51
51
 
52
52
  - a folder has a name the layout gives it:
53
- - `src/` holds `app/`, `features/`, `shared-features/` and `shared/`, next to its entry files, and `app/` is not checked
54
- - `src/shared/` holds kind folders only (`lib/`, `types/`, `configs/`...), since it has no domain
55
- - a feature (`features/<x>/`) or a shared feature (`shared-features/<x>/`), at any depth, holds kind folders, `features/` for its sub-features, `shared-features/` for the business code they share and `shared/` for the code with no domain
53
+ - `src/` holds `app/`, `features/` and `shared/`, next to its entry files. `app/` belongs to the router, so its folders are not checked and its files stay where they are, whatever their kind
54
+ - a `shared/`, at any depth, holds one folder per slice, named after its concept (`shared/todos/`, `shared/errors/`), and no file
55
+ - a feature (`features/<x>/`) or a slice (`shared/<x>/`), at any depth, holds kind folders, `features/` for its sub-features and `shared/` for the slices they share
56
56
  - a kind folder holds kind folders only, like `presenters/` inside `components/`
57
57
  - no empty folder
58
58
  - a category folder (`components`, `hooks`, `stores`…) does not hold a single child: move the child up and delete the folder
@@ -77,7 +77,10 @@ const violations = await sharedViolations('src');
77
77
  | `stores/` | `xStore.ts` |
78
78
  | `lib/` | any other `.ts` file, except `xContent.ts`, `xEnv.ts` and `.d.ts` |
79
79
 
80
- - a file of a `shared/` folder is used by at least two consumers. For `src/shared/`, a consumer is a feature or a shared feature, a sub-feature counting as the feature it sits in. For the `shared/` of a feature or a shared feature, a consumer is one of its sub-features, one of its sub shared features, or its own files outside them. A file imported by another file of the same `shared/` gets the consumers of that file. A test counts for the feature it sits in, since moving the file would make that test import another feature, and a test next to the file in `shared/` adds no consumer. A file of `src/shared/` used only by `app/` or by the entry files of `src/` passes. A file with a single consumer gets `src/shared/lib/format.ts is only used by src/features/cart: move it into src/features/cart`.
80
+ - a file of a slice is used by at least two consumers. For `src/shared/`, a consumer is a feature or another slice, a sub-feature counting as the feature it sits in. For the `shared/` of a feature or a slice, a consumer is one of its sub-features, another of its slices, or its own files outside them. A file imported by another file of the same slice gets the consumers of that file. A test counts for the feature it sits in, since moving the file would make that test import another feature, and a test next to the file in the slice adds no consumer. A file of `src/shared/` used only by `app/` or by the entry files of `src/` passes. A file with a single consumer gets `src/shared/dates/format.ts is only used by src/features/cart: move it into src/features/cart`, which also catches a whole slice used by one feature.
81
+ - the files of a slice, tests aside, form one group in the import graph, whatever the direction of the imports. Since two slices never import each other, the folder then only names a boundary the graph already draws. A `shared/utils/` holding `errorMessage.ts`, `isRecord.ts` and `packageRoot.ts`, which do not import each other, gets `src/shared/utils holds 3 groups of files that never import each other (errorMessage.ts) (isRecord.ts) (packageRoot.ts): split it into one slice per group`. A slice of a single file is fine.
82
+
83
+ The first of these two rules says why a file is shared, the second why files sit together. Each one lets through what the other catches: in the `shared/utils/` above, each file has two consumers.
81
84
 
82
85
  So a feature with two components puts them in `components/`, and a `components/` folder with two presenters puts them in `presenters/`. The `components/` rule does not apply inside `components/`, `orchestrators/` or `presenters/`.
83
86
 
package/dist/checkTree.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { t as treeViolations } from "./treeViolations-lxAwbM5R.js";
3
- import { n as cruiseImports, t as sharedConsumerViolations } from "./sharedConsumerViolations-CmRppyrD.js";
2
+ import { t as treeViolations } from "./treeViolations-CEQ5ks7L.js";
3
+ import { n as cruiseImports, t as sliceViolations } from "./sliceViolations-DojT6WkL.js";
4
4
  import { resolve } from "node:path";
5
5
  import { parseArgs } from "node:util";
6
6
  // src/checkTree.ts
@@ -14,7 +14,7 @@ const { values, positionals } = parseArgs({
14
14
  const folder = positionals[0] ?? "src";
15
15
  const categories = values.categories?.split(",").map((category) => category.trim());
16
16
  try {
17
- const violations = [...treeViolations(resolve(folder), categories, { rootEntries: values["root-entries"] === true }), ...sharedConsumerViolations(folder, await cruiseImports(folder))];
17
+ const violations = [...treeViolations(resolve(folder), categories, { rootEntries: values["root-entries"] === true }), ...sliceViolations(folder, await cruiseImports(folder))];
18
18
  for (const violation of violations) console.error(violation);
19
19
  process.exitCode = violations.length === 0 ? 0 : 1;
20
20
  } catch (error) {
@@ -1,6 +1,6 @@
1
- import { n as cruiseImports, t as sharedConsumerViolations } from "./sharedConsumerViolations-CmRppyrD.js";
1
+ import { n as cruiseImports, t as sliceViolations } from "./sliceViolations-DojT6WkL.js";
2
2
  // src/sharedViolations.ts
3
3
  async function sharedViolations(root) {
4
- return sharedConsumerViolations(root, await cruiseImports(root));
4
+ return sliceViolations(root, await cruiseImports(root));
5
5
  }
6
6
  export { sharedViolations };
@@ -0,0 +1,139 @@
1
+ import { dirname, normalize } from "node:path";
2
+ import { existsSync } from "node:fs";
3
+ import { cruise } from "dependency-cruiser";
4
+ import extractDepcruiseOptions from "dependency-cruiser/config-utl/extract-depcruise-options";
5
+ import extractTSConfig from "dependency-cruiser/config-utl/extract-ts-config";
6
+ // src/features/shared-consumers/lib/cruiseImports.ts
7
+ const CONFIG_FILES = [
8
+ ".dependency-cruiser.js",
9
+ ".dependency-cruiser.cjs",
10
+ ".dependency-cruiser.mjs",
11
+ ".dependency-cruiser.json"
12
+ ];
13
+ async function cruiseImports(root) {
14
+ const configFile = CONFIG_FILES.find((file) => existsSync(file));
15
+ if (configFile === void 0) throw new Error(`check-tree reads the dependency-cruiser config to resolve imports, and the current folder has none of ${CONFIG_FILES.join(", ")}`);
16
+ const options = await extractDepcruiseOptions(`./${configFile}`);
17
+ const tsConfigFile = options.tsConfig?.fileName;
18
+ const result = await cruise([root], {
19
+ ...options,
20
+ validate: false,
21
+ tsPreCompilationDeps: true
22
+ }, {}, { tsConfig: tsConfigFile === void 0 ? void 0 : extractTSConfig(tsConfigFile) });
23
+ if (typeof result.output === "string") throw new Error(result.output);
24
+ return result.output.modules.map(({ source, dependencies }) => ({
25
+ source,
26
+ imports: dependencies.map(({ resolved }) => resolved)
27
+ }));
28
+ }
29
+ // src/features/shared-consumers/SharedConsumersConfig.ts
30
+ const TEST_CODE = /\.test\.tsx?$/u;
31
+ const SLICE = /^(?:features|shared)\/[^/]+/u;
32
+ const SLICE_FILE = /^((.*)\/shared\/[^/]+)\//u;
33
+ // src/features/shared-consumers/lib/checkedPaths.ts
34
+ function checkedPaths(checkedFolder) {
35
+ const root = normalize(checkedFolder).replace(/\/$/u, "");
36
+ const parent = dirname(root);
37
+ return {
38
+ root,
39
+ shown: (path) => parent === "." ? path : path.slice(parent.length + 1)
40
+ };
41
+ }
42
+ // src/features/shared-consumers/lib/consumerSlots.ts
43
+ function slotOf(owner, importer) {
44
+ if (!importer.startsWith(`${owner}/`)) return importer;
45
+ const slice = SLICE.exec(importer.slice(owner.length + 1));
46
+ return slice === null ? owner : `${owner}/${slice[0]}`;
47
+ }
48
+ function importersByModule(modules) {
49
+ const importers = /* @__PURE__ */ new Map();
50
+ for (const { source, imports } of modules) for (const target of imports) importers.set(target, [...importers.get(target) ?? [], source]);
51
+ return importers;
52
+ }
53
+ function consumerSlots(modules) {
54
+ const importers = importersByModule(modules);
55
+ const slotsByModule = /* @__PURE__ */ new Map();
56
+ return function slots(path, slice) {
57
+ const key = `${slice.folder}:${path}`;
58
+ const known = slotsByModule.get(key);
59
+ if (known !== void 0) return known;
60
+ const found = /* @__PURE__ */ new Set();
61
+ slotsByModule.set(key, found);
62
+ for (const importer of importers.get(path) ?? []) if (importer.startsWith(`${slice.folder}/`)) for (const slot of slots(importer, slice)) found.add(slot);
63
+ else found.add(slotOf(slice.owner, importer));
64
+ return found;
65
+ };
66
+ }
67
+ // src/features/shared-consumers/lib/sliceOf.ts
68
+ function sliceOf(path) {
69
+ const [, folder, owner] = SLICE_FILE.exec(path) ?? [];
70
+ if (folder === void 0 || owner === void 0) return void 0;
71
+ return {
72
+ owner,
73
+ folder
74
+ };
75
+ }
76
+ // src/features/shared-consumers/lib/sharedConsumerViolations.ts
77
+ function violation(path, owner, slot) {
78
+ if (slot === owner) return `${path} is only used by ${owner} outside its sub-features: move it out of shared/ into the kind folders of ${owner}`;
79
+ return `${path} is only used by ${slot}: move it into ${slot}`;
80
+ }
81
+ function sharedConsumerViolations(checkedFolder, modules) {
82
+ const { root, shown } = checkedPaths(checkedFolder);
83
+ const slots = consumerSlots(modules);
84
+ return modules.flatMap(({ source }) => {
85
+ const slice = sliceOf(source);
86
+ if (slice === void 0 || TEST_CODE.test(source) || !source.startsWith(`${root}/`)) return [];
87
+ const [slot, ...others] = slots(source, slice);
88
+ if (slot === void 0 || others.length > 0) return [];
89
+ if (slice.owner === root && !SLICE.test(slot.slice(root.length + 1))) return [];
90
+ return [violation(shown(source), shown(slice.owner), shown(slot))];
91
+ });
92
+ }
93
+ // src/features/shared-consumers/lib/sliceGroupViolations.ts
94
+ function sliceFolders(root, modules) {
95
+ const folders = /* @__PURE__ */ new Map();
96
+ for (const { source } of modules) {
97
+ const slice = sliceOf(source);
98
+ if (slice !== void 0 && !TEST_CODE.test(source) && source.startsWith(`${root}/`)) folders.set(source, slice.folder);
99
+ }
100
+ return folders;
101
+ }
102
+ function linkedGroups(modules, folders) {
103
+ const parents = new Map([...folders.keys()].map((file) => [file, file]));
104
+ function head(file) {
105
+ const parent = parents.get(file) ?? file;
106
+ if (parent === file) return file;
107
+ const found = head(parent);
108
+ parents.set(file, found);
109
+ return found;
110
+ }
111
+ for (const { source, imports } of modules) {
112
+ const folder = folders.get(source);
113
+ for (const target of imports) if (folder !== void 0 && folders.get(target) === folder) parents.set(head(source), head(target));
114
+ }
115
+ return head;
116
+ }
117
+ function groupsBySlice(folders, head) {
118
+ const slices = /* @__PURE__ */ new Map();
119
+ for (const [file, folder] of [...folders].toSorted(([a], [b]) => a.localeCompare(b))) {
120
+ const groups = slices.get(folder) ?? /* @__PURE__ */ new Map();
121
+ groups.set(head(file), [...groups.get(head(file)) ?? [], file.slice(folder.length + 1)]);
122
+ slices.set(folder, groups);
123
+ }
124
+ return slices;
125
+ }
126
+ function sliceGroupViolations(checkedFolder, modules) {
127
+ const { root, shown } = checkedPaths(checkedFolder);
128
+ const folders = sliceFolders(root, modules);
129
+ return [...groupsBySlice(folders, linkedGroups(modules, folders))].flatMap(([folder, groups]) => {
130
+ if (groups.size < 2) return [];
131
+ const listed = [...groups.values()].map((files) => `(${files.join(", ")})`).join(" ");
132
+ return [`${shown(folder)} holds ${groups.size} groups of files that never import each other ${listed}: split it into one slice per group`];
133
+ });
134
+ }
135
+ // src/features/shared-consumers/lib/sliceViolations.ts
136
+ function sliceViolations(checkedFolder, modules) {
137
+ return [...sharedConsumerViolations(checkedFolder, modules), ...sliceGroupViolations(checkedFolder, modules)];
138
+ }
139
+ export { cruiseImports as n, sliceViolations as t };
@@ -116,18 +116,13 @@ const FILE_GROUPS = [
116
116
  appliesIn: outsideOwnFolder("lib")
117
117
  }
118
118
  ];
119
- // src/features/tree-violations/features/layout/childLayer.ts
119
+ // src/features/tree-violations/features/layout/lib/childLayer.ts
120
120
  const SOURCE_LAYERS = /* @__PURE__ */ new Map([
121
- ["app", "free"],
121
+ ["app", "router"],
122
122
  ["features", "features"],
123
- ["shared-features", "features"],
124
- ["shared", "shared"]
125
- ]);
126
- const FEATURE_LAYERS = /* @__PURE__ */ new Map([
127
- ["features", "features"],
128
- ["shared-features", "features"],
129
- ["shared", "shared"]
123
+ ["shared", "slices"]
130
124
  ]);
125
+ const FEATURE_LAYERS = /* @__PURE__ */ new Map([["features", "features"], ["shared", "slices"]]);
131
126
  function kindFolder(path, categories, reason) {
132
127
  if (categories.has(basename(path))) return {
133
128
  layer: "kind",
@@ -146,7 +141,7 @@ function sourceChild(path) {
146
141
  };
147
142
  return {
148
143
  layer: "free",
149
- violations: [`${path} is not a layer: ${dirname(path)}/ holds app/, features/, shared-features/ and shared/ next to its entry files, move it into one of them`]
144
+ violations: [`${path} is not a layer: ${dirname(path)}/ holds app/, features/ and shared/ next to its entry files, move it into one of them`]
150
145
  };
151
146
  }
152
147
  function featureChild(path, categories) {
@@ -155,22 +150,35 @@ function featureChild(path, categories) {
155
150
  layer,
156
151
  violations: []
157
152
  };
158
- return kindFolder(path, categories, "a feature holds kind folders, features/ for its sub-features, shared-features/ for the business code they share and shared/, move it into features/ as a sub-feature or spread its files into kind folders");
153
+ return kindFolder(path, categories, "a feature or a slice holds kind folders, features/ for its sub-features and shared/ for the slices they share, move it into features/ as a sub-feature, into shared/ as a slice, or spread its files into kind folders");
159
154
  }
160
155
  function childLayer(layer, path, categories) {
161
156
  if (layer === "source") return sourceChild(path);
162
- if (layer === "features") return {
157
+ if (layer === "features" || layer === "slices") return {
163
158
  layer: "feature",
164
159
  violations: []
165
160
  };
166
161
  if (layer === "feature") return featureChild(path, categories);
167
- if (layer === "shared") return kindFolder(path, categories, `${dirname(path)}/ holds no domain, move its files into lib/, types/, configs/... or into a shared feature`);
162
+ if (layer === "router") return {
163
+ layer: "router",
164
+ violations: []
165
+ };
168
166
  if (layer === "kind") return kindFolder(path, categories, `${dirname(path)}/ holds its files and kind folders only`);
169
167
  return {
170
168
  layer: "free",
171
169
  violations: []
172
170
  };
173
171
  }
172
+ // src/features/tree-violations/features/layout/lib/filesCheck.ts
173
+ function filesCheck(layer, holdsEntries) {
174
+ if (layer === "slices") return "slices";
175
+ return layer === "router" || holdsEntries ? "none" : "groups";
176
+ }
177
+ // src/features/tree-violations/features/layout/lib/sliceFileViolations.ts
178
+ function sliceFileViolations(name, files) {
179
+ if (files.length === 0) return [];
180
+ return [`${name} holds ${files.join(", ")}: shared/ holds one folder per slice, move each file into the slice of its concept`];
181
+ }
174
182
  // src/features/tree-violations/treeViolations.ts
175
183
  function groupViolations(name, folderName, listing, categoryFolders) {
176
184
  const holdsFilesOnly = categoryFolders.has(folderName) && listing.folders.size === 0;
@@ -194,18 +202,19 @@ function shapeViolations(name, count, isCategory) {
194
202
  if (count === 1 && isCategory) return [`${name} holds a single child: move it up one level and delete the folder`];
195
203
  return [];
196
204
  }
197
- function folderViolations(folder, name, categoryFolders, groupsFiles) {
205
+ function folderViolations(folder, name, categoryFolders, check) {
198
206
  const children = readdirSync(folder, { withFileTypes: true }).filter((entry) => !TEST_FILE.test(entry.name));
199
207
  const violations = shapeViolations(name, children.length, categoryFolders.has(basename(folder)));
200
- if (!groupsFiles) return violations;
201
208
  const listing = folderListing(children);
209
+ if (check === "slices") return [...violations, ...sliceFileViolations(name, listing.files)];
210
+ if (check === "none") return violations;
202
211
  return [...violations, ...groupViolations(name, basename(folder), listing, categoryFolders)];
203
212
  }
204
213
  function treeViolations(root, categoryFolders = DEFAULT_CATEGORY_FOLDERS, options = {}) {
205
214
  const categories = new Set(categoryFolders);
206
215
  function walk(folder, layer) {
207
216
  const name = relative(join(root, ".."), folder);
208
- return [...folderViolations(folder, name, categories, folder !== root || options.rootEntries !== true), ...readdirSync(folder, { withFileTypes: true }).filter((entry) => entry.isDirectory()).flatMap((entry) => {
217
+ return [...folderViolations(folder, name, categories, filesCheck(layer, folder === root && options.rootEntries === true)), ...readdirSync(folder, { withFileTypes: true }).filter((entry) => entry.isDirectory()).flatMap((entry) => {
209
218
  const child = childLayer(layer, `${name}/${entry.name}`, categories);
210
219
  return [...child.violations, ...walk(join(folder, entry.name), child.layer)];
211
220
  })];
@@ -1 +1 @@
1
- export { t as treeViolations } from "./treeViolations-lxAwbM5R.js";
1
+ export { t as treeViolations } from "./treeViolations-CEQ5ks7L.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@brutalway/check-tree",
3
- "version": "0.7.0",
4
- "description": "Checks a source tree: only the folders the layout names, no empty folder, no category folder holding a single child, stylesheets grouped in styles/, no file of shared/ used by a single feature.",
3
+ "version": "0.8.0",
4
+ "description": "Checks a source tree: only the folders the layout names, no empty folder, no category folder holding a single child, stylesheets grouped in styles/, no file of a slice of shared/ used by a single feature, no slice whose files never import each other.",
5
5
  "keywords": [
6
6
  "lint",
7
7
  "folder-structure",
@@ -1,75 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import { cruise } from "dependency-cruiser";
3
- import extractDepcruiseOptions from "dependency-cruiser/config-utl/extract-depcruise-options";
4
- import extractTSConfig from "dependency-cruiser/config-utl/extract-ts-config";
5
- // src/features/shared-consumers/lib/cruiseImports.ts
6
- const CONFIG_FILES = [
7
- ".dependency-cruiser.js",
8
- ".dependency-cruiser.cjs",
9
- ".dependency-cruiser.mjs",
10
- ".dependency-cruiser.json"
11
- ];
12
- async function cruiseImports(root) {
13
- const configFile = CONFIG_FILES.find((file) => existsSync(file));
14
- if (configFile === void 0) throw new Error(`check-tree reads the dependency-cruiser config to resolve imports, and the current folder has none of ${CONFIG_FILES.join(", ")}`);
15
- const options = await extractDepcruiseOptions(`./${configFile}`);
16
- const tsConfigFile = options.tsConfig?.fileName;
17
- const result = await cruise([root], {
18
- ...options,
19
- validate: false,
20
- tsPreCompilationDeps: true
21
- }, {}, { tsConfig: tsConfigFile === void 0 ? void 0 : extractTSConfig(tsConfigFile) });
22
- if (typeof result.output === "string") throw new Error(result.output);
23
- return result.output.modules.map(({ source, dependencies }) => ({
24
- source,
25
- imports: dependencies.map(({ resolved }) => resolved)
26
- }));
27
- }
28
- // src/features/shared-consumers/SharedConsumersConfig.ts
29
- const TEST_CODE = /\.test\.tsx?$/u;
30
- const SLICE = /^(?:features|shared-features)\/[^/]+/u;
31
- // src/features/shared-consumers/lib/consumerSlots.ts
32
- function slotOf(owner, importer) {
33
- if (!importer.startsWith(`${owner}/`)) return importer;
34
- const slice = SLICE.exec(importer.slice(owner.length + 1));
35
- return slice === null ? owner : `${owner}/${slice[0]}`;
36
- }
37
- function importersByModule(modules) {
38
- const importers = /* @__PURE__ */ new Map();
39
- for (const { source, imports } of modules) for (const target of imports) importers.set(target, [...importers.get(target) ?? [], source]);
40
- return importers;
41
- }
42
- function consumerSlots(modules) {
43
- const importers = importersByModule(modules);
44
- const slotsByModule = /* @__PURE__ */ new Map();
45
- return function slots(path, owner) {
46
- const known = slotsByModule.get(path);
47
- if (known !== void 0) return known;
48
- const found = /* @__PURE__ */ new Set();
49
- slotsByModule.set(path, found);
50
- for (const importer of importers.get(path) ?? []) if (importer.startsWith(`${owner}/shared/`)) for (const slot of slots(importer, owner)) found.add(slot);
51
- else found.add(slotOf(owner, importer));
52
- return found;
53
- };
54
- }
55
- // src/features/shared-consumers/lib/sharedConsumerViolations.ts
56
- function ownerOf(path) {
57
- const index = path.lastIndexOf("/shared/");
58
- return index === -1 ? void 0 : path.slice(0, index);
59
- }
60
- function violation(path, owner, slot) {
61
- if (slot === owner) return `${path} is only used by ${owner} outside its sub-features: move it out of shared/ into the kind folders of ${owner}`;
62
- return `${path} is only used by ${slot}: move it into ${slot}`;
63
- }
64
- function sharedConsumerViolations(root, modules) {
65
- const slots = consumerSlots(modules);
66
- return modules.flatMap(({ source }) => {
67
- const owner = ownerOf(source);
68
- if (owner === void 0 || TEST_CODE.test(source) || !source.startsWith(`${root}/`)) return [];
69
- const [slot, ...others] = slots(source, owner);
70
- if (slot === void 0 || others.length > 0) return [];
71
- if (owner === root && !SLICE.test(slot.slice(root.length + 1))) return [];
72
- return [violation(source, owner, slot)];
73
- });
74
- }
75
- export { cruiseImports as n, sharedConsumerViolations as t };