mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-22 08:14:48 -06:00
fa9ae9437c
The gitbook install has been incredibly flaky due to it's dependency on npm. This commit simply vendors the node_modules so that each time we build the site the process doesn't have to re-run gitbook install. Signed-off-by: Torin Sandall <torinsandall@gmail.com>
28 lines
478 B
JavaScript
28 lines
478 B
JavaScript
"use strict";
|
|
|
|
/* From Twitter's Hogan.js */
|
|
|
|
var rAmp = /&/g,
|
|
rLt = /</g,
|
|
rGt = />/g,
|
|
rApos =/\'/g,
|
|
rQuot = /\"/g,
|
|
hChars =/[&<>\"\']/;
|
|
|
|
function coerceToString(val) {
|
|
return String((val === null || val === undefined) ? '' : val);
|
|
}
|
|
|
|
module.exports = function(str) {
|
|
str = coerceToString(str);
|
|
|
|
return hChars.test(str)
|
|
? str
|
|
.replace(rAmp,'&')
|
|
.replace(rLt,'<')
|
|
.replace(rGt,'>')
|
|
.replace(rApos,''')
|
|
.replace(rQuot, '"')
|
|
: str;
|
|
};
|