
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@pro-functional/objects
Advanced tools
yarn add --exact @pro-functional/objects
isObject A type checker to evaluate the given value as an
NonNullable<object>
isObject(null)
// false
isObject(undefined)
// false
isObject(5)
// false
isObject('random value')
// false
isObject({})
// true
isObjectWithProps A type checker that verifies the provided value to be an object with the provided property keys
isObjectWithProps(null, 'name', 'id')
// false
isObjectWithProps(undefined, 'name', 'id')
// false
isObjectWithProps(5, 'name', 'id')
// false
isObjectWithProps('random value', 'name', 'id')
// false
isObjectWithProps({}, 'name', 'id')
// false
isObjectWithProps({ name: 'bob' }, 'name', 'id')
// false
isObjectWithProps({ name: 'bob', id: '007', uid: 'ga98as7fuhk' }, 'name', 'id')
// true
interface User {
name: string
id: string
}
const maybeUser = { name: 'bob', id: '007', uid: 'ga98as7fuhk' }
const user: User | null = isObjectWithProps(maybeUser, 'name', 'id')
? maybeUser
: null
// ✅ assignment is type-correct
makeEnumResolver Create a resolver for an Enum allowing you to map a text back to the enum. The fallback allows a guaranteed response.
enum Colors {
Green = 'green',
Blue = 'blue',
Invalid = 'invalid',
}
const resolveColor = makeEnumResolver(Colors, Colors.Invalid)
resolveColor('green')
// Colors.Green
resolveColor('blue')
// Colors.Blue
resolveColor('purple')
// Colors.Invalid
FAQs
Tools to simplify pure functions
The npm package @pro-functional/objects receives a total of 2 weekly downloads. As such, @pro-functional/objects popularity was classified as not popular.
We found that @pro-functional/objects demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.