
Security News
gem.coop Tests Dependency Cooldowns as Package Ecosystems Move to Slow Down Attacks
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.
Fimp helps you work with Immutable.js data structures in a more functional way. Think of it as Ramda or lodash/fp for Immutable.
Fimp provides composable, curried, data-last functions that work with immutable objects. If you are used to functional programming you are hopefully thinking "Nice, this makes sense, I can use this". If not, you might be thinking "Why would I want this?".
The aim of Fimp is to help you write cleaner, more understandable code. Composable functions makes it easier to create more complex functions by combining smaller building blocks. (this article, explaining the rationale behind Ramda)[http://fr.umio.us/why-ramda/] applies to Fimp as well. The only difference is that Fimp is built for use with Immutable data structures, whereas Ramda is used with plain javascript object.
The following functions are supported:
compose const add5 = map((a) => a + 5)
const filterEven = filter((a) => !(a % 2))
const sum = reduce((total, a) => a + total, 0)
const addFilterAndSum = compose(add5, filterEven, sum)
addFilterAndSum(fromJS([1, 2, 3]) // 14
concat const concat456 = concat(fromJS([4, 5, 6]))
concat456(fromJS([1, 2, 3])).toJS() // [1, 2, 3, 4, 5, 6]
contains const containsA = contains('a')
containsA(fromJS(['a', 'b', 'c'])) // true
curry const subtract = curry((a, b) => b - a)
const subtract2 = subtract(2)
subtract2(3) // 1
subtract(2, 3) // 1
entrySeq entrySeq(fromJS({a: 'foo', b: 'bar', c: 'baz'})).toJS()
// [['a', 'foo'], ['b', 'bar'], ['c', 'baz']]
every const allEven = every(isEven)
allEven(fromJS([1, 4, 8])) // false
allEven(fromJS([2, 4, 100])) // true
filter const filterEven = filter(isEven)
filterEven(fromJS([1, 2, 3, 4, 5, 6, 7, 8])).toJS() // [2, 4, 6, 8]
find const findEven = find(isEven)
findEven(fromJS([1, 4, 3])) // 4
flatten const shallowFlatten = flatten(true)
shallowFlatten(fromJS([1, 2, [3, 4, [5, 6]]])) // List [1, 2, 3, 4, [5, 6]]
})
const deeperFlatten = flatten(2)
deeperFlatten(fromJS([1, 2, [3, 4, [5, [6]]]])) // List [1, 2, 3, 4, 5, [6]]
})
const deepFlatten = flatten(false)
deepFlatten(fromJS([1, 2, [3, 4, [5, [6]]]])) //[1, 2, 3, 4, 5, 6])
get const user = fromJS({
id: 1,
address: {
street: 'Simborgargatan 12',
},
})
const getAddress = get(['address'])
getAddress(user) // Map {street: 'Simborgargatan 12'}
keySeq keySeq(fromJS({a: 'foo', b: 'bar', c: 'baz'})).toJS() //['a', 'b', 'c']
map const add5 = map((a) => a + 5)
add5(fromJS([1, 2, 3])) // List [6, 7, 8]
reduce const sum = reduce((a, b) => a + b, 0)
sum(fromJS([1, 2, 3, 4, 5, 6])) // 21
reverse reverse(fromJS([1, 2, 3, 4, 5])).toJS() //[5, 4, 3, 2, 1]
setconst user = fromJS({
id: 1,
address: {
street: 'Simborgargatan 12',
},
})
const setStreet = set(['address', 'street']) // Map user
skip const skip3 = skip(3)
skip3(fromJS([1, 2, 3, 4, 5])).toJS() // [4, 5]
skipLast const skipLast3 = skipLast(3)
skipLast3(fromJS([1, 2, 3, 4, 5])).toJS() // [1, 2]
some const someEven = some(isEven)
someEven(fromJS([1, 4, 3])) // true
sort const sortHighest = sort((a, b) => b - a)
sortHighest(fromJS([100, 20, 3, 44, 5])).toJS() // [100, 44, 20, 5, 3]
takeconst take3 = take(3)
take3(fromJS([1, 2, 3, 4, 5])).toJS() // [1, 2, 3]
takeLast const takeLast3 = takeLast(3)
takeLast3(fromJS([1, 2, 3, 4, 5])).toJS() // [3, 4, 5]
valueSeq valueSeq(fromJS({a: 'foo', b: 'bar', c: 'baz'})).toJS() // ['foo', 'bar', 'baz']
FAQs
Functional Immutable Programming
The npm package fimp receives a total of 2 weekly downloads. As such, fimp popularity was classified as not popular.
We found that fimp 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
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.