script.io.js 2026.124.357 → 2026.124.1620
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_packages/script.js +3 -6
- package/package.json +1 -1
package/node_packages/script.js
CHANGED
|
@@ -148,6 +148,8 @@ Define (String.prototype, "clone", function () { return this.trim (); });
|
|
|
148
148
|
Define (String.prototype, "format", function (format) { var string = this.trim (); for (var i in format) string = string.split (`{{ ${i} }}`).join (format [i]); return string; });
|
|
149
149
|
Define (String.prototype, "small", function () { return this.toLowerCase (); });
|
|
150
150
|
Define (String.prototype, "big", function () { return this.toUpperCase (); });
|
|
151
|
+
Define (String.prototype, "first", function (input = 1) { if (typeof input === "number") return this.substr (0, input); else return this.startsWith (input); });
|
|
152
|
+
Define (String.prototype, "last", function (input = 1) { if (typeof input === "number") return this.substr (- input); else return this.endsWith (input); });
|
|
151
153
|
Define (String.prototype, "after", function (input, offset) { if ((offset = this.indexOf (input, offset)) >= 0) return this.substr (offset + input.length); else return ""; });
|
|
152
154
|
Define (String.prototype, "before", function (input, offset) { if ((offset = this.indexOf (input, offset)) >= 0) return this.substr (0, offset); else return ""; });
|
|
153
155
|
Define (String.prototype, "pop", function (length = 1) { return this.substr (0, (this.length - length)); });
|
|
@@ -383,7 +385,7 @@ Define (URL, "parse", function (url) {
|
|
|
383
385
|
Define (URL, "header", function () {});
|
|
384
386
|
Define (URL.header, "status", {
|
|
385
387
|
OK: 200, success: 200,
|
|
386
|
-
error: {request: 400, forbidden: 403,
|
|
388
|
+
error: {request: 400, forbidden: 403, exist: 404, timeout: 408, legal: 451, internal: 500},
|
|
387
389
|
code: {
|
|
388
390
|
100: "Continue", 101: "Switching Protocols", 102: "Processing",
|
|
389
391
|
200: "OK", 201: "Created", 202: "Accepted", 203: "Non-authoritative Information", 204: "No Content", 205: "Reset Content", 206: "Partial Content", 207: "Multi-Status", 208: "Already Reported", 226: "IM Used",
|
|
@@ -668,11 +670,6 @@ Define (Function, "html", class {
|
|
|
668
670
|
for (var i in this.head.data.style) this.markup.push (2, `<style${Function.html.attribute (this.head.data.style [i].attribute, {space: true, prop: this.head.data.style [i].prop})}>${this.head.data.style [i].css}</style>`);
|
|
669
671
|
this.markup.push (1, `</head>`);
|
|
670
672
|
this.markup.push (1, `<body>`);
|
|
671
|
-
this.markup.push (0, `<script>
|
|
672
|
-
Function.ajax.get ("/test1.js", { success () { console.log ("ajax") } })
|
|
673
|
-
Function.ajax.get ("/test2.js", { success () { console.log ("ajax") } })
|
|
674
|
-
Function.ajax.get ("/test3.js", { success () { console.log ("ajax") } })
|
|
675
|
-
</script>`);
|
|
676
673
|
this.markup.push (1, `</body>`);
|
|
677
674
|
this.markup.push (0, `</html>`);
|
|
678
675
|
if (this.var.debug) {
|
package/package.json
CHANGED