keybase-proofs
Version:
Publicly-verifiable proofs of identity
44 lines (39 loc) • 922 B
JavaScript
// Generated by IcedCoffeeScript 108.0.11
(function() {
var errsan, make_errors;
make_errors = require('iced-error').make_errors;
exports.errors = make_errors({
CLOCK_SKEW: "critical clock skew detected",
WRONG_SEQNO: "wrong seqno",
BAD_HIGH_SKIP: "bad high skip",
BAD_PREV: "bad prev pointer",
EXPANSION: "bad expansion"
});
exports.errsan = errsan = function(s) {
var map, re;
if (typeof s === 'number') {
return s;
}
if (typeof s === 'boolean') {
return s;
}
if (s == null) {
return s;
}
if (typeof s !== 'string') {
s = s.toString();
}
map = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'",
"/": "/"
};
re = new RegExp("[" + Object.keys(map) + "]", "g");
return s.replace(re, function(c) {
return map[c] || c;
});
};
}).call(this);