Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
dtrim
Advanced tools
Readme
dtrim is a tool for trimming deep/lengthy javascript structures. Some potential usages are: debugging, logging or data sanitization. Fully configurable.
Caters for:
npm i dtrim
import * as dtrim from 'dtrim'
const trim = dtrim.trimmer({ depth: 4 });
const nasty = { ... a big, deep and nasty object here ... };
const nice = trim(nasty);
dtrim.trimmer([options])
options
: <Object>
depth
: <number>
Trim depth - all structures deeper than this will be omitted from output. This is useful for truncating large complicated objects. To make it return full structure, pass Infinity
or some arbitrary large number. Default: 4
.size
: <number>
Trim size - all objects and arrays that are longer/bigger than specified size will be trimmed. Note on trimming objects: because order of properties is not guaranteed by javascript spec, objects with number of properties bigger than size will be represented as string "Object(N)"
. To make it return full structure, pass Infinity
or some arbitrary large number. Default: 64
.string
: <number>
Trim strings that are longer than specified number. To make it return full structure, pass Infinity
or some arbitrary large number. Default: 512
.buffer
: <boolean>
Substitues instances of a Buffer
object with their string representation: "Buffer(N)"
. Default: true
.getters
: <boolean>
Omits getter fields in objects and classes from the result. Default: true
.retain
: <Set<string>>
A set of root paths to ignore while at depth 0. For example trimming {a: FooClass}
with new Set(['a'])
will result in {a: FooClass}
instead of {a: {}}
. Default: new Set()
Returns: <Function>
- trimmer function that accepts input argument of any type.
MIT
FAQs
A tool for trimming deep/lenghty javascript structures. Some potential usages are: debugging, logging or data sanitization.
The npm package dtrim receives a total of 18,697 weekly downloads. As such, dtrim popularity was classified as popular.
We found that dtrim 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.