@bigbinary/neeto-molecules 4.1.23 → 4.1.25
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/IpRestriction.js +93 -86
- package/dist/IpRestriction.js.map +1 -1
- package/dist/cjs/IpRestriction.js +93 -86
- package/dist/cjs/IpRestriction.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/ar.json +3 -1
- package/src/translations/bg.json +3 -1
- package/src/translations/ca.json +3 -1
- package/src/translations/cs.json +3 -1
- package/src/translations/da.json +3 -1
- package/src/translations/de.json +4 -2
- package/src/translations/es-MX.json +3 -1
- package/src/translations/es.json +3 -1
- package/src/translations/et.json +4 -2
- package/src/translations/fi.json +4 -2
- package/src/translations/fil.json +4 -2
- package/src/translations/fr.json +3 -1
- package/src/translations/he.json +3 -1
- package/src/translations/hi.json +3 -1
- package/src/translations/hr.json +3 -1
- package/src/translations/hu.json +4 -2
- package/src/translations/id.json +4 -2
- package/src/translations/it.json +3 -1
- package/src/translations/ja.json +3 -1
- package/src/translations/ko.json +3 -1
- package/src/translations/nl.json +3 -1
- package/src/translations/pl.json +4 -2
- package/src/translations/pt-BR.json +4 -2
- package/src/translations/pt.json +4 -2
- package/src/translations/ro.json +3 -1
- package/src/translations/ru.json +3 -1
- package/src/translations/sk.json +3 -1
- package/src/translations/sl.json +4 -2
- package/src/translations/sv.json +3 -1
- package/src/translations/th.json +3 -1
- package/src/translations/tr.json +4 -2
- package/src/translations/uk.json +3 -1
- package/src/translations/vi.json +3 -1
- package/src/translations/zh-CN.json +3 -1
- package/src/translations/zh-TW.json +3 -1
package/dist/IpRestriction.js
CHANGED
|
@@ -345,86 +345,93 @@ function requireIPv6Utils () {
|
|
|
345
345
|
|
|
346
346
|
var HexadecimalUtils = {};
|
|
347
347
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
348
|
+
var hasRequiredHexadecimalUtils;
|
|
349
|
+
|
|
350
|
+
function requireHexadecimalUtils () {
|
|
351
|
+
if (hasRequiredHexadecimalUtils) return HexadecimalUtils;
|
|
352
|
+
hasRequiredHexadecimalUtils = 1;
|
|
353
|
+
(function (exports$1) {
|
|
354
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
355
|
+
exports$1.hexadectetNotationToBinaryString = exports$1.binaryStringToHexadecimalString = exports$1.colonHexadecimalNotationToBinaryString = exports$1.hexadecimalStringToHexadecatetString = exports$1.hexadecimalStringToBinaryString = exports$1.bigIntToHexadecimalString = void 0;
|
|
356
|
+
const IPv6Utils_1 = requireIPv6Utils();
|
|
357
|
+
const BinaryUtils_1 = BinaryUtils;
|
|
358
|
+
/**
|
|
359
|
+
* Converts a given bigint number to a hexadecimal string
|
|
360
|
+
* @param num the bigint number
|
|
361
|
+
* @returns {string} the hexadeciaml string
|
|
362
|
+
*/
|
|
363
|
+
let bigIntToHexadecimalString = (num) => {
|
|
364
|
+
return num.toString(16);
|
|
365
|
+
};
|
|
366
|
+
exports$1.bigIntToHexadecimalString = bigIntToHexadecimalString;
|
|
367
|
+
/**
|
|
368
|
+
* Converts a number in hexadecimal (base 16) to binary string
|
|
369
|
+
* @param {string} hexadecimalString the number in base 16
|
|
370
|
+
* @returns {string} the number converted to base 2
|
|
371
|
+
*/
|
|
372
|
+
let hexadecimalStringToBinaryString = (hexadecimalString) => {
|
|
373
|
+
let inDecimal = BigInt(`0x${hexadecimalString}`);
|
|
374
|
+
return inDecimal.toString(2);
|
|
375
|
+
};
|
|
376
|
+
exports$1.hexadecimalStringToBinaryString = hexadecimalStringToBinaryString;
|
|
377
|
+
/**
|
|
378
|
+
* Converts a number in hexadecimal (base 16) to binary hexadecatet string.
|
|
379
|
+
* This means the bits in the output cannot be more than 16
|
|
380
|
+
*
|
|
381
|
+
* @param hexadecimalString {string} the number converted to binary hexadecatet string
|
|
382
|
+
*/
|
|
383
|
+
let hexadecimalStringToHexadecatetString = (hexadecimalString) => {
|
|
384
|
+
let binaryString = (0, exports$1.hexadecimalStringToBinaryString)(hexadecimalString);
|
|
385
|
+
let length = binaryString.length;
|
|
386
|
+
if (length > 16) {
|
|
387
|
+
throw new Error("Given decimal in binary contains digits greater than an Hexadecatet");
|
|
388
|
+
}
|
|
389
|
+
return (0, BinaryUtils_1.leftPadWithZeroBit)(binaryString, 16);
|
|
390
|
+
};
|
|
391
|
+
exports$1.hexadecimalStringToHexadecatetString = hexadecimalStringToHexadecatetString;
|
|
392
|
+
/**
|
|
393
|
+
* Given an IPv6 number in hexadecimal notated string, e.g 2001:0db8:0000:0000:0000:0000:0000:0000 converts it to
|
|
394
|
+
* binary string
|
|
395
|
+
*
|
|
396
|
+
* @param hexadecimalString IPv6 string
|
|
397
|
+
* @returns {string} the binary value of the given ipv6 number in string
|
|
398
|
+
*/
|
|
399
|
+
let colonHexadecimalNotationToBinaryString = (hexadecimalString) => {
|
|
400
|
+
let expandedIPv6 = (0, IPv6Utils_1.expandIPv6Number)(hexadecimalString);
|
|
401
|
+
let stringHexadecimal = expandedIPv6.split(":");
|
|
402
|
+
return stringHexadecimal.reduce((binaryAsString, hexidecimal) => {
|
|
403
|
+
return binaryAsString.concat((0, exports$1.hexadecimalStringToHexadecatetString)(hexidecimal));
|
|
404
|
+
}, '');
|
|
405
|
+
};
|
|
406
|
+
exports$1.colonHexadecimalNotationToBinaryString = colonHexadecimalNotationToBinaryString;
|
|
407
|
+
/**
|
|
408
|
+
* Converts number in binary string to hexadecimal string
|
|
409
|
+
* @param {string} num in binary string
|
|
410
|
+
* @returns {string} num in hexadecimal string
|
|
411
|
+
*/
|
|
412
|
+
let binaryStringToHexadecimalString = (num) => {
|
|
413
|
+
// first convert to binary string to decimal (big Integer)
|
|
414
|
+
let inDecimal = BigInt(`0b${num}`);
|
|
415
|
+
return inDecimal.toString(16);
|
|
416
|
+
};
|
|
417
|
+
exports$1.binaryStringToHexadecimalString = binaryStringToHexadecimalString;
|
|
418
|
+
/**
|
|
419
|
+
* Converts a given IPv6 number expressed in the hexadecimal string notation into a 16 bit binary number in string
|
|
420
|
+
* @param {string} hexadectetString the IPv6 number
|
|
421
|
+
* @returns {string} the IPv6 number converted to binary string
|
|
422
|
+
*/
|
|
423
|
+
let hexadectetNotationToBinaryString = (hexadectetString) => {
|
|
424
|
+
let expand = (0, IPv6Utils_1.expandIPv6Number)(hexadectetString);
|
|
425
|
+
let hexadecimals = expand.split(":");
|
|
426
|
+
return hexadecimals.reduce((hexadecimalAsString, hexavalue) => {
|
|
427
|
+
return hexadecimalAsString.concat((0, BinaryUtils_1.leftPadWithZeroBit)((0, exports$1.hexadecimalStringToBinaryString)(hexavalue), 16));
|
|
428
|
+
}, '');
|
|
429
|
+
};
|
|
430
|
+
exports$1.hexadectetNotationToBinaryString = hexadectetNotationToBinaryString;
|
|
431
|
+
|
|
432
|
+
} (HexadecimalUtils));
|
|
433
|
+
return HexadecimalUtils;
|
|
434
|
+
}
|
|
428
435
|
|
|
429
436
|
var hasRequiredValidator;
|
|
430
437
|
|
|
@@ -436,8 +443,8 @@ function requireValidator () {
|
|
|
436
443
|
const BinaryUtils_1 = BinaryUtils;
|
|
437
444
|
const BinaryUtils_2 = BinaryUtils;
|
|
438
445
|
const IPv6Utils_1 = requireIPv6Utils();
|
|
439
|
-
const HexadecimalUtils_1 =
|
|
440
|
-
const HexadecimalUtils_2 =
|
|
446
|
+
const HexadecimalUtils_1 = requireHexadecimalUtils();
|
|
447
|
+
const HexadecimalUtils_2 = requireHexadecimalUtils();
|
|
441
448
|
let Validator$1 = class Validator {
|
|
442
449
|
/**
|
|
443
450
|
* Checks if given ipNumber is in between the given lower and upper bound
|
|
@@ -934,9 +941,9 @@ const BinaryUtils_2 = BinaryUtils;
|
|
|
934
941
|
const BinaryUtils_3 = BinaryUtils;
|
|
935
942
|
const BinaryUtils_4 = BinaryUtils;
|
|
936
943
|
const Hexadecatet_1$1 = Hexadecatet$1;
|
|
937
|
-
const HexadecimalUtils_1$1 =
|
|
944
|
+
const HexadecimalUtils_1$1 = requireHexadecimalUtils();
|
|
938
945
|
const IPv6Utils_1 = requireIPv6Utils();
|
|
939
|
-
const HexadecimalUtils_2 =
|
|
946
|
+
const HexadecimalUtils_2 = requireHexadecimalUtils();
|
|
940
947
|
/**
|
|
941
948
|
* Provides the implementation of functionality that are common
|
|
942
949
|
* to {@link IPv4}, {@link IPv6}, {@link IPv4Mask} and {@link IPv6Mask}
|
|
@@ -1687,7 +1694,7 @@ Prefix.isIPv4Prefix = isIPv4Prefix;
|
|
|
1687
1694
|
const Validator_1$1 = requireValidator();
|
|
1688
1695
|
const IPNumber_1$1 = IPNumber;
|
|
1689
1696
|
const BinaryUtils_1$1 = BinaryUtils;
|
|
1690
|
-
const HexadecimalUtils_1 =
|
|
1697
|
+
const HexadecimalUtils_1 = requireHexadecimalUtils();
|
|
1691
1698
|
const Hexadecatet_1 = Hexadecatet$1;
|
|
1692
1699
|
/**
|
|
1693
1700
|
* Represents the prefix portion in the CIDR notation for representing IP ranges
|
|
@@ -3185,7 +3192,7 @@ class SortedSet {
|
|
|
3185
3192
|
*/
|
|
3186
3193
|
__exportStar(BinaryUtils, exports$1);
|
|
3187
3194
|
__exportStar(Hexadecatet$1, exports$1);
|
|
3188
|
-
__exportStar(
|
|
3195
|
+
__exportStar(requireHexadecimalUtils(), exports$1);
|
|
3189
3196
|
__exportStar(IPNumber, exports$1);
|
|
3190
3197
|
__exportStar(IPNumType, exports$1);
|
|
3191
3198
|
__exportStar(IPPool, exports$1);
|