relaxed-json.js
File relaxed-json.js
has 456 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
Copyright (c) 2013, Oleg Grenrus
All rights reserved.
Redistribution and use in source and binary forms, with or without
Function parsePair
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parsePair(tokens, state, obj) {
var token = skipPunctuation(tokens, state, [":"]);
var key;
var value;
Function parseMany
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseMany(tokens, state, obj, opts) {
var token = skipPunctuation(tokens, state, opts.skip);
if (token.type === "eof") {
raiseUnexpected(state, token, "'" + opts.endSymbol + "' or " + opts.elementName);
Function makeLexer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeLexer(tokenSpecs) {
// :: string -> array token
return function (contents) {
var tokens = [];
var line = 1;
Function parse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parse(text, opts) {
if (typeof opts === "function" || opts === undefined) {
return JSON.parse(transform(text), opts);
} else if (new Object(opts) !== opts) { // eslint-disable-line no-new-object
throw new TypeError("opts/reviver should be undefined, a function or an object");
Function makeTokenSpecs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeTokenSpecs(relaxed) {
// :: string -> fn
function f(type) {
// :: tuple string -> rawToken
return function (m) {