Skip to content

Commit

Permalink
feat: add ipcidr protocol (#303)
Browse files Browse the repository at this point in the history
Support ipcidr multiaddrs
  • Loading branch information
mpetrunic authored Jan 17, 2023
1 parent c04b04f commit fe760d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/protocols-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const table: Array<[number, number, string, boolean?, boolean?]> = [
[33, 16, 'dccp'],
[41, 128, 'ip6'],
[42, V, 'ip6zone'],
[43, 8, 'ipcidr'],
[53, V, 'dns', true],
[54, V, 'dns4', true],
[55, V, 'dns6', true],
Expand Down
1 change: 1 addition & 0 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ describe('helpers', () => {
describe('multiaddr.isMultiaddr', () => {
it('handles different inputs', () => {
expect(isMultiaddr(multiaddr('/'))).to.be.eql(true)
expect(isMultiaddr(multiaddr('/ip4/192.0.2.0/ipcidr/24'))).to.be.eql(true)
expect(isMultiaddr('/')).to.be.eql(false)
expect(isMultiaddr(123)).to.be.eql(false)

Expand Down

0 comments on commit fe760d3

Please sign in to comment.