Skip to content

Commit 16cafc4

Browse files
committed
rename factory to builder
1 parent 0f0de8b commit 16cafc4

12 files changed

+16
-16
lines changed

Diff for: .eslintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
{
230230
"files": [
231231
"utils/**", // TODO
232-
"src/exportMapFactory.js", // TODO
232+
"src/exportMapBuilder.js", // TODO
233233
],
234234
"rules": {
235235
"no-use-before-define": "off",

Diff for: src/exportMapFactory.js renamed to src/exportMapBuilder.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ const availableDocStyleParsers = {
118118

119119
const supportedImportTypes = new Set(['ImportDefaultSpecifier', 'ImportNamespaceSpecifier']);
120120

121-
export default class ExportMapFactory {
121+
export default class ExportMapBuilder {
122122
static get(source, context) {
123123
const path = resolve(source, context);
124124
if (path == null) { return null; }
125125

126-
return ExportMapFactory.for(childContext(path, context));
126+
return ExportMapBuilder.for(childContext(path, context));
127127
}
128128

129129
static for(context) {
@@ -167,7 +167,7 @@ export default class ExportMapFactory {
167167
}
168168

169169
log('cache miss', cacheKey, 'for path', path);
170-
exportMap = ExportMapFactory.parse(path, content, context);
170+
exportMap = ExportMapBuilder.parse(path, content, context);
171171

172172
// ambiguous modules return null
173173
if (exportMap == null) {
@@ -271,7 +271,7 @@ export default class ExportMapFactory {
271271
function resolveImport(value) {
272272
const rp = remotePath(value);
273273
if (rp == null) { return null; }
274-
return ExportMapFactory.for(childContext(rp, context));
274+
return ExportMapBuilder.for(childContext(rp, context));
275275
}
276276

277277
function getNamespace(identifier) {
@@ -562,7 +562,7 @@ export default class ExportMapFactory {
562562
* caused memory leaks. See #1266.
563563
*/
564564
function thunkFor(p, context) {
565-
return () => ExportMapFactory.for(childContext(p, context));
565+
return () => ExportMapBuilder.for(childContext(p, context));
566566
}
567567

568568
/**

Diff for: src/rules/default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Exports from '../exportMapFactory';
1+
import Exports from '../exportMapBuilder';
22
import docsUrl from '../docsUrl';
33

44
module.exports = {

Diff for: src/rules/export.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ExportMap, { recursivePatternCapture } from '../exportMapFactory';
1+
import ExportMap, { recursivePatternCapture } from '../exportMapBuilder';
22
import docsUrl from '../docsUrl';
33
import includes from 'array-includes';
44
import flatMap from 'array.prototype.flatmap';

Diff for: src/rules/named.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from 'path';
2-
import Exports from '../exportMapFactory';
2+
import Exports from '../exportMapBuilder';
33
import docsUrl from '../docsUrl';
44

55
module.exports = {

Diff for: src/rules/namespace.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import declaredScope from 'eslint-module-utils/declaredScope';
2-
import Exports from '../exportMapFactory';
2+
import Exports from '../exportMapBuilder';
33
import ExportMap from '../exportMap';
44
import importDeclaration from '../importDeclaration';
55
import docsUrl from '../docsUrl';

Diff for: src/rules/no-cycle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import resolve from 'eslint-module-utils/resolve';
7-
import Exports from '../exportMapFactory';
7+
import Exports from '../exportMapBuilder';
88
import { isExternalModule } from '../core/importType';
99
import moduleVisitor, { makeOptionsSchema } from 'eslint-module-utils/moduleVisitor';
1010
import docsUrl from '../docsUrl';

Diff for: src/rules/no-deprecated.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import declaredScope from 'eslint-module-utils/declaredScope';
2-
import Exports from '../exportMapFactory';
2+
import Exports from '../exportMapBuilder';
33
import ExportMap from '../exportMap';
44
import docsUrl from '../docsUrl';
55

Diff for: src/rules/no-named-as-default-member.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @copyright 2016 Desmond Brand. All rights reserved.
55
* See LICENSE in root directory for full license.
66
*/
7-
import Exports from '../exportMapFactory';
7+
import Exports from '../exportMapBuilder';
88
import importDeclaration from '../importDeclaration';
99
import docsUrl from '../docsUrl';
1010

Diff for: src/rules/no-named-as-default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Exports from '../exportMapFactory';
1+
import Exports from '../exportMapBuilder';
22
import importDeclaration from '../importDeclaration';
33
import docsUrl from '../docsUrl';
44

Diff for: src/rules/no-unused-modules.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import values from 'object.values';
1313
import includes from 'array-includes';
1414
import flatMap from 'array.prototype.flatmap';
1515

16-
import Exports, { recursivePatternCapture } from '../exportMapFactory';
16+
import Exports, { recursivePatternCapture } from '../exportMapBuilder';
1717
import docsUrl from '../docsUrl';
1818

1919
let FileEnumerator;

Diff for: tests/src/core/getExports.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import sinon from 'sinon';
44
import eslintPkg from 'eslint/package.json';
55
import typescriptPkg from 'typescript/package.json';
66
import * as tsConfigLoader from 'tsconfig-paths/lib/tsconfig-loader';
7-
import ExportMap from '../../../src/exportMapFactory';
7+
import ExportMap from '../../../src/exportMapBuilder';
88

99
import * as fs from 'fs';
1010

0 commit comments

Comments
 (0)