require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); define([ '/common/cryptpad-common.js', '/common/cryptget.js', '/common/userObject.js', 'json.sortify' ], function (Cryptpad, Crypt, FO, Sortify) { var exp = {}; var getType = function (el) { if (el === null) { return "null"; } return Array.isArray(el) ? "array" : typeof(el); }; var findAvailableKey = function (obj, key) { if (typeof (obj[key]) === "undefined") { return key; } var i = 1; var nkey = key; while (typeof (obj[nkey]) !== "undefined") { nkey = key + '_' + i; i++; } return nkey; }; var copy = function (el) { if (typeof (el) !== "object") { return el; } return JSON.parse(JSON.stringify(el)); }; var deduplicate = function (array) { var a = array.slice(); for(var i=0; i