
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@types/js-quantities
Advanced tools
TypeScript definitions for js-quantities
npm install --save @types/js-quantities
This package contains type definitions for js-quantities (http://gentooboontoo.github.io/js-quantities/).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/js-quantities.
declare const Qty: Qty.Type;
interface Qty {
readonly numerator: string[];
readonly denominator: string[];
readonly scalar: number;
readonly baseScalar: number;
readonly initValue: string;
units(): string;
isCompatible(value: Qty.UnitSource): boolean;
kind(): string;
isUnitless(): boolean;
isBase(): boolean;
toBase(): Qty;
toFloat(): number;
to(value: Qty.UnitSource): Qty;
inverse(): Qty;
eq(value: Qty.UnitSource): boolean;
same(value: Qty.UnitSource): boolean;
lt(value: Qty.UnitSource): boolean;
lte(value: Qty.UnitSource): boolean;
gt(value: Qty.UnitSource): boolean;
gte(value: Qty.UnitSource): boolean;
compareTo(value: Qty): Qty.ComparisonResult;
add(value: Qty.Source): Qty;
sub(value: Qty.Source): Qty;
mul(value: Qty.Source): Qty;
div(value: Qty.Source): Qty;
toPrec(value: Qty.Source): Qty;
toString(valueOrPrecision?: Qty.Source): string;
toString(value: string, precision: number): string;
format(formatter?: Qty.Formatter): string;
format(value: string, formatter?: Qty.Formatter): string;
}
declare namespace Qty {
interface Type {
(value: Source): Qty;
(value: number, unit: string): Qty;
new(value: Source): Qty;
new(value: number, unit: string): Qty;
parse(value: string): Qty;
getKinds(): string[];
getUnits(kind?: string): string[];
getAliases(unit: string): string[];
swiftConverter(sourceUnit: string, targetUnit: string): Converter;
formatter: Formatter;
readonly Error: any;
mulSafe(n1: number, n2: number): number;
divSafe(n1: number, n2: number): number;
}
interface Converter {
(sourceValue: number): number;
(sourceValues: number[]): number[];
}
type Formatter = (scalar: number, unit: string) => string;
type ComparisonResult = -1 | 0 | 1;
type Source = UnitSource | number;
type UnitSource = Qty | string;
}
export = Qty;
These definitions were written by .
FAQs
TypeScript definitions for js-quantities
The npm package @types/js-quantities receives a total of 20,846 weekly downloads. As such, @types/js-quantities popularity was classified as popular.
We found that @types/js-quantities 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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.