Skip to content

Commit

Permalink
Adding the getExtension helper back
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Feb 10, 2017
1 parent 4e31db1 commit 7645404
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "artoo",
"description": "The client-side scraping companion.",
"version": "0.3.3",
"version": "0.3.4",
"permissions": [
"background",
"webRequest",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artoo-js",
"version": "0.3.3",
"version": "0.3.4",
"description": "The client-side scraping companion.",
"main": "./build/artoo.node.js",
"author": {
Expand Down
9 changes: 9 additions & 0 deletions src/artoo.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@
return -1;
}

// Retrieve a file extenstion from filename or url
function getExtension(url) {
var a = url.split('.');

if (a.length === 1 || (a[0] === '' && a.length === 2))
return '';
return a.pop();
}

/**
* Document Helpers
Expand Down Expand Up @@ -406,6 +414,7 @@
createDocument: createDocument,
extend: extend,
first: first,
getExtension: getExtension,
indexOf: indexOf,
isArray: isArray,
isDocument: isDocument,
Expand Down

0 comments on commit 7645404

Please sign in to comment.