Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = program => {
wdk.customize = (fnName, ...args) => {
const urls = wdk[fnName].apply(null, args)
const isSparqlFunction = sparqlFunctions.includes(fnName)
const customizer = isSparqlFunction ? 'sparql_endpoint' : 'wikibase_instance'
const { isCustomized, customize } = require(`./custom_${customizer}`)(program)
if (!isCustomized) return urls
if (typeof urls === 'string') return customize(urls)
return urls.map(customize)
}
return wdk
}