Files

538 B
Raw Permalink Blame History

Grim.js — escapeNBT() (satır 723)

← Grim.js · ← Master

function escapeNBT(s) {
    return String(s).replace(/\\/g, "\\\\").replace(/"/g, '\\"');
}

function trim(s) {
    return String(s || "").replace(/^\s+|\s+$/g, "");
}

function lower(s) {
    return String(s || "").toLowerCase();
}

function isUrl(s) {
    s = lower(trim(s));
    return s.indexOf("http://") === 0 || s.indexOf("https://") === 0;
}

function nowMs() {
    return Date.now();
}