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

+extended format of plugin settings (now it can be set via arrays, li… #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

plandem
Copy link

@plandem plandem commented Oct 26, 2016

+extended format of plugin settings (now it can be set via arrays, like at webpack.config.js. E.g.: ['fetchLocal', { source: 'locales', skip: true }])

*fixed sorting of final result - now it sorts correctly!

+added cli arg to supress non critical information

…ke at webpack.config.js. E.g.: ['fetchLocal', { source: 'locales', skip: true }])

*fixed sorting of final result - now it sorts correctly!
@@ -4,7 +4,7 @@ import { join } from 'path';

function sortKey(obj) {
return Object.keys(obj)
.sort((a, b) => a.toString().toLowerCase() > b.toString().toLowerCase())
.sort()
Copy link
Member

@jaredleechn jaredleechn Nov 10, 2016

Choose a reason for hiding this comment

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

@plandem can you give a case for the updating of this line ?

Copy link
Author

@plandem plandem Nov 10, 2016

Choose a reason for hiding this comment

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

Sure! in your case you will not have same result. Sort can return: -1, 0, 1. Your way returning true/false only.

If you want to sort with case insensitive, then you must do like this:

sort = (a,b) => {
    a = a.toLowerCase();
    b = b.toLowerCase();
    if( a == b) return 0;
    if( a > b) return 1;
    return -1;
};

or

sort = (a, b) => a.localeCompare(b,  { sensitivity:'base' });

],
},
};

Copy link
Member

Choose a reason for hiding this comment

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

could you make a fix about the indent, using 2 spaces instead of tab? 😸

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.

2 participants