Socket
Socket
Sign inDemoInstall

@double-great/alt-text

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@double-great/alt-text - npm Package Compare versions

Comparing version 1.2.0-beta.3 to 1.2.0-beta.4

clues.ts

29

dist/clues.d.ts

@@ -0,1 +1,30 @@

export interface Rule {
/** The name of the rule */
heading: string;
/** Shortened URL to the rule's documentation. */
docs: string;
/** Recommendation on how to fix the rule. */
suggestion: (value?: number | string) => string;
/** Explanation of the rule and why it's important. */
rationale: string;
/** URLs to external sources to support the rule. */
source: string[];
/** Example of the correct usage. */
ok: string;
/** Example of the incorrect usage. */
notOk: string;
/** If available, URL to https://doublegreat.dev/listen/ test case to support the rule. */
listen?: string;
/** If applicable, list of strings to test the rule against. */
rules?: string[];
/** If applicable, a function to test the rule against the current `alt` value. */
fn?: (item: string, alt: string) => string | boolean;
}
/**
* Suggestions to improve alt text.
*/
interface Clue {
[rule: string]: Rule;
}
export declare const clues: Clue;
export {};

@@ -0,1 +1,8 @@

export declare type Alt = string;
/**
* Check for unhelpful alt text.
*
* @param alt A string of alt text
* @returns {string | undefined} Suggestions on how to improve the alt text
*/
export default function altText(alt?: Alt): string | undefined;
import { checkClue, checkPunctuation, checkLength, checkOnlySpace, checkEmoji, createSuggestion, } from "./rules.js";
/**
* Check for unhelpful alt text.
*
* @param alt A string of alt text
* @returns {string | undefined} Suggestions on how to improve the alt text
*/
export default function altText(alt) {

@@ -3,0 +9,0 @@ if (!alt)

2

dist/rules.d.ts

@@ -0,1 +1,3 @@

import { Rule } from "./clues.js";
import { Alt } from "./index.js";
export declare function createSuggestion(ruleName: string, value?: string | number): string;

@@ -2,0 +4,0 @@ export declare function filterClues({ ruleName, clue, alt, }: {

6

package.json
{
"name": "@double-great/alt-text",
"version": "1.2.0-beta.3",
"version": "1.2.0-beta.4",
"description": "Check for unhelpful alt text.",

@@ -57,6 +57,6 @@ "main": "dist/index.js",

"moduleNameMapper": {
"^./clues.js$": "<rootDir>/src/clues.ts",
"^./rules.js$": "<rootDir>/src/rules.ts"
"^./clues.js$": "<rootDir>/clues.ts",
"^./rules.js$": "<rootDir>/rules.ts"
}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc