net-address 0.1.2 → 0.2.0
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/README.md +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +452 -43
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +452 -43
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/packages/net-address/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Err as e,None as t,Ok as n,Result as r,Some as i}from"@luolapeikko/result-option";var a=class a{static regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;static from(t){return typeof t!=`string`||!a.regex.test(t)?e(TypeError(`${JSON.stringify(t)} is invalid ipv6 value`)):a.#t(t).andThen(({leftSegs:t,rightSegs:r,embeddedIpv4:i})=>{let o=Array(8).fill(0);for(let e=0;e<t.length;e++)o[e]=t[e];let s=8-r.length-i.length;for(let e=0;e<r.length;e++)o[s+e]=r[e];for(let e=0;e<i.length;e++)o[s+r.length+e]=i[e];try{return n(new a(o))}catch(t){return e(t)}})}static fromBuffer(t,r){try{let e=new DataView(t);if(r){let t=e.getBigUint64(0,!0),r=e.getBigUint64(8,!0);return n(new a(r<<64n|t))}{let t=e.getBigUint64(0,!1),r=e.getBigUint64(8,!1);return n(new a(t<<64n|r))}}catch(t){return e(t)}}static#e(t,r){let i=parseInt(t,r);return Number.isNaN(i)?e(TypeError(`${t} is not a valid number`)):n(i)}static#t(e){let t=e.split(`::`),i=t[0].split(`:`).filter(e=>e!==``),o=t.length>1?t[1].split(`:`).filter(e=>e!==``):[],s=[],c=o[o.length-1]??i[i.length-1];if(c?.includes(`.`)){let e=a.#n(c);if(e.isErr)return e;s=e.ok(),o.length>0?o.pop():i.pop()}return r.tupleFlow(r.asArray(i.map(e=>a.#e(e,16))),()=>r.asArray(o.map(e=>a.#e(e,16))),(e,t)=>n({leftSegs:e,rightSegs:t,embeddedIpv4:s}))}static#n(e){return r.asArray(e.split(`.`).map(e=>a.#e(e,10))).andThen(e=>n([e[0]<<8|e[1],e[2]<<8|e[3]]))}static BITS=128;static LOCALHOST=new a(1n);static UNSPECIFIED=new a(0n);family=`ipv6`;#r;get value(){return this.#r}constructor(e){if(Array.isArray(e)&&e.every(e=>typeof e==`number`))this.#r=this.#i(e);else if(typeof e==`bigint`)this.#r=e;else throw TypeError(`Invalid Ipv6Addr arguments. Expected either 1 bigint or 8 numbers (segments).`)}isBenchmarking(){return this.#o(42540488320432167789079031612388147200n,48)}isDocumentation(){return this.#o(42540766411282592856903984951653826560n,32)||this.#o(85065399433376081038215121361612832768n,20)}isLoopback(){return this.#r===1n}isUnspecified(){return this.#r===0n}isMulticast(){return this.#r>>120n==255n}isMulticastInterfaceLocal(){return this.#o(338958331222012082418099330867817086976n,16)}isMulticastLinkLocal(){return this.#o(338963523518870617245727861364146307072n,16)}isMulticastRealmLocal(){return this.#o(338968715815729152073356391860475527168n,16)}isMulticastAdminLocal(){return this.#o(338973908112587686900984922356804747264n,16)}isMulticastSiteLocal(){return this.#o(338979100409446221728613452853133967360n,16)}isMulticastOrganizationLocal(){return this.#o(338994677300021826211499044342121627648n,16)}isMulticastGlobal(){return this.#o(339025831081173035177270227320096948224n,16)}isIpv4Mapped(){return this.#o(281470681743360n,96)}isUnicast(){return!this.isMulticast()}isUnicastLinkLocal(){return this.#o(338288524927261089654018896841347694592n,10)}isUnicastGlobal(){return this.isUnicast()&&!this.isLoopback()&&!this.isUnicastLinkLocal()&&!this.isUniqueLocal()&&!this.isUnspecified()&&!this.isDocumentation()}isGlobal(){return!this.isUnspecified()&&!this.isLoopback()&&!this.isIpv4Mapped()&&!this.isBenchmarking()&&!this.isDocumentation()&&!this.isUniqueLocal()&&!this.isUnicastLinkLocal()&&!this.isMulticast()}isUniqueLocal(){return this.#o(334965454937798799971759379190646833152n,7)}toIpv4(){if(this.isIpv4Mapped()||this.#o(0n,96)){let e=this.#a(this.#r);return i(new o(e[6]>>8,e[6]&255,e[7]>>8,e[7]&255))}return t()}toIpv4Mapped(){if(this.isIpv4Mapped()){let e=this.#a(this.#r);return i(new o(e[6]>>8,e[6]&255,e[7]>>8,e[7]&255))}return t()}toString(){let e=this.#a(this.#r),t=-1,n=0,r=-1,i=0;for(let a=0;a<e.length;a++)e[a]===0?(r===-1?(r=a,i=1):i++,i>n&&(n=i,t=r)):(r=-1,i=0);if(n<2)return e.map(e=>e.toString(16)).join(`:`);let a=e.slice(0,t).map(e=>e.toString(16)),o=e.slice(t+n).map(e=>e.toString(16));return`${a.join(`:`)}::${o.join(`:`)}`}toBuffer(e){let t=new ArrayBuffer(16),n=new DataView(t);return e?(n.setBigUint64(0,this.#r&18446744073709551615n,!0),n.setBigUint64(8,this.#r>>64n,!0)):(n.setBigUint64(0,this.#r>>64n,!1),n.setBigUint64(8,this.#r&18446744073709551615n,!1)),t}equals(e){return`family`in e&&this.family===e.family&&this.#r===e.#r}#i(e){if(e.length!==8)throw RangeError(`IPv6 address must have exactly 8 segments`);let t=0n;for(let n of e){if(n<0||n>65535)throw RangeError(`IPv6 segment must be between 0 and 65535`);t=t<<16n|BigInt(n)}return t}#a(e){return[Number(e>>112n&65535n),Number(e>>96n&65535n),Number(e>>80n&65535n),Number(e>>64n&65535n),Number(e>>48n&65535n),Number(e>>32n&65535n),Number(e>>16n&65535n),Number(e&65535n)]}#o(e,t){if(t<0||t>128)throw Error(`Invalid prefix length`);if(t===0)return!0;let n=(1n<<128n)-1n,r=n<<BigInt(128-t)&n;return(this.#r&r)===(e&r)}},o=class t{static from(r){let i=r.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);if(!i)return e(TypeError(`${r} is invalid ipv4 value`));let a=i.slice(1).map(Number);return a.some(e=>e>255)?e(TypeError(`${r} is invalid ipv4 value`)):n(new t(a[0],a[1],a[2],a[3]))}static fromBuffer(r,i){try{let e=new DataView(r);return n(new t(e.getUint32(0,i)))}catch(t){return e(t)}}static BITS=32;static BROADCAST=new t(4294967295);static LOCALHOST=new t(2130706433);static UNSPECIFIED=new t(0);family=`ipv4`;#e;get value(){return this.#e}constructor(...e){if(e.length!==1&&e.length!==4||e.some(e=>typeof e!=`number`))throw TypeError(`Invalid Ipv4Addr arguments. Expected either 1 number (integer value) or 4 numbers (octets).`);if(e.length===1){if(e[0]<0||e[0]>4294967295)throw RangeError(`IPv4 integer value must be between 0 and 0xffffffff`);this.#e=e[0]}else this.#e=this.#t(e[0],e[1],e[2],e[3])}isBroadcast(){return this.#e===4294967295}isDocumentation(){return this.#r(3221225984,24)||this.#r(3325256704,24)||this.#r(3405803776,24)}isBenchmarking(){return this.#r(3323068416,15)}isGlobal(){return!(this.isUnspecified()||this.isPrivate()||this.isShared()||this.isLoopback()||this.isLinkLocal()||this.isDocumentation()||this.isBenchmarking()||this.isReserved()||this.isMulticast()||this.isBroadcast())}isLinkLocal(){return this.#r(2851995648,16)}isLoopback(){return this.#r(2130706432,8)}isMulticast(){return this.#r(3758096384,4)}isPrivate(){return this.#r(167772160,8)||this.#r(2886729728,12)||this.#r(3232235520,16)}isReserved(){return this.#r(4026531840,4)&&!this.isBroadcast()}isShared(){return this.#r(1681915904,10)}isUnspecified(){return this.#e===0}toIpv6(){return a.from(`::${this.toString()}`).unwrap()}toIpv6Mapped(){return a.from(`::ffff:${this.toString()}`).unwrap()}toString(){let[e,t,n,r]=this.#n(this.#e);return`${e}.${t}.${n}.${r}`}toBuffer(e){let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,this.#e,e),t}equals(e){return`family`in e&&this.family===e.family&&this.#e===e.#e}#t(e,t,n,r){for(let i of[e,t,n,r])if(i<0||i>255)throw RangeError(`IPv4 octet must be between 0 and 255`);return(e<<24|t<<16|n<<8|r)>>>0}#n(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}#r(e,t){if(t<0||t>32)throw RangeError(`Invalid prefix length`);let n=t===0?0:-1<<32-t>>>0;return(this.#e&n)===(e&n)}},s=class e{#e;#t;address;size;constructor(e,t){this.address=e;let n=e.value,r=(1<<32-t)-1>>>0;this.#e=(n&~r>>>0)>>>0,this.#t=(n|r)>>>0,this.size=t}static fromAddr(t,n){return new e(t,n)}static from(t){let[n,r]=t.split(`/`),i=o.from(n).unwrap();if(!/^-?\d+$/.test(r))throw Error(`Invalid IPv4 network size: must be numeric`);let a=parseInt(r,10);if(a<0||a>32)throw Error(`Invalid IPv4 network size: must be between 0 and 32`);return new e(i,a)}isInRange(e){let t=e.value;return t>=this.#e&&t<=this.#t}},c=class e{#e;#t;address;size;constructor(e,t){this.address=e;let n=e.value,r=(BigInt(1)<<BigInt(128-t))-BigInt(1);this.#e=n&~r,this.#t=n|r,this.size=t}static fromAddr(t,n){return new e(t,n)}static from(t){let[n,r]=t.split(`/`),i=a.from(n).unwrap();if(!/^-?\d+$/.test(r))throw Error(`Invalid IPv6 network size: must be numeric`);let o=parseInt(r,10);if(o<0||o>128)throw Error(`Invalid IPv6 network size: must be between 0 and 128`);return new e(i,o)}isInRange(e){let t=e.value;return t>=this.#e&&t<=this.#t}};export{o as Ipv4Addr,s as Ipv4Net,a as Ipv6Addr,c as Ipv6Net};
|
|
1
|
+
function e(e){if(!e.success)throw e.error;return e.value}var t=class t{static#e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;static from(e){if(typeof e!=`string`||!t.#e.test(e))return{success:!1,error:/* @__PURE__ */ TypeError(`${JSON.stringify(e)} is invalid ipv6 value`)};let n=t.#n(e);if(!n.success)return n;let{leftSegs:r,rightSegs:i,embeddedIpv4:a}=n.value,o=Array(8).fill(0);for(let e=0;e<r.length;e++)o[e]=r[e];let s=8-i.length-a.length;for(let e=0;e<i.length;e++)o[s+e]=i[e];for(let e=0;e<a.length;e++)o[s+i.length+e]=a[e];try{return{success:!0,value:new t(o)}}catch(e){return{success:!1,error:e}}}static fromOrThrow(n){return e(t.from(n))}static fromBuffer(e,n){try{let r=new DataView(e);if(n){let e=r.getBigUint64(0,!0),n=r.getBigUint64(8,!0);return{success:!0,value:new t(n<<64n|e)}}{let e=r.getBigUint64(0,!1),n=r.getBigUint64(8,!1);return{success:!0,value:new t(e<<64n|n)}}}catch(e){return{success:!1,error:e}}}static fromBufferOrThrow(n,r){return e(t.fromBuffer(n,r))}static fromRaw(e){if(e<0n||e>340282366920938463463374607431768211455n)throw RangeError(`${e} is out of range for an IPv6 address`);return new t(e)}static#t(e,t){let n=parseInt(e,t);return Number.isNaN(n)?{success:!1,error:/* @__PURE__ */ TypeError(`${e} is not a valid number`)}:{success:!0,value:n}}static#n(e){let n=e.split(`::`),r=n[0].split(`:`).filter(e=>e!==``),i=n.length>1?n[1].split(`:`).filter(e=>e!==``):[],a=[],o=i[i.length-1]??r[r.length-1];if(o?.includes(`.`)){let e=t.#r(o);if(!e.success)return e;a=e.value,i.length>0?i.pop():r.pop()}let s=t.#l(r.map(e=>t.#t(e,16)));if(!s.success)return s;let c=t.#l(i.map(e=>t.#t(e,16)));return c.success?{success:!0,value:{leftSegs:s.value,rightSegs:c.value,embeddedIpv4:a}}:c}static#r(e){let n=t.#l(e.split(`.`).map(e=>t.#t(e,10)));return n.success?{success:!0,value:[n.value[0]<<8|n.value[1],n.value[2]<<8|n.value[3]]}:n}static BITS=128;static LOCALHOST=new t(1n);static UNSPECIFIED=new t(0n);family=`ipv6`;#i;get value(){return this.#i}constructor(e){if(Array.isArray(e)&&e.every(e=>typeof e==`number`))this.#i=this.#a(e);else if(typeof e==`bigint`)this.#i=e;else throw TypeError(`Invalid Ipv6Addr arguments. Expected either 1 bigint or 8 numbers (segments).`)}isBenchmarking(){return this.#s(42540488320432167789079031612388147200n,48)}isDocumentation(){return this.#s(42540766411282592856903984951653826560n,32)||this.#s(85065399433376081038215121361612832768n,20)}isLoopback(){return this.#i===1n}isUnspecified(){return this.#i===0n}isMulticast(){return this.#i>>120n==255n}isMulticastInterfaceLocal(){return this.#s(338958331222012082418099330867817086976n,16)}isMulticastLinkLocal(){return this.#s(338963523518870617245727861364146307072n,16)}isAllNodesMulticastGroup(){return this.isMulticast()&&this.#c()===1n}isAllRoutersMulticastGroup(){return this.isMulticast()&&this.#c()===2n}isMdnsMulticastGroup(){return this.isMulticastLinkLocal()&&this.#c()===251n}isSsdpMulticastGroup(){return this.isMulticastLinkLocal()&&this.#c()===12n}isDhcpv6MulticastGroup(){return this.isMulticastLinkLocal()&&this.#c()===18n}isMulticastRealmLocal(){return this.#s(338968715815729152073356391860475527168n,16)}isMulticastAdminLocal(){return this.#s(338973908112587686900984922356804747264n,16)}isMulticastSiteLocal(){return this.#s(338979100409446221728613452853133967360n,16)}isMulticastOrganizationLocal(){return this.#s(338994677300021826211499044342121627648n,16)}isMulticastGlobal(){return this.#s(339025831081173035177270227320096948224n,16)}isIpv4Mapped(){return this.#s(281470681743360n,96)}isUnicast(){return!this.isMulticast()}isUnicastLinkLocal(){return this.#s(338288524927261089654018896841347694592n,10)}isUnicastGlobal(){return this.isUnicast()&&!this.isLoopback()&&!this.isUnicastLinkLocal()&&!this.isUniqueLocal()&&!this.isUnspecified()&&!this.isDocumentation()}isGlobal(){return!this.isUnspecified()&&!this.isLoopback()&&!this.isIpv4Mapped()&&!this.isBenchmarking()&&!this.isDocumentation()&&!this.isUniqueLocal()&&!this.isUnicastLinkLocal()&&!this.isMulticast()}isUniqueLocal(){return this.#s(334965454937798799971759379190646833152n,7)}toIpv4(){if(this.isIpv4Mapped()||this.#s(0n,96)){let e=this.#o(this.#i);return{success:!0,value:new n(e[6]>>8,e[6]&255,e[7]>>8,e[7]&255)}}return{success:!1,error:/* @__PURE__ */ RangeError(`Address is not IPv4 compatible or mapped`)}}toIpv4OrThrow(){return e(this.toIpv4())}toIpv4Mapped(){if(this.isIpv4Mapped()){let e=this.#o(this.#i);return{success:!0,value:new n(e[6]>>8,e[6]&255,e[7]>>8,e[7]&255)}}return{success:!1,error:/* @__PURE__ */ RangeError(`Address is not IPv4 mapped`)}}toIpv4MappedOrThrow(){return e(this.toIpv4Mapped())}toString(){let e=this.#o(this.#i),t=-1,n=0,r=-1,i=0;for(let a=0;a<e.length;a++)e[a]===0?(r===-1?(r=a,i=1):i++,i>n&&(n=i,t=r)):(r=-1,i=0);if(n<2)return e.map(e=>e.toString(16)).join(`:`);let a=e.slice(0,t).map(e=>e.toString(16)),o=e.slice(t+n).map(e=>e.toString(16));return`${a.join(`:`)}::${o.join(`:`)}`}toExpandedString(){return this.#o(this.#i).map(e=>e.toString(16).padStart(4,`0`)).join(`:`)}toBuffer(e){let t=/* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(16));return e?(t.setBigUint64(0,this.#i&18446744073709551615n,!0),t.setBigUint64(8,this.#i>>64n,!0)):(t.setBigUint64(0,this.#i>>64n,!1),t.setBigUint64(8,this.#i&18446744073709551615n,!1)),t.buffer}equals(e){return e instanceof t&&this.#i===e.#i}#a(e){if(e.length!==8)throw RangeError(`IPv6 address must have exactly 8 segments`);let t=0n;for(let n of e){if(n<0||n>65535)throw RangeError(`IPv6 segment must be between 0 and 65535`);t=t<<16n|BigInt(n)}return t}#o(e){return[Number(e>>112n&65535n),Number(e>>96n&65535n),Number(e>>80n&65535n),Number(e>>64n&65535n),Number(e>>48n&65535n),Number(e>>32n&65535n),Number(e>>16n&65535n),Number(e&65535n)]}#s(e,t){if(t<0||t>128)throw Error(`Invalid prefix length`);if(t===0)return!0;let n=(1n<<128n)-1n,r=n<<BigInt(128-t)&n;return(this.#i&r)===(e&r)}#c(){return this.#i&(1n<<112n)-1n}static#l(e){let t=[];for(let n of e){if(!n.success)return{success:!1,error:n.error};t.push(n.value)}return{success:!0,value:t}}},n=class n{static from(e){let t=e.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);if(!t)return{success:!1,error:/* @__PURE__ */ TypeError(`${e} is invalid ipv4 value`)};let r=t.slice(1).map(Number);return r.some(e=>e>255)?{success:!1,error:/* @__PURE__ */ TypeError(`${e} is invalid ipv4 value`)}:{success:!0,value:new n(r[0],r[1],r[2],r[3])}}static fromOrThrow(t){return e(n.from(t))}static fromBuffer(e,t){try{let r=new DataView(e);return{success:!0,value:new n(r.getUint32(0,t))}}catch(e){return{success:!1,error:e}}}static fromBufferOrThrow(t,r){return e(n.fromBuffer(t,r))}static BITS=32;static BROADCAST=new n(4294967295);static LOCALHOST=new n(2130706433);static UNSPECIFIED=new n(0);family=`ipv4`;#e;get value(){return this.#e}constructor(...e){if(e.length!==1&&e.length!==4||e.some(e=>typeof e!=`number`))throw TypeError(`Invalid Ipv4Addr arguments. Expected either 1 number (integer value) or 4 numbers (octets).`);if(e.length===1){if(e[0]<0||e[0]>4294967295)throw RangeError(`IPv4 integer value must be between 0 and 0xffffffff`);this.#e=e[0]}else this.#e=this.#t(e[0],e[1],e[2],e[3])}isBroadcast(){return this.#e===4294967295}isDocumentation(){return this.#r(3221225984,24)||this.#r(3325256704,24)||this.#r(3405803776,24)}isBenchmarking(){return this.#r(3323068416,15)}isGlobal(){return!(this.isUnspecified()||this.isPrivate()||this.isShared()||this.isLoopback()||this.isLinkLocal()||this.isDocumentation()||this.isBenchmarking()||this.isReserved()||this.isMulticast()||this.isBroadcast())}isLinkLocal(){return this.#r(2851995648,16)}isLoopback(){return this.#r(2130706432,8)}isMulticast(){return this.#r(3758096384,4)}isPrivate(){return this.#r(167772160,8)||this.#r(2886729728,12)||this.#r(3232235520,16)}isReserved(){return this.#r(4026531840,4)&&!this.isBroadcast()}isShared(){return this.#r(1681915904,10)}isUnspecified(){return this.#e===0}toOctets(){return this.#n(this.#e)}toIpv6(){return new t(BigInt(this.value))}toIpv6Mapped(){return new t(281470681743360n|BigInt(this.value))}toString(){return this.toOctets().join(`.`)}toBuffer(e){let t=/* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(4));return t.setUint32(0,this.#e,e),t.buffer}equals(e){return e instanceof n&&this.#e===e.#e}#t(e,t,n,r){for(let i of[e,t,n,r])if(i<0||i>255)throw RangeError(`IPv4 octet must be between 0 and 255`);return(e<<24|t<<16|n<<8|r)>>>0}#n(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}#r(e,t){if(t<0||t>32)throw RangeError(`Invalid prefix length`);let n=t===0?0:-1<<32-t>>>0;return(this.#e&n)===(e&n)}},r=class t{#e;#t;#n;#r;#i;size;family=`ipv4`;constructor(e,t){let r=e.value,i=(1<<32-t)-1>>>0;this.size=t,this.#e=(r&~i>>>0)>>>0,this.#t=(r|i)>>>0,this.#r=t===32?this.#e:this.#e+1,this.#i=t===32?this.#t:this.#t-1,this.#n=new n(this.#e)}static fromAddr(e,n){return t.#a(n)?{success:!0,value:new t(e,n)}:{success:!1,error:/* @__PURE__ */ RangeError(`Invalid IPv4 network size: must be between 0 and 32`)}}static fromAddrOrThrow(n,r){return e(t.fromAddr(n,r))}static from(e){let[r,i]=e.split(`/`),a=n.from(r);if(!a.success)return a;if(!/^-?\d+$/.test(i))return{success:!1,error:/* @__PURE__ */ TypeError(`Invalid IPv4 network size: must be numeric`)};let o=parseInt(i,10);return t.#a(o)?{success:!0,value:new t(a.value,o)}:{success:!1,error:/* @__PURE__ */ TypeError(`Invalid IPv4 network size: must be between 0 and 32`)}}static fromOrThrow(n){return e(t.from(n))}static#a(e){return e>=0&&e<=32}contains(e){let t=e.value;return t>=this.#e&&t<=this.#t}broadcast(){return this.last()}netmask(){return new n((1<<this.size)-1<<32-this.size>>>0)}toString(){return`${this.#n.toString()}/${this.size}`}first(){return this.#n}last(){return new n(this.#t)}firstUsable(){return new n(this.#r)}lastUsable(){return new n(this.#i)}equals(e){return e?e instanceof t&&this.#n.value===e.#n.value&&this.size===e.size:!1}assignAddress(e){let t=typeof e==`string`?n.from(e):{success:!0,value:e};if(!t.success)return t;let r=t.value,i=this.size===0?4294967295:this.size===32?0:(1<<32-this.size)-1>>>0;return(r.value&~i)===0?{success:!0,value:new n((this.#e|r.value)>>>0)}:{success:!1,error:/* @__PURE__ */ RangeError(`Address ${e.toString()} exceeds network host capacity for /${this.size}`)}}assignAddressOrThrow(t){return e(this.assignAddress(t))}isSubnetOf(e){return this.#e>=e.first().value&&this.#t<=e.last().value}containsNet(e){return this.#e<=e.first().value&&this.#t>=e.last().value}*addresses(){for(let e=this.#e;e<=this.#t;e++)yield new n(e>>>0)}*hosts(){for(let e=this.#r;e<=this.#i;e++)yield new n(e>>>0)}},i=class n{#e;#t;#n;#r;#i;size;family=`ipv6`;constructor(e,n){let r=e.value,i=(BigInt(1)<<BigInt(128-n))-BigInt(1);this.size=n,this.#e=r&~i,this.#t=r|i,this.#n=n===128?this.#e:this.#e+BigInt(1),this.#r=n===128?this.#t:this.#t-BigInt(1),this.#i=new t(this.#e)}static fromAddr(e,t){return t<0||t>128?{success:!1,error:/* @__PURE__ */ RangeError(`Invalid IPv6 network size: must be between 0 and 128`)}:{success:!0,value:new n(e,t)}}static fromAddrOrThrow(t,r){return e(n.fromAddr(t,r))}static from(e){let[r,i]=e.split(`/`),a=t.from(r);if(!a.success)return a;let o=a.value;if(!/^-?\d+$/.test(i))return{success:!1,error:/* @__PURE__ */ TypeError(`Invalid IPv6 network size: must be numeric`)};let s=parseInt(i,10);return s<0||s>128?{success:!1,error:/* @__PURE__ */ RangeError(`Invalid IPv6 network size: must be between 0 and 128`)}:{success:!0,value:new n(o,s)}}static fromOrThrow(t){return e(n.from(t))}contains(e){let t=e.value;return t>=this.#e&&t<=this.#t}netmask(){let e=(BigInt(1)<<BigInt(this.size))-BigInt(1)<<BigInt(128-this.size);return t.fromRaw(e)}toString(){return`${this.#i.toString()}/${this.size}`}toExpandedString(){return`${this.#i.toExpandedString()}/${this.size}`}first(){return this.#i}last(){return t.fromRaw(this.#t)}firstUsable(){return t.fromRaw(this.#n)}lastUsable(){return t.fromRaw(this.#r)}equals(e){return e?e instanceof n&&this.#i.value===e.#i.value&&this.size===e.size:!1}assignAddress(e){let n=typeof e==`string`?t.from(e):{success:!0,value:e};if(!n.success)return n;let r=n.value,i=~(this.size===0?(1n<<128n)-1n:this.size===128?0n:(1n<<BigInt(128-this.size))-1n)&(1n<<128n)-1n;return(r.value&i)===0n?{success:!0,value:new t(this.#e|r.value)}:{success:!1,error:/* @__PURE__ */ RangeError(`Address ${r.toString()} exceeds network host capacity for /${this.size}`)}}assignAddressOrThrow(t){return e(this.assignAddress(t))}isSubnetOf(e){return this.#e>=e.first().value&&this.#t<=e.last().value}containsNet(e){return this.#e<=e.first().value&&this.#t>=e.last().value}*addresses(){for(let e=this.#e;e<=this.#t;e++)yield t.fromRaw(e)}*hosts(){for(let e=this.#n;e<=this.#r;e++)yield t.fromRaw(e)}};export{n as Ipv4Addr,r as Ipv4Net,t as Ipv6Addr,i as Ipv6Net};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/Ipv6Addr.ts","../src/Ipv4Addr.ts","../src/Ipv4Net.ts","../src/Ipv6Net.ts"],"sourcesContent":["import {Err, type IOption, type IResult, None, Ok, Result, Some} from '@luolapeikko/result-option';\nimport {Ipv4Addr} from './Ipv4Addr';\n\n/**\n * Represents an IPv6 address.\n * @example\n * const addr1 = Ipv6Addr.from('2001:db8::1').unwrap();\n * const addr2 = new Ipv6Addr([0x2001, 0xdb8, 0, 0, 0, 0, 0, 1]);\n * const addr3 = new Ipv6Addr(0x20010db8000000000000000000000001n);\n * @since v0.0.1\n */\nexport class Ipv6Addr {\n\tprivate static regex =\n\t\t/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\n\t/**\n\t * Creates an IPv6 address from text.\n\t * @returns A successful result with an IPv6 address, or an error when the input is invalid.\n\t * @example\n\t * const addr = Ipv6Addr.from('2001:db8::1').unwrap();\n\t * @since v0.0.1\n\t */\n\tpublic static from(value: string): IResult<Ipv6Addr, TypeError | RangeError> {\n\t\tif (typeof value !== 'string' || !Ipv6Addr.regex.test(value)) {\n\t\t\treturn Err(new TypeError(`${JSON.stringify(value)} is invalid ipv6 value`));\n\t\t}\n\t\treturn Ipv6Addr.#parseComponents(value).andThen(({leftSegs, rightSegs, embeddedIpv4}) => {\n\t\t\tconst segments: number[] = Array(8).fill(0);\n\t\t\t// Place left segments\n\t\t\tfor (let i = 0; i < leftSegs.length; i++) {\n\t\t\t\tsegments[i] = leftSegs[i];\n\t\t\t}\n\t\t\t// Place right segments\n\t\t\tconst rightStartIdx = 8 - rightSegs.length - embeddedIpv4.length;\n\t\t\tfor (let i = 0; i < rightSegs.length; i++) {\n\t\t\t\tsegments[rightStartIdx + i] = rightSegs[i];\n\t\t\t}\n\t\t\t// Place embedded IPv4\n\t\t\tfor (let i = 0; i < embeddedIpv4.length; i++) {\n\t\t\t\tsegments[rightStartIdx + rightSegs.length + i] = embeddedIpv4[i];\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn Ok(new Ipv6Addr(segments as [number, number, number, number, number, number, number, number]));\n\t\t\t} catch (err) {\n\t\t\t\treturn Err(err as RangeError);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Creates an IPv6 address from a 16-byte buffer.\n\t * @returns A successful result with an IPv6 address, or an error when the buffer cannot be read.\n\t * @since v0.0.1\n\t */\n\tpublic static fromBuffer(buffer: ArrayBuffer, littleEndian?: boolean): IResult<Ipv6Addr> {\n\t\ttry {\n\t\t\tconst view = new DataView(buffer);\n\t\t\tif (littleEndian) {\n\t\t\t\tconst low = view.getBigUint64(0, true);\n\t\t\t\tconst high = view.getBigUint64(8, true);\n\t\t\t\treturn Ok(new Ipv6Addr((high << 64n) | low));\n\t\t\t} else {\n\t\t\t\tconst high = view.getBigUint64(0, false);\n\t\t\t\tconst low = view.getBigUint64(8, false);\n\t\t\t\treturn Ok(new Ipv6Addr((high << 64n) | low));\n\t\t\t}\n\t\t} catch (err) {\n\t\t\treturn Err(err as Error);\n\t\t}\n\t}\n\n\tstatic #parseInt(value: string, radix: number): IResult<number, TypeError> {\n\t\tconst output = parseInt(value, radix);\n\t\tif (Number.isNaN(output)) {\n\t\t\treturn Err(new TypeError(`${value} is not a valid number`));\n\t\t}\n\t\treturn Ok(output);\n\t}\n\n\tstatic #parseComponents(value: string): IResult<{leftSegs: number[]; rightSegs: number[]; embeddedIpv4: number[]}, TypeError> {\n\t\tconst components = value.split('::');\n\t\tconst leftParts = components[0].split(':').filter((x) => x !== '');\n\t\tconst rightParts = components.length > 1 ? components[1].split(':').filter((x) => x !== '') : [];\n\t\tlet embeddedIpv4: number[] = [];\n\t\tconst lastPart = rightParts[rightParts.length - 1] ?? leftParts[leftParts.length - 1];\n\t\t// check if the last part is an embedded IPv4 address (e.g., ::ffff:192.168.0.1)\n\t\tif (lastPart?.includes('.')) {\n\t\t\tconst embeddedIpv4Result = Ipv6Addr.#parseEmbeddedIpv4(lastPart);\n\t\t\tif (embeddedIpv4Result.isErr) {\n\t\t\t\treturn embeddedIpv4Result;\n\t\t\t}\n\t\t\tembeddedIpv4 = embeddedIpv4Result.ok();\n\t\t\tif (rightParts.length > 0) {\n\t\t\t\trightParts.pop();\n\t\t\t} else {\n\t\t\t\tleftParts.pop();\n\t\t\t}\n\t\t}\n\t\treturn Result.tupleFlow(\n\t\t\tResult.asArray(leftParts.map((p) => Ipv6Addr.#parseInt(p, 16))),\n\t\t\t() => Result.asArray(rightParts.map((p) => Ipv6Addr.#parseInt(p, 16))),\n\t\t\t(leftSegs, rightSegs) => Ok({leftSegs, rightSegs, embeddedIpv4}),\n\t\t);\n\t}\n\n\tstatic #parseEmbeddedIpv4(value: string): IResult<number[], TypeError> {\n\t\treturn Result.asArray(value.split('.').map((octet) => Ipv6Addr.#parseInt(octet, 10))).andThen((octets) =>\n\t\t\tOk([(octets[0] << 8) | octets[1], (octets[2] << 8) | octets[3]]),\n\t\t);\n\t}\n\n\t/**\n\t * The number of bits in an IPv6 address.\n\t * @since v0.0.1\n\t */\n\tpublic static readonly BITS = 128;\n\n\t/**\n\t * The loopback address (`::1`).\n\t * @since v0.0.1\n\t */\n\tpublic static readonly LOCALHOST: Ipv6Addr = new Ipv6Addr(0x00000000000000000000000000000001n);\n\n\t/**\n\t * The unspecified address (`::`).\n\t * @since v0.0.1\n\t */\n\tpublic static readonly UNSPECIFIED: Ipv6Addr = new Ipv6Addr(0x00000000000000000000000000000000n);\n\n\t/**\n\t * The address family identifier for IPv6 addresses.\n\t * @since v0.0.1\n\t */\n\tpublic readonly family = 'ipv6';\n\n\t#integerAddress: bigint;\n\n\t/**\n\t * Gets the raw bigint representation of the IPv6 address.\n\t */\n\tpublic get value(): bigint {\n\t\treturn this.#integerAddress;\n\t}\n\n\t/**\n\t * Creates a new IPv6 address instance.\n\t * @param value - A bigint representing the IPv6 address or an array of 8 numbers representing the segments of the address.\n\t * @throws {RangeError} If the segments array does not have exactly 8 elements or if any segment is out of range.\n\t * @throws {TypeError} If the input is neither a bigint nor an array of 8 numbers.\n\t */\n\tpublic constructor(value: bigint);\n\tpublic constructor(segments: [number, number, number, number, number, number, number, number]);\n\tpublic constructor(valueOrSegments: [number, number, number, number, number, number, number, number] | bigint) {\n\t\tif (Array.isArray(valueOrSegments) && valueOrSegments.every((seg) => typeof seg === 'number')) {\n\t\t\tthis.#integerAddress = this.#toInteger(valueOrSegments);\n\t\t} else if (typeof valueOrSegments === 'bigint') {\n\t\t\tthis.#integerAddress = valueOrSegments;\n\t\t} else {\n\t\t\tthrow new TypeError('Invalid Ipv6Addr arguments. Expected either 1 bigint or 8 numbers (segments).');\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether this address is in the benchmarking range.\n\t * @see https://tools.ietf.org/html/rfc5180 and https://www.rfc-editor.org/errata_search.php?eid=1752\n\t * @returns `true` when the address is in `2001:2::/48`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isBenchmarking(): boolean {\n\t\treturn this.#match(0x20010002000000000000000000000000n, 48);\n\t}\n\n\t/**\n\t * Checks whether this address is in a documentation-only range.\n\t * @see https://tools.ietf.org/html/rfc3849 and https://tools.ietf.org/html/rfc9637\n\t * @returns `true` for `2001:db8::/32` or `3fff::/20`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isDocumentation(): boolean {\n\t\treturn this.#match(0x20010db8000000000000000000000000n, 32) || this.#match(0x3fff0000000000000000000000000000n, 20);\n\t}\n\n\t/**\n\t * Checks whether this address is the loopback address.\n\t * @see https://tools.ietf.org/html/rfc4291#section-2.5.3\n\t * @returns `true` when the address is `::1`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isLoopback(): boolean {\n\t\treturn this.#integerAddress === 1n;\n\t}\n\n\t/**\n\t * Checks whether this address is the unspecified address.\n\t * @see https://tools.ietf.org/html/rfc4291\n\t * @returns `true` when the address is `::`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isUnspecified(): boolean {\n\t\treturn this.#integerAddress === 0n;\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast address.\n\t * @see https://tools.ietf.org/html/rfc4291\n\t * @returns `true` when the address is in `ff00::/8`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isMulticast(): boolean {\n\t\treturn this.#integerAddress >> 120n === 0xffn;\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast interface-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff01::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastInterfaceLocal(): boolean {\n\t\treturn this.#match(0xff010000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast link-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff02::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastLinkLocal(): boolean {\n\t\treturn this.#match(0xff020000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast realm-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff03::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastRealmLocal(): boolean {\n\t\treturn this.#match(0xff030000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast admin-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff04::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastAdminLocal(): boolean {\n\t\treturn this.#match(0xff040000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast site-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff05::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastSiteLocal(): boolean {\n\t\treturn this.#match(0xff050000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast organization-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff08::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastOrganizationLocal(): boolean {\n\t\treturn this.#match(0xff080000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast global address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff0e::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastGlobal(): boolean {\n\t\treturn this.#match(0xff0e0000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is an IPv4-mapped IPv6 address.\n\t * @returns `true` when the address is in `::ffff:0:0/96`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isIpv4Mapped(): boolean {\n\t\treturn this.#match(0x00000000000000000000ffff00000000n, 96);\n\t}\n\n\t/**\n\t * Checks whether this address is a unicast address.\n\t * @see https://tools.ietf.org/html/rfc4291\n\t * @returns `true` when the address is not multicast, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isUnicast(): boolean {\n\t\treturn !this.isMulticast();\n\t}\n\n\t/**\n\t * Checks whether this address is a link-local unicast address.\n\t * @see https://tools.ietf.org/html/rfc4291\n\t * @returns `true` when the address is in `fe80::/10`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isUnicastLinkLocal(): boolean {\n\t\treturn this.#match(0xfe800000000000000000000000000000n, 10);\n\t}\n\n\t/**\n\t * Checks whether this address is a global unicast address.\n\t * @see https://tools.ietf.org/html/rfc4291#section-2.5.7\n\t * @returns `true` when the address is unicast and not loopback, link-local, private, unspecified, or documentation.\n\t * @since v0.0.1\n\t */\n\tpublic isUnicastGlobal(): boolean {\n\t\treturn this.isUnicast() && !this.isLoopback() && !this.isUnicastLinkLocal() && !this.isUniqueLocal() && !this.isUnspecified() && !this.isDocumentation();\n\t}\n\n\t/**\n\t * Checks whether this address appears globally reachable.\n\t * @see https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml\n\t * @returns `true` when the address is not in known non-global special ranges.\n\t * @since v0.0.1\n\t */\n\tpublic isGlobal(): boolean {\n\t\treturn (\n\t\t\t!this.isUnspecified() &&\n\t\t\t!this.isLoopback() &&\n\t\t\t!this.isIpv4Mapped() &&\n\t\t\t!this.isBenchmarking() &&\n\t\t\t!this.isDocumentation() &&\n\t\t\t!this.isUniqueLocal() &&\n\t\t\t!this.isUnicastLinkLocal() &&\n\t\t\t!this.isMulticast()\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether this address is in the unique-local range.\n\t * @see https://tools.ietf.org/html/rfc4193\n\t * @returns `true` when the address is in `fc00::/7`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isUniqueLocal(): boolean {\n\t\treturn this.#match(0xfc000000000000000000000000000000n, 7);\n\t}\n\n\t/**\n\t * Converts this address to IPv4 when compatible or mapped.\n\t * @returns An IPv4 address for `::a.b.c.d` or `::ffff:a.b.c.d`; otherwise `None`.\n\t * @since v0.0.1\n\t */\n\tpublic toIpv4(): IOption<Ipv4Addr> {\n\t\tif (this.isIpv4Mapped() || this.#match(0n, 96)) {\n\t\t\tconst segments = this.#fromInteger(this.#integerAddress);\n\t\t\treturn Some(new Ipv4Addr(segments[6] >> 8, segments[6] & 0xff, segments[7] >> 8, segments[7] & 0xff));\n\t\t}\n\t\treturn None();\n\t}\n\n\t/**\n\t * Converts this address to IPv4 only when it is IPv4-mapped.\n\t * @returns An IPv4 address for `::ffff:a.b.c.d`; otherwise `None`.\n\t * @since v0.0.1\n\t */\n\tpublic toIpv4Mapped(): IOption<Ipv4Addr> {\n\t\tif (this.isIpv4Mapped()) {\n\t\t\tconst segments = this.#fromInteger(this.#integerAddress);\n\t\t\treturn Some(new Ipv4Addr(segments[6] >> 8, segments[6] & 0xff, segments[7] >> 8, segments[7] & 0xff));\n\t\t}\n\t\treturn None();\n\t}\n\n\t/**\n\t * Formats this address as a compressed IPv6 string.\n\t * @returns The shortest standard IPv6 text form.\n\t * @since v0.0.1\n\t */\n\tpublic toString(): string {\n\t\tconst segments = this.#fromInteger(this.#integerAddress);\n\t\tlet maxZeroStart = -1;\n\t\tlet maxZeroLen = 0;\n\t\tlet currentZeroStart = -1;\n\t\tlet currentZeroLen = 0;\n\n\t\tfor (let i = 0; i < segments.length; i++) {\n\t\t\tif (segments[i] === 0) {\n\t\t\t\tif (currentZeroStart === -1) {\n\t\t\t\t\tcurrentZeroStart = i;\n\t\t\t\t\tcurrentZeroLen = 1;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentZeroLen++;\n\t\t\t\t}\n\t\t\t\tif (currentZeroLen > maxZeroLen) {\n\t\t\t\t\tmaxZeroLen = currentZeroLen;\n\t\t\t\t\tmaxZeroStart = currentZeroStart;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentZeroStart = -1;\n\t\t\t\tcurrentZeroLen = 0;\n\t\t\t}\n\t\t}\n\n\t\tif (maxZeroLen < 2) {\n\t\t\treturn segments.map((s) => s.toString(16)).join(':');\n\t\t}\n\n\t\tconst before = segments.slice(0, maxZeroStart).map((s) => s.toString(16));\n\t\tconst after = segments.slice(maxZeroStart + maxZeroLen).map((s) => s.toString(16));\n\n\t\treturn `${before.join(':')}::${after.join(':')}`;\n\t}\n\n\t/**\n\t * Encodes this address to a 16-byte buffer.\n\t * @param littleEndian Whether to use little-endian byte order. Defaults to `false`.\n\t * @returns An `ArrayBuffer` containing the IPv6 integer value.\n\t * @since v0.0.1\n\t */\n\tpublic toBuffer(littleEndian?: boolean): ArrayBuffer {\n\t\tconst buffer = new ArrayBuffer(16);\n\t\tconst view = new DataView(buffer);\n\t\tif (littleEndian) {\n\t\t\tview.setBigUint64(0, this.#integerAddress & 0xffffffffffffffffn, true);\n\t\t\tview.setBigUint64(8, this.#integerAddress >> 64n, true);\n\t\t} else {\n\t\t\tview.setBigUint64(0, this.#integerAddress >> 64n, false);\n\t\t\tview.setBigUint64(8, this.#integerAddress & 0xffffffffffffffffn, false);\n\t\t}\n\t\treturn buffer;\n\t}\n\n\t/**\n\t * Compares this IPv6 address with another for equality.\n\t * @param other instance of another IPv6 address to compare with.\n\t * @returns `true` if both addresses are equal, otherwise `false`.\n\t * @since v0.1.0\n\t */\n\tpublic equals(other: Ipv6Addr | Ipv4Addr | object): boolean {\n\t\treturn 'family' in other && this.family === other.family && this.#integerAddress === other.#integerAddress;\n\t}\n\n\t/**\n\t * Converts an array of IPv6 segments to a bigint representation.\n\t * @param segments An array of 8 numbers representing the IPv6 segments.\n\t * @returns A bigint representing the IPv6 address.\n\t * @throws {RangeError} If the segments array does not have exactly 8 elements or if any segment is out of range.\n\t */\n\t#toInteger(segments: [number, number, number, number, number, number, number, number]): bigint {\n\t\tif (segments.length !== 8) {\n\t\t\tthrow new RangeError('IPv6 address must have exactly 8 segments');\n\t\t}\n\t\tlet result = 0n;\n\t\tfor (const segment of segments) {\n\t\t\tif (segment < 0 || segment > 0xffff) {\n\t\t\t\tthrow new RangeError('IPv6 segment must be between 0 and 65535');\n\t\t\t}\n\t\t\tresult = (result << 16n) | BigInt(segment);\n\t\t}\n\t\treturn result;\n\t}\n\n\t#fromInteger(integer: bigint): [number, number, number, number, number, number, number, number] {\n\t\treturn [\n\t\t\tNumber((integer >> 112n) & 0xffffn),\n\t\t\tNumber((integer >> 96n) & 0xffffn),\n\t\t\tNumber((integer >> 80n) & 0xffffn),\n\t\t\tNumber((integer >> 64n) & 0xffffn),\n\t\t\tNumber((integer >> 48n) & 0xffffn),\n\t\t\tNumber((integer >> 32n) & 0xffffn),\n\t\t\tNumber((integer >> 16n) & 0xffffn),\n\t\t\tNumber(integer & 0xffffn),\n\t\t];\n\t}\n\n\t#match(network: bigint, prefix: number): boolean {\n\t\tif (prefix < 0 || prefix > 128) {\n\t\t\tthrow new Error('Invalid prefix length');\n\t\t}\n\t\tif (prefix === 0) {\n\t\t\treturn true;\n\t\t}\n\t\tconst ALL_ONES = (1n << 128n) - 1n;\n\t\tconst mask = (ALL_ONES << BigInt(128 - prefix)) & ALL_ONES;\n\t\treturn (this.#integerAddress & mask) === (network & mask);\n\t}\n}\n","import {Err, type IResult, Ok} from '@luolapeikko/result-option';\nimport {Ipv6Addr} from './Ipv6Addr';\n\n/**\n * Represents an IPv4 address.\n * @example\n * const addr1 = Ipv4Addr.from('192.168.0.1').unwrap();\n * const addr2 = new Ipv4Addr(192, 168, 0, 1);\n * const addr3 = new Ipv4Addr(0xc0a80001);\n * @since v0.0.1\n */\nexport class Ipv4Addr {\n\t/**\n\t * Creates an IPv4 address from dotted-decimal text.\n\t * @returns A successful {@link IResult} with an IPv4 address, or an error when the input is invalid.\n\t * @since v0.0.1\n\t */\n\tpublic static from(value: string): IResult<Ipv4Addr, TypeError> {\n\t\tconst match = value.match(/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/);\n\t\tif (!match) {\n\t\t\treturn Err(new TypeError(`${value} is invalid ipv4 value`));\n\t\t}\n\t\tconst octets = match.slice(1).map(Number);\n\t\tif (octets.some((o) => o > 255)) {\n\t\t\treturn Err(new TypeError(`${value} is invalid ipv4 value`));\n\t\t}\n\t\treturn Ok(new Ipv4Addr(octets[0], octets[1], octets[2], octets[3]));\n\t}\n\n\t/**\n\t * Creates an IPv4 address from a 4-byte buffer.\n\t * @returns A successful {@link IResult} with an IPv4 address, or an error when the buffer cannot be read.\n\t * @since v0.0.1\n\t */\n\tpublic static fromBuffer(buffer: ArrayBuffer, littleEndian?: boolean): IResult<Ipv4Addr> {\n\t\ttry {\n\t\t\tconst view = new DataView(buffer);\n\t\t\treturn Ok(new Ipv4Addr(view.getUint32(0, littleEndian)));\n\t\t} catch (err) {\n\t\t\treturn Err(err);\n\t\t}\n\t}\n\n\t/**\n\t * The number of bits in an IPv4 address.\n\t * @since v0.0.1\n\t */\n\tpublic static readonly BITS = 32;\n\n\t/**\n\t * The broadcast address `255.255.255.255`.\n\t * @since v0.0.1\n\t */\n\tpublic static readonly BROADCAST: Ipv4Addr = new Ipv4Addr(0xffffffff);\n\n\t/**\n\t * The localhost address `127.0.0.1`.\n\t * @since v0.0.1\n\t */\n\tpublic static readonly LOCALHOST: Ipv4Addr = new Ipv4Addr(0x7f000001);\n\n\t/**\n\t * The unspecified address `0.0.0.0`.\n\t * @since v0.0.1\n\t */\n\tpublic static readonly UNSPECIFIED: Ipv4Addr = new Ipv4Addr(0x00000000);\n\n\t/**\n\t * The address family identifier for IPv4 addresses.\n\t * @since v0.0.1\n\t */\n\tpublic readonly family = 'ipv4';\n\n\t#integerAddress: number;\n\n\t/**\n\t * Gets the raw integer representation of the IPv4 address.\n\t */\n\tpublic get value(): number {\n\t\treturn this.#integerAddress;\n\t}\n\n\t/**\n\t * Creates a new IPv4 address from four octets.\n\t * @param num1 The first octet.\n\t * @param num2 The second octet.\n\t * @param num3 The third octet.\n\t * @param num4 The fourth octet.\n\t * @throws {RangeError} If the integer values are not in the range of 0 to 255 for each octet.\n\t * @throws {TypeError} If the input is not a number.\n\t * @example\n\t * new Ipv4Addr(192, 168, 0, 1) // creates the address `192.168.0.1`\n\t */\n\tpublic constructor(num1: number, num2: number, num3: number, num4: number);\n\t/**\n\t * Creates a new IPv4 address from an integer value.\n\t * @param integerValue The integer representation of the IPv4 address.\n\t * @throws {RangeError} If the integer value is not in the range of 0 to 0xffffffff.\n\t * @throws {TypeError} If the input is not a number.\n\t * @example\n\t * new Ipv4Addr(0xc0a80001) // creates the address `192.168.0.1` from the integer value `0xc0a80001`\n\t */\n\tpublic constructor(integerValue: number);\n\tpublic constructor(...args: [number] | [number, number, number, number]) {\n\t\tif ((args.length !== 1 && args.length !== 4) || args.some((arg) => typeof arg !== 'number')) {\n\t\t\tthrow new TypeError('Invalid Ipv4Addr arguments. Expected either 1 number (integer value) or 4 numbers (octets).');\n\t\t}\n\t\tif (args.length === 1) {\n\t\t\tif (args[0] < 0 || args[0] > 0xffffffff) {\n\t\t\t\tthrow new RangeError('IPv4 integer value must be between 0 and 0xffffffff');\n\t\t\t}\n\t\t\tthis.#integerAddress = args[0];\n\t\t} else {\n\t\t\tthis.#integerAddress = this.#toInteger(args[0], args[1], args[2], args[3]);\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether this address is the broadcast address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc919#section-7\n\t * @returns `true` when the address is `255.255.255.255`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isBroadcast(): boolean {\n\t\treturn this.#integerAddress === 0xffffffff;\n\t}\n\n\t/**\n\t * Checks whether this address is in a documentation-only range.\n\t * @see https://datatracker.ietf.org/doc/html/rfc5737\n\t * @returns `true` for `192.0.2.0/24`, `198.51.100.0/24`, or `203.0.113.0/24`; otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isDocumentation(): boolean {\n\t\treturn (\n\t\t\tthis.#match(0xc0000200, 24) || // 192.0.2.0/24\n\t\t\tthis.#match(0xc6336400, 24) || // 198.51.100.0/24\n\t\t\tthis.#match(0xcb007100, 24) // 203.0.113.0/24\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether this address is in the benchmarking range.\n\t * @see https://datatracker.ietf.org/doc/html/rfc2544\n\t * @returns `true` when the address is in `198.18.0.0/15`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isBenchmarking(): boolean {\n\t\treturn this.#match(0xc6120000, 15);\n\t}\n\n\t/**\n\t * Checks whether this address is globally reachable.\n\t * @see https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml\n\t * @returns `true` when the address is not in any special non-global range.\n\t * @since v0.0.1\n\t */\n\tpublic isGlobal(): boolean {\n\t\treturn !(\n\t\t\tthis.isUnspecified() ||\n\t\t\tthis.isPrivate() ||\n\t\t\tthis.isShared() ||\n\t\t\tthis.isLoopback() ||\n\t\t\tthis.isLinkLocal() ||\n\t\t\tthis.isDocumentation() ||\n\t\t\tthis.isBenchmarking() ||\n\t\t\tthis.isReserved() ||\n\t\t\tthis.isMulticast() ||\n\t\t\tthis.isBroadcast()\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether this address is link-local.\n\t * @see https://datatracker.ietf.org/doc/html/rfc3927\n\t * @returns `true` when the address is in `169.254.0.0/16`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isLinkLocal(): boolean {\n\t\treturn this.#match(0xa9fe0000, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a loopback address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc1122\n\t * @returns `true` when the address is in `127.0.0.0/8`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isLoopback(): boolean {\n\t\treturn this.#match(0x7f000000, 8);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc5771\n\t * @returns `true` when the address is in `224.0.0.0/4`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isMulticast(): boolean {\n\t\treturn this.#match(0xe0000000, 4);\n\t}\n\n\t/**\n\t * Checks whether this address is in a private-use range.\n\t * @see https://datatracker.ietf.org/doc/html/rfc1918\n\t * @returns `true` for `10.0.0.0/8`, `172.16.0.0/12`, or `192.168.0.0/16`; otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isPrivate(): boolean {\n\t\treturn (\n\t\t\tthis.#match(0x0a000000, 8) || // 10.0.0.0/8\n\t\t\tthis.#match(0xac100000, 12) || // 172.16.0.0/12\n\t\t\tthis.#match(0xc0a80000, 16) // 192.168.0.0/16\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether this address is in the reserved range.\n\t * @see https://datatracker.ietf.org/doc/html/rfc1112\n\t * @returns `true` when the address is in `240.0.0.0/4` except the broadcast address.\n\t * @since v0.0.1\n\t */\n\tpublic isReserved(): boolean {\n\t\treturn this.#match(0xf0000000, 4) && !this.isBroadcast();\n\t}\n\n\t/**\n\t * Checks whether this address is in the shared Carrier-Grade NAT range.\n\t * @see https://datatracker.ietf.org/doc/html/rfc6598\n\t * @returns `true` when the address is in `100.64.0.0/10`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isShared(): boolean {\n\t\treturn this.#match(0x64400000, 10);\n\t}\n\n\t/**\n\t * Checks whether this address is the unspecified address.\n\t * @returns `true` when the address is `0.0.0.0`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isUnspecified(): boolean {\n\t\treturn this.#integerAddress === 0;\n\t}\n\n\t/**\n\t * Converts this address to an IPv4-compatible IPv6 address.\n\t * @returns An IPv6 address in the form `::a.b.c.d`.\n\t * @since v0.0.1\n\t */\n\tpublic toIpv6(): Ipv6Addr {\n\t\treturn Ipv6Addr.from(`::${this.toString()}`).unwrap();\n\t}\n\n\t/**\n\t * Converts this address to an IPv4-mapped IPv6 address.\n\t * @returns An IPv6 address in the form `::ffff:a.b.c.d`.\n\t * @since v0.0.1\n\t */\n\tpublic toIpv6Mapped(): Ipv6Addr {\n\t\treturn Ipv6Addr.from(`::ffff:${this.toString()}`).unwrap();\n\t}\n\n\t/**\n\t * Formats this address as dotted-decimal text.\n\t * @returns The IPv4 string representation, such as `192.168.0.1`.\n\t * @since v0.0.1\n\t */\n\tpublic toString(): string {\n\t\tconst [num1, num2, num3, num4] = this.#fromInteger(this.#integerAddress);\n\t\treturn `${num1}.${num2}.${num3}.${num4}`;\n\t}\n\n\t/**\n\t * Encodes this address to a 4-byte buffer.\n\t * @returns An `ArrayBuffer` containing the IPv4 integer value.\n\t * @since v0.0.1\n\t */\n\tpublic toBuffer(littleEndian?: boolean): ArrayBuffer {\n\t\tconst buffer = new ArrayBuffer(4);\n\t\tconst view = new DataView(buffer);\n\t\tview.setUint32(0, this.#integerAddress, littleEndian);\n\t\treturn buffer;\n\t}\n\n\t/**\n\t * Compares this IPv4 address with another for equality.\n\t * @param other instance of another IPv4 address to compare with.\n\t * @returns `true` if both addresses are equal, otherwise `false`.\n\t * @since v0.1.0\n\t */\n\tpublic equals(other: Ipv4Addr | Ipv6Addr | object): boolean {\n\t\treturn 'family' in other && this.family === other.family && this.#integerAddress === other.#integerAddress;\n\t}\n\n\t#toInteger(num1: number, num2: number, num3: number, num4: number): number {\n\t\tfor (const octet of [num1, num2, num3, num4]) {\n\t\t\tif (octet < 0 || octet > 255) {\n\t\t\t\tthrow new RangeError('IPv4 octet must be between 0 and 255');\n\t\t\t}\n\t\t}\n\t\treturn ((num1 << 24) | (num2 << 16) | (num3 << 8) | num4) >>> 0;\n\t}\n\n\t#fromInteger(integer: number): [number, number, number, number] {\n\t\tconst num1 = (integer >> 24) & 0xff;\n\t\tconst num2 = (integer >> 16) & 0xff;\n\t\tconst num3 = (integer >> 8) & 0xff;\n\t\tconst num4 = integer & 0xff;\n\t\treturn [num1, num2, num3, num4];\n\t}\n\n\t#match(network: number, prefix: number): boolean {\n\t\tif (prefix < 0 || prefix > 32) {\n\t\t\tthrow new RangeError('Invalid prefix length');\n\t\t}\n\t\tconst mask = prefix === 0 ? 0 : (~0 << (32 - prefix)) >>> 0;\n\t\treturn (this.#integerAddress & mask) === (network & mask);\n\t}\n}\n","import {Ipv4Addr} from './Ipv4Addr';\n\n/**\n * Represents an IPv4 network.\n * @example\n * const addr = Ipv4Addr.from('192.168.0.1').unwrap();\n * const network = Ipv4Net.fromAddr(addr, 24);\n * @since v0.1.2\n */\nexport class Ipv4Net {\n\t#lowAddress: number;\n\t#highAddress: number;\n\tpublic readonly address: Ipv4Addr;\n\tpublic readonly size: number;\n\tprivate constructor(address: Ipv4Addr, size: number) {\n\t\tthis.address = address;\n\t\tconst currentValue = address.value;\n\t\t// Use >>> 0 to ensure unsigned 32-bit arithmetic\n\t\tconst mask = ((1 << (32 - size)) - 1) >>> 0;\n\t\tthis.#lowAddress = (currentValue & (~mask >>> 0)) >>> 0;\n\t\tthis.#highAddress = (currentValue | mask) >>> 0;\n\t\tthis.size = size;\n\t}\n\n\tpublic static fromAddr(address: Ipv4Addr, size: number): Ipv4Net {\n\t\treturn new Ipv4Net(address, size);\n\t}\n\n\tpublic static from(value: string): Ipv4Net {\n\t\tconst [addrStr, sizeStr] = value.split('/');\n\t\tconst addr = Ipv4Addr.from(addrStr).unwrap();\n\t\tif (!/^-?\\d+$/.test(sizeStr)) {\n\t\t\tthrow new Error('Invalid IPv4 network size: must be numeric');\n\t\t}\n\t\tconst size = parseInt(sizeStr, 10);\n\t\tif (size < 0 || size > 32) {\n\t\t\tthrow new Error('Invalid IPv4 network size: must be between 0 and 32');\n\t\t}\n\t\treturn new Ipv4Net(addr, size);\n\t}\n\n\tpublic isInRange(address: Ipv4Addr): boolean {\n\t\tconst value = address.value;\n\t\treturn value >= this.#lowAddress && value <= this.#highAddress;\n\t}\n}\n","import {Ipv6Addr} from './Ipv6Addr';\n\n/**\n * Represents an IPv6 network.\n * @example\n * const addr = Ipv6Addr.from('2001:db8::1').unwrap();\n * const network = Ipv6Net.fromAddr(addr, 64);\n * @since v0.1.2\n */\nexport class Ipv6Net {\n\t#lowAddress: bigint;\n\t#highAddress: bigint;\n\tpublic readonly address: Ipv6Addr;\n\tpublic readonly size: number;\n\tprivate constructor(address: Ipv6Addr, size: number) {\n\t\tthis.address = address;\n\t\tconst currentValue = address.value;\n\t\tconst mask = (BigInt(1) << BigInt(128 - size)) - BigInt(1);\n\t\tthis.#lowAddress = currentValue & ~mask;\n\t\tthis.#highAddress = currentValue | mask;\n\t\tthis.size = size;\n\t}\n\n\tpublic static fromAddr(address: Ipv6Addr, size: number): Ipv6Net {\n\t\treturn new Ipv6Net(address, size);\n\t}\n\n\tpublic static from(value: string): Ipv6Net {\n\t\tconst [addrStr, sizeStr] = value.split('/');\n\t\tconst addr = Ipv6Addr.from(addrStr).unwrap();\n\t\tif (!/^-?\\d+$/.test(sizeStr)) {\n\t\t\tthrow new Error('Invalid IPv6 network size: must be numeric');\n\t\t}\n\t\tconst size = parseInt(sizeStr, 10);\n\t\tif (size < 0 || size > 128) {\n\t\t\tthrow new Error('Invalid IPv6 network size: must be between 0 and 128');\n\t\t}\n\t\treturn new Ipv6Net(addr, size);\n\t}\n\n\tpublic isInRange(address: Ipv6Addr): boolean {\n\t\tconst value = address.value;\n\t\treturn value >= this.#lowAddress && value <= this.#highAddress;\n\t}\n}\n"],"mappings":"yFAWA,IAAa,EAAb,MAAa,CAAS,CACrB,OAAe,MACd,wpBASD,OAAc,KAAK,EAA0D,CAI5E,OAHI,OAAO,GAAU,UAAY,CAAC,EAAS,MAAM,KAAK,CAAK,EACnD,EAAQ,UAAU,GAAG,KAAK,UAAU,CAAK,EAAE,uBAAuB,CAAC,EAEpE,EAAS,GAAiB,CAAK,CAAC,CAAC,SAAS,CAAC,WAAU,YAAW,kBAAkB,CACxF,IAAM,EAAqB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAE1C,IAAK,IAAI,EAAI,EAAG,EAAI,EAAS,OAAQ,IACpC,EAAS,GAAK,EAAS,GAGxB,IAAM,EAAgB,EAAI,EAAU,OAAS,EAAa,OAC1D,IAAK,IAAI,EAAI,EAAG,EAAI,EAAU,OAAQ,IACrC,EAAS,EAAgB,GAAK,EAAU,GAGzC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAa,OAAQ,IACxC,EAAS,EAAgB,EAAU,OAAS,GAAK,EAAa,GAE/D,GAAI,CACH,OAAO,EAAG,IAAI,EAAS,CAA4E,CAAC,CACrG,OAAS,EAAK,CACb,OAAO,EAAI,CAAiB,CAC7B,CACD,CAAC,CACF,CAOA,OAAc,WAAW,EAAqB,EAA2C,CACxF,GAAI,CACH,IAAM,EAAO,IAAI,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AK,CAAO,CAAC,CAAC,OAAO,EAC3C,GAAI,CAAC,UAAU,KAAK,CAAO,EAC1B,MAAU,MAAM,4CAA4C,EAE7D,IAAM,EAAO,SAAS,EAAS,EAAE,EACjC,GAAI,EAAO,GAAK,EAAO,IACtB,MAAU,MAAM,sDAAsD,EAEvE,OAAO,IAAI,EAAQ,EAAM,CAAI,CAC9B,CAEA,UAAiB,EAA4B,CAC5C,IAAM,EAAQ,EAAQ,MACtB,OAAO,GAAS,KAAK,IAAe,GAAS,KAAK,EACnD,CACD"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/common.ts","../src/Ipv6Addr.ts","../src/Ipv4Addr.ts","../src/Ipv4Net.ts","../src/Ipv6Net.ts"],"sourcesContent":["import type {CoreResult} from 'core-result';\n\n/** unwraps a CoreResult, throwing an error if it is not successful */\nexport function uw<T, E>(result: CoreResult<T, E>): T {\n\tif (!result.success) {\n\t\tthrow result.error;\n\t}\n\treturn result.value;\n}\n","import type {CoreResult} from 'core-result';\nimport {uw} from './common';\nimport {Ipv4Addr} from './Ipv4Addr';\n\n/**\n * Represents an IPv6 address.\n * @example\n * const addrRes1 = Ipv6Addr.from('2001:db8::1');\n * const addr1 = Ipv6Addr.fromOrThrow('2001:db8::1');\n * const addr2 = new Ipv6Addr([0x2001, 0xdb8, 0, 0, 0, 0, 0, 1]);\n * const addr3 = new Ipv6Addr(0x20010db8000000000000000000000001n);\n * @since v0.0.1\n */\nexport class Ipv6Addr {\n\tstatic #regex =\n\t\t/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\n\n\t/**\n\t * Creates an IPv6 address from text.\n\t * @returns A successful result with an IPv6 address, or an error when the input is invalid.\n\t * @example\n\t * const addrRes: CoreResult<Ipv6Addr, TypeError | RangeError> = Ipv6Addr.from('2001:db8::1');\n\t * @since v0.0.1\n\t */\n\tpublic static from(value: string): CoreResult<Ipv6Addr, TypeError | RangeError> {\n\t\tif (typeof value !== 'string' || !Ipv6Addr.#regex.test(value)) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: new TypeError(`${JSON.stringify(value)} is invalid ipv6 value`),\n\t\t\t};\n\t\t}\n\t\tconst parseResult = Ipv6Addr.#parseComponents(value);\n\t\tif (!parseResult.success) {\n\t\t\treturn parseResult;\n\t\t}\n\t\tconst {leftSegs, rightSegs, embeddedIpv4} = parseResult.value;\n\t\tconst segments: number[] = Array(8).fill(0);\n\t\t// Place left segments\n\t\tfor (let i = 0; i < leftSegs.length; i++) {\n\t\t\tsegments[i] = leftSegs[i];\n\t\t}\n\t\t// Place right segments\n\t\tconst rightStartIdx = 8 - rightSegs.length - embeddedIpv4.length;\n\t\tfor (let i = 0; i < rightSegs.length; i++) {\n\t\t\tsegments[rightStartIdx + i] = rightSegs[i];\n\t\t}\n\t\t// Place embedded IPv4\n\t\tfor (let i = 0; i < embeddedIpv4.length; i++) {\n\t\t\tsegments[rightStartIdx + rightSegs.length + i] = embeddedIpv4[i];\n\t\t}\n\t\ttry {\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tvalue: new Ipv6Addr(segments as [number, number, number, number, number, number, number, number]),\n\t\t\t};\n\t\t} catch (err) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: err as RangeError,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Creates an IPv6 address from text and throws an error if the input is invalid.\n\t * @param value The IPv6 address in string format.\n\t * @returns The IPv6 address instance.\n\t * @example\n\t * const addr: Ipv6Addr = Ipv6Addr.fromOrThrow('2001:db8::1');\n\t * @since v0.2.0\n\t */\n\tpublic static fromOrThrow(value: string): Ipv6Addr {\n\t\treturn uw(Ipv6Addr.from(value));\n\t}\n\n\t/**\n\t * Creates an IPv6 address from a 16-byte buffer.\n\t * @returns A successful result with an IPv6 address, or an error when the buffer cannot be read.\n\t * @example\n\t * const addrRes: CoreResult<Ipv6Addr> = Ipv6Addr.fromBuffer(buffer);\n\t * @since v0.0.1\n\t */\n\tpublic static fromBuffer(buffer: ArrayBuffer, littleEndian?: boolean): CoreResult<Ipv6Addr> {\n\t\ttry {\n\t\t\tconst view = new DataView(buffer);\n\t\t\tif (littleEndian) {\n\t\t\t\tconst low = view.getBigUint64(0, true);\n\t\t\t\tconst high = view.getBigUint64(8, true);\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\tvalue: new Ipv6Addr((high << 64n) | low),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst high = view.getBigUint64(0, false);\n\t\t\t\tconst low = view.getBigUint64(8, false);\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\tvalue: new Ipv6Addr((high << 64n) | low),\n\t\t\t\t};\n\t\t\t}\n\t\t} catch (err) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: err as Error,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Creates an IPv6 address from a 16-byte buffer and throws an error if the buffer cannot be read.\n\t * @param buffer The 16-byte buffer containing the IPv6 address.\n\t * @param littleEndian Whether the buffer is in little-endian format. Defaults to false (big-endian).\n\t * @returns The IPv6 address instance.\n\t * @example\n\t * const addr: Ipv6Addr = Ipv6Addr.fromBufferOrThrow(buffer);\n\t * @since v0.2.0\n\t */\n\tpublic static fromBufferOrThrow(buffer: ArrayBuffer, littleEndian?: boolean): Ipv6Addr {\n\t\treturn uw(Ipv6Addr.fromBuffer(buffer, littleEndian));\n\t}\n\n\t/**\n\t * Creates an IPv6 address from a raw bigint value.\n\t * @param value The raw bigint value representing the IPv6 address.\n\t * @returns The IPv6 address instance.\n\t * @example\n\t * const addr: Ipv6Addr = Ipv6Addr.fromRaw(0x20010db8000000000000000000000001n);\n\t * @since v0.2.0\n\t */\n\tpublic static fromRaw(value: bigint): Ipv6Addr {\n\t\t// check valid value\n\t\tif (value < 0n || value > 0xffffffffffffffffffffffffffffffffn) {\n\t\t\tthrow new RangeError(`${value} is out of range for an IPv6 address`);\n\t\t}\n\t\treturn new Ipv6Addr(value);\n\t}\n\n\tstatic #parseInt(value: string, radix: number): CoreResult<number, TypeError> {\n\t\tconst output = parseInt(value, radix);\n\t\tif (Number.isNaN(output)) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: new TypeError(`${value} is not a valid number`),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tvalue: output,\n\t\t};\n\t}\n\n\tstatic #parseComponents(value: string): CoreResult<{leftSegs: number[]; rightSegs: number[]; embeddedIpv4: number[]}, TypeError> {\n\t\tconst components = value.split('::');\n\t\tconst leftParts = components[0].split(':').filter((x) => x !== '');\n\t\tconst rightParts = components.length > 1 ? components[1].split(':').filter((x) => x !== '') : [];\n\t\tlet embeddedIpv4: number[] = [];\n\t\tconst lastPart = rightParts[rightParts.length - 1] ?? leftParts[leftParts.length - 1];\n\t\t// check if the last part is an embedded IPv4 address (e.g., ::ffff:192.168.0.1)\n\t\tif (lastPart?.includes('.')) {\n\t\t\tconst embeddedIpv4Result = Ipv6Addr.#parseEmbeddedIpv4(lastPart);\n\t\t\tif (!embeddedIpv4Result.success) {\n\t\t\t\treturn embeddedIpv4Result;\n\t\t\t}\n\t\t\tembeddedIpv4 = embeddedIpv4Result.value;\n\t\t\tif (rightParts.length > 0) {\n\t\t\t\trightParts.pop();\n\t\t\t} else {\n\t\t\t\tleftParts.pop();\n\t\t\t}\n\t\t}\n\t\tconst leftSegs = Ipv6Addr.#resultArray(leftParts.map((p) => Ipv6Addr.#parseInt(p, 16)));\n\t\tif (!leftSegs.success) {\n\t\t\treturn leftSegs;\n\t\t}\n\t\tconst rightSegs = Ipv6Addr.#resultArray(rightParts.map((p) => Ipv6Addr.#parseInt(p, 16)));\n\t\tif (!rightSegs.success) {\n\t\t\treturn rightSegs;\n\t\t}\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tvalue: {leftSegs: leftSegs.value, rightSegs: rightSegs.value, embeddedIpv4},\n\t\t};\n\t}\n\n\tstatic #parseEmbeddedIpv4(value: string): CoreResult<number[], TypeError> {\n\t\tconst octets = Ipv6Addr.#resultArray(value.split('.').map((octet) => Ipv6Addr.#parseInt(octet, 10)));\n\t\tif (!octets.success) {\n\t\t\treturn octets;\n\t\t}\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tvalue: [(octets.value[0] << 8) | octets.value[1], (octets.value[2] << 8) | octets.value[3]],\n\t\t};\n\t}\n\n\t/**\n\t * The number of bits in an IPv6 address.\n\t * @since v0.0.1\n\t */\n\tpublic static readonly BITS = 128;\n\n\t/**\n\t * The loopback address (`::1`).\n\t * @since v0.0.1\n\t */\n\tpublic static readonly LOCALHOST: Ipv6Addr = new Ipv6Addr(0x00000000000000000000000000000001n);\n\n\t/**\n\t * The unspecified address (`::`).\n\t * @since v0.0.1\n\t */\n\tpublic static readonly UNSPECIFIED: Ipv6Addr = new Ipv6Addr(0x00000000000000000000000000000000n);\n\n\t/**\n\t * The address family identifier for IPv6 addresses.\n\t * @since v0.0.1\n\t */\n\tpublic readonly family = 'ipv6';\n\n\t#integerAddress: bigint;\n\n\t/**\n\t * Gets the raw {@link BigInt} representation of the {@link Ipv6Addr} address.\n\t * @since v0.2.0\n\t */\n\tpublic get value(): bigint {\n\t\treturn this.#integerAddress;\n\t}\n\n\t/**\n\t * Creates a new {@link Ipv6Addr} address instance.\n\t * @param value - A bigint representing the IPv6 address or an array of 8 numbers representing the segments of the address.\n\t * @throws {RangeError} If the segments array does not have exactly 8 elements or if any segment is out of range.\n\t * @throws {TypeError} If the input is neither a bigint nor an array of 8 numbers.\n\t */\n\tpublic constructor(value: bigint);\n\tpublic constructor(segments: [number, number, number, number, number, number, number, number]);\n\tpublic constructor(valueOrSegments: [number, number, number, number, number, number, number, number] | bigint) {\n\t\tif (Array.isArray(valueOrSegments) && valueOrSegments.every((seg) => typeof seg === 'number')) {\n\t\t\tthis.#integerAddress = this.#toInteger(valueOrSegments);\n\t\t} else if (typeof valueOrSegments === 'bigint') {\n\t\t\tthis.#integerAddress = valueOrSegments;\n\t\t} else {\n\t\t\tthrow new TypeError('Invalid Ipv6Addr arguments. Expected either 1 bigint or 8 numbers (segments).');\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether this address is in the benchmarking range.\n\t * @see https://tools.ietf.org/html/rfc5180 and https://www.rfc-editor.org/errata_search.php?eid=1752\n\t * @returns `true` when the address is in `2001:2::/48`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isBenchmarking(): boolean {\n\t\treturn this.#match(0x20010002000000000000000000000000n, 48);\n\t}\n\n\t/**\n\t * Checks whether this address is in a documentation-only range.\n\t * @see https://tools.ietf.org/html/rfc3849 and https://tools.ietf.org/html/rfc9637\n\t * @returns `true` for `2001:db8::/32` or `3fff::/20`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isDocumentation(): boolean {\n\t\treturn this.#match(0x20010db8000000000000000000000000n, 32) || this.#match(0x3fff0000000000000000000000000000n, 20);\n\t}\n\n\t/**\n\t * Checks whether this address is the loopback address.\n\t * @see https://tools.ietf.org/html/rfc4291#section-2.5.3\n\t * @returns `true` when the address is `::1`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isLoopback(): boolean {\n\t\treturn this.#integerAddress === 1n;\n\t}\n\n\t/**\n\t * Checks whether this address is the unspecified address.\n\t * @see https://tools.ietf.org/html/rfc4291\n\t * @returns `true` when the address is `::`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isUnspecified(): boolean {\n\t\treturn this.#integerAddress === 0n;\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast address.\n\t * @see https://tools.ietf.org/html/rfc4291\n\t * @returns `true` when the address is in `ff00::/8`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isMulticast(): boolean {\n\t\treturn this.#integerAddress >> 120n === 0xffn;\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast interface-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff01::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastInterfaceLocal(): boolean {\n\t\treturn this.#match(0xff010000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast link-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff02::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastLinkLocal(): boolean {\n\t\treturn this.#match(0xff020000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is the all-nodes multicast group address.\n\t * @returns `true` when the address is multicast and the group ID is 1, otherwise `false`.\n\t * @since v0.2.0\n\t */\n\tpublic isAllNodesMulticastGroup(): boolean {\n\t\treturn this.isMulticast() && this.#groupId() === 1n;\n\t}\n\n\t/**\n\t * Checks whether this address is the all-routers multicast group address.\n\t * @returns `true` when the address is multicast and the group ID is 2, otherwise `false`.\n\t * @since v0.2.0\n\t */\n\tpublic isAllRoutersMulticastGroup(): boolean {\n\t\treturn this.isMulticast() && this.#groupId() === 2n;\n\t}\n\n\t/**\n\t * Checks whether this address is the mDNS multicast group address.\n\t * @returns `true` when the address is `ff02::fb`, otherwise `false`.\n\t * @since v0.2.0\n\t */\n\tpublic isMdnsMulticastGroup(): boolean {\n\t\treturn this.isMulticastLinkLocal() && this.#groupId() === 0xfbn;\n\t}\n\t/**\n\t * Checks whether this address is the SSDP multicast group address.\n\t * @returns `true` when the address is `ff02::c`, otherwise `false`.\n\t * @since v0.2.0\n\t */\n\tpublic isSsdpMulticastGroup(): boolean {\n\t\treturn this.isMulticastLinkLocal() && this.#groupId() === 0x0cn;\n\t}\n\n\t/**\n\t * Checks whether this address is the DHCPv6 multicast group address.\n\t * @returns `true` when the address is `ff02::12`, otherwise `false`.\n\t * @since v0.2.0\n\t */\n\tpublic isDhcpv6MulticastGroup(): boolean {\n\t\treturn this.isMulticastLinkLocal() && this.#groupId() === 0x12n;\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast realm-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff03::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastRealmLocal(): boolean {\n\t\treturn this.#match(0xff030000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast admin-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff04::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastAdminLocal(): boolean {\n\t\treturn this.#match(0xff040000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast site-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff05::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastSiteLocal(): boolean {\n\t\treturn this.#match(0xff050000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast organization-local address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff08::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastOrganizationLocal(): boolean {\n\t\treturn this.#match(0xff080000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast global address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc4291#section-2.7\n\t * @returns `true` when the address is in `ff0e::/16`, otherwise `false`.\n\t * @since v0.0.2\n\t */\n\tpublic isMulticastGlobal(): boolean {\n\t\treturn this.#match(0xff0e0000000000000000000000000000n, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is an IPv4-mapped IPv6 address.\n\t * @returns `true` when the address is in `::ffff:0:0/96`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isIpv4Mapped(): boolean {\n\t\treturn this.#match(0x00000000000000000000ffff00000000n, 96);\n\t}\n\n\t/**\n\t * Checks whether this address is a unicast address.\n\t * @see https://tools.ietf.org/html/rfc4291\n\t * @returns `true` when the address is not multicast, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isUnicast(): boolean {\n\t\treturn !this.isMulticast();\n\t}\n\n\t/**\n\t * Checks whether this address is a link-local unicast address.\n\t * @see https://tools.ietf.org/html/rfc4291\n\t * @returns `true` when the address is in `fe80::/10`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isUnicastLinkLocal(): boolean {\n\t\treturn this.#match(0xfe800000000000000000000000000000n, 10);\n\t}\n\n\t/**\n\t * Checks whether this address is a global unicast address.\n\t * @see https://tools.ietf.org/html/rfc4291#section-2.5.7\n\t * @returns `true` when the address is unicast and not loopback, link-local, private, unspecified, or documentation.\n\t * @since v0.0.1\n\t */\n\tpublic isUnicastGlobal(): boolean {\n\t\treturn this.isUnicast() && !this.isLoopback() && !this.isUnicastLinkLocal() && !this.isUniqueLocal() && !this.isUnspecified() && !this.isDocumentation();\n\t}\n\n\t/**\n\t * Checks whether this address appears globally reachable.\n\t * @see https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml\n\t * @returns `true` when the address is not in known non-global special ranges.\n\t * @since v0.0.1\n\t */\n\tpublic isGlobal(): boolean {\n\t\treturn (\n\t\t\t!this.isUnspecified() &&\n\t\t\t!this.isLoopback() &&\n\t\t\t!this.isIpv4Mapped() &&\n\t\t\t!this.isBenchmarking() &&\n\t\t\t!this.isDocumentation() &&\n\t\t\t!this.isUniqueLocal() &&\n\t\t\t!this.isUnicastLinkLocal() &&\n\t\t\t!this.isMulticast()\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether this address is in the unique-local range.\n\t * @see https://tools.ietf.org/html/rfc4193\n\t * @returns `true` when the address is in `fc00::/7`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isUniqueLocal(): boolean {\n\t\treturn this.#match(0xfc000000000000000000000000000000n, 7);\n\t}\n\n\t/**\n\t * Converts this address to IPv4 when compatible or mapped.\n\t * @returns A {@link CoreResult} containing either the resulting {@link Ipv4Addr} or a {@link RangeError} if the address is not IPv4 compatible or mapped.\n\t * @since v0.0.1\n\t */\n\tpublic toIpv4(): CoreResult<Ipv4Addr, RangeError> {\n\t\tif (this.isIpv4Mapped() || this.#match(0n, 96)) {\n\t\t\tconst segments = this.#fromInteger(this.#integerAddress);\n\t\t\treturn {success: true, value: new Ipv4Addr(segments[6] >> 8, segments[6] & 0xff, segments[7] >> 8, segments[7] & 0xff)};\n\t\t}\n\t\treturn {success: false, error: new RangeError('Address is not IPv4 compatible or mapped')};\n\t}\n\n\t/**\n\t * Converts this address to IPv4 when compatible or mapped, throwing on failure.\n\t * @returns An {@link Ipv4Addr} for `::a.b.c.d` or `::ffff:a.b.c.d`.\n\t * @throws {RangeError} If the address is not IPv4 compatible or mapped.\n\t * @since v0.2.0\n\t */\n\tpublic toIpv4OrThrow(): Ipv4Addr {\n\t\treturn uw(this.toIpv4());\n\t}\n\n\t/**\n\t * Converts this address to IPv4 only when it is IPv4-mapped.\n\t * @returns A {@link CoreResult} containing either the resulting {@link Ipv4Addr} or a {@link RangeError} if the address is not IPv4 mapped.\n\t * @since v0.0.1\n\t */\n\tpublic toIpv4Mapped(): CoreResult<Ipv4Addr, RangeError> {\n\t\tif (this.isIpv4Mapped()) {\n\t\t\tconst segments = this.#fromInteger(this.#integerAddress);\n\t\t\treturn {success: true, value: new Ipv4Addr(segments[6] >> 8, segments[6] & 0xff, segments[7] >> 8, segments[7] & 0xff)};\n\t\t}\n\t\treturn {success: false, error: new RangeError('Address is not IPv4 mapped')};\n\t}\n\n\t/**\n\t * Converts this address to IPv4 only when it is IPv4-mapped, throwing on failure.\n\t * @returns An {@link Ipv4Addr} address for `::ffff:a.b.c.d`.\n\t * @throws {RangeError} If the address is not IPv4 mapped.\n\t * @since v0.2.0\n\t */\n\tpublic toIpv4MappedOrThrow(): Ipv4Addr {\n\t\treturn uw(this.toIpv4Mapped());\n\t}\n\n\t/**\n\t * Formats this address as a compressed IPv6 string.\n\t * @returns The shortest standard IPv6 text form.\n\t * @since v0.0.1\n\t */\n\tpublic toString(): string {\n\t\tconst segments = this.#fromInteger(this.#integerAddress);\n\t\tlet maxZeroStart = -1;\n\t\tlet maxZeroLen = 0;\n\t\tlet currentZeroStart = -1;\n\t\tlet currentZeroLen = 0;\n\n\t\tfor (let i = 0; i < segments.length; i++) {\n\t\t\tif (segments[i] === 0) {\n\t\t\t\tif (currentZeroStart === -1) {\n\t\t\t\t\tcurrentZeroStart = i;\n\t\t\t\t\tcurrentZeroLen = 1;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentZeroLen++;\n\t\t\t\t}\n\t\t\t\tif (currentZeroLen > maxZeroLen) {\n\t\t\t\t\tmaxZeroLen = currentZeroLen;\n\t\t\t\t\tmaxZeroStart = currentZeroStart;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentZeroStart = -1;\n\t\t\t\tcurrentZeroLen = 0;\n\t\t\t}\n\t\t}\n\n\t\tif (maxZeroLen < 2) {\n\t\t\treturn segments.map((s) => s.toString(16)).join(':');\n\t\t}\n\n\t\tconst before = segments.slice(0, maxZeroStart).map((s) => s.toString(16));\n\t\tconst after = segments.slice(maxZeroStart + maxZeroLen).map((s) => s.toString(16));\n\n\t\treturn `${before.join(':')}::${after.join(':')}`;\n\t}\n\t/**\n\t * Converts this address to its fully expanded IPv6 string representation.\n\t * @returns The expanded IPv6 string (e.g., `2001:0db8:0000:0000:0000:ff00:0042:8329`).\n\t * @since v0.2.0\n\t */\n\tpublic toExpandedString(): string {\n\t\tconst segments = this.#fromInteger(this.#integerAddress);\n\t\treturn segments.map((s) => s.toString(16).padStart(4, '0')).join(':');\n\t}\n\n\t/**\n\t * Encodes this address to a 16-byte buffer.\n\t * @param littleEndian Whether to use little-endian byte order. Defaults to `false`.\n\t * @returns An {@link ArrayBuffer} containing the IPv6 integer value.\n\t * @since v0.0.1\n\t */\n\tpublic toBuffer(littleEndian?: boolean): ArrayBuffer {\n\t\tconst view = new DataView(new ArrayBuffer(16));\n\t\tif (littleEndian) {\n\t\t\tview.setBigUint64(0, this.#integerAddress & 0xffffffffffffffffn, true);\n\t\t\tview.setBigUint64(8, this.#integerAddress >> 64n, true);\n\t\t} else {\n\t\t\tview.setBigUint64(0, this.#integerAddress >> 64n, false);\n\t\t\tview.setBigUint64(8, this.#integerAddress & 0xffffffffffffffffn, false);\n\t\t}\n\t\treturn view.buffer;\n\t}\n\n\t/**\n\t * Compares this address with another for equality.\n\t * @param other instance of another {@link Ipv6Addr} or {@link Ipv4Addr} address to compare with.\n\t * @returns `true` if both addresses are equal, otherwise `false`.\n\t * @since v0.1.0\n\t */\n\tpublic equals(other?: unknown): boolean {\n\t\treturn other instanceof Ipv6Addr && this.#integerAddress === other.#integerAddress;\n\t}\n\n\t/**\n\t * Converts an array of IPv6 segments to a {@link BigInt} representation.\n\t * @param segments An array of 8 numbers representing the IPv6 segments.\n\t * @returns A bigint representing the IPv6 address.\n\t * @throws {RangeError} If the segments array does not have exactly 8 elements or if any segment is out of range.\n\t */\n\t#toInteger(segments: [number, number, number, number, number, number, number, number]): bigint {\n\t\tif (segments.length !== 8) {\n\t\t\tthrow new RangeError('IPv6 address must have exactly 8 segments');\n\t\t}\n\t\tlet result = 0n;\n\t\tfor (const segment of segments) {\n\t\t\tif (segment < 0 || segment > 0xffff) {\n\t\t\t\tthrow new RangeError('IPv6 segment must be between 0 and 65535');\n\t\t\t}\n\t\t\tresult = (result << 16n) | BigInt(segment);\n\t\t}\n\t\treturn result;\n\t}\n\n\t#fromInteger(integer: bigint): [number, number, number, number, number, number, number, number] {\n\t\treturn [\n\t\t\tNumber((integer >> 112n) & 0xffffn),\n\t\t\tNumber((integer >> 96n) & 0xffffn),\n\t\t\tNumber((integer >> 80n) & 0xffffn),\n\t\t\tNumber((integer >> 64n) & 0xffffn),\n\t\t\tNumber((integer >> 48n) & 0xffffn),\n\t\t\tNumber((integer >> 32n) & 0xffffn),\n\t\t\tNumber((integer >> 16n) & 0xffffn),\n\t\t\tNumber(integer & 0xffffn),\n\t\t];\n\t}\n\n\t#match(network: bigint, prefix: number): boolean {\n\t\tif (prefix < 0 || prefix > 128) {\n\t\t\tthrow new Error('Invalid prefix length');\n\t\t}\n\t\tif (prefix === 0) {\n\t\t\treturn true;\n\t\t}\n\t\tconst ALL_ONES = (1n << 128n) - 1n;\n\t\tconst mask = (ALL_ONES << BigInt(128 - prefix)) & ALL_ONES;\n\t\treturn (this.#integerAddress & mask) === (network & mask);\n\t}\n\n\t/**\n\t * Extracts the group ID from the IPv6 multicast address.\n\t * @returns The 112-bit group ID as a bigint.\n\t */\n\t#groupId(): bigint {\n\t\treturn this.#integerAddress & ((1n << 112n) - 1n);\n\t}\n\n\tstatic #resultArray<T, E>(results: CoreResult<T, E>[]): CoreResult<T[], E> {\n\t\tconst values: T[] = [];\n\t\tfor (const result of results) {\n\t\t\tif (!result.success) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: result.error,\n\t\t\t\t};\n\t\t\t}\n\t\t\tvalues.push(result.value);\n\t\t}\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tvalue: values,\n\t\t};\n\t}\n}\n","import type {CoreResult} from 'core-result';\nimport {uw} from './common';\nimport {Ipv6Addr} from './Ipv6Addr';\n\n/**\n * Represents an IPv4 address.\n * @example\n * const addr1Res = Ipv4Addr.from('192.168.0.1');\n * const addr1 = Ipv4Addr.fromOrThrow('192.168.0.1');\n * const addr2 = new Ipv4Addr(192, 168, 0, 1);\n * const addr3 = new Ipv4Addr(0xc0a80001);\n * @since v0.0.1\n */\nexport class Ipv4Addr {\n\t/**\n\t * Creates an IPv4 address from dotted-decimal text.\n\t * @returns A successful {@link CoreResult} with an {@link Ipv4Addr}, or an {@link TypeError} when the input is invalid.\n\t * @example\n\t * const addr: CoreResult<Ipv4Addr, TypeError> = Ipv4Addr.from('192.168.0.1');\n\t * @since v0.0.1\n\t */\n\tpublic static from(value: string): CoreResult<Ipv4Addr, TypeError> {\n\t\tconst match = value.match(/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/);\n\t\tif (!match) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: new TypeError(`${value} is invalid ipv4 value`),\n\t\t\t};\n\t\t}\n\t\tconst octets = match.slice(1).map(Number);\n\t\tif (octets.some((o) => o > 255)) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: new TypeError(`${value} is invalid ipv4 value`),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tvalue: new Ipv4Addr(octets[0], octets[1], octets[2], octets[3]),\n\t\t};\n\t}\n\n\t/**\n\t * Creates an IPv4 address from text and throws an error if the input is invalid.\n\t * @param value The IPv4 address in string format.\n\t * @returns The {@link Ipv4Addr} instance.\n\t * @throws {TypeError} If the input is not a valid IPv4 address.\n\t * @example\n\t * const addr: Ipv4Addr = Ipv4Addr.fromOrThrow('192.168.0.1');\n\t * @since v0.2.0\n\t */\n\tpublic static fromOrThrow(value: string): Ipv4Addr {\n\t\treturn uw(Ipv4Addr.from(value));\n\t}\n\n\t/**\n\t * Creates an IPv4 address from a 4-byte buffer.\n\t * @returns A successful {@link CoreResult} with an {@link Ipv4Addr}, or an {@link Error} when the buffer cannot be read.\n\t * @example\n\t * const result: CoreResult<Ipv4Addr, Error> = Ipv4Addr.fromBuffer(buffer);\n\t * @since v0.0.1\n\t */\n\tpublic static fromBuffer(buffer: ArrayBuffer, littleEndian?: boolean): CoreResult<Ipv4Addr, Error> {\n\t\ttry {\n\t\t\tconst view = new DataView(buffer);\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tvalue: new Ipv4Addr(view.getUint32(0, littleEndian)),\n\t\t\t};\n\t\t} catch (err) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: err as Error,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Creates an IPv4 address from a 4-byte buffer and throws an error if the buffer cannot be read.\n\t * @param buffer The 4-byte buffer containing the IPv4 address.\n\t * @param littleEndian Whether the buffer is in little-endian format. Defaults to false (big-endian).\n\t * @returns The {@link Ipv4Addr} instance.\n\t * @throws {Error} If the buffer cannot be read.\n\t * @example\n\t * const addr: Ipv4Addr = Ipv4Addr.fromBufferOrThrow(buffer);\n\t * @since v0.2.0\n\t */\n\tpublic static fromBufferOrThrow(buffer: ArrayBuffer, littleEndian?: boolean): Ipv4Addr {\n\t\treturn uw(Ipv4Addr.fromBuffer(buffer, littleEndian));\n\t}\n\n\t/**\n\t * The number of bits in an IPv4 address.\n\t * @since v0.0.1\n\t * @see https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#associatedconstant.BITS\n\t */\n\tpublic static readonly BITS = 32;\n\n\t/**\n\t * The broadcast address `255.255.255.255`.\n\t * @since v0.0.1\n\t * @see https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#associatedconstant.BROADCAST\n\t */\n\tpublic static readonly BROADCAST: Ipv4Addr = new Ipv4Addr(0xffffffff);\n\n\t/**\n\t * The localhost address `127.0.0.1`.\n\t * @since v0.0.1\n\t * @see https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#associatedconstant.LOCALHOST\n\t */\n\tpublic static readonly LOCALHOST: Ipv4Addr = new Ipv4Addr(0x7f000001);\n\n\t/**\n\t * The unspecified address `0.0.0.0`.\n\t * @since v0.0.1\n\t * @see https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#associatedconstant.UNSPECIFIED\n\t */\n\tpublic static readonly UNSPECIFIED: Ipv4Addr = new Ipv4Addr(0x00000000);\n\n\t/**\n\t * The address family identifier for IPv4 addresses.\n\t * @since v0.0.1\n\t */\n\tpublic readonly family = 'ipv4';\n\n\t#integerAddress: number;\n\n\t/**\n\t * Gets the raw integer representation of the IPv4 address.\n\t */\n\tpublic get value(): number {\n\t\treturn this.#integerAddress;\n\t}\n\n\t/**\n\t * Creates a new IPv4 address from four octets.\n\t * @param num1 The first octet.\n\t * @param num2 The second octet.\n\t * @param num3 The third octet.\n\t * @param num4 The fourth octet.\n\t * @throws {RangeError} If the integer values are not in the range of 0 to 255 for each octet.\n\t * @throws {TypeError} If the input is not a number.\n\t * @example\n\t * new Ipv4Addr(192, 168, 0, 1) // creates the address `192.168.0.1`\n\t */\n\tpublic constructor(num1: number, num2: number, num3: number, num4: number);\n\t/**\n\t * Creates a new IPv4 address from an integer value.\n\t * @param integerValue The integer representation of the IPv4 address.\n\t * @throws {RangeError} If the integer value is not in the range of 0 to 0xffffffff.\n\t * @throws {TypeError} If the input is not a number.\n\t * @example\n\t * new Ipv4Addr(0xc0a80001) // creates the address `192.168.0.1` from the integer value `0xc0a80001`\n\t */\n\tpublic constructor(integerValue: number);\n\tpublic constructor(...args: [number] | [number, number, number, number]) {\n\t\tif ((args.length !== 1 && args.length !== 4) || args.some((arg) => typeof arg !== 'number')) {\n\t\t\tthrow new TypeError('Invalid Ipv4Addr arguments. Expected either 1 number (integer value) or 4 numbers (octets).');\n\t\t}\n\t\tif (args.length === 1) {\n\t\t\tif (args[0] < 0 || args[0] > 0xffffffff) {\n\t\t\t\tthrow new RangeError('IPv4 integer value must be between 0 and 0xffffffff');\n\t\t\t}\n\t\t\tthis.#integerAddress = args[0];\n\t\t} else {\n\t\t\tthis.#integerAddress = this.#toInteger(args[0], args[1], args[2], args[3]);\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether this address is the broadcast address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc919#section-7\n\t * @returns `true` when the address is `255.255.255.255`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isBroadcast(): boolean {\n\t\treturn this.#integerAddress === 0xffffffff;\n\t}\n\n\t/**\n\t * Checks whether this address is in a documentation-only range.\n\t * @see https://datatracker.ietf.org/doc/html/rfc5737\n\t * @returns `true` for `192.0.2.0/24`, `198.51.100.0/24`, or `203.0.113.0/24`; otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isDocumentation(): boolean {\n\t\treturn (\n\t\t\tthis.#match(0xc0000200, 24) || // 192.0.2.0/24\n\t\t\tthis.#match(0xc6336400, 24) || // 198.51.100.0/24\n\t\t\tthis.#match(0xcb007100, 24) // 203.0.113.0/24\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether this address is in the benchmarking range.\n\t * @see https://datatracker.ietf.org/doc/html/rfc2544\n\t * @returns `true` when the address is in `198.18.0.0/15`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isBenchmarking(): boolean {\n\t\treturn this.#match(0xc6120000, 15);\n\t}\n\n\t/**\n\t * Checks whether this address is globally reachable.\n\t * @see https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml\n\t * @returns `true` when the address is not in any special non-global range.\n\t * @since v0.0.1\n\t */\n\tpublic isGlobal(): boolean {\n\t\treturn !(\n\t\t\tthis.isUnspecified() ||\n\t\t\tthis.isPrivate() ||\n\t\t\tthis.isShared() ||\n\t\t\tthis.isLoopback() ||\n\t\t\tthis.isLinkLocal() ||\n\t\t\tthis.isDocumentation() ||\n\t\t\tthis.isBenchmarking() ||\n\t\t\tthis.isReserved() ||\n\t\t\tthis.isMulticast() ||\n\t\t\tthis.isBroadcast()\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether this address is link-local.\n\t * @see https://datatracker.ietf.org/doc/html/rfc3927\n\t * @returns `true` when the address is in `169.254.0.0/16`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isLinkLocal(): boolean {\n\t\treturn this.#match(0xa9fe0000, 16);\n\t}\n\n\t/**\n\t * Checks whether this address is a loopback address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc1122\n\t * @returns `true` when the address is in `127.0.0.0/8`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isLoopback(): boolean {\n\t\treturn this.#match(0x7f000000, 8);\n\t}\n\n\t/**\n\t * Checks whether this address is a multicast address.\n\t * @see https://datatracker.ietf.org/doc/html/rfc5771\n\t * @returns `true` when the address is in `224.0.0.0/4`, otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isMulticast(): boolean {\n\t\treturn this.#match(0xe0000000, 4);\n\t}\n\n\t/**\n\t * Checks whether this address is in a private-use range.\n\t * @see https://datatracker.ietf.org/doc/html/rfc1918\n\t * @returns `true` for `10.0.0.0/8`, `172.16.0.0/12`, or `192.168.0.0/16`; otherwise `false`.\n\t * @since v0.0.1\n\t */\n\tpublic isPrivate(): boolean {\n\t\treturn (\n\t\t\tthis.#match(0x0a000000, 8) || // 10.0.0.0/8\n\t\t\tthis.#match(0xac100000, 12) || // 172.16.0.0/12\n\t\t\tthis.#match(0xc0a80000, 16) // 192.168.0.0/16\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether this address is in the reserved range.\n\t * @see https://datatracker.ietf.org/doc/html/rfc1112\n\t * @returns `true` when the address is in `240.0.0.0/4` except the broadcast address.\n\t * @since v0.0.1\n\t */\n\tpublic isReserved(): boolean {\n\t\treturn this.#match(0xf0000000, 4) && !this.isBroadcast();\n\t}\n\n\t/**\n\t * Checks whether this address is in the shared Carrier-Grade NAT range.\n\t * @see https://datatracker.ietf.org/doc/html/rfc6598\n\t * @returns `true` when the address is in `100.64.0.0/10`, otherwise `false`.\n\t * @since v0.0.1\n\t * @see https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.is_shared\n\t */\n\tpublic isShared(): boolean {\n\t\treturn this.#match(0x64400000, 10);\n\t}\n\n\t/**\n\t * Checks whether this address is the unspecified address.\n\t * @returns `true` when the address is `0.0.0.0`, otherwise `false`.\n\t * @since v0.0.1\n\t * @see https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.is_unspecified\n\t */\n\tpublic isUnspecified(): boolean {\n\t\treturn this.#integerAddress === 0;\n\t}\n\n\t/**\n\t * Gets the four octets of this IPv4 address.\n\t * @returns An array containing the four octets `[num1, num2, num3, num4]`.\n\t * @see https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.octets\n\t * @since v0.2.0\n\t */\n\tpublic toOctets(): [number, number, number, number] {\n\t\treturn this.#fromInteger(this.#integerAddress);\n\t}\n\n\t/**\n\t * Converts this address to an IPv4-compatible {@link Ipv6Addr}.\n\t * @returns An {@link Ipv6Addr} in the form `::a.b.c.d`.\n\t * @since v0.0.1\n\t */\n\tpublic toIpv6(): Ipv6Addr {\n\t\treturn new Ipv6Addr(BigInt(this.value));\n\t}\n\n\t/**\n\t * Converts this address to an IPv4-mapped {@link Ipv6Addr}.\n\t * @returns An {@link Ipv6Addr} in the form `::ffff:a.b.c.d`.\n\t * @since v0.0.1\n\t */\n\tpublic toIpv6Mapped(): Ipv6Addr {\n\t\treturn new Ipv6Addr(0xffff00000000n | BigInt(this.value));\n\t}\n\n\t/**\n\t * Formats this address as dotted-decimal text.\n\t * @returns The IPv4 string representation, such as `192.168.0.1`.\n\t * @since v0.0.1\n\t */\n\tpublic toString(): string {\n\t\treturn this.toOctets().join('.');\n\t}\n\n\t/**\n\t * Encodes this address to a 4-byte buffer.\n\t * @returns An {@link ArrayBuffer} containing the IPv4 integer value.\n\t * @since v0.0.1\n\t * @example\n\t * const buffer: ArrayBuffer = addr.toBuffer();\n\t */\n\tpublic toBuffer(littleEndian?: boolean): ArrayBuffer {\n\t\tconst view = new DataView(new ArrayBuffer(4));\n\t\tview.setUint32(0, this.#integerAddress, littleEndian);\n\t\treturn view.buffer;\n\t}\n\n\t/**\n\t * Compares this IPv4 address with another for equality.\n\t * @param other instance of another address like to compare with.\n\t * @returns `true` if both addresses are equal, otherwise `false`.\n\t * @since v0.1.0\n\t */\n\tpublic equals(other?: unknown): boolean {\n\t\treturn other instanceof Ipv4Addr && this.#integerAddress === other.#integerAddress;\n\t}\n\n\t#toInteger(num1: number, num2: number, num3: number, num4: number): number {\n\t\tfor (const octet of [num1, num2, num3, num4]) {\n\t\t\tif (octet < 0 || octet > 255) {\n\t\t\t\tthrow new RangeError('IPv4 octet must be between 0 and 255');\n\t\t\t}\n\t\t}\n\t\treturn ((num1 << 24) | (num2 << 16) | (num3 << 8) | num4) >>> 0;\n\t}\n\n\t#fromInteger(integer: number): [number, number, number, number] {\n\t\tconst num1 = (integer >> 24) & 0xff;\n\t\tconst num2 = (integer >> 16) & 0xff;\n\t\tconst num3 = (integer >> 8) & 0xff;\n\t\tconst num4 = integer & 0xff;\n\t\treturn [num1, num2, num3, num4];\n\t}\n\n\t#match(network: number, prefix: number): boolean {\n\t\tif (prefix < 0 || prefix > 32) {\n\t\t\tthrow new RangeError('Invalid prefix length');\n\t\t}\n\t\tconst mask = prefix === 0 ? 0 : (~0 << (32 - prefix)) >>> 0;\n\t\treturn (this.#integerAddress & mask) === (network & mask);\n\t}\n}\n","import type {CoreResult} from 'core-result';\nimport {uw} from './common';\nimport {Ipv4Addr} from './Ipv4Addr';\n\n/**\n * Represents an IPv4 network.\n * @example\n * const addrRes = Ipv4Addr.from('192.168.0.1');\n * const addr = Ipv4Addr.fromOrThrow('192.168.0.1');\n * const network = Ipv4Net.fromAddr(addr, 24);\n * @since v0.1.2\n */\nexport class Ipv4Net {\n\t#lowAddress: number;\n\t#highAddress: number;\n\t#first: Ipv4Addr;\n\t#firstUsable: number;\n\t#lastUsable: number;\n\t/**\n\t * Size of the network (subnet mask length).\n\t * @since v0.1.2\n\t */\n\tpublic readonly size: number;\n\t/**\n\t * Address family of the network.\n\t * @since v0.1.2\n\t */\n\tpublic readonly family = 'ipv4' as const;\n\tprivate constructor(address: Ipv4Addr, size: number) {\n\t\tconst currentValue = address.value;\n\t\t// Use >>> 0 to ensure unsigned 32-bit arithmetic\n\t\tconst mask = ((1 << (32 - size)) - 1) >>> 0;\n\t\tthis.size = size;\n\t\tthis.#lowAddress = (currentValue & (~mask >>> 0)) >>> 0;\n\t\tthis.#highAddress = (currentValue | mask) >>> 0;\n\t\tthis.#firstUsable = size === 32 ? this.#lowAddress : this.#lowAddress + 1;\n\t\tthis.#lastUsable = size === 32 ? this.#highAddress : this.#highAddress - 1;\n\t\tthis.#first = new Ipv4Addr(this.#lowAddress);\n\t}\n\n\t/**\n\t * Creates an IPv4 network from address and a subnet mask length.\n\t * @param address The starting {@link Ipv4Addr} of the network.\n\t * @param size The size of the network (subnet mask length).\n\t * @returns A {@link CoreResult} containing the parsed {@link Ipv4Net} instance or a {@link RangeError} if the network size is invalid.\n\t * @example\n\t * const networkRes: CoreResult<Ipv4Net, RangeError> = Ipv4Net.fromAddr(addr, 24);\n\t * @since v0.2.0\n\t */\n\tpublic static fromAddr(address: Ipv4Addr, size: number): CoreResult<Ipv4Net, RangeError> {\n\t\tif (!Ipv4Net.#validSize(size)) {\n\t\t\treturn {success: false, error: new RangeError('Invalid IPv4 network size: must be between 0 and 32')};\n\t\t}\n\t\treturn {success: true, value: new Ipv4Net(address, size)};\n\t}\n\n\t/**\n\t * Creates an IPv4 network from address and a subnet mask length, throwing an error if creation fails.\n\t * @param address The starting {@link Ipv4Addr} of the network.\n\t * @param size The size of the network (subnet mask length).\n\t * @returns The parsed {@link Ipv4Net} instance.\n\t * @throws {RangeError} If the network size is invalid.\n\t * @example\n\t * const network: Ipv4Net = Ipv4Net.fromAddrOrThrow(addr, 24);\n\t * @since v0.2.0\n\t */\n\tpublic static fromAddrOrThrow(address: Ipv4Addr, size: number): Ipv4Net {\n\t\treturn uw(Ipv4Net.fromAddr(address, size));\n\t}\n\n\t/**\n\t * Creates an IPv4 network from its string representation.\n\t * @param value The string representation of the IPv4 network, e.g., `192.168.0.1/24`.\n\t * @returns A {@link CoreResult} containing the parsed {@link Ipv4Net} instance or a {@link TypeError} if parsing fails.\n\t * @example\n\t * const networkRes: CoreResult<Ipv4Net, TypeError> = Ipv4Net.from('192.168.0.1/24');\n\t * @since v0.2.0\n\t */\n\tpublic static from(value: string): CoreResult<Ipv4Net, TypeError> {\n\t\tconst [addrStr, sizeStr] = value.split('/');\n\t\tconst addrRes = Ipv4Addr.from(addrStr);\n\t\tif (!addrRes.success) {\n\t\t\treturn addrRes;\n\t\t}\n\t\tif (!/^-?\\d+$/.test(sizeStr)) {\n\t\t\treturn {success: false, error: new TypeError('Invalid IPv4 network size: must be numeric')};\n\t\t}\n\t\tconst size = parseInt(sizeStr, 10);\n\t\tif (!Ipv4Net.#validSize(size)) {\n\t\t\treturn {success: false, error: new TypeError('Invalid IPv4 network size: must be between 0 and 32')};\n\t\t}\n\t\treturn {success: true, value: new Ipv4Net(addrRes.value, size)};\n\t}\n\n\t/**\n\t * Creates an IPv4 network from its string representation, throwing an error if parsing fails.\n\t * @param value The string representation of the IPv4 network, e.g., `192.168.0.1/24`.\n\t * @returns The parsed {@link Ipv4Net} instance.\n\t * @throws {TypeError} If the string representation is invalid.\n\t * @example\n\t * const network: Ipv4Net = Ipv4Net.fromOrThrow('192.168.0.1/24');\n\t * @since v0.2.0\n\t */\n\tpublic static fromOrThrow(value: string): Ipv4Net {\n\t\treturn uw(Ipv4Net.from(value));\n\t}\n\n\tstatic #validSize(size: number): boolean {\n\t\treturn size >= 0 && size <= 32;\n\t}\n\n\t/**\n\t * Checks if the given IPv4 address is contained within the network.\n\t * @param addr The {@link Ipv4Addr} to check.\n\t * @returns `true` if the given address is contained within the network, otherwise `false`.\n\t * @since v0.2.0\n\t */\n\tpublic contains(addr: Ipv4Addr): boolean {\n\t\tconst value = addr.value;\n\t\treturn value >= this.#lowAddress && value <= this.#highAddress;\n\t}\n\n\t/**\n\t * Gets the broadcast address of the network.\n\t * @returns The broadcast address as an {@link Ipv4Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic broadcast(): Ipv4Addr {\n\t\treturn this.last();\n\t}\n\t/**\n\t * Gets the network mask of the IPv4 network.\n\t * @returns The network mask as an {@link Ipv4Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic netmask(): Ipv4Addr {\n\t\tconst mask = ((1 << this.size) - 1) << (32 - this.size);\n\t\treturn new Ipv4Addr(mask >>> 0);\n\t}\n\t/**\n\t * Gets the string representation of the IPv4 network.\n\t * @returns The IPv4 network as a string, e.g., `192.168.0.1/24`.\n\t * @since v0.2.0\n\t */\n\tpublic toString(): string {\n\t\treturn `${this.#first.toString()}/${this.size}`;\n\t}\n\t/**\n\t * Gets the first address within the network.\n\t * @returns The first address as an {@link Ipv4Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic first(): Ipv4Addr {\n\t\treturn this.#first;\n\t}\n\t/**\n\t * Gets the last address within the network.\n\t * @returns The last address as an {@link Ipv4Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic last(): Ipv4Addr {\n\t\treturn new Ipv4Addr(this.#highAddress);\n\t}\n\t/**\n\t * Gets the first usable address within the network.\n\t * @returns The first usable address as an {@link Ipv4Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic firstUsable(): Ipv4Addr {\n\t\treturn new Ipv4Addr(this.#firstUsable);\n\t}\n\t/**\n\t * Gets the last usable address within the network.\n\t * @returns The last usable address as an {@link Ipv4Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic lastUsable(): Ipv4Addr {\n\t\treturn new Ipv4Addr(this.#lastUsable);\n\t}\n\n\t/**\n\t * Checks if the current network is equal to another network.\n\t * @param other The other network to compare with.\n\t * @returns `true` if the networks are equal, otherwise `false`.\n\t * @example\n\t * const isEqual = Ipv4Net.fromOrThrow('192.168.0.0/24').equals(Ipv4Net.fromOrThrow('192.168.0.0/24'));\n\t * @since v0.2.0\n\t */\n\tpublic equals(other?: unknown): boolean {\n\t\tif (!other) {\n\t\t\treturn false;\n\t\t}\n\t\treturn other instanceof Ipv4Net && this.#first.value === other.#first.value && this.size === other.size;\n\t}\n\t/**\n\t * Assigns an address to the current network, effectively combining the network with the given address.\n\t * @param value The other IPv4 address to combine with (e.g., `0.0.0.100`)\n\t * @returns The combined IPv4 address as a {@link CoreResult} containing either the resulting {@link Ipv4Addr} or a {@link RangeError} if the address does not fit within the host portion of the network.\n\t * @example\n\t * const network = Ipv4Net.fromOrThrow('192.168.0.0/24');\n\t * const result: CoreResult<Ipv4Addr, RangeError | TypeError> = network.assignAddress('0.0.0.100');\n\t * const result: CoreResult<Ipv4Addr, RangeError | TypeError> = network.assignAddress(Ipv4Addr.fromOrThrow('0.0.0.100'))\n\t * @since v0.2.0\n\t */\n\tpublic assignAddress(value: Ipv4Addr | string): CoreResult<Ipv4Addr, RangeError | TypeError> {\n\t\tconst res = typeof value === 'string' ? Ipv4Addr.from(value) : ({success: true, value} as const);\n\t\tif (!res.success) {\n\t\t\treturn res;\n\t\t}\n\t\tconst addr = res.value;\n\t\tconst hostMask = this.size === 0 ? 0xffffffff : this.size === 32 ? 0 : ((1 << (32 - this.size)) - 1) >>> 0;\n\t\tif ((addr.value & ~hostMask) !== 0) {\n\t\t\treturn {success: false, error: new RangeError(`Address ${value.toString()} exceeds network host capacity for /${this.size}`)};\n\t\t}\n\t\treturn {success: true, value: new Ipv4Addr((this.#lowAddress | addr.value) >>> 0)};\n\t}\n\n\t/**\n\t * Assigns an address to the current network, effectively combining the network with the given address.\n\t * @param other The other IPv4 address to combine with (e.g., `0.0.0.100`)\n\t * @returns The combined IPv4 address as an {@link Ipv4Addr} instance. (e.g., combining `192.168.0.0/24` with `0.0.0.100` would result in `192.168.0.100`)\n\t * @throws {RangeError} If the given address does not fit within the host portion of the network.\n\t * @example\n\t * const network = Ipv4Net.fromOrThrow('192.168.0.0/24');\n\t * const combined = network.assignAddressOrThrow('0.0.0.100'); // Ipv4Addr(192.168.0.100)\n\t * const combined = network.assignAddressOrThrow(Ipv4Addr.fromOrThrow('0.0.0.100')); // Ipv4Addr(192.168.0.100)\n\t * @since v0.2.0\n\t */\n\tpublic assignAddressOrThrow(other: Ipv4Addr | string): Ipv4Addr {\n\t\treturn uw(this.assignAddress(other));\n\t}\n\n\t/**\n\t * Checks if the current network is a subnet of the given parent network.\n\t * @param parent The parent network to check against.\n\t * @returns `true` if the current network is a subnet of the parent network, `false` otherwise.\n\t * @since v0.2.0\n\t */\n\tpublic isSubnetOf(parent: Ipv4Net): boolean {\n\t\treturn this.#lowAddress >= parent.first().value && this.#highAddress <= parent.last().value;\n\t}\n\n\t/**\n\t * Checks if the current network contains the given child network.\n\t * @param child The child network to check for containment.\n\t * @returns `true` if the current network contains the child network, `false` otherwise.\n\t * @since v0.2.0\n\t */\n\tpublic containsNet(child: Ipv4Net): boolean {\n\t\treturn this.#lowAddress <= child.first().value && this.#highAddress >= child.last().value;\n\t}\n\n\t/**\n\t * Returns an iterable of all addresses within the network.\n\t * @returns An {@link Ipv4Addr} {@link Iterable} of all addresses within the network.\n\t * @since v0.2.0\n\t */\n\tpublic *addresses(): Iterable<Ipv4Addr> {\n\t\tfor (let addr = this.#lowAddress; addr <= this.#highAddress; addr++) {\n\t\t\tyield new Ipv4Addr(addr >>> 0);\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterable of all usable host addresses within the network.\n\t * @returns An {@link Ipv4Addr} {@link Iterable} of all usable host addresses within the network.\n\t * @since v0.2.0\n\t */\n\tpublic *hosts(): Iterable<Ipv4Addr> {\n\t\tfor (let addr = this.#firstUsable; addr <= this.#lastUsable; addr++) {\n\t\t\tyield new Ipv4Addr(addr >>> 0);\n\t\t}\n\t}\n}\n","import type {CoreResult} from 'core-result';\nimport {uw} from './common';\nimport {Ipv6Addr} from './Ipv6Addr';\n\n/**\n * Represents an IPv6 network.\n * @example\n * const addrRes = Ipv6Addr.from('2001:db8::1');\n * const addr = Ipv6Addr.fromOrThrow('2001:db8::1');\n * const network = Ipv6Net.fromAddr(addr, 64);\n * @since v0.1.2\n */\nexport class Ipv6Net {\n\t#lowAddress: bigint;\n\t#highAddress: bigint;\n\t#firstUsable: bigint;\n\t#lastUsable: bigint;\n\t#first: Ipv6Addr;\n\t/**\n\t * Size of the network (prefix length).\n\t * @since v0.1.2\n\t */\n\tpublic readonly size: number;\n\t/**\n\t * Address family of the network.\n\t * @since v0.1.2\n\t */\n\tpublic readonly family = 'ipv6' as const;\n\tprivate constructor(address: Ipv6Addr, size: number) {\n\t\tconst currentValue = address.value;\n\t\tconst mask = (BigInt(1) << BigInt(128 - size)) - BigInt(1);\n\t\tthis.size = size;\n\t\tthis.#lowAddress = currentValue & ~mask;\n\t\tthis.#highAddress = currentValue | mask;\n\t\tthis.#firstUsable = size === 128 ? this.#lowAddress : this.#lowAddress + BigInt(1);\n\t\tthis.#lastUsable = size === 128 ? this.#highAddress : this.#highAddress - BigInt(1);\n\t\tthis.#first = new Ipv6Addr(this.#lowAddress);\n\t}\n\n\t/**\n\t * Creates an instance of {@link Ipv6Net} from {@link Ipv6Addr} and network size.\n\t * @param address The interface address as an {@link Ipv6Addr} instance.\n\t * @param size The network size (prefix length) as a number.\n\t * @returns A {@link CoreResult} containing the instance of {@link Ipv6Net} if successful, or a {@link RangeError} if the network size is invalid.\n\t * @since v0.1.2\n\t */\n\tpublic static fromAddr(address: Ipv6Addr, size: number): CoreResult<Ipv6Net, RangeError> {\n\t\tif (size < 0 || size > 128) {\n\t\t\treturn {success: false, error: new RangeError('Invalid IPv6 network size: must be between 0 and 128')};\n\t\t}\n\t\treturn {success: true, value: new Ipv6Net(address, size)};\n\t}\n\n\t/**\n\t * Creates an instance of {@link Ipv6Net} from {@link Ipv6Addr} and network size, throwing an error if the size is invalid.\n\t * @param address The interface address as an {@link Ipv6Addr} instance.\n\t * @param size The network size (prefix length) as a number.\n\t * @returns An instance of {@link Ipv6Net}.\n\t * @throws {RangeError} If the network size is not between 0 and 128.\n\t * @since v0.2.0\n\t */\n\tpublic static fromAddrOrThrow(address: Ipv6Addr, size: number): Ipv6Net {\n\t\treturn uw(Ipv6Net.fromAddr(address, size));\n\t}\n\n\t/**\n\t * Creates an instance of {@link Ipv6Net} from a string representation.\n\t * @param value The string representation of the IPv6 network, e.g., `2001:db8::/64` or full interface address with size.\n\t * @returns A {@link CoreResult} containing the instance of {@link Ipv6Net} if successful, or a {@link TypeError} if the input is invalid.\n\t * @since v0.1.2\n\t */\n\tpublic static from(value: string): CoreResult<Ipv6Net, TypeError> {\n\t\tconst [addrStr, sizeStr] = value.split('/');\n\t\tconst addrRes = Ipv6Addr.from(addrStr);\n\t\tif (!addrRes.success) {\n\t\t\treturn addrRes;\n\t\t}\n\t\tconst addr = addrRes.value;\n\t\tif (!/^-?\\d+$/.test(sizeStr)) {\n\t\t\treturn {success: false, error: new TypeError('Invalid IPv6 network size: must be numeric')};\n\t\t}\n\t\tconst size = parseInt(sizeStr, 10);\n\t\tif (size < 0 || size > 128) {\n\t\t\treturn {success: false, error: new RangeError('Invalid IPv6 network size: must be between 0 and 128')};\n\t\t}\n\t\treturn {success: true, value: new Ipv6Net(addr, size)};\n\t}\n\n\t/**\n\t * Creates an instance of {@link Ipv6Net} from a string representation.\n\t * @param value The string representation of the IPv6 network, e.g., `2001:db8::/64` or full interface address with size.\n\t * @returns An instance of {@link Ipv6Net}.\n\t * @throws {TypeError} If the input string is not a valid IPv6 network representation.\n\t * @since v0.2.0\n\t */\n\tpublic static fromOrThrow(value: string): Ipv6Net {\n\t\treturn uw(Ipv6Net.from(value));\n\t}\n\n\t/**\n\t * Checks if the given IPv6 address is contained within the network.\n\t * @param addr The {@link Ipv6Addr} to check.\n\t * @returns `true` if the given address is contained within the network, otherwise `false`.\n\t * @since v0.2.0\n\t */\n\tpublic contains(addr: Ipv6Addr): boolean {\n\t\tconst value = addr.value;\n\t\treturn value >= this.#lowAddress && value <= this.#highAddress;\n\t}\n\t/**\n\t * Gets the network mask of the IPv6 network.\n\t * @returns The network mask as an {@link Ipv6Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic netmask(): Ipv6Addr {\n\t\tconst mask = (BigInt(1) << BigInt(this.size)) - BigInt(1);\n\t\tconst shiftedMask = mask << BigInt(128 - this.size);\n\t\treturn Ipv6Addr.fromRaw(shiftedMask);\n\t}\n\t/**\n\t * Gets the string representation of the IPv6 network.\n\t * @returns The IPv6 network as a string, e.g., `2001:db8::1/64`.\n\t * @since v0.2.0\n\t */\n\tpublic toString(): string {\n\t\treturn `${this.#first.toString()}/${this.size}`;\n\t}\n\t/**\n\t * Returns the expanded string representation of the IPv6 network.\n\t * @returns The IPv6 network in expanded notation, e.g., `2001:0db8:0000:0000:0000:0000:0000:0001/64`.\n\t * @since v0.2.0\n\t */\n\tpublic toExpandedString(): string {\n\t\treturn `${this.#first.toExpandedString()}/${this.size}`;\n\t}\n\t/**\n\t * Gets the first address within the network.\n\t * @returns The first address as an {@link Ipv6Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic first(): Ipv6Addr {\n\t\treturn this.#first;\n\t}\n\t/**\n\t * Gets the last address within the network.\n\t * @returns The last address as an {@link Ipv6Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic last(): Ipv6Addr {\n\t\treturn Ipv6Addr.fromRaw(this.#highAddress);\n\t}\n\t/**\n\t * Gets the first usable address within the network.\n\t * @returns The first usable address as an {@link Ipv6Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic firstUsable(): Ipv6Addr {\n\t\treturn Ipv6Addr.fromRaw(this.#firstUsable);\n\t}\n\t/**\n\t * Gets the last usable address within the network.\n\t * @returns The last usable address as an {@link Ipv6Addr} instance.\n\t * @since v0.2.0\n\t */\n\tpublic lastUsable(): Ipv6Addr {\n\t\treturn Ipv6Addr.fromRaw(this.#lastUsable);\n\t}\n\t/**\n\t * Checks if the current network is equal to another network.\n\t * @param other The other network to compare with.\n\t * @returns `true` if the networks are equal, otherwise `false`.\n\t * @since v0.2.0\n\t */\n\tpublic equals(other?: unknown): boolean {\n\t\tif (!other) {\n\t\t\treturn false;\n\t\t}\n\t\treturn other instanceof Ipv6Net && this.#first.value === other.#first.value && this.size === other.size;\n\t}\n\n\t/**\n\t * Assigns an address to the current network, effectively combining the network with the given address.\n\t * @param value The other IPv6 address to combine with (e.g., `::100`)\n\t * @returns The combined IPv6 address as a {@link CoreResult} containing either the resulting {@link Ipv6Addr} or a {@link RangeError} if the address does not fit within the host portion of the network.\n\t * @since v0.2.0\n\t */\n\tpublic assignAddress(value: Ipv6Addr | string): CoreResult<Ipv6Addr, RangeError> {\n\t\tconst res = typeof value === 'string' ? Ipv6Addr.from(value) : ({success: true, value} as const);\n\t\tif (!res.success) {\n\t\t\treturn res;\n\t\t}\n\t\tconst addr = res.value;\n\t\tconst hostMask = this.size === 0 ? (1n << 128n) - 1n : this.size === 128 ? 0n : (1n << BigInt(128 - this.size)) - 1n;\n\t\tconst netmask = ~hostMask & ((1n << 128n) - 1n);\n\t\tif ((addr.value & netmask) !== 0n) {\n\t\t\treturn {success: false, error: new RangeError(`Address ${addr.toString()} exceeds network host capacity for /${this.size}`)};\n\t\t}\n\t\treturn {success: true, value: new Ipv6Addr(this.#lowAddress | addr.value)};\n\t}\n\n\t/**\n\t * Assigns an address to the current network, effectively combining the network with the given address.\n\t * @param other The other IPv6 address to combine with (e.g., `::100`)\n\t * @returns The combined IPv6 address as an {@link Ipv6Addr} instance. (e.g., combining `2001:db8::/64` with `::100` would result in `2001:db8::100`)\n\t * @throws {RangeError} If the given address does not fit within the host portion of the network.\n\t * @since v0.2.0\n\t */\n\tpublic assignAddressOrThrow(other: Ipv6Addr | string): Ipv6Addr {\n\t\treturn uw(this.assignAddress(other));\n\t}\n\n\t/**\n\t * Checks if the current network is a subnet of the given parent network.\n\t * @param parent The parent network to check against.\n\t * @returns `true` if the current network is a subnet of the parent network, `false` otherwise.\n\t * @since v0.2.0\n\t */\n\tpublic isSubnetOf(parent: Ipv6Net): boolean {\n\t\treturn this.#lowAddress >= parent.first().value && this.#highAddress <= parent.last().value;\n\t}\n\t/**\n\t * Checks if the current network contains the given child network.\n\t * @param child The child network to check for containment.\n\t * @returns `true` if the current network contains the child network, `false` otherwise.\n\t * @since v0.2.0\n\t */\n\tpublic containsNet(child: Ipv6Net): boolean {\n\t\treturn this.#lowAddress <= child.first().value && this.#highAddress >= child.last().value;\n\t}\n\t/**\n\t * Gets an iterable of all addresses within the network.\n\t * @returns An {@link Ipv6Addr} {@link Iterable} of all addresses within the network.\n\t * @since v0.2.0\n\t */\n\tpublic *addresses(): Iterable<Ipv6Addr> {\n\t\tfor (let addr = this.#lowAddress; addr <= this.#highAddress; addr++) {\n\t\t\tyield Ipv6Addr.fromRaw(addr);\n\t\t}\n\t}\n\t/**\n\t * Gets an iterable of all usable host addresses within the network.\n\t * @returns An {@link Ipv6Addr} {@link Iterable} of all usable host addresses within the network.\n\t * @since v0.2.0\n\t */\n\tpublic *hosts(): Iterable<Ipv6Addr> {\n\t\tfor (let addr = this.#firstUsable; addr <= this.#lastUsable; addr++) {\n\t\t\tyield Ipv6Addr.fromRaw(addr);\n\t\t}\n\t}\n}\n"],"mappings":"AAGA,SAAgB,EAAS,EAA6B,CACrD,GAAI,CAAC,EAAO,QACX,MAAM,EAAO,MAEd,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CAE7B,CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.object.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.string.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.collection.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.float16.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.intl.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.promise.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.array.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.date.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.error.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../../node_modules/.pnpm/core-result@0.0.3/node_modules/core-result/index.d.ts","../../../src/common.ts","../../../src/Ipv6Addr.ts","../../../src/Ipv4Addr.ts","../../../src/Ipv4Net.ts","../../../src/Ipv6Net.ts","../../../src/index.ts","../../../../../node_modules/.pnpm/vitest@5.0.1_@vitest+coverage-v8@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/vitest/optional-runtime-types.d.ts","../../../../../node_modules/.pnpm/tinybench@6.1.4/node_modules/tinybench/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@5.0.1_@vitest+coverage-v8@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/vitest/dist/chunks/config.d.CU_b-wJj.d.ts","../../../../../node_modules/.pnpm/vite@8.3.0_yaml@2.9.0/node_modules/vite/types/hmrPayload.d.ts","../../../../../node_modules/.pnpm/vite@8.3.0_yaml@2.9.0/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts","../../../../../node_modules/.pnpm/vite@8.3.0_yaml@2.9.0/node_modules/vite/types/customEvent.d.ts","../../../../../node_modules/.pnpm/vite@8.3.0_yaml@2.9.0/node_modules/vite/types/hot.d.ts","../../../../../node_modules/.pnpm/vite@8.3.0_yaml@2.9.0/node_modules/vite/dist/node/module-runner.d.ts","../../../../../node_modules/.pnpm/vitest@5.0.1_@vitest+coverage-v8@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/vitest/dist/chunks/rpc.d.DA9Utv4e.d.ts","../../../../../node_modules/.pnpm/vitest@5.0.1_@vitest+coverage-v8@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/vitest/dist/chunks/environment.d.C6xYahWA.d.ts","../../../../../node_modules/.pnpm/vitest@5.0.1_@vitest+coverage-v8@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/vitest/dist/chunks/worker.d.MLmnzOJE.d.ts","../../../../../node_modules/.pnpm/vitest@5.0.1_@vitest+coverage-v8@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/vitest/dist/chunks/browser.d.g5Thl309.d.ts","../../../../../node_modules/.pnpm/vitest@5.0.1_@vitest+coverage-v8@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/vitest/dist/chunks/task-utils.d.BZm4GSQD.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/@vitest/mocker/dist/registry.d-xLx_FoyF.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/@vitest/mocker/dist/index.d-D4wtotQw.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/@vitest/mocker/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@5.0.1_@vitest+coverage-v8@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/vitest/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts","../../../../../node_modules/.pnpm/expect-type@1.4.0/node_modules/expect-type/dist/utils.d.ts","../../../../../node_modules/.pnpm/expect-type@1.4.0/node_modules/expect-type/dist/overloads.d.ts","../../../../../node_modules/.pnpm/expect-type@1.4.0/node_modules/expect-type/dist/branding.d.ts","../../../../../node_modules/.pnpm/expect-type@1.4.0/node_modules/expect-type/dist/messages.d.ts","../../../../../node_modules/.pnpm/expect-type@1.4.0/node_modules/expect-type/dist/index.d.ts","../../../../../node_modules/.pnpm/@types+deep-eql@4.0.2/node_modules/@types/deep-eql/index.d.ts","../../../../../node_modules/.pnpm/assertion-error@2.0.1/node_modules/assertion-error/index.d.ts","../../../../../node_modules/.pnpm/@types+chai@5.2.3/node_modules/@types/chai/index.d.ts","../../../../../node_modules/.pnpm/vitest@5.0.1_@vitest+coverage-v8@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/vitest/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@5.0.1_@vitest+coverage-v8@5.0.1_vite@8.3.0_yaml@2.9.0_/node_modules/vitest/index.d.cts","../../../test/Ipv4Addr.test.ts","../../../test/Ipv4Net.test.ts","../../../test/Ipv6Addr.test.ts","../../../test/ipv6Net.test.ts"],"fileIdsList":[[118,119],[109],[109,110],[113,114],[113,114,115,116],[113,115],[113],[99],[99,100,101,102],[101],[98,104,106],[96,97],[98],[103],[98,103],[98,121],[98,103,104,105],[96,97,98,103,104,105,106,107,108,111,112,117,120],[108,121],[89,90,91],[89,90,92],[89],[91,92,93,94],[95,122],[91,122]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"3c659f3995af0a1b35d21548283a5f1b39b351a52181702b9bb658381deab3e7","impliedFormat":99},{"version":"59b616f1da69583eb4e99a65bf79825bed4a8367bffb874e380f10f8ff4110b1","impliedFormat":1},{"version":"b3efc1472e587012b2622300beeeaeaf5c3e919419bc5828f22f731d10f2a7c5","impliedFormat":1},{"version":"90ffff82064fc73a125d9882092020eba3fc258ef0a3e2fd1885937095f4d4af","impliedFormat":1},{"version":"10a65df6027af88b9aeb0691bf5e6fd752d6653012cc5c83ee855653f79ee316","impliedFormat":1},{"version":"3d3a5f0c636f8e89e5f7400db7e3eb23ba880fa61314dfd628641de42a51745e","impliedFormat":1},{"version":"74cbb28a06ee4d907729cbdea0aa832dfde743f277fd2f5d43e2bd441b01f334","impliedFormat":1},{"version":"c76c02846ba7d40b9b3488f0e8d75d02cbdee2f0bc5fcd55dd3bd2e1457646ea","impliedFormat":99},{"version":"883ab61941ae697bd5724f02abc0a4044dc5427e7fb002c95867204918c1a68c","impliedFormat":99},{"version":"2493d114a1f01f02d69b4b44265405dfd5bbf135e0f467838808c4137c71ce54","impliedFormat":99},{"version":"24c010698f5f7a0f1c216b963994d09ecfef77d7d5b4116b248068287ddb5964","impliedFormat":99},{"version":"c911b3bd083dade8fdb7775261aa25feae695d562a3b11209650b47be90043fc","impliedFormat":99},{"version":"5ef1bf71c773ca3df07f0c8c126af004a8e7310a7373ba4f049e7d3fb1b21921","impliedFormat":99},{"version":"4e003c868b0d8f8ad200b96cbc653e18e513fa23e1c19c4fe3cc25d4394efc47","impliedFormat":99},{"version":"93aed5bd196d1a1417d07e5c5b66a96107f0ee7d5c9027c2af12d876ab5e0f5e","impliedFormat":99},{"version":"fc620fc5a05d1d8499e790626f83b401604634dfd9c4b11042099a63883df8fb","impliedFormat":99},{"version":"123b46e873f6ae5902094478c2c58b725b3d92e1d36b53daf85b7732d032dfa8","impliedFormat":99},{"version":"11f54bcce4d6e4271122c6b06329b37f6d297141ad6e918b5181e17572158a10","impliedFormat":99},{"version":"dd8cb59c27a49fdc4b86eb755ddaaab5de0f30a627767f506fb2607ca4b2ec22","impliedFormat":99},{"version":"9500d6fd10c59daeab4a18b1d9aeaf13d790bd4a92a5f864d5f323dba395d4cc","impliedFormat":99},{"version":"8d4ea2431523a42682a9f2efb2ae662aa42a39983c9d40a19257b2445f50450e","impliedFormat":99},{"version":"29738162d88967e51557276cba80552cb8d2a4c823873b7f1531244860f0d178","impliedFormat":99},{"version":"fc07122b30042636bbf689305c75a764d6e3c2eeb75cd1033c96a6a7dc9e6e3f","impliedFormat":99},{"version":"b413fbc6658fe2774f8bf9a15cf4c53e586fc38a2d5256b3b9647da242c14389","impliedFormat":99},{"version":"dd51e53752b310bd20c9b1a87bbf12b1fe2be7fe40f505b43199496481096275","impliedFormat":1},{"version":"a87be4662442b3feeffc331ecafe6b36cafd08727e2d7f2425a5099577e7fd18","impliedFormat":1},{"version":"cd4cd9220a1ba793bc935e76d8e5481c110a90d9868ae7866a182ee71cdb6abb","impliedFormat":1},{"version":"0a7fb8619b10bc05fd933ca9ac1c8b2ab2220be7a57b57565c3ac158595494ef","impliedFormat":1},{"version":"c4a5f91feb9c5a6b2a91089d959c38391b79a961db3b9cc73b8877d57ad7dcdc","impliedFormat":1},{"version":"427fe2004642504828c1476d0af4270e6ad4db6de78c0b5da3e4c5ca95052a99","impliedFormat":1},{"version":"2eeffcee5c1661ddca53353929558037b8cf305ffb86a803512982f99bcab50d","impliedFormat":99},{"version":"9afb4cb864d297e4092a79ee2871b5d3143ea14153f62ef0bb04ede25f432030","affectsGlobalScope":true,"impliedFormat":99},{"version":"3589cb90a45acfb8c2336b34a9e340f036a6aecfdb71742047d37748dfa52816","impliedFormat":99},{"version":"db8e26b83e6708b250200435440c326d84dd9f07114c72b33775569486bebd0b","impliedFormat":1},{"version":"e8de72a20ae9ad903802325ec63fadb5d85014c51e3f02b5ab2e24b07fb27311","impliedFormat":1},{"version":"e3499dbcb2ead379d66b898d2821ec1601e5d170e3401e0c3b73652166343b8b","impliedFormat":1},{"version":"050d65c72a96bf25821a02b31127bb9f878330f8e0ca4542423a77b9026ec348","impliedFormat":1},{"version":"8952073a67956826024dc9324828eacdc9f8cd3b8fc09192bf6016f1a1312467","impliedFormat":1}],"root":[[90,95],[123,126]],"options":{"composite":true,"declaration":true,"declarationMap":true,"erasableSyntaxOnly":true,"esModuleInterop":true,"isolatedDeclarations":true,"module":199,"outDir":"../..","rootDir":"../../../../..","skipLibCheck":true,"strict":true,"target":9},"referencedMap":[[120,1],[110,2],[111,3],[115,4],[117,5],[116,6],[114,7],[100,8],[103,9],[101,8],[102,10],[107,11],[98,12],[105,13],[112,14],[104,15],[108,16],[106,17],[121,18],[122,19],[92,20],[93,21],[91,21],[94,20],[90,22],[95,23],[123,24],[124,24],[125,25],[126,24]],"affectedFilesPendingEmit":[[92,49],[93,49],[91,49],[94,49],[90,49],[95,49],[123,49],[124,49],[125,49],[126,49]],"emitSignatures":[90,91,92,93,94,95,123,124,125,126],"version":"6.0.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "net-address",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Network address instances",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/luolapeikko/net-address-base#readme",
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"
|
|
38
|
+
"core-result": "0.0.3"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"
|
|
41
|
+
"core-result": ">= 0.0.3"
|
|
42
42
|
}
|
|
43
43
|
}
|