
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@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
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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.