change url to archive mirror
This commit is contained in:
1 parent
fbb2b0cc60
commit
66602c7280
690 files changed
+1017813
-2
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
var util = require("util")
|
||||
var messages = require("./warning_messages.json")
|
||||
|
||||
module.exports = function() {
|
||||
var args = Array.prototype.slice.call(arguments, 0)
|
||||
var warningName = args.shift()
|
||||
if (warningName == "typo") {
|
||||
return makeTypoWarning.apply(null,args)
|
||||
}
|
||||
else {
|
||||
var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'"
|
||||
args.unshift(msgTemplate)
|
||||
return util.format.apply(null, args)
|
||||
}
|
||||
}
|
||||
|
||||
function makeTypoWarning (providedName, probableName, field) {
|
||||
if (field) {
|
||||
providedName = field + "['" + providedName + "']"
|
||||
probableName = field + "['" + probableName + "']"
|
||||
}
|
||||
return util.format(messages.typo, providedName, probableName)
|
||||
}
|
||||
Reference in new issue
Block a user