
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@skypilot/common-types
Advanced tools
A library of reusable common types for TypeScript projects
type AnyRecord = Record<string, any>
// Describes an object without properties
type EmptyObject = { [key: string]: never; [key: number]: never }
interface Class<T> extends Function {
new(...args: any[]): T
}
type Enum<E> = Record<keyof E, number | string> & { [key: number]: string }
type Primitive = boolean | number | string;
// Constructs a type that matches any serializable value
export type AsJsonValue<T> =
T extends JsonPrimitive ? T :
T extends Function ? never :
T extends Array<unknown> ? AsJsonArray<T> :
T extends object ? AsJsonMap<T> :
never;
// Constructs a type that matches any serializable array
export type AsJsonArray<T> = Array<AsJsonValue<UnpackedArray<T>>>
// Constructs a type that matches any serializable object map
export type AsJsonMap<T> =
T extends Array<unknown> ? never :
{[K in keyof T]: AsJsonValue<T[K]> };
interface DefiniteJsonArray extends Array<DefiniteJsonValue> {}
type DefiniteJsonMap = {
[key: string]: DefiniteJsonArray | DefiniteJsonMap | JsonPrimitive;
}
type DefiniteJsonValue = DefiniteJsonArray | DefiniteJsonMap | JsonPrimitive;
interface JsonArray extends Array<JsonValue> {}
type JsonMap = {
[key: string]: JsonArray | JsonMap | JsonPrimitive | undefined;
}
type JsonPrimitive = boolean | number | string | null;
type JsonValue = JsonArray | JsonMap | JsonPrimitive | undefined;
These types provide semantic value only. (Until TypeScript allows pattern-matching, the patterns these types imply will not be enforced.)
type Email = string
type Integer = number
type Json = string
type Timestamp = Integer
type Url = string
ArrayItems<A>
: constructs a type that is the union of all items in array A
AtLeastOne<T>
: constructs a type that requires at least one property of T
ExactlyOne<T>
: constructs a type that requires exactly one property of T
Maybe<T>
: constructs a type that allows T
, null
, or undefined
MaybeNull<T>
: constructs a type that allows T
or null
MaybeReadOnly<T>
: constructs a type that allows T[]
or readonly T[]
MaybeUndefined<T>
: constructs a type that allows T
or undefined
ObjectEntries<O>
: constructs a type that is the union of the types of all entries in object O
ObjectKeys<O>
: constructs a type that is the union of all keys in object O
ObjectValues<O, K?>
: constructs a type that is the union of all values in object O
, or, if K
is provided, of all values mapped to keys K
in object O
PromisedReturnType<F>
: obtains the promised return type of function F
Require<T, Required>
[DEPRECATED in favor of RequireProps
]: constructs a type that makes the
Required
properties of T
required
RequireProps<T, Required>
: constructs a type that makes the Required
properties of T
required
UnpackedArray<T>
: constructs a type that is the union of the types of the items in an array of type T
FAQs
Library of reusable common types for TypeScript projects
We found that @skypilot/common-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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.