@kayahr/text-encoding
Version:
Text encoder and decoder
18 lines • 464 B
JavaScript
/*
* Copyright (C) 2021 Klaus Reimer <k@ailis.de>
* See LICENSE.md for licensing information.
*/
/**
* Base class for encoders.
*/
export class AbstractEncoder {
/**
* Fails the encoding by throwing an exception
*
* @param codePoint - The code point which could not be encoded.
*/
fail(codePoint) {
throw new TypeError(`The code point ${codePoint} could not be encoded`);
}
}
//# sourceMappingURL=AbstractEncoder.js.map