
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.
standard-utils
Advanced tools
A very small library for making development with typescript easier. Contains utility functions I wish was there in typescript.
Note: This library uses monkey patching to extend native prototypes.
Install using npm
npm install --save standard-utils
Import the whole library as follows:
import "standard-utils";
or you can import specific utility functions as follows:
import "standard-utils/dist/strain";
if you want to use only the strain utility and not anything else.
You can then use the imported utility functions within your application.
This is a utility that lets you filter an array for a single element and returns that element. If more than one elements remain in the filtered array, the first element is returned.
let arr = [
{
name: "blackberry",
type: "fruit"
},
{
name: "orange",
type: "fruit"
},
{
name: "eggplant",
type: "vegetable"
}
];
let obj = arr.strain(el => el.name === "blackberry");
console.log(obj); //{name: "blackberry",type: "fruit"}
This is a function that returns the distinct elements within an array.
let arr = [1, 2, 3, 4, 5, 4, 3, 2, 1];
let obj = arr.distinct();
console.log(obj); //[1, 2, 3, 4, 5]
This is a function that returns the intersection of two arrays
let characters = [
{
name: "Cersei",
house: "Lannister"
},
{
name: "Arya",
house: "Stark"
},
{
name: "Olenna",
house: "Tyrell"
}
];
let starks = [
{
name: "Brandon",
house: "Stark"
},
{
name: "Arya",
house: "Stark"
}
];
console.log(Array.prototype.intersection(characters, starks)); //[{ name: "Arya", house: "Stark" }]);
This is a function that returns the difference between two arrays.
const shoppingList = ["Apple", "Toothpaste", "Boots"];
const unavailableItems = ["Gasoline", "Ribbon", "Apple"];
const newShoppingList = shoppingList.difference(unavailableItems);
console.log(newShoppingList); //["Toothpaste", "Boots"]
Standard MIT Licence.
FAQs
A very small library for making development with typescript easier.
We found that standard-utils 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.