File tree Expand file tree Collapse file tree 7 files changed +15
-18
lines changed Expand file tree Collapse file tree 7 files changed +15
-18
lines changed Original file line number Diff line number Diff line change 1212 node-version :
1313 - 14
1414 - 12
15- - 10
1615 steps :
1716 - uses : actions/checkout@v2
18- - uses : actions/setup-node@v1
17+ - uses : actions/setup-node@v2
1918 with :
2019 node-version : ${{ matrix.node-version }}
2120 - run : npm install
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Check if a string is a URL.
33
44@example
55```
6- import isUrl = require( 'is-url-superb') ;
6+ import isUrl from 'is-url-superb';
77
88isUrl('https://sindresorhus.com');
99//=> true
@@ -15,6 +15,4 @@ isUrl('unicorn');
1515//=> false
1616```
1717*/
18- declare function isUrl ( url : string ) : boolean ;
19-
20- export = isUrl ;
18+ export default function isUrl ( url : string ) : boolean ;
Original file line number Diff line number Diff line change 1- 'use strict' ;
2-
3- module . exports = string => {
1+ export default function isUrl ( string ) {
42 if ( typeof string !== 'string' ) {
53 throw new TypeError ( 'Expected a string' ) ;
64 }
@@ -16,4 +14,4 @@ module.exports = string => {
1614 } catch {
1715 return false ;
1816 }
19- } ;
17+ }
Original file line number Diff line number Diff line change 11import { expectType } from 'tsd' ;
2- import isUrlSuperb = require ( '.' ) ;
2+ import isUrl from './index.js' ;
33
4- expectType < boolean > ( isUrlSuperb ( 'https://sindresorhus.com' ) ) ;
4+ expectType < boolean > ( isUrl ( 'https://sindresorhus.com' ) ) ;
Original file line number Diff line number Diff line change 10101111 "url" : " https://sindresorhus.com"
1212 },
13+ "type" : " module" ,
14+ "exports" : " ./index.js" ,
1315 "engines" : {
14- "node" : " >=10 "
16+ "node" : " >=12 "
1517 },
1618 "scripts" : {
1719 "test" : " xo && ava && tsd"
2931 " is"
3032 ],
3133 "devDependencies" : {
32- "ava" : " ^2.4 .0" ,
33- "tsd" : " ^0.13.1 " ,
34- "xo" : " ^0.35.0 "
34+ "ava" : " ^3.15 .0" ,
35+ "tsd" : " ^0.14.0 " ,
36+ "xo" : " ^0.38.2 "
3537 }
3638}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ $ npm install is-url-superb
1111## Usage
1212
1313``` js
14- const isUrl = require ( ' is-url-superb' ) ;
14+ import isUrl from ' is-url-superb' ;
1515
1616isUrl (' https://sindresorhus.com' );
1717// => true
Original file line number Diff line number Diff line change 11import test from 'ava' ;
2- import isUrl from '.' ;
2+ import isUrl from './index.js ' ;
33
44test ( 'main' , t => {
55 t . true ( isUrl ( 'https://sindresorhus.com' ) ) ;
You can’t perform that action at this time.
0 commit comments