Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ip-cidr

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip-cidr - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6

65

index.d.ts

@@ -1,49 +0,48 @@

export = ipcidr;
export as namespace ipcidr;
import { Address4, Address6 } from "ip-address";
import { BigInteger } from "jsbn";
import {Address4, Address6} from "ip-address";
import {BigInteger} from "jsbn";
declare class IPCIDR {
constructor(cidr: string);
declare namespace ipcidr {
type Address = Address4 | Address6;
type FormatResult = BigInteger | Address | string;
formatIP<T = IPCIDR.FormatResult>(address: IPCIDR.Address, options?: any): T;
interface FormatOptions {
type: "bigInteger" | "addressObject",
from: number | BigInteger;
limit: number | BigInteger;
}
start<T = IPCIDR.FormatResult>(options?: IPCIDR.FormatOptions): T;
interface ChunkInfo {
from: BigInteger;
to: BigInteger;
limit: number;
length: number;
}
end<T = IPCIDR.FormatResult>(options?: IPCIDR.FormatOptions): T;
interface IPCIDR {
constructor(cidr: string): IPCIDR;
toRange<T = IPCIDR.FormatResult>(options?: IPCIDR.FormatOptions): [T, T];
formatIP<T = FormatResult>(address: Address, options?: any): T;
loop<T = IPCIDR.FormatResult, R = any>(fn: (ip: T) => Promise<R>, options: IPCIDR.FormatOptions, results?: IPCIDR.ChunkInfo): Promise<R>[];
start<T = FormatResult>(options?: FormatOptions): T;
getChunkInfo(length: number, options: IPCIDR.FormatOptions): IPCIDR.ChunkInfo;
end<T = FormatResult>(options?: FormatOptions): T;
contains(address: IPCIDR.Address | string): boolean;
toRange<T = FormatResult>(options?: FormatOptions): [T, T];
isValid(): boolean;
loop<T = FormatResult, R = any>(fn: (ip: T) => Promise<R>, options: FormatOptions, results?: ChunkInfo): Promise<R>[];
toString(): string;
getChunkInfo(length: number, options: FormatOptions): ChunkInfo;
toArray(): string[];
contains(address: Address | string): boolean;
toObject(): { start: string, end: string };
}
isValid(): boolean;
declare namespace IPCIDR {
type Address = Address4 | Address6;
type FormatResult = BigInteger | Address | string;
toString(): string;
interface FormatOptions {
type: "bigInteger" | "addressObject",
from: number | BigInteger;
limit: number | BigInteger;
}
toArray(): string[];
interface ChunkInfo {
from: BigInteger;
to: BigInteger;
limit: number;
length: number;
}
}
toObject(): { start: string, end: string };
}
}
export = IPCIDR;
{
"name": "ip-cidr",
"version": "2.0.5",
"version": "2.0.6",
"description": "Module for working with CIDR (v4, v6)",

@@ -5,0 +5,0 @@ "main": "./index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc