rename path verification methods to introspection and add NodePath#getSource method
This commit is contained in:
parent
ede6237b6f
commit
eb72ea3e5a
@ -7,4 +7,4 @@
|
||||
- `replacement` - Methods responsible for replacing a node with another.
|
||||
- `removal` - Methods responsible for removing a node.
|
||||
- `family` - Methods responsible for dealing with/retrieving children or siblings.
|
||||
- `verification` - Methodsresponsible for introspecting the current path for certain values.
|
||||
- `introspection` - Methods responsible for introspecting the current path for certain values.
|
||||
|
||||
@ -210,3 +210,16 @@ export function referencesImport(moduleSource, importName) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description
|
||||
*/
|
||||
|
||||
export function getSource() {
|
||||
var node = this.node;
|
||||
if (node.end) {
|
||||
return this.hub.file.code.slice(node.start, node.end);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user