{
  "definitions": [
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "core/converters/search.index.converter.ts",
          "name": "searchLeaves",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-search-index-converter-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/converters/search.index.converter.ts",
            "label": "core/converters/search.index.converter.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/converters/search.index.converter.ts.md",
            "ref": "anatomy:file-build-scripts-core-converters-search-index-converter-ts"
          }
        }
      ],
      "exported": false,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 79,
      "name": "kindLeaves",
      "signature": "const kindLeaves = function kindLeaves(search: SearchKind, linker: Linker): readonly Leaf[] {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "core/resolvers/catalog.resolver.ts",
          "name": "indexPart",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-resolvers-catalog-resolver-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/resolvers/catalog.resolver.ts",
            "label": "core/resolvers/catalog.resolver.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/resolvers/catalog.resolver.ts.md",
            "ref": "anatomy:file-build-scripts-core-resolvers-catalog-resolver-ts"
          }
        },
        {
          "file": "core/resolvers/catalog.resolver.ts",
          "name": "searchKindIndex",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-resolvers-catalog-resolver-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/resolvers/catalog.resolver.ts",
            "label": "core/resolvers/catalog.resolver.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/resolvers/catalog.resolver.ts.md",
            "ref": "anatomy:file-build-scripts-core-resolvers-catalog-resolver-ts"
          }
        }
      ],
      "callers": [],
      "exported": false,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 58,
      "name": "rowParts",
      "signature": "const rowParts = function rowParts(kind: string, rows: readonly (readonly unknown[])[]): readonly Leaf[] {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "core/resolvers/catalog.resolver.ts",
          "name": "searchShard",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-resolvers-catalog-resolver-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/resolvers/catalog.resolver.ts",
            "label": "core/resolvers/catalog.resolver.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/resolvers/catalog.resolver.ts.md",
            "ref": "anatomy:file-build-scripts-core-resolvers-catalog-resolver-ts"
          }
        }
      ],
      "callers": [],
      "exported": false,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 43,
      "name": "shardLeaf",
      "signature": "const shardLeaf = function shardLeaf("
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "core/converters/search.index.converter.ts",
          "name": "kindLeaves",
          "source": {
            "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-search-index-converter-ts",
            "json": "https://banes-lab.com/json/source/build-scripts/core/converters/search.index.converter.ts",
            "label": "core/converters/search.index.converter.ts",
            "markdown": "https://banes-lab.com/source/build-scripts/core/converters/search.index.converter.ts.md",
            "ref": "anatomy:file-build-scripts-core-converters-search-index-converter-ts"
          }
        }
      ],
      "callers": [],
      "exported": true,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 101,
      "name": "searchLeaves",
      "signature": "export const searchLeaves = function searchLeaves("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 19,
      "name": "SEARCH_REF",
      "signature": "const SEARCH_REF = \"api:search\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 20,
      "name": "KIND_REF",
      "signature": "const KIND_REF = \"api:search/\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 21,
      "name": "REF_SEPARATOR",
      "signature": "const REF_SEPARATOR = \"/\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 22,
      "name": "COLUMNS",
      "signature": "const COLUMNS = [\"ref\", \"title\", \"position\"] as const;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 23,
      "name": "POSTING",
      "signature": "const POSTING = [\"row\", \"count\"] as const;"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 25,
      "name": "postingsOf",
      "signature": "const postingsOf = function postingsOf(entries: readonly SearchEntry[]): ReadonlyMap<string, [number, number][]> {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 28,
      "name": "counts",
      "signature": "const counts = new Map<string, number>();"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 39,
      "name": "rowOf",
      "signature": "const rowOf = function rowOf(entry: SearchEntry): readonly unknown[] {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 50,
      "name": "postings",
      "signature": "const postings = Object.fromEntries(words.toSorted(([left], [right]) => left.localeCompare(right)));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 61,
      "name": "number",
      "signature": "const number = index + 1;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 80,
      "name": "{ entries, kind }",
      "signature": "const { entries, kind } = search;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 81,
      "name": "prefixes",
      "signature": "const prefixes = prefixShards([...postingsOf(entries).entries()], INDEX_PART_BUDGET);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 82,
      "name": "shards",
      "signature": "const shards = [...prefixes.entries()].map(([prefix, words]) => shardLeaf(kind, prefix, words));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 83,
      "name": "ref",
      "signature": "const ref = KIND_REF + kind;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 85,
      "name": "addresses",
      "signature": "const addresses = Object.fromEntries("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 88,
      "name": "rows",
      "signature": "const rows = entries.map(rowOf);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 89,
      "name": "whole",
      "signature": "const whole = { columns: COLUMNS, kind, ref, rows, shards: addresses, title };"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 90,
      "name": "parted",
      "signature": "const parted = Buffer.byteLength(serialize(whole)) > CATALOG_FILE_BUDGET ? rowParts(kind, rows) : [];"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 91,
      "name": "parts",
      "signature": "const parts = parted.map((part) => linker.site + part.identity.address.json);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 92,
      "name": "data",
      "signature": "const data = parted.length === 0 ? whole : { ...whole, parts, rows: [] };"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 106,
      "name": "indexes",
      "signature": "const indexes = Object.fromEntries("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 112,
      "name": "title",
      "signature": "const title = SEARCH_INDEX_TITLE;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 113,
      "name": "head",
      "signature": "const head: Leaf = {"
    }
  ],
  "document": null,
  "findings": [],
  "generated": false,
  "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-search-index-converter-ts",
  "language": "typescript",
  "layer": "processing",
  "name": "search.index.converter.ts",
  "path": "core/converters/search.index.converter.ts",
  "ref": "anatomy:file-build-scripts-core-converters-search-index-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-core-resolvers-catalog-resolver-ts",
          "json": "https://banes-lab.com/json/source/build-scripts/core/resolvers/catalog.resolver.ts",
          "label": "core/resolvers/catalog.resolver.ts",
          "markdown": "https://banes-lab.com/source/build-scripts/core/resolvers/catalog.resolver.ts.md",
          "ref": "anatomy:file-build-scripts-core-resolvers-catalog-resolver-ts"
        }
      ],
      "relation": "uses"
    },
    {
      "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"
        },
        {
          "href": "https://banes-lab.com/anatomy/build-scripts#folder-build-scripts-core-resolvers",
          "json": "https://banes-lab.com/json/anatomy/build-scripts/folder-build-scripts-core-resolvers",
          "label": "core/resolvers",
          "markdown": "https://banes-lab.com/anatomy/build-scripts/folder-build-scripts-core-resolvers.md",
          "ref": "chapter:/anatomy/build-scripts#folder-build-scripts-core-resolvers"
        }
      ],
      "relation": "linked-from"
    }
  ],
  "slots": {
    "concern": "converter",
    "subject": "search",
    "variant": "index"
  },
  "stats": {
    "bytes": 4874,
    "callable": 6,
    "definitions": 27,
    "edges": 4,
    "exported": 4,
    "files": 1,
    "findings": {},
    "flows": {
      "leaf": 1,
      "entry": 3,
      "isolated": 23
    },
    "lines": {
      "blank": 7,
      "code": 112,
      "total": 119
    }
  },
  "summary": "112 lines of code and 27 definitions.",
  "text": "https://banes-lab.com/source/build-scripts/core/converters/search.index.converter.ts.txt",
  "tree": "build-scripts",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-section-converter-ts",
      "json": "https://banes-lab.com/json/source/build-scripts/core/converters/section.converter.ts",
      "label": "core/converters/section.converter.ts",
      "markdown": "https://banes-lab.com/source/build-scripts/core/converters/section.converter.ts.md",
      "ref": "anatomy:file-build-scripts-core-converters-section-converter-ts"
    },
    "previous": {
      "href": "https://banes-lab.com/anatomy/build-scripts#file-build-scripts-core-converters-search-converter-ts",
      "json": "https://banes-lab.com/json/source/build-scripts/core/converters/search.converter.ts",
      "label": "core/converters/search.converter.ts",
      "markdown": "https://banes-lab.com/source/build-scripts/core/converters/search.converter.ts.md",
      "ref": "anatomy:file-build-scripts-core-converters-search-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"
  }
}
