UNPKG

igniteui-react-core

Version:
77 lines (76 loc) 2.8 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { Base, markType } from "./type"; import { JsonWriter } from "./JsonWriter"; import { StringBuilder } from "./StringBuilder"; import { stringReplace } from "./string"; /** * @hidden */ export let JsonDictionaryItem = /*@__PURE__*/ (() => { class JsonDictionaryItem extends Base { b() { let a = new JsonWriter(); this.d(a); return a.toString(); } d(a) { } a(a) { if (a == null) { return null; } return stringReplace(stringReplace(stringReplace(stringReplace(stringReplace(a, "\\", "\\\\"), "\t", "\\t"), "\"", "\\\""), "\r", "\\r"), "\n", "\\n"); } static c(a) { if (a == null) { return null; } let b = -1; let c = new StringBuilder(0); for (let d = 0; d < a.length; d++) { if (a.charAt(d) == '\\' && b == -1) { b = d; } else { if (b == -1) { c.h(a.charAt(d)); } else { if (a.charAt(d) == 'n') { c.l("\n"); b = -1; } else if (a.charAt(d) == 'r') { c.l("\r"); b = -1; } else if (a.charAt(d) == 't') { c.l("\t"); b = -1; } else if (a.charAt(d) == '\"') { c.l("\""); b = -1; } else if (a.charAt(d) == '\\') { c.l("\\"); b = -1; } else { c.l("\\" + a.charAt(d)); b = -1; } } } } return c.toString(); } } JsonDictionaryItem.$t = /*@__PURE__*/ markType(JsonDictionaryItem, 'JsonDictionaryItem'); return JsonDictionaryItem; })();