
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
flat-object
Advanced tools
$ npm install flat-object
Returns an array of "flattened" paths for the Object specified.
import { flatten } from 'flat-object'
const data = {
nestedArray: [
'string',
{
boolean: true,
string: 'yes'
}
]
}
flatten({ data }) // "nestedArray[0]", "nestedArray[1]", "nestedArray[1].boolean", "nestedArray[1].string"
Returns the property value of the flattened path or undefined if the property does not exist.
import { read } from 'flat-object'
const data = {
name: 'Example',
nestedArray: [
{ id: 1 },
{ id: 2 }
]
}
read({
data,
path: 'name'
}) // "Example"
read({
data,
path: 'nestedArray[1].id'
}) // 2
Writes a value to the specified path. This method just-in-time creates any missing properties along the specified path.
This method will throw an error if an Array value is specified for a property containing an Object (or vice versa).
import { write } from 'flat-object'
const data = {}
write({
data,
path: 'name',
value: 'Example'
}) // data == { name: "Example" }
flatten({
data,
path: 'address.street',
value: '123 Bird Ave'
}) // data == { name: "Example", address: { street: "123 Bird Ave" } }
flatten({
data,
path: 'address[0]',
value: 123
}) // Throws error (since address is already defined as an Object)
FAQs
Utilities for working with nested data structures
The npm package flat-object receives a total of 5 weekly downloads. As such, flat-object popularity was classified as not popular.
We found that flat-object 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.

Research
/Security News
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.