Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="header"><h1>UCS Filenames Checker</h1><div><a href="https://universalcategorysystem.com/"><img src="https://www.extremraym.com/wp-content/uploads/2024/03/UCS_maroon-50x50.png"></a></div></div>
<p>Short URL access: <a href="https://www.extremraym.com/ucs-checker">https://www.extremraym.com/ucs-checker</a></p>
<p>Promoted on <a href="https://sonofex.com/">Sonofex</a> newsletter. Detailed article on <a href="https://www.extremraym.com/en/my-ucs-filename-checker-showcased-in-sonofex-newsletter/">extremraym</a> website.</p>
<h2>Instructions</h2>
<p>This webapp allows to check if a list of file names fit the <a href="https://universalcategorysystem.com/">Universal Category System</a> standard (v8.2.1).</p>
<pre><code><span class="pattern-mandatory">CatID</span><span class="pattern-optional">(-UserCat)</span><span class="pattern-separator">_</span><span class="pattern-optional">(VendorCat-)</span><span class="pattern-mandatory">FXName</span><span class="pattern-separator">_</span><span class="pattern-mandatory">CreatorID</span><span class="pattern-optional>">(_SourceID(_UserNotes))</span><span class="pattern-extension">.ext</span></code></pre>
<h2>Input</h2>
<p>Paste a list audio files names below.</p>
<textarea id="textarea-input" spellcheck="false" placeholder="BELLMisc-UserCat_VendorCat-FXName 01_Creator ID_SourceID_UserNotes.wav
WIND_Short Cat ID_Creator ID_SourceID_UserNotes.wav
BELLMisc-UserCat_VendorCat-FXName 1_Creator ID_SourceID_UserNotes.wav
BELLMisc-UserCat_VendorCat-FXName 01_Creator ID_SourceID_UserNotes.sound
BELLMisc_Metalic Carillon_Test Test_MagicCS_Test_Test_Test.wav
BELLMisc_Small Carillon_01_MagicCS_UserNotes.wav
BELLMisc_Small Carillon_EXTREM RAYM_MagicCS_UserNotes.wav
MAGSpel_Teleportation_ExtremRaym_MagicCS.wav
MAGSpel_Teleportation_Extrem Raym._MagicCS.wav
BELLMisc-UserCat_VendorCat-FXName 01_CreatorID_SourceID_UserNotes.wav
MAGSpil_Teleportation_XR_MagicCS.wav"></textarea>

<button id="button-process">Process</button>

<div id="output-container">
  <h2 id="output">Output</h2>
  <p id="output-log"></p>
  <table id="output-table">
    <thead>
      <tr id="output-table-head">
        <th class="report">ID</th>
        <th class="report">Original</th>
        <th class="report">Valid</th>
        <th class="report">Log</th>
        <th>CatShort</th>
        <th>SubCatShort</th>
        <th class="optional">UserCat</th>
        <th class="optional">VendorCat</th>
        <th>FXName</th>
        <th class="optional">Variation</th>
        <th>CreatorID</th>
        <th class="semi-optional">SourceID</th>
        <th class="optional">UserNotes</th>
        <th class="extension">Ext</th>
      </tr>
    </thead>
    <tbody id="output-table-body"></tbody>
  </table>
</div>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
}

body {
  background: #333333;
  color: white;
  font-family: Helvetica, sans-serif;
}

.header {
  display: flex;
  justify-content: space-between;
}

p {
  line-height: 1.5em;
}

pre {
  padding: 1em;
  background: #AA6600;
  border: 0;
  width: 100%;
  white-space: pre-wrap;
  overflow-x: auto;
}

code {
  font-family: Helvetica;
}

.output-container {
  display: none;
}

#textarea-input {
  display: block;
  padding: 1em 1em;
  width: 100%;
  height: 20vw;
  margin:auto;
  border: 1px solid rgba(0,0,0,0);
  margin-bottom: 1em;
  background: #262626;
  color: white;
  font-size: 1.1em;
  line-height: 1.5em;
}

#textarea-input:focus {
    outline: none;
    border: 1px solid black;
  }

