Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Essential utilities for TypeScript projects
Ideas for additional essential utilities welcome. Type-only utilities belong in type-fest.
npm install ts-extras
import {isDefined} from 'ts-extras';
[1, undefined, 2].filter(isDefined);
//=> [1, 2]
General
asWritable
- Cast the given value to be Writable
.safeCastTo
- Cast a value to the given type safely.Type guard
isDefined
- Check whether a value is defined (not undefined
).isPresent
- Check whether a value is present (not null
or undefined
).isEmpty
- Check whether an array is empty.assertError
- Assert that the given value is an Error
.isInfinite
- Check whether a value is infinite.Improved builtin
arrayIncludes
- An alternative to Array#includes()
that properly acts as a type guard.setHas
- An alternative to Set#has()
that properly acts as a type guard.objectKeys
- A strongly-typed version of Object.keys()
.objectEntries
- A strongly-typed version of Object.entries()
.objectFromEntries
- A strongly-typed version of Object.fromEntries()
.objectHasOwn
- A strongly-typed version of Object.hasOwn()
.isFinite
- A strongly-typed version of Number.isFinite()
.isInteger
- A strongly-typed version of Number.isInteger()
.isSafeInteger
- A strongly-typed version of Number.isSafeInteger()
.type-fest
?The type-fest
package contains only types, meaning they are only used at compile-time and nothing is ever compiled into actual JavaScript code. This package contains functions that are compiled into JavaScript code and used at runtime.
FAQs
Essential utilities for TypeScript projects
We found that ts-extras demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.