diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:10:59 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:41:44 +0800 |
| commit | fc87c009806dcc98867f6b58efe29b042aa01dee (patch) | |
| tree | 8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/babel-plugin-transform-undefined-to-void | |
| parent | 3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff) | |
node: updatemain
Diffstat (limited to 'node_modules/babel-plugin-transform-undefined-to-void')
3 files changed, 0 insertions, 83 deletions
diff --git a/node_modules/babel-plugin-transform-undefined-to-void/README.md b/node_modules/babel-plugin-transform-undefined-to-void/README.md deleted file mode 100644 index 58989c65..00000000 --- a/node_modules/babel-plugin-transform-undefined-to-void/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# babel-plugin-transform-undefined-to-void - -Some JavaScript implementations allow undefined to be overwritten, this may lead to peculiar bugs that are extremely hard to track down. - -This plugin transforms `undefined` into `void 0` which returns undefined regardless of if it's been reassigned. - -## Example - -**In** - -```javascript -foo === undefined; -``` - -**Out** - -```javascript -foo === void 0; -``` - -## Installation - -```sh -npm install babel-plugin-transform-undefined-to-void --save-dev -``` - -## Usage - -### Via `.babelrc` (Recommended) - -**.babelrc** - -```json -{ - "plugins": ["transform-undefined-to-void"] -} -``` - -### Via CLI - -```sh -babel --plugins transform-undefined-to-void script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-undefined-to-void"] -}); -``` diff --git a/node_modules/babel-plugin-transform-undefined-to-void/lib/index.js b/node_modules/babel-plugin-transform-undefined-to-void/lib/index.js deleted file mode 100644 index 6e9c1e09..00000000 --- a/node_modules/babel-plugin-transform-undefined-to-void/lib/index.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -module.exports = function ({ - types: t -}) { - const VOID_0 = t.unaryExpression("void", t.numericLiteral(0), true); - return { - name: "transform-undefined-to-void", - visitor: { - ReferencedIdentifier(path) { - if (path.node.name === "undefined") { - path.replaceWith(VOID_0); - } - } - - } - }; -};
\ No newline at end of file diff --git a/node_modules/babel-plugin-transform-undefined-to-void/package.json b/node_modules/babel-plugin-transform-undefined-to-void/package.json deleted file mode 100644 index fdf80dbf..00000000 --- a/node_modules/babel-plugin-transform-undefined-to-void/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "babel-plugin-transform-undefined-to-void", - "version": "6.9.4", - "description": "Replace references to `undefined` with `void 0`", - "keywords": [ - "babel-plugin" - ], - "homepage": "https://github.com/babel/minify#readme", - "bugs": "https://github.com/babel/minify/issues", - "license": "MIT", - "author": "amasad", - "main": "lib/index.js", - "repository": "https://github.com/babel/minify/tree/master/packages/babel-plugin-transform-undefined-to-void" -} |
