Check if the environment supports { ...a } spread syntax (evacuated from NSA/Microsoft Github)
|
7 年之前 | |
---|---|---|
.gitignore | 7 年之前 | |
.travis.yml | 7 年之前 | |
CHANGELOG.md | 7 年之前 | |
LICENSE.md | 7 年之前 | |
README.md | 7 年之前 | |
index.js | 7 年之前 | |
package.json | 7 年之前 | |
test.js | 7 年之前 |
check if the environment supports { ...a }
spread syntax
npm install has-object-spread
var hasObjectSpread = require('has-object-spread')
if (hasObjectSpread()) {
clone = Function('object', '({ ...object })')
}