@mll-lab/js-utils 2.15.2 → 2.15.3
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/index.common.js +20 -19
- package/dist/index.common.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -19
- package/dist/index.js.map +1 -1
- package/dist/predicates.d.ts +8 -10
- package/dist/predicates.test.d.ts +3 -1
- package/dist/typeGuards.d.ts +2 -0
- package/dist/typeGuards.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -15319,28 +15319,32 @@ function pluralize(amount, singular, plural) {
|
|
|
15319
15319
|
function isString(value) {
|
|
15320
15320
|
return typeof value === 'string';
|
|
15321
15321
|
}
|
|
15322
|
-
function
|
|
15323
|
-
return
|
|
15322
|
+
function isNotNullish(value) {
|
|
15323
|
+
return value != null;
|
|
15324
15324
|
}
|
|
15325
|
+
|
|
15326
|
+
const isAlphanumeric = function isAlphanumeric(value) {
|
|
15327
|
+
return isString(value) && /^[A-Za-z0-9]+$/.test(value);
|
|
15328
|
+
};
|
|
15325
15329
|
/**
|
|
15326
15330
|
* BSNR (Betriebsstättennummer) ist eine eindeutige Zuordnung von Leistungen zu dem entsprechenden Ort der Leistungserbringung ermöglicht,
|
|
15327
15331
|
* für alle vertrags(zahn)ärztlichen Leistungserbringer gültig
|
|
15328
15332
|
* und klar abzugrenzen vom Institutskennzeichen (IK-Nummer) eines Krankenhauses.
|
|
15329
15333
|
*/
|
|
15330
|
-
function isBSNR(value) {
|
|
15334
|
+
const isBSNR = function isBSNR(value) {
|
|
15331
15335
|
return isString(value) && /^\d{9}$/.test(value);
|
|
15332
|
-
}
|
|
15336
|
+
};
|
|
15333
15337
|
// Taken from https://emailregex.com
|
|
15334
15338
|
const EMAIL_REGEX =
|
|
15335
15339
|
// eslint-disable-next-line no-useless-escape
|
|
15336
15340
|
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
15337
|
-
function isEmail(value) {
|
|
15341
|
+
const isEmail = function isEmail(value) {
|
|
15338
15342
|
return isString(value) && EMAIL_REGEX.test(value);
|
|
15339
|
-
}
|
|
15340
|
-
function isOnlyDigits(value) {
|
|
15343
|
+
};
|
|
15344
|
+
const isOnlyDigits = function isOnlyDigits(value) {
|
|
15341
15345
|
return isString(value) && /^\d+$/.test(value);
|
|
15342
|
-
}
|
|
15343
|
-
function isURL(value) {
|
|
15346
|
+
};
|
|
15347
|
+
const isURL = function isURL(value) {
|
|
15344
15348
|
if (!isString(value)) {
|
|
15345
15349
|
return false;
|
|
15346
15350
|
}
|
|
@@ -15353,19 +15357,16 @@ function isURL(value) {
|
|
|
15353
15357
|
catch (_a) {
|
|
15354
15358
|
return false;
|
|
15355
15359
|
}
|
|
15356
|
-
}
|
|
15357
|
-
function isWord(value) {
|
|
15360
|
+
};
|
|
15361
|
+
const isWord = function isWord(value) {
|
|
15358
15362
|
return isString(value) && /^[\w-]+$/.test(value);
|
|
15359
|
-
}
|
|
15360
|
-
function isLabId(value) {
|
|
15363
|
+
};
|
|
15364
|
+
const isLabId = function isLabId(value) {
|
|
15361
15365
|
return isString(value) && /^\d{2}-\d{6}$/.test(value);
|
|
15362
|
-
}
|
|
15363
|
-
function isRackBarcode(value) {
|
|
15366
|
+
};
|
|
15367
|
+
const isRackBarcode = function isRackBarcode(value) {
|
|
15364
15368
|
return isString(value) && /^[A-Z]{2}\d{8}$/.test(value);
|
|
15365
|
-
}
|
|
15366
|
-
function isNotNullish(value) {
|
|
15367
|
-
return value != null;
|
|
15368
|
-
}
|
|
15369
|
+
};
|
|
15369
15370
|
|
|
15370
15371
|
/**
|
|
15371
15372
|
* Call an array of promises in order, waiting for each promise to resolve before calling the next.
|