@toa.io/dns
TypeScript icon, indicating that this package has built-in type declarations

0.24.0-alpha.0 • Public • Published

Toa DNS Tools

Deduplication

async dedupe(...urls: string[]): string[]

Resolves DNS names to IP addresses and returns an array of unique URLs.

urls must be valid.

Example

import { dedupe } from '@toa.io/dns'

const inputs = [
  'amqp://github.com/?test=true',
  'amqp://github.com/?test=true',
  'amqp://github.com:5672'
]

const urls = await dedupe(inputs)

console.log(urls)

//   [
//     'amqp://20.207.73.82/?test=true',
//     'amqp://20.207.73.82:5672'
//   ]

Readme

Keywords

none

Package Sidebar

Install

npm i @toa.io/dns

Homepage

toa.io

Weekly Downloads

34

Version

0.24.0-alpha.0

License

MIT

Unpacked Size

4.29 kB

Total Files

9

Last publish

Collaborators

  • agurtovoi