feat(module): select module to add generations to for declaration#1966
Merged
Brocco merged 1 commit intoangular:masterfrom Sep 4, 2016
Merged
feat(module): select module to add generations to for declaration#1966Brocco merged 1 commit intoangular:masterfrom
Brocco merged 1 commit intoangular:masterfrom
Conversation
24a31ed to
f6a6351
Compare
| var dynamicPathParser = require('../../utilities/dynamic-path-parser'); | ||
| const stringUtils = require('ember-cli-string-utils'); | ||
| const astUtils = require('../../utilities/ast-utils'); | ||
| var findParentModule = require('../../utilities/find-parent-module'); |
f6a6351 to
77148b2
Compare
|
|
||
|
|
||
| for (let i = 0; i <= partsLength; i++) { | ||
| let files: string[] = fs.readdirSync(pathToCheck); |
Contributor
There was a problem hiding this comment.
You don't need the type information, and you could just do
const files = fs.readdirSync(pathToCheck)
.filter(fileName => fileName.endsWith('.module.ts')
.filter(fileName => fs.statsSync(fileName).isFile());Right now there's a bug (unlikely but still) that if it contains .module.ts (but doesn't end with) it will match. Also, a bug that it doesn't check if it's a directory or a regular file.
77148b2 to
d01f5e8
Compare
| import * as path from 'path'; | ||
| const SilentError = require('silent-error'); | ||
|
|
||
| export function findParentModule( |
Contributor
There was a problem hiding this comment.
Everything fits on one line now. \o/
1f7a7e6 to
3582e72
Compare
Contributor
|
2 nits: code in comments and |
3582e72 to
0034fca
Compare
Note: this also displays a warning stating that services are not provided by default
0034fca to
fd52c20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: this also displays a warning stating that services are not provided by default