-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
151 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
.DS_Store | ||
*.log | ||
.nyc_output/ | ||
coverage/ | ||
node_modules/ | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
coverage/ | ||
*.json | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
'use strict' | ||
import {any} from './lib/any.js' | ||
import {parse} from './lib/parse.js' | ||
|
||
exports.matches = matches | ||
exports.selectAll = selectAll | ||
exports.select = select | ||
|
||
var any = require('./lib/any') | ||
var parse = require('./lib/parse') | ||
|
||
function matches(selector, node) { | ||
return Boolean( | ||
any(parse(selector), node, {one: true, shallow: true, any: any})[0] | ||
) | ||
export function matches(selector, node) { | ||
return Boolean(any(parse(selector), node, {one: true, shallow: true, any})[0]) | ||
} | ||
|
||
function select(selector, node) { | ||
return any(parse(selector), node, {one: true, any: any})[0] || null | ||
export function select(selector, node) { | ||
return any(parse(selector), node, {one: true, any})[0] || null | ||
} | ||
|
||
function selectAll(selector, node) { | ||
return any(parse(selector), node, {any: any}) | ||
export function selectAll(selector, node) { | ||
return any(parse(selector), node, {any}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
'use strict' | ||
|
||
module.exports = match | ||
|
||
function match(query, node) { | ||
export function name(query, node) { | ||
return query.tagName === '*' || query.tagName === node.type | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.