Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@types/wcag-contrast
Advanced tools
npm install --save @types/wcag-contrast
This package contains type definitions for wcag-contrast (https://github.com/tmcw/wcag-contrast).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wcag-contrast.
// Type definitions for wcag-contrast 3.0
// Project: https://github.com/tmcw/wcag-contrast
// Definitions by: York Yao <https://github.com/plantain-00>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Get the contrast ratio between two relative luminance values
* @param a luminance value
* @param b luminance value
* @returns contrast ratio
* @example
* luminance(1, 1); // = 1
*/
export function luminance(a: number, b: number): number;
/**
* Get a score for the contrast between two colors as rgb triplets
* @param a
* @param b
* @returns contrast ratio
* @example
* rgb([0, 0, 0], [255, 255, 255]); // = 21
*/
export function rgb(a: RGBColor, b: RGBColor): number;
/**
* Get a score for the contrast between two colors as hex strings
* @param a hex value
* @param b hex value
* @returns contrast ratio
* @example
* hex('#000', '#fff'); // = 21
*/
export function hex(a: string, b: string): number;
/**
* Get a textual score from a numeric contrast value
* @param contrast
* @returns score
* @example
* score(10); // = 'AAA'
*/
export function score(contrast: number): Score;
/** Color as RGB triplet */
export type RGBColor = [number, number, number];
/** Textual score */
export type Score = "AAA" | "AA" | "AA Large" | "Fail";
These definitions were written by York Yao, and Piotr Błażejewicz.
FAQs
TypeScript definitions for wcag-contrast
The npm package @types/wcag-contrast receives a total of 25,095 weekly downloads. As such, @types/wcag-contrast popularity was classified as popular.
We found that @types/wcag-contrast 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.