Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
functionally
Advanced tools
Readme
Functionally - A utility belt for functional JavaScript
$ npm install functionally
var F = require('functionally')
function log(msg){
console.log(msg)
}
function greet(name){
return 'Hello ' + name + '!'
}
var logGreeting = F.compose(log, greet)
logGreeting('Bob') //console.log('Hello Bob!')
Returns the first object in target for which fn returns a truthy value.
Example
F.find(function(obj){
return obj.name == 'js'
}, [
{name: 'ruby'},
{name: 'js'},
{name: 'php'},
{name: 'erlang'}
])
//returns the second object in the array
The find
function is curried, so you can do
var findFirst = F.find(function(value, index, target){
if (index === 0){
return value
}
})
findFirst([4,5,6]) == 4
Returns a function that calls fn just once.
Example
var counter = 0
var inc = F.once(function(){
counter++
})
inc()
counter == 1
inc()
inc()
counter == 1
The function returned by once returns the result of the original function. On subsequent calls, returns the same result.
If you use parseInt as the parameter to array.map, you get an undesired result
['1','2','3'].map(parseInt)
//[1, NaN, NaN]
But if you use maxArgs:
var parseInt = F.maxArgs(parseInt, 1)
['1','2','3'].map(parseInt)
//you get [1,2,3], the expected result
Creates a new curried function that calls the given fn with the new operator. Expected args are the fn to use for calling new and an array of args to be used (they will be spread on the new call).
Example:
function Developer(name, language){
this.name = name
this.lang = language
}
var newDev = newify(Developer)
var dev = newDev(['bob', 'js'])
var dev2 = newify(Developer, ['john', 'c#'])
dev instanceof Developer === true
dev2 instanceof Developer === true
FAQs
Functionally - A utility belt for functional JavaScript
The npm package functionally receives a total of 519 weekly downloads. As such, functionally popularity was classified as not popular.
We found that functionally 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
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.