
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
@ergodark/types
Advanced tools
This package contains various utility and helper types that can be imported by a TypeScript project.
This package only contains TypeScript types.
npm install @ergodark/types
You can use this library's types in your TypeScript projects like so:
import type { TypeNameHere } from '@ergodark/types'
const variable: TypeNameHere;
import type * as ErgoDark from '@ergodark/types'
const variable: ErgoDark.TypeNameHere;
This library provides the following types:
Represents all "primitive" types. Specifically: string, number, bigint,
boolean, symbol, null, and undefined.
import type { Primitive } from '@ergodark/types'
let primitive: Primitive = "yes";
primitive = 1;
primitive = Symbol('yes');
primitive = null;
primitive = new Date(); // <== TypeScript error
Represents all "falsy" types. Specifically: false, '', 0, null, and
undefined.
import type { Falsy } from '@ergodark/types'
let falsy: Falsy = "";
falsy = 0;
falsy = false;
falsy = null;
falsy = true; // <== TypeScript error
Represents all "nullish" types. Specifically: null and undefined.
import type { Nullish } from '@ergodark/types'
let nullish: Nullish = null;
nullish = undefined;
nullish = true; // <== TypeScript error
TypeScript's Partial utility type but applied recursively to every property and any sub-properties.
import type { DeepPartial } from '@ergodark/types'
type T = { a: string, b: { c: { d: number }}};
let t:T = { a: "enough!", b: { c: { d: 1 }}};
let t_bad:T = { a: "enough?" }; // <== TypeScript error
let t2:Partial<T> = { a: "enough?" };
let t2_bad:Partial<T> = { a: "enough?", b: {}}; // <== TypeScript error
let t3:DeepPartial<T> = { a: "enough?" };
let t3_ok:DeepPartial<T> = { a: "enough?", b: {}};
Represents any possible object key.
import type { AnyKey } from '@ergodark/types'
let key: AnyKey = "key";
key = Symbol('key');
key = true; // <== TypeScript error
Represents any possible function.
import type { AnyFunction } from '@ergodark/types'
let fn: AnyFunction = () => true;
fn = Symbol('key'); // <== TypeScript error
Represents any possible constructor.
import type { AnyConstructor } from '@ergodark/types'
let myConstructor: AnyConstructor = Date;
myConstructor = Symbol('key'); // <== TypeScript error
Represents any possible class.
import type { AnyClass } from '@ergodark/types'
let MyClass: AnyClass = class { bark() { return 'woof!' }};
MyClass = Symbol('key'); // <== TypeScript error
Represents any object with string keys. Alias of Record<string, unknown>.
import type { AnyRecord } from '@ergodark/types'
let record: AnyRecord = { a: 1 };
record = Symbol('key'); // <== TypeScript error
Recursively unwrap the return value of a resolved promise.
import type { Awaited } from '@ergodark/types'
const p1 = new Promise<boolean>(resolve => resolve(true));
const p2 = new Promise<typeof p1>(resolve => resolve(p1));
// Type of `p2` is Promise<Promise<boolean>> ...
let result: Awaited<typeof p2>; // <== However, type of `result` is boolean
Issues and pull requests are welcome! In lieu of a formal styleguide, take care to maintain the existing coding style.
Please test your code!
FAQs
Various utility and helper types for TypeScript projects
The npm package @ergodark/types receives a total of 5 weekly downloads. As such, @ergodark/types popularity was classified as not popular.
We found that @ergodark/types 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
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.