isite 2025.8.1 → 2025.8.3

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/index.js CHANGED
@@ -44,6 +44,9 @@ module.exports = function init(options) {
44
44
  args[1] = args[1] || {};
45
45
  if (args[1].body && typeof args[1].body == 'object') {
46
46
  args[1].body = JSON.stringify(args[1].body);
47
+ } else if (args[1].data && typeof args[1].data == 'object') {
48
+ args[1].body = JSON.stringify(args[1].data);
49
+ delete args[1].data;
47
50
  }
48
51
  args[1].agent =
49
52
  args[1].agent ||
@@ -1,13 +1,10 @@
1
1
  exports = module.exports = function init(____0) {
2
- function escape(s) {
3
- if (!s) {
4
- return '';
5
- }
2
+ site.escapeRegExp = function (s = '') {
6
3
  if (typeof s !== 'string') {
7
4
  s = s.toString();
8
5
  }
9
6
  return s.replace(/[\/\\^$*+?.()\[\]{}]/g, '\\$&');
10
- }
7
+ };
11
8
 
12
9
  if (____0.options.proto.object) {
13
10
  if (!Object.prototype.test) {
@@ -43,11 +40,11 @@ exports = module.exports = function init(____0) {
43
40
  if (name.indexOf('*') !== -1) {
44
41
  name = name.split('*');
45
42
  name.forEach((n, i) => {
46
- name[i] = escape(n);
43
+ name[i] = site.escapeRegExp(n);
47
44
  });
48
45
  name = name.join('.*');
49
46
  } else {
50
- name = escape(name);
47
+ name = site.escapeRegExp(name);
51
48
  }
52
49
  return this.test('^' + name + '$', 'gium');
53
50
  },
@@ -56,10 +53,14 @@ exports = module.exports = function init(____0) {
56
53
  if (!Object.prototype.contains) {
57
54
  Object.defineProperty(Object.prototype, 'contains', {
58
55
  value: function (name) {
59
- if (!name) {
60
- return !1;
61
- }
62
- return this.test('^.*' + escape(name) + '.*$', 'gium');
56
+ return name.split('|').some((n) => n && site.toJson(this).test('^.*' + site.site.escapeRegExpRegExp(n) + '.*$', 'gium'));
57
+ },
58
+ });
59
+ }
60
+ if (!Object.prototype.contain) {
61
+ Object.defineProperty(Object.prototype, 'contain', {
62
+ value: function (name) {
63
+ return name.split('|').some((n) => n && site.toJson(this).test('^.*' + site.site.escapeRegExpRegExp(n) + '.*$', 'gium'));
63
64
  },
64
65
  });
65
66
  }
@@ -82,27 +83,29 @@ exports = module.exports = function init(____0) {
82
83
  }
83
84
  if (!Array.prototype.like) {
84
85
  Array.prototype.like = function (name) {
85
- if (typeof name !== "string") {
86
+ if (typeof name !== 'string') {
86
87
  return !1;
87
88
  }
88
89
  if (name.indexOf('*') !== -1) {
89
90
  name = name.split('*');
90
91
  name.forEach((n, i) => {
91
- name[i] = escape(n);
92
+ name[i] = site.escapeRegExp(n);
92
93
  });
93
94
  name = name.join('.*');
94
95
  } else {
95
- name = escape(name);
96
+ name = site.escapeRegExp(name);
96
97
  }
97
98
  return this.test('^' + name + '$', 'gium');
98
99
  };
99
100
  }
100
101
  if (!Array.prototype.contains) {
101
- Array.prototype.contains = function (name) {
102
- if (typeof name !== "string") {
103
- return !1;
104
- }
105
- return this.test('^.*' + escape(name) + '.*$', 'gium');
102
+ Array.prototype.contains = function (name = '') {
103
+ return name.split('|').some((n) => n && site.toJson(this).test('^.*' + site.site.escapeRegExpRegExp(n) + '.*$', 'gium'));
104
+ };
105
+ }
106
+ if (!Array.prototype.contain) {
107
+ Array.prototype.contain = function (name = '') {
108
+ return name.split('|').some((n) => n && site.toJson(this).test('^.*' + site.site.escapeRegExpRegExp(n) + '.*$', 'gium'));
106
109
  };
107
110
  }
108
111
  }
@@ -119,14 +122,14 @@ exports = module.exports = function init(____0) {
119
122
 
120
123
  if (!String.prototype.like) {
121
124
  String.prototype.like = function (name) {
122
- if (typeof name !== "string") {
125
+ if (typeof name !== 'string') {
123
126
  return !1;
124
127
  }
125
128
  let r = !1;
126
129
  name.split('|').forEach((n) => {
127
130
  n = n.split('*');
128
131
  n.forEach((w, i) => {
129
- n[i] = escape(w);
132
+ n[i] = site.escapeRegExp(w);
130
133
  });
131
134
  n = n.join('.*');
132
135
  if (this.test('^' + n + '$', 'gium')) {
@@ -138,17 +141,13 @@ exports = module.exports = function init(____0) {
138
141
  }
139
142
 
140
143
  if (!String.prototype.contains) {
141
- String.prototype.contains = function (name) {
142
- let r = !1;
143
- if (typeof name !== "string") {
144
- return r;
145
- }
146
- name.split('|').forEach((n) => {
147
- if (n && this.test('^.*' + escape(n) + '.*$', 'gium')) {
148
- r = !0;
149
- }
150
- });
151
- return r;
144
+ String.prototype.contains = function (name = '') {
145
+ return name.split('|').some((n) => n && this.test('^.*' + site.site.escapeRegExpRegExp(n) + '.*$', 'gium'));
146
+ };
147
+ }
148
+ if (!String.prototype.contain) {
149
+ String.prototype.contain = function (name = '') {
150
+ return name.split('|').some((n) => n && this.test('^.*' + site.site.escapeRegExpRegExp(n) + '.*$', 'gium'));
152
151
  };
153
152
  }
154
153
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2025.08.01",
3
+ "version": "2025.08.03",
4
4
  "description": "Create High Level Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {