Skip to content

Commit

Permalink
Add isRelative check for identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Mar 15, 2015
1 parent 5c1a383 commit be44d79
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions identifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,17 @@ function extension(location) {
}
}

exports.isRelative = isRelative;
function isRelative(id) {
return /^\.\.?[/]/.test(id);
}

exports.split = split;
function split(id) {
var match = /([^\/]+)\/(.*)/.exec(id);
return {
name: match[1],
id: match[2]
};
}

0 comments on commit be44d79

Please sign in to comment.