1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = isMACAddress;
|
7 |
|
8 | var _assertString = _interopRequireDefault(require("./util/assertString"));
|
9 |
|
10 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11 |
|
12 | var macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/;
|
13 | var macAddressNoColons = /^([0-9a-fA-F]){12}$/;
|
14 |
|
15 | function isMACAddress(str, options) {
|
16 | (0, _assertString.default)(str);
|
17 |
|
18 | if (options && options.no_colons) {
|
19 | return macAddressNoColons.test(str);
|
20 | }
|
21 |
|
22 | return macAddress.test(str);
|
23 | }
|
24 |
|
25 | module.exports = exports.default; |
\ | No newline at end of file |