Skip to content

Commit

Permalink
deps(dev): bump aegir from 37.12.1 to 38.1.7 (#142)
Browse files Browse the repository at this point in the history
* 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

---------

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>
  • Loading branch information
dependabot[bot] and achingbrain authored Mar 17, 2023
1 parent 3d8a401 commit 83f55a9
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 56 deletions.
46 changes: 6 additions & 40 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,43 +1,9 @@
**/node_modules/
**/*.log
test/repo-tests*
**/bundle.js

# Logs
logs
*.log

coverage

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

build
docs

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

lib
build
dist
test/test-data/go-ipfs-repo/LOCK
test/test-data/go-ipfs-repo/LOG
test/test-data/go-ipfs-repo/LOG.old

# while testing npm5
.docs
.coverage
node_modules
package-lock.json
yarn.lock
.vscode
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,35 @@

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

> A multiaddr validator
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Browser `<script>` tag](#browser-script-tag)
- [Usage](#usage)
- [API](#api)
- [`mafmt.<FORMAT>.matches(multiaddr)`](#mafmtformatmatchesmultiaddr)
- - [`mafmt.<FORMAT>.matches(multiaddr)`](#mafmtformatmatchesmultiaddr)
- [API Docs](#api-docs)
- [License](#license)
- [Contribute](#contribute)
- [Contribution](#contribution)

## Install

```console
$ npm i @multiformats/mafmt
```

### Browser `<script>` tag

Loading this module through a script tag will make it's exports available as `MultiformatsMafmt` in the global namespace.

```html
<script src="https://unpkg.com/@multiformats/mafmt/dist/index.min.js"></script>
```

## Usage

```js
Expand Down Expand Up @@ -64,13 +74,17 @@ Where `multiaddr` may be:

Returns `true`/`false`

## API Docs

- <https://multiformats.github.io/js-mafmt>

## License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

## Contribute
## Contribution

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.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"types": "./dist/src/index.d.ts",
"files": [
"src",
"dist/src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
Expand Down Expand Up @@ -135,13 +135,14 @@
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"test:node": "aegir test -t node",
"test:electron-main": "aegir test -t electron-main",
"release": "aegir release"
"release": "aegir release",
"docs": "aegir docs"
},
"dependencies": {
"@multiformats/multiaddr": "^11.0.0"
},
"devDependencies": {
"aegir": "^37.5.3",
"aegir": "^38.1.7",
"uint8arrays": "^3.0.0",
"util": "^0.12.3"
}
Expand Down
14 changes: 7 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const _Circuit = or(
base('p2p-circuit')
)

const CircuitRecursive = () => or(
const CircuitRecursive = (): Mafmt => or(
and(_Circuit, CircuitRecursive),
_Circuit
)
Expand All @@ -143,7 +143,7 @@ export const IPFS = P2P
* Validation funcs
*/

function makeMatchesFunction (partialMatch: PartialMatchesFunction) {
function makeMatchesFunction (partialMatch: PartialMatchesFunction): (a: string | Uint8Array | Multiaddr) => boolean {
function matches (a: string | Uint8Array | Multiaddr): boolean {
let ma

Expand Down Expand Up @@ -199,7 +199,7 @@ function and (...args: Array<Mafmt | (() => Mafmt)>): Mafmt {
toString: function () { return '{ ' + args.join(' ') + ' }' },
input: args,
matches: makeMatchesFunction(partialMatch),
partialMatch: partialMatch
partialMatch
}
}

Expand All @@ -224,7 +224,7 @@ function or (...args: Array<Mafmt | (() => Mafmt)>): Mafmt {
toString: function () { return '{ ' + args.join(' ') + ' }' },
input: args,
matches: makeMatchesFunction(partialMatch),
partialMatch: partialMatch
partialMatch
}

return result
Expand All @@ -233,7 +233,7 @@ function or (...args: Array<Mafmt | (() => Mafmt)>): Mafmt {
function base (n: string): Mafmt {
const name = n

function matches (a: string | Uint8Array | Multiaddr) {
function matches (a: string | Uint8Array | Multiaddr): boolean {
let ma: Multiaddr

try {
Expand Down Expand Up @@ -262,7 +262,7 @@ function base (n: string): Mafmt {

return {
toString: function () { return name },
matches: matches,
partialMatch: partialMatch
matches,
partialMatch
}
}
4 changes: 2 additions & 2 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ describe('multiaddr validation', function () {
'/ip4/0.0.0.0/udp/4004/webrtc/uEiAeP0OEmBbGVTH5Bhnm3WopwRNSQ0et46xNkn2dIagnGw/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64'
]

function assertMatches (p: Mafmt, ...tests: string[][]) {
function assertMatches (p: Mafmt, ...tests: string[][]): void {
tests.forEach(function (test) {
test.forEach(function (testcase) {
try {
Expand All @@ -217,7 +217,7 @@ describe('multiaddr validation', function () {
})
}

function assertMismatches (p: Mafmt, ...tests: string[][]) {
function assertMismatches (p: Mafmt, ...tests: string[][]): void {
tests.forEach(function (test) {
test.forEach(function (testcase) {
try {
Expand Down

0 comments on commit 83f55a9

Please sign in to comment.