Socket
Socket
Sign inDemoInstall

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 1.0.0 to 2.0.0

index.d.ts

11

index.js
'use strict';
const regex = '@[a-z0-9][\\w-.]+/[a-z0-9][\\w-.]*';
module.exports = opts => opts && opts.exact ? new RegExp(`^${regex}$`, 'i') : new RegExp(regex, 'gi');
const regex = '@[a-z\\d][\\w-.]+/[a-z\\d][\\w-.]*';
const scopedRegex = options =>
options && options.exact ?
new RegExp(`^${regex}$`, 'i') :
new RegExp(regex, 'gi');
module.exports = scopedRegex;
module.exports.default = scopedRegex;

68

package.json
{
"name": "scoped-regex",
"version": "1.0.0",
"description": "Regular expression for matching scoped npm package names",
"license": "MIT",
"repository": "sindresorhus/scoped-regex",
"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",
"regex",
"regexp",
"regular",
"expression"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
"name": "scoped-regex",
"version": "2.0.0",
"description": "Regular expression for matching scoped npm package names",
"license": "MIT",
"repository": "sindresorhus/scoped-regex",
"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",
"regex",
"regexp",
"regular",
"expression"
],
"devDependencies": {
"ava": "^1.3.1",
"tsd-check": "^0.3.0",
"xo": "^0.24.0"
}
}

@@ -9,3 +9,3 @@ # scoped-regex [![Build Status](https://travis-ci.org/sindresorhus/scoped-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/scoped-regex)

```
$ npm install --save scoped-regex
$ npm install scoped-regex
```

@@ -33,4 +33,8 @@

#### options.exact
#### options
Type: `Object`
##### exact
Type: `boolean`<br>

@@ -37,0 +41,0 @@ Default: `false` *(Matches any scoped package names in a string)*

Sorry, the diff of this file is not supported yet

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