Skip to content

Commit f3ee76d

Browse files
deps(dev): bump aegir from 37.12.1 to 38.1.7 (#119)
* deps(dev): bump aegir from 37.12.1 to 38.1.7 Bumps [aegir](https://github.com/ipfs/aegir) from 37.12.1 to 38.1.7. - [Release notes](https://github.com/ipfs/aegir/releases) - [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md) - [Commits](ipfs/aegir@v37.12.1...v38.1.7) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * chore: fix linting and update project config --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain <alex@achingbrain.net>
1 parent 1692b1d commit f3ee76d

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
node_modules
2-
coverage
3-
.nyc_output
4-
package-lock.json
2+
build
53
dist
4+
.docs
5+
.coverage
6+
node_modules
7+
package-lock.json
8+
yarn.lock
9+
.vscode

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,33 @@
22

33
[![multiformats.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://multiformats.io)
44
[![codecov](https://img.shields.io/codecov/c/github/multiformats/js-multiaddr-to-uri.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-multiaddr-to-uri)
5-
[![CI](https://img.shields.io/github/workflow/status/multiformats/js-multiaddr-to-uri/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/multiformats/js-multiaddr-to-uri/actions/workflows/js-test-and-release.yml)
5+
[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-multiaddr-to-uri/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/multiformats/js-multiaddr-to-uri/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
66

77
> Convert a Multiaddr to a URI /dnsaddr/ipfs.io/http -> <http://ipfs.io>
88
99
## Table of contents <!-- omit in toc -->
1010

1111
- [Install](#install)
12+
- [Browser `<script>` tag](#browser-script-tag)
1213
- [Usage](#usage)
13-
- [Contribute](#contribute)
14+
- [API Docs](#api-docs)
1415
- [License](#license)
15-
- [Contribute](#contribute-1)
16+
- [Contribution](#contribution)
1617

1718
## Install
1819

1920
```console
2021
$ npm i @multiformats/multiaddr-to-uri
2122
```
2223

24+
### Browser `<script>` tag
25+
26+
Loading this module through a script tag will make it's exports available as `MultiformatsMultiaddrToUri` in the global namespace.
27+
28+
```html
29+
<script src="https://unpkg.com/@multiformats/multiaddr-to-uri/dist/index.min.js"></script>
30+
```
31+
2332
## Usage
2433

2534
```js
@@ -45,9 +54,9 @@ Note:
4554
- is not a valid multiaddr
4655
- is not supported as a URI e.g. circuit
4756

48-
## Contribute
57+
## API Docs
4958

50-
Feel free to dive in! [Open an issue](https://github.com/multiformats/js-multiaddr-to-uri/issues/new) or submit PRs.
59+
- <https://multiformats.github.io/js-multiaddr-to-uri>
5160

5261
## License
5362

@@ -56,6 +65,6 @@ Licensed under either of
5665
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
5766
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
5867

59-
## Contribute
68+
## Contribution
6069

6170
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"types": "./dist/src/index.d.ts",
2626
"files": [
2727
"src",
28-
"dist/src",
28+
"dist",
2929
"!dist/test",
3030
"!**/*.tsbuildinfo"
3131
],
@@ -139,12 +139,13 @@
139139
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
140140
"test:node": "aegir test -t node --cov",
141141
"test:electron-main": "aegir test -t electron-main",
142-
"release": "aegir release"
142+
"release": "aegir release",
143+
"docs": "aegir docs"
143144
},
144145
"dependencies": {
145146
"@multiformats/multiaddr": "^11.0.0"
146147
},
147148
"devDependencies": {
148-
"aegir": "^37.5.3"
149+
"aegir": "^38.1.7"
149150
}
150151
}

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface MultiaddrToUriOpts {
88
interface Reducer { (str: string, content: string, i: number, parts: Part[], opts?: MultiaddrToUriOpts): string }
99

1010
const reduceValue: Reducer = (_, v) => v
11-
const tcpUri = (str: string, port: string, parts: Part[], opts?: MultiaddrToUriOpts) => {
11+
const tcpUri = (str: string, port: string, parts: Part[], opts?: MultiaddrToUriOpts): string => {
1212
// return tcp when explicitly requested
1313
if ((opts != null) && opts.assumeHttp === false) return `tcp://${str}:${port}`
1414
// check if tcp is the last protocol in multiaddr
@@ -55,7 +55,7 @@ interface Part {
5555
content: string
5656
}
5757

58-
export function multiaddrToUri (input: Multiaddr | string | Uint8Array, opts?: MultiaddrToUriOpts) {
58+
export function multiaddrToUri (input: Multiaddr | string | Uint8Array, opts?: MultiaddrToUriOpts): string {
5959
const ma = multiaddr(input)
6060
const parts = ma.toString().split('/').slice(1)
6161
return ma

0 commit comments

Comments
 (0)