
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
functional, semantic and neat.
npm i -S the-value
const Value = require('the-value')
Value(1).Number // true
Value(1).range(0, 1) // true
Value('b').between('a', 'c') // true
Value.is(200, Value.Constant(200)) // true
Value(200).is(Value.Constant(200)) // true
All original provided functions in here
! All functions should have the first parameter to be the target value (to conduct operations).
addon(utilsObject: object, keys?: string[]|Record<string, string>, type?: 'getter', notCacheGetter?: boolean=false)
utilsObject, properties owner.keys, list properties should be added. If ignored, all own enumerable properties will added. Properties will be renamed with the option is not an array.type, if set to be getter, indicate the function type properties should be converted to getter properties.notCacheGetter, if set to be true, indicate the getter properties should not be cached.All of own enumerable properties:
// * addon() of the top level `Value` will return a new `Value`, to avoid pollute the package source when it's imported in other files.
const NewValue = Value.addon({
pow(v, n) { return v ** n },
get Square(v) { return v ** 2 },
VERSION: '1.0',
})
NewValue(2).pow(2) // 4
NewValue(2).Square // 4
NewValue(2).VERSION // 1.0
// addon() of new `Value` will addon itself (instead of returning a new one).
const NewValue2 = NewValue.addon({})
newValue2 === newValue // true
Specific properties (even non-enumerable or inherited):
const NewValue = Value.addon({
pow(v, n) { return v ** n },
get Square(v) { return v ** 2 },
VERSION: '1.0',
}, ['pow'])
Make function to be getter:
const NewValue = Value.addon({
square(v) { return v ** 2 },
}, ['square'], 'getter')
NewValue(2).square // 4
Rename:
const NewValue = Value.addon({
square(v) { return v ** 2 },
}, { square: 'Square' }, 'getter')
NewValue(2).Square // 4
Disable cache of getter properties when add on (cache getter properties is default option of addon(), see declaration):
let count = 0
const NewValue = Value.addon({
square(v) { count++; return v ** 2 },
}, { square: 'Square' }, 'getter', true)
const v = NewValue(2)
v.Square // count is 1
v.Square // count is 2
v.Square // count is 3
v.Square // count is 4
const underscore = require('underscore')
const Value = require('the-value')
.addon(underscore, ['pick', 'omit', 'shuffle'])
.addon(underscore, { isElement: 'Element' }, 'getter')
FAQs
value utility. functional, semantic and neat.
The npm package the-value receives a total of 0 weekly downloads. As such, the-value popularity was classified as not popular.
We found that the-value 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.