Found via report that unreleased code showing in docs: yargs/yargs#2569 (comment)
Both the old jsonp sites are defunct, and falling through to main branch:
|
// use a service to wrap registry json in jsonp |
|
var svcs = ['https://json2jsonp.com/', 'https://jsonp.afeld.me/'] |
|
var i = 0 |
|
var nextSvc = function () { |
|
var svc = svcs[i++] |
|
if (!svc) { |
|
// no jsonp services worked, just use master |
|
console.log('falling back to master branch :(') |
|
return Flatdoc.run({ |
|
fetcher: Flatdoc.github('yargs/yargs', 'docs/api.md') |
|
}) |
|
} |
|
$.ajax(svc, { |
|
data: { |
|
url: 'https://registry.npmjs.org/yargs' |
|
}, |
|
dataType: 'jsonp', |
|
timeout: 2000, |
|
jsonpCallback: svc.replace(/\W/g, ''), |
|
success: function (data) { |
|
var version = data['dist-tags'] && data['dist-tags'].latest |
|
if (!version) return nextSvc() |
|
console.log('determined latest version as %s via %s', version, svc) |
|
Flatdoc.run({ |
|
fetcher: Flatdoc.file('https://raw.githubusercontent.com/yargs/yargs/v' + version + '/docs/api.md') |
|
}) |
|
}, |
|
error: function () { |
|
console.log('service failed: %s, trying next', svc) |
|
nextSvc() |
|
} |
From console when loading docs:
service failed: https://json2jsonp.com/, trying next
TypeError: httpsjson2jsonpcom is not a function
[HUGE error omitted]
service failed: https://jsonp.afeld.me/, trying next
falling back to master branch :(
The docs are also slow to load, perhaps related to the failed attempts.
Found via report that unreleased code showing in docs: yargs/yargs#2569 (comment)
Both the old jsonp sites are defunct, and falling through to main branch:
yargs.github.io/_layouts/docs.html
Lines 31 to 61 in 4114b79
From console when loading docs:
The docs are also slow to load, perhaps related to the failed attempts.