scoped-regex
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -1,15 +0,37 @@ | ||
export interface Options { | ||
/** | ||
* Only match an exact string. By default, it matches any scoped package names in a string. Useful with `RegExp#test()` to check if a string is a scoped package name. | ||
* | ||
* @default false | ||
*/ | ||
readonly exact?: boolean; | ||
declare namespace scopedRegex { | ||
interface Options { | ||
/** | ||
Only match an exact string. By default, it matches any scoped package names in a string. Useful with `RegExp#test()` to check if a string is a scoped package name. | ||
@default false | ||
*/ | ||
readonly exact?: boolean; | ||
} | ||
} | ||
/** | ||
* Regular expression for matching [scoped npm package names](https://docs.npmjs.com/misc/scope). | ||
* | ||
* @returns A `RegExp` for matching scoped package names. | ||
*/ | ||
export default function scopedRegex(options?: Options): RegExp; | ||
declare const scopedRegex: { | ||
/** | ||
Regular expression for matching [scoped npm package names](https://docs.npmjs.com/misc/scope). | ||
@returns A `RegExp` for matching scoped package names. | ||
@example | ||
``` | ||
import scopedRegex = require('scoped-regex'); | ||
scopedRegex({exact: true}).test('@sindresorhus/df'); | ||
//=> true | ||
'foo @sindresorhus/df bar'.match(scopedRegex()); | ||
//=> ['@sindresorhus/df'] | ||
``` | ||
*/ | ||
(options?: scopedRegex.Options): RegExp; | ||
// TODO: Remove this for the next major release, refactor the whole definition to: | ||
// declare function scopedRegex(options?: scopedRegex.Options): RegExp; | ||
// export = scopedRegex; | ||
default: typeof scopedRegex; | ||
}; | ||
export = scopedRegex; |
@@ -11,2 +11,3 @@ 'use strict'; | ||
module.exports = scopedRegex; | ||
// TODO: Remove this for the next major release | ||
module.exports.default = scopedRegex; |
{ | ||
"name": "scoped-regex", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Regular expression for matching scoped npm package names", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
"test": "xo && ava && tsd" | ||
}, | ||
@@ -34,6 +34,6 @@ "files": [ | ||
"devDependencies": { | ||
"ava": "^1.3.1", | ||
"tsd-check": "^0.3.0", | ||
"ava": "^1.4.1", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4011
38