Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scoped-regex

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scoped-regex - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

48

index.d.ts

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc