alienese 0.4.2 → 0.4.4
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/alienese.js +203 -203
- package/package.json +2 -2
package/alienese.js
CHANGED
|
@@ -32,7 +32,7 @@ SOFTWARE.
|
|
|
32
32
|
// This patch aims to create smaller (quicker) and more concise (lighter) JavaScript code.
|
|
33
33
|
// It makes the code more implicit and serves as an alternative to obfuscation.
|
|
34
34
|
//
|
|
35
|
-
// v0.4.
|
|
35
|
+
// v0.4.4 / release 2025.11.25
|
|
36
36
|
//
|
|
37
37
|
// * Must be loaded modernism.js before this script.
|
|
38
38
|
//
|
|
@@ -41,10 +41,14 @@ SOFTWARE.
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
// Auto-load modernism in Node.js environment
|
|
45
|
+
if (typeof require !== 'undefined' && typeof module !== 'undefined') {
|
|
46
|
+
try { require("modernism"); } catch (e) { }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let _gb = _global ?? (typeof globalThis !== 'undefined') ? globalThis : (typeof window !== 'undefined' ? window : global);
|
|
50
|
+
let dfg = defineGlobal ?? ((name, value) => {
|
|
51
|
+
Object.defineProperty(_gb, name, {
|
|
48
52
|
value: value,
|
|
49
53
|
writable: false,
|
|
50
54
|
configurable: false,
|
|
@@ -52,33 +56,29 @@ const dfg = defineGlobal ?? ((name, value) => {
|
|
|
52
56
|
});
|
|
53
57
|
});
|
|
54
58
|
|
|
55
|
-
//
|
|
56
|
-
if (typeof require !== 'undefined' && typeof module !== 'undefined') {
|
|
57
|
-
try { require("modernism"); } catch (e) { }
|
|
58
|
-
}
|
|
59
|
-
|
|
59
|
+
// primitive types alias constant
|
|
60
60
|
dfg("U", UNDEFINED);
|
|
61
61
|
dfg("N", NULL);
|
|
62
62
|
dfg("T", TRUE);
|
|
63
63
|
dfg("F", FALSE);
|
|
64
64
|
|
|
65
|
-
dfg("u",
|
|
66
|
-
dfg("n",
|
|
67
|
-
dfg("t",
|
|
68
|
-
dfg("f",
|
|
65
|
+
dfg("u", _gb.undefined);
|
|
66
|
+
dfg("n", _gb.null);
|
|
67
|
+
dfg("t", _gb.true);
|
|
68
|
+
dfg("f", _gb.false);
|
|
69
69
|
|
|
70
70
|
// end point assigner constant
|
|
71
|
-
dfg("eoo",
|
|
72
|
-
dfg("eoa",
|
|
71
|
+
dfg("eoo", _gb.u);
|
|
72
|
+
dfg("eoa", _gb.u);
|
|
73
73
|
|
|
74
74
|
// prototype of primitive types alias constant
|
|
75
|
-
dfg("FNC",
|
|
76
|
-
dfg("BLE",
|
|
77
|
-
dfg("STR",
|
|
78
|
-
dfg("SYM",
|
|
79
|
-
dfg("NUM",
|
|
80
|
-
dfg("BIG",
|
|
81
|
-
dfg("OBJ",
|
|
75
|
+
dfg("FNC", _gb.FUNCTION);
|
|
76
|
+
dfg("BLE", _gb.BOOLEAN);
|
|
77
|
+
dfg("STR", _gb.STRING);
|
|
78
|
+
dfg("SYM", _gb.SYMBOL);
|
|
79
|
+
dfg("NUM", _gb.NUMBER);
|
|
80
|
+
dfg("BIG", _gb.BIGINT);
|
|
81
|
+
dfg("OBJ", _gb.OBJECT);
|
|
82
82
|
|
|
83
83
|
dfg("fun", Function);
|
|
84
84
|
dfg("ble", Boolean);
|
|
@@ -89,13 +89,13 @@ dfg("big", BigInt);
|
|
|
89
89
|
dfg("obj", Object);
|
|
90
90
|
|
|
91
91
|
// class names of primitive types constant
|
|
92
|
-
dfg("FN",
|
|
93
|
-
dfg("BL",
|
|
94
|
-
dfg("ST",
|
|
95
|
-
dfg("SY",
|
|
96
|
-
dfg("NO",
|
|
97
|
-
dfg("BI",
|
|
98
|
-
dfg("OJ",
|
|
92
|
+
dfg("FN", _gb._FUNCTION);
|
|
93
|
+
dfg("BL", _gb._BOOLEAN);
|
|
94
|
+
dfg("ST", _gb._STRING);
|
|
95
|
+
dfg("SY", _gb._SYMBOL);
|
|
96
|
+
dfg("NO", _gb._NUMBER);
|
|
97
|
+
dfg("BI", _gb._BIG_INT);
|
|
98
|
+
dfg("OJ", _gb._OBJECT);
|
|
99
99
|
|
|
100
100
|
dfg("fn", Function);
|
|
101
101
|
dfg("bl", Boolean);
|
|
@@ -107,11 +107,11 @@ dfg("oj", Object);
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
// frequent object types alias constant
|
|
110
|
-
dfg("DT",
|
|
110
|
+
dfg("DT", _gb._DATE);
|
|
111
111
|
|
|
112
|
-
dfg("RA",
|
|
113
|
-
dfg("SA",
|
|
114
|
-
dfg("MA",
|
|
112
|
+
dfg("RA", _gb._ARRAY);
|
|
113
|
+
dfg("SA", _gb._SET);
|
|
114
|
+
dfg("MA", _gb._MAP);
|
|
115
115
|
|
|
116
116
|
dfg("dt", Date);
|
|
117
117
|
|
|
@@ -121,8 +121,8 @@ dfg("ma", Map);
|
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
// frequent assign types alias constant
|
|
124
|
-
dfg("def",
|
|
125
|
-
dfg("fin",
|
|
124
|
+
dfg("def", _gb.DEFAULT);
|
|
125
|
+
dfg("fin", _gb.FINALLY);
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
// frequent object types empty object issuer alias constant
|
|
@@ -135,172 +135,172 @@ dfg("x", {
|
|
|
135
135
|
|
|
136
136
|
|
|
137
137
|
// bypass constant
|
|
138
|
-
dfg("ifx",
|
|
139
|
-
dfg("itx",
|
|
138
|
+
dfg("ifx", _gb.executeIf);
|
|
139
|
+
dfg("itx", _gb.executeWhen);
|
|
140
140
|
|
|
141
|
-
dfg("ifr",
|
|
141
|
+
dfg("ifr", _gb.ifReturn);
|
|
142
142
|
|
|
143
|
-
dfg("roen",
|
|
144
|
-
dfg("roes",
|
|
145
|
-
dfg("roea",
|
|
146
|
-
dfg("roeo",
|
|
143
|
+
dfg("roen", _gb.ifReturnOrEmptyNumber);
|
|
144
|
+
dfg("roes", _gb.ifReturnOrEmptyString);
|
|
145
|
+
dfg("roea", _gb.ifReturnOrEmptyArray);
|
|
146
|
+
dfg("roeo", _gb.ifReturnOrEmptyObject);
|
|
147
147
|
|
|
148
|
-
dfg("val",
|
|
148
|
+
dfg("val", _gb.valet);
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
// common process shortcut constant
|
|
152
|
-
dfg("f02b",
|
|
153
|
-
dfg("f02r",
|
|
152
|
+
dfg("f02b", _gb.forZeroToBefore);
|
|
153
|
+
dfg("f02r", _gb.forZeroToReach);
|
|
154
154
|
|
|
155
|
-
dfg("f20",
|
|
156
|
-
dfg("f21",
|
|
155
|
+
dfg("f20", _gb.forToZeroFrom);
|
|
156
|
+
dfg("f21", _gb.forToPrimeFrom);
|
|
157
157
|
|
|
158
|
-
dfg("ff",
|
|
159
|
-
dfg("fb",
|
|
158
|
+
dfg("ff", _gb.forForward);
|
|
159
|
+
dfg("fb", _gb.forBackward);
|
|
160
160
|
|
|
161
|
-
dfg("fi",
|
|
162
|
-
dfg("fiv",
|
|
161
|
+
dfg("fi", _gb.forin);
|
|
162
|
+
dfg("fiv", _gb.forinner);
|
|
163
163
|
|
|
164
|
-
dfg("fo",
|
|
165
|
-
dfg("fkv",
|
|
164
|
+
dfg("fo", _gb.forof);
|
|
165
|
+
dfg("fkv", _gb.forkv);
|
|
166
166
|
|
|
167
|
-
dfg("w",
|
|
168
|
-
dfg("dw",
|
|
167
|
+
dfg("w", _gb.whileIn);
|
|
168
|
+
dfg("dw", _gb.doWhileIn);
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
// meaning comparator constant
|
|
172
|
-
dfg("to",
|
|
173
|
-
|
|
174
|
-
dfg("tm",
|
|
175
|
-
|
|
176
|
-
dfg("tu",
|
|
177
|
-
dfg("tf",
|
|
178
|
-
dfg("tb",
|
|
179
|
-
dfg("ts",
|
|
180
|
-
dfg("ty",
|
|
181
|
-
dfg("tn",
|
|
182
|
-
dfg("tg",
|
|
183
|
-
dfg("tj",
|
|
184
|
-
|
|
185
|
-
dfg("im",
|
|
186
|
-
dfg("io",
|
|
187
|
-
dfg("ia",
|
|
188
|
-
dfg("ioa",
|
|
189
|
-
dfg("ios",
|
|
190
|
-
dfg("ion",
|
|
191
|
-
dfg("iot",
|
|
192
|
-
dfg("iop",
|
|
193
|
-
|
|
194
|
-
dfg("xv",
|
|
195
|
-
dfg("nxv",
|
|
196
|
-
dfg("xm",
|
|
197
|
-
dfg("nx",
|
|
198
|
-
|
|
199
|
-
dfg("ev",
|
|
200
|
-
dfg("nev",
|
|
201
|
-
dfg("sm",
|
|
202
|
-
dfg("df",
|
|
203
|
-
|
|
204
|
-
dfg("gtv",
|
|
205
|
-
dfg("ltv",
|
|
206
|
-
dfg("ngt",
|
|
207
|
-
dfg("nlt",
|
|
208
|
-
|
|
209
|
-
dfg("gev",
|
|
210
|
-
dfg("lev",
|
|
211
|
-
dfg("nge",
|
|
212
|
-
dfg("nle",
|
|
213
|
-
|
|
214
|
-
dfg("fc",
|
|
215
|
-
dfg("nfc",
|
|
216
|
-
|
|
217
|
-
dfg("xu",
|
|
218
|
-
dfg("xn",
|
|
219
|
-
dfg("xt",
|
|
220
|
-
dfg("xf",
|
|
221
|
-
|
|
222
|
-
dfg("nxu",
|
|
223
|
-
dfg("nxn",
|
|
224
|
-
dfg("nxt",
|
|
225
|
-
dfg("nxf",
|
|
226
|
-
|
|
227
|
-
dfg("en",
|
|
228
|
-
dfg("et",
|
|
229
|
-
dfg("ef",
|
|
230
|
-
dfg("ee",
|
|
231
|
-
|
|
232
|
-
dfg("nn",
|
|
233
|
-
dfg("nt",
|
|
234
|
-
dfg("nf",
|
|
235
|
-
dfg("ne",
|
|
236
|
-
|
|
237
|
-
dfg("noe",
|
|
238
|
-
dfg("nne",
|
|
172
|
+
dfg("to", _gb.typeOf);
|
|
173
|
+
|
|
174
|
+
dfg("tm", _gb.typeMatch);
|
|
175
|
+
|
|
176
|
+
dfg("tu", _gb.typeUndefined);
|
|
177
|
+
dfg("tf", _gb.typeFunction);
|
|
178
|
+
dfg("tb", _gb.typeBoolean);
|
|
179
|
+
dfg("ts", _gb.typeString);
|
|
180
|
+
dfg("ty", _gb.typeSymbol);
|
|
181
|
+
dfg("tn", _gb.typeNumber);
|
|
182
|
+
dfg("tg", _gb.typeBigint);
|
|
183
|
+
dfg("tj", _gb.typeObject);
|
|
184
|
+
|
|
185
|
+
dfg("im", _gb.instanceMatch);
|
|
186
|
+
dfg("io", _gb.isObject);
|
|
187
|
+
dfg("ia", _gb.isArray);
|
|
188
|
+
dfg("ioa", _gb.isArray);
|
|
189
|
+
dfg("ios", _gb.isString);
|
|
190
|
+
dfg("ion", _gb.isNumber);
|
|
191
|
+
dfg("iot", _gb.isSet);
|
|
192
|
+
dfg("iop", _gb.isMap);
|
|
193
|
+
|
|
194
|
+
dfg("xv", _gb.exact);
|
|
195
|
+
dfg("nxv", _gb.notExact);
|
|
196
|
+
dfg("xm", _gb.exactMatches);
|
|
197
|
+
dfg("nx", _gb.notExactMatches);
|
|
198
|
+
|
|
199
|
+
dfg("ev", _gb.equals);
|
|
200
|
+
dfg("nev", _gb.notEquals);
|
|
201
|
+
dfg("sm", _gb.same);
|
|
202
|
+
dfg("df", _gb.diffrent);
|
|
203
|
+
|
|
204
|
+
dfg("gtv", _gb.getherThan);
|
|
205
|
+
dfg("ltv", _gb.lessThan);
|
|
206
|
+
dfg("ngt", _gb.notGetherThan);
|
|
207
|
+
dfg("nlt", _gb.notLessThan);
|
|
208
|
+
|
|
209
|
+
dfg("gev", _gb.getherOrEquals);
|
|
210
|
+
dfg("lev", _gb.lessOrEquels);
|
|
211
|
+
dfg("nge", _gb.notGetherAndEquals);
|
|
212
|
+
dfg("nle", _gb.notLessAndEquals);
|
|
213
|
+
|
|
214
|
+
dfg("fc", _gb.isFalseCase);
|
|
215
|
+
dfg("nfc", _gb.isTrueCase);
|
|
216
|
+
|
|
217
|
+
dfg("xu", _gb.isUndefined);
|
|
218
|
+
dfg("xn", _gb.isNull);
|
|
219
|
+
dfg("xt", _gb.isExactTrue);
|
|
220
|
+
dfg("xf", _gb.isExactFalse);
|
|
221
|
+
|
|
222
|
+
dfg("nxu", _gb.isNotUndefined);
|
|
223
|
+
dfg("nxn", _gb.isNotNull);
|
|
224
|
+
dfg("nxt", _gb.isNotTrue);
|
|
225
|
+
dfg("nxf", _gb.isNotFalse);
|
|
226
|
+
|
|
227
|
+
dfg("en", _gb.isNully);
|
|
228
|
+
dfg("et", _gb.isTruely);
|
|
229
|
+
dfg("ef", _gb.isFalsely);
|
|
230
|
+
dfg("ee", _gb.isEmpty);
|
|
231
|
+
|
|
232
|
+
dfg("nn", _gb.isNotNully);
|
|
233
|
+
dfg("nt", _gb.isNotTruely);
|
|
234
|
+
dfg("nf", _gb.isNotFalsely);
|
|
235
|
+
dfg("ne", _gb.isNotEmpty);
|
|
236
|
+
|
|
237
|
+
dfg("noe", _gb.isNullOrEmpty);
|
|
238
|
+
dfg("nne", _gb.isNotNullAndEmpty);
|
|
239
239
|
|
|
240
240
|
|
|
241
241
|
// quick execute by conditions constant
|
|
242
|
-
dfg("inoe",
|
|
243
|
-
dfg("inne",
|
|
242
|
+
dfg("inoe", _gb.ifNullOrEmpty);
|
|
243
|
+
dfg("inne", _gb.ifNotNullAndEmpty);
|
|
244
244
|
|
|
245
245
|
|
|
246
246
|
// do and return inline double takes
|
|
247
|
-
dfg("dr",
|
|
248
|
-
dfg("drx",
|
|
247
|
+
dfg("dr", _gb.doAndReturn);
|
|
248
|
+
dfg("drx", _gb.doAndReturnByExecute);
|
|
249
249
|
|
|
250
250
|
|
|
251
251
|
// object method shortcut constant
|
|
252
|
-
dfg("ok",
|
|
253
|
-
dfg("ov",
|
|
254
|
-
dfg("oe",
|
|
255
|
-
dfg("oc",
|
|
252
|
+
dfg("ok", _gb.keysOf);
|
|
253
|
+
dfg("ov", _gb.valuesOf);
|
|
254
|
+
dfg("oe", _gb.entriesOf);
|
|
255
|
+
dfg("oc", _gb.countOf);
|
|
256
256
|
|
|
257
|
-
dfg("occ",
|
|
257
|
+
dfg("occ", _gb.checkCount);
|
|
258
258
|
|
|
259
259
|
|
|
260
260
|
// match case constant
|
|
261
|
-
dfg("mc",
|
|
262
|
-
dfg("ec",
|
|
263
|
-
dfg("xc",
|
|
264
|
-
dfg("tc",
|
|
265
|
-
dfg("cc",
|
|
266
|
-
dfg("kc",
|
|
261
|
+
dfg("mc", _gb.matchCase);
|
|
262
|
+
dfg("ec", _gb.equalCase);
|
|
263
|
+
dfg("xc", _gb.exactCase);
|
|
264
|
+
dfg("tc", _gb.typeCase);
|
|
265
|
+
dfg("cc", _gb.classCase);
|
|
266
|
+
dfg("kc", _gb.kindCase);
|
|
267
267
|
|
|
268
268
|
|
|
269
269
|
/** variable data copy */
|
|
270
|
-
dfg("cp",
|
|
271
|
-
dfg("mk",
|
|
272
|
-
dfg("mm",
|
|
273
|
-
dfg("tw",
|
|
274
|
-
dfg("cn",
|
|
270
|
+
dfg("cp", _gb.copy);
|
|
271
|
+
dfg("mk", _gb.mock);
|
|
272
|
+
dfg("mm", _gb.mimic);
|
|
273
|
+
dfg("tw", _gb.twin);
|
|
274
|
+
dfg("cn", _gb.clone);
|
|
275
275
|
|
|
276
|
-
dfg("pc",
|
|
277
|
-
dfg("ow",
|
|
278
|
-
dfg("tk",
|
|
279
|
-
dfg("aq",
|
|
280
|
-
dfg("ih",
|
|
276
|
+
dfg("pc", _gb.patch);
|
|
277
|
+
dfg("ow", _gb.overwrite);
|
|
278
|
+
dfg("tk", _gb.takeover);
|
|
279
|
+
dfg("aq", _gb.acquire);
|
|
280
|
+
dfg("ih", _gb.inherit);
|
|
281
281
|
|
|
282
|
-
dfg("rv",
|
|
282
|
+
dfg("rv", _gb.revert);
|
|
283
283
|
|
|
284
284
|
|
|
285
285
|
/** run handle */
|
|
286
|
-
dfg("pq",
|
|
287
|
-
dfg("pd",
|
|
288
|
-
dfg("pp",
|
|
289
|
-
dfg("pb",
|
|
290
|
-
dfg("ppq",
|
|
291
|
-
dfg("paq",
|
|
292
|
-
dfg("pwq",
|
|
293
|
-
dfg("pfq",
|
|
294
|
-
dfg("pfp",
|
|
286
|
+
dfg("pq", _gb.postQueue);
|
|
287
|
+
dfg("pd", _gb.postDelayed);
|
|
288
|
+
dfg("pp", _gb.postPromise);
|
|
289
|
+
dfg("pb", _gb.postBonded);
|
|
290
|
+
dfg("ppq", _gb.postPromiseQueue);
|
|
291
|
+
dfg("paq", _gb.postAsyncQueue);
|
|
292
|
+
dfg("pwq", _gb.postAwaitQueue);
|
|
293
|
+
dfg("pfq", _gb.postFrameQueue);
|
|
294
|
+
dfg("pfp", _gb.postFramePromise);
|
|
295
295
|
|
|
296
296
|
|
|
297
297
|
// Object function shortcut constants
|
|
298
|
-
dfg("dsp",
|
|
299
|
-
dfg("dp",
|
|
300
|
-
dfg("dpx",
|
|
301
|
-
dfg("dspgs",
|
|
302
|
-
dfg("dpgs",
|
|
303
|
-
dfg("dpgsx",
|
|
298
|
+
dfg("dsp", _gb.defineStaticProperty);
|
|
299
|
+
dfg("dp", _gb.defineProperty);
|
|
300
|
+
dfg("dpx", _gb.definePropertyPlex);
|
|
301
|
+
dfg("dspgs", _gb.defineStaticGetterAndSetter);
|
|
302
|
+
dfg("dpgs", _gb.defineGetterAndSetter);
|
|
303
|
+
dfg("dpgsx", _gb.defineGetterAndSetterPlex);
|
|
304
304
|
|
|
305
305
|
|
|
306
306
|
// additional static function for classes
|
|
@@ -316,35 +316,35 @@ definePropertyPlex("tc", function () { return typeCase(this.it, ...arguments); }
|
|
|
316
316
|
definePropertyPlex("cc", function () { return classCase(this.it, ...arguments); });
|
|
317
317
|
definePropertyPlex("kc", function () { return kindCase(this.it, ...arguments); });
|
|
318
318
|
|
|
319
|
-
definePropertyPlex("ee", function (process = it => it, ornot = it => it, numberEmptyMatch = 0) { return
|
|
320
|
-
definePropertyPlex("ne", function (process = it => it, ornot = it => it, numberEmptyMatch = 0) { return
|
|
319
|
+
definePropertyPlex("ee", function (process = it => it, ornot = it => it, numberEmptyMatch = 0) { return _gb.isEmpty(this.it, numberEmptyMatch) ? process(this.it) : ornot(this.it); });
|
|
320
|
+
definePropertyPlex("ne", function (process = it => it, ornot = it => it, numberEmptyMatch = 0) { return _gb.isNotEmpty(this.it, numberEmptyMatch) ? process(this.it) : ornot(this.it); });
|
|
321
321
|
|
|
322
|
-
definePropertyPlex("dr", function (does = (it, args) => { }, returns, args = []) { return
|
|
323
|
-
definePropertyPlex("drx", function (does = (it, args) => { }, forReturns, args = []) { return
|
|
322
|
+
definePropertyPlex("dr", function (does = (it, args) => { }, returns, args = []) { return _gb.doAndReturn(does, returns, [this.it, ...args]); });
|
|
323
|
+
definePropertyPlex("drx", function (does = (it, args) => { }, forReturns, args = []) { return _gb.doAndReturnByExecute(does, forReturns, [this.it, ...args]); });
|
|
324
324
|
|
|
325
|
-
defineGetterAndSetter(Object, "ok", function () { return
|
|
326
|
-
defineGetterAndSetter(Object, "ov", function () { return
|
|
327
|
-
defineGetterAndSetter(Object, "oe", function () { return
|
|
328
|
-
defineGetterAndSetter(Object, "oc", function () { return
|
|
329
|
-
defineGetterAndSetter(Object, "occ", function () { return
|
|
325
|
+
defineGetterAndSetter(Object, "ok", function () { return _gb.keysOf(this.it); });
|
|
326
|
+
defineGetterAndSetter(Object, "ov", function () { return _gb.valuesOf(this.it); });
|
|
327
|
+
defineGetterAndSetter(Object, "oe", function () { return _gb.entriesOf(this.it); });
|
|
328
|
+
defineGetterAndSetter(Object, "oc", function () { return _gb.countOf(this.it); });
|
|
329
|
+
defineGetterAndSetter(Object, "occ", function () { return _gb.checkCount(this.it, (k, v) => true); });
|
|
330
330
|
|
|
331
|
-
defineProperty(Object, "fk", function (work = key => { return false; }) { return
|
|
332
|
-
defineProperty(Object, "fv", function (work = value => { return false; }) { return
|
|
333
|
-
defineProperty(Object, "fe", function (work = (key, value) => { return false; }) { return
|
|
334
|
-
defineProperty(Object, "fkv", function (work = (key, value) => { return false; }) { return
|
|
331
|
+
defineProperty(Object, "fk", function (work = key => { return false; }) { return _gb.forof(this.it.ways, work); });
|
|
332
|
+
defineProperty(Object, "fv", function (work = value => { return false; }) { return _gb.forof(this.it.looks, work); });
|
|
333
|
+
defineProperty(Object, "fe", function (work = (key, value) => { return false; }) { return _gb.forkv(this.it.entire, work); });
|
|
334
|
+
defineProperty(Object, "fkv", function (work = (key, value) => { return false; }) { return _gb.forkv(this.it.entire, work); });
|
|
335
335
|
|
|
336
|
-
defineProperty(Object, "cp", function (dataOnly = true, primitiveOnly = false, recusive = true) { return
|
|
337
|
-
defineProperty(Object, "pc", function (from, dataOnly = true, primitiveOnly = false, recusive = true, append = false) { return
|
|
338
|
-
defineProperty(Object, "rv", function (from, dataOnly = true, primitiveOnly = false, recusive = true, exceptNew = false) { return
|
|
336
|
+
defineProperty(Object, "cp", function (dataOnly = true, primitiveOnly = false, recusive = true) { return _gb.copy(this, dataOnly, primitiveOnly, recusive); });
|
|
337
|
+
defineProperty(Object, "pc", function (from, dataOnly = true, primitiveOnly = false, recusive = true, append = false) { return _gb.patch(this.it, from, dataOnly, primitiveOnly, recusive, append); });
|
|
338
|
+
defineProperty(Object, "rv", function (from, dataOnly = true, primitiveOnly = false, recusive = true, exceptNew = false) { return _gb.revert(this.it, from, dataOnly, primitiveOnly, recusive, exceptNew); });
|
|
339
339
|
|
|
340
|
-
definePropertyPlex("ifeq", function (that, process = it => it, ornot = it => { }) { return this.let(it =>
|
|
341
|
-
definePropertyPlex("ifneq", function (that, process = it => it, ornot = it => { }) { return this.let(it =>
|
|
340
|
+
definePropertyPlex("ifeq", function (that, process = it => it, ornot = it => { }) { return this.let(it => _gb.executeIf(it == that, process, [it], ornot)); });
|
|
341
|
+
definePropertyPlex("ifneq", function (that, process = it => it, ornot = it => { }) { return this.let(it => _gb.executeIf(it != that, process, [it], ornot)); });
|
|
342
342
|
|
|
343
343
|
|
|
344
344
|
|
|
345
345
|
// Regex builder alias
|
|
346
346
|
dfg("rx", (regex, flags) => new RegExp(regex, flags));
|
|
347
|
-
dfg("reg",
|
|
347
|
+
dfg("reg", _gb.rx);
|
|
348
348
|
dfg("ri", regex => new RegExp(regex, "i"));
|
|
349
349
|
dfg("rg", regex => new RegExp(regex, "g"));
|
|
350
350
|
dfg("rm", regex => new RegExp(regex, "m"));
|
|
@@ -358,37 +358,37 @@ dfg("rigm", regex => new RegExp(regex, "igm"));
|
|
|
358
358
|
// common extra characters constants
|
|
359
359
|
dfg("lt", "<");
|
|
360
360
|
dfg("gt", ">");
|
|
361
|
-
dfg("ab",
|
|
362
|
-
dfg("cb",
|
|
361
|
+
dfg("ab", _gb.lt + _gb.gt);
|
|
362
|
+
dfg("cb", _gb.gt + _gb.lt);
|
|
363
363
|
dfg("ti", "~");
|
|
364
364
|
dfg("ep", "!");
|
|
365
|
-
dfg("em",
|
|
365
|
+
dfg("em", _gb.ep);
|
|
366
366
|
dfg("at", "@");
|
|
367
367
|
dfg("ds", "$");
|
|
368
368
|
dfg("ms", "&");
|
|
369
369
|
dfg("ps", "%");
|
|
370
370
|
dfg("cf", "^");
|
|
371
371
|
dfg("ak", "*");
|
|
372
|
-
dfg("mp",
|
|
372
|
+
dfg("mp", _gb.ak);
|
|
373
373
|
dfg("ad", "+");
|
|
374
|
-
dfg("add",
|
|
374
|
+
dfg("add", _gb.ad + _gb.ad);
|
|
375
375
|
dfg("hp", "-");
|
|
376
|
-
dfg("sr",
|
|
377
|
-
dfg("srr",
|
|
376
|
+
dfg("sr", _gb.hp);
|
|
377
|
+
dfg("srr", _gb.sr + _gb.sr);
|
|
378
378
|
dfg("us", "_");
|
|
379
379
|
dfg("eq", "=");
|
|
380
380
|
dfg("vl", "|");
|
|
381
381
|
dfg("bs", "\\");
|
|
382
382
|
dfg("ss", "/");
|
|
383
|
-
dfg("dv",
|
|
383
|
+
dfg("dv", _gb.ss);
|
|
384
384
|
dfg("qm", "?");
|
|
385
|
-
dfg("nl",
|
|
386
|
-
dfg("le",
|
|
387
|
-
dfg("ge",
|
|
388
|
-
dfg("fa",
|
|
389
|
-
dfg("fs",
|
|
390
|
-
dfg("fm",
|
|
391
|
-
dfg("fd",
|
|
385
|
+
dfg("nl", _gb.ep + _gb.eq);
|
|
386
|
+
dfg("le", _gb.lt + _gb.eq);
|
|
387
|
+
dfg("ge", _gb.gt + _gb.eq);
|
|
388
|
+
dfg("fa", _gb.ad + _gb.eq);
|
|
389
|
+
dfg("fs", _gb.sr + _gb.eq);
|
|
390
|
+
dfg("fm", _gb.mp + _gb.eq);
|
|
391
|
+
dfg("fd", _gb.dv + _gb.eq);
|
|
392
392
|
dfg("sq", "'");
|
|
393
393
|
dfg("dq", '"');
|
|
394
394
|
dfg("gv", '`');
|
|
@@ -396,20 +396,20 @@ dfg("cl", ":");
|
|
|
396
396
|
dfg("sc", ";");
|
|
397
397
|
dfg("cm", ",");
|
|
398
398
|
dfg("es", "");
|
|
399
|
-
dfg("l",
|
|
399
|
+
dfg("l", _gb.cm);
|
|
400
400
|
dfg("s", " ");
|
|
401
401
|
dfg("i", "#");
|
|
402
402
|
dfg("d", ".");
|
|
403
403
|
|
|
404
404
|
dfg("cr", "\r");
|
|
405
405
|
dfg("lf", "\n");
|
|
406
|
-
dfg("crlf",
|
|
407
|
-
dfg("lfcr",
|
|
406
|
+
dfg("crlf", _gb.cr + _gb.lf);
|
|
407
|
+
dfg("lfcr", _gb.lf + _gb.cr);
|
|
408
408
|
dfg("tab", "\t");
|
|
409
409
|
|
|
410
410
|
dfg("ecr", "\\r");
|
|
411
411
|
dfg("elf", "\\n");
|
|
412
|
-
dfg("ecrlf",
|
|
413
|
-
dfg("elfcr",
|
|
412
|
+
dfg("ecrlf", _gb.ecr + _gb.elf);
|
|
413
|
+
dfg("elfcr", _gb.elf + _gb.ecr);
|
|
414
414
|
dfg("etab", "\\t");
|
|
415
415
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alienese",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Alienise.js - Estre javscript Alienese patch",
|
|
5
5
|
"main": "alienese.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"modernism": "^0.4.
|
|
7
|
+
"modernism": "^0.4.3"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|