diff --git a/src/babel/traversal/path/README.md b/src/babel/traversal/path/README.md index 797576fd16..46b9037959 100644 --- a/src/babel/traversal/path/README.md +++ b/src/babel/traversal/path/README.md @@ -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. diff --git a/src/babel/traversal/path/verification.js b/src/babel/traversal/path/introspection.js similarity index 96% rename from src/babel/traversal/path/verification.js rename to src/babel/traversal/path/introspection.js index 38b5fde27f..bd72f259de 100644 --- a/src/babel/traversal/path/verification.js +++ b/src/babel/traversal/path/introspection.js @@ -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 ""; + } +}