Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 866 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 866 Bytes

Selector Kit Build Status

Usage

{Selector} = require 'selector-kit'

# Creates one Selector
[someNodeSelector] = Selector.create('.some-node')

# Creates two selectors, due to the `,`
[someNodeSelector, anotherNodeSelector] = Selector.create('.some-node, .another-node')

someNodeSelector.matches('.parent .some-node') # => true
someNodeSelector.matches('.parent .whatever') # => false

anotherNodeSelector.matches('.parent .another-node') # => true
anotherNodeSelector.matches('.parent .whatever') # => false

# Other supported methods
someNodeSelector.toString() # => '.some-node'
someNodeSelector.getSpecificity() # => 20
someNodeSelector.compare(anotherNodeSelector) # => 0
someNodeSelector.isEqual(anotherNodeSelector) # false

💥