27 lines
538 B
Markdown
27 lines
538 B
Markdown
# 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();
|
||
}
|
||
```
|