Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed May 18, 2024
1 parent 7631e4a commit 019f45f
Show file tree
Hide file tree
Showing 28 changed files with 997 additions and 1,217 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/~feature-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
- run: |
npm install --prefix ../..
npm run prepare-legacy-test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/~result-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
- run: |
npm install --prefix ../..
npm run prepare-legacy-test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/~solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
- run: |
npm install --prefix ../..
npm run prepare-legacy-test
Expand Down
120 changes: 13 additions & 107 deletions api-doc/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# JScrewIt
**JScrewIt****Docs**

***

## Table of contents
# JScrewIt

### Interfaces
## Interfaces

- [CustomFeature](interfaces/CustomFeature.md)
- [ElementaryFeature](interfaces/ElementaryFeature.md)
Expand All @@ -14,115 +16,19 @@
- [default](interfaces/default.md)
- [encode](interfaces/encode.md)

### Type Aliases

- [ElementaryFeatureName](README.md#elementaryfeaturename)
- [FeatureElement](README.md#featureelement)
- [FeatureElementOrCompatibleArray](README.md#featureelementorcompatiblearray)
- [PredefinedFeatureName](README.md#predefinedfeaturename)
- [RunAs](README.md#runas)

### Variables

- [Feature](README.md#feature)
- [default](README.md#default)

### Functions

- [encode](README.md#encode)

## Type Aliases

### ElementaryFeatureName

Ƭ **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"``

Name of an elementary feature.

___

### FeatureElement

Ƭ **FeatureElement**: [`Feature`](interfaces/Feature.md) \| keyof [`FeatureAll`](interfaces/FeatureAll.md)

A feature object or a name or alias of a predefined feature.

**`Remarks`**

Methods that accept parameters of this type throw an error if the specified value is neither a
feature object nor a name or alias of a predefined feature.

___

### FeatureElementOrCompatibleArray

Ƭ **FeatureElementOrCompatibleArray**: [`FeatureElement`](README.md#featureelement) \| readonly [`FeatureElement`](README.md#featureelement)[]

A feature object, a name or alias of a predefined feature, or an array of such values that
defines a union of mutually compatible features.

**`Remarks`**

Methods that accept parameters of this type throw an error if the specified value is neither a
feature object nor a name or alias of a predefined feature, or if it is an array of values that
does not define a union of mutually compatible features.

___

### PredefinedFeatureName

Ƭ **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_22"`` \| ``"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"``

Name of a predefined feature.

___

### RunAs

Ƭ **RunAs**: ``"call"`` \| ``"eval"`` \| ``"express"`` \| ``"express-call"`` \| ``"express-eval"`` \| ``"none"``

Values of this type control the type of code generated from a given input.
See [`EncodeOptions.runAs`](interfaces/EncodeOptions.md#runas) for the meaning of each possible value.
- [ElementaryFeatureName](type-aliases/ElementaryFeatureName.md)
- [FeatureElement](type-aliases/FeatureElement.md)
- [FeatureElementOrCompatibleArray](type-aliases/FeatureElementOrCompatibleArray.md)
- [PredefinedFeatureName](type-aliases/PredefinedFeatureName.md)
- [RunAs](type-aliases/RunAs.md)

## Variables

### Feature

**Feature**: [`FeatureConstructor`](interfaces/FeatureConstructor.md)

___

### default

**default**: [`default`](interfaces/default.md)
- [Feature](variables/Feature.md)
- [default](variables/default.md)

## Functions

### encode

**encode**(`input`, `options?`): `string`

Encodes a given string into JSFuck.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `input` | `string` | The string to encode. |
| `options?` | [`EncodeOptions`](interfaces/EncodeOptions.md) | An optional object specifying encoding options. |

#### Returns

`string`

The encoded string.

**`Throws`**

An `Error` is thrown under the following circumstances.
- The specified string cannot be encoded with the specified options.
- Some unknown features were specified.
- A combination of mutually incompatible features was specified.
- The option `runAs` (or `wrapWith`) was specified with an invalid value.

Also, an out of memory condition may occur when processing very large data.
- [encode](functions/encode.md)
35 changes: 35 additions & 0 deletions api-doc/functions/encode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[**JScrewIt**](../README.md)**Docs**

***

# Function: encode()

> **encode**(`input`, `options`?): `string`
Encodes a given string into JSFuck.

## Parameters

**input**: `string`

The string to encode.

**options?**: [`EncodeOptions`](../interfaces/EncodeOptions.md)

An optional object specifying encoding options.

## Returns

`string`

The encoded string.

## Throws

An `Error` is thrown under the following circumstances.
- The specified string cannot be encoded with the specified options.
- Some unknown features were specified.
- A combination of mutually incompatible features was specified.
- The option `runAs` (or `wrapWith`) was specified with an invalid value.

Also, an out of memory condition may occur when processing very large data.
90 changes: 47 additions & 43 deletions api-doc/interfaces/CustomFeature.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[**JScrewIt**](../README.md)**Docs**

***

# Interface: CustomFeature

Objects of this type indicate which of the capabilities that JScrewIt can use to minimize the
Expand All @@ -23,68 +27,52 @@ elementary features available in the current environment.
Not all features can be available at the same time: some features are necessarily incompatible,
meaning that they mutually exclude each other, and thus their union cannot be constructed.

## Hierarchy
## Extends

- [`Feature`](Feature.md)

**`CustomFeature`**

## Table of contents

### Properties

- [canonicalNames](CustomFeature.md#canonicalnames)
- [elementary](CustomFeature.md#elementary)
- [elementaryNames](CustomFeature.md#elementarynames)
- [name](CustomFeature.md#name)

### Methods

- [includes](CustomFeature.md#includes)
- [restrict](CustomFeature.md#restrict)

## Properties

### canonicalNames

`Readonly` **canonicalNames**: [`ElementaryFeatureName`](../README.md#elementaryfeaturename)[]
> `readonly` **canonicalNames**: [`ElementaryFeatureName`](../type-aliases/ElementaryFeatureName.md)[]
An array of all elementary feature names included in this feature object, without aliases and
implied features.

#### Inherited from

[Feature](Feature.md).[canonicalNames](Feature.md#canonicalnames)
[`Feature`](Feature.md).[`canonicalNames`](Feature.md#canonicalnames)

___
***

### elementary

`Readonly` **elementary**: ``false``
> `readonly` **elementary**: `false`
A boolean value indicating whether this is an elementary feature object.

#### Overrides

[Feature](Feature.md).[elementary](Feature.md#elementary)
[`Feature`](Feature.md).[`elementary`](Feature.md#elementary)

___
***

### elementaryNames

`Readonly` **elementaryNames**: [`ElementaryFeatureName`](../README.md#elementaryfeaturename)[]
> `readonly` **elementaryNames**: [`ElementaryFeatureName`](../type-aliases/ElementaryFeatureName.md)[]
An array of all elementary feature names included in this feature object, without aliases.

#### Inherited from

[Feature](Feature.md).[elementaryNames](Feature.md#elementarynames)
[`Feature`](Feature.md).[`elementaryNames`](Feature.md#elementarynames)

___
***

### name
### name?

`Optional` **name**: `string`
> `optional` **name**: `string`
The primary name of this feature object, useful for identification purpose.

Expand All @@ -93,21 +81,19 @@ If a name is assigned, it will be used when the feature is converted into a stri

#### Inherited from

[Feature](Feature.md).[name](Feature.md#name)
[`Feature`](Feature.md).[`name`](Feature.md#name)

## Methods

### includes
### includes()

**includes**(`...features`): `boolean`
> **includes**(...`features`): `boolean`
Determines whether this feature object includes all of the specified features.

#### Parameters

| Name | Type |
| :------ | :------ |
| `...features` | [`FeatureElementOrCompatibleArray`](../README.md#featureelementorcompatiblearray)[] |
• ...**features**: [`FeatureElementOrCompatibleArray`](../type-aliases/FeatureElementOrCompatibleArray.md)[]

#### Returns

Expand All @@ -118,13 +104,13 @@ If no arguments are specified, the return value is `true`.

#### Inherited from

[Feature](Feature.md).[includes](Feature.md#includes)
[`Feature`](Feature.md).[`includes`](Feature.md#includes)

___
***

### restrict
### restrict()

**restrict**(`environment`, `engineFeatureObjs?`): [`CustomFeature`](CustomFeature.md)
> **restrict**(`environment`, `engineFeatureObjs`?): [`CustomFeature`](CustomFeature.md)
Creates a new feature object from this feature by removing elementary features that are not
available inside a particular environment.
Expand All @@ -134,15 +120,33 @@ that require strict mode code, or inside web workers.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `environment` | ``"forced-strict-mode"`` \| ``"web-worker"`` | The environment to which this feature should be restricted. Two environments are currently supported. <dl> <dt><code>"forced-strict-mode"</code></dt> <dd> Removes features that are not available in environments that require strict mode code. </dd> <dt><code>"web-worker"</code></dt> <dd>Removes features that are not available inside web workers.</dd> </dl> |
| `engineFeatureObjs?` | readonly [`PredefinedFeature`](PredefinedFeature.md)[] | An array of predefined feature objects, each corresponding to a particular engine in which the restriction should be enacted. If this parameter is omitted, the restriction is enacted in all engines. |
**environment**: `"forced-strict-mode"` \| `"web-worker"`

The environment to which this feature should be restricted.
Two environments are currently supported.

<dl>

<dt><code>"forced-strict-mode"</code></dt>
<dd>
Removes features that are not available in environments that require strict mode code.
</dd>

<dt><code>"web-worker"</code></dt>
<dd>Removes features that are not available inside web workers.</dd>

</dl>

**engineFeatureObjs?**: readonly [`PredefinedFeature`](PredefinedFeature.md)[]

An array of predefined feature objects, each corresponding to a particular engine in which
the restriction should be enacted.
If this parameter is omitted, the restriction is enacted in all engines.

#### Returns

[`CustomFeature`](CustomFeature.md)

#### Inherited from

[Feature](Feature.md).[restrict](Feature.md#restrict)
[`Feature`](Feature.md).[`restrict`](Feature.md#restrict)
Loading

0 comments on commit 019f45f

Please sign in to comment.