Skip to content

Commit

Permalink
Merge pull request #78 from alvarocastro/dependabot/npm_and_yarn/xo-0…
Browse files Browse the repository at this point in the history
….48.0

Bump xo from 0.39.1 to 0.48.0
  • Loading branch information
alvarocastro committed Feb 28, 2022
2 parents 4a19d14 + a14ca4c commit 7c3e2fd
Show file tree
Hide file tree
Showing 8 changed files with 3,053 additions and 8,437 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm ci
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,22 @@ jobs:
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm ci

- name: Run tests
env:
NODE_ENV: test
run: npm test

- name: Prepare coverage report
run: npx nyc report --reporter=lcov
env:
NODE_ENV: test
run: npx c8 report --reporter=lcov

- name: Send coverage data to coveralls.io
uses: coverallsapp/github-action@master
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.nyc_output/
node_modules/
coverage/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ npm install pick-random-weighted
## Usage

```js
const pick = require('pick-random-weighted');
import pick from 'pick-random-weighted';

const colors = [
['Red', 30],
Expand Down
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const pick = function (data) {
if (!Array.isArray(data)) {
throw new TypeError('Expected an Array as the first argument');
Expand Down Expand Up @@ -31,4 +29,4 @@ pick.random = function () {
return Math.random();
};

module.exports = pick;
export default pick;
Loading

0 comments on commit 7c3e2fd

Please sign in to comment.