initial commit taken from gitlab.lrz.de

This commit is contained in:
privatereese
2018-08-24 18:09:42 +02:00
parent ae54ed4c48
commit fc05486403
28494 changed files with 2159823 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
src
test
node_modules

View 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"]
});
```

View 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"];

View File

@@ -0,0 +1,93 @@
{
"_args": [
[
"babel-plugin-transform-strict-mode@^6.24.1",
"/home/bernhard/freifunk-app/node_modules/babel-plugin-transform-es2015-modules-commonjs"
]
],
"_from": "babel-plugin-transform-strict-mode@>=6.24.1 <7.0.0",
"_id": "babel-plugin-transform-strict-mode@6.24.1",
"_inCache": true,
"_installable": true,
"_location": "/babel-plugin-transform-strict-mode",
"_nodeVersion": "6.9.0",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/babel-plugin-transform-strict-mode-6.24.1.tgz_1491578349467_0.8609954498242587"
},
"_npmUser": {
"email": "hi@henryzoo.com",
"name": "hzoo"
},
"_npmVersion": "3.10.10",
"_phantomChildren": {},
"_requested": {
"name": "babel-plugin-transform-strict-mode",
"raw": "babel-plugin-transform-strict-mode@^6.24.1",
"rawSpec": "^6.24.1",
"scope": null,
"spec": ">=6.24.1 <7.0.0",
"type": "range"
},
"_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",
"_shrinkwrap": null,
"_spec": "babel-plugin-transform-strict-mode@^6.24.1",
"_where": "/home/bernhard/freifunk-app/node_modules/babel-plugin-transform-es2015-modules-commonjs",
"dependencies": {
"babel-runtime": "^6.22.0",
"babel-types": "^6.24.1"
},
"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"
},
"directories": {},
"dist": {
"shasum": "d5faf7aa578a65bbe591cf5edae04a0c67020758",
"tarball": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz"
},
"keywords": [
"babel-plugin"
],
"license": "MIT",
"main": "lib/index.js",
"maintainers": [
{
"name": "amasad",
"email": "amjad.masad@gmail.com"
},
{
"name": "hzoo",
"email": "hi@henryzoo.com"
},
{
"name": "jmm",
"email": "npm-public@jessemccarthy.net"
},
{
"name": "loganfsmyth",
"email": "loganfsmyth@gmail.com"
},
{
"name": "sebmck",
"email": "sebmck@gmail.com"
},
{
"name": "thejameskyle",
"email": "me@thejameskyle.com"
}
],
"name": "babel-plugin-transform-strict-mode",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-strict-mode"
},
"scripts": {},
"version": "6.24.1"
}