CoreFiles by mySites.guru
codemirror-lang-json.min.js1 lines, 999 bytes, from Joomla_5.0.0-alpha4-Alpha-Full_Package.zip
Raw History Compare with 5.0.0-alpha3
md5
2bdf8a1017d0272693a102165876c2fe
sha1
c21df13297028be56f80ed1e8a2b3468c3228db9
sha256
5da6f5d72d016de7176818299a68af54e4d00b889d577c3374bdb79b92f22014
import{parser}from"@lezer/json";import{LRLanguage,indentNodeProp,continuedIndent,foldNodeProp,foldInside,LanguageSupport}from"@codemirror/language";const jsonParseLinter=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(n){if(!(n instanceof SyntaxError))throw n;const o=getErrorPosition(n,e.state.doc);return[{from:o,message:n.message,severity:"error",to:o}]}return[]};function getErrorPosition(e,n){let o;return(o=e.message.match(/at position (\d+)/))?Math.min(+o[1],n.length):(o=e.message.match(/at line (\d+) column (\d+)/))?Math.min(n.line(+o[1]).from+ +o[2]-1,n.length):0}const jsonLanguage=LRLanguage.define({name:"json",parser:parser.configure({props:[indentNodeProp.add({Object:continuedIndent({except:/^\s*\}/}),Array:continuedIndent({except:/^\s*\]/})}),foldNodeProp.add({"Object Array":foldInside})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function json(){return new LanguageSupport(jsonLanguage)}export{json,jsonLanguage,jsonParseLinter};

The same content is in 8 releases, Joomla 5.0.0-alpha3 to 5.0.0. See them all, or every version of this file.