jscrewit 2.35.1 → 2.36.0
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/Features.md +6 -2
- package/api-doc/README.md +18 -56
- package/api-doc/interfaces/CustomFeature.md +32 -7
- package/api-doc/interfaces/ElementaryFeature.md +28 -0
- package/api-doc/interfaces/Feature.md +9 -1
- package/api-doc/interfaces/FeatureAll.md +38 -16
- package/api-doc/interfaces/FeatureConstructor.md +118 -84
- package/api-doc/interfaces/PredefinedFeature.md +35 -7
- package/api-doc/interfaces/default.md +1 -1
- package/api-doc/interfaces/encode.md +10 -10
- package/lib/feature-all.d.ts +29 -15
- package/lib/jscrewit.js +67 -39
- package/lib/jscrewit.min.js +2 -2
- package/package.json +3 -3
- package/readme.md +5 -5
|
@@ -17,12 +17,22 @@ Creates a new feature object from the union of the specified features.
|
|
|
17
17
|
The constructor can be used with or without the `new` operator, e.g.
|
|
18
18
|
`new JScrewIt.Feature(feature1, feature2)` or `JScrewIt.Feature(feature1, feature2)`.
|
|
19
19
|
If no arguments are specified, the new feature object will be equivalent to
|
|
20
|
-
[`DEFAULT`](
|
|
20
|
+
[`DEFAULT`](FeatureAll.md#default).
|
|
21
|
+
|
|
22
|
+
#### Parameters
|
|
23
|
+
|
|
24
|
+
| Name | Type |
|
|
25
|
+
| :------ | :------ |
|
|
26
|
+
| `...features` | [`FeatureElementOrCompatibleArray`](../README.md#featureelementorcompatiblearray)[] |
|
|
27
|
+
|
|
28
|
+
#### Returns
|
|
29
|
+
|
|
30
|
+
[`CustomFeature`](CustomFeature.md)
|
|
21
31
|
|
|
22
32
|
**`Example`**
|
|
23
33
|
|
|
24
34
|
The following statements are equivalent, and will all construct a new feature object
|
|
25
|
-
including both [`ANY_DOCUMENT`](
|
|
35
|
+
including both [`ANY_DOCUMENT`](FeatureAll.md#any_document) and [`ANY_WINDOW`](FeatureConstructor.md#any_window).
|
|
26
36
|
|
|
27
37
|
```js
|
|
28
38
|
new JScrewIt.Feature("ANY_DOCUMENT", "ANY_WINDOW");
|
|
@@ -40,16 +50,6 @@ new JScrewIt.Feature([JScrewIt.Feature.ANY_DOCUMENT, JScrewIt.Feature.ANY_WINDOW
|
|
|
40
50
|
|
|
41
51
|
An error is thrown if any of the specified features are not mutually compatible.
|
|
42
52
|
|
|
43
|
-
#### Parameters
|
|
44
|
-
|
|
45
|
-
| Name | Type |
|
|
46
|
-
| :------ | :------ |
|
|
47
|
-
| `...features` | [`FeatureElementOrCompatibleArray`](../README.md#featureelementorcompatiblearray)[] |
|
|
48
|
-
|
|
49
|
-
#### Returns
|
|
50
|
-
|
|
51
|
-
[`CustomFeature`](CustomFeature.md)
|
|
52
|
-
|
|
53
53
|
## Table of contents
|
|
54
54
|
|
|
55
55
|
### Constructors
|
|
@@ -73,7 +73,7 @@ An error is thrown if any of the specified features are not mutually compatible.
|
|
|
73
73
|
- [BROWSER](FeatureConstructor.md#browser)
|
|
74
74
|
- [CAPITAL\_HTML](FeatureConstructor.md#capital_html)
|
|
75
75
|
- [CHROME](FeatureConstructor.md#chrome)
|
|
76
|
-
- [CHROME\
|
|
76
|
+
- [CHROME\_122](FeatureConstructor.md#chrome_122)
|
|
77
77
|
- [CHROME\_PREV](FeatureConstructor.md#chrome_prev)
|
|
78
78
|
- [COMPACT](FeatureConstructor.md#compact)
|
|
79
79
|
- [CONSOLE](FeatureConstructor.md#console)
|
|
@@ -130,6 +130,7 @@ An error is thrown if any of the specified features are not mutually compatible.
|
|
|
130
130
|
- [NO\_IE\_SRC](FeatureConstructor.md#no_ie_src)
|
|
131
131
|
- [NO\_OLD\_SAFARI\_ARRAY\_ITERATOR](FeatureConstructor.md#no_old_safari_array_iterator)
|
|
132
132
|
- [NO\_V8\_SRC](FeatureConstructor.md#no_v8_src)
|
|
133
|
+
- [OBJECT\_ARRAY\_ENTRIES\_CTOR](FeatureConstructor.md#object_array_entries_ctor)
|
|
133
134
|
- [OBJECT\_L\_LOCATION\_CTOR](FeatureConstructor.md#object_l_location_ctor)
|
|
134
135
|
- [OBJECT\_UNDEFINED](FeatureConstructor.md#object_undefined)
|
|
135
136
|
- [OBJECT\_W\_CTOR](FeatureConstructor.md#object_w_ctor)
|
|
@@ -143,6 +144,7 @@ An error is thrown if any of the specified features are not mutually compatible.
|
|
|
143
144
|
- [SAFARI\_14\_0\_1](FeatureConstructor.md#safari_14_0_1)
|
|
144
145
|
- [SAFARI\_14\_1](FeatureConstructor.md#safari_14_1)
|
|
145
146
|
- [SAFARI\_15\_4](FeatureConstructor.md#safari_15_4)
|
|
147
|
+
- [SAFARI\_17\_4](FeatureConstructor.md#safari_17_4)
|
|
146
148
|
- [SAFARI\_7\_0](FeatureConstructor.md#safari_7_0)
|
|
147
149
|
- [SAFARI\_7\_1](FeatureConstructor.md#safari_7_1)
|
|
148
150
|
- [SAFARI\_9](FeatureConstructor.md#safari_9)
|
|
@@ -165,19 +167,29 @@ An error is thrown if any of the specified features are not mutually compatible.
|
|
|
165
167
|
|
|
166
168
|
### constructor
|
|
167
169
|
|
|
168
|
-
• **new FeatureConstructor**(`...features`)
|
|
170
|
+
• **new FeatureConstructor**(`...features`): [`CustomFeature`](CustomFeature.md)
|
|
169
171
|
|
|
170
172
|
Creates a new feature object from the union of the specified features.
|
|
171
173
|
|
|
172
174
|
The constructor can be used with or without the `new` operator, e.g.
|
|
173
175
|
`new JScrewIt.Feature(feature1, feature2)` or `JScrewIt.Feature(feature1, feature2)`.
|
|
174
176
|
If no arguments are specified, the new feature object will be equivalent to
|
|
175
|
-
[`DEFAULT`](
|
|
177
|
+
[`DEFAULT`](FeatureAll.md#default).
|
|
178
|
+
|
|
179
|
+
#### Parameters
|
|
180
|
+
|
|
181
|
+
| Name | Type |
|
|
182
|
+
| :------ | :------ |
|
|
183
|
+
| `...features` | [`FeatureElementOrCompatibleArray`](../README.md#featureelementorcompatiblearray)[] |
|
|
184
|
+
|
|
185
|
+
#### Returns
|
|
186
|
+
|
|
187
|
+
[`CustomFeature`](CustomFeature.md)
|
|
176
188
|
|
|
177
189
|
**`Example`**
|
|
178
190
|
|
|
179
191
|
The following statements are equivalent, and will all construct a new feature object
|
|
180
|
-
including both [`ANY_DOCUMENT`](
|
|
192
|
+
including both [`ANY_DOCUMENT`](FeatureAll.md#any_document) and [`ANY_WINDOW`](FeatureConstructor.md#any_window).
|
|
181
193
|
|
|
182
194
|
```js
|
|
183
195
|
JScrewIt.Feature("ANY_DOCUMENT", "ANY_WINDOW");
|
|
@@ -195,12 +207,6 @@ JScrewIt.Feature([JScrewIt.Feature.ANY_DOCUMENT, JScrewIt.Feature.ANY_WINDOW]);
|
|
|
195
207
|
|
|
196
208
|
An error is thrown if any of the specified features are not mutually compatible.
|
|
197
209
|
|
|
198
|
-
#### Parameters
|
|
199
|
-
|
|
200
|
-
| Name | Type |
|
|
201
|
-
| :------ | :------ |
|
|
202
|
-
| `...features` | [`FeatureElementOrCompatibleArray`](../README.md#featureelementorcompatiblearray)[] |
|
|
203
|
-
|
|
204
210
|
#### Inherited from
|
|
205
211
|
|
|
206
212
|
FeatureAll.constructor
|
|
@@ -425,7 +431,7 @@ ___
|
|
|
425
431
|
|
|
426
432
|
Features available in the current stable versions of Chrome, Edge and Opera.
|
|
427
433
|
|
|
428
|
-
An alias for `
|
|
434
|
+
An alias for `CHROME_122`.
|
|
429
435
|
|
|
430
436
|
#### Inherited from
|
|
431
437
|
|
|
@@ -433,15 +439,15 @@ An alias for `CHROME_92`.
|
|
|
433
439
|
|
|
434
440
|
___
|
|
435
441
|
|
|
436
|
-
### CHROME\
|
|
442
|
+
### CHROME\_122
|
|
437
443
|
|
|
438
|
-
• **CHROME\
|
|
444
|
+
• **CHROME\_122**: [`PredefinedFeature`](PredefinedFeature.md)
|
|
439
445
|
|
|
440
|
-
Features available in Chrome
|
|
446
|
+
Features available in Chrome 122, Edge 122 and Opera 108 or later.
|
|
441
447
|
|
|
442
448
|
**`Remarks`**
|
|
443
449
|
|
|
444
|
-
This feature may be replaced or removed in the near future when current browser versions become obsolete. Use `CHROME` or `CHROME_PREV` instead of `
|
|
450
|
+
This feature may be replaced or removed in the near future when current browser versions become obsolete. Use `CHROME` or `CHROME_PREV` instead of `CHROME_122` for long term support.
|
|
445
451
|
|
|
446
452
|
**`See`**
|
|
447
453
|
|
|
@@ -449,7 +455,7 @@ This feature may be replaced or removed in the near future when current browser
|
|
|
449
455
|
|
|
450
456
|
#### Inherited from
|
|
451
457
|
|
|
452
|
-
[FeatureAll](FeatureAll.md).[
|
|
458
|
+
[FeatureAll](FeatureAll.md).[CHROME_122](FeatureAll.md#chrome_122)
|
|
453
459
|
|
|
454
460
|
___
|
|
455
461
|
|
|
@@ -459,7 +465,7 @@ ___
|
|
|
459
465
|
|
|
460
466
|
Features available in the previous to current versions of Chrome and Edge.
|
|
461
467
|
|
|
462
|
-
An alias for `
|
|
468
|
+
An alias for `CHROME_122`.
|
|
463
469
|
|
|
464
470
|
#### Inherited from
|
|
465
471
|
|
|
@@ -767,7 +773,7 @@ A string representation of dynamically generated functions where the character a
|
|
|
767
773
|
|
|
768
774
|
**`Remarks`**
|
|
769
775
|
|
|
770
|
-
Available in Chrome, Edge, Firefox, Opera, and Node.js 10+.
|
|
776
|
+
Available in Chrome, Edge, Firefox, Safari 17.4+, Opera, and Node.js 10+.
|
|
771
777
|
|
|
772
778
|
#### Inherited from
|
|
773
779
|
|
|
@@ -783,7 +789,7 @@ A string representation of dynamically generated functions where the character a
|
|
|
783
789
|
|
|
784
790
|
**`Remarks`**
|
|
785
791
|
|
|
786
|
-
Available in Internet Explorer, Safari 9
|
|
792
|
+
Available in Internet Explorer, Safari 9+ before 17.4, Android Browser, and Node.js before 10.
|
|
787
793
|
|
|
788
794
|
#### Inherited from
|
|
789
795
|
|
|
@@ -1255,7 +1261,7 @@ ___
|
|
|
1255
1261
|
|
|
1256
1262
|
• **NO\_OLD\_SAFARI\_ARRAY\_ITERATOR**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
1257
1263
|
|
|
1258
|
-
The property that the string representation of Array.prototype.entries\(\) evaluates to "\[object Array Iterator\]"
|
|
1264
|
+
The property that the string representation of Array.prototype.entries\(\) evaluates to "\[object Array Iterator\]".
|
|
1259
1265
|
|
|
1260
1266
|
**`Remarks`**
|
|
1261
1267
|
|
|
@@ -1285,11 +1291,27 @@ Available in Firefox, Internet Explorer, and Safari.
|
|
|
1285
1291
|
|
|
1286
1292
|
___
|
|
1287
1293
|
|
|
1294
|
+
### OBJECT\_ARRAY\_ENTRIES\_CTOR
|
|
1295
|
+
|
|
1296
|
+
• **OBJECT\_ARRAY\_ENTRIES\_CTOR**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
1297
|
+
|
|
1298
|
+
The property that the Array.prototype.entries\(\).constructor is the Object constructor.
|
|
1299
|
+
|
|
1300
|
+
**`Remarks`**
|
|
1301
|
+
|
|
1302
|
+
Available in Firefox, Safari 9+, and Node.js 0.12+.
|
|
1303
|
+
|
|
1304
|
+
#### Inherited from
|
|
1305
|
+
|
|
1306
|
+
[FeatureAll](FeatureAll.md).[OBJECT_ARRAY_ENTRIES_CTOR](FeatureAll.md#object_array_entries_ctor)
|
|
1307
|
+
|
|
1308
|
+
___
|
|
1309
|
+
|
|
1288
1310
|
### OBJECT\_L\_LOCATION\_CTOR
|
|
1289
1311
|
|
|
1290
1312
|
• **OBJECT\_L\_LOCATION\_CTOR**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
1291
1313
|
|
|
1292
|
-
Existence of the global function location.constructor whose string representation starts with "\[object L"
|
|
1314
|
+
Existence of the global function location.constructor whose string representation starts with "\[object L".
|
|
1293
1315
|
|
|
1294
1316
|
**`Remarks`**
|
|
1295
1317
|
|
|
@@ -1321,7 +1343,7 @@ ___
|
|
|
1321
1343
|
|
|
1322
1344
|
• **OBJECT\_W\_CTOR**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
1323
1345
|
|
|
1324
|
-
The property that the string representation of the global object constructor starts with "\[object W"
|
|
1346
|
+
The property that the string representation of the global object constructor starts with "\[object W".
|
|
1325
1347
|
|
|
1326
1348
|
**`Remarks`**
|
|
1327
1349
|
|
|
@@ -1337,7 +1359,7 @@ ___
|
|
|
1337
1359
|
|
|
1338
1360
|
• **OLD\_SAFARI\_LOCATION\_CTOR**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
1339
1361
|
|
|
1340
|
-
Existence of the global object location.constructor whose string representation starts with "\[object " and ends with "LocationConstructor\]"
|
|
1362
|
+
Existence of the global object location.constructor whose string representation starts with "\[object " and ends with "LocationConstructor\]".
|
|
1341
1363
|
|
|
1342
1364
|
**`Remarks`**
|
|
1343
1365
|
|
|
@@ -1353,7 +1375,7 @@ ___
|
|
|
1353
1375
|
|
|
1354
1376
|
• **PLAIN\_INTL**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
1355
1377
|
|
|
1356
|
-
Existence of the global object Intl having the string representation "\[object Object\]"
|
|
1378
|
+
Existence of the global object Intl having the string representation "\[object Object\]".
|
|
1357
1379
|
|
|
1358
1380
|
**`Remarks`**
|
|
1359
1381
|
|
|
@@ -1387,7 +1409,7 @@ ___
|
|
|
1387
1409
|
|
|
1388
1410
|
Features available in the current stable version of Safari.
|
|
1389
1411
|
|
|
1390
|
-
An alias for `
|
|
1412
|
+
An alias for `SAFARI_17_4`.
|
|
1391
1413
|
|
|
1392
1414
|
#### Inherited from
|
|
1393
1415
|
|
|
@@ -1459,7 +1481,7 @@ ___
|
|
|
1459
1481
|
|
|
1460
1482
|
• **SAFARI\_15\_4**: [`PredefinedFeature`](PredefinedFeature.md)
|
|
1461
1483
|
|
|
1462
|
-
Features available in Safari 15.4
|
|
1484
|
+
Features available in Safari 15.4 to 17.3.
|
|
1463
1485
|
|
|
1464
1486
|
#### Inherited from
|
|
1465
1487
|
|
|
@@ -1467,6 +1489,18 @@ Features available in Safari 15.4 or later.
|
|
|
1467
1489
|
|
|
1468
1490
|
___
|
|
1469
1491
|
|
|
1492
|
+
### SAFARI\_17\_4
|
|
1493
|
+
|
|
1494
|
+
• **SAFARI\_17\_4**: [`PredefinedFeature`](PredefinedFeature.md)
|
|
1495
|
+
|
|
1496
|
+
Features available in Safari 17.4 or later.
|
|
1497
|
+
|
|
1498
|
+
#### Inherited from
|
|
1499
|
+
|
|
1500
|
+
[FeatureAll](FeatureAll.md).[SAFARI_17_4](FeatureAll.md#safari_17_4)
|
|
1501
|
+
|
|
1502
|
+
___
|
|
1503
|
+
|
|
1470
1504
|
### SAFARI\_7\_0
|
|
1471
1505
|
|
|
1472
1506
|
• **SAFARI\_7\_0**: [`PredefinedFeature`](PredefinedFeature.md)
|
|
@@ -1621,18 +1655,6 @@ Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, and Androi
|
|
|
1621
1655
|
|
|
1622
1656
|
Determines whether the specified features are mutually compatible.
|
|
1623
1657
|
|
|
1624
|
-
**`Example`**
|
|
1625
|
-
|
|
1626
|
-
```js
|
|
1627
|
-
// false: only one of "V8_SRC" or "IE_SRC" may be available.
|
|
1628
|
-
JScrewIt.Feature.areCompatible("V8_SRC", "IE_SRC")
|
|
1629
|
-
```
|
|
1630
|
-
|
|
1631
|
-
```js
|
|
1632
|
-
// true
|
|
1633
|
-
JScrewIt.Feature.areCompatible(JScrewIt.Feature.DEFAULT, JScrewIt.Feature.FILL)
|
|
1634
|
-
```
|
|
1635
|
-
|
|
1636
1658
|
#### Parameters
|
|
1637
1659
|
|
|
1638
1660
|
| Name | Type |
|
|
@@ -1646,6 +1668,18 @@ JScrewIt.Feature.areCompatible(JScrewIt.Feature.DEFAULT, JScrewIt.Feature.FILL)
|
|
|
1646
1668
|
`true` if the specified features are mutually compatible; otherwise, `false`.
|
|
1647
1669
|
If less than two features are specified, the return value is `true`.
|
|
1648
1670
|
|
|
1671
|
+
**`Example`**
|
|
1672
|
+
|
|
1673
|
+
```js
|
|
1674
|
+
// false: only one of "V8_SRC" or "IE_SRC" may be available.
|
|
1675
|
+
JScrewIt.Feature.areCompatible("V8_SRC", "IE_SRC")
|
|
1676
|
+
```
|
|
1677
|
+
|
|
1678
|
+
```js
|
|
1679
|
+
// true
|
|
1680
|
+
JScrewIt.Feature.areCompatible(JScrewIt.Feature.DEFAULT, JScrewIt.Feature.FILL)
|
|
1681
|
+
```
|
|
1682
|
+
|
|
1649
1683
|
___
|
|
1650
1684
|
|
|
1651
1685
|
### areEqual
|
|
@@ -1657,6 +1691,19 @@ Determines whether all of the specified features are equivalent.
|
|
|
1657
1691
|
Different features are considered equivalent if they include the same set of elementary
|
|
1658
1692
|
features, regardless of any other difference.
|
|
1659
1693
|
|
|
1694
|
+
#### Parameters
|
|
1695
|
+
|
|
1696
|
+
| Name | Type |
|
|
1697
|
+
| :------ | :------ |
|
|
1698
|
+
| `...features` | [`FeatureElementOrCompatibleArray`](../README.md#featureelementorcompatiblearray)[] |
|
|
1699
|
+
|
|
1700
|
+
#### Returns
|
|
1701
|
+
|
|
1702
|
+
`boolean`
|
|
1703
|
+
|
|
1704
|
+
`true` if all of the specified features are equivalent; otherwise, `false`.
|
|
1705
|
+
If less than two arguments are specified, the return value is `true`.
|
|
1706
|
+
|
|
1660
1707
|
**`Example`**
|
|
1661
1708
|
|
|
1662
1709
|
```js
|
|
@@ -1669,6 +1716,14 @@ JScrewIt.Feature.areEqual(JScrewIt.Feature.CHROME, JScrewIt.Feature.FF)
|
|
|
1669
1716
|
JScrewIt.Feature.areEqual("DEFAULT", [])
|
|
1670
1717
|
```
|
|
1671
1718
|
|
|
1719
|
+
___
|
|
1720
|
+
|
|
1721
|
+
### commonOf
|
|
1722
|
+
|
|
1723
|
+
▸ **commonOf**(`...features`): ``null`` \| [`CustomFeature`](CustomFeature.md)
|
|
1724
|
+
|
|
1725
|
+
Creates a new feature object equivalent to the intersection of the specified features.
|
|
1726
|
+
|
|
1672
1727
|
#### Parameters
|
|
1673
1728
|
|
|
1674
1729
|
| Name | Type |
|
|
@@ -1677,46 +1732,25 @@ JScrewIt.Feature.areEqual("DEFAULT", [])
|
|
|
1677
1732
|
|
|
1678
1733
|
#### Returns
|
|
1679
1734
|
|
|
1680
|
-
`
|
|
1681
|
-
|
|
1682
|
-
`true` if all of the specified features are equivalent; otherwise, `false`.
|
|
1683
|
-
If less than two arguments are specified, the return value is `true`.
|
|
1684
|
-
|
|
1685
|
-
___
|
|
1686
|
-
|
|
1687
|
-
### commonOf
|
|
1688
|
-
|
|
1689
|
-
▸ **commonOf**(`...features`): ``null`` \| [`CustomFeature`](CustomFeature.md)
|
|
1735
|
+
``null`` \| [`CustomFeature`](CustomFeature.md)
|
|
1690
1736
|
|
|
1691
|
-
|
|
1737
|
+
A feature object, or `null` if no arguments are specified.
|
|
1692
1738
|
|
|
1693
1739
|
**`Example`**
|
|
1694
1740
|
|
|
1695
|
-
This will create a new feature object equivalent to [`NAME`](
|
|
1741
|
+
This will create a new feature object equivalent to [`NAME`](FeatureAll.md#name).
|
|
1696
1742
|
|
|
1697
1743
|
```js
|
|
1698
1744
|
const newFeature = JScrewIt.Feature.commonOf(["ATOB", "NAME"], ["NAME", "SELF"]);
|
|
1699
1745
|
```
|
|
1700
1746
|
|
|
1701
|
-
This will create a new feature object equivalent to [`ANY_DOCUMENT`](
|
|
1702
|
-
This is because both [`HTMLDOCUMENT`](
|
|
1747
|
+
This will create a new feature object equivalent to [FeatureConstructor.ANY_DOCUMENT | `ANY_DOCUMENT`](FeatureAll.md#any_document).
|
|
1748
|
+
This is because both [`HTMLDOCUMENT`](FeatureAll.md#htmldocument) and [`DOCUMENT`](FeatureConstructor.md#document) imply [FeatureConstructor.ANY_DOCUMENT | `ANY_DOCUMENT`](FeatureAll.md#any_document).
|
|
1703
1749
|
|
|
1704
1750
|
```js
|
|
1705
1751
|
const newFeature = JScrewIt.Feature.commonOf("HTMLDOCUMENT", "DOCUMENT");
|
|
1706
1752
|
```
|
|
1707
1753
|
|
|
1708
|
-
#### Parameters
|
|
1709
|
-
|
|
1710
|
-
| Name | Type |
|
|
1711
|
-
| :------ | :------ |
|
|
1712
|
-
| `...features` | [`FeatureElementOrCompatibleArray`](../README.md#featureelementorcompatiblearray)[] |
|
|
1713
|
-
|
|
1714
|
-
#### Returns
|
|
1715
|
-
|
|
1716
|
-
``null`` \| [`CustomFeature`](CustomFeature.md)
|
|
1717
|
-
|
|
1718
|
-
A feature object, or `null` if no arguments are specified.
|
|
1719
|
-
|
|
1720
1754
|
___
|
|
1721
1755
|
|
|
1722
1756
|
### descriptionFor
|
|
@@ -1725,14 +1759,6 @@ ___
|
|
|
1725
1759
|
|
|
1726
1760
|
Returns a short description of a predefined feature in plain English.
|
|
1727
1761
|
|
|
1728
|
-
**`Remarks`**
|
|
1729
|
-
|
|
1730
|
-
Different names or aliases of the same feature may have different descriptions.
|
|
1731
|
-
|
|
1732
|
-
**`Throws`**
|
|
1733
|
-
|
|
1734
|
-
An error is thrown if the specified argument is not a name or alias of a predefined feature.
|
|
1735
|
-
|
|
1736
1762
|
#### Parameters
|
|
1737
1763
|
|
|
1738
1764
|
| Name | Type | Description |
|
|
@@ -1742,3 +1768,11 @@ An error is thrown if the specified argument is not a name or alias of a predefi
|
|
|
1742
1768
|
#### Returns
|
|
1743
1769
|
|
|
1744
1770
|
`string`
|
|
1771
|
+
|
|
1772
|
+
**`Remarks`**
|
|
1773
|
+
|
|
1774
|
+
Different names or aliases of the same feature may have different descriptions.
|
|
1775
|
+
|
|
1776
|
+
**`Throws`**
|
|
1777
|
+
|
|
1778
|
+
An error is thrown if the specified argument is not a name or alias of a predefined feature.
|
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
# Interface: PredefinedFeature
|
|
2
2
|
|
|
3
|
+
Objects of this type indicate which of the capabilities that JScrewIt can use to minimize the
|
|
4
|
+
length of its output are available in a particular JavaScript engine.
|
|
5
|
+
|
|
6
|
+
JScrewIt comes with a set of predefined feature objects exposed as property values of
|
|
7
|
+
`JScrewIt.Feature` or [`JScrewIt.Feature.ALL`](FeatureConstructor.md#all), where the property
|
|
8
|
+
name is the feature's name or alias.
|
|
9
|
+
|
|
10
|
+
Besides these predefined features, it is possible to construct custom features from the union or
|
|
11
|
+
intersection of other features.
|
|
12
|
+
|
|
13
|
+
Among the predefined features, there are some special ones called *elementary* features.
|
|
14
|
+
Elementary features either cannot be expressed as a union of any number of other features, or
|
|
15
|
+
they are different from such a union in that they exclude some other feature not excluded by
|
|
16
|
+
their elementary components.
|
|
17
|
+
All other features, called *composite* features, can be constructed as a union of zero or more
|
|
18
|
+
elementary features.
|
|
19
|
+
Two of the predefined composite features are particularly important: [`DEFAULT`](FeatureConstructor.md#default) is the empty feature, indicating that no elementary
|
|
20
|
+
feature is available at all; [`AUTO`](FeatureAll.md#auto) is the union of all
|
|
21
|
+
elementary features available in the current environment.
|
|
22
|
+
|
|
23
|
+
Not all features can be available at the same time: some features are necessarily incompatible,
|
|
24
|
+
meaning that they mutually exclude each other, and thus their union cannot be constructed.
|
|
25
|
+
|
|
3
26
|
## Hierarchy
|
|
4
27
|
|
|
5
|
-
- [`Feature`](
|
|
28
|
+
- [`Feature`](Feature.md)
|
|
6
29
|
|
|
7
30
|
↳ **`PredefinedFeature`**
|
|
8
31
|
|
|
@@ -33,7 +56,7 @@ implied features.
|
|
|
33
56
|
|
|
34
57
|
#### Inherited from
|
|
35
58
|
|
|
36
|
-
Feature.canonicalNames
|
|
59
|
+
[Feature](Feature.md).[canonicalNames](Feature.md#canonicalnames)
|
|
37
60
|
|
|
38
61
|
___
|
|
39
62
|
|
|
@@ -45,7 +68,7 @@ A boolean value indicating whether this is an elementary feature object.
|
|
|
45
68
|
|
|
46
69
|
#### Inherited from
|
|
47
70
|
|
|
48
|
-
Feature.elementary
|
|
71
|
+
[Feature](Feature.md).[elementary](Feature.md#elementary)
|
|
49
72
|
|
|
50
73
|
___
|
|
51
74
|
|
|
@@ -57,7 +80,7 @@ An array of all elementary feature names included in this feature object, withou
|
|
|
57
80
|
|
|
58
81
|
#### Inherited from
|
|
59
82
|
|
|
60
|
-
Feature.elementaryNames
|
|
83
|
+
[Feature](Feature.md).[elementaryNames](Feature.md#elementarynames)
|
|
61
84
|
|
|
62
85
|
___
|
|
63
86
|
|
|
@@ -65,9 +88,14 @@ ___
|
|
|
65
88
|
|
|
66
89
|
• `Readonly` **name**: [`PredefinedFeatureName`](../README.md#predefinedfeaturename)
|
|
67
90
|
|
|
91
|
+
The primary name of this feature object, useful for identification purpose.
|
|
92
|
+
|
|
93
|
+
All predefined features have a name; custom features may be optionally assigned a name, too.
|
|
94
|
+
If a name is assigned, it will be used when the feature is converted into a string.
|
|
95
|
+
|
|
68
96
|
#### Overrides
|
|
69
97
|
|
|
70
|
-
Feature.name
|
|
98
|
+
[Feature](Feature.md).[name](Feature.md#name)
|
|
71
99
|
|
|
72
100
|
## Methods
|
|
73
101
|
|
|
@@ -92,7 +120,7 @@ If no arguments are specified, the return value is `true`.
|
|
|
92
120
|
|
|
93
121
|
#### Inherited from
|
|
94
122
|
|
|
95
|
-
Feature.includes
|
|
123
|
+
[Feature](Feature.md).[includes](Feature.md#includes)
|
|
96
124
|
|
|
97
125
|
___
|
|
98
126
|
|
|
@@ -119,4 +147,4 @@ that require strict mode code, or inside web workers.
|
|
|
119
147
|
|
|
120
148
|
#### Inherited from
|
|
121
149
|
|
|
122
|
-
Feature.restrict
|
|
150
|
+
[Feature](Feature.md).[restrict](Feature.md#restrict)
|
|
@@ -8,16 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
Encodes a given string into JSFuck.
|
|
10
10
|
|
|
11
|
-
**`Throws`**
|
|
12
|
-
|
|
13
|
-
An `Error` is thrown under the following circumstances.
|
|
14
|
-
- The specified string cannot be encoded with the specified options.
|
|
15
|
-
- Some unknown features were specified.
|
|
16
|
-
- A combination of mutually incompatible features was specified.
|
|
17
|
-
- The option `runAs` (or `wrapWith`) was specified with an invalid value.
|
|
18
|
-
|
|
19
|
-
Also, an out of memory condition may occur when processing very large data.
|
|
20
|
-
|
|
21
11
|
#### Parameters
|
|
22
12
|
|
|
23
13
|
| Name | Type | Description |
|
|
@@ -31,6 +21,16 @@ Also, an out of memory condition may occur when processing very large data.
|
|
|
31
21
|
|
|
32
22
|
The encoded string.
|
|
33
23
|
|
|
24
|
+
**`Throws`**
|
|
25
|
+
|
|
26
|
+
An `Error` is thrown under the following circumstances.
|
|
27
|
+
- The specified string cannot be encoded with the specified options.
|
|
28
|
+
- Some unknown features were specified.
|
|
29
|
+
- A combination of mutually incompatible features was specified.
|
|
30
|
+
- The option `runAs` (or `wrapWith`) was specified with an invalid value.
|
|
31
|
+
|
|
32
|
+
Also, an out of memory condition may occur when processing very large data.
|
|
33
|
+
|
|
34
34
|
## Table of contents
|
|
35
35
|
|
|
36
36
|
### Properties
|