script.io.js 2026.124.357 → 2026.124.2230

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.
@@ -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); }); Define (String.prototype, "begin", function (input = 1) { return this.first (input); });
152
+ Define (String.prototype, "last", function (input = 1) { if (typeof input === "number") return this.substr (- input); else return this.endsWith (input); }); Define (String.prototype, "end", function (input = 1) { return this.last (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)); });
@@ -289,7 +291,7 @@ Define (Date.embed, "minute", function (input) { var minute = Math.floor (input
289
291
 
290
292
  Define (Event, "io", class {
291
293
  constructor () {
292
- this.data = {}
294
+ this.data = Object.create (null);
293
295
  }
294
296
  on (key, value) {
295
297
  if (this.data [key]) this.data [key].push (value);
@@ -305,6 +307,8 @@ Define (Event, "io", class {
305
307
  });
306
308
 
307
309
  Define (Event, "proto", function (proto) {
310
+ if (proto) {}
311
+ else proto = Object.create (null);
308
312
  proto.event = proto.event || Object.create (null);
309
313
  proto.on = function (key, value) {
310
314
  if (proto.event [key]) proto.event [key].push (value);
@@ -383,7 +387,7 @@ Define (URL, "parse", function (url) {
383
387
  Define (URL, "header", function () {});
384
388
  Define (URL.header, "status", {
385
389
  OK: 200, success: 200,
386
- error: {request: 400, forbidden: 403, found: 404, timeout: 408, legal: 451, internal: 500},
390
+ error: {request: 400, forbidden: 403, exist: 404, timeout: 408, legal: 451, internal: 500},
387
391
  code: {
388
392
  100: "Continue", 101: "Switching Protocols", 102: "Processing",
389
393
  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",
@@ -653,7 +657,7 @@ Define (Function, "html", class {
653
657
  this.head.script ({src: "https://unpkg.com/lodash@4.17.21/core.min.js"});
654
658
  this.head.script ({src: "https://unpkg.com/vue@3.5.27/dist/vue.global.prod.js"});
655
659
  this.head.script ({src: "https://unpkg.com/vue-router@4.6.4/dist/vue-router.global.prod.js"});
656
- this.head.script ({src: "/test.js?123"});
660
+ // this.head.script ({src: "/test.js?123"});
657
661
  return this;
658
662
  }
659
663
  render (variable = {}) {
@@ -668,11 +672,6 @@ Define (Function, "html", class {
668
672
  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
673
  this.markup.push (1, `</head>`);
670
674
  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
675
  this.markup.push (1, `</body>`);
677
676
  this.markup.push (0, `</html>`);
678
677
  if (this.var.debug) {
@@ -1004,7 +1003,7 @@ Define (Function.appwrite.db, "select", class {
1004
1003
  if (typeof this.prop.filter !== "object") this.prop.filter = {serial: (serial = this.prop.filter)}
1005
1004
  var __ = function (db) {
1006
1005
  return new Promise (async function (resolve, reject) {
1007
- var data;
1006
+ var data = [];
1008
1007
  var error = false;
1009
1008
  var database, result, query = [];
1010
1009
  if (serial) query = [Function.appwrite.api.Query.limit (1)]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "script.io.js",
3
3
  "description": "Hello World",
4
- "version": "2026.124.357",
4
+ "version": "2026.124.2230",
5
5
  "author": "Seindi Rahmat Barus <xseindi@gmail.com>",
6
6
  "contributors": [
7
7
  "Seindi Rahmat Barus <xseindi@gmail.com>"