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

ncname

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ncname - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

11

index.js

@@ -1,7 +0,8 @@

'use strict';
const xmlChars = require('xml-char-classes');
import xmlCharacterClasses from 'xml-char-classes';
const getRange = re => re.source.slice(1, -1);
const getRange = regex => regex.source.slice(1, -1);
// http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName
module.exports = new RegExp(`^[${getRange(xmlChars.letter)}_][${getRange(xmlChars.letter)}${getRange(xmlChars.digit)}\\.\\-_${getRange(xmlChars.combiningChar)}${getRange(xmlChars.extender)}]*$`);
// https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName
const ncname = new RegExp(`^[${getRange(xmlCharacterClasses.letter)}_][${getRange(xmlCharacterClasses.letter)}${getRange(xmlCharacterClasses.digit)}\\.\\-_${getRange(xmlCharacterClasses.combiningChar)}${getRange(xmlCharacterClasses.extender)}]*$`);
export default ncname;
{
"name": "ncname",
"version": "2.0.0",
"version": "3.0.0",
"description": "Regular expression for matching XML NCName",
"license": "MIT",
"repository": "sindresorhus/ncname",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=6"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},

@@ -34,8 +37,8 @@ "scripts": {

"dependencies": {
"xml-char-classes": "^2.0.0"
"xml-char-classes": "^3.0.0"
},
"devDependencies": {
"ava": "*",
"xo": "*"
"ava": "^3.15.0",
"xo": "^0.45.0"
}
}

@@ -1,17 +0,15 @@

# ncname [![Build Status](https://travis-ci.org/sindresorhus/ncname.svg?branch=master)](https://travis-ci.org/sindresorhus/ncname)
# ncname
> Regular expression for matching [XML NCName](http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName)
> Regular expression for matching [XML NCName](https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName)
## Install
```sh
npm install ncname
```
$ npm install ncname
```
## Usage
```js
const ncname = require('ncname');
import ncname from 'ncname';

@@ -24,6 +22,1 @@ ncname.test('hællæ');

```
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

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