@mkven/regexps 1.0.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/package.json +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gzEncExtension = exports.encExtension = exports.gzExtension = exports.trailingQuote = exports.leadingQuote = exports.leadingOrTrailingDash = exports.leadingOrTrailingDotHyphenPlus = exports.latinNumbersDotUnderscoreHyphenPlus = exports.uppercaseLatinLetters = exports.latinDashQuotation = exports.cyrillicDashQuotation = exports.latinCyrillicNumbersHyphen = exports.latinOnly = exports.russianPhone = exports.nonPlusNonDigit = exports.nonDigit = exports.digits = exports.invisibleControlChars = exports.tabNewlineCarriageReturn = exports.whitespaceAndNbsp = exports.spacesAndNewlines = exports.whitespace = void 0;
|
|
3
|
+
exports.gzEncExtension = exports.encExtension = exports.gzExtension = exports.trailingQuote = exports.leadingQuote = exports.leadingOrTrailingDash = exports.leadingOrTrailingDotHyphenPlus = exports.latinNumbersDotUnderscoreHyphenPlus = exports.uppercaseLatinLetters = exports.latinDashQuotation = exports.cyrillicDashQuotation = exports.latinCyrillicNumbersHyphen = exports.latinOnly = exports.russianPhone = exports.nonPlusNonDigit = exports.nonDigit = exports.digitsOnly = exports.digits = exports.invisibleControlChars = exports.tabNewlineCarriageReturn = exports.whitespaceAndNbsp = exports.spacesAndNewlines = exports.whitespace = void 0;
|
|
4
4
|
// Text normalization
|
|
5
5
|
exports.whitespace = /\s/gu;
|
|
6
6
|
exports.spacesAndNewlines = /(\s|\n)/gu;
|
|
@@ -9,6 +9,7 @@ exports.tabNewlineCarriageReturn = /[\t\n\r]/gu;
|
|
|
9
9
|
exports.invisibleControlChars = /[\u0002\u0003\u200B\u202A\u202B]/gu;
|
|
10
10
|
// Digit / phone patterns
|
|
11
11
|
exports.digits = /\d/gu;
|
|
12
|
+
exports.digitsOnly = /^\d+$/u;
|
|
12
13
|
exports.nonDigit = /\D/gu;
|
|
13
14
|
exports.nonPlusNonDigit = /[^\d+]/gu;
|
|
14
15
|
exports.russianPhone = /^(\+?7|8)(\d{10})$/u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const whitespaceAndNbsp: RegExp;
|
|
|
4
4
|
export declare const tabNewlineCarriageReturn: RegExp;
|
|
5
5
|
export declare const invisibleControlChars: RegExp;
|
|
6
6
|
export declare const digits: RegExp;
|
|
7
|
+
export declare const digitsOnly: RegExp;
|
|
7
8
|
export declare const nonDigit: RegExp;
|
|
8
9
|
export declare const nonPlusNonDigit: RegExp;
|
|
9
10
|
export declare const russianPhone: RegExp;
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export const tabNewlineCarriageReturn = /[\t\n\r]/gu;
|
|
|
6
6
|
export const invisibleControlChars = /[\u0002\u0003\u200B\u202A\u202B]/gu;
|
|
7
7
|
// Digit / phone patterns
|
|
8
8
|
export const digits = /\d/gu;
|
|
9
|
+
export const digitsOnly = /^\d+$/u;
|
|
9
10
|
export const nonDigit = /\D/gu;
|
|
10
11
|
export const nonPlusNonDigit = /[^\d+]/gu;
|
|
11
12
|
export const russianPhone = /^(\+?7|8)(\d{10})$/u;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mkven/regexps",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Shared regular expression constants for text normalization and validation",
|
|
5
5
|
"author": "Damir Manapov",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"vitest": "^4.0.18"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "tsc && tsc -p tsconfig.cjs.json",
|
|
31
|
+
"build": "tsc && tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
32
32
|
"lint": "biome check --write .",
|
|
33
33
|
"typecheck": "tsc --noEmit",
|
|
34
34
|
"test": "vitest run",
|