Skip to content

Commit b45871b

Browse files
committed
Reformat repo, upgrade build, use github actions
1 parent ae9e576 commit b45871b

File tree

11 files changed

+10496
-10959
lines changed

11 files changed

+10496
-10959
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
test:
7+
name: Node.js ${{ matrix.node-version }}
8+
runs-on: macos-latest
9+
strategy:
10+
matrix:
11+
node-version:
12+
- "12"
13+
- "*"
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v1
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- uses: actions/cache@v2
20+
with:
21+
path: ~/.npm
22+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
23+
restore-keys: |
24+
${{ runner.os }}-node-
25+
- run: npm install -g npm@8
26+
- run: npm ci
27+
- run: npm test
28+
- uses: codecov/codecov-action@v1
29+
with:
30+
name: Node.js ${{ matrix.node-version }}

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

Readme.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
> Turn a path string such as `/user/:name` into a regular expression.
44
55
[![NPM version][npm-image]][npm-url]
6-
[![Build status][travis-image]][travis-url]
7-
[![Test coverage][coveralls-image]][coveralls-url]
8-
[![Dependency Status][david-image]][david-url]
6+
[![NPM downloads][downloads-image]][downloads-url]
7+
[![Build status][build-image]][build-url]
8+
[![Build coverage][coverage-image]][coverage-url]
99
[![License][license-image]][license-url]
10-
[![Downloads][downloads-image]][downloads-url]
1110

1211
## Installation
1312

@@ -201,15 +200,17 @@ fn("/user/caf%C3%A9"); //=> { path: '/user/caf%C3%A9', index: 0, params: { id: '
201200
The `match` function can be used to custom match named parameters. For example, this can be used to whitelist a small number of valid paths:
202201

203202
```js
204-
const urlMatch = match("/users/:id/:tab(home|photos|bio)", { decode: decodeURIComponent });
203+
const urlMatch = match("/users/:id/:tab(home|photos|bio)", {
204+
decode: decodeURIComponent,
205+
});
205206

206-
urlMatch("/users/1234/photos")
207+
urlMatch("/users/1234/photos");
207208
//=> { path: '/users/1234/photos', index: 0, params: { id: '1234', tab: 'photos' } }
208209

209-
urlMatch("/users/1234/bio")
210+
urlMatch("/users/1234/bio");
210211
//=> { path: '/users/1234/bio', index: 0, params: { id: '1234', tab: 'bio' } }
211212

212-
urlMatch("/users/1234/otherstuff")
213+
urlMatch("/users/1234/otherstuff");
213214
//=> false
214215
```
215216

@@ -340,15 +341,13 @@ You can see a live demo of this library in use at [express-route-tester](http://
340341

341342
MIT
342343

343-
[npm-image]: https://img.shields.io/npm/v/path-to-regexp.svg?style=flat
344+
[npm-image]: https://img.shields.io/npm/v/path-to-regexp
344345
[npm-url]: https://npmjs.org/package/path-to-regexp
345-
[travis-image]: https://img.shields.io/travis/pillarjs/path-to-regexp.svg?style=flat
346-
[travis-url]: https://travis-ci.org/pillarjs/path-to-regexp
347-
[coveralls-image]: https://img.shields.io/coveralls/pillarjs/path-to-regexp.svg?style=flat
348-
[coveralls-url]: https://coveralls.io/r/pillarjs/path-to-regexp?branch=master
349-
[david-image]: http://img.shields.io/david/pillarjs/path-to-regexp.svg?style=flat
350-
[david-url]: https://david-dm.org/pillarjs/path-to-regexp
346+
[downloads-image]: https://img.shields.io/npm/dm/path-to-regexp
347+
[downloads-url]: https://npmjs.org/package/path-to-regexp
348+
[build-image]: https://img.shields.io/github/workflow/status/pillarjs/path-to-regexp/CI/master
349+
[build-url]: https://github.com/pillarjs/path-to-regexp/actions/workflows/ci.yml?query=branch%3Amaster
350+
[coverage-image]: https://img.shields.io/codecov/c/gh/pillarjs/path-to-regexp
351+
[coverage-url]: https://codecov.io/gh/pillarjs/path-to-regexp
351352
[license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat
352353
[license-url]: LICENSE.md
353-
[downloads-image]: http://img.shields.io/npm/dm/path-to-regexp.svg?style=flat
354-
[downloads-url]: https://npmjs.org/package/path-to-regexp

0 commit comments

Comments
 (0)