@double-great/alt-text
Advanced tools
Comparing version 1.2.0-beta.3 to 1.2.0-beta.4
@@ -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) |
@@ -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, }: { |
{ | ||
"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" | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34967
594
13
1