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
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
2604
Yes
22
+ Addedxml-char-classes@3.0.0(transitive)
- Removedxml-char-classes@2.0.0(transitive)
Updatedxml-char-classes@^3.0.0