chardet/src/match.ts

14 lines
306 B
TypeScript
Raw Normal View History

2020-09-23 03:06:43 +00:00
import { Context, Recogniser } from "./encoding";
export interface Match {
confidence: number;
name: string;
2020-09-23 03:06:43 +00:00
lang?: string;
}
2021-10-19 10:21:29 +00:00
export default (ctx: Context, rec: Recogniser, confidence: number): Match => ({
confidence,
2021-10-19 10:21:29 +00:00
name: rec.name(ctx),
lang: rec.language ? rec.language() : undefined,
});