@oazmi/esbuild-plugin-deno - v0.4.0
    Preparing search index...

    Variable compareImportMapEntriesByLengthConst

    compareImportMapEntriesByLength: Parameters<ImportMapSortedEntries["sort"]>[0] = ...

    use this compare-function to sort import-map entries by the key-alias's length, in decreasing order.

    import type { ImportMapSortedEntries } from "./typedefs.ts"
    import { assertEquals } from "jsr:@std/assert"

    const my_import_map_entries: ImportMapSortedEntries = [
    ["./hello/", "https://example.com/hello-greetings/"],
    ["./hello/world/", "https://example.com/hello-world/"],
    ["./hello/abc/", "https://example.com/hello-abc/"],
    ["./hello", "https://example.com/"],
    ]

    assertEquals(my_import_map_entries.toSorted(compareImportMapEntriesByLength), [
    ["./hello/world/", "https://example.com/hello-world/"],
    ["./hello/abc/", "https://example.com/hello-abc/"],
    ["./hello/", "https://example.com/hello-greetings/"],
    ["./hello", "https://example.com/"],
    ])