parse json params

@private
@method
@param {String} jsonSource - json object for parsing
@returns {*}
491969
function (jsonSource) {
		var json = null;

		try {
			json = JSON.parse(jsonSource);
		} catch (err) {
			json = jsonSource; // string
		}

		return json;
	}
459917
function ToJSON(jsonName) {
        if (jsonName === 'result') jsonName = 'default';
        let args = Array.prototype.slice.call(arguments);
        if (typeof jsonName === 'undefined') {
          jsonName = 'default';
        } else if (typeof jsonName === 'string') {
          args.splice(0, 1);  //remove the name.
        }
        let jsonFn = modelObj.jsons[jsonName],
          result = this.dataValues;
        if (typeof jsonFn === 'undefined' && jsonName !== 'default') { // silent fallback
          if (typeof modelObj.jsons['default'] === 'function') {
            result = modelObj.jsons['default'].apply(this, args);
          }
        } else {
          if (typeof modelObj.jsons[jsonName] === 'function') {
            result = modelObj.jsons[jsonName].apply(this, args);
          } else {
            result = this.dataValues;
          }
        }
        if (result === this) {
          result = this.dataValues;
        }
        if (typeof result === 'object' && result != null) {
          for (let i = 0; i < modelObj.privateAttributes.length; i++) {
            if (typeof result[modelObj.privateAttributes[i]] !== 'undefined') {
              delete result[modelObj.privateAttributes[i]];
            }
          }
        }
        return result;
      }
890352
function json (options) {
  var opts = options || {}

  var limit = typeof opts.limit !== 'number'
    ? bytes.parse(opts.limit || '100kb')
    : opts.limit
  var inflate = opts.inflate !== false
  var reviver = opts.reviver
  var strict = opts.strict !== false
  var type = opts.type || 'application/json'
  var verify = opts.verify || false

  if (verify !== false && typeof verify !== 'function') {
    throw new TypeError('option verify must be function')
  }

  // create the appropriate type checking function
  var shouldParse = typeof type !== 'function'
    ? typeChecker(type)
    : type

  function parse (body) {
    if (body.length === 0) {
      // special-case empty json body, as it's a common client-side mistake
      // TODO: maybe make this configurable or part of "strict" option
      return {}
    }

    if (strict) {
      var first = firstchar(body)

      if (first !== '{' && first !== '[') {
        debug('strict violation')
        throw new SyntaxError('Unexpected token ' + first)
      }
    }

    debug('parse json')
    return JSON.parse(body, reviver)
  }

  return function jsonParser (req, res, next) {
    if (req._body) {
      debug('body already parsed')
      next()
      return
    }

    req.body = req.body || {}

    // skip requests without bodies
    if (!typeis.hasBody(req)) {
      debug('skip empty body')
      next()
      return
    }

    debug('content-type %j', req.headers['content-type'])

    // determine if request should be parsed
    if (!shouldParse(req)) {
      debug('skip parsing')
      next()
      return
    }

    // assert charset per RFC 7159 sec 8.1
    var charset = getCharset(req) || 'utf-8'
    if (charset.substr(0, 4) !== 'utf-') {
      debug('invalid charset')
      next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
        charset: charset
      }))
      return
    }

    // read
    read(req, res, next, parse, debug, {
      encoding: charset,
      inflate: inflate,
      limit: limit,
      verify: verify
    })
  }
}
368599
private Document parseInputSource(InputSource s) throws JspException {
        try {
            DocumentBuilder db = XmlUtil.newDocumentBuilder();
            db.setEntityResolver(entityResolver);
            return db.parse(s);
        } catch (SAXException e) {
            throw new JspException(e);
        } catch (IOException e) {
            throw new JspException(e);
        }
    }
