@prantlf/jsonlint 10.2.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["lib/sorter.js"],"names":["global","factory","exports","module","define","amd","self","jsonlintSorter","this","hasOwnProperty","Object","prototype","sortObject","o","Array","isArray","map","toString","call","sorted","key","a","push","sort","length","defineProperty","value"],"mappings":"CAAC,SAAUA,OAAQC,gBAEVC,UAAY,iBAAmBC,SAAW,YAAcF,QAAQC,gBAE5DE,SAAW,YAAcA,OAAOC,IAAMD,OAAO,kBAAmB,CAAC,WAAYH,UAEjFD,OAASA,QAAUM,KAAML,QAAQD,OAAOO,eAAiB,MANlE,CAOEC,KAAM,SAAUN,SAChB,aAGA,IAAIO,eAAiBC,OAAOC,UAAUF,eACtC,SAASG,WAAYC,GACnB,GAAIC,MAAMC,QAAQF,GAAI,CACpB,OAAOA,EAAEG,IAAIJ,iBACR,GAAIF,OAAOC,UAAUM,SAASC,KAAKL,KAAO,kBAAmB,CAClE,OAAOA,EAET,IAAIM,OAAS,GACb,IAAIC,IACJ,IAAIC,EAAI,GACR,IAAKD,OAAOP,EAAG,CACb,GAAIJ,eAAeS,KAAKL,EAAGO,KAAM,CAC/BC,EAAEC,KAAKF,MAGXC,EAAEE,OACF,IAAKH,IAAM,EAAGA,IAAMC,EAAEG,OAAQJ,MAAO,CACnCD,OAAOE,EAAED,MAAQR,WAAWC,EAAEQ,EAAED,OAElC,OAAOD,OAGTjB,QAAQU,WAAaA,WAErBF,OAAOe,eAAevB,QAAS,aAAc,CAAEwB,MAAO","file":"sorter.js","sourcesContent":["(function (global, factory) {\n // eslint-disable-next-line no-unused-expressions\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports)\n // eslint-disable-next-line no-undef\n : typeof define === 'function' && define.amd ? define('jsonlint-sorter', ['exports'], factory)\n // eslint-disable-next-line no-undef\n : (global = global || self, factory(global.jsonlintSorter = {}))\n}(this, function (exports) {\n 'use strict'\n\n // from http://stackoverflow.com/questions/1359761/sorting-a-json-object-in-javascript\n var hasOwnProperty = Object.prototype.hasOwnProperty\n function sortObject (o) {\n if (Array.isArray(o)) {\n return o.map(sortObject)\n } else if (Object.prototype.toString.call(o) !== '[object Object]') {\n return o\n }\n var sorted = {}\n var key\n var a = []\n for (key in o) {\n if (hasOwnProperty.call(o, key)) {\n a.push(key)\n }\n }\n a.sort()\n for (key = 0; key < a.length; key++) {\n sorted[a[key]] = sortObject(o[a[key]])\n }\n return sorted\n }\n\n exports.sortObject = sortObject\n\n Object.defineProperty(exports, '__esModule', { value: true })\n}))\n"]}
1
+ {"version":3,"sources":["lib/sorter.js"],"names":["global","factory","exports","module","define","amd","self","jsonlintSorter","this","hasOwnProperty","Object","prototype","sortObject","o","Array","isArray","map","toString","call","sorted","key","a","push","sort","length","defineProperty","value"],"mappings":"CAAC,SAAUA,OAAQC,gBAEVC,UAAY,iBAAmBC,SAAW,YAAcF,QAAQC,gBAE5DE,SAAW,YAAcA,OAAOC,IAAMD,OAAO,kBAAmB,CAAC,WAAYH,UAEjFD,OAASA,QAAUM,KAAML,QAAQD,OAAOO,eAAiB,MANlE,CAOEC,MAAM,SAAUN,SAChB,aAGA,MAAMO,eAAiBC,OAAOC,UAAUF,eACxC,SAASG,WAAYC,GACnB,GAAIC,MAAMC,QAAQF,GAAI,CACpB,OAAOA,EAAEG,IAAIJ,iBACR,GAAIF,OAAOC,UAAUM,SAASC,KAAKL,KAAO,kBAAmB,CAClE,OAAOA,EAET,MAAMM,OAAS,GACf,IAAIC,IACJ,MAAMC,EAAI,GACV,IAAKD,OAAOP,EAAG,CACb,GAAIJ,eAAeS,KAAKL,EAAGO,KAAM,CAC/BC,EAAEC,KAAKF,MAGXC,EAAEE,OACF,IAAKH,IAAM,EAAGA,IAAMC,EAAEG,OAAQJ,MAAO,CACnCD,OAAOE,EAAED,MAAQR,WAAWC,EAAEQ,EAAED,OAElC,OAAOD,OAGTjB,QAAQU,WAAaA,WAErBF,OAAOe,eAAevB,QAAS,aAAc,CAAEwB,MAAO","file":"sorter.js","sourcesContent":["(function (global, factory) {\n // eslint-disable-next-line no-unused-expressions, multiline-ternary\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports)\n // eslint-disable-next-line no-undef, multiline-ternary\n : typeof define === 'function' && define.amd ? define('jsonlint-sorter', ['exports'], factory)\n // eslint-disable-next-line no-undef\n : (global = global || self, factory(global.jsonlintSorter = {}))\n}(this, function (exports) {\n 'use strict'\n\n // from http://stackoverflow.com/questions/1359761/sorting-a-json-object-in-javascript\n const hasOwnProperty = Object.prototype.hasOwnProperty\n function sortObject (o) {\n if (Array.isArray(o)) {\n return o.map(sortObject)\n } else if (Object.prototype.toString.call(o) !== '[object Object]') {\n return o\n }\n const sorted = {}\n let key\n const a = []\n for (key in o) {\n if (hasOwnProperty.call(o, key)) {\n a.push(key)\n }\n }\n a.sort()\n for (key = 0; key < a.length; key++) {\n sorted[a[key]] = sortObject(o[a[key]])\n }\n return sorted\n }\n\n exports.sortObject = sortObject\n\n Object.defineProperty(exports, '__esModule', { value: true })\n}))\n"]}
@@ -1,2 +1,2 @@
1
- (function(global,factory){if(typeof exports==="object"&&typeof module!=="undefined"){var jsonlint=require("./jsonlint");var Ajv=require("ajv");function requireSchemaDraft(environment){return require("ajv/lib/refs/"+environment+".json")}factory(exports,Ajv,jsonlint,requireSchemaDraft)}else if(typeof define==="function"&&define.amd){define("jsonlint-validator",["exports","ajv","jsonlint","jsonlint-schema-drafts"],function(exports,jsonlint,Ajv,schemaDrafts){function requireSchemaDraft(environment){return schemaDrafts[environment]}factory(exports,Ajv,jsonlint,requireSchemaDraft)})}else{global=global||self;var requireSchemaDraft=function(environment){return global.jsonlintSchemaDrafts[environment]};factory(global.jsonlintValidator={},global.Ajv,global.jsonlint,requireSchemaDraft)}})(this,function(exports,Ajv,jsonlint,requireSchemaDraft){"use strict";function addErrorLocation(problem,input,tokens,dataPath){var token=tokens.find(function(token){return dataPath===jsonlint.pathToPointer(token.path)});if(token){var location=token.location.start;var offset=location.offset;var line=location.line;var column=location.column;var texts=jsonlint.getErrorTexts(problem.reason,input,offset,line,column);problem.message=texts.message;problem.excerpt=texts.excerpt;if(texts.pointer){problem.pointer=texts.pointer;problem.location={start:{column:column,line:line,offset:offset}}}return true}}function errorToProblem(error,input,tokens){var dataPath=error.dataPath;var schemaPath=error.schemaPath;var reason=(dataPath||"/")+" "+error.message+"; see "+schemaPath;var problem={reason:reason,dataPath:dataPath,schemaPath:schemaPath};if(!addErrorLocation(problem,input,tokens,dataPath)){problem.message=reason}return problem}function createError(errors,data,input,options){if(!input){input=JSON.stringify(data,undefined,2)}if(!options){options={}}Object.assign(options,{tokenLocations:true,tokenPaths:true});var tokens=jsonlint.tokenize(input,options);var problem=errorToProblem(errors[0],input,tokens);var error=new SyntaxError(problem.message);Object.assign(error,problem);return error}function createAjv(environment){var ajvOptions={jsonPointers:true};var ajv;if(!environment){ajvOptions.schemaId="auto";ajv=new Ajv(ajvOptions);ajv.addMetaSchema(requireSchemaDraft("json-schema-draft-04"));ajv.addMetaSchema(requireSchemaDraft("json-schema-draft-06"))}else if(environment==="json-schema-draft-07"){ajv=new Ajv(ajvOptions)}else if(environment==="json-schema-draft-06"){ajv=new Ajv(ajvOptions);ajv.addMetaSchema(requireSchemaDraft("json-schema-draft-06"))}else if(environment==="json-schema-draft-04"){ajvOptions.schemaId="id";ajv=new Ajv(ajvOptions);ajv.addMetaSchema(requireSchemaDraft("json-schema-draft-04"))}else{throw new RangeError('Unsupported environment for the JSON schema validation: "'+environment+'".')}return ajv}function compileSchema(ajv,schema,parseOptions){var parsed;try{parsed=jsonlint.parse(schema,parseOptions)}catch(error){error.message="Parsing the JSON schema failed.\n"+error.message;throw error}try{return ajv.compile(parsed)}catch(originalError){var errors=ajv.errors;var betterError=errors?createError(errors,parsed,schema,parseOptions):originalError;betterError.message="Compiling the JSON schema failed.\n"+betterError.message;throw betterError}}function compile(schema,environment){var options={};if(typeof environment==="object"&&!(environment instanceof String)){options=environment;environment=options.environment}var ajv=createAjv(environment);var parseOptions={mode:options.mode,ignoreComments:options.ignoreComments,ignoreTrailingCommas:options.ignoreTrailingCommas,allowSingleQuotedStrings:options.allowSingleQuotedStrings,allowDuplicateObjectKeys:options.allowDuplicateObjectKeys};var validate=compileSchema(ajv,schema,parseOptions);return function(data,input,options){if(typeof data==="string"||data instanceof String){options=input;input=data;data=jsonlint.parse(input,options)}else if(!(typeof input==="string"||input instanceof String)){options=input;input=undefined}if(validate(data)){return data}throw createError(validate.errors,data,input,options)}}exports.compile=compile;Object.defineProperty(exports,"__esModule",{value:true})});
1
+ (function(global,factory){if(typeof exports==="object"&&typeof module!=="undefined"){const jsonlint=require("./jsonlint");const Ajv=require("ajv");function requireSchemaDraft(environment){return require("ajv/lib/refs/"+environment+".json")}factory(exports,Ajv,jsonlint,requireSchemaDraft)}else if(typeof define==="function"&&define.amd){define("jsonlint-validator",["exports","ajv","jsonlint","jsonlint-schema-drafts"],(function(exports,jsonlint,Ajv,schemaDrafts){function requireSchemaDraft(environment){return schemaDrafts[environment]}factory(exports,Ajv,jsonlint,requireSchemaDraft)}))}else{global=global||self;const requireSchemaDraft=function(environment){return global.jsonlintSchemaDrafts[environment]};factory(global.jsonlintValidator={},global.Ajv,global.jsonlint,requireSchemaDraft)}})(this,(function(exports,Ajv,jsonlint,requireSchemaDraft){"use strict";function addErrorLocation(problem,input,tokens,dataPath){const token=tokens.find((function(token){return dataPath===jsonlint.pathToPointer(token.path)}));if(token){const location=token.location.start;const offset=location.offset;const line=location.line;const column=location.column;const texts=jsonlint.getErrorTexts(problem.reason,input,offset,line,column);problem.message=texts.message;problem.excerpt=texts.excerpt;if(texts.pointer){problem.pointer=texts.pointer;problem.location={start:{column:column,line:line,offset:offset}}}return true}}function errorToProblem(error,input,tokens){const dataPath=error.dataPath;const schemaPath=error.schemaPath;const reason=(dataPath||"/")+" "+error.message+"; see "+schemaPath;const problem={reason:reason,dataPath:dataPath,schemaPath:schemaPath};if(!addErrorLocation(problem,input,tokens,dataPath)){problem.message=reason}return problem}function createError(errors,data,input,options){if(!input){input=JSON.stringify(data,undefined,2)}if(!options){options={}}Object.assign(options,{tokenLocations:true,tokenPaths:true});const tokens=jsonlint.tokenize(input,options);const problem=errorToProblem(errors[0],input,tokens);const error=new SyntaxError(problem.message);Object.assign(error,problem);return error}function createAjv(environment){const ajvOptions={jsonPointers:true};let ajv;if(!environment){ajvOptions.schemaId="auto";ajv=new Ajv(ajvOptions);ajv.addMetaSchema(requireSchemaDraft("json-schema-draft-04"));ajv.addMetaSchema(requireSchemaDraft("json-schema-draft-06"))}else if(environment==="json-schema-draft-07"){ajv=new Ajv(ajvOptions)}else if(environment==="json-schema-draft-06"){ajv=new Ajv(ajvOptions);ajv.addMetaSchema(requireSchemaDraft("json-schema-draft-06"))}else if(environment==="json-schema-draft-04"){ajvOptions.schemaId="id";ajv=new Ajv(ajvOptions);ajv.addMetaSchema(requireSchemaDraft("json-schema-draft-04"))}else{throw new RangeError('Unsupported environment for the JSON schema validation: "'+environment+'".')}return ajv}function compileSchema(ajv,schema,parseOptions){let parsed;try{parsed=jsonlint.parse(schema,parseOptions)}catch(error){error.message="Parsing the JSON schema failed.\n"+error.message;throw error}try{return ajv.compile(parsed)}catch(originalError){const errors=ajv.errors;const betterError=errors?createError(errors,parsed,schema,parseOptions):originalError;betterError.message="Compiling the JSON schema failed.\n"+betterError.message;throw betterError}}function compile(schema,environment){let options={};if(typeof environment==="object"&&!(environment instanceof String)){options=environment;environment=options.environment}const ajv=createAjv(environment);const parseOptions={mode:options.mode,ignoreComments:options.ignoreComments,ignoreTrailingCommas:options.ignoreTrailingCommas,allowSingleQuotedStrings:options.allowSingleQuotedStrings,allowDuplicateObjectKeys:options.allowDuplicateObjectKeys};const validate=compileSchema(ajv,schema,parseOptions);return function(data,input,options){if(typeof data==="string"||data instanceof String){options=input;input=data;data=jsonlint.parse(input,options)}else if(!(typeof input==="string"||input instanceof String)){options=input;input=undefined}if(validate(data)){return data}throw createError(validate.errors,data,input,options)}}exports.compile=compile;Object.defineProperty(exports,"__esModule",{value:true})}));
2
2
  //# sourceMappingURL=validator.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["lib/validator.js"],"names":["global","factory","exports","module","jsonlint","require","Ajv","requireSchemaDraft","environment","define","amd","schemaDrafts","self","jsonlintSchemaDrafts","jsonlintValidator","this","addErrorLocation","problem","input","tokens","dataPath","token","find","pathToPointer","path","location","start","offset","line","column","texts","getErrorTexts","reason","message","excerpt","pointer","errorToProblem","error","schemaPath","createError","errors","data","options","JSON","stringify","undefined","Object","assign","tokenLocations","tokenPaths","tokenize","SyntaxError","createAjv","ajvOptions","jsonPointers","ajv","schemaId","addMetaSchema","RangeError","compileSchema","schema","parseOptions","parsed","parse","compile","originalError","betterError","String","mode","ignoreComments","ignoreTrailingCommas","allowSingleQuotedStrings","allowDuplicateObjectKeys","validate","defineProperty","value"],"mappings":"CAAC,SAAUA,OAAQC,SACjB,UAAWC,UAAY,iBAAmBC,SAAW,YAAa,CAChE,IAAIC,SAAWC,QAAQ,cACvB,IAAIC,IAAMD,QAAQ,OAElB,SAASE,mBAAoBC,aAC3B,OAAOH,QAAQ,gBAAkBG,YAAc,SAEjDP,QAAQC,QAASI,IAAKF,SAAUG,yBAE3B,UAAWE,SAAW,YAAcA,OAAOC,IAAK,CAErDD,OAAO,qBAAsB,CAAC,UAAW,MAAO,WAAY,0BAC1D,SAAUP,QAASE,SAAUE,IAAKK,cAChC,SAASJ,mBAAoBC,aAC3B,OAAOG,aAAaH,aAEtBP,QAAQC,QAASI,IAAKF,SAAUG,0BAE/B,CAELP,OAASA,QAAUY,KACnB,IAAIL,mBAAqB,SAAUC,aACjC,OAAOR,OAAOa,qBAAqBL,cAErCP,QAAQD,OAAOc,kBAAoB,GAAId,OAAOM,IAAKN,OAAOI,SAAUG,sBAzBxE,CA2BEQ,KAAM,SAAUb,QAASI,IAAKF,SAAUG,oBACxC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K,OAAQC,cAC1C,OAAO,SAAUpB,KAAMvB,MAAOwB,SAC5B,UAAWD,OAAS,UAAYA,gBAAgB0B,OAAQ,CACtDzB,QAAUxB,MACVA,MAAQuB,KACRA,KAAOrC,SAAS2D,MAAM7C,MAAOwB,cACxB,YAAaxB,QAAU,UAAYA,iBAAiBiD,QAAS,CAClEzB,QAAUxB,MACVA,MAAQ2B,UAEV,GAAI4B,SAAShC,MAAO,CAClB,OAAOA,KAET,MAAMF,YAAYkC,SAASjC,OAAQC,KAAMvB,MAAOwB,UAIpDxC,QAAQ8D,QAAUA,QAElBlB,OAAO4B,eAAexE,QAAS,aAAc,CAAEyE,MAAO","file":"validator.js","sourcesContent":["(function (global, factory) {\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n var jsonlint = require('./jsonlint')\n var Ajv = require('ajv')\n // eslint-disable-next-line no-inner-declarations\n function requireSchemaDraft (environment) {\n return require('ajv/lib/refs/' + environment + '.json')\n }\n factory(exports, Ajv, jsonlint, requireSchemaDraft)\n // eslint-disable-next-line no-undef\n } else if (typeof define === 'function' && define.amd) {\n // eslint-disable-next-line no-undef\n define('jsonlint-validator', ['exports', 'ajv', 'jsonlint', 'jsonlint-schema-drafts'],\n function (exports, jsonlint, Ajv, schemaDrafts) {\n function requireSchemaDraft (environment) {\n return schemaDrafts[environment]\n }\n factory(exports, Ajv, jsonlint, requireSchemaDraft)\n })\n } else {\n // eslint-disable-next-line no-undef\n global = global || self\n var requireSchemaDraft = function (environment) {\n return global.jsonlintSchemaDrafts[environment]\n }\n factory(global.jsonlintValidator = {}, global.Ajv, global.jsonlint, requireSchemaDraft)\n }\n}(this, function (exports, Ajv, jsonlint, requireSchemaDraft) {\n 'use strict'\n\n function addErrorLocation (problem, input, tokens, dataPath) {\n var token = tokens.find(function (token) {\n return dataPath === jsonlint.pathToPointer(token.path)\n })\n if (token) {\n var location = token.location.start\n var offset = location.offset\n var line = location.line\n var column = location.column\n var texts = jsonlint.getErrorTexts(problem.reason, input, offset, line, column)\n problem.message = texts.message\n problem.excerpt = texts.excerpt\n if (texts.pointer) {\n problem.pointer = texts.pointer\n problem.location = {\n start: {\n column: column,\n line: line,\n offset: offset\n }\n }\n }\n return true\n }\n }\n\n function errorToProblem (error, input, tokens) {\n var dataPath = error.dataPath\n var schemaPath = error.schemaPath\n var reason = (dataPath || '/') + ' ' + error.message + '; see ' + schemaPath\n var problem = {\n reason: reason,\n dataPath: dataPath,\n schemaPath: schemaPath\n }\n if (!addErrorLocation(problem, input, tokens, dataPath)) {\n problem.message = reason\n }\n return problem\n }\n\n function createError (errors, data, input, options) {\n if (!input) {\n input = JSON.stringify(data, undefined, 2)\n }\n if (!options) {\n options = {}\n }\n Object.assign(options, {\n tokenLocations: true,\n tokenPaths: true\n })\n var tokens = jsonlint.tokenize(input, options)\n // var problems = errors.map(function (error) {\n // return errorToProblem(error, input, tokens)\n // })\n // var message = problems\n // .map(function (problem) {\n // return problem.message\n // })\n // .join('\\n')\n var problem = errorToProblem(errors[0], input, tokens)\n var error = new SyntaxError(problem.message)\n Object.assign(error, problem)\n return error\n }\n\n function createAjv (environment) {\n var ajvOptions = { jsonPointers: true }\n var ajv\n if (!environment) {\n ajvOptions.schemaId = 'auto'\n ajv = new Ajv(ajvOptions)\n ajv.addMetaSchema(requireSchemaDraft('json-schema-draft-04'))\n ajv.addMetaSchema(requireSchemaDraft('json-schema-draft-06'))\n } else if (environment === 'json-schema-draft-07') {\n ajv = new Ajv(ajvOptions)\n } else if (environment === 'json-schema-draft-06') {\n ajv = new Ajv(ajvOptions)\n ajv.addMetaSchema(requireSchemaDraft('json-schema-draft-06'))\n } else if (environment === 'json-schema-draft-04') {\n ajvOptions.schemaId = 'id'\n ajv = new Ajv(ajvOptions)\n ajv.addMetaSchema(requireSchemaDraft('json-schema-draft-04'))\n } else {\n throw new RangeError('Unsupported environment for the JSON schema validation: \"' +\n environment + '\".')\n }\n return ajv\n }\n\n function compileSchema (ajv, schema, parseOptions) {\n var parsed\n try {\n parsed = jsonlint.parse(schema, parseOptions)\n } catch (error) {\n error.message = 'Parsing the JSON schema failed.\\n' + error.message\n throw error\n }\n try {\n return ajv.compile(parsed)\n } catch (originalError) {\n var errors = ajv.errors\n var betterError = errors\n ? createError(errors, parsed, schema, parseOptions)\n : originalError\n betterError.message = 'Compiling the JSON schema failed.\\n' + betterError.message\n throw betterError\n }\n }\n\n function compile (schema, environment) {\n var options = {}\n if (typeof environment === 'object' && !(environment instanceof String)) {\n options = environment\n environment = options.environment\n }\n var ajv = createAjv(environment)\n var parseOptions = {\n mode: options.mode,\n ignoreComments: options.ignoreComments,\n ignoreTrailingCommas: options.ignoreTrailingCommas,\n allowSingleQuotedStrings: options.allowSingleQuotedStrings,\n allowDuplicateObjectKeys: options.allowDuplicateObjectKeys\n }\n var validate = compileSchema(ajv, schema, parseOptions)\n return function (data, input, options) {\n if (typeof data === 'string' || data instanceof String) {\n options = input\n input = data\n data = jsonlint.parse(input, options)\n } else if (!(typeof input === 'string' || input instanceof String)) {\n options = input\n input = undefined\n }\n if (validate(data)) {\n return data\n }\n throw createError(validate.errors, data, input, options)\n }\n }\n\n exports.compile = compile\n\n Object.defineProperty(exports, '__esModule', { value: true })\n}))\n"]}
