
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@mkholt/utilities
Advanced tools
The TS Utilities is a collection of small common utility functions to simplify common programming tasks. It is designed to be lightweight, efficient, and easy to use.
The functions are fully typescript typed, and implement type-assertion where relevant.
You can install the library using npm:
npm install @mkholt/utilities
or using yarn:
yarn add @mkholt/utilities
Here is an example of how to use the Utilities Library:
import { chunkArray } from "@mkholt/utilities";
// Example usage
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for (const chunk of chunkArray(arr, 3)) {
console.log(chunk)
}
// [1, 2, 3]
// [4, 5, 6]
// [7, 8, 9]
const arr2 = [1, 2, 3, 1, 2, 3, 4, 5]
const unique = arr2.filter(isUnique)
// unique = [1, 2, 3, 4, 5]
assert(condition, "error"): Given a boolean condition, checks the condition and throws and error if it is false.chunkArray(arr, size): Given an array, returns an iterator which returns the array in chunks of the given sizeisDefined(obj): Returns true if the object is defined and non-null.isUnique(value, index, arr): Returns true if this is the first occurence of the value in the given array arr, false otherwise.This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or feedback, please open an issue on GitHub.
FAQs
Fully typed small utility functions that I often need
We found that @mkholt/utilities demonstrated a not healthy version release cadence and project activity because the last version was released 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.