"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseInteger = exports.normalizeMac = exports.normalizeString = void 0;
const lodash_1 = __importDefault(require("lodash"));
function normalizeString(str) {
    return lodash_1.default.isString(str) ? str.trim().replace(/\s+/g, ' ') : str;
}
exports.normalizeString = normalizeString;
function normalizeMac(mac) {
    // parts only contains values at odd indexes
    const parts = mac.toUpperCase().replace(/:/g, '').split(/([A-F0-9]{2})/);
    const macParts = [];
    for (let i = 1; i < parts.length; i += 2) {
        macParts.push(parts[i]);
    }
    return macParts.join(':');
}
exports.normalizeMac = normalizeMac;
function parseInteger(str) {
    const parsed = lodash_1.default.parseInt(str, 10);
    return parsed.toString() === str ? parsed : undefined;
}
exports.parseInteger = parseInteger;
//# sourceMappingURL=strings.js.map