globals-docs
Advanced tools
Comparing version 2.0.0 to 2.0.1
23
index.js
@@ -16,3 +16,22 @@ var docs = require('./globals-docs.json'); | ||
function buildLowerCased() { | ||
var lowercased = {}; | ||
for (var k in docs) { | ||
lowercased[k] = {}; | ||
for (var name in docs[k]) { | ||
lowercased[k][name.toLowerCase()] = docs[k][name]; | ||
} | ||
} | ||
return lowercased; | ||
} | ||
var lowerCased = buildLowerCased(); | ||
/** | ||
* Lowercased docs: the same as the original docs array, but with lowercased | ||
* names. | ||
*/ | ||
module.exports.lowerCased = lowerCased; | ||
/** | ||
* Get a URL for a global object. | ||
@@ -27,8 +46,8 @@ * | ||
module.exports.getDoc = function(name, env) { | ||
if (!env) env = Object.keys(docs); | ||
if (!env) env = Object.keys(lowerCased); | ||
for (var i = 0; i < env.length; i++) { | ||
var d = docs[env[i]][name]; | ||
var d = lowerCased[env[i]][name.toLowerCase()]; | ||
if (d) return d; | ||
} | ||
}; |
{ | ||
"name": "globals-docs", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "documentation links for all node and browser globals", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45263
518