1
+ {"version":3,"sources":["lib/validator.js"],"names":["global","factory","exports","module","jsonlint","require","Ajv","requireSchemaDraft","environment","define","amd","schemaDrafts","self","jsonlintSchemaDrafts","jsonlintValidator","this","addErrorLocation","problem","input","tokens","dataPath","token","find","pathToPointer","path","location","start","offset","line","column","texts","getErrorTexts","reason","message","excerpt","pointer","errorToProblem","error","schemaPath","createError","errors","data","options","JSON","stringify","undefined","Object","assign","tokenLocations","tokenPaths","tokenize","SyntaxError","createAjv","ajvOptions","jsonPointers","ajv","schemaId","addMetaSchema","RangeError","compileSchema","schema","parseOptions","parsed","parse","compile","originalError","betterError","String","mode","ignoreComments","ignoreTrailingCommas","allowSingleQuotedStrings","allowDuplicateObjectKeys","validate","defineProperty","value"],"mappings":"CAAC,SAAUA,OAAQC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AAOxB,OACPA,MAAMJ,QAAU,oCAAsCI,MAAMJ,QAC5D,MAAMI,MAER,IACE,OAAOkB,IAAIS,QAAQF,QACnB,MAAOG,eACP,MAAMzB,OAASe,IAAIf,OACnB,MAAM0B,YAAc1B,OAChBD,YAAYC,OAAQsB,OAAQF,OAAQC,cACpCI,cACJC,YAAYjC,QAAU,sCAAwCiC,YAAYjC,QAC1E,MAAMiC,aAIV,SAASF,QAASJ,OAAQpD,aACxB,IAAIkC,QAAU,GACd,UAAWlC,cAAgB,YAAcA,uBAAuB2D,QAAS,CACvEzB,QAAUlC,YACVA,YAAckC,QAAQlC,YAExB,MAAM+C,IAAMH,UAAU5C,aACtB,MAAMqD,aAAe,CACnBO,KAAM1B,QAAQ0B,KACdC,eAAgB3B,QAAQ2B,eACxBC,qBAAsB5B,QAAQ4B,qBAC9BC,yBAA0B7B,QAAQ6B,yBAClCC,yBAA0B9B,QAAQ8B,0BAEpC,MAAMC,SAAWd,cAAcJ,IAAKK,OAAQC,cAC5C,OAAO,SAAUpB,KAAMvB,MAAOwB,SAC5B,UAAWD,OAAS,UAAYA,gBAAgB0B,OAAQ,CACtDzB,QAAUxB,MACVA,MAAQuB,KACRA,KAAOrC,SAAS2D,MAAM7C,MAAOwB,cACxB,YAAaxB,QAAU,UAAYA,iBAAiBiD,QAAS,CAClEzB,QAAUxB,MACVA,MAAQ2B,UAEV,GAAI4B,SAAShC,MAAO,CAClB,OAAOA,KAET,MAAMF,YAAYkC,SAASjC,OAAQC,KAAMvB,MAAOwB,UAIpDxC,QAAQ8D,QAAUA,QAElBlB,OAAO4B,eAAexE,QAAS,aAAc,CAAEyE,MAAO","file":"validator.js","sourcesContent":["(function (global, factory) {\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n const jsonlint = require('./jsonlint')\n const Ajv = require('ajv')\n // eslint-disable-next-line no-inner-declarations\n function requireSchemaDraft (environment) {\n return require('ajv/lib/refs/' + environment + '.json')\n }\n factory(exports, Ajv, jsonlint, requireSchemaDraft)\n // eslint-disable-next-line no-undef\n } else if (typeof define === 'function' && define.amd) {\n // eslint-disable-next-line no-undef\n define('jsonlint-validator', ['exports', 'ajv', 'jsonlint', 'jsonlint-schema-drafts'],\n function (exports, jsonlint, Ajv, schemaDrafts) {\n function requireSchemaDraft (environment) {\n return schemaDrafts[environment]\n }\n factory(exports, Ajv, jsonlint, requireSchemaDraft)\n })\n } else {\n // eslint-disable-next-line no-undef\n global = global || self\n const requireSchemaDraft = function (environment) {\n return global.jsonlintSchemaDrafts[environment]\n }\n factory(global.jsonlintValidator = {}, global.Ajv, global.jsonlint, requireSchemaDraft)\n }\n}(this, function (exports, Ajv, jsonlint, requireSchemaDraft) {\n 'use strict'\n\n function addErrorLocation (problem, input, tokens, dataPath) {\n const token = tokens.find(function (token) {\n return dataPath === jsonlint.pathToPointer(token.path)\n })\n if (token) {\n const location = token.location.start\n const offset = location.offset\n const line = location.line\n const column = location.column\n const texts = jsonlint.getErrorTexts(problem.reason, input, offset, line, column)\n problem.message = texts.message\n problem.excerpt = texts.excerpt\n if (texts.pointer) {\n problem.pointer = texts.pointer\n problem.location = {\n start: {\n column,\n line,\n offset\n }\n }\n }\n return true\n }\n }\n\n function errorToProblem (error, input, tokens) {\n const dataPath = error.dataPath\n const schemaPath = error.schemaPath\n const reason = (dataPath || '/') + ' ' + error.message + '; see ' + schemaPath\n const problem = {\n reason,\n dataPath,\n schemaPath\n }\n if (!addErrorLocation(problem, input, tokens, dataPath)) {\n problem.message = reason\n }\n return problem\n }\n\n function createError (errors, data, input, options) {\n if (!input) {\n input = JSON.stringify(data, undefined, 2)\n }\n if (!options) {\n options = {}\n }\n Object.assign(options, {\n tokenLocations: true,\n tokenPaths: true\n })\n const tokens = jsonlint.tokenize(input, options)\n // var problems = errors.map(function (error) {\n // return errorToProblem(error, input, tokens)\n // })\n // var message = problems\n // .map(function (problem) {\n // return problem.message\n // })\n // .join('\\n')\n const problem = errorToProblem(errors[0], input, tokens)\n const error = new SyntaxError(problem.message)\n Object.assign(error, problem)\n return error\n }\n\n function createAjv (environment) {\n const ajvOptions = { jsonPointers: true }\n let ajv\n if (!environment) {\n ajvOptions.schemaId = 'auto'\n ajv = new Ajv(ajvOptions)\n ajv.addMetaSchema(requireSchemaDraft('json-schema-draft-04'))\n ajv.addMetaSchema(requireSchemaDraft('json-schema-draft-06'))\n } else if (environment === 'json-schema-draft-07') {\n ajv = new Ajv(ajvOptions)\n } else if (environment === 'json-schema-draft-06') {\n ajv = new Ajv(ajvOptions)\n ajv.addMetaSchema(requireSchemaDraft('json-schema-draft-06'))\n } else if (environment === 'json-schema-draft-04') {\n ajvOptions.schemaId = 'id'\n ajv = new Ajv(ajvOptions)\n ajv.addMetaSchema(requireSchemaDraft('json-schema-draft-04'))\n } else {\n throw new RangeError('Unsupported environment for the JSON schema validation: \"' +\n environment + '\".')\n }\n return ajv\n }\n\n function compileSchema (ajv, schema, parseOptions) {\n let parsed\n try {\n parsed = jsonlint.parse(schema, parseOptions)\n } catch (error) {\n error.message = 'Parsing the JSON schema failed.\\n' + error.message\n throw error\n }\n try {\n return ajv.compile(parsed)\n } catch (originalError) {\n const errors = ajv.errors\n const betterError = errors\n ? createError(errors, parsed, schema, parseOptions)\n : originalError\n betterError.message = 'Compiling the JSON schema failed.\\n' + betterError.message\n throw betterError\n }\n }\n\n function compile (schema, environment) {\n let options = {}\n if (typeof environment === 'object' && !(environment instanceof String)) {\n options = environment\n environment = options.environment\n }\n const ajv = createAjv(environment)\n const parseOptions = {\n mode: options.mode,\n ignoreComments: options.ignoreComments,\n ignoreTrailingCommas: options.ignoreTrailingCommas,\n allowSingleQuotedStrings: options.allowSingleQuotedStrings,\n allowDuplicateObjectKeys: options.allowDuplicateObjectKeys\n }\n const validate = compileSchema(ajv, schema, parseOptions)\n return function (data, input, options) {\n if (typeof data === 'string' || data instanceof String) {\n options = input\n input = data\n data = jsonlint.parse(input, options)\n } else if (!(typeof input === 'string' || input instanceof String)) {\n options = input\n input = undefined\n }\n if (validate(data)) {\n return data\n }\n throw createError(validate.errors, data, input, options)\n }\n }\n\n exports.compile = compile\n\n Object.defineProperty(exports, '__esModule', { value: true })\n}))\n"]}
package/CHANGELOG.md DELETED
@@ -1,271 +0,0 @@
1
- # [10.2.0](https://github.com/prantlf/jsonlint/compare/v10.1.1...v10.2.0) (2019-12-28)
2
-
3
- ### Features
4
-
5
- * Allow trimming trailing commas in arrays and objects (JSON5) ([136ea99](https://github.com/prantlf/jsonlint/commit/136ea995bef7b0f77c2ac54b6ce7dd8572190bf8))
6
- * Allow unifying quotes around object keys to double or single ones (JSON5) ([6b6da17](https://github.com/prantlf/jsonlint/commit/6b6da175cfea8f71841e145a525ef124c19c2607))
7
-
8
- # [10.1.1](https://github.com/prantlf/jsonlint/compare/v10.1.0...v10.1.1) (2019-12-27)
9
-
10
- ### Bug Fixes
11
-
12
- * Restore compatibility with IE11 ([55b8a48](https://github.com/prantlf/jsonlint/commit/55b8a4816b08c5504cf7f0841d1997634a6376ea))
13
-
14
- # [10.1.0](https://github.com/prantlf/jsonlint/compare/v10.0.2...v10.1.0) (2019-12-27)
15
-
16
- ### Features
17
-
18
- * Alternatively accept number of spaces for the indent parameter ([4c25739](https://github.com/prantlf/jsonlint/commit/4c257399b77e446c198b25049fae2ca08ad174ec))
19
-
20
- # [10.0.2](https://github.com/prantlf/jsonlint/compare/v10.0.1...v10.0.2) (2019-12-27)
21
-
22
- ### Bug Fixes
23
-
24
- * Do not modify input options in the tokenize method ([7e3ac0b](https://github.com/prantlf/jsonlint/commit/7e3ac0babf873c42da1daadaee2bbe55d2644690))
25
-
26
- # [10.0.1](https://github.com/prantlf/jsonlint/compare/v10.0.0...v10.0.1) (2019-12-27)
27
-
28
- ### Bug Fixes
29
-
30
- * Pretty-printer: keep the comment after opening an object scope indented ([4fbc09d](https://github.com/prantlf/jsonlint/commit/4fbc09d402ed5442e2de77382342267e330cb908))
31
-
32
- # [10.0.0](https://github.com/prantlf/jsonlint/compare/v9.0.0...v10.0.0) (2019-12-27)
33
-
34
- ### Bug Fixes
35
-
36
- * Rename the property "exzerpt" in error information to "excerpt" ([4c74e3d](https://github.com/prantlf/jsonlint/commit/4c74e3d866fc54a7b2f833ff522efbaef3331bbe))
37
-
38
- ### Features
39
-
40
- * Add support for pretty-printing of the JSON input ([d5eaa93](https://github.com/prantlf/jsonlint/commit/d5eaa9350d654050316b186dc8965ce9cb45d905))
41
-
42
- ### BREAKING CHANGES
43
-
44
- * If you used the property "exzerpt" from the parsing error object, you have to change it to "excerpt". It should be easy using a full-text search in your sources.
45
- * The option for pretty-printing *invalid input* has been renamed:
46
-
47
- -p (--pretty-print) ==> -P (--pretty-print-invalid)
48
-
49
- The option `-p (--pretty-print)` will newly prettify the raw (text) input instead of formatting the parsed JSON object.
50
-
51
- # [9.0.0](https://github.com/prantlf/jsonlint/compare/v8.0.3...v9.0.0) (2019-12-22)
52
-
53
- ### chore
54
-
55
- * Upgrade package dependencies ([4a8f2d9](https://github.com/prantlf/jsonlint/commit/4a8f2d9c27428da32b95f607bf7952190636af9f))
56
-
57
- ### Features
58
-
59
- * Add TypeScript typings ([ba6c979](https://github.com/prantlf/jsonlint/commit/ba6c9790792837fdc3abd0032899ffd04953cf3d))
60
-
61
- ### BREAKING CHANGES
62
-
63
- * Dependencies (commander, at least) dropped support for Node.js 4. Node.js 6 should still work, but officially it is not supported either. You should upgrade to the current or still supported Node.js LTS version.
64
-
65
- ## [8.0.3](https://github.com/prantlf/jsonlint/compare/v8.0.2...v8.0.3) (2019-09-24)
66
-
67
- ### Bug Fixes
68
-
69
- * Upgrade package dependencies and adapt sources ([9f1f332](https://github.com/prantlf/jsonlint/commit/9f1f332960c91d9779bff995457154157df8823b))
70
-
71
- ## [8.0.2](https://github.com/prantlf/jsonlint/compare/v8.0.1...v8.0.2) (2019-07-04)
72
-
73
- ### Bug Fixes
74
-
75
- * Put only the reason of the error to the error.reason property when the custom parser is used; not the full message including the error context ([8d7f0b1](https://github.com/prantlf/jsonlint/commit/8d7f0b13b2bfe7e854c965b7266e5de1dec79229))
76
- * Update newline replacement regex to show correct error position on Windows ([7af364c](https://github.com/prantlf/jsonlint/commit/7af364cbafd84326f20f29adbacde1cd0f70e57a))
77
-
78
- # [8.0.0](https://github.com/prantlf/jsonlint/compare/v7.0.3...v8.0.0) (2019-06-16)
79
-
80
- ### Bug Fixes
81
-
82
- * Give the schema-drafts.js proper name and path in source maps ([c2f0148](https://github.com/prantlf/jsonlint/commit/c2f0148cb027e335fa2bb644f3c09a9c51303193))
83
-
84
- ### Features
85
-
86
- * Add the tokenize method returning tokens instead of the parsed object ([cc7b554](https://github.com/prantlf/jsonlint/commit/cc7b55495b3287279aa0c27e242d3e90d8636d66))
87
- * Improve schema error reporting to the level of data parsing ([ea5a8a2](https://github.com/prantlf/jsonlint/commit/ea5a8a2f917f6a07212f8a4e05af22c14e5f1883))
88
- * Remove deprecated exports `Parser` and `parser` ([8bda5b1](https://github.com/prantlf/jsonlint/commit/8bda5b1455d8d176997dcce0bbcd622985888fc7))
89
-
90
- ### BREAKING CHANGES
91
-
92
- * The `Parser` class and `parser` instance did not bring any benefit. They were generated by Jison. After abandoning the Jison parser they were kept for compatibility only. The only method on the `Parser` prototype was the `parse`. It remains unchanged as a direct export. Drop the class interface and just call the `parse` method directly.
93
-
94
- ## [7.0.3](https://github.com/prantlf/jsonlint/compare/v7.0.2...v7.0.3) (2019-06-03)
95
-
96
- ### Bug Fixes
97
-
98
- * Ensure, that tokens and keys in error messages are enclosed in quotation marks ([2149198](https://github.com/prantlf/jsonlint/commit/2149198721fc8dd05632b2225c621ebf7b5e14b7))
99
-
100
- ## [7.0.2](https://github.com/prantlf/jsonlint/compare/v7.0.1...v7.0.2) (2019-06-02)
101
-
102
- ### Bug Fixes
103
-
104
- * Upgrade minificating module ([04d80d7](https://github.com/prantlf/jsonlint/commit/04d80d752c4900f26585d9a809b8ac6d0eef696d))
105
-
106
- ## [7.0.1](https://github.com/prantlf/jsonlint/compare/v7.0.0...v7.0.1) (2019-06-02)
107
-
108
- ### Bug Fixes
109
-
110
- * Recognize boxed string as schema environment too ([e37b004](https://github.com/prantlf/jsonlint/commit/e37b0042376cf5beafc93bf906ee70b583f08969))
111
-
112
- # [7.0.0](https://github.com/prantlf/jsonlint/compare/v6.3.1...v7.0.0) (2019-06-02)
113
-
114
- ### Bug Fixes
115
-
116
- * Do not use the native parser in Safari and Node.js 4 ([a4a606c](https://github.com/prantlf/jsonlint/commit/a4a606c333e443642ced99d466223607bce11461))
117
- * Include the minified scripts used on the on-line page in the NPM module ([03561ec](https://github.com/prantlf/jsonlint/commit/03561ecba00c5d23dfba41831bea818837a7b804))
118
-
119
- ### Features
120
-
121
- * Add "mode" parameter to set flags for a typical format type easier ([9aa09fb](https://github.com/prantlf/jsonlint/commit/9aa09fbc9980e78fa0fed134ce48d99412b619a9))
122
- * Add an option for ignoring trailing commas in object and arrays ([7d521fb](https://github.com/prantlf/jsonlint/commit/7d521fb68ea7919625cc6bc5f5179ce69f6b5985))
123
- * Add an option for reporting duplicate object keys as an error ([09e3977](https://github.com/prantlf/jsonlint/commit/09e39772de088b73e43dac551533a160bc09903c))
124
- * Replace the parser generated by Jison with a hand-built parser from JJU ([2781670](https://github.com/prantlf/jsonlint/commit/27816706435fb48fb8816d743bc56d6d34c4c6c8))
125
- * Support `reviver` from the native `JSON.parse` method ([83cd33c](https://github.com/prantlf/jsonlint/commit/83cd33c937851482799e01bf7262a9ba93bed6cf))
126
-
127
- ### BREAKING CHANGES
128
-
129
- * There is no `yy.parseError` to intercept error handling. Use the thrown error - it contains all available information. The error does not include the `hash` object with structured information. Look for the [documentd properties](/prantlf/jsonlint#error-handling). The location of the error occurrence is available as `location.start`, for example.
130
-
131
- DEPRECATION: The only exposed object to use from now on is the `parse` method as a named export. Other exports (`parser` and `Parser`) are deprecated and will be removed in future.
132
-
133
- The parser from ["Utilities to work with JSON/JSON5 documents"](/rlidwka/jju) is four times faster, than the previous one, has approximatly the same size and can be easier enhanced, regarding both features and error handling.
134
-
135
- ## [6.3.1](https://github.com/prantlf/jsonlint/compare/v6.3.0...v6.3.1) (2019-05-31)
136
-
137
- ### Bug Fixes
138
-
139
- * Recognise the location of error occurrences in Firefox ([7c8c040](https://github.com/prantlf/jsonlint/commit/7c8c040e8f9d259bf573c04f8f6a7df15587a54a))
140
-
141
- # [6.3.0](https://github.com/prantlf/jsonlint/compare/v6.2.1...v6.3.0) (2019-05-30)
142
-
143
- ### Bug Fixes
144
-
145
- * Auto-detect the version of the JSON Schema draft by default ([1fe98ef](https://github.com/prantlf/jsonlint/commit/1fe98ef4e3ee5cd26055e6f73f11387635a078a3))
146
- * Prefer the native JSON parser, if possible, to improve performance ([1639356](https://github.com/prantlf/jsonlint/commit/16393562769a9f77741347fd9cda15c5207f1fee))
147
-
148
- ### Features
149
-
150
- * Support parser options for customisation and performance in JSON schema parsing too ([d562826](https://github.com/prantlf/jsonlint/commit/d562826f604f8c3df5656a79ee4c2085c203f91c))
151
-
152
- ## [6.2.1](https://github.com/prantlf/jsonlint/compare/v6.2.0...v6.2.1) (2019-05-30)
153
-
154
- ### Bug Fixes
155
-
156
- * Include source code in source maps on the on-line validator page ([31e0097](https://github.com/prantlf/jsonlint/commit/31e0097de3c2c5a30e3695d1d5b3f411dc7b6723))
157
-
158
- # [6.2.0](https://github.com/prantlf/jsonlint/compare/v6.1.0...v6.2.0) (2019-05-30)
159
-
160
- ### Features
161
-
162
- * Extract the functionality for sorting object keys to a module ([a53bd93](https://github.com/prantlf/jsonlint/commit/a53bd9392b2116b5272c77deee9423ba16b5f520))
163
-
164
- # [6.1.0](https://github.com/prantlf/jsonlint/compare/v6.0.0...v6.1.0) (2019-05-27)
165
-
166
- ### Bug Fixes
167
-
168
- * Fix the missing function object (Parser) in the main module exports ([eb892aa](https://github.com/prantlf/jsonlint/commit/eb892aab516754ec3bf2eb01ff575fe0c173a510))
169
- * Restore context options (yy) set in the Parser constructor after the call to parse, if the options were overridden by the method arguments ([787c350](https://github.com/prantlf/jsonlint/commit/787c350c201ac0971e42d5b9f224689600e5c11f))
170
-
171
- ### Features
172
-
173
- * Use the native JSON parser if a limited error information is enough ([8aa9fb1](https://github.com/prantlf/jsonlint/commit/8aa9fb10d6c6f7f148d8c7816cc73d6b8385aace))
174
-
175
- # [6.0.0](https://github.com/prantlf/jsonlint/compare/v5.0.0...v6.0.0) (2019-05-26)
176
-
177
- ### Features
178
-
179
- * Declare modules in this package using UMD ([d442583](https://github.com/prantlf/jsonlint/commit/d4425837cea5c11352f988e3723455b8d8f5115b))
180
- * Remove ParserWithComments and parseWithComment from the interface ([3fab374](https://github.com/prantlf/jsonlint/commit/3fab374a0675a699dab3e8aed3bcf928b77fffe4))
181
-
182
- ### BREAKING CHANGES
183
-
184
- * The object and the method do not exist any more. Pass the parameter "ignoreComments" as an object `{ ignoreComments: true }` either to the constructor of the `Parser` object, or as the second parameter to the method `parse`.
185
-
186
- # [5.0.0](https://github.com/prantlf/jsonlint/compare/v4.0.2...v5.0.0) (2019-05-26)
187
-
188
- ### Bug Fixes
189
-
190
- * Do not export "main" method, which requires other NPM modules ([d8af36a](https://github.com/prantlf/jsonlint/commit/d8af36ac292c68b0ee35460a5e7394a26fad4524))
191
-
192
- ### Features
193
-
194
- * Accept single quotes (apostrophes) as string delimiters ([240b8cd](https://github.com/prantlf/jsonlint/commit/240b8cd916b7424e27f7ff585ca30512e87a6566))
195
-
196
- ### BREAKING CHANGES
197
-
198
- * The "main" method providing a command-line interface importable from other module has been removed. If you used it, have a look at the command-line interface in `lib/cli`. You can import this module in instead and it offers a richer interface, than the previously exported "main" method. The `lib/cli` module is mapped to `bin/jsonlint` too. However, consider the default library export (`lib/jsonlint`) for programmatic usage. You will pack less JavaScript code and use smalker, mode programmer-oriented interface.
199
-
200
- ## [4.0.2](https://github.com/prantlf/jsonlint/compare/v4.0.1...v4.0.2) (2019-05-19)
201
-
202
- ### Bug Fixes
203
-
204
- * Print parsing errors if the JSON input is read from stdin ([acfdf11](https://github.com/prantlf/jsonlint/commit/acfdf11e11a8f355cdd8fd1abf09edde664d8c02))
205
-
206
- ## [4.0.1](https://github.com/prantlf/jsonlint/compare/v4.0.0...v4.0.1) (2019-05-19)
207
-
208
- ### Bug Fixes
209
-
210
- * Do not fail sorting objects with a property called "hasOwnProperty" ([b544ceb](https://github.com/prantlf/jsonlint/commit/b544ceb54d44e8273dd7a1d28fc7f69a527fd806))
211
-
212
- # [4.0.0](https://github.com/prantlf/jsonlint/compare/v3.0.0...v4.0.0) (2019-05-19)
213
-
214
- ### Bug Fixes
215
-
216
- * Standardize the interface of the "jsonlint/lib/formatter" module ([b8b041b](https://github.com/prantlf/jsonlint/commit/b8b041bcc0e6ea672ec4575c5b108f347cfef69a))
217
-
218
- ### Features
219
-
220
- * Add web and programmatic interfaces to JSON Schema validation ([d45b243](https://github.com/prantlf/jsonlint/commit/d45b243bf1d083df58d9959d42eb3a787f5e7d89))
221
-
222
- ### BREAKING CHANGES
223
-
224
- * The formatting method is exposed not as exports.formatter.formatJson, but as exports.format.
225
- This module is not documented and it is unlikely, that it broke other project.
226
-
227
- # [3.0.0](https://github.com/prantlf/jsonlint/compare/v2.0.1...v3.0.0) (2019-05-18)
228
-
229
- ### Bug Fixes
230
-
231
- * Replace JSON schema validator JSV with ajv, because JSV is not maintained any more and does not support current JSON schema drafts ([1a4864f](https://github.com/prantlf/jsonlint/commit/1a4864f63ba14cb86a4e677fc23e5c1e963d2e07))
232
-
233
- ### BREAKING CHANGES
234
-
235
- * The environment for the JSON schema validation "json-schema-draft-03" is not available any more.
236
- Migrate your schemas from the JSON schema draft 03 to 04 or newer. Drafts 04, 06 and 07 are supported with this release.
237
-
238
- ## [2.0.1](https://github.com/prantlf/jsonlint/compare/v2.0.0...v2.0.1) (2019-05-18)
239
-
240
- ### Bug Fixes
241
-
242
- * Do not depend on the standard checker in the release package ([1e9c7b5](https://github.com/prantlf/jsonlint/commit/1e9c7b5b5c091332270dbe6b2203fd66644bf355))
243
-
244
- # [2.0.0](https://github.com/prantlf/jsonlint/compare/v1.7.0...v2.0.0) (2019-05-18)
245
-
246
- ### Bug Fixes
247
-
248
- * Accept any file extension on the command line directly ([14ba31c](https://github.com/prantlf/jsonlint/commit/14ba31cf5adc0ddb24d6c318866b6bf9a3c6ae48))
249
- * Do not distribute the web directory in the npm module ([7379be8](https://github.com/prantlf/jsonlint/commit/7379be83e3dc511785c4506e8ab55b77e014724e))
250
- * Make the compact-errors mode working with the latest Jison output ([d417a9c](https://github.com/prantlf/jsonlint/commit/d417a9c39047be929b9f7589da9c2d3c188db7f9))
251
- * Rename the long name of the option "extension" to "extensions" ([383e50a](https://github.com/prantlf/jsonlint/commit/383e50a6a00ee4641f8ae863b46e1af7bade7ee9))
252
- * Replace nomnom as command-line parser with commander, which is maintaitained ([6694bba](https://github.com/prantlf/jsonlint/commit/6694bba56fc821cbe2622340c9753506fa026580))
253
- * Report the right file name in the compact-errors mode, if multiple files or directories are engtered ([7c80326](https://github.com/prantlf/jsonlint/commit/7c80326a69a8df8f1f7ea66dced4a888ea321d9b))
254
-
255
- ### Features
256
-
257
- * Add a checkbox to recognize JavaScript-style comments to the web page ([2a9082a](https://github.com/prantlf/jsonlint/commit/2a9082a26d1316a80ebf132d159e5bf49c3d0978))
258
- * Support parsing and skipping JavaScript-style comments in the JSON input ([4955c58](https://github.com/prantlf/jsonlint/commit/4955c58788dd3b8c3a7a4358cbf65af72a353d0d))
259
-
260
- ### BREAKING CHANGES
261
-
262
- * The options "extension" is not recognized any more.
263
- Use the option "extensions" with the same semantics instead.
264
-
265
- # [1.7.0](https://github.com/prantlf/jsonlint/compare/v1.6.4...v1.7.0) (2019-05-18)
266
-
267
- ### Features
268
-
269
- * Allow specifying JSON file extensions for directory walk ([d8e8076](https://github.com/prantlf/jsonlint/commit/d8e8076edb831a577f5e272a5ea9e4edd077671b))
270
-
271
- This is the first version released after forking the [original project](https://github.com/zaach/jsonlint).