dist/watJSON.browser.js
/**
	   * Convert an object to an watJSON object.
	   * Object (obj) can have a veriety of types. (Javascript/JSON Object, HTMLElement, HTMLCollection)
	   * It can contain objects which has types mentioned above as JSON Object.
	   * @param {any} obj an object to convert.
	   * @param {watJSON.Options=} options converting options.
	   * @return {watJSON.WatJSONObject} converted watJSON object.
	   * @static
	   */
Convert an object to an watJSON object.
Object (obj) can have a veriety of types. (Javascript/JSON Object, HTMLElement, HTMLCollection)
It can contain objects which has types mentioned above as JSON Object.
@param {any} obj an object to convert.
@param {watJSON.Options=} options converting options.
@return {watJSON.WatJSONObject} converted watJSON object.
@static
Convert an object to an watJSON object . Object ( obj ) can have a veriety of types . ( Javascript / JSON Object HTMLElement HTMLCollection ) It can contain objects which has types mentioned above as JSON Object . @param { any } obj an object to convert . @param { watJSON . Options = } options converting options . @return { watJSON . WatJSONObject } converted watJSON object . @static
function toWatJSON(obj, options) {
	    function _ref7(_id7) {
	      if (!WatJSONObject(_id7)) {
	        throw new TypeError('Function "toWatJSON" return value violates contract.\n\nExpected:\nWatJSONObject\n\nGot:\n' + _inspect(_id7));
	      }
	      return _id7;
	    }
	    if (!(options === undefined || Options(options))) {
	      throw new TypeError('Value of optional argument "options" violates contract.\n\nExpected:\nOptions\n\nGot:\n' + _inspect(options));
	    }
	    var opt = commonUtils.extend(watJSONConstants.defOptions, options);
	    if (!(opt instanceof Object)) {
	      throw new TypeError('Value of variable "opt" violates contract.\n\nExpected:\nObject\n\nGot:\n' + _inspect(opt));
	    }
	    if (options) {
	      opt.extTypes = commonUtils.extend(watJSONConstants.defOptions.extTypes, options.extTypes);
	    }
	    var result;
	    if (!(WatJSONObject(result) || result == null)) {
	      throw new TypeError('Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect(result));
	    }
	    var rawResult = _toWatJSON(obj, opt);
	    var dataType = typeof rawResult === 'undefined' ? 'undefined' : _typeof(rawResult);
	    var extTypeMap = watJSONConstants.extTypeMap;
	    if (!(extTypeMap instanceof Object)) {
	      throw new TypeError('Value of variable "extTypeMap" violates contract.\n\nExpected:\nObject\n\nGot:\n' + _inspect(extTypeMap));
	    }
	    if (dataType === 'string') {
	      result = new Ctor();
	      if (!(WatJSONObject(result) || result == null)) {
	        throw new TypeError('Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect(result));
	      }
	      result[extTypeMap.string] = rawResult;
	    } else if (dataType === 'number') {
	      result = new Ctor();
	      if (!(WatJSONObject(result) || result == null)) {
	        throw new TypeError('Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect(result));
	      }
	      result[extTypeMap.number] = rawResult;
	    } else if (dataType === 'boolean') {
	      result = new Ctor();
	      if (!(WatJSONObject(result) || result == null)) {
	        throw new TypeError('Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect(result));
	      }
	      result[extTypeMap.bool] = rawResult;
	    } else if (obj === null) {
	      result = new Ctor();
	      if (!(WatJSONObject(result) || result == null)) {
	        throw new TypeError('Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect(result));
	      }
	      result[extTypeMap.nul] = rawResult;
	    } else if (obj instanceof Array) {
	      result = new Ctor();
	      if (!(WatJSONObject(result) || result == null)) {
	        throw new TypeError('Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect(result));
	      }
	      result[extTypeMap.array] = rawResult;
	    } else {
	      result = rawResult;
	      if (!(WatJSONObject(result) || result == null)) {
	        throw new TypeError('Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect(result));
	      }
	    }
	    return _ref7(result);
	  }
function toWatJSON ( obj , options ) { function _ref7 ( _id7 ) { if ( ! WatJSONObject ( _id7 ) ) { throw new TypeError ( 'Function "toWatJSON" return value violates contract.\n\nExpected:\nWatJSONObject\n\nGot:\n' + _inspect ( _id7 ) ) ; } return _id7 ; } if ( ! ( options === undefined || Options ( options ) ) ) { throw new TypeError ( 'Value of optional argument "options" violates contract.\n\nExpected:\nOptions\n\nGot:\n' + _inspect ( options ) ) ; } var opt = commonUtils . extend ( watJSONConstants . defOptions , options ) ; if ( ! ( opt instanceof Object ) ) { throw new TypeError ( 'Value of variable "opt" violates contract.\n\nExpected:\nObject\n\nGot:\n' + _inspect ( opt ) ) ; } if ( options ) { opt . extTypes = commonUtils . extend ( watJSONConstants . defOptions . extTypes , options . extTypes ) ; } var result ; if ( ! ( WatJSONObject ( result ) || result == null ) ) { throw new TypeError ( 'Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect ( result ) ) ; } var rawResult = _toWatJSON ( obj , opt ) ; var dataType = typeof rawResult === 'undefined' ? 'undefined' : _typeof ( rawResult ) ; var extTypeMap = watJSONConstants . extTypeMap ; if ( ! ( extTypeMap instanceof Object ) ) { throw new TypeError ( 'Value of variable "extTypeMap" violates contract.\n\nExpected:\nObject\n\nGot:\n' + _inspect ( extTypeMap ) ) ; } if ( dataType === 'string' ) { result = new Ctor ( ) ; if ( ! ( WatJSONObject ( result ) || result == null ) ) { throw new TypeError ( 'Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect ( result ) ) ; } result [ extTypeMap . string ] = rawResult ; } else if ( dataType === 'number' ) { result = new Ctor ( ) ; if ( ! ( WatJSONObject ( result ) || result == null ) ) { throw new TypeError ( 'Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect ( result ) ) ; } result [ extTypeMap . number ] = rawResult ; } else if ( dataType === 'boolean' ) { result = new Ctor ( ) ; if ( ! ( WatJSONObject ( result ) || result == null ) ) { throw new TypeError ( 'Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect ( result ) ) ; } result [ extTypeMap . bool ] = rawResult ; } else if ( obj === null ) { result = new Ctor ( ) ; if ( ! ( WatJSONObject ( result ) || result == null ) ) { throw new TypeError ( 'Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect ( result ) ) ; } result [ extTypeMap . nul ] = rawResult ; } else if ( obj instanceof Array ) { result = new Ctor ( ) ; if ( ! ( WatJSONObject ( result ) || result == null ) ) { throw new TypeError ( 'Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect ( result ) ) ; } result [ extTypeMap . array ] = rawResult ; } else { result = rawResult ; if ( ! ( WatJSONObject ( result ) || result == null ) ) { throw new TypeError ( 'Value of variable "result" violates contract.\n\nExpected:\nWatJSONObject | null\n\nGot:\n' + _inspect ( result ) ) ; } } return _ref7 ( result ) ; }
Convert an object to an watJSON object.
Convert an object to an watJSON object .