Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
pluck a property out of an object.
var friendsAsJavaScriptLibraries = [
{
name: 'passy.js',
hobby: 'clay'
},
{
name: 'sindre.js',
vehicle: 'unicorn taxi'
},
{
name: 'addy.js',
invented: 'google *'
}
];
var names = friendsAsJavaScriptLibraries.map(function (item) {
return item.name;
});
var friendsAsJavaScriptLibraries = [ /* ... */ ];
var names = friendsAsJavaScriptLibraries.map(prop('name'));
The benefit is more noticeable when you're using multiple Array.prototype methods to shape your objects:
var friendsAsJavaScriptLibraries = [ /* ... */ ];
var urls;
if (friendsAsJavaScriptLibraries.every(prop('name'))) {
urls = friendsAsJavaScriptLibraries
.map(function (item) {
item.url = 'https://github.com/magical-library-land/' + item.name;
return item;
})
.map(prop('url'));
}
Perhaps you're already using Lo-Dash, Underscore.js, or another utility library. This should not supplement those libraries, and definitely cannot replace. This is better suited towards applications that don't want to carry the weight and/or functionality of such libraries, and just want something simple and modular.
prop
can be used in the browser or within your Node.js apps.
$ bower install --save propprop
<script src="bower_components/propprop/browser.js"></script>
$ npm install --save propprop
var prop = require('propprop');
FAQs
Just a helper for plucking a property out of an object.
The npm package propprop receives a total of 7,324 weekly downloads. As such, propprop popularity was classified as popular.
We found that propprop 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.