Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
tiny-decoders
Advanced tools
Version 20.0.0 (2023-10-29)
This release adds more support for primitives.
These are the primitive types:
type primitive = bigint | boolean | number | string | symbol | null | undefined;
stringUnion
has been renamed to primitiveUnion
and now works with literals of any primitive type, not just strings. You can now create a codec for a union of numbers, for example.tag
now accepts literals of any primitive type, not just strings. For example, this allows for easily decoding a tagged union where the discriminator is isAdmin: true
and isAdmin: false
, or a tagged union where the tags are numbers.bigint
codec has been added – a codec for bigint
values. There are now codecs for all primitive types, except:
symbol
: I don’t think this is useful. Use const mySymbol: unique symbol = Symbol(); primitiveUnion([mySymbol])
instead.undefined
: Use primitiveUnion([undefined])
if needed.null
: Use primitiveUnion([null])
if needed.multi
now supports bigint
and symbol
, covering all primitive types. Additionally, since multi
is basically the JavaScript typeof
operator as a codec, it now also supports function
.repr
now recognizes bigint
and prints for example 123n
instead of BigInt
. It already supported symbols (and all other primitive types) since before.DecoderError
type had slight changes due to the above. If all you do with errors is format(error)
, then you won’t notice.In short, all you need to do to upgrade is change stringUnion
into primitiveUnion
.
FAQs
Type-safe data decoding for the minimalist.
The npm package tiny-decoders receives a total of 5,585 weekly downloads. As such, tiny-decoders popularity was classified as popular.
We found that tiny-decoders 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
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.