
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
es6-computed-properties
Advanced tools
Compiles JavaScript written using ES6 computed properties to use ES5- or ES3-compatible syntax. For example, this:
var propName = 'code';
var params = {
[propName]: true
['data' + propName.toUpperCase()]: true
};
console.log(params); // {code: true, dataCode: true}
compiles to this:
ES5 targeting (default):
var $__Object$defineProperty = Object.defineProperty;
var $__0;
var propName = 'code';
var params = ($__0 = {}, $__Object$defineProperty($__0, propName, {
value: true,
enumerable: true,
configurable: true,
writable: true
}), $__Object$defineProperty($__0, 'data' + propName.toUpperCase(), {
value: true,
enumerable: true,
configurable: true,
writable: true
}), $__0);
console.log(params); // {code: true, dataCode: true}
If you're using ES5 with accessors (getters/setters) you should compile in ES5 mode, since it correctly handles inherited accessor properties.
In case if you need to support older engines, you may compile to ES3 (runs with {es: 3}
compile option, or --es=3
from CLI):
var $__0;
var propName = 'code';
var params = (
$__0 = {},
$__0[propName] = true,
$__0['data' + propName.toUpperCase()] = true,
$__0
);
console.log(params); // {code: true, dataCode: true}
$ npm install es6-computed-properties
$ node
> var es6ComputedProperties = require('es6-computed-properties')
> es6ComputedProperties.compile(codeWithComputedProperties)
{ "code": ..., "map": ... }
> es6ComputedProperties.transform(anAst)
anotherAst
Browserify support is built in.
$ npm install es6-computed-properties # install local dependency
$ browserify -t es6-computed-properties $file
First, install the development dependencies:
$ npm install
Then, try running the tests:
$ npm test
To run specific example files:
$ node test/runner test/examples/my-example.js test/examples/other-example.js
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Computed properties compiled to ES5.
The npm package es6-computed-properties receives a total of 13 weekly downloads. As such, es6-computed-properties popularity was classified as not popular.
We found that es6-computed-properties demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.