Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,21 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Set version from release tag
run: npm version ${{ github.event.release.tag_name }} --git-tag-version=false

- name: Generate jsr.json from package.json
run: |
jq '{
name: .name,
version: .version,
license: .license,
exports: "src/index.ts"
}' package.json > jsr.json

- name: Publish to JSR
run: npx jsr publish

- name: Download build artifact
uses: actions/download-artifact@v8
with:
Expand All @@ -136,9 +151,6 @@ jobs:
working-directory: ./package
run: tar -xzf cldn-ip-0.0.0-dev.tgz

- name: Set version from release tag
run: npm version ${{ github.event.release.tag_name }} --git-tag-version=false

- name: Copy package.json to build package
run: cp package.json package/package

Expand Down
4 changes: 2 additions & 2 deletions src/Subnet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright © 2024–2025 Cloudnode OÜ.
* Copyright © 2024–2026 Cloudnode OÜ.
*
* This file is part of @cldn/ip.
*
Expand All @@ -25,7 +25,7 @@ export class Subnet<T extends IP> implements Network<T> {
/**
* Subnet for IPv4-mapped IPv6 addresses (`::ffff:0.0.0.0/96`).
*/
public static readonly IPV4_MAPPED_IPV6 = Subnet.fromCIDR(
public static readonly IPV4_MAPPED_IPV6: Subnet<IP> = Subnet.fromCIDR(
"::ffff:0.0.0.0/96",
);

Expand Down
6 changes: 3 additions & 3 deletions src/SubnetList.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright © 2024–2025 Cloudnode OÜ.
* Copyright © 2024–2026 Cloudnode OÜ.
*
* This file is part of @cldn/ip.
*
Expand All @@ -23,7 +23,7 @@ export class SubnetList implements Network {
/**
* A network of reserved subnets. This network does not contain publicly routable IP addresses.
*/
public static readonly BOGON = new SubnetList([
public static readonly BOGON: SubnetList = new SubnetList([
// IPv4
Subnet.fromCIDR("0.0.0.0/8"),
Subnet.fromCIDR("10.0.0.0/8"),
Expand Down Expand Up @@ -133,7 +133,7 @@ export class SubnetList implements Network {
* @param subnet Subnet to remove.
* @returns Whether the subnet was found and removed.
*/
public remove(subnet: Subnet<IP>) {
public remove(subnet: Subnet<IP>): boolean {
for (const [index, s] of this.#subnets.entries()) {
if (s.equals(subnet)) {
this.#subnets.splice(index, 1);
Expand Down
Loading