@babel/plugin-transform-spread
Advanced tools
Comparing version 7.0.0-beta.49 to 7.0.0-beta.50
{ | ||
"name": "@babel/plugin-transform-spread", | ||
"version": "7.0.0-beta.49", | ||
"version": "7.0.0-beta.50", | ||
"description": "Compile ES2015 spread to ES5", | ||
@@ -12,3 +12,3 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread", | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "7.0.0-beta.49" | ||
"@babel/helper-plugin-utils": "7.0.0-beta.50" | ||
}, | ||
@@ -19,5 +19,5 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.49", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.49" | ||
"@babel/core": "7.0.0-beta.50", | ||
"@babel/helper-plugin-test-runner": "7.0.0-beta.50" | ||
} | ||
} |
@@ -5,80 +5,16 @@ # @babel/plugin-transform-spread | ||
## Example | ||
See our website [@babel/plugin-transform-spread](https://new.babeljs.io/docs/en/next/babel-plugin-transform-spread.html) for more information. | ||
**In** | ||
## Install | ||
```js | ||
var a = ['a', 'b', 'c']; | ||
Using npm: | ||
var b = [...a, 'foo']; | ||
var c = foo(...a); | ||
``` | ||
**Out** | ||
```js | ||
var a = ['a', 'b', 'c']; | ||
var b = a.concat(['foo']); | ||
var c = foo.apply(void 0, a); | ||
``` | ||
## Installation | ||
```sh | ||
npm install --save-dev @babel/plugin-transform-spread | ||
npm install --save @babel/plugin-transform-spread | ||
``` | ||
## Usage | ||
or using yarn: | ||
### Via `.babelrc` (Recommended) | ||
**.babelrc** | ||
Without options: | ||
```json | ||
{ | ||
"plugins": ["@babel/plugin-transform-spread"] | ||
} | ||
``` | ||
With options: | ||
```json | ||
{ | ||
"plugins": [ | ||
["@babel/plugin-transform-spread", { | ||
"loose": true | ||
}] | ||
] | ||
} | ||
``` | ||
### Via CLI | ||
```sh | ||
babel --plugins @babel/plugin-transform-spread script.js | ||
yarn add --save @babel/plugin-transform-spread | ||
``` | ||
### Via Node API | ||
```javascript | ||
require("@babel/core").transform("code", { | ||
plugins: ["@babel/plugin-transform-spread"] | ||
}); | ||
``` | ||
## Options | ||
### `loose` | ||
`boolean`, defaults to `false`. | ||
In loose mode, **all** iterables are assumed to be arrays. | ||
## References | ||
* [MDN: Spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5239
3
20
+ Added@babel/helper-plugin-utils@7.0.0-beta.50(transitive)
- Removed@babel/helper-plugin-utils@7.0.0-beta.49(transitive)