-
Notifications
You must be signed in to change notification settings - Fork 56
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
Limits the number of class-combinations to avoid freeze #23
Conversation
Please merge this. It will fix the freeze when there are many classes on one element. |
@@ -0,0 +1,31 @@ | |||
function kCombinations( result, items, data, start, end, index, k ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing jsdoc block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will create one.
src/getCombinations.js
Outdated
/** | ||
* Returns all the possible selector combinations | ||
*/ | ||
export function getCombinations( items, k ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls add jsdoc block (@param
, @returns
)
@@ -35,6 +35,15 @@ describe( 'Unique Selector Tests', () => | |||
expect( uniqueSelector ).to.equal( 'body > :nth-child(1)' ); | |||
} ); | |||
|
|||
it( 'Classes', () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should explain what is testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I named the tests after your tests which are not any more descriptive than this one either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I see, there are not more descriptive indeed. Sorry, I cant remember the codebase, I havent work on the project the last months.
This is especially useful for the modernizr sites which have dozens of classes attached to their
<html>
element.