Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Check deprecations
if (feed.checkReponse) {
next(new Error('Feed checkResponse option is deprecated for check'))
return this
}
// Ensure optional
feed = this.prepareFeed(feed)
// Plugins
const plugins = {}
if (typeChecker.isString(feed.plugins)) {
feed.plugins = feed.plugins.split(' ')
}
if (typeChecker.isArray(feed.plugins)) {
for (let i = 0; i < feed.plugins.length; ++i) {
const name = feed.plugins[i]
try {
plugins[name] = require('./plugins/' + name)
} catch (err) {
next(err)
return this
}
}
}
// Generators
function generateParser(name, method, opts, complete) {
me.log('debug', `Feedr parse [${feed.url}] with ${name} attempt`)
method(opts, function(err, data) {
if (err) {
module.exports = function eachr (subject, callback) {
// Handle
if ( typeChecker.isArray(subject) ) {
for ( let key = 0; key < subject.length; ++key ) {
const value = subject[key]
if ( callback.call(subject, value, key, subject) === false ) {
break
}
}
}
else if ( typeChecker.isPlainObject(subject) ) {
for ( const key in subject ) {
if ( subject.hasOwnProperty(key) ) {
const value = subject[key]
if ( callback.call(subject, value, key, subject) === false ) {
break
}
}
}
module.exports = function eachr(subject, callback) {
// Handle
if (typeChecker.isArray(subject)) {
for (var key = 0; key < subject.length; ++key) {
var value = subject[key];
if (callback.call(subject, value, key, subject) === false) {
break;
}
}
} else if (typeChecker.isPlainObject(subject)) {
for (var _key in subject) {
if (subject.hasOwnProperty(_key)) {
var _value = subject[_key];
if (callback.call(subject, _value, _key, subject) === false) {
break;
}
}
}
} else if (typeChecker.isMap(subject)) {
module.exports = function (opts, next, config = {}) {
// Empty, set default
if ( config.completionCallbackNames == null ) {
config.completionCallbackNames = ['next']
}
// Not array, make array
else if ( typeChecker.isArray(config.completionCallbackNames) === false ) {
config.completionCallbackNames = [config.completionCallbackNames]
}
// Arguments
if ( typeChecker.isFunction(opts) && next == null ) {
next = opts
opts = {}
}
else if ( !opts ) {
opts = {}
}
// Completion callback
if ( !next ) {
// Cycle the completionCallbackNames to check if the completion callback name exists in opts
// if it does, then use it as the next and delete it's value
module.exports = function (opts, next) {
var config = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
// Empty, set default
if (config.completionCallbackNames == null) {
config.completionCallbackNames = ['next'];
}
// Not array, make array
else if (typeChecker.isArray(config.completionCallbackNames) === false) {
config.completionCallbackNames = [config.completionCallbackNames];
}
// Arguments
if (typeChecker.isFunction(opts) && next == null) {
next = opts;
opts = {};
} else if (!opts) {
opts = {};
}
// Completion callback
if (!next) {
// Cycle the completionCallbackNames to check if the completion callback name exists in opts
// if it does, then use it as the next and delete it's value
eachr(config.completionCallbackNames, function (completionCallbackName) {
args.forEach(function(arg, index) {
if (typeChecker.isFunction(arg)) {
next = arg
} else if (typeChecker.isArray(arg)) {
feeds = arg
} else if (typeChecker.isPlainObject(arg)) {
if (index === 0) {
feeds = arg
} else {
extendr.extend(defaultfeed, arg)
}
}
})
getExtension: function(extensions) {
var extension;
if (!require('typechecker').isArray(extensions)) {
extensions = docpadUtil.getExtensions(extensions);
}
if (extensions.length !== 0) {
extension = extensions.slice(-1)[0] || null;
} else {
extension = null;
}
return extension;
},
getDirPath: function(path) {