Skip to content
This repository has been archived by the owner on Feb 6, 2018. It is now read-only.

Commit

Permalink
refactor(entity): should not to create BemEntityName twice
Browse files Browse the repository at this point in the history
  • Loading branch information
blond committed Mar 10, 2017
1 parent 701df0c commit e619572
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/walkers/flat.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const fs = require('fs');
const path = require('path');

const bemNaming = require('@bem/naming');
const BemEntityName = require('@bem/entity-name');
const BemCell = require('@bem/cell');

const BemFile = require('../bem-file');
Expand Down Expand Up @@ -37,7 +36,7 @@ module.exports = (info, add, callback) => {

if (entity) {
const cell = new BemCell({
entity: new BemEntityName(entity),
entity: entity,
tech: basename.substring(dotIndex + 1),
layer: levelpath
});
Expand Down
6 changes: 3 additions & 3 deletions lib/walkers/nested.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class LevelWalker {
if (tech && entity && scope.block === entity.block && scope.modName === entity.modName) {
this.add(new BemFile(
new BemCell({
entity: new BemEntityName(entity),
entity: entity,
tech: tech,
layer: this.levelpath
}),
Expand Down Expand Up @@ -175,7 +175,7 @@ class LevelWalker {

this.add(new BemFile(
new BemCell({
entity: new BemEntityName(entity),
entity: entity,
tech: tech,
layer: this.levelpath
}),
Expand Down Expand Up @@ -216,7 +216,7 @@ class LevelWalker {
) {
this.add(new BemFile(
new BemCell({
entity: new BemEntityName(entity),
entity: entity,
tech: tech,
layer: this.levelpath
}),
Expand Down

0 comments on commit e619572

Please sign in to comment.