1.0.5 • Published 8 years ago

matches-selector-universal v1.0.5

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

matches-selector-universal

Check if an element matches a given selector.

History

This package is useful when bundling a library that will be used for universal rendering. It was forked from a merge of component-matches-selector and matches-selector. Both packages threw errors when required from an environment that didn't have global DOM objects. matches-selector-universal fixes that, but for obvious reasons, will still throw errors if DOM globals, e.g. document and Element aren't available.

Installation

$ npm install matches-selector-universal

Example

var matches = require('matches-selector-universal');
matches(el, 'ul li a');
// => true or false

Running Tests

Tests are run with karma + mocha + webpack. An additional test is performed to ensure that the code does not throw errors when required by node with no DOM globals.

npm install
npm test
1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

2.0.0

8 years ago