OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
core
/
main
/
ts
/
api
/
util
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:12:10 AM
rwxr-xr-x
📄
Class.ts
4.15 KB
02/20/2020 06:12:13 AM
rw-r--r--
📄
Color.ts
5.3 KB
02/20/2020 06:12:14 AM
rw-r--r--
📄
Delay.ts
6.14 KB
02/20/2020 06:12:14 AM
rw-r--r--
📄
EventDispatcher.ts
10.97 KB
02/20/2020 06:12:15 AM
rw-r--r--
📄
FakeStorage.ts
986 bytes
02/20/2020 06:12:15 AM
rw-r--r--
📄
I18n.ts
4.92 KB
02/20/2020 06:12:16 AM
rw-r--r--
📄
JSON.ts
1.63 KB
02/20/2020 06:12:16 AM
rw-r--r--
📄
JSONP.ts
1 KB
02/20/2020 06:12:17 AM
rw-r--r--
📄
JSONRequest.ts
3.36 KB
02/20/2020 06:12:17 AM
rw-r--r--
📄
LocalStorage.ts
866 bytes
02/20/2020 06:12:18 AM
rw-r--r--
📄
Observable.ts
4.92 KB
02/20/2020 06:12:18 AM
rw-r--r--
📄
Promise.ts
5.46 KB
02/20/2020 06:12:19 AM
rw-r--r--
📄
Tools.ts
12.15 KB
02/20/2020 06:12:19 AM
rw-r--r--
📄
URI.ts
12.03 KB
02/20/2020 06:12:20 AM
rw-r--r--
📄
VK.ts
1.22 KB
02/20/2020 06:12:20 AM
rw-r--r--
📄
XHR.ts
3.78 KB
02/20/2020 06:12:21 AM
rw-r--r--
Editing: JSON.ts
Close
/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ import { Type } from '@ephox/katamari'; /** * JSON parser and serializer class. * * @class tinymce.util.JSON * @static * @example * // JSON parse a string into an object * var obj = tinymce.util.JSON.parse(somestring); * * // JSON serialize a object into an string * var str = tinymce.util.JSON.serialize(obj); */ const serialize = (obj: {}) => { const data = JSON.stringify(obj); if (!Type.isString(data)) { return data; } // convert unicode chars to escaped chars return data.replace(/[\u0080-\uFFFF]/g, (match) => { const hexCode = match.charCodeAt(0).toString(16); return '\\u' + '0000'.substring(hexCode.length) + hexCode; }); }; interface JSONUtils { serialize (obj: {}): string; parse (text: string): any; } const JSONUtils: JSONUtils = { /** * Serializes the specified object as a JSON string. * * @method serialize * @param {Object} obj Object to serialize as a JSON string. * @return {string} JSON string serialized from input. */ serialize, /** * Unserializes/parses the specified JSON string into a object. * * @method parse * @param {string} text JSON String to parse into a JavaScript object. * @return {Object} Object from input JSON string or undefined if it failed. */ parse (text: string): any { try { return JSON.parse(text); } catch (ex) { // Ignore } } }; export default JSONUtils;