Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cope with 'min' in names like 'Admin' #8

Merged
merged 2 commits into from
Dec 19, 2016
Merged

Conversation

corneliusweiss
Copy link
Contributor

Hi,

the current code fails with names like 'Admin.js'

kind regards
Cornelius

var minIndex = name.lastIndexOf('min');
if (minIndex > -1) {
return name.substring(0, minIndex - 1) + name.substring(minIndex + 3);
if (name.match(/([-_.]min)[-_.]/)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to check -_ as well? Is it necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't hurt and thus you can cope with names like
'Admin-min-inc.js'
'Admin-min.js'
...

@leftstick leftstick merged commit 03bd0c2 into leftstick:master Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants