node_modules

This commit is contained in:
saeid
2019-07-15 13:07:31 +04:30
parent d3735c6d30
commit ce1a3ebf9c
35713 changed files with 3639219 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _common = require("./common");
var _default = function _default() {
var separator = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ':';
return (0, _common.withParams)({
type: 'macAddress'
}, function (value) {
if (!(0, _common.req)(value)) {
return true;
}
if (typeof value !== 'string') {
return false;
}
var parts = typeof separator === 'string' && separator !== '' ? value.split(separator) : value.length === 12 || value.length === 16 ? value.match(/.{2}/g) : null;
return parts !== null && (parts.length === 6 || parts.length === 8) && parts.every(hexValid);
});
};
exports.default = _default;
var hexValid = function hexValid(hex) {
return hex.toLowerCase().match(/^[0-9a-f]{2}$/);
};