Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var handleInput = function ( input, lang ) {
console.log( 'Entering Wikidata module...' )
var call = 'getEntities'
, result
if ( Array.isArray( input ) && wdk.isWikidataEntityId( input[ 0 ] ) ) {
if ( input.length >= 50 )
call = 'getManyEntities'
} else if ( typeof input === 'string' && wdk.isWikidataEntityId( input ) ) {
input = [ input ]
}
var url = wdk[ call ]( {
ids: input,
languages: [ lang ]
} )
if ( Array.isArray( url ) ) {
var urls = url
, outs = []
for ( var urlIndex = 0; urlIndex < urls.length; urlIndex++ ) {
var url = urls[ urlIndex ]
, out = getOutput( url, lang )
outs= outs.concat( out )
var handleInput = function ( input, lang ) {
console.log( 'Entering Wikidata module...' )
var call = 'getEntities'
, result
if ( Array.isArray( input ) && wdk.isWikidataEntityId( input[ 0 ] ) ) {
if ( input.length >= 50 )
call = 'getManyEntities'
} else if ( typeof input === 'string' && wdk.isWikidataEntityId( input ) ) {
input = [ input ]
}
var url = wdk[ call ]( {
ids: input,
languages: [ lang ]
} )
if ( Array.isArray( url ) ) {
var urls = url
, outs = []
for ( var urlIndex = 0; urlIndex < urls.length; urlIndex++ ) {