Browse files

used Array.isArray() instead of custom implementation

  • Loading branch information...
1 parent 7dcc45d commit fad38c77493b6d7f1ec35c61ebe96e7a6346a6f0 @schaermu schaermu committed Oct 30, 2012
Showing with 3 additions and 7 deletions.
  1. +3 −7 lib/processor.js
View
10 lib/processor.js
@@ -226,10 +226,6 @@ exports = module.exports = function Processor(command) {
result = result.replace('%b', self.options.inputfile.substr(0,self.options.inputfile.lastIndexOf('.')));
return result;
}
-
- function _is_array(input) {
- return typeof(input) == 'object' && (input instanceof Array);
- };
function _screenShotInternal(callback) {
@@ -243,7 +239,7 @@ exports = module.exports = function Processor(command) {
}
// check if all timemarks are inside duration
- if (_is_array(timemarks)) {
+ if (Array.isArray(timemarks)) {
for (var i = 0; i < timemarks.length; i++) {
/* convert percentage to seconds */
if( timemarks[i].indexOf('%') > 0 ) {
@@ -278,7 +274,7 @@ exports = module.exports = function Processor(command) {
},
function(taskcallback) {
var offset;
- if (_is_array(timemarks)) {
+ if (Array.isArray(timemarks)) {
// get timemark for current iteration
offset = timemarks[(j - 1)];
} else {
@@ -341,7 +337,7 @@ exports = module.exports = function Processor(command) {
}
filename = config.filename || 'tn_%ss';
- if(!/%0*i/.test(filename) && _is_array(timemarks) && timemarks.length > 1 ) {
+ if(!/%0*i/.test(filename) && Array.isArray(timemarks) && timemarks.length > 1 ) {
// if there are multiple timemarks but no %i in filename add one
// so we won't overwrite the same thumbnail with each timemark
filename += '_%i';

0 comments on commit fad38c7

Please sign in to comment.