All files / ethers.js/src.ts/wordlists wordlist-owla.ts

100% Statements 41/41
100% Branches 4/4
100% Functions 4/4
100% Lines 41/41

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 421x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x  
 
import { WordlistOwl } from "./wordlist-owl.js";
import { decodeOwlA } from "./decode-owla.js";
 
/**
 *  An OWL-A format Wordlist extends the OWL format to add an
 *  overlay onto an OWL format Wordlist to support diacritic
 *  marks.
 *
 *  This class is generally not useful to most developers as
 *  it is used mainly internally to keep Wordlists for languages
 *  based on latin-1 small.
 *
 *  If necessary, there are tools within the ``generation/`` folder
 *  to create the necessary data.
 */
export class WordlistOwlA extends WordlistOwl {
    #accent: string;
 
 
    /**
     *  Creates a new Wordlist for %%locale%% using the OWLA %%data%%
     *  and %%accent%% data and validated against the %%checksum%%.
     */
    constructor(locale: string, data: string, accent: string, checksum: string) {
        super(locale, data, checksum);
        this.#accent = accent;
    }
 
    /**
     *  The OWLA-encoded accent data.
     */
    get _accent(): string { return this.#accent; }
 
    /**
     *  Decode all the words for the wordlist.
     */
    _decodeWords(): Array<string> {
        return decodeOwlA(this._data, this._accent);
    }
}