Skip to content

Commit 1a00535

Browse files
committed
Require Node.js 14 and move to ESM
1 parent fa37503 commit 1a00535

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

.github/workflows/main.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13+
- 18
14+
- 16
1315
- 14
14-
- 12
15-
- 10
16-
- 8
1716
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-node@v1
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-node@v3
2019
with:
2120
node-version: ${{ matrix.node-version }}
2221
- run: npm install

index.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
'use strict';
2-
3-
module.exports = value => {
1+
export default function isObservable(value) {
42
if (!value) {
53
return false;
64
}
@@ -16,4 +14,4 @@ module.exports = value => {
1614
}
1715

1816
return false;
19-
};
17+
}

package.json

+10-7
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
"email": "sindresorhus@gmail.com",
1111
"url": "https://sindresorhus.com"
1212
},
13+
"type": "module",
14+
"exports": "./index.js",
15+
"types": "./index.d.ts",
1316
"engines": {
14-
"node": ">=8"
17+
"node": ">=14.16"
1518
},
1619
"scripts": {
1720
"test": "xo && ava"
@@ -28,12 +31,12 @@
2831
"type"
2932
],
3033
"devDependencies": {
31-
"ava": "^1.4.1",
34+
"ava": "^4.3.0",
3235
"indefinite-observable": "^1.0.1",
33-
"most": "^1.7.2",
34-
"rxjs": "^6.5.2",
35-
"xo": "^0.24.0",
36-
"xstream": "^11.0.0",
37-
"zen-observable": "^0.8.14"
36+
"most": "^1.9.0",
37+
"rxjs": "^7.5.5",
38+
"xo": "^0.49.0",
39+
"xstream": "^11.14.0",
40+
"zen-observable": "^0.8.15"
3841
}
3942
}

readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
55
## Install
66

7-
```
8-
$ npm install is-observable
7+
```sh
8+
npm install is-observable
99
```
1010

1111
## Usage
1212

1313
```js
14-
const isObservable = require('is-observable');
14+
import isObservable from 'is-observable';
1515

1616
isObservable(Observable.of(1, 2));
1717
//=> true

test/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {of as rxOf} from 'rxjs';
44
import * as most from 'most';
55
import {Stream as xstream} from 'xstream';
66
import {IndefiniteObservable} from 'indefinite-observable';
7-
import isObservable from '..';
7+
import isObservable from '../index.js';
88

99
test('main', t => {
1010
t.true(isObservable(zenObservable.of(1)));

test/strict.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import test from 'ava';
2-
import isObservable from '..';
2+
import isObservable from '../index.js';
33

44
const fake1 = {'@@observable': true};
55
const fake2 = {undefined: true};
66
const fake3 = {
77
undefined() {
88
return this;
9-
}
9+
},
1010
};
1111

1212
test('strict', t => {

0 commit comments

Comments
 (0)