336254
function parse(data) {
  try {
    return JSON.parse(data);
  } catch (e) {
    log('Oops! Some problems parsing this ' + (typeof data === 'undefined' ? 'undefined' : _typeof(data)) + '.', 'error', debug);
  }

  return null;
}
235995
function JSON_parse(jsonString) { // @arg String - JSON String
                                  // @ret Any
                                  // @throw SyntaxError("Unexpected token: ...")
    var unescaped = jsonString.trim().replace(/"(\\.|[^"\\])*"/g, "");

    if (/[^,:{}\[\]0-9\.\-+Eaeflnr-u \n\r\t]/.test(unescaped)) {
        throw new SyntaxError("Unexpected token:" + jsonString);
    }
    return (new Function("return " + jsonString))(); // raise error
}
1206993
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof SourceCitation)){
    return new SourceCitation(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(SourceCitation.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
521388
function parseSource (node, nodeType, feedType) {
  var source = {},
      sourceNode = node.source,
      temp;

  if (!sourceNode) {
    return;
  }

  if (temp = (feedType === 'atom' && utils.get(sourceNode.title)) || utils.get(sourceNode)) {
    source.title = temp;
  }
  if (temp = (feedType === 'atom' && utils.getAttr(sourceNode.link, 'href')) || utils.getAttr(sourceNode, 'url')) {
    source.url = temp;
  }

  return Object.keys(source).length && source;
}
828796
function parseJson(name, type, value) {
    try {
        return typeof value  === 'string' ?
            JSON.parse(value) :
            value;
    } catch (e) {
        throwError(name, type, value);
    }
}
408897
function JsonParserToMinifiy() {
        // invoke super constructor
        Parser.call(this, allTokens)

        // not mandatory, using <$> (or any other sign) to reduce verbosity (this. this. this. this. .......)
        var $ = this

        this.RULE("json", function() {
            // prettier-ignore
            $.OR([
                {ALT: function() {$.SUBRULE($.object)}},
                {ALT: function() {$.SUBRULE($.array)}}
            ])
        })

        this.RULE("object", function() {
            $.CONSUME(LCurly)
            $.OPTION(function() {
                $.SUBRULE($.objectItem)
                $.MANY(function() {
                    $.CONSUME(Comma)
                    $.SUBRULE2($.objectItem)
                })
            })
            $.CONSUME(RCurly)
        })

        this.RULE("objectItem", function() {
            $.CONSUME(StringLiteral)
            $.CONSUME(Colon)
            $.SUBRULE($.value)
        })

        this.RULE("array", function() {
            $.CONSUME(LSquare)
            $.OPTION(function() {
                $.SUBRULE($.value)
                $.MANY(function() {
                    $.CONSUME(Comma)
                    $.SUBRULE2($.value)
                })
            })
            $.CONSUME(RSquare)
        })

        this.RULE("value", function() {
            // prettier-ignore
            $.OR([
                {ALT: function() {$.CONSUME(StringLiteral)}},
                {ALT: function() {$.CONSUME(NumberLiteral)}},
                {ALT: function() {$.SUBRULE($.object)}},
                {ALT: function() {$.SUBRULE($.array)}},
                {ALT: function() {$.CONSUME(True)}},
                {ALT: function() {$.CONSUME(False)}},
                {ALT: function() {$.CONSUME(Null)}}
            ])
        })

        // very important to call this after all the rules have been defined.
        // otherwise the parser may not work correctly as it will lack information
        // derived during the self analysis phase.
        this.performSelfAnalysis()
    }
220654
public static Node convertToJson(Object source, String label, boolean lenient) {
        if (source instanceof JsonSource) {
            return converter.convertToNode(((JsonSource) source).getJson(), label, lenient);
        } else {
            return converter.convertToNode(source, label, lenient);
        }
    }
1039018
function processJsonpUrl( requestSettings ) {
		if ( requestSettings.type.toUpperCase() === "GET" ) {
			if ( !CALLBACK_REGEX.test( requestSettings.url ) ) {
				requestSettings.url += (/\?/.test( requestSettings.url ) ? "&" : "?") +
					(requestSettings.jsonp || "callback") + "=?";
			}
		} else if ( !requestSettings.data || !CALLBACK_REGEX.test(requestSettings.data) ) {
			requestSettings.data = (requestSettings.data ? requestSettings.data + "&" : "") + (requestSettings.jsonp || "callback") + "=?";
		}
	}
458881
function parse (string) {
  var result = jsonmatter.parse(string, {
    regex: /^[\s\t\n\r]*---{1}[\s\t\n\r]*(\{[\s\S]*\}[\s\t\n\r]*)(---{1})/
  })
  var markdown        = result.__content__
  var html            = marked(markdown).replace(/\r?\n|\r/g, "")
  result.__content__  = patch(html, result.custom)
  return result
}
234092
function convertSource(key, inObj) {
	let source = inObj; // body, query : keep it as is
	
	if (inObj === 'header') {
		source = "headers";
	}
	if (inObj === 'formData') {
		source = "body";
	}
	if (inObj === 'path') {
		source = "params";
	}
	
	return [`${source}.${key}`];
}
576674
function parseJson(payload)
{
  var data;

  try
  {
    data = JSON.parse(payload);
  }
  catch (e)
  {
    this.logger.error({message: 'Unable to parse provided JSON', error: e, payload: payload});
  }

  return data;
}
617213
function (source) {
  var ast = parser.parseEval(source)
  var array = ast.children.find((child) => child.kind === 'array')
  return parseValue(array)
}
741960
function parse( source ) {
      // Must use eval since Jasmine produces no valid JSON (unquoted object keys, Object constructor)
      try {
         // Because the source code is an expression generated by jasmine, newlines should only occur as part
         // of strings (the otherwise missing newlines are the reason that this fixup script exists).
         const oneLineSource = source.replace( '\n', NEWLINE_MARKER );
         // eslint-disable-next-line no-eval
         return eval( '[ ' + oneLineSource + ' ]' );
      }
      catch( e ) {
         var msg = 'webpack-jasmine-html-runner-plugin: fixup-json-messages: could not parse message part: ';
         // eslint-disable-next-line no-console
         console.info( msg, source );
         return source;
      }
   }