forked from enviPath/enviPy
Current Dev State
This commit is contained in:
69
static/js/ketcher2/node_modules/babel-plugin-transform-strict-mode/README.md
generated
vendored
Normal file
69
static/js/ketcher2/node_modules/babel-plugin-transform-strict-mode/README.md
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
# babel-plugin-transform-strict-mode
|
||||
|
||||
> This plugin places a `"use strict";` directive at the top of all files to enable [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode).
|
||||
|
||||
This plugin may be enabled via `babel-plugin-transform-es2015-modules-commonjs`.
|
||||
If you wish to disable it you can either turn `strict` off or pass
|
||||
`strictMode: false` as an option to the commonjs transform.
|
||||
|
||||
## Example
|
||||
|
||||
**In**
|
||||
|
||||
```javascript
|
||||
foo();
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
foo();
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save-dev babel-plugin-transform-strict-mode
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
Without options:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["transform-strict-mode"]
|
||||
}
|
||||
```
|
||||
|
||||
With options:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
["transform-strict-mode", {
|
||||
"strict": true
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins transform-strict-mode script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("babel-core").transform("code", {
|
||||
plugins: ["transform-strict-mode"]
|
||||
});
|
||||
```
|
||||
49
static/js/ketcher2/node_modules/babel-plugin-transform-strict-mode/lib/index.js
generated
vendored
Normal file
49
static/js/ketcher2/node_modules/babel-plugin-transform-strict-mode/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _getIterator2 = require("babel-runtime/core-js/get-iterator");
|
||||
|
||||
var _getIterator3 = _interopRequireDefault(_getIterator2);
|
||||
|
||||
exports.default = function () {
|
||||
return {
|
||||
visitor: {
|
||||
Program: function Program(path, state) {
|
||||
if (state.opts.strict === false || state.opts.strictMode === false) return;
|
||||
|
||||
var node = path.node;
|
||||
|
||||
|
||||
for (var _iterator = node.directives, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
|
||||
var _ref;
|
||||
|
||||
if (_isArray) {
|
||||
if (_i >= _iterator.length) break;
|
||||
_ref = _iterator[_i++];
|
||||
} else {
|
||||
_i = _iterator.next();
|
||||
if (_i.done) break;
|
||||
_ref = _i.value;
|
||||
}
|
||||
|
||||
var directive = _ref;
|
||||
|
||||
if (directive.value.value === "use strict") return;
|
||||
}
|
||||
|
||||
path.unshiftContainer("directives", t.directive(t.directiveLiteral("use strict")));
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var _babelTypes = require("babel-types");
|
||||
|
||||
var t = _interopRequireWildcard(_babelTypes);
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
module.exports = exports["default"];
|
||||
46
static/js/ketcher2/node_modules/babel-plugin-transform-strict-mode/package.json
generated
vendored
Normal file
46
static/js/ketcher2/node_modules/babel-plugin-transform-strict-mode/package.json
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"_from": "babel-plugin-transform-strict-mode@^6.24.1",
|
||||
"_id": "babel-plugin-transform-strict-mode@6.24.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=",
|
||||
"_location": "/babel-plugin-transform-strict-mode",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "babel-plugin-transform-strict-mode@^6.24.1",
|
||||
"name": "babel-plugin-transform-strict-mode",
|
||||
"escapedName": "babel-plugin-transform-strict-mode",
|
||||
"rawSpec": "^6.24.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^6.24.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/babel-plugin-transform-es2015-modules-commonjs"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz",
|
||||
"_shasum": "d5faf7aa578a65bbe591cf5edae04a0c67020758",
|
||||
"_spec": "babel-plugin-transform-strict-mode@^6.24.1",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/babel-plugin-transform-es2015-modules-commonjs",
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"babel-runtime": "^6.22.0",
|
||||
"babel-types": "^6.24.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "This plugin places a 'use strict'; directive at the top of all files to enable strict mode",
|
||||
"devDependencies": {
|
||||
"babel-helper-plugin-test-runner": "^6.24.1"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "babel-plugin-transform-strict-mode",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-strict-mode"
|
||||
},
|
||||
"version": "6.24.1"
|
||||
}
|
||||
Reference in New Issue
Block a user