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
package/Features.md
CHANGED
|
@@ -6,7 +6,7 @@ This table lists features available in the most common engines.
|
|
|
6
6
|
<th>Features</th>
|
|
7
7
|
</tr>
|
|
8
8
|
<tr>
|
|
9
|
-
<td>Chrome
|
|
9
|
+
<td>Chrome 122+, Edge 122+, Opera 108+</td>
|
|
10
10
|
<td>
|
|
11
11
|
<ul>
|
|
12
12
|
<li><a href="api-doc/interfaces/FeatureAll.md#ANY_DOCUMENT"><code>ANY_DOCUMENT</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#HTMLDOCUMENT"><code>HTMLDOCUMENT</code></a>)
|
|
@@ -84,6 +84,7 @@ This table lists features available in the most common engines.
|
|
|
84
84
|
<li><a href="api-doc/interfaces/FeatureAll.md#NO_IE_SRC"><code>NO_IE_SRC</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#FF_SRC"><code>FF_SRC</code></a>)
|
|
85
85
|
<li><a href="api-doc/interfaces/FeatureAll.md#NO_OLD_SAFARI_ARRAY_ITERATOR"><code>NO_OLD_SAFARI_ARRAY_ITERATOR</code></a>
|
|
86
86
|
<li><a href="api-doc/interfaces/FeatureAll.md#NO_V8_SRC"><code>NO_V8_SRC</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#FF_SRC"><code>FF_SRC</code></a>)
|
|
87
|
+
<li><a href="api-doc/interfaces/FeatureAll.md#OBJECT_ARRAY_ENTRIES_CTOR"><code>OBJECT_ARRAY_ENTRIES_CTOR</code></a>
|
|
87
88
|
<li><a href="api-doc/interfaces/FeatureAll.md#OBJECT_UNDEFINED"><code>OBJECT_UNDEFINED</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#GLOBAL_UNDEFINED"><code>GLOBAL_UNDEFINED</code></a>)
|
|
88
89
|
<li><a href="api-doc/interfaces/FeatureAll.md#REGEXP_STRING_ITERATOR"><code>REGEXP_STRING_ITERATOR</code></a>
|
|
89
90
|
<li><a href="api-doc/interfaces/FeatureAll.md#SELF_OBJ"><code>SELF_OBJ</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#ANY_WINDOW"><code>ANY_WINDOW</code></a> and <a href="api-doc/interfaces/FeatureAll.md#WINDOW"><code>WINDOW</code></a>)
|
|
@@ -151,7 +152,8 @@ This table lists features available in the most common engines.
|
|
|
151
152
|
<li><a href="api-doc/interfaces/FeatureAll.md#FILL"><code>FILL</code></a> (Safari 7.1+)
|
|
152
153
|
<li><a href="api-doc/interfaces/FeatureAll.md#FLAT"><code>FLAT</code></a> (Safari 12+)
|
|
153
154
|
<li><a href="api-doc/interfaces/FeatureAll.md#FROM_CODE_POINT"><code>FROM_CODE_POINT</code></a> (Safari 9+)
|
|
154
|
-
<li><a href="api-doc/interfaces/FeatureAll.md#
|
|
155
|
+
<li><a href="api-doc/interfaces/FeatureAll.md#FUNCTION_19_LF"><code>FUNCTION_19_LF</code></a> (Safari 17.4+)
|
|
156
|
+
<li><a href="api-doc/interfaces/FeatureAll.md#FUNCTION_22_LF"><code>FUNCTION_22_LF</code></a> (Safari 9+, not in Safari 17.4+)
|
|
155
157
|
<li><a href="api-doc/interfaces/FeatureAll.md#GENERIC_ARRAY_TO_STRING"><code>GENERIC_ARRAY_TO_STRING</code></a>
|
|
156
158
|
<li><a href="api-doc/interfaces/FeatureAll.md#GLOBAL_UNDEFINED"><code>GLOBAL_UNDEFINED</code></a>
|
|
157
159
|
<li><a href="api-doc/interfaces/FeatureAll.md#GMT"><code>GMT</code></a>
|
|
@@ -168,6 +170,7 @@ This table lists features available in the most common engines.
|
|
|
168
170
|
<li><a href="api-doc/interfaces/FeatureAll.md#NO_IE_SRC"><code>NO_IE_SRC</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#FF_SRC"><code>FF_SRC</code></a>)
|
|
169
171
|
<li><a href="api-doc/interfaces/FeatureAll.md#NO_OLD_SAFARI_ARRAY_ITERATOR"><code>NO_OLD_SAFARI_ARRAY_ITERATOR</code></a> (Safari 9+)
|
|
170
172
|
<li><a href="api-doc/interfaces/FeatureAll.md#NO_V8_SRC"><code>NO_V8_SRC</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#FF_SRC"><code>FF_SRC</code></a>)
|
|
173
|
+
<li><a href="api-doc/interfaces/FeatureAll.md#OBJECT_ARRAY_ENTRIES_CTOR"><code>OBJECT_ARRAY_ENTRIES_CTOR</code></a> (Safari 9+)
|
|
171
174
|
<li><a href="api-doc/interfaces/FeatureAll.md#OBJECT_L_LOCATION_CTOR"><code>OBJECT_L_LOCATION_CTOR</code></a> (not in Safari 10+)
|
|
172
175
|
<li><a href="api-doc/interfaces/FeatureAll.md#OBJECT_UNDEFINED"><code>OBJECT_UNDEFINED</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#GLOBAL_UNDEFINED"><code>GLOBAL_UNDEFINED</code></a>)
|
|
173
176
|
<li><a href="api-doc/interfaces/FeatureAll.md#OBJECT_W_CTOR"><code>OBJECT_W_CTOR</code></a> (not in Safari 10+)
|
|
@@ -250,6 +253,7 @@ This table lists features available in the most common engines.
|
|
|
250
253
|
<li><a href="api-doc/interfaces/FeatureAll.md#NO_FF_SRC"><code>NO_FF_SRC</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#V8_SRC"><code>V8_SRC</code></a>)
|
|
251
254
|
<li><a href="api-doc/interfaces/FeatureAll.md#NO_IE_SRC"><code>NO_IE_SRC</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#V8_SRC"><code>V8_SRC</code></a>)
|
|
252
255
|
<li><a href="api-doc/interfaces/FeatureAll.md#NO_OLD_SAFARI_ARRAY_ITERATOR"><code>NO_OLD_SAFARI_ARRAY_ITERATOR</code></a> (Node.js 0.12+)
|
|
256
|
+
<li><a href="api-doc/interfaces/FeatureAll.md#OBJECT_ARRAY_ENTRIES_CTOR"><code>OBJECT_ARRAY_ENTRIES_CTOR</code></a> (Node.js 0.12+)
|
|
253
257
|
<li><a href="api-doc/interfaces/FeatureAll.md#OBJECT_UNDEFINED"><code>OBJECT_UNDEFINED</code></a> (implied by <a href="api-doc/interfaces/FeatureAll.md#GLOBAL_UNDEFINED"><code>GLOBAL_UNDEFINED</code></a>)
|
|
254
258
|
<li><a href="api-doc/interfaces/FeatureAll.md#PLAIN_INTL"><code>PLAIN_INTL</code></a> (Node.js 0.12+, not in Node.js 15+)
|
|
255
259
|
<li><a href="api-doc/interfaces/FeatureAll.md#REGEXP_STRING_ITERATOR"><code>REGEXP_STRING_ITERATOR</code></a> (Node.js 12+)
|
package/api-doc/README.md
CHANGED
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
|
|
25
25
|
### Variables
|
|
26
26
|
|
|
27
|
+
- [Feature](README.md#feature)
|
|
27
28
|
- [default](README.md#default)
|
|
28
29
|
|
|
29
30
|
### Functions
|
|
30
31
|
|
|
31
|
-
- [Feature](README.md#feature)
|
|
32
32
|
- [encode](README.md#encode)
|
|
33
33
|
|
|
34
34
|
## Type Aliases
|
|
35
35
|
|
|
36
36
|
### ElementaryFeatureName
|
|
37
37
|
|
|
38
|
-
Ƭ **ElementaryFeatureName**: ``"ANY_DOCUMENT"`` \| ``"ANY_WINDOW"`` \| ``"ARRAY_ITERATOR"`` \| ``"ARROW"`` \| ``"AT"`` \| ``"ATOB"`` \| ``"BARPROP"`` \| ``"CAPITAL_HTML"`` \| ``"CONSOLE"`` \| ``"DOCUMENT"`` \| ``"DOMWINDOW"`` \| ``"ESC_HTML_ALL"`` \| ``"ESC_HTML_QUOT"`` \| ``"ESC_HTML_QUOT_ONLY"`` \| ``"ESC_REGEXP_LF"`` \| ``"ESC_REGEXP_SLASH"`` \| ``"FF_SRC"`` \| ``"FILL"`` \| ``"FLAT"`` \| ``"FROM_CODE_POINT"`` \| ``"FUNCTION_19_LF"`` \| ``"FUNCTION_22_LF"`` \| ``"GENERIC_ARRAY_TO_STRING"`` \| ``"GLOBAL_UNDEFINED"`` \| ``"GMT"`` \| ``"HISTORY"`` \| ``"HTMLAUDIOELEMENT"`` \| ``"HTMLDOCUMENT"`` \| ``"IE_SRC"`` \| ``"INCR_CHAR"`` \| ``"INTL"`` \| ``"LOCALE_INFINITY"`` \| ``"LOCALE_NUMERALS"`` \| ``"LOCALE_NUMERALS_EXT"`` \| ``"LOCATION"`` \| ``"NAME"`` \| ``"NODECONSTRUCTOR"`` \| ``"NO_FF_SRC"`` \| ``"NO_IE_SRC"`` \| ``"NO_OLD_SAFARI_ARRAY_ITERATOR"`` \| ``"NO_V8_SRC"`` \| ``"OBJECT_L_LOCATION_CTOR"`` \| ``"OBJECT_UNDEFINED"`` \| ``"OBJECT_W_CTOR"`` \| ``"OLD_SAFARI_LOCATION_CTOR"`` \| ``"PLAIN_INTL"`` \| ``"REGEXP_STRING_ITERATOR"`` \| ``"SELF_OBJ"`` \| ``"SHORT_LOCALES"`` \| ``"STATUS"`` \| ``"UNDEFINED"`` \| ``"V8_SRC"`` \| ``"WINDOW"``
|
|
38
|
+
Ƭ **ElementaryFeatureName**: ``"ANY_DOCUMENT"`` \| ``"ANY_WINDOW"`` \| ``"ARRAY_ITERATOR"`` \| ``"ARROW"`` \| ``"AT"`` \| ``"ATOB"`` \| ``"BARPROP"`` \| ``"CAPITAL_HTML"`` \| ``"CONSOLE"`` \| ``"DOCUMENT"`` \| ``"DOMWINDOW"`` \| ``"ESC_HTML_ALL"`` \| ``"ESC_HTML_QUOT"`` \| ``"ESC_HTML_QUOT_ONLY"`` \| ``"ESC_REGEXP_LF"`` \| ``"ESC_REGEXP_SLASH"`` \| ``"FF_SRC"`` \| ``"FILL"`` \| ``"FLAT"`` \| ``"FROM_CODE_POINT"`` \| ``"FUNCTION_19_LF"`` \| ``"FUNCTION_22_LF"`` \| ``"GENERIC_ARRAY_TO_STRING"`` \| ``"GLOBAL_UNDEFINED"`` \| ``"GMT"`` \| ``"HISTORY"`` \| ``"HTMLAUDIOELEMENT"`` \| ``"HTMLDOCUMENT"`` \| ``"IE_SRC"`` \| ``"INCR_CHAR"`` \| ``"INTL"`` \| ``"LOCALE_INFINITY"`` \| ``"LOCALE_NUMERALS"`` \| ``"LOCALE_NUMERALS_EXT"`` \| ``"LOCATION"`` \| ``"NAME"`` \| ``"NODECONSTRUCTOR"`` \| ``"NO_FF_SRC"`` \| ``"NO_IE_SRC"`` \| ``"NO_OLD_SAFARI_ARRAY_ITERATOR"`` \| ``"NO_V8_SRC"`` \| ``"OBJECT_ARRAY_ENTRIES_CTOR"`` \| ``"OBJECT_L_LOCATION_CTOR"`` \| ``"OBJECT_UNDEFINED"`` \| ``"OBJECT_W_CTOR"`` \| ``"OLD_SAFARI_LOCATION_CTOR"`` \| ``"PLAIN_INTL"`` \| ``"REGEXP_STRING_ITERATOR"`` \| ``"SELF_OBJ"`` \| ``"SHORT_LOCALES"`` \| ``"STATUS"`` \| ``"UNDEFINED"`` \| ``"V8_SRC"`` \| ``"WINDOW"``
|
|
39
39
|
|
|
40
40
|
Name of an elementary feature.
|
|
41
41
|
|
|
@@ -43,7 +43,7 @@ ___
|
|
|
43
43
|
|
|
44
44
|
### FeatureElement
|
|
45
45
|
|
|
46
|
-
Ƭ **FeatureElement**: [`Feature`](
|
|
46
|
+
Ƭ **FeatureElement**: [`Feature`](interfaces/Feature.md) \| keyof [`FeatureAll`](interfaces/FeatureAll.md)
|
|
47
47
|
|
|
48
48
|
A feature object or a name or alias of a predefined feature.
|
|
49
49
|
|
|
@@ -71,7 +71,7 @@ ___
|
|
|
71
71
|
|
|
72
72
|
### PredefinedFeatureName
|
|
73
73
|
|
|
74
|
-
Ƭ **PredefinedFeatureName**: [`ElementaryFeatureName`](README.md#elementaryfeaturename) \| ``"ANDRO_4_0"`` \| ``"ANDRO_4_1"`` \| ``"ANDRO_4_4"`` \| ``"AUTO"`` \| ``"BROWSER"`` \| ``"
|
|
74
|
+
Ƭ **PredefinedFeatureName**: [`ElementaryFeatureName`](README.md#elementaryfeaturename) \| ``"ANDRO_4_0"`` \| ``"ANDRO_4_1"`` \| ``"ANDRO_4_4"`` \| ``"AUTO"`` \| ``"BROWSER"`` \| ``"CHROME_122"`` \| ``"COMPACT"`` \| ``"DEFAULT"`` \| ``"FF_90"`` \| ``"IE_10"`` \| ``"IE_11"`` \| ``"IE_11_WIN_10"`` \| ``"IE_9"`` \| ``"NODE_0_10"`` \| ``"NODE_0_12"`` \| ``"NODE_10"`` \| ``"NODE_11"`` \| ``"NODE_12"`` \| ``"NODE_13"`` \| ``"NODE_15"`` \| ``"NODE_16_0"`` \| ``"NODE_16_6"`` \| ``"NODE_4"`` \| ``"NODE_5"`` \| ``"SAFARI_10"`` \| ``"SAFARI_12"`` \| ``"SAFARI_13"`` \| ``"SAFARI_14_0_1"`` \| ``"SAFARI_14_1"`` \| ``"SAFARI_15_4"`` \| ``"SAFARI_17_4"`` \| ``"SAFARI_7_0"`` \| ``"SAFARI_7_1"`` \| ``"SAFARI_9"``
|
|
75
75
|
|
|
76
76
|
Name of a predefined feature.
|
|
77
77
|
|
|
@@ -86,61 +86,36 @@ See [`EncodeOptions.runAs`](interfaces/EncodeOptions.md#runas) for the meaning o
|
|
|
86
86
|
|
|
87
87
|
## Variables
|
|
88
88
|
|
|
89
|
-
### default
|
|
90
|
-
|
|
91
|
-
• **default**: [`default`](README.md#default)
|
|
92
|
-
|
|
93
|
-
## Functions
|
|
94
|
-
|
|
95
89
|
### Feature
|
|
96
90
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
Creates a new feature object from the union of the specified features.
|
|
100
|
-
|
|
101
|
-
The constructor can be used with or without the `new` operator, e.g.
|
|
102
|
-
`new JScrewIt.Feature(feature1, feature2)` or `JScrewIt.Feature(feature1, feature2)`.
|
|
103
|
-
If no arguments are specified, the new feature object will be equivalent to
|
|
104
|
-
[`DEFAULT`](interfaces/FeatureConstructor.md#default).
|
|
91
|
+
• **Feature**: [`FeatureConstructor`](interfaces/FeatureConstructor.md)
|
|
105
92
|
|
|
106
|
-
|
|
93
|
+
___
|
|
107
94
|
|
|
108
|
-
|
|
109
|
-
including both [`ANY_DOCUMENT`](interfaces/FeatureConstructor.md#any_document) and [`ANY_WINDOW`](interfaces/FeatureConstructor.md#any_window).
|
|
95
|
+
### default
|
|
110
96
|
|
|
111
|
-
|
|
112
|
-
new JScrewIt.Feature("ANY_DOCUMENT", "ANY_WINDOW");
|
|
113
|
-
```
|
|
97
|
+
• **default**: [`default`](interfaces/default.md)
|
|
114
98
|
|
|
115
|
-
|
|
116
|
-
new JScrewIt.Feature(JScrewIt.Feature.ANY_DOCUMENT, JScrewIt.Feature.ANY_WINDOW);
|
|
117
|
-
```
|
|
99
|
+
## Functions
|
|
118
100
|
|
|
119
|
-
|
|
120
|
-
new JScrewIt.Feature([JScrewIt.Feature.ANY_DOCUMENT, JScrewIt.Feature.ANY_WINDOW]);
|
|
121
|
-
```
|
|
101
|
+
### encode
|
|
122
102
|
|
|
123
|
-
|
|
103
|
+
▸ **encode**(`input`, `options?`): `string`
|
|
124
104
|
|
|
125
|
-
|
|
105
|
+
Encodes a given string into JSFuck.
|
|
126
106
|
|
|
127
107
|
#### Parameters
|
|
128
108
|
|
|
129
|
-
| Name | Type |
|
|
130
|
-
| :------ | :------ |
|
|
131
|
-
|
|
|
109
|
+
| Name | Type | Description |
|
|
110
|
+
| :------ | :------ | :------ |
|
|
111
|
+
| `input` | `string` | The string to encode. |
|
|
112
|
+
| `options?` | [`EncodeOptions`](interfaces/EncodeOptions.md) | An optional object specifying encoding options. |
|
|
132
113
|
|
|
133
114
|
#### Returns
|
|
134
115
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
___
|
|
138
|
-
|
|
139
|
-
### encode
|
|
140
|
-
|
|
141
|
-
▸ **encode**(`input`, `options?`): `string`
|
|
116
|
+
`string`
|
|
142
117
|
|
|
143
|
-
|
|
118
|
+
The encoded string.
|
|
144
119
|
|
|
145
120
|
**`Throws`**
|
|
146
121
|
|
|
@@ -151,16 +126,3 @@ An `Error` is thrown under the following circumstances.
|
|
|
151
126
|
- The option `runAs` (or `wrapWith`) was specified with an invalid value.
|
|
152
127
|
|
|
153
128
|
Also, an out of memory condition may occur when processing very large data.
|
|
154
|
-
|
|
155
|
-
#### Parameters
|
|
156
|
-
|
|
157
|
-
| Name | Type | Description |
|
|
158
|
-
| :------ | :------ | :------ |
|
|
159
|
-
| `input` | `string` | The string to encode. |
|
|
160
|
-
| `options?` | [`EncodeOptions`](interfaces/EncodeOptions.md) | An optional object specifying encoding options. |
|
|
161
|
-
|
|
162
|
-
#### Returns
|
|
163
|
-
|
|
164
|
-
`string`
|
|
165
|
-
|
|
166
|
-
The encoded string.
|
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
# Interface: CustomFeature
|
|
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
|
↳ **`CustomFeature`**
|
|
8
31
|
|
|
@@ -31,7 +54,7 @@ implied features.
|
|
|
31
54
|
|
|
32
55
|
#### Inherited from
|
|
33
56
|
|
|
34
|
-
Feature.canonicalNames
|
|
57
|
+
[Feature](Feature.md).[canonicalNames](Feature.md#canonicalnames)
|
|
35
58
|
|
|
36
59
|
___
|
|
37
60
|
|
|
@@ -39,9 +62,11 @@ ___
|
|
|
39
62
|
|
|
40
63
|
• `Readonly` **elementary**: ``false``
|
|
41
64
|
|
|
65
|
+
A boolean value indicating whether this is an elementary feature object.
|
|
66
|
+
|
|
42
67
|
#### Overrides
|
|
43
68
|
|
|
44
|
-
Feature.elementary
|
|
69
|
+
[Feature](Feature.md).[elementary](Feature.md#elementary)
|
|
45
70
|
|
|
46
71
|
___
|
|
47
72
|
|
|
@@ -53,7 +78,7 @@ An array of all elementary feature names included in this feature object, withou
|
|
|
53
78
|
|
|
54
79
|
#### Inherited from
|
|
55
80
|
|
|
56
|
-
Feature.elementaryNames
|
|
81
|
+
[Feature](Feature.md).[elementaryNames](Feature.md#elementarynames)
|
|
57
82
|
|
|
58
83
|
___
|
|
59
84
|
|
|
@@ -68,7 +93,7 @@ If a name is assigned, it will be used when the feature is converted into a stri
|
|
|
68
93
|
|
|
69
94
|
#### Inherited from
|
|
70
95
|
|
|
71
|
-
Feature.name
|
|
96
|
+
[Feature](Feature.md).[name](Feature.md#name)
|
|
72
97
|
|
|
73
98
|
## Methods
|
|
74
99
|
|
|
@@ -93,7 +118,7 @@ If no arguments are specified, the return value is `true`.
|
|
|
93
118
|
|
|
94
119
|
#### Inherited from
|
|
95
120
|
|
|
96
|
-
Feature.includes
|
|
121
|
+
[Feature](Feature.md).[includes](Feature.md#includes)
|
|
97
122
|
|
|
98
123
|
___
|
|
99
124
|
|
|
@@ -120,4 +145,4 @@ that require strict mode code, or inside web workers.
|
|
|
120
145
|
|
|
121
146
|
#### Inherited from
|
|
122
147
|
|
|
123
|
-
Feature.restrict
|
|
148
|
+
[Feature](Feature.md).[restrict](Feature.md#restrict)
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Interface: ElementaryFeature
|
|
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
28
|
- [`PredefinedFeature`](PredefinedFeature.md)
|
|
@@ -63,6 +86,11 @@ ___
|
|
|
63
86
|
|
|
64
87
|
• `Readonly` **name**: [`ElementaryFeatureName`](../README.md#elementaryfeaturename)
|
|
65
88
|
|
|
89
|
+
The primary name of this feature object, useful for identification purpose.
|
|
90
|
+
|
|
91
|
+
All predefined features have a name; custom features may be optionally assigned a name, too.
|
|
92
|
+
If a name is assigned, it will be used when the feature is converted into a string.
|
|
93
|
+
|
|
66
94
|
#### Overrides
|
|
67
95
|
|
|
68
96
|
[PredefinedFeature](PredefinedFeature.md).[name](PredefinedFeature.md#name)
|
|
@@ -17,12 +17,20 @@ their elementary components.
|
|
|
17
17
|
All other features, called *composite* features, can be constructed as a union of zero or more
|
|
18
18
|
elementary features.
|
|
19
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`](
|
|
20
|
+
feature is available at all; [`AUTO`](FeatureAll.md#auto) is the union of all
|
|
21
21
|
elementary features available in the current environment.
|
|
22
22
|
|
|
23
23
|
Not all features can be available at the same time: some features are necessarily incompatible,
|
|
24
24
|
meaning that they mutually exclude each other, and thus their union cannot be constructed.
|
|
25
25
|
|
|
26
|
+
## Hierarchy
|
|
27
|
+
|
|
28
|
+
- **`Feature`**
|
|
29
|
+
|
|
30
|
+
↳ [`CustomFeature`](CustomFeature.md)
|
|
31
|
+
|
|
32
|
+
↳ [`PredefinedFeature`](PredefinedFeature.md)
|
|
33
|
+
|
|
26
34
|
## Table of contents
|
|
27
35
|
|
|
28
36
|
### Properties
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
- [BROWSER](FeatureAll.md#browser)
|
|
25
25
|
- [CAPITAL\_HTML](FeatureAll.md#capital_html)
|
|
26
26
|
- [CHROME](FeatureAll.md#chrome)
|
|
27
|
-
- [CHROME\
|
|
27
|
+
- [CHROME\_122](FeatureAll.md#chrome_122)
|
|
28
28
|
- [CHROME\_PREV](FeatureAll.md#chrome_prev)
|
|
29
29
|
- [COMPACT](FeatureAll.md#compact)
|
|
30
30
|
- [CONSOLE](FeatureAll.md#console)
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
- [NO\_IE\_SRC](FeatureAll.md#no_ie_src)
|
|
81
81
|
- [NO\_OLD\_SAFARI\_ARRAY\_ITERATOR](FeatureAll.md#no_old_safari_array_iterator)
|
|
82
82
|
- [NO\_V8\_SRC](FeatureAll.md#no_v8_src)
|
|
83
|
+
- [OBJECT\_ARRAY\_ENTRIES\_CTOR](FeatureAll.md#object_array_entries_ctor)
|
|
83
84
|
- [OBJECT\_L\_LOCATION\_CTOR](FeatureAll.md#object_l_location_ctor)
|
|
84
85
|
- [OBJECT\_UNDEFINED](FeatureAll.md#object_undefined)
|
|
85
86
|
- [OBJECT\_W\_CTOR](FeatureAll.md#object_w_ctor)
|
|
@@ -93,6 +94,7 @@
|
|
|
93
94
|
- [SAFARI\_14\_0\_1](FeatureAll.md#safari_14_0_1)
|
|
94
95
|
- [SAFARI\_14\_1](FeatureAll.md#safari_14_1)
|
|
95
96
|
- [SAFARI\_15\_4](FeatureAll.md#safari_15_4)
|
|
97
|
+
- [SAFARI\_17\_4](FeatureAll.md#safari_17_4)
|
|
96
98
|
- [SAFARI\_7\_0](FeatureAll.md#safari_7_0)
|
|
97
99
|
- [SAFARI\_7\_1](FeatureAll.md#safari_7_1)
|
|
98
100
|
- [SAFARI\_9](FeatureAll.md#safari_9)
|
|
@@ -250,19 +252,19 @@ ___
|
|
|
250
252
|
|
|
251
253
|
Features available in the current stable versions of Chrome, Edge and Opera.
|
|
252
254
|
|
|
253
|
-
An alias for `
|
|
255
|
+
An alias for `CHROME_122`.
|
|
254
256
|
|
|
255
257
|
___
|
|
256
258
|
|
|
257
|
-
### CHROME\
|
|
259
|
+
### CHROME\_122
|
|
258
260
|
|
|
259
|
-
• **CHROME\
|
|
261
|
+
• **CHROME\_122**: [`PredefinedFeature`](PredefinedFeature.md)
|
|
260
262
|
|
|
261
|
-
Features available in Chrome
|
|
263
|
+
Features available in Chrome 122, Edge 122 and Opera 108 or later.
|
|
262
264
|
|
|
263
265
|
**`Remarks`**
|
|
264
266
|
|
|
265
|
-
This feature may be replaced or removed in the near future when current browser versions become obsolete. Use `CHROME` or `CHROME_PREV` instead of `
|
|
267
|
+
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.
|
|
266
268
|
|
|
267
269
|
**`See`**
|
|
268
270
|
|
|
@@ -276,7 +278,7 @@ ___
|
|
|
276
278
|
|
|
277
279
|
Features available in the previous to current versions of Chrome and Edge.
|
|
278
280
|
|
|
279
|
-
An alias for `
|
|
281
|
+
An alias for `CHROME_122`.
|
|
280
282
|
|
|
281
283
|
___
|
|
282
284
|
|
|
@@ -500,7 +502,7 @@ A string representation of dynamically generated functions where the character a
|
|
|
500
502
|
|
|
501
503
|
**`Remarks`**
|
|
502
504
|
|
|
503
|
-
Available in Chrome, Edge, Firefox, Opera, and Node.js 10+.
|
|
505
|
+
Available in Chrome, Edge, Firefox, Safari 17.4+, Opera, and Node.js 10+.
|
|
504
506
|
|
|
505
507
|
___
|
|
506
508
|
|
|
@@ -512,7 +514,7 @@ A string representation of dynamically generated functions where the character a
|
|
|
512
514
|
|
|
513
515
|
**`Remarks`**
|
|
514
516
|
|
|
515
|
-
Available in Internet Explorer, Safari 9
|
|
517
|
+
Available in Internet Explorer, Safari 9+ before 17.4, Android Browser, and Node.js before 10.
|
|
516
518
|
|
|
517
519
|
___
|
|
518
520
|
|
|
@@ -852,7 +854,7 @@ ___
|
|
|
852
854
|
|
|
853
855
|
• **NO\_OLD\_SAFARI\_ARRAY\_ITERATOR**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
854
856
|
|
|
855
|
-
The property that the string representation of Array.prototype.entries\(\) evaluates to "\[object Array Iterator\]"
|
|
857
|
+
The property that the string representation of Array.prototype.entries\(\) evaluates to "\[object Array Iterator\]".
|
|
856
858
|
|
|
857
859
|
**`Remarks`**
|
|
858
860
|
|
|
@@ -874,11 +876,23 @@ Available in Firefox, Internet Explorer, and Safari.
|
|
|
874
876
|
|
|
875
877
|
___
|
|
876
878
|
|
|
879
|
+
### OBJECT\_ARRAY\_ENTRIES\_CTOR
|
|
880
|
+
|
|
881
|
+
• **OBJECT\_ARRAY\_ENTRIES\_CTOR**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
882
|
+
|
|
883
|
+
The property that the Array.prototype.entries\(\).constructor is the Object constructor.
|
|
884
|
+
|
|
885
|
+
**`Remarks`**
|
|
886
|
+
|
|
887
|
+
Available in Firefox, Safari 9+, and Node.js 0.12+.
|
|
888
|
+
|
|
889
|
+
___
|
|
890
|
+
|
|
877
891
|
### OBJECT\_L\_LOCATION\_CTOR
|
|
878
892
|
|
|
879
893
|
• **OBJECT\_L\_LOCATION\_CTOR**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
880
894
|
|
|
881
|
-
Existence of the global function location.constructor whose string representation starts with "\[object L"
|
|
895
|
+
Existence of the global function location.constructor whose string representation starts with "\[object L".
|
|
882
896
|
|
|
883
897
|
**`Remarks`**
|
|
884
898
|
|
|
@@ -902,7 +916,7 @@ ___
|
|
|
902
916
|
|
|
903
917
|
• **OBJECT\_W\_CTOR**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
904
918
|
|
|
905
|
-
The property that the string representation of the global object constructor starts with "\[object W"
|
|
919
|
+
The property that the string representation of the global object constructor starts with "\[object W".
|
|
906
920
|
|
|
907
921
|
**`Remarks`**
|
|
908
922
|
|
|
@@ -914,7 +928,7 @@ ___
|
|
|
914
928
|
|
|
915
929
|
• **OLD\_SAFARI\_LOCATION\_CTOR**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
916
930
|
|
|
917
|
-
Existence of the global object location.constructor whose string representation starts with "\[object " and ends with "LocationConstructor\]"
|
|
931
|
+
Existence of the global object location.constructor whose string representation starts with "\[object " and ends with "LocationConstructor\]".
|
|
918
932
|
|
|
919
933
|
**`Remarks`**
|
|
920
934
|
|
|
@@ -926,7 +940,7 @@ ___
|
|
|
926
940
|
|
|
927
941
|
• **PLAIN\_INTL**: [`ElementaryFeature`](ElementaryFeature.md)
|
|
928
942
|
|
|
929
|
-
Existence of the global object Intl having the string representation "\[object Object\]"
|
|
943
|
+
Existence of the global object Intl having the string representation "\[object Object\]".
|
|
930
944
|
|
|
931
945
|
**`Remarks`**
|
|
932
946
|
|
|
@@ -952,7 +966,7 @@ ___
|
|
|
952
966
|
|
|
953
967
|
Features available in the current stable version of Safari.
|
|
954
968
|
|
|
955
|
-
An alias for `
|
|
969
|
+
An alias for `SAFARI_17_4`.
|
|
956
970
|
|
|
957
971
|
___
|
|
958
972
|
|
|
@@ -1000,7 +1014,15 @@ ___
|
|
|
1000
1014
|
|
|
1001
1015
|
• **SAFARI\_15\_4**: [`PredefinedFeature`](PredefinedFeature.md)
|
|
1002
1016
|
|
|
1003
|
-
Features available in Safari 15.4
|
|
1017
|
+
Features available in Safari 15.4 to 17.3.
|
|
1018
|
+
|
|
1019
|
+
___
|
|
1020
|
+
|
|
1021
|
+
### SAFARI\_17\_4
|
|
1022
|
+
|
|
1023
|
+
• **SAFARI\_17\_4**: [`PredefinedFeature`](PredefinedFeature.md)
|
|
1024
|
+
|
|
1025
|
+
Features available in Safari 17.4 or later.
|
|
1004
1026
|
|
|
1005
1027
|
___
|
|
1006
1028
|
|