@skillcap/gdh 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL-BUNDLE.json +1 -1
- package/RELEASE-SPAN-UPDATE-CONTRACTS.json +70 -0
- package/node_modules/@clack/core/CHANGELOG.md +8 -0
- package/node_modules/@clack/core/dist/index.d.mts +18 -4
- package/node_modules/@clack/core/dist/index.mjs +16 -10
- package/node_modules/@clack/core/dist/index.mjs.map +1 -1
- package/node_modules/@clack/core/package.json +5 -2
- package/node_modules/@clack/prompts/CHANGELOG.md +15 -0
- package/node_modules/@clack/prompts/README.md +107 -2
- package/node_modules/@clack/prompts/dist/index.d.mts +16 -11
- package/node_modules/@clack/prompts/dist/index.mjs +114 -107
- package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
- package/node_modules/@clack/prompts/package.json +7 -4
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.js +1 -1
- package/node_modules/@gdh/adapters/dist/authoring-hook-render.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-settings-patch.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-settings-patch.js +4 -2
- package/node_modules/@gdh/adapters/dist/claude-settings-patch.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-statusline-render.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-statusline-render.js +1 -1
- package/node_modules/@gdh/adapters/dist/claude-statusline-render.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-hook-render.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-hook-render.js +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-hook-render.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-worker-render.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-worker-render.js +1 -1
- package/node_modules/@gdh/adapters/dist/claude-update-worker-render.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.js +1 -1
- package/node_modules/@gdh/adapters/dist/deferred-actions-advisory.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/durable-backup.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/durable-backup.js +3 -5
- package/node_modules/@gdh/adapters/dist/durable-backup.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/index.d.ts +11 -37
- package/node_modules/@gdh/adapters/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/index.js +18 -90
- package/node_modules/@gdh/adapters/dist/index.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/inventory-sweep.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/inventory-sweep.js +1 -3
- package/node_modules/@gdh/adapters/dist/inventory-sweep.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/managed-surfaces.d.ts +32 -0
- package/node_modules/@gdh/adapters/dist/managed-surfaces.d.ts.map +1 -0
- package/node_modules/@gdh/adapters/dist/managed-surfaces.js +66 -0
- package/node_modules/@gdh/adapters/dist/managed-surfaces.js.map +1 -0
- package/node_modules/@gdh/adapters/dist/process-orchestration.d.ts +1 -1
- package/node_modules/@gdh/adapters/dist/process-orchestration.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/process-orchestration.js +3 -2
- package/node_modules/@gdh/adapters/dist/process-orchestration.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/self-update-mechanics.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/self-update-mechanics.js +11 -23
- package/node_modules/@gdh/adapters/dist/self-update-mechanics.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/skill-rendering.d.ts.map +1 -1
- package/node_modules/@gdh/adapters/dist/skill-rendering.js +2 -8
- package/node_modules/@gdh/adapters/dist/skill-rendering.js.map +1 -1
- package/node_modules/@gdh/adapters/dist/template-assets.js.map +1 -1
- package/node_modules/@gdh/adapters/package.json +7 -8
- package/node_modules/@gdh/authoring/dist/authoring-state-store.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/authoring-state-store.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/cache.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/cache.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/diagnostics-broker-contract.d.ts +2 -2
- package/node_modules/@gdh/authoring/dist/diagnostics-broker-contract.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/diagnostics-broker-contract.js +2 -2
- package/node_modules/@gdh/authoring/dist/diagnostics-broker-contract.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/diagnostics-broker.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/diagnostics-broker.js +15 -12
- package/node_modules/@gdh/authoring/dist/diagnostics-broker.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/lsp-broker-snapshot.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/lsp-broker-snapshot.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/lsp-client.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/lsp-client.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/lsp-constants.d.ts +17 -0
- package/node_modules/@gdh/authoring/dist/lsp-constants.d.ts.map +1 -0
- package/node_modules/@gdh/authoring/dist/lsp-constants.js +17 -0
- package/node_modules/@gdh/authoring/dist/lsp-constants.js.map +1 -0
- package/node_modules/@gdh/authoring/dist/lsp-warmup.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/lsp-warmup.js +2 -4
- package/node_modules/@gdh/authoring/dist/lsp-warmup.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/lsp.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/lsp.js +8 -46
- package/node_modules/@gdh/authoring/dist/lsp.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/prepare.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/prepare.js +1 -3
- package/node_modules/@gdh/authoring/dist/prepare.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/project.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/project.js +4 -13
- package/node_modules/@gdh/authoring/dist/project.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/report.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/report.js +2 -11
- package/node_modules/@gdh/authoring/dist/report.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/scene-resource.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/scene-resource.js.map +1 -1
- package/node_modules/@gdh/authoring/dist/tcp-port.d.ts +2 -0
- package/node_modules/@gdh/authoring/dist/tcp-port.d.ts.map +1 -0
- package/node_modules/@gdh/authoring/dist/tcp-port.js +23 -0
- package/node_modules/@gdh/authoring/dist/tcp-port.js.map +1 -0
- package/node_modules/@gdh/authoring/dist/warmup.d.ts.map +1 -1
- package/node_modules/@gdh/authoring/dist/warmup.js.map +1 -1
- package/node_modules/@gdh/authoring/package.json +2 -2
- package/node_modules/@gdh/cli/dist/args.d.ts +44 -0
- package/node_modules/@gdh/cli/dist/args.d.ts.map +1 -0
- package/node_modules/@gdh/cli/dist/args.js +124 -0
- package/node_modules/@gdh/cli/dist/args.js.map +1 -0
- package/node_modules/@gdh/cli/dist/bridge-session.d.ts +1 -1
- package/node_modules/@gdh/cli/dist/bridge-session.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/bridge-session.js +8 -7
- package/node_modules/@gdh/cli/dist/bridge-session.js.map +1 -1
- package/node_modules/@gdh/cli/dist/index.d.ts +4 -52
- package/node_modules/@gdh/cli/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/index.js +8 -197
- package/node_modules/@gdh/cli/dist/index.js.map +1 -1
- package/node_modules/@gdh/cli/dist/io.d.ts +10 -0
- package/node_modules/@gdh/cli/dist/io.d.ts.map +1 -0
- package/node_modules/@gdh/cli/dist/io.js +26 -0
- package/node_modules/@gdh/cli/dist/io.js.map +1 -0
- package/node_modules/@gdh/cli/dist/migrate.d.ts +1 -1
- package/node_modules/@gdh/cli/dist/migrate.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/migrate.js +23 -30
- package/node_modules/@gdh/cli/dist/migrate.js.map +1 -1
- package/node_modules/@gdh/cli/dist/self-update.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/self-update.js +13 -20
- package/node_modules/@gdh/cli/dist/self-update.js.map +1 -1
- package/node_modules/@gdh/cli/dist/setup.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/setup.js.map +1 -1
- package/node_modules/@gdh/cli/dist/status-command.d.ts +3 -0
- package/node_modules/@gdh/cli/dist/status-command.d.ts.map +1 -0
- package/node_modules/@gdh/cli/dist/status-command.js +44 -0
- package/node_modules/@gdh/cli/dist/status-command.js.map +1 -0
- package/node_modules/@gdh/cli/dist/update-banner.d.ts.map +1 -1
- package/node_modules/@gdh/cli/dist/update-banner.js +1 -1
- package/node_modules/@gdh/cli/dist/update-banner.js.map +1 -1
- package/node_modules/@gdh/cli/package.json +11 -11
- package/node_modules/@gdh/core/dist/dev-mode.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/dev-mode.js.map +1 -1
- package/node_modules/@gdh/core/dist/editor-operation-runner.d.ts +3 -0
- package/node_modules/@gdh/core/dist/editor-operation-runner.d.ts.map +1 -0
- package/node_modules/@gdh/core/dist/editor-operation-runner.js +682 -0
- package/node_modules/@gdh/core/dist/editor-operation-runner.js.map +1 -0
- package/node_modules/@gdh/core/dist/git-root.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/git-root.js +4 -1
- package/node_modules/@gdh/core/dist/git-root.js.map +1 -1
- package/node_modules/@gdh/core/dist/godot-docs-version.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/godot-docs-version.js.map +1 -1
- package/node_modules/@gdh/core/dist/godot-stderr-fatality.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/godot-stderr-fatality.js +1 -2
- package/node_modules/@gdh/core/dist/godot-stderr-fatality.js.map +1 -1
- package/node_modules/@gdh/core/dist/index.d.ts +8 -5
- package/node_modules/@gdh/core/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/index.js +14 -5
- package/node_modules/@gdh/core/dist/index.js.map +1 -1
- package/node_modules/@gdh/core/dist/managed-gitignore.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/managed-gitignore.js +4 -14
- package/node_modules/@gdh/core/dist/managed-gitignore.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.js +2 -2
- package/node_modules/@gdh/core/dist/migrations/entries/s2c2_to_s2c3_rules_schema_v2_to_v3.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.js +6 -14
- package/node_modules/@gdh/core/dist/migrations/entries/s3c21_to_s3c22_canonical_hook_paths.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.js +7 -23
- package/node_modules/@gdh/core/dist/migrations/entries/s3c8_to_s3c9_register_runtime_bridge_autoload.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/envelopes/envelope-output-validator.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/envelopes/envelope-output-validator.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/envelopes/index.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/envelopes/index.js +1 -2
- package/node_modules/@gdh/core/dist/migrations/envelopes/index.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/envelopes/types.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/golden-harness.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/golden-harness.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/managed-surface-classes.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/managed-target-surface-inventory.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/managed-target-surface-inventory.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/probes.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/probes.js.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/registry.d.ts +1 -1
- package/node_modules/@gdh/core/dist/migrations/registry.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/migrations/registry.js +3 -6
- package/node_modules/@gdh/core/dist/migrations/registry.js.map +1 -1
- package/node_modules/@gdh/core/dist/official-docs.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/release-span-preview.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/release-span-preview.js +1 -1
- package/node_modules/@gdh/core/dist/release-span-preview.js.map +1 -1
- package/node_modules/@gdh/core/dist/release-span-update-contract.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/release-span-update-contract.js +5 -10
- package/node_modules/@gdh/core/dist/release-span-update-contract.js.map +1 -1
- package/node_modules/@gdh/core/dist/state/codex-retrust-reminder.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/state/codex-retrust-reminder.js.map +1 -1
- package/node_modules/@gdh/core/dist/state/migration-state.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/state/migration-state.js +3 -8
- package/node_modules/@gdh/core/dist/state/migration-state.js.map +1 -1
- package/node_modules/@gdh/core/dist/state/migration-trace.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/state/migration-trace.js +3 -8
- package/node_modules/@gdh/core/dist/state/migration-trace.js.map +1 -1
- package/node_modules/@gdh/core/dist/state/render-inventory.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/state/render-inventory.js.map +1 -1
- package/node_modules/@gdh/core/dist/update-cache.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/update-cache.js.map +1 -1
- package/node_modules/@gdh/core/dist/update-probe.d.ts.map +1 -1
- package/node_modules/@gdh/core/dist/update-probe.js +1 -3
- package/node_modules/@gdh/core/dist/update-probe.js.map +1 -1
- package/node_modules/@gdh/core/package.json +1 -1
- package/node_modules/@gdh/docs/dist/agent-contract.d.ts.map +1 -1
- package/node_modules/@gdh/docs/dist/agent-contract.js +2 -4
- package/node_modules/@gdh/docs/dist/agent-contract.js.map +1 -1
- package/node_modules/@gdh/docs/dist/files.d.ts +1 -1
- package/node_modules/@gdh/docs/dist/files.d.ts.map +1 -1
- package/node_modules/@gdh/docs/dist/guidance.js +1 -1
- package/node_modules/@gdh/docs/dist/guidance.js.map +1 -1
- package/node_modules/@gdh/docs/dist/index.d.ts +4 -4
- package/node_modules/@gdh/docs/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/docs/dist/index.js +3 -3
- package/node_modules/@gdh/docs/dist/index.js.map +1 -1
- package/node_modules/@gdh/docs/dist/official-docs.d.ts.map +1 -1
- package/node_modules/@gdh/docs/dist/official-docs.js +16 -5
- package/node_modules/@gdh/docs/dist/official-docs.js.map +1 -1
- package/node_modules/@gdh/docs/dist/query.d.ts.map +1 -1
- package/node_modules/@gdh/docs/dist/query.js +8 -3
- package/node_modules/@gdh/docs/dist/query.js.map +1 -1
- package/node_modules/@gdh/docs/dist/recovery-hints.d.ts.map +1 -1
- package/node_modules/@gdh/docs/dist/recovery-hints.js +0 -1
- package/node_modules/@gdh/docs/dist/recovery-hints.js.map +1 -1
- package/node_modules/@gdh/docs/dist/template-assets.js.map +1 -1
- package/node_modules/@gdh/docs/package.json +2 -2
- package/node_modules/@gdh/editor/dist/index.d.ts +1 -3
- package/node_modules/@gdh/editor/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/editor/dist/index.js +9 -682
- package/node_modules/@gdh/editor/dist/index.js.map +1 -1
- package/node_modules/@gdh/editor/package.json +2 -2
- package/node_modules/@gdh/mcp/dist/bridge-tools.d.ts +8 -1
- package/node_modules/@gdh/mcp/dist/bridge-tools.d.ts.map +1 -1
- package/node_modules/@gdh/mcp/dist/bridge-tools.js +81 -2
- package/node_modules/@gdh/mcp/dist/bridge-tools.js.map +1 -1
- package/node_modules/@gdh/mcp/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/mcp/dist/index.js +10 -77
- package/node_modules/@gdh/mcp/dist/index.js.map +1 -1
- package/node_modules/@gdh/mcp/package.json +8 -10
- package/node_modules/@gdh/observability/dist/guidance-audit.d.ts.map +1 -1
- package/node_modules/@gdh/observability/dist/guidance-audit.js +11 -21
- package/node_modules/@gdh/observability/dist/guidance-audit.js.map +1 -1
- package/node_modules/@gdh/observability/dist/index.d.ts +2 -2
- package/node_modules/@gdh/observability/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/observability/dist/index.js +1 -1
- package/node_modules/@gdh/observability/dist/index.js.map +1 -1
- package/node_modules/@gdh/observability/dist/runtime-bundles.d.ts.map +1 -1
- package/node_modules/@gdh/observability/dist/runtime-bundles.js +3 -10
- package/node_modules/@gdh/observability/dist/runtime-bundles.js.map +1 -1
- package/node_modules/@gdh/observability/dist/runtime-corpus.d.ts.map +1 -1
- package/node_modules/@gdh/observability/dist/runtime-corpus.js +1 -1
- package/node_modules/@gdh/observability/dist/runtime-corpus.js.map +1 -1
- package/node_modules/@gdh/observability/package.json +3 -2
- package/node_modules/@gdh/runtime/dist/bridge-broker-client.d.ts +1 -1
- package/node_modules/@gdh/runtime/dist/bridge-broker-client.d.ts.map +1 -1
- package/node_modules/@gdh/runtime/dist/bridge-broker-client.js +0 -1
- package/node_modules/@gdh/runtime/dist/bridge-broker-client.js.map +1 -1
- package/node_modules/@gdh/runtime/dist/bridge-broker.d.ts +1 -1
- package/node_modules/@gdh/runtime/dist/bridge-broker.d.ts.map +1 -1
- package/node_modules/@gdh/runtime/dist/bridge-broker.js +9 -5
- package/node_modules/@gdh/runtime/dist/bridge-broker.js.map +1 -1
- package/node_modules/@gdh/runtime/dist/bridge-surface.d.ts +1 -1
- package/node_modules/@gdh/runtime/dist/bridge-surface.d.ts.map +1 -1
- package/node_modules/@gdh/runtime/dist/bridge-surface.js +2 -2
- package/node_modules/@gdh/runtime/dist/bridge-surface.js.map +1 -1
- package/node_modules/@gdh/runtime/dist/docker-provider.d.ts +1 -1
- package/node_modules/@gdh/runtime/dist/docker-provider.d.ts.map +1 -1
- package/node_modules/@gdh/runtime/dist/docker-provider.js +5 -16
- package/node_modules/@gdh/runtime/dist/docker-provider.js.map +1 -1
- package/node_modules/@gdh/runtime/dist/index.js +2 -1
- package/node_modules/@gdh/runtime/dist/index.js.map +1 -1
- package/node_modules/@gdh/runtime/dist/knowledge-surface.d.ts.map +1 -1
- package/node_modules/@gdh/runtime/dist/knowledge-surface.js +21 -10
- package/node_modules/@gdh/runtime/dist/knowledge-surface.js.map +1 -1
- package/node_modules/@gdh/runtime/package.json +2 -3
- package/node_modules/@gdh/scan/dist/detect-existing-onboarding.d.ts.map +1 -1
- package/node_modules/@gdh/scan/dist/detect-existing-onboarding.js +1 -5
- package/node_modules/@gdh/scan/dist/detect-existing-onboarding.js.map +1 -1
- package/node_modules/@gdh/scan/dist/index.d.ts +3 -3
- package/node_modules/@gdh/scan/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/scan/dist/index.js +3 -3
- package/node_modules/@gdh/scan/dist/index.js.map +1 -1
- package/node_modules/@gdh/scan/dist/inventory-cache.js +1 -1
- package/node_modules/@gdh/scan/dist/inventory-cache.js.map +1 -1
- package/node_modules/@gdh/scan/dist/onboard.d.ts +1 -2
- package/node_modules/@gdh/scan/dist/onboard.d.ts.map +1 -1
- package/node_modules/@gdh/scan/dist/onboard.js +4 -5
- package/node_modules/@gdh/scan/dist/onboard.js.map +1 -1
- package/node_modules/@gdh/scan/dist/scan.d.ts.map +1 -1
- package/node_modules/@gdh/scan/dist/scan.js +4 -2
- package/node_modules/@gdh/scan/dist/scan.js.map +1 -1
- package/node_modules/@gdh/scan/package.json +3 -3
- package/node_modules/@gdh/verify/dist/corpus.d.ts.map +1 -1
- package/node_modules/@gdh/verify/dist/corpus.js +7 -6
- package/node_modules/@gdh/verify/dist/corpus.js.map +1 -1
- package/node_modules/@gdh/verify/dist/index.d.ts.map +1 -1
- package/node_modules/@gdh/verify/dist/index.js +0 -1
- package/node_modules/@gdh/verify/dist/index.js.map +1 -1
- package/node_modules/@gdh/verify/dist/readiness.d.ts.map +1 -1
- package/node_modules/@gdh/verify/dist/readiness.js.map +1 -1
- package/node_modules/@gdh/verify/dist/scenarios.d.ts +1 -1
- package/node_modules/@gdh/verify/dist/scenarios.d.ts.map +1 -1
- package/node_modules/@gdh/verify/dist/scenarios.js +14 -11
- package/node_modules/@gdh/verify/dist/scenarios.js.map +1 -1
- package/node_modules/@gdh/verify/package.json +6 -7
- package/node_modules/@hono/node-server/dist/index.js +22 -0
- package/node_modules/@hono/node-server/dist/index.mjs +22 -0
- package/node_modules/@hono/node-server/dist/listener.js +22 -0
- package/node_modules/@hono/node-server/dist/listener.mjs +22 -0
- package/node_modules/@hono/node-server/dist/request.js +11 -0
- package/node_modules/@hono/node-server/dist/request.mjs +11 -0
- package/node_modules/@hono/node-server/dist/response.js +11 -0
- package/node_modules/@hono/node-server/dist/response.mjs +11 -0
- package/node_modules/@hono/node-server/dist/server.js +22 -0
- package/node_modules/@hono/node-server/dist/server.mjs +22 -0
- package/node_modules/@hono/node-server/dist/utils.d.mts +2 -2
- package/node_modules/@hono/node-server/dist/utils.d.ts +2 -2
- package/node_modules/@hono/node-server/dist/vercel.js +22 -0
- package/node_modules/@hono/node-server/dist/vercel.mjs +22 -0
- package/node_modules/@hono/node-server/package.json +1 -1
- package/node_modules/ajv/README.md +1 -1
- package/node_modules/ajv/dist/core.js +1 -1
- package/node_modules/ajv/dist/core.js.map +1 -1
- package/node_modules/ajv/lib/core.ts +1 -1
- package/node_modules/ajv/package.json +2 -3
- package/node_modules/eventsource-parser/LICENSE +1 -1
- package/node_modules/eventsource-parser/dist/index.cjs +104 -44
- package/node_modules/eventsource-parser/dist/index.cjs.map +1 -1
- package/node_modules/eventsource-parser/dist/index.d.cts +23 -21
- package/node_modules/eventsource-parser/dist/index.d.ts +23 -21
- package/node_modules/eventsource-parser/dist/index.js +104 -44
- package/node_modules/eventsource-parser/dist/index.js.map +1 -1
- package/node_modules/eventsource-parser/dist/stream.d.cts +22 -19
- package/node_modules/eventsource-parser/dist/stream.d.ts +22 -19
- package/node_modules/eventsource-parser/package.json +54 -77
- package/node_modules/eventsource-parser/src/parse.ts +270 -107
- package/node_modules/express-rate-limit/dist/index.cjs +51 -10
- package/node_modules/express-rate-limit/dist/index.d.cts +31 -1
- package/node_modules/express-rate-limit/dist/index.d.mts +31 -1
- package/node_modules/express-rate-limit/dist/index.d.ts +31 -1
- package/node_modules/express-rate-limit/dist/index.mjs +51 -10
- package/node_modules/express-rate-limit/package.json +3 -2
- package/node_modules/express-rate-limit/readme.md +3 -0
- package/node_modules/fast-string-truncated-width/dist/index.js +36 -96
- package/node_modules/fast-string-truncated-width/dist/types.d.ts +0 -3
- package/node_modules/fast-string-truncated-width/dist/utils.d.ts +3 -3
- package/node_modules/fast-string-truncated-width/dist/utils.js +14 -9
- package/node_modules/fast-string-truncated-width/package.json +1 -1
- package/node_modules/fast-string-truncated-width/readme.md +2 -3
- package/node_modules/fast-string-width/package.json +2 -2
- package/node_modules/fast-string-width/readme.md +0 -3
- package/node_modules/fast-uri/.github/workflows/ci.yml +12 -7
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +1 -1
- package/node_modules/fast-uri/LICENSE +1 -3
- package/node_modules/fast-uri/README.md +13 -4
- package/node_modules/fast-uri/index.js +90 -24
- package/node_modules/fast-uri/lib/utils.js +129 -22
- package/node_modules/fast-uri/package.json +3 -4
- package/node_modules/fast-wrap-ansi/lib/main.js +4 -1
- package/node_modules/fast-wrap-ansi/lib/main.js.map +1 -1
- package/node_modules/fast-wrap-ansi/package.json +2 -2
- package/node_modules/get-intrinsic/CHANGELOG.md +0 -7
- package/node_modules/get-intrinsic/index.js +13 -8
- package/node_modules/get-intrinsic/package.json +4 -7
- package/node_modules/hasown/CHANGELOG.md +11 -0
- package/node_modules/hasown/eslint.config.mjs +6 -0
- package/node_modules/hasown/index.d.ts +1 -0
- package/node_modules/hasown/package.json +14 -14
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +9 -2
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +9 -2
- package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +2 -0
- package/node_modules/hono/dist/cjs/jsx/base.js +7 -1
- package/node_modules/hono/dist/cjs/jsx/dom/render.js +22 -9
- package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +3 -0
- package/node_modules/hono/dist/cjs/jsx/utils.js +155 -5
- package/node_modules/hono/dist/cjs/middleware/body-limit/index.js +21 -30
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +11 -3
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +2 -5
- package/node_modules/hono/dist/cjs/middleware/method-override/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js +2 -2
- package/node_modules/hono/dist/cjs/utils/jwt/jws.js +1 -1
- package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +12 -6
- package/node_modules/hono/dist/helper/ssg/ssg.js +2 -0
- package/node_modules/hono/dist/jsx/base.js +13 -2
- package/node_modules/hono/dist/jsx/dom/render.js +22 -9
- package/node_modules/hono/dist/jsx/jsx-runtime.js +4 -1
- package/node_modules/hono/dist/jsx/utils.js +153 -5
- package/node_modules/hono/dist/middleware/body-limit/index.js +21 -30
- package/node_modules/hono/dist/middleware/cache/index.js +11 -3
- package/node_modules/hono/dist/middleware/cors/index.js +2 -5
- package/node_modules/hono/dist/middleware/method-override/index.js +1 -1
- package/node_modules/hono/dist/middleware/trailing-slash/index.js +2 -2
- package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +1 -1
- package/node_modules/hono/dist/types/jsx/utils.d.ts +3 -1
- package/node_modules/hono/dist/types/middleware/cache/index.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/cors/index.d.ts +1 -1
- package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +16 -0
- package/node_modules/hono/dist/types/types.d.ts +116 -116
- package/node_modules/hono/dist/utils/jwt/jws.js +1 -1
- package/node_modules/hono/dist/utils/jwt/jwt.js +12 -6
- package/node_modules/hono/package.json +1 -1
- package/node_modules/ip-address/README.md +249 -76
- package/node_modules/ip-address/dist/address-error.d.ts +0 -1
- package/node_modules/ip-address/dist/address-error.js.map +1 -1
- package/node_modules/ip-address/dist/common.d.ts +6 -1
- package/node_modules/ip-address/dist/common.js +21 -0
- package/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/ip-address/dist/ip-address.d.ts +0 -1
- package/node_modules/ip-address/dist/ip-address.js.map +1 -1
- package/node_modules/ip-address/dist/ipv4.d.ts +115 -57
- package/node_modules/ip-address/dist/ipv4.js +193 -68
- package/node_modules/ip-address/dist/ipv4.js.map +1 -1
- package/node_modules/ip-address/dist/ipv6.d.ts +172 -111
- package/node_modules/ip-address/dist/ipv6.js +345 -131
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v4/constants.d.ts +0 -1
- package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +0 -1
- package/node_modules/ip-address/dist/v6/constants.js +5 -0
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/dist/v6/helpers.d.ts +1 -1
- package/node_modules/ip-address/dist/v6/helpers.js +12 -3
- package/node_modules/ip-address/dist/v6/helpers.js.map +1 -1
- package/node_modules/ip-address/dist/v6/regular-expressions.d.ts +0 -1
- package/node_modules/ip-address/dist/v6/regular-expressions.js.map +1 -1
- package/node_modules/ip-address/package.json +45 -35
- package/node_modules/jose/dist/webapi/jwks/remote.js +1 -1
- package/node_modules/jose/dist/webapi/lib/pbes2kw.js +3 -0
- package/node_modules/jose/package.json +1 -1
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +5 -3
- package/node_modules/yaml/browser/dist/nodes/Alias.js +2 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +11 -8
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +2 -1
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +5 -3
- package/node_modules/yaml/dist/nodes/Alias.js +2 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +5 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +10 -7
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +2 -1
- package/node_modules/yaml/package.json +1 -1
- package/node_modules/zod/README.md +1 -18
- package/node_modules/zod/locales/package.json +2 -1
- package/node_modules/zod/mini/package.json +2 -1
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/errors.ts +2 -2
- package/node_modules/zod/src/v4/classic/external.ts +1 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +39 -23
- package/node_modules/zod/src/v4/classic/parse.ts +6 -6
- package/node_modules/zod/src/v4/classic/schemas.ts +414 -151
- package/node_modules/zod/src/v4/core/api.ts +31 -6
- package/node_modules/zod/src/v4/core/checks.ts +1 -1
- package/node_modules/zod/src/v4/core/core.ts +17 -2
- package/node_modules/zod/src/v4/core/errors.ts +31 -24
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +17 -18
- package/node_modules/zod/src/v4/core/parse.ts +7 -7
- package/node_modules/zod/src/v4/core/regexes.ts +8 -1
- package/node_modules/zod/src/v4/core/schemas.ts +263 -71
- package/node_modules/zod/src/v4/core/to-json-schema.ts +10 -1
- package/node_modules/zod/src/v4/core/util.ts +52 -35
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/node_modules/zod/src/v4/locales/en.ts +4 -0
- package/node_modules/zod/src/v4/locales/fr.ts +24 -8
- package/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/node_modules/zod/src/v4/locales/index.ts +3 -0
- package/node_modules/zod/src/v4/locales/it.ts +1 -1
- package/node_modules/zod/src/v4/locales/ka.ts +8 -8
- package/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/mini/external.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +56 -25
- package/node_modules/zod/v3/package.json +2 -1
- package/node_modules/zod/v4/classic/errors.js +2 -2
- package/node_modules/zod/v4/classic/external.d.cts +1 -0
- package/node_modules/zod/v4/classic/external.d.ts +1 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +31 -16
- package/node_modules/zod/v4/classic/from-json-schema.js +31 -16
- package/node_modules/zod/v4/classic/package.json +2 -1
- package/node_modules/zod/v4/classic/schemas.cjs +358 -119
- package/node_modules/zod/v4/classic/schemas.d.cts +42 -14
- package/node_modules/zod/v4/classic/schemas.d.ts +42 -14
- package/node_modules/zod/v4/classic/schemas.js +356 -118
- package/node_modules/zod/v4/core/api.cjs +7 -2
- package/node_modules/zod/v4/core/api.d.cts +26 -5
- package/node_modules/zod/v4/core/api.d.ts +26 -5
- package/node_modules/zod/v4/core/api.js +7 -2
- package/node_modules/zod/v4/core/checks.d.cts +1 -1
- package/node_modules/zod/v4/core/checks.d.ts +1 -1
- package/node_modules/zod/v4/core/core.cjs +3 -1
- package/node_modules/zod/v4/core/core.js +4 -2
- package/node_modules/zod/v4/core/errors.cjs +26 -23
- package/node_modules/zod/v4/core/errors.d.cts +1 -0
- package/node_modules/zod/v4/core/errors.d.ts +1 -0
- package/node_modules/zod/v4/core/errors.js +26 -23
- package/node_modules/zod/v4/core/json-schema-processors.cjs +16 -20
- package/node_modules/zod/v4/core/json-schema-processors.js +16 -20
- package/node_modules/zod/v4/core/package.json +2 -1
- package/node_modules/zod/v4/core/parse.cjs +7 -7
- package/node_modules/zod/v4/core/parse.js +7 -7
- package/node_modules/zod/v4/core/regexes.cjs +9 -3
- package/node_modules/zod/v4/core/regexes.d.cts +6 -0
- package/node_modules/zod/v4/core/regexes.d.ts +6 -0
- package/node_modules/zod/v4/core/regexes.js +7 -1
- package/node_modules/zod/v4/core/schemas.cjs +211 -65
- package/node_modules/zod/v4/core/schemas.d.cts +39 -1
- package/node_modules/zod/v4/core/schemas.d.ts +39 -1
- package/node_modules/zod/v4/core/schemas.js +210 -64
- package/node_modules/zod/v4/core/to-json-schema.cjs +12 -1
- package/node_modules/zod/v4/core/to-json-schema.js +12 -1
- package/node_modules/zod/v4/core/util.cjs +54 -30
- package/node_modules/zod/v4/core/util.d.cts +1 -0
- package/node_modules/zod/v4/core/util.d.ts +1 -0
- package/node_modules/zod/v4/core/util.js +55 -32
- package/node_modules/zod/v4/core/versions.cjs +2 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/locales/el.cjs +136 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +109 -0
- package/node_modules/zod/v4/locales/en.cjs +4 -0
- package/node_modules/zod/v4/locales/en.js +4 -0
- package/node_modules/zod/v4/locales/fr.cjs +24 -7
- package/node_modules/zod/v4/locales/fr.js +24 -7
- package/node_modules/zod/v4/locales/hr.cjs +149 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +122 -0
- package/node_modules/zod/v4/locales/index.cjs +8 -1
- package/node_modules/zod/v4/locales/index.d.cts +3 -0
- package/node_modules/zod/v4/locales/index.d.ts +3 -0
- package/node_modules/zod/v4/locales/index.js +3 -0
- package/node_modules/zod/v4/locales/it.cjs +1 -1
- package/node_modules/zod/v4/locales/it.js +1 -1
- package/node_modules/zod/v4/locales/ka.cjs +8 -8
- package/node_modules/zod/v4/locales/ka.js +8 -8
- package/node_modules/zod/v4/locales/package.json +2 -1
- package/node_modules/zod/v4/locales/ro.cjs +146 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +119 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/mini/external.d.cts +1 -0
- package/node_modules/zod/v4/mini/external.d.ts +1 -0
- package/node_modules/zod/v4/mini/package.json +2 -1
- package/node_modules/zod/v4/mini/schemas.cjs +41 -4
- package/node_modules/zod/v4/mini/schemas.d.cts +28 -10
- package/node_modules/zod/v4/mini/schemas.d.ts +28 -10
- package/node_modules/zod/v4/mini/schemas.js +40 -4
- package/node_modules/zod/v4/package.json +2 -1
- package/node_modules/zod/v4-mini/package.json +2 -1
- package/package.json +12 -12
- package/node_modules/async-function/.eslintrc +0 -16
- package/node_modules/async-function/.github/FUNDING.yml +0 -12
- package/node_modules/async-function/.nycrc +0 -9
- package/node_modules/async-function/CHANGELOG.md +0 -16
- package/node_modules/async-function/LICENSE +0 -21
- package/node_modules/async-function/README.md +0 -51
- package/node_modules/async-function/index.d.mts +0 -3
- package/node_modules/async-function/index.d.ts +0 -13
- package/node_modules/async-function/index.js +0 -8
- package/node_modules/async-function/index.mjs +0 -4
- package/node_modules/async-function/legacy.js +0 -18
- package/node_modules/async-function/package.json +0 -86
- package/node_modules/async-function/require.mjs +0 -5
- package/node_modules/async-function/tsconfig.json +0 -9
- package/node_modules/async-generator-function/.eslintrc +0 -26
- package/node_modules/async-generator-function/.github/FUNDING.yml +0 -12
- package/node_modules/async-generator-function/.nycrc +0 -9
- package/node_modules/async-generator-function/CHANGELOG.md +0 -15
- package/node_modules/async-generator-function/LICENSE +0 -21
- package/node_modules/async-generator-function/README.md +0 -52
- package/node_modules/async-generator-function/index.d.mts +0 -3
- package/node_modules/async-generator-function/index.d.ts +0 -22
- package/node_modules/async-generator-function/index.js +0 -8
- package/node_modules/async-generator-function/index.mjs +0 -4
- package/node_modules/async-generator-function/legacy.js +0 -18
- package/node_modules/async-generator-function/package.json +0 -87
- package/node_modules/async-generator-function/require.mjs +0 -5
- package/node_modules/async-generator-function/tsconfig.json +0 -9
- package/node_modules/fast-uri/.github/.stale.yml +0 -21
- package/node_modules/fast-uri/.github/tests_checker.yml +0 -8
- package/node_modules/generator-function/.eslintrc +0 -16
- package/node_modules/generator-function/.github/FUNDING.yml +0 -12
- package/node_modules/generator-function/.nycrc +0 -9
- package/node_modules/generator-function/CHANGELOG.md +0 -27
- package/node_modules/generator-function/LICENSE.md +0 -7
- package/node_modules/generator-function/README.md +0 -51
- package/node_modules/generator-function/index.d.mts +0 -3
- package/node_modules/generator-function/index.d.ts +0 -3
- package/node_modules/generator-function/index.js +0 -8
- package/node_modules/generator-function/index.mjs +0 -4
- package/node_modules/generator-function/legacy.js +0 -18
- package/node_modules/generator-function/package.json +0 -88
- package/node_modules/generator-function/require.mjs +0 -5
- package/node_modules/generator-function/tsconfig.json +0 -9
- package/node_modules/hasown/.eslintrc +0 -5
- package/node_modules/ip-address/dist/address-error.d.ts.map +0 -1
- package/node_modules/ip-address/dist/common.d.ts.map +0 -1
- package/node_modules/ip-address/dist/ip-address.d.ts.map +0 -1
- package/node_modules/ip-address/dist/ipv4.d.ts.map +0 -1
- package/node_modules/ip-address/dist/ipv6.d.ts.map +0 -1
- package/node_modules/ip-address/dist/v4/constants.d.ts.map +0 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts.map +0 -1
- package/node_modules/ip-address/dist/v6/helpers.d.ts.map +0 -1
- package/node_modules/ip-address/dist/v6/regular-expressions.d.ts.map +0 -1
- package/node_modules/ip-address/src/address-error.ts +0 -11
- package/node_modules/ip-address/src/common.ts +0 -55
- package/node_modules/ip-address/src/ip-address.ts +0 -7
- package/node_modules/ip-address/src/ipv4.ts +0 -394
- package/node_modules/ip-address/src/ipv6.ts +0 -1212
- package/node_modules/ip-address/src/v4/constants.ts +0 -7
- package/node_modules/ip-address/src/v6/constants.ts +0 -79
- package/node_modules/ip-address/src/v6/helpers.ts +0 -48
- package/node_modules/ip-address/src/v6/regular-expressions.ts +0 -94
- /package/node_modules/{cross-spawn/node_modules/isexe → isexe}/.npmignore +0 -0
- /package/node_modules/{cross-spawn/node_modules/isexe → isexe}/LICENSE +0 -0
- /package/node_modules/{cross-spawn/node_modules/isexe → isexe}/README.md +0 -0
- /package/node_modules/{cross-spawn/node_modules/isexe → isexe}/index.js +0 -0
- /package/node_modules/{cross-spawn/node_modules/isexe → isexe}/mode.js +0 -0
- /package/node_modules/{cross-spawn/node_modules/isexe → isexe}/package.json +0 -0
- /package/node_modules/{cross-spawn/node_modules/isexe → isexe}/windows.js +0 -0
- /package/node_modules/{cross-spawn/node_modules/which → which}/LICENSE +0 -0
- /package/node_modules/{cross-spawn/node_modules/which → which}/README.md +0 -0
- /package/node_modules/{cross-spawn/node_modules/which → which}/bin/node-which +0 -0
- /package/node_modules/{cross-spawn/node_modules/which → which}/package.json +0 -0
- /package/node_modules/{cross-spawn/node_modules/which → which}/which.js +0 -0
|
@@ -2,104 +2,277 @@
|
|
|
2
2
|
[![codecov]](https://codecov.io/github/beaugunderson/ip-address?branch=master)
|
|
3
3
|
[![downloads]](https://www.npmjs.com/package/ip-address)
|
|
4
4
|
[![npm]](https://www.npmjs.com/package/ip-address)
|
|
5
|
-
[![snyk]](https://snyk.io/test/github/beaugunderson/ip-address)
|
|
6
5
|
|
|
7
6
|
[codecov]: https://codecov.io/github/beaugunderson/ip-address/coverage.svg?branch=master
|
|
8
7
|
[downloads]: https://img.shields.io/npm/dm/ip-address.svg
|
|
9
8
|
[npm]: https://img.shields.io/npm/v/ip-address.svg
|
|
10
|
-
[snyk]: https://snyk.io/test/github/beaugunderson/ip-address/badge.svg
|
|
11
9
|
|
|
12
10
|
## ip-address
|
|
13
11
|
|
|
14
|
-
`ip-address` is a library for validating and manipulating IPv4 and IPv6
|
|
15
|
-
addresses in JavaScript.
|
|
12
|
+
`ip-address` is a library for validating and manipulating IPv4 and IPv6 addresses in JavaScript and TypeScript.
|
|
16
13
|
|
|
17
|
-
###
|
|
14
|
+
### Install
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
```sh
|
|
17
|
+
npm install ip-address
|
|
18
|
+
```
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
### Examples
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
```ts
|
|
23
|
+
import { Address4, Address6 } from 'ip-address';
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
// Validation
|
|
26
|
+
Address4.isValid('192.168.1.1'); // true
|
|
27
|
+
Address6.isValid('2001:db8::1'); // true
|
|
28
|
+
Address6.isValid('not an address'); // false
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
// Parsing (throws AddressError on invalid input)
|
|
31
|
+
const v4 = new Address4('192.168.1.1/24');
|
|
32
|
+
const v6 = new Address6('2001:db8::1/64');
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
// Subnet membership
|
|
35
|
+
const host = new Address4('192.168.1.42');
|
|
36
|
+
const network = new Address4('192.168.1.0/24');
|
|
37
|
+
host.isInSubnet(network); // true
|
|
38
|
+
|
|
39
|
+
// Subnet range
|
|
40
|
+
network.startAddress().correctForm(); // '192.168.1.0'
|
|
41
|
+
network.endAddress().correctForm(); // '192.168.1.255'
|
|
42
|
+
|
|
43
|
+
// Strict network-address check (host bits must be zero).
|
|
44
|
+
// isValid() accepts CIDRs with host bits set — '192.168.1.5/24' is a valid
|
|
45
|
+
// host-with-subnet, but it isn't a network address.
|
|
46
|
+
const cidr = new Address4('192.168.1.5/24');
|
|
47
|
+
Address4.isValid('192.168.1.5/24'); // true
|
|
48
|
+
cidr.correctForm() === cidr.startAddress().correctForm(); // false
|
|
33
49
|
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
// Address properties
|
|
51
|
+
const link = new Address6('fe80::1');
|
|
52
|
+
link.isLinkLocal(); // true
|
|
53
|
+
link.isMulticast(); // false
|
|
54
|
+
link.isLoopback(); // false
|
|
36
55
|
|
|
37
|
-
|
|
56
|
+
new Address4('192.168.1.1').isPrivate(); // true (RFC 1918)
|
|
57
|
+
new Address6('fc00::1').isULA(); // true (RFC 4193)
|
|
38
58
|
|
|
39
|
-
|
|
59
|
+
// Numeric and byte representations
|
|
60
|
+
v4.bigInt(); // 3232235777n
|
|
61
|
+
v4.toArray(); // [192, 168, 1, 1]
|
|
62
|
+
v6.canonicalForm(); // '2001:0db8:0000:0000:0000:0000:0000:0001'
|
|
40
63
|
|
|
41
|
-
|
|
64
|
+
// Embedded IPv4 + Teredo
|
|
65
|
+
const teredo = new Address6('2001:0:ce49:7601:e866:efff:62c3:fffe');
|
|
66
|
+
teredo.inspectTeredo().client4; // '157.60.0.1'
|
|
67
|
+
|
|
68
|
+
// Parse host + port from a URL
|
|
69
|
+
Address6.fromURL('http://[2001:db8::1]:8080/').port; // 8080
|
|
42
70
|
```
|
|
43
71
|
|
|
44
72
|
### Features
|
|
45
73
|
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
74
|
+
- Written in TypeScript with full type definitions; usable from CommonJS and ESM
|
|
75
|
+
- Zero runtime dependencies
|
|
76
|
+
- Parses all standard IPv4 and IPv6 notations, including subnets and zones
|
|
77
|
+
- Parses IPv6 hosts (and ports) from URLs via `Address6.fromURL(url)`
|
|
78
|
+
- Subnet membership checks (`isInSubnet`) and range queries (`startAddress` / `endAddress`)
|
|
79
|
+
- Special-property checks: private (RFC 1918) / ULA (RFC 4193), loopback, link-local, multicast, broadcast, unspecified, CGNAT, documentation, Teredo, 6to4, v4-in-v6
|
|
80
|
+
- Decodes [Teredo](http://en.wikipedia.org/wiki/Teredo_tunneling#IPv6_addressing) and 6to4 tunneling information
|
|
81
|
+
- Conversions: canonical/correct form, hex, binary, decimal, byte arrays, BigInt, `in-addr.arpa` / `ip6.arpa`
|
|
82
|
+
- Runs in Node.js and the browser
|
|
83
|
+
- Thousands of test cases
|
|
84
|
+
|
|
85
|
+
### Terminology
|
|
86
|
+
|
|
87
|
+
A few terms used throughout the API can be confusing if you haven't worked deeply with IPv6 before:
|
|
88
|
+
|
|
89
|
+
- **Correct form** — the shortest valid representation, per [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952): leading zeros stripped, the longest run of zero groups collapsed to `::`, and hex digits lowercased (e.g. `2001:db8::1`). This is what most software displays.
|
|
90
|
+
- **Canonical form** — the fully expanded representation: all 8 groups, each padded to 4 hex digits, no `::` collapsing (e.g. `2001:0db8:0000:0000:0000:0000:0000:0001`). Useful for sorting and byte-exact comparison.
|
|
91
|
+
- **Subnet** — the network portion of an address expressed as a CIDR prefix length (e.g. `/24` for IPv4, `/64` for IPv6). `startAddress()` / `endAddress()` return the bounds of the subnet's range.
|
|
92
|
+
- **Zone** — the IPv6 scope identifier appended after `%`, used to disambiguate link-local addresses across interfaces (e.g. `fe80::1%eth0`).
|
|
93
|
+
- **v4-in-v6** — mixed notation that embeds an IPv4 address as the last 32 bits of an IPv6 address, e.g. `::ffff:192.168.0.1`. Used for IPv4-mapped IPv6 addresses.
|
|
94
|
+
- **Teredo** — a tunneling protocol that encodes an IPv4 endpoint, port, and flags inside a `2001::/32` IPv6 address. `inspectTeredo()` decodes those fields.
|
|
95
|
+
- **6to4** — a tunneling protocol that embeds an IPv4 address as the second 16 bits of a `2002::/16` IPv6 address. `inspect6to4()` decodes the embedded v4 address.
|
|
96
|
+
|
|
97
|
+
### API
|
|
98
|
+
|
|
99
|
+
<!-- API:START -->
|
|
100
|
+
|
|
101
|
+
#### AddressError
|
|
102
|
+
|
|
103
|
+
**Constructor**
|
|
104
|
+
|
|
105
|
+
- `new AddressError(message: string, parseMessage?: string): AddressError`
|
|
106
|
+
|
|
107
|
+
**Properties**
|
|
108
|
+
|
|
109
|
+
- `parseMessage: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/address-error.ts#L2)
|
|
110
|
+
|
|
111
|
+
#### Address4
|
|
112
|
+
|
|
113
|
+
Represents an IPv4 address
|
|
114
|
+
|
|
115
|
+
**Constructor**
|
|
116
|
+
|
|
117
|
+
- `new Address4(address: string): Address4`
|
|
118
|
+
|
|
119
|
+
**Static methods**
|
|
120
|
+
|
|
121
|
+
- `static isValid(address: string): boolean` — Returns true if the given string is a valid IPv4 address (with optional CIDR subnet), false otherwise. Host bits in the subnet portion are allowed (e.g. `192.168.1.5/24` is valid); for strict network-address validation compare `correctForm()` to `startAddress().correctForm()`, or use `networkForm()`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L53)
|
|
122
|
+
- `static fromAddressAndMask(address: string, mask: string): Address4` — Construct an `Address4` from an address and a dotted-decimal subnet mask given as separate strings (e.g. as returned by Node's `os.networkInterfaces()`). Throws `AddressError` if the mask is non-contiguous (e.g. `255.0.255.0`). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L104)
|
|
123
|
+
- `static fromAddressAndWildcardMask(address: string, wildcardMask: string): Address4` — Construct an `Address4` from an address and a Cisco-style wildcard mask given as separate strings (e.g. `0.0.0.255` for a `/24`). The wildcard mask is the bitwise inverse of the subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g. `0.255.0.255`). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L118)
|
|
124
|
+
- `static fromWildcard(input: string): Address4` — Construct an `Address4` from a wildcard pattern with trailing `*` octets. The number of trailing wildcards determines the prefix length: each `*` represents 8 bits. Only trailing whole-octet wildcards are supported. Partial-octet wildcards (e.g. `192.168.0.1*`) and interior wildcards (e.g. `192.*.0.1`) throw `AddressError`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L140)
|
|
125
|
+
- `static fromHex(hex: string): Address4` — Converts a hex string to an IPv4 address object. Accepts 8 hex digits with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`). Throws `AddressError` for any other length or for non-hex characters. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L175)
|
|
126
|
+
- `static fromInteger(integer: number): Address4` — Converts an integer into a IPv4 address object. The integer must be a non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L198)
|
|
127
|
+
- `static fromArpa(arpaFormAddress: string): Address4` — Return an address from in-addr.arpa form [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L214)
|
|
128
|
+
- `static fromBigInt(bigInt: bigint): Address4` — Converts a BigInt to a v4 address object. The value must be in the range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L361)
|
|
129
|
+
- `static fromByteArray(bytes: number[]): Address4` — Convert a byte array to an Address4 object. To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L376)
|
|
130
|
+
- `static fromUnsignedByteArray(bytes: number[]): Address4` — Convert an unsigned byte array to an Address4 object [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L396)
|
|
131
|
+
|
|
132
|
+
**Instance methods**
|
|
133
|
+
|
|
134
|
+
- `parse(address: string): string[]` — Parses an IPv4 address string into its four octet groups and stores the result on `this.parsedAddress`. Called automatically by the constructor; you typically don't need to call it directly. Throws `AddressError` if the input is not a valid IPv4 address. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L70)
|
|
135
|
+
- `correctForm(): string` — Returns the address in correct form: octets joined with `.` and any leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the canonical dotted-decimal representation. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L85)
|
|
136
|
+
- `toHex(): string` — Converts an IPv4 address object to a hex string [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L227)
|
|
137
|
+
- `toArray(): number[]` — Converts an IPv4 address object to an array of bytes. To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toArray())`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L237)
|
|
138
|
+
- `toGroup6(): string` — Converts an IPv4 address object to an IPv6 address group [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L245)
|
|
139
|
+
- `bigInt(): bigint` — Returns the address as a `bigint` [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L264)
|
|
140
|
+
- `startAddress(): Address4` — The first address in the range given by this address' subnet. Often referred to as the Network Address. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L281)
|
|
141
|
+
- `startAddressExclusive(): Address4` — The first host address in the range given by this address's subnet ie the first address after the Network Address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L290)
|
|
142
|
+
- `endAddress(): Address4` — The last address in the range given by this address' subnet Often referred to as the Broadcast [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L308)
|
|
143
|
+
- `endAddressExclusive(): Address4` — The last host address in the range given by this address's subnet ie the last address prior to the Broadcast Address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L317)
|
|
144
|
+
- `subnetMaskAddress(): Address4` — The dotted-decimal form of the subnet mask, e.g. `255.255.240.0` for a `/20`. Returns an `Address4`; call `.correctForm()` for the string. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L327)
|
|
145
|
+
- `wildcardMask(): Address4` — The Cisco-style wildcard mask, e.g. `0.0.0.255` for a `/24`. This is the bitwise inverse of `subnetMaskAddress()`. Returns an `Address4`; call `.correctForm()` for the string. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L339)
|
|
146
|
+
- `networkForm(): string` — The network address in CIDR string form, e.g. `192.168.1.0/24` for `192.168.1.5/24`. For an address with no explicit subnet the prefix is `/32`, e.g. `networkForm()` on `192.168.1.5` returns `192.168.1.5/32`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L351)
|
|
147
|
+
- `mask(mask?: number): string` — Returns the first n bits of the address, defaulting to the subnet mask [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L410)
|
|
148
|
+
- `getBitsBase2(start: number, end: number): string` — Returns the bits in the given range as a base-2 string [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L422)
|
|
149
|
+
- `reverseForm(options?: ReverseFormOptions): string` — Return the reversed ip6.arpa form of the address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L432)
|
|
150
|
+
- `isMulticast(): boolean` — Returns true if the given address is a multicast address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L456)
|
|
151
|
+
- `isPrivate(): boolean` — Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L464)
|
|
152
|
+
- `isLoopback(): boolean` — Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L472)
|
|
153
|
+
- `isLinkLocal(): boolean` — Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L480)
|
|
154
|
+
- `isUnspecified(): boolean` — Returns true if the address is the unspecified address `0.0.0.0`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L488)
|
|
155
|
+
- `isBroadcast(): boolean` — Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L496)
|
|
156
|
+
- `isCGNAT(): boolean` — Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L504)
|
|
157
|
+
- `binaryZeroPad(): string` — Returns a zero-padded base-2 string representation of the address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L512)
|
|
158
|
+
- `groupForV6(): string` — Groups an IPv4 address for inclusion at the end of an IPv6 address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L523)
|
|
159
|
+
|
|
160
|
+
**Properties**
|
|
161
|
+
|
|
162
|
+
- `address: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L14)
|
|
163
|
+
- `addressMinusSuffix: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L15)
|
|
164
|
+
- `groups: number` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L16)
|
|
165
|
+
- `parsedAddress: string[]` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L17)
|
|
166
|
+
- `parsedSubnet: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L18)
|
|
167
|
+
- `subnet: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L19)
|
|
168
|
+
- `subnetMask: number` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L20)
|
|
169
|
+
- `v4: boolean` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L21)
|
|
170
|
+
- `isCorrect: (this: Address4 | Address6) => boolean` — Returns true if the address is correct, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L93)
|
|
171
|
+
- `isInSubnet: (this: Address4 | Address6, address: Address4 | Address6) => boolean` — Returns true if the given address is in the subnet of the current address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv4.ts#L450)
|
|
172
|
+
|
|
173
|
+
#### Address6
|
|
174
|
+
|
|
175
|
+
Represents an IPv6 address
|
|
176
|
+
|
|
177
|
+
**Constructor**
|
|
178
|
+
|
|
179
|
+
- `new Address6(address: string, optionalGroups?: number): Address6`
|
|
180
|
+
|
|
181
|
+
**Static methods**
|
|
182
|
+
|
|
183
|
+
- `static isValid(address: string): boolean` — Returns true if the given string is a valid IPv6 address (with optional CIDR subnet and zone identifier), false otherwise. Host bits in the subnet portion are allowed (e.g. `2001:db8::1/32` is valid); for strict network-address validation compare `correctForm()` to `startAddress().correctForm()`, or use `networkForm()`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L163)
|
|
184
|
+
- `static fromBigInt(bigInt: bigint): Address6` — Convert a BigInt to a v6 address object. The value must be in the range `[0, 2**128 - 1]`; otherwise `AddressError` is thrown. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L184)
|
|
185
|
+
- `static fromURL(url: string): { error: string; address: null; port: null } | { error?: undefined; address: Address6; port: number | null }` — Parse a URL (with optional bracketed host and port) into an address and port. Returns either `{ address, port }` on success or `{ error, address: null, port: null }` if the URL could not be parsed. Ports are returned as numbers (or `null` if absent or out of range). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L209)
|
|
186
|
+
- `static fromAddressAndMask(address: string, mask: string): Address6` — Construct an `Address6` from an address and a hex subnet mask given as separate strings (e.g. as returned by Node's `os.networkInterfaces()`). Throws `AddressError` if the mask is non-contiguous (e.g. `ffff::ffff`). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L273)
|
|
187
|
+
- `static fromAddressAndWildcardMask(address: string, wildcardMask: string): Address6` — Construct an `Address6` from an address and a Cisco-style wildcard mask given as separate strings (e.g. `::ffff:ffff:ffff:ffff` for a `/64`). The wildcard mask is the bitwise inverse of the subnet mask. Throws `AddressError` if the mask is non-contiguous. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L287)
|
|
188
|
+
- `static fromWildcard(input: string): Address6` — Construct an `Address6` from a wildcard pattern with trailing `*` groups. The number of trailing wildcards determines the prefix length: each `*` represents 16 bits. `::` is expanded to zero groups (not wildcards) before evaluating trailing wildcards. Only trailing whole-group wildcards are supported. Partial-group wildcards (e.g. `2001:db8::0*`) and interior wildcards (e.g. `*::1`) throw `AddressError`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L310)
|
|
189
|
+
- `static fromAddress4(address: string): Address6` — Create an IPv6-mapped address given an IPv4 address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L371)
|
|
190
|
+
- `static fromArpa(arpaFormAddress: string): Address6` — Return an address from ip6.arpa form [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L387)
|
|
191
|
+
- `static fromAddress4Nat64(address: string, prefix: string): Address6` — Embed an IPv4 address into a NAT64 IPv6 address using the encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). The default prefix is the well-known prefix `64:ff9b::/96`. The prefix length must be one of 32, 40, 48, 56, 64, or 96; for prefixes shorter than /64 the IPv4 octets are split around the reserved bits 64–71. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1048)
|
|
192
|
+
- `static fromByteArray(bytes: any[]): Address6` — Convert a byte array to an Address6 object. To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1154)
|
|
193
|
+
- `static fromUnsignedByteArray(bytes: any[]): Address6` — Convert an unsigned byte array to an Address6 object. To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1164)
|
|
194
|
+
|
|
195
|
+
**Instance methods**
|
|
196
|
+
|
|
197
|
+
- `microsoftTranscription(): string` — Return the Microsoft UNC transcription of the address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L413)
|
|
198
|
+
- `mask(mask?: number): string` — Return the first n bits of the address, defaulting to the subnet mask [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L422)
|
|
199
|
+
- `possibleSubnets(subnetSize?: number): string` — Return the number of possible subnets of a given size in the address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L432)
|
|
200
|
+
- `startAddress(): Address6` — The first address in the range given by this address' subnet Often referred to as the Network Address. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L457)
|
|
201
|
+
- `startAddressExclusive(): Address6` — The first host address in the range given by this address's subnet ie the first address after the Network Address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L466)
|
|
202
|
+
- `endAddress(): Address6` — The last address in the range given by this address' subnet Often referred to as the Broadcast [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L484)
|
|
203
|
+
- `endAddressExclusive(): Address6` — The last host address in the range given by this address's subnet ie the last address prior to the Broadcast Address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L493)
|
|
204
|
+
- `subnetMaskAddress(): Address6` — The hex form of the subnet mask, e.g. `ffff:ffff:ffff:ffff::` for a `/64`. Returns an `Address6`; call `.correctForm()` for the string. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L503)
|
|
205
|
+
- `wildcardMask(): Address6` — The Cisco-style wildcard mask, e.g. `::ffff:ffff:ffff:ffff` for a `/64`. This is the bitwise inverse of `subnetMaskAddress()`. Returns an `Address6`; call `.correctForm()` for the string. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L515)
|
|
206
|
+
- `networkForm(): string` — The network address in CIDR string form, e.g. `2001:db8::/32` for `2001:db8::1/32`. For an address with no explicit subnet the prefix is `/128`, e.g. `networkForm()` on `2001:db8::1` returns `2001:db8::1/128`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L528)
|
|
207
|
+
- `getScope(): string` — Return the scope of the address. The 4-bit scope field ([RFC 4291 §2.7](https://datatracker.ietf.org/doc/html/rfc4291#section-2.7)) is only defined for multicast addresses; for unicast addresses the scope is derived from the address type per [RFC 4007 §6](https://datatracker.ietf.org/doc/html/rfc4007#section-6). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L540)
|
|
208
|
+
- `getType(): string` — Return the type of the address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L567)
|
|
209
|
+
- `getBits(start: number, end: number): bigint` — Return the bits in the given range as a BigInt [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L582)
|
|
210
|
+
- `getBitsBase2(start: number, end: number): string` — Return the bits in the given range as a base-2 string [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L590)
|
|
211
|
+
- `getBitsBase16(start: number, end: number): string` — Return the bits in the given range as a base-16 string [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L598)
|
|
212
|
+
- `getBitsPastSubnet(): string` — Return the bits that are set past the subnet mask length [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L614)
|
|
213
|
+
- `reverseForm(options?: ReverseFormOptions): string` — Return the reversed ip6.arpa form of the address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L624)
|
|
214
|
+
- `correctForm(): string` — Returns the address in correct form, per [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952): leading zeros stripped, the longest run of zero groups collapsed to `::`, and hex digits lowercased (e.g. `2001:db8::1`). This is the recommended form for display. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L659)
|
|
215
|
+
- `binaryZeroPad(): string` — Return a zero-padded base-2 string representation of the address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L721)
|
|
216
|
+
- `parse4in6(address: string): string` — Parses a v4-in-v6 string (e.g. `::ffff:192.168.0.1`) by extracting the trailing IPv4 address into `this.address4` / `this.parsedAddress4` and returning the address with the v4 portion converted to two v6 groups. Used internally by `parse()`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L735)
|
|
217
|
+
- `parse(address: string): string[]` — Parses an IPv6 address string into its 8 hexadecimal groups (expanding any `::` elision and any trailing v4-in-v6 portion) and stores the result on `this.parsedAddress`. Called automatically by the constructor; you typically don't need to call it directly. Throws `AddressError` if the input is malformed. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L783)
|
|
218
|
+
- `canonicalForm(): string` — Returns the canonical (fully expanded) form of the address: all 8 groups, each padded to 4 hex digits, with no `::` collapsing (e.g. `2001:0db8:0000:0000:0000:0000:0000:0001`). Useful for sorting and byte-exact comparison. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L863)
|
|
219
|
+
- `decimal(): string` — Return the decimal form of the address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L871)
|
|
220
|
+
- `bigInt(): bigint` — Return the address as a BigInt [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L879)
|
|
221
|
+
- `to4(): Address4` — Return the last two groups of this address as an IPv4 address string. If this address carries a CIDR prefix that covers the trailing 32 bits (i.e. `subnetMask >= 96`), the resulting `Address4` inherits the corresponding v4 prefix (`subnetMask - 96`); otherwise it defaults to `/32`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L894)
|
|
222
|
+
- `to4in6(): string` — Return the v4-in-v6 form of the address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L916)
|
|
223
|
+
- `inspectTeredo(): TeredoProperties` — Decodes the Teredo tunneling fields embedded in this address. Returns the Teredo prefix, server IPv4, client IPv4, raw flag bits, cone-NAT flag, UDP port, and Microsoft-format flag breakdown (reserved, universal/local, group/individual, nonce). Only meaningful for addresses in `2001::/32`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L937)
|
|
224
|
+
- `inspect6to4(): SixToFourProperties` — Decodes the 6to4 tunneling fields embedded in this address. Returns the 6to4 prefix and the embedded IPv4 gateway address. Only meaningful for addresses in `2002::/16`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1002)
|
|
225
|
+
- `to6to4(): Address6 | null` — Return a v6 6to4 address from a v6 v4inv6 address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1022)
|
|
226
|
+
- `toAddress4Nat64(prefix: string): Address4 | null` — Extract the embedded IPv4 address from a NAT64 IPv6 address using the encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). The default prefix is the well-known prefix `64:ff9b::/96`. Returns `null` if this address is not contained within the given prefix. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1089)
|
|
227
|
+
- `toByteArray(): number[]` — Return a byte array. To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toByteArray())`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1124)
|
|
228
|
+
- `toUnsignedByteArray(): number[]` — Return an unsigned byte array. To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toUnsignedByteArray())`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1144)
|
|
229
|
+
- `isCanonical(): boolean` — Returns true if the address is in the canonical form, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1195)
|
|
230
|
+
- `isLinkLocal(): boolean` — Returns true if the address is a link local address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1203)
|
|
231
|
+
- `isMulticast(): boolean` — Returns true if the address is a multicast address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1219)
|
|
232
|
+
- `is4(): boolean` — Returns true if the address was written in v4-in-v6 dotted-quad notation (e.g. `::ffff:127.0.0.1`), false otherwise. This is a notation-level flag and does not reflect whether the address bits lie in the IPv4-mapped (`::ffff:0:0/96`) subnet — for that, see isMapped4. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1231)
|
|
233
|
+
- `isMapped4(): boolean` — Returns true if the address is an IPv4-mapped IPv6 address in `::ffff:0:0/96` ([RFC 4291 §2.5.5.2](https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2)), false otherwise. Unlike is4, this checks the underlying address bits rather than the textual notation, so `::ffff:127.0.0.1` and `::ffff:7f00:1` both return true. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1243)
|
|
234
|
+
- `isTeredo(): boolean` — Returns true if the address is a Teredo address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1251)
|
|
235
|
+
- `is6to4(): boolean` — Returns true if the address is a 6to4 address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1259)
|
|
236
|
+
- `isLoopback(): boolean` — Returns true if the address is a loopback address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1267)
|
|
237
|
+
- `isULA(): boolean` — Returns true if the address is a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)). ULAs are the IPv6 equivalent of IPv4 [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private addresses. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1275)
|
|
238
|
+
- `isUnspecified(): boolean` — Returns true if the address is the unspecified address `::`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1283)
|
|
239
|
+
- `isDocumentation(): boolean` — Returns true if the address is in the documentation prefix `2001:db8::/32` ([RFC 3849](https://datatracker.ietf.org/doc/html/rfc3849)). [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1291)
|
|
240
|
+
- `href(optionalPort?: string | number): string` — Returns the address as an HTTP URL with the host bracketed, e.g. `http://[2001:db8::1]/`. If `optionalPort` is provided it is appended, e.g. `http://[2001:db8::1]:8080/`. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1302)
|
|
241
|
+
- `link(options?: { className?: string; prefix?: string; v4?: boolean }): string` — Returns an HTML `<a>` element whose `href` encodes the address in a URL hash fragment (default prefix `/#address=`). Useful for linking between pages of an address-inspector UI. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1320)
|
|
242
|
+
- `group(): string` — Groups an address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1360)
|
|
243
|
+
- `regularExpressionString(this: Address6, substringSearch: boolean): string` — Generate a regular expression string that can be used to find or validate all variations of this address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1412)
|
|
244
|
+
- `regularExpression(this: Address6, substringSearch: boolean): RegExp` — Generate a regular expression that can be used to find or validate all variations of this address. [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1466)
|
|
245
|
+
|
|
246
|
+
**Properties**
|
|
247
|
+
|
|
248
|
+
- `address4: Address4` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L98)
|
|
249
|
+
- `address: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L99)
|
|
250
|
+
- `addressMinusSuffix: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L100)
|
|
251
|
+
- `elidedGroups: number` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L101)
|
|
252
|
+
- `elisionBegin: number` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L102)
|
|
253
|
+
- `elisionEnd: number` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L103)
|
|
254
|
+
- `groups: number` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L104)
|
|
255
|
+
- `parsedAddress4: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L105)
|
|
256
|
+
- `parsedAddress: string[]` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L106)
|
|
257
|
+
- `parsedSubnet: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L107)
|
|
258
|
+
- `subnet: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L108)
|
|
259
|
+
- `subnetMask: number` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L109)
|
|
260
|
+
- `v4: boolean` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L110)
|
|
261
|
+
- `zone: string` — [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L111)
|
|
262
|
+
- `isInSubnet: (this: Address4 | Address6, address: Address4 | Address6) => boolean` — Returns true if the given address is in the subnet of the current address [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1183)
|
|
263
|
+
- `isCorrect: (this: Address4 | Address6) => boolean` — Returns true if the address is correct, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/master/src/ipv6.ts#L1189)
|
|
264
|
+
|
|
265
|
+
<!-- API:END -->
|
|
64
266
|
|
|
65
267
|
### Used by
|
|
66
268
|
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
- [
|
|
71
|
-
- [
|
|
72
|
-
|
|
73
|
-
- [
|
|
74
|
-
- [
|
|
75
|
-
|
|
76
|
-
- [
|
|
77
|
-
quickly geolocating IP addresses
|
|
78
|
-
- [hexabus](https://github.com/mysmartgrid/hexabus): an IPv6-based home
|
|
79
|
-
automation bus
|
|
80
|
-
- [hubot-deploy](https://github.com/atmos/hubot-deploy): GitHub Flow via hubot
|
|
81
|
-
- [heroku-portscanner](https://github.com/robison/heroku-portscanner): nmap
|
|
82
|
-
hosted on Heroku
|
|
83
|
-
- [ipfs-swarm](https://github.com/diasdavid/node-ipfs-swarm): a swarm
|
|
84
|
-
implementation based on IPFS
|
|
85
|
-
- [javascript-x-server](https://github.com/GothAck/javascript-x-server): an X
|
|
86
|
-
server written in JavaScript
|
|
87
|
-
- [libnmap](https://github.com/jas-/node-libnmap): a node API for nmap
|
|
88
|
-
- [mail-io](https://github.com/mofux/mail-io): a lightweight SMTP server
|
|
89
|
-
- [maxmind-db-reader](https://github.com/PaddeK/node-maxmind-db): a library for
|
|
90
|
-
reading MaxMind database files
|
|
91
|
-
- [proxy-protocol-v2](https://github.com/ably/proxy-protocol-v2): a proxy
|
|
92
|
-
protocol encoder/decoder built by [Ably](https://www.ably.io/)
|
|
93
|
-
- [Samsara](https://github.com/mariusGundersen/Samsara): a Docker web interface
|
|
94
|
-
- [sis-api](https://github.com/sis-cmdb/sis-api): a configuration management
|
|
95
|
-
database API
|
|
96
|
-
- [socks5-client](https://github.com/mattcg/socks5-client): a SOCKS v5 client
|
|
97
|
-
- [socksified](https://github.com/vially/node-socksified): a SOCKS v5 client
|
|
98
|
-
- [socksv5](https://github.com/mscdex/socksv5): a SOCKS v5 server/client
|
|
99
|
-
- [ssdapi](https://github.com/rsolomou/ssdapi): an API created by the
|
|
100
|
-
University of Portsmouth
|
|
101
|
-
- [SwitchyOmega](https://github.com/FelisCatus/SwitchyOmega): a [Chrome
|
|
102
|
-
extension](https://chrome.google.com/webstore/detail/padekgcemlokbadohgkifijomclgjgif)
|
|
103
|
-
for switching between multiple proxies with ~311k users!
|
|
104
|
-
- [swiz](https://github.com/racker/node-swiz): a serialization framework built
|
|
105
|
-
and used by [Rackspace](http://www.rackspace.com/)
|
|
269
|
+
`ip-address` is downloaded ~66 million times per week, mostly via the Node proxy/agent ecosystem. The dependency chain runs through a handful of widely-used packages:
|
|
270
|
+
|
|
271
|
+
- [**socks**](https://github.com/JoshGlazebrook/socks) (~53M weekly) — SOCKS4/5 client for Node; depends on `ip-address` directly. The single biggest source of downloads.
|
|
272
|
+
- [**socks-proxy-agent**](https://github.com/TooTallNate/proxy-agents/tree/main/packages/socks-proxy-agent) (~57M weekly) — `http.Agent` for SOCKS proxies; depends on `socks`. Bundled by virtually every CLI that respects `HTTPS_PROXY`.
|
|
273
|
+
- [**npm**](https://github.com/npm/cli) and [**pnpm**](https://github.com/pnpm/pnpm) — both bundle `socks-proxy-agent` through their HTTP fetch stack (`make-fetch-happen` → `@npmcli/agent`), so every Node install on the planet pulls in `ip-address` as a transitive dependency.
|
|
274
|
+
- [**Puppeteer**](https://github.com/puppeteer/puppeteer) — `@puppeteer/browsers` uses `proxy-agent` for browser-binary downloads, which routes through `socks-proxy-agent` → `socks` → `ip-address`.
|
|
275
|
+
- [**proxy-agent**](https://github.com/TooTallNate/proxy-agents/tree/main/packages/proxy-agent) (~28M weekly) and [**pac-proxy-agent**](https://github.com/TooTallNate/proxy-agents/tree/main/packages/pac-proxy-agent) (~27M weekly) — auto-detecting proxy agents (HTTP/HTTPS/SOCKS/PAC) used widely in scraping, headless-browser, and CI tooling.
|
|
276
|
+
- [**cacache**](https://github.com/npm/cacache) (~44M weekly) — npm's content-addressable cache; pulls in the same fetch stack.
|
|
277
|
+
|
|
278
|
+
Beyond the proxy chain, `ip-address` has been used by Juniper Networks' Contrail, Ably's proxy-protocol implementation, Rackspace's serialization framework, IPFS, and the [SwitchyOmega](https://github.com/FelisCatus/SwitchyOmega) Chrome extension, among many others.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-error.js","sourceRoot":"","sources":["../src/address-error.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IAGrC,YAAY,OAAe,EAAE,YAAqB;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAE3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF;AAVD,oCAUC"}
|
|
1
|
+
{"version":3,"file":"address-error.js","sourceRoot":"","sources":["../src/address-error.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IAGrC,YAAY,OAAe,EAAE,YAAqB;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAE3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF;AAVD,oCAUC","sourcesContent":["export class AddressError extends Error {\n parseMessage?: string;\n\n constructor(message: string, parseMessage?: string) {\n super(message);\n\n this.name = 'AddressError';\n\n this.parseMessage = parseMessage;\n }\n}\n"]}
|
|
@@ -5,6 +5,12 @@ export interface ReverseFormOptions {
|
|
|
5
5
|
}
|
|
6
6
|
export declare function isInSubnet(this: Address4 | Address6, address: Address4 | Address6): boolean;
|
|
7
7
|
export declare function isCorrect(defaultBits: number): (this: Address4 | Address6) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the prefix length (number of leading 1 bits) of a contiguous
|
|
10
|
+
* subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.
|
|
11
|
+
* `255.0.255.0`).
|
|
12
|
+
*/
|
|
13
|
+
export declare function prefixLengthFromMask(value: bigint, totalBits: number): number;
|
|
8
14
|
export declare function numberToPaddedHex(number: number): string;
|
|
9
15
|
export declare function stringToPaddedHex(numberString: string): string;
|
|
10
16
|
/**
|
|
@@ -12,4 +18,3 @@ export declare function stringToPaddedHex(numberString: string): string;
|
|
|
12
18
|
* @param position Byte position, where 0 is the least significant bit
|
|
13
19
|
*/
|
|
14
20
|
export declare function testBit(binaryValue: string, position: number): boolean;
|
|
15
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isInSubnet = isInSubnet;
|
|
4
4
|
exports.isCorrect = isCorrect;
|
|
5
|
+
exports.prefixLengthFromMask = prefixLengthFromMask;
|
|
5
6
|
exports.numberToPaddedHex = numberToPaddedHex;
|
|
6
7
|
exports.stringToPaddedHex = stringToPaddedHex;
|
|
7
8
|
exports.testBit = testBit;
|
|
9
|
+
const address_error_1 = require("./address-error");
|
|
8
10
|
function isInSubnet(address) {
|
|
9
11
|
if (this.subnetMask < address.subnetMask) {
|
|
10
12
|
return false;
|
|
@@ -25,6 +27,25 @@ function isCorrect(defaultBits) {
|
|
|
25
27
|
return this.parsedSubnet === String(this.subnetMask);
|
|
26
28
|
};
|
|
27
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Returns the prefix length (number of leading 1 bits) of a contiguous
|
|
32
|
+
* subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.
|
|
33
|
+
* `255.0.255.0`).
|
|
34
|
+
*/
|
|
35
|
+
function prefixLengthFromMask(value, totalBits) {
|
|
36
|
+
const binary = value.toString(2).padStart(totalBits, '0');
|
|
37
|
+
if (binary.length > totalBits) {
|
|
38
|
+
throw new address_error_1.AddressError('Invalid subnet mask.');
|
|
39
|
+
}
|
|
40
|
+
const firstZero = binary.indexOf('0');
|
|
41
|
+
if (firstZero === -1) {
|
|
42
|
+
return totalBits;
|
|
43
|
+
}
|
|
44
|
+
if (binary.slice(firstZero).includes('1')) {
|
|
45
|
+
throw new address_error_1.AddressError('Invalid subnet mask.');
|
|
46
|
+
}
|
|
47
|
+
return firstZero;
|
|
48
|
+
}
|
|
28
49
|
function numberToPaddedHex(number) {
|
|
29
50
|
return number.toString(16).padStart(2, '0');
|
|
30
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;AAQA,gCAUC;AAED,8BAYC;AAOD,oDAkBC;AAED,8CAEC;AAED,8CAEC;AAMD,0BASC;AA9ED,mDAA+C;AAM/C,SAAgB,UAAU,CAA4B,OAA4B;IAChF,IAAI,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,SAAS,CAAC,WAAmB;IAC3C,OAAO;QACL,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,KAAa,EAAE,SAAiB;IACnE,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAE1D,IAAI,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,4BAAY,CAAC,sBAAsB,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtC,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,4BAAY,CAAC,sBAAsB,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,iBAAiB,CAAC,MAAc;IAC9C,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,iBAAiB,CAAC,YAAoB;IACpD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,WAAmB,EAAE,QAAgB;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAE/B,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,OAAO,WAAW,CAAC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;AAC/E,CAAC","sourcesContent":["import { Address4 } from './ipv4';\nimport { Address6 } from './ipv6';\nimport { AddressError } from './address-error';\n\nexport interface ReverseFormOptions {\n omitSuffix?: boolean;\n}\n\nexport function isInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n if (this.subnetMask < address.subnetMask) {\n return false;\n }\n\n if (this.mask(address.subnetMask) === address.mask()) {\n return true;\n }\n\n return false;\n}\n\nexport function isCorrect(defaultBits: number) {\n return function (this: Address4 | Address6) {\n if (this.addressMinusSuffix !== this.correctForm()) {\n return false;\n }\n\n if (this.subnetMask === defaultBits && !this.parsedSubnet) {\n return true;\n }\n\n return this.parsedSubnet === String(this.subnetMask);\n };\n}\n\n/**\n * Returns the prefix length (number of leading 1 bits) of a contiguous\n * subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.\n * `255.0.255.0`).\n */\nexport function prefixLengthFromMask(value: bigint, totalBits: number): number {\n const binary = value.toString(2).padStart(totalBits, '0');\n\n if (binary.length > totalBits) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n const firstZero = binary.indexOf('0');\n\n if (firstZero === -1) {\n return totalBits;\n }\n\n if (binary.slice(firstZero).includes('1')) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n return firstZero;\n}\n\nexport function numberToPaddedHex(number: number) {\n return number.toString(16).padStart(2, '0');\n}\n\nexport function stringToPaddedHex(numberString: string) {\n return numberToPaddedHex(parseInt(numberString, 10));\n}\n\n/**\n * @param binaryValue Binary representation of a value (e.g. `10`)\n * @param position Byte position, where 0 is the least significant bit\n */\nexport function testBit(binaryValue: string, position: number): boolean {\n const { length } = binaryValue;\n\n if (position > length) {\n return false;\n }\n\n const positionInString = length - position;\n return binaryValue.substring(positionInString, positionInString + 1) === '1';\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ip-address.js","sourceRoot":"","sources":["../src/ip-address.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAErB,sDAAwC;AAE3B,QAAA,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"ip-address.js","sourceRoot":"","sources":["../src/ip-address.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAErB,sDAAwC;AAE3B,QAAA,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC","sourcesContent":["export { Address4 } from './ipv4';\nexport { Address6 } from './ipv6';\nexport { AddressError } from './address-error';\n\nimport * as helpers from './v6/helpers';\n\nexport const v6 = { helpers };\n"]}
|