packages/cafeteria/plugins/cordova-plugin-secure-storage/www/sjcl_ss.js
function (obj) {
    var i, out='{', comma='';
    for (i in obj) {
      if (obj.hasOwnProperty(i)) {
        if (!i.match(/^[a-z0-9]+$/i)) {
          throw new sjcl.exception.invalid("json encode: invalid property name");
        }
        out += comma + '"' + i + '":';
        comma = ',';

        switch (typeof obj[i]) {
          case 'number':
          case 'boolean':
            out += obj[i];
            break;

          case 'string':
            out += '"' + escape(obj[i]) + '"';
            break;

          case 'object':
            out += '"' + sjcl.codec.base64.fromBits(obj[i],0) + '"';
            break;

          default:
            throw new sjcl.exception.bug("json encode: unsupported type");
        }
      }
    }
    return out+'}';
  }
function (obj) {
    var i, out='{', comma='';
    for (i in obj) {
      if (obj.hasOwnProperty(i)) {
        if (!i.match(/^[a-z0-9]+$/i)) {
          throw new sjcl.exception.invalid("json encode: invalid property name");
        }
        out += comma + '"' + i + '":';
        comma = ',';

        switch (typeof obj[i]) {
          case 'number':
          case 'boolean':
            out += obj[i];
            break;

          case 'string':
            out += '"' + escape(obj[i]) + '"';
            break;

          case 'object':
            out += '"' + sjcl.codec.base64.fromBits(obj[i],0) + '"';
            break;

          default:
            throw new sjcl.exception.bug("json encode: unsupported type");
        }
      }
    }
    return out+'}';
  }
function ( obj ) { var i , out = '{' , comma = '' ; for ( i in obj ) { if ( obj . hasOwnProperty ( i ) ) { if ( ! i . match ( / ^[a-z0-9]+$ / i ) ) { throw new sjcl . exception . invalid ( "json encode: invalid property name" ) ; } out += comma + '"' + i + '":' ; comma = ',' ; switch ( typeof obj [ i ] ) { case 'number' : case 'boolean' : out += obj [ i ] ; break ; case 'string' : out += '"' + escape ( obj [ i ] ) + '"' ; break ; case 'object' : out += '"' + sjcl . codec . base64 . fromBits ( obj [ i ] , 0 ) + '"' ; break ; default : throw new sjcl . exception . bug ( "json encode: unsupported type" ) ; } } } return out + '}' ; }
Encode a flat structure into a JSON string.
@param {Object} obj The structure to encode.
@return {String} A JSON string.
@throws {sjcl.exception.invalid} if obj has a non-alphanumeric property.
@throws {sjcl.exception.bug} if a parameter has an unsupported type.
Encode a flat structure into a JSON string .