UNPKG

devexpress-richedit

Version:

DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.

16 lines (15 loc) 525 B
export class DecoderBase { static decode(str, specifiedSymbols) { if (str == null) { return null; } let result = ""; for (let i = 0; i < str.length; i++) { const sourceCharCode = str.charCodeAt(i); const target = specifiedSymbols[sourceCharCode]; const targetCharCode = target !== undefined ? target : sourceCharCode; result = result + String.fromCharCode(targetCharCode); } return result; } }