#button-process {
  display:block;
  margin:auto;
  width: 50%;
  padding: 0;
  border: 1px solid black;
  padding: 0.5em;
  margin-bottom: 3em;
  background: #222222;
  color: white;
}

#button-process:hover{
  cursor: pointer;
  background-color: #555555;
}

a {
  color: #CC8822
}

a:hover {
  color: #AA6600;
}

table {
  width: 100%;
  border-spacing: 0;
  background: #262626;
  /* No collapse cause this isn't*/
  border-collapse: separate;
  border-right: 1px solid #111111;
  border-top: 1px solid #111111;
}

/* Sticky on tope of page table header */
/* https://usefulangle.com/post/262/html-table-fixed-header-with-css */


thead {
  position: sticky;
  top: 0;
}

tbody {
  font-size: 0.9em;
}

th {
  background: #444477;
  height: 3em;
}

th.optional {
  background: #444444;
}

th.semi-optional {
  background: #555522;
}

th.extension {
  background: #663333;
}

th.report {
  background: #335533;
}

tbody tr:hover {
  background: #555555;
}

td, th {
  border-left: 1px solid #111111;
  border-bottom: 1px solid #111111;
  padding: 0.2em;
}

tr.error {
  background: #552222;
}

/*table {
  white-space: nowrap;
}*/

tr td:nth-child(11) {
  white-space: nowrap;
}

table td:nth-child(3) {
  text-align: center;
}

table td:nth-child(1) {
  text-align: right;
}

tr.warning {
  background: #404022;
}

pre code .pattern-mandatory, pre code .pattern-separator, pre code .pattern-extension {
  font-weight: bold;
}
              
            
!

JS

              
                console.clear()

var elm_button_process = document.getElementById( "button-process" )
var elm_input = document.getElementById( "textarea-input" )
var elm_output_container = document.getElementById( "output-container" )
var elm_output_log = document.getElementById( "output-log" )
var elm_output_table = document.getElementById( "output-table" )
var elm_output_table_body = document.getElementById( "output-table-body" )
var elm_output_table_head = document.querySelectorAll( "th" )

elm_button_process.addEventListener("click", Process )

var keys = []
for( i = 0; i < elm_output_table_head.length; i++) {
  keys.push( elm_output_table_head[i].innerText )
}

var valid_exts = { wav: true, mp3: true, ogg: true, aif: true }

