-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require Node.js 8, add TypeScript definition (#1)
- Loading branch information
1 parent
2c1efd5
commit c4847a7
Showing
10 changed files
with
64 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
* text=auto | ||
*.js text eol=lf | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
language: node_js | ||
node_js: | ||
- '6' | ||
- '4' | ||
- '10' | ||
- '8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* Check if a string is a [scoped npm package name](https://docs.npmjs.com/misc/scope). | ||
* | ||
* @param input - The package name to check. | ||
*/ | ||
export default function isScoped(input: string): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
'use strict'; | ||
const scopedRegex = require('scoped-regex'); | ||
|
||
module.exports = input => scopedRegex({exact: true}).test(input); | ||
const isScoped = input => scopedRegex({exact: true}).test(input); | ||
|
||
module.exports = isScoped; | ||
module.exports.default = isScoped; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import {expectType} from 'tsd-check'; | ||
import isScoped from '.'; | ||
|
||
expectType<boolean>(isScoped('is-scoped')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
{ | ||
"name": "is-scoped", | ||
"version": "1.0.0", | ||
"description": "Check if a string is a scoped npm package name", | ||
"license": "MIT", | ||
"repository": "sindresorhus/is-scoped", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"scoped", | ||
"npm", | ||
"package", | ||
"name", | ||
"is", | ||
"detect", | ||
"validate", | ||
"validation" | ||
], | ||
"dependencies": { | ||
"scoped-regex": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
"name": "is-scoped", | ||
"version": "1.0.0", | ||
"description": "Check if a string is a scoped npm package name", | ||
"license": "MIT", | ||
"repository": "sindresorhus/is-scoped", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
"keywords": [ | ||
"scoped", | ||
"npm", | ||
"package", | ||
"name", | ||
"is", | ||
"detect", | ||
"validate", | ||
"validation" | ||
], | ||
"dependencies": { | ||
"scoped-regex": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^1.3.1", | ||
"tsd-check": "^0.3.0", | ||
"xo": "^0.24.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters