{
  "definitions": [
    {
      "callable": true,
      "callees": [
        {
          "file": "core/converters/catalog.grammar.converter.ts",
          "name": "segmentMatches",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-catalog-grammar-converter-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/converters/catalog.grammar.converter.ts",
            "label": "core/converters/catalog.grammar.converter.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/converters/catalog.grammar.converter.ts.md",
            "ref": "anatomy:file-build-scripts-core-converters-catalog-grammar-converter-ts"
          }
        }
      ],
      "callers": [
        {
          "file": "core/converters/catalog.grammar.converter.ts",
          "name": "matchesTemplate",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-catalog-grammar-converter-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/converters/catalog.grammar.converter.ts",
            "label": "core/converters/catalog.grammar.converter.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/converters/catalog.grammar.converter.ts.md",
            "ref": "anatomy:file-build-scripts-core-converters-catalog-grammar-converter-ts"
          }
        }
      ],
      "exported": false,
      "flow": "relay",
      "kind": "lexical_declaration",
      "line": 121,
      "name": "segmentsMatch",
      "signature": "const segmentsMatch = function segmentsMatch("
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "core/converters/catalog.grammar.converter.ts",
          "name": "segmentsMatch",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-catalog-grammar-converter-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/converters/catalog.grammar.converter.ts",
            "label": "core/converters/catalog.grammar.converter.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/converters/catalog.grammar.converter.ts.md",
            "ref": "anatomy:file-build-scripts-core-converters-catalog-grammar-converter-ts"
          }
        }
      ],
      "callers": [
        {
          "file": "core/converters/catalog.grammar.converter.ts",
          "name": "grammarRows",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-catalog-grammar-converter-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/converters/catalog.grammar.converter.ts",
            "label": "core/converters/catalog.grammar.converter.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/converters/catalog.grammar.converter.ts.md",
            "ref": "anatomy:file-build-scripts-core-converters-catalog-grammar-converter-ts"
          }
        }
      ],
      "exported": true,
      "flow": "relay",
      "kind": "lexical_declaration",
      "line": 143,
      "name": "matchesTemplate",
      "signature": "export const matchesTemplate = function matchesTemplate(template: string, path: string): boolean {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "core/converters/catalog.grammar.converter.ts",
          "name": "segmentsMatch",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-catalog-grammar-converter-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/converters/catalog.grammar.converter.ts",
            "label": "core/converters/catalog.grammar.converter.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/converters/catalog.grammar.converter.ts.md",
            "ref": "anatomy:file-build-scripts-core-converters-catalog-grammar-converter-ts"
          }
        }
      ],
      "exported": false,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 106,
      "name": "segmentMatches",
      "signature": "const segmentMatches = function segmentMatches(pattern: string, value: string): boolean {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "core/validators/catalog.grammar.validator.ts",
          "name": "kindFindings",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-validators-catalog-grammar-validator-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/validators/catalog.grammar.validator.ts",
            "label": "core/validators/catalog.grammar.validator.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/validators/catalog.grammar.validator.ts.md",
            "ref": "anatomy:file-build-scripts-core-validators-catalog-grammar-validator-ts"
          }
        }
      ],
      "exported": true,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 165,
      "name": "kindOrNull",
      "signature": "export const kindOrNull = function kindOrNull(path: string): GrammarKind | null {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "configuration/strings/catalog.strings.ts",
          "name": "unknownAddress",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-configuration-strings-catalog-strings-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/configuration/strings/catalog.strings.ts",
            "label": "configuration/strings/catalog.strings.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/configuration/strings/catalog.strings.ts.md",
            "ref": "anatomy:file-build-scripts-configuration-strings-catalog-strings-ts"
          }
        }
      ],
      "callers": [],
      "exported": true,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 175,
      "name": "kindOfAddress",
      "signature": "export const kindOfAddress = function kindOfAddress(path: string): GrammarKind {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "core/converters/catalog.grammar.converter.ts",
          "name": "matchesTemplate",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-catalog-grammar-converter-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/converters/catalog.grammar.converter.ts",
            "label": "core/converters/catalog.grammar.converter.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/converters/catalog.grammar.converter.ts.md",
            "ref": "anatomy:file-build-scripts-core-converters-catalog-grammar-converter-ts"
          }
        }
      ],
      "callers": [],
      "exported": true,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 183,
      "name": "grammarRows",
      "signature": "export const grammarRows = function grammarRows(published: readonly string[]): readonly GrammarData[] {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 47,
      "name": "PLACEHOLDER",
      "signature": "const PLACEHOLDER = \"{\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 48,
      "name": "PLACEHOLDER_CLOSE",
      "signature": "const PLACEHOLDER_CLOSE = \"}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 49,
      "name": "SLASH",
      "signature": "const SLASH = \"/\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 50,
      "name": "PAGE",
      "signature": "const PAGE = \"{page}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 51,
      "name": "TAB",
      "signature": "const TAB = \"{tab}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 52,
      "name": "COLLECTION",
      "signature": "const COLLECTION = \"{collection}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 53,
      "name": "FIELD",
      "signature": "const FIELD = \"{field}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 54,
      "name": "TREE",
      "signature": "const TREE = \"{tree}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 55,
      "name": "SECTION",
      "signature": "const SECTION = \"{section}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 56,
      "name": "ID",
      "signature": "const ID = \"{id}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 57,
      "name": "VALUE",
      "signature": "const VALUE = \"{value}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 58,
      "name": "SLUG",
      "signature": "const SLUG = \"{slug}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 59,
      "name": "KIND",
      "signature": "const KIND = \"{kind}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 60,
      "name": "LETTER",
      "signature": "const LETTER = \"{letter}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 61,
      "name": "PART",
      "signature": "const PART = \"{part}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 62,
      "name": "GROUP",
      "signature": "const GROUP = \"{group}\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 63,
      "name": "PART_KIND",
      "signature": "const PART_KIND: GrammarKind = \"part\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 64,
      "name": "PARTS_KEEP_KIND",
      "signature": "const PARTS_KEEP_KIND: ReadonlySet<GrammarKind> = new Set([\"idsShard\"]);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 66,
      "name": "TEXT_ADDRESS",
      "signature": "const TEXT_ADDRESS: Address = { json: sourceText(TREE, PATH_PLACEHOLDER), markdown: null };"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 68,
      "name": "GRAMMAR",
      "signature": "export const GRAMMAR: readonly GrammarRow[] = ["
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 111,
      "name": "prefix",
      "signature": "const prefix = pattern.slice(0, open);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 112,
      "name": "suffix",
      "signature": "const suffix = pattern.slice(pattern.indexOf(PLACEHOLDER_CLOSE, open) + 1);"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 116,
      "name": "spans",
      "signature": "const spans = function spans(pattern: string): boolean {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 117,
      "name": "open",
      "signature": "const open = pattern.indexOf(PLACEHOLDER);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 129,
      "name": "pattern",
      "signature": "const pattern = patterns.at(at.pattern) ?? \"\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 131,
      "name": "end",
      "signature": "for (let end = at.value + 1; end <= last; end += 1) {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 132,
      "name": "consumed",
      "signature": "const consumed = values.slice(at.value, end).join(SLASH);"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 147,
      "name": "literalLength",
      "signature": "const literalLength = function literalLength(template: string): number {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 148,
      "name": "length",
      "signature": "let length = 0;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 149,
      "name": "inside",
      "signature": "let inside = false;"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 157,
      "name": "closestKind",
      "signature": "const closestKind = function closestKind(path: string): GrammarKind | null {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 158,
      "name": "matching",
      "signature": "const matching = GRAMMAR.filter((row) => matchesTemplate(row.address.json, path));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 159,
      "name": "ranked",
      "signature": "const ranked = matching.toSorted("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 166,
      "name": "last",
      "signature": "const last = path.slice(path.lastIndexOf(SLASH) + 1);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 167,
      "name": "base",
      "signature": "const base = last.startsWith(INDEX_PART_MARK) ? path.slice(0, path.lastIndexOf(SLASH)) : null;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 176,
      "name": "kind",
      "signature": "const kind = kindOrNull(path);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 184,
      "name": "served",
      "signature": "const served = new Set(published);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 186,
      "name": "template",
      "signature": "const template = row.address.json.includes(PLACEHOLDER);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 187,
      "name": "schema",
      "signature": "const schema = schemaLeaf(row.kind).json;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 188,
      "name": "described",
      "signature": "const described = served.has(schema) ? schema : null;"
    }
  ],
  "document": null,
  "findings": [],
  "generated": false,
  "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-catalog-grammar-converter-ts",
  "language": "typescript",
  "layer": "processing",
  "name": "catalog.grammar.converter.ts",
  "path": "core/converters/catalog.grammar.converter.ts",
  "ref": "anatomy:file-build-scripts-core-converters-catalog-grammar-converter-ts",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/build-scripts#folder-build-scripts-core-converters",
          "json": "https://banes-lab.com/json/anatomy/build-scripts/folder-build-scripts-core-converters",
          "label": "core/converters",
          "markdown": "https://banes-lab.com/anatomy/build-scripts/folder-build-scripts-core-converters.md",
          "ref": "chapter:/anatomy/build-scripts#folder-build-scripts-core-converters"
        }
      ],
      "relation": "contained-in"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-configuration-strings-catalog-strings-ts",
          "json": "https://banes-lab.com/json/source/build-scripts/configuration/strings/catalog.strings.ts",
          "label": "configuration/strings/catalog.strings.ts",
          "markdown": "https://banes-lab.com/source/build-scripts/configuration/strings/catalog.strings.ts.md",
          "ref": "anatomy:file-build-scripts-configuration-strings-catalog-strings-ts"
        }
      ],
      "relation": "uses"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-validators-catalog-grammar-validator-ts",
          "json": "https://banes-lab.com/json/source/build-scripts/core/validators/catalog.grammar.validator.ts",
          "label": "core/validators/catalog.grammar.validator.ts",
          "markdown": "https://banes-lab.com/source/build-scripts/core/validators/catalog.grammar.validator.ts.md",
          "ref": "anatomy:file-build-scripts-core-validators-catalog-grammar-validator-ts"
        }
      ],
      "relation": "used-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/build-scripts#folder-build-scripts-configuration-strings",
          "json": "https://banes-lab.com/json/anatomy/build-scripts/folder-build-scripts-configuration-strings",
          "label": "configuration/strings",
          "markdown": "https://banes-lab.com/anatomy/build-scripts/folder-build-scripts-configuration-strings.md",
          "ref": "chapter:/anatomy/build-scripts#folder-build-scripts-configuration-strings"
        },
        {
          "href": "https://banes-lab.com/anatomy/build-scripts#folder-build-scripts-core-converters",
          "json": "https://banes-lab.com/json/anatomy/build-scripts/folder-build-scripts-core-converters",
          "label": "core/converters",
          "markdown": "https://banes-lab.com/anatomy/build-scripts/folder-build-scripts-core-converters.md",
          "ref": "chapter:/anatomy/build-scripts#folder-build-scripts-core-converters"
        },
        {
          "href": "https://banes-lab.com/anatomy/build-scripts#folder-build-scripts-core-validators",
          "json": "https://banes-lab.com/json/anatomy/build-scripts/folder-build-scripts-core-validators",
          "label": "core/validators",
          "markdown": "https://banes-lab.com/anatomy/build-scripts/folder-build-scripts-core-validators.md",
          "ref": "chapter:/anatomy/build-scripts#folder-build-scripts-core-validators"
        }
      ],
      "relation": "linked-from"
    }
  ],
  "slots": {
    "concern": "converter",
    "subject": "catalog",
    "variant": "grammar"
  },
  "stats": {
    "bytes": 7334,
    "callable": 9,
    "definitions": 46,
    "edges": 4,
    "exported": 12,
    "files": 1,
    "findings": {},
    "flows": {
      "relay": 2,
      "leaf": 2,
      "entry": 2,
      "isolated": 40
    },
    "lines": {
      "blank": 12,
      "code": 187,
      "total": 199
    }
  },
  "summary": "187 lines of code and 46 definitions.",
  "text": "https://banes-lab.com/source/build-scripts/core/converters/catalog.grammar.converter.ts.txt",
  "tree": "build-scripts",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-check-converter-ts",
      "json": "https://banes-lab.com/json/source/build-scripts/core/converters/check.converter.ts",
      "label": "core/converters/check.converter.ts",
      "markdown": "https://banes-lab.com/source/build-scripts/core/converters/check.converter.ts.md",
      "ref": "anatomy:file-build-scripts-core-converters-check-converter-ts"
    },
    "previous": {
      "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-catalog-converter-ts",
      "json": "https://banes-lab.com/json/source/build-scripts/core/converters/catalog.converter.ts",
      "label": "core/converters/catalog.converter.ts",
      "markdown": "https://banes-lab.com/source/build-scripts/core/converters/catalog.converter.ts.md",
      "ref": "anatomy:file-build-scripts-core-converters-catalog-converter-ts"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/source/build-scripts/core/converters",
    "label": "core/converters",
    "markdown": "https://banes-lab.com/api/source/build-scripts/core/converters.md",
    "ref": "api:source/build-scripts/core/converters"
  }
}
