-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
21 changed files
with
271 additions
and
345 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,8 +1,5 @@ | ||
.DS_Store | ||
*.log | ||
.nyc_output/ | ||
coverage/ | ||
node_modules/ | ||
hast-util-select.js | ||
hast-util-select.min.js | ||
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,5 +1,2 @@ | ||
coverage/ | ||
hast-util-select.js | ||
hast-util-select.min.js | ||
*.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,16 @@ | ||
'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, space) { | ||
export function matches(selector, node, space) { | ||
return Boolean( | ||
any(parse(selector), node, {space: space, one: true, shallow: true})[0] | ||
any(parse(selector), node, {space, one: true, shallow: true})[0] | ||
) | ||
} | ||
|
||
function select(selector, node, space) { | ||
return any(parse(selector), node, {space: space, one: true})[0] || null | ||
export function select(selector, node, space) { | ||
return any(parse(selector), node, {space, one: true})[0] || null | ||
} | ||
|
||
function selectAll(selector, node, space) { | ||
return any(parse(selector), node, {space: space}) | ||
export function selectAll(selector, node, space) { | ||
return any(parse(selector), node, {space}) | ||
} |
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
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 id(query, node) { | ||
return node.properties.id === query.id | ||
} |
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.tagName | ||
} |
Oops, something went wrong.