Skip to content
HALOWERK

Codewerk

import map check

Implements the HTML Living Standard algorithms (section 8.1.5.2): parse an import map string (TypeErrors for non-object values), sort and normalize module specifier maps and scopes (empty keys, non-string or invalid addresses, trailing-slash mismatches become null entries with warnings), normalize the integrity map, merge several import maps in document order (rules for already resolved modules and conflicting rules are ignored), and resolve a module specifier with scopes, prefix matches,.

POST https://code.halowerk.com/v1/import-map-check

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
base_urlstringYesDocument base URL, e.g. https://example.com/index.html.
import_mapSee schemaNoImport map JSON (text or object).
htmlstringNoHTML with <script type="importmap"> and module scripts.
specifiersarrayNoSpecifiers to resolve, optionally with the referring script URL.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "base_url"
  ],
  "properties": {
    "base_url": {
      "type": "string",
      "format": "uri",
      "maxLength": 2000,
      "description": "Document base URL, e.g. https://example.com/index.html."
    },
    "import_map": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 2,
          "maxLength": 200000
        },
        {
          "type": "object"
        }
      ],
      "description": "Import map JSON (text or object)."
    },
    "html": {
      "type": "string",
      "minLength": 1,
      "maxLength": 240000,
      "description": "HTML with <script type=\"importmap\"> and module scripts."
    },
    "specifiers": {
      "type": "array",
      "maxItems": 200,
      "items": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "specifier"
            ],
            "properties": {
              "specifier": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "referrer": {
                "type": "string",
                "format": "uri",
                "maxLength": 2000
              }
            }
          }
        ]
      },
      "description": "Specifiers to resolve, optionally with the referring script URL."
    }
  }
}

Open original schema

Published input example

{
  "base_url": "https://halowerk.com/",
  "import_map": {
    "imports": {
      "lodash": "/node_modules/lodash-es/lodash.js",
      "lodash/": "/node_modules/lodash-es/"
    }
  },
  "specifiers": [
    "lodash",
    "lodash/fp.js",
    "react"
  ]
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’