https://github.com/freaktechnik/babel-plugin-transform-safest-mode
Make your JS the safest
https://github.com/freaktechnik/babel-plugin-transform-safest-mode
babel-plugin babel-transformation optional-chaining
Last synced: about 1 year ago
JSON representation
Make your JS the safest
- Host: GitHub
- URL: https://github.com/freaktechnik/babel-plugin-transform-safest-mode
- Owner: freaktechnik
- License: mit
- Created: 2021-05-22T14:34:39.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-22T15:15:39.000Z (about 5 years ago)
- Last Synced: 2025-02-14T20:46:58.025Z (over 1 year ago)
- Topics: babel-plugin, babel-transformation, optional-chaining
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-plugin-transform-safest-mode
> As a disclaimer, this transform is intended mostly as a joke.
Does your web app load too fast? Do you often encounter issues where code will just stop to work? This babel transform is the ultimate solution. Not only will it increase your file size, and thus make your app load like a proper important web app, but it also makes it less likely that your app will break.
How does it do that? It replaces all object member traversals and function calls with the [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) syntax, adding one or two characters per occurence.
## Example
Your source code:
```js
myApp.controller['best-method'](json.foreign.data[0]);
```
The resulting code:
```js
myApp?.controller?.['best-method']?.(json?.foreign?.data?.[0]);
```
Much better, and crucially, the safest!