Files

27 lines
538 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Grim.js — escapeNBT() (satır 723)
[← Grim.js](index.md) · [← Master](../../wiki.md)
```javascript
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();
}
```