var arr_needed = ["CatShort","SubCatShort","FXName","CreatorID","Ext"]
function Process(e) {
  elm_output_container.style.display = "block"
  
  if( elm_input.value === "" ) elm_input.value = elm_input.placeholder
  
  let arr_out = []
  let arr_lines = elm_input.value.split("\n")
  
  // Remove Empty Lines at End
  for( let i = arr_lines.length-1; i>0; i-- ){
    if( arr_lines[i] === "" ) {
      arr_lines.pop(i)
    } else {
      break
    }
  }
  
  let count = 0
  var error_count = 0
  var warning_count = 0
  for( let line of arr_lines) {
    
    // Fill with default values
    let entry = [];
    for( let i= 0; i<keys.length; i++) {
      entry[i] = "";
    }
    entry.Valid = "✅" // Or ✔️
    let class_log = ""
    entry.Original = line.replaceAll( " ", "&nbsp;" ).replaceAll( "-", "&#8209;" ).replaceAll( "_", "_<wbr>" )
    
    // Increment
    count++
    entry.ID = count
    
    // File Name and Extension
    let file = getFilenameAndExtension(line)
    if( file.name === undefined || file.name === "" ) {
      file.name = file.ext
      file.ext = ""
    }
    entry.Ext = file.ext
    if( valid_exts[ entry.Ext ] === undefined ) {
      entry.Valid = "❌"
      entry.Log = entry.Ext.length > 0 ? "Wrong extension" : "No extension"
      entry.Ext = "❌&nbsp;" + entry.Ext
    }
    
    // Split Blocks
    let blocks = file.name.split("_")
    let matches
    
    // Blocks[0] - CatID, SubCatId, UserCat
    let cat = blocks[0].split("-") // Check User Cat
    entry.CatShort = cat[0]
    matches = cat[0].match(/(.+)([A-Z][a-z]+)/)
    if( matches !== null ) {
      entry.CatShort = matches[1]
      entry.SubCatShort = matches[2]
    }
    if( cat[1] !== undefined ) entry.UserCat = cat[1]
    if( entry.SubCatShort === undefined ) entry.SubCatShort = ""
    
    // Blocks[1] - FX Name, Variation
    if( blocks[1] ) {
      entry.FXName = blocks[1]
      matches = blocks[1].match(/(.+) (\d+)$/)
      // Variation
      if( matches !== null ) {
        entry.FXName = matches[1]
        entry.Variation = matches[2]
        if( entry.Variation.length < 2 ){
          entry.Valid = "❌"
          entry.Log = "Variation ID is too short"
          entry.Variation = "❌&nbsp;" + entry.Variation
        }
      }
      // Vendor Cat
      matches = entry.FXName.match(/(.+)-(.+)/)
      if( matches !== null ) {
        entry.FXName = matches[2]
        entry.VendorCat = matches[1]
      }
    }
    
    // Blocks[2] - CreatorID
    if( blocks[2] ) {
      entry.CreatorID = blocks[2]
      // Check if only numbers
      if( entry.CreatorID.match( /^(\d+)$/ ) !== null ) {
        entry.Valid = "❌"
        entry.Log = "Creator ID is just numbers"
        entry.CreatorID = "❌&nbsp;" + entry.CreatorID
      }
      if( entry.Valid === "✅" ) {
        WarningCheck( entry, "CreatorID", /\s/, false, "Creator ID has no spaces")
        WarningCheck( entry, "CreatorID", /\./, true, "Creator ID has a dot character")
        WarningCheck( entry, "CreatorID", /^[A-Z|\s]+$/, true, "Creator ID is only uppercase")
      }
    }

    // Blocks[2] - SourceID
    if( blocks[3] ) entry.SourceID = blocks[3]
    
    // Blocks[4] - UserNotes
    if( blocks[4] ) entry.UserNotes = blocks[4]
    
    // Check Missing Necessary Fields
    for( let id of arr_needed) {
      if( entry[id] === undefined || entry[id] === "" ) {
        if( ! id === "SubCatShort" || ! cats_ids_nosubcat[entry.CatShort] ) {
          entry.Valid = "❌"
          entry[id] = "❌"
          entry.Log = "Missing necessary field"
        }
      }
    }
    
    // Extra Checks
    if( blocks.length > 5 ) {
      entry.Valid = "❌"
      entry.Log = "Too many underscores"
    }
    
    if( entry.Valid !== "❌" && cats_ids_key[ entry.CatShort + entry.SubCatShort ] !== true ) {
      entry.Valid = "⚠️"
      entry.Log = "Unknown CatID"
    }
    
    // Flag Errors
    if( entry.Valid === "❌" ) {
      error_count++
      class_log = ' class="error"'
    }
    
    if( entry.Valid === "⚠️" ) {
      warning_count++
      class_log = ' class="warning"'
    }
    
    let row = []
    keys.map( k => row.push( entry[k] ) )
    
    let str = "<tr" + class_log + "><td>" + row.join("</td><td>") + "</td></tr>"
    arr_out.push( str )
  }
  
  // Global Output
  elm_output_table_body.innerHTML = arr_out.join("\n")
  
  let issues = error_count > 1 ? " issues " : " issue "
  let warnings = warning_count > 1 ? " warnings " : " warning "
  
  let error_log = error_count > 0 ? "❌ " + error_count + issues + " found!" : "✅ Formatting is good! Please double check the output for case issues, mispelling errors and erronous data."
  let warning_log = warning_count > 0 ? "⚠️ " + warning_count + warnings + " found. Inspection is needed." : ""
  
  elm_output_log.innerText = error_log + "\n" + warning_log
}

// https://stackoverflow.com/questions/48164648/extract-filename-and-extension-in-js // MODIFIED
function getFilenameAndExtension(pathfilename){
  var filenameextension = pathfilename.replace(/^.*[\\\/]/, '')
  var filename = filenameextension.substring(0, filenameextension.lastIndexOf('.'))
  var ext = filenameextension.split('.').pop()
  return {name: filename, ext: ext}
}

function WarningCheck( entry, k, re, val, log ) {
  if( re.test( entry[k] ) === val ) {
    if( entry.Valid === "✅" ) {
      entry[k] = "⚠️&nbsp;" + entry[k]
      entry.Valid = "⚠️"
    }
    entry.Log = log
  }
}

// UCS 8.2
var cats_ids = [ "AIRBlow", "AIRBrst", "AIRHiss", "AIRMisc", "AIRSuck", "AERODoor", "AEROHeli", "AEROInt", "AEROJet", "AEROMech", "AEROMil", "AEROMisc", "AEROProp", "AERORadio", "AERORckt", "ALRMBell", "ALRMBuzr", "ALRMClok", "ALRMElec", "ALRMMisc", "ALRMSirn", "AMBAir", "AMBAlpn", "AMBAmus", "AMBBird", "AMBCele", "AMBCnst", "AMBDsrt", "AMBDsgn", "AMBEmrg", "AMBFant", "AMBFarm", "AMBForst", "AMBGras", "AMBHist", "AMBTech", "AMBHosp", "AMBInd", "AMBInsc", "AMBLake", "AMBMrkt", "AMBMisc", "AMBNaut", "AMBOffc", "AMBPark", "AMBPrisn", "AMBPrtst", "AMBPubl", "AMBRlgn", "AMBHome", "AMBRest", "AMBRoom", "AMBRurl", "AMBSchl", "AMBSci", "AMBSea", "AMBSprt", "AMBSubn", "AMBSwmp", "AMBTown", "AMBTraf", "AMBTran", "AMBTrop", "AMBTndra", "AMBUndr", "AMBUndwtr", "AMBUrbn", "AMBWar", "ANMLAmph", "ANMLAqua", "ANMLBat", "ANMLCat", "ANMLWcat", "ANMLDog", "ANMLWdog", "ANMLFarm", "ANMLHors", "ANMLInsc", "ANMLMisc", "ANMLPrim", "ANMLRept", "ANMLRdnt", "ANMLWild", "ADR", "ASSET", "BNCE", "IR", "LPGRP", "MIX", "PFX", "PROD", "RAW", "REF", "SCNE", "TEST", "TMARK", "WIP", "WTF", "BEEPAppl", "BEEP", "BEEPLofi", "BEEPMed", "BEEPTimer", "BEEPVeh", "BELLAnml", "BELLDoor", "BELLGong", "BELLHand", "BELLLrg", "BELLMisc", "BIRDPrey", "BIRDCrow", "BIRDFowl", "BIRDMisc", "BIRDSea", "BIRDSong", "BIRDTrop", "BIRDWade", "BOATAir", "BOATWash", "BOATDoor", "BOATElec", "BOATFish", "BOATHorn", "BOATInt", "BOATMech", "BOATMil", "BOATMisc", "BOATMotr", "BOATRace", "BOATRow", "BOATSail", "BOATShip", "BOATStm", "BOATSub", "BOATUndwtr", "BLLTBy", "BLLTImpt", "BLLTMisc", "BLLTRico", "BLLTShel", "TOONAnml", "TOONBoing", "TOONClang", "TOONCreak", "TOONHorn", "TOONImpt", "TOONMach", "TOONMisc", "TOONMx", "TOONPluk", "TOONPop", "TOONShake", "TOONSplt", "TOONSqk", "TOONStrch", "TOONSwsh", "TOONTwang", "TOONVeh", "TOONVox", "TOONWarb", "TOONWhis", "TOONZip", "CERMBrk", "CERMCrsh", "CERMFric", "CERMHndl", "CERMImpt", "CERMMisc", "CERMMvmt", "CERMTonl", "CHAINBrk", "CHAINHndl", "CHAINImpt", "CHAINMisc", "CHAINMvmt", "CHEMAcid", "CHEMMisc", "CHEMReac", "CLOCKChim", "CLOCKMech", "CLOCKMisc", "CLOCKTick", "CLOTHFlp", "CLOTHHndl", "CLOTHImpt", "CLOTHMisc", "CLOTHMvmt", "CLOTHRip", "COMAv", "COMCam", "COMCell", "COMMic", "COMMisc", "COMPhono", "COMRadio", "COMStatic", "COMTelm", "COMTelph", "COMTv", "COMTran", "COMType", "CMPTDriv", "CMPTKey", "CMPTMisc", "CREAAqua", "CREAAvian", "CREABeast", "CREABlob", "CREADino", "CREADrgn", "CREAElem", "CREAEthr", "CREAHmn", "CREAInsc", "CREAMisc", "CREAMnstr", "CREARept", "CREASmall", "CREASrce", "CRWDAngr", "CRWDApls", "CRWDBatl", "CRWDCele", "CRWDCheer", "CRWDChld", "CRWDConv", "CRWDLaff", "CRWDLoop", "CRWDMisc", "CRWDPanic", "CRWDQuiet", "CRWDReac", "CRWDSing", "CRWDSprt", "CRWDWalla", "DSGNBass", "DSGNBoom", "DSGNBram", "DSGNDist", "DSGNDron", "DSGNErie", "DSGNEthr", "DSGNGran", "DSGNImpt", "DSGNMisc", "DSGNMorph", "DSGNRise", "DSGNRmbl", "DSGNRythm", "DSGNSrce", "DSGNStngr", "DSGNSynth", "DSGNTonl", "DSGNVocl", "DSGNWhsh", "DESTRClpse", "DESTRCrsh", "DESTRMisc", "DIRTCrsh", "DIRTDust", "DIRTHndl", "DIRTImpt", "DIRTMisc", "DIRTMvmt", "DIRTTonl", "DOORAntq", "DOORAppl", "DOORCab", "DOORComp", "DOORCreak", "DOORDungn", "DOORElec", "DOORGate", "DOORGlas", "DOORHdwr", "DOORTech", "DOORHydr", "DOORKnck", "DOORMetl", "DOORMisc", "DOORPlas", "DOORPrisn", "DOORRevl", "DOORSlid", "DOORSton", "DOORSwng", "DOORWood", "DRWRMetl", "DRWRMisc", "DRWRPlas", "DRWRWood", "ELECArc", "ELECBuzz", "ELECEmf", "ELECMisc", "ELECSprk", "ELECZap", "EQUIPBridle", "EQUIPTech", "EQUIPMisc", "EQUIPRec", "EQUIPSprt", "EQUIPTact", "EXPLDsgn", "EXPLMisc", "EXPLReal", "FARTDsgn", "FARTMisc", "FARTReal", "FGHTBf", "FGHTClth", "FGHTGrab", "FGHTImpt", "FGHTMisc", "FIREBurn", "FIREBrst", "FIRECrkl", "FIREGas", "FIREIgn", "FIREMisc", "FIRESizz", "FIRETrch", "FIRETurb", "FIREWhsh", "FRWKComr", "FRWKMisc", "FRWKRec", "FOLYClth", "FOLYFeet", "FOLYHand", "FOLYMisc", "FOLYProp", "FOODCook", "FOODDrnk", "FOODEat", "FOODGware", "FOODIngr", "FOODKware", "FOODMisc", "FOODPour", "FOODTware", "FEETAnml", "FEETCrea", "FEETHors", "FEETHmn", "FEETMisc", "GAMEArcd", "GAMEBoard", "GAMECas", "GAMEMisc", "GAMEVideo", "GEOFuma", "GEOGeyser", "GEOLava", "GEOMisc", "GEOMudpot", "GLASBrk", "GLASCrsh", "GLASFric", "GLASHndl", "GLASImpt", "GLASMisc", "GLASMvmt", "GLASTonl", "GOREBlood", "GOREBone", "GOREBurn", "GOREFlsh", "GOREMisc", "GOREOoze", "GORESrce", "GORESplt", "GORESqsh", "GOREStab", "GUNAntq", "GUNArtl", "GUNAuto", "GUNCano", "GUNHndl", "GUNTech", "GUNMech", "GUNMisc", "GUNPis", "GUNRif", "GUNShotg", "GUNSupr", "HORNAir", "HORNCele", "HORNMisc", "HORNTrad", "HMNBlow", "HMNBrth", "HMNBurp", "HMNCough", "HMNHart", "HMNKiss", "HMNMisc", "HMNPee", "HMNSkin", "HMNSneez", "HMNSniff", "HMNSnor", "HMNSpit", "HMNVomit", "ICEBrk", "ICECrsh", "ICEFric", "ICEHndl", "ICEImpt", "ICEMisc", "ICEMvmt", "ICETonl", "LASRBeam", "LASRGun", "LASRImpt", "LASRMisc", "LETHRCreak", "LETHRHndl", "LETHRImpt", "LETHRMisc", "LETHRMvmt", "LIQBubl", "LIQImpt", "LIQMisc", "LIQMvmt", "LIQSuct", "MACHAmus", "MACHAntq", "MACHAppl", "MACHCnst", "MACHElev", "MACHEscl", "MACHFan", "MACHGrdn", "MACHGym", "MACHTech", "MACHHvac", "MACHInd", "MACHMech", "MACHMed", "MACHMisc", "MACHOffc", "MACHPump", "MAGAngl", "MAGElem", "MAGEvil", "MAGMisc", "MAGPoof", "MAGShim", "MAGSpel", "MECHClik", "MECHGear", "MECHHydr", "MECHLtch", "MECHLvr", "MECHLock", "MECHMisc", "MECHPuly", "MECHRtch", "MECHRelay", "MECHRolr", "MECHSwtch", "METLBrk", "METLCrsh", "METLFric", "METLHndl", "METLImpt", "METLMisc", "METLMvmt", "METLTonl", "MOTRAntq", "MOTRComb", "MOTRElec", "MOTRMisc", "MOTRSrvo", "MOTRTurb", "MOVEActv", "MOVEAnml", "MOVECrea", "MOVECrwd", "MOVEHmn", "MOVEInsc", "MOVEMisc", "MOVEPres", "MUSCBell", "MUSCBrass", "MUSCChim", "MUSCChor", "MUSCExpr", "MUSCInst", "MUSCKeyd", "MUSCLoop", "MUSCMisc", "MUSCPerc", "MUSCTnprc", "MUSCPrfm", "MUSCPluck", "MUSCSmpl", "MUSCShake", "MUSCSong", "MUSCStngr", "MUSCStr", "MUSCSynth", "MUSCToy", "MUSCWind", "NATDAval", "NATDQuak", "NATDMisc", "NATDTorn", "NATDTsun", "NATDThyp", "NATDVolc", "OBJBag", "OBJBook", "OBJCoin", "OBJCont", "OBJFash", "OBJFurn", "OBJGrdn", "OBJGym", "OBJHsehld", "OBJJewl", "OBJKey", "OBJLug", "OBJMed", "OBJMisc", "OBJOffc", "OBJPack", "OBJTape", "OBJUmbr", "OBJWhled", "OBJWrite", "OBJZipr", "PAPRFltr", "PAPRFric", "PAPRHndl", "PAPRImpt", "PAPRMisc", "PAPRRip", "PAPRTonl", "PLASBrk", "PLASCrsh", "PLASFric", "PLASHndl", "PLASImpt", "PLASMisc", "PLASMvmt", "PLASTonl", "RAINClth", "RAINConc", "RAIN", "RAINGlas", "RAINInt", "RAINMetl", "RAINPlas", "RAINVege", "RAINWatr", "RAINWood", "ROBTMisc", "ROBTMvmt", "ROBTVox", "ROCKBrk", "ROCKCrsh", "ROCKFric", "ROCKHndl", "ROCKImpt", "ROCKMisc", "ROCKMvmt", "ROCKTonl", "ROPECreak", "ROPEHndl", "ROPEImpt", "ROPEMisc", "ROPEMvmt", "RUBRCrsh", "RUBRFric", "RUBRHndl", "RUBRImpt", "RUBRMisc", "RUBRMvmt", "RUBRTonl", "SCIAlrm", "SCICmpt", "SCIDoor", "SCIEnrg", "SCIImpt", "SCIMach", "SCIMech", "SCIMisc", "SCIRetro", "SCIShip", "SCIVeh", "SCIWeap", "SNOWCrsh", "SNOWFric", "SNOWHndl", "SNOWImpt", "SNOWMisc", "SNOWMvmt", "SPRTCourt", "SPRTField", "SPRTGym", "SPRTIndor", "SPRTMisc", "SPRTSkate", "SPRTTrck", "SPRTWatr", "SPRTWntr", "SWSH", "WHSH", "TOOLGrdn", "TOOLHand", "TOOLMisc", "TOOLPneu", "TOOLPowr", "TOYElec", "TOYMech", "TOYMisc", "TRNBrake", "TRNClak", "TRNDoor", "TRNDiesl", "TRNElec", "TRNHspd", "TRNHorn", "TRNInt", "TRNMech", "TRNMisc", "TRNSteam", "TRNSbwy", "TRNTram", "UIAlert", "UIBeep", "UIClick", "UIData", "UIGlitch", "UIMisc", "UIMvmt", "VEGEGras", "VEGELeaf", "VEGEMisc", "VEGETree", "VEHAlrm", "VEHAntq", "VEHAtv", "VEHBike", "VEHBrake", "VEHBus", "VEHCar", "VEHCnst", "VEHDoor", "VEHElec", "VEHEmrg", "VEHFarm", "VEHFrght", "VEHBy", "VEHHorn", "VEHInt", "VEHJalop", "VEHMech", "VEHMil", "VEHMisc", "VEHMoto", "VEHRace", "VEHSirn", "VEHSkid", "VEHSusp", "VEHTire", "VEHTruck", "VEHUtil", "VEHWagn", "VEHWndw", "VOXAlien", "VOXBaby", "VOXCheer", "VOXChld", "VOXCry", "VOXEfrt", "VOXFem", "VOXFutz", "VOXHist", "VOXLaff", "VOXMale", "VOXMisc", "VOXReac", "VOXScrm", "VOXSing", "VOXWhsp", "WATRBubl", "WATRDran", "WATRDrip", "WATRFizz", "WATRFlow", "WATRFoun", "WATRImpt", "WATRLap", "WATRMisc", "WATRMvmt", "WATRPlmb", "WATRPour", "WATRSplsh", "WATRSpray", "WATRStm", "WATRSurf", "WATRTurb", "WATRUndwtr", "WATRFall", "WATRWave", "WEAPArmr", "WEAPArro", "WEAPAxe", "WEAPBlnt", "WEAPBow", "WEAPKnif", "WEAPMisc", "WEAPPole", "WEAPSiege", "WEAPSwrd", "WEAPWhip", "HAIL", "WTHR", "STORM", "THUN", "WHSTHmn", "WHSTMech", "WHSTMisc", "WINDDsgn", "WIND", "WINDGust", "WINDInt", "WINDTonl", "WINDTurb", "WINDVege", "WNDWCover", "WNDWHdwr", "WNDWKnck", "WNDWMetl", "WNDWMisc", "WNDWPlas", "WNDWWood", "WINGBird", "WINGCrea", "WINGInsc", "WINGMisc", "WOODBrk", "WOODCrsh", "WOODFric", "WOODHndl", "WOODImpt", "WOODMisc", "WOODMvmt", "WOODTonl" ]

var cats_ids_key = {} // cats_ids.map( k => cats_ids_key[k] = true )
var cats_ids_nosubcat = {} // Some CatID doesn't have SubCatShort
var re_only_uppercase = /^[A-Z]+$/
for( let k of cats_ids) {
  cats_ids_key[k] = true
  if( re_only_uppercase.test( k ) ) cats_ids_nosubcat[k] = true
}
              
            
!
999px

Console