@gidw/mac-address-util
Advanced tools
Comparing version 0.0.1 to 1.0.0
56
index.js
@@ -13,5 +13,6 @@ 'use strict'; | ||
* @param {number} macNum | ||
* @param {boolean} [debug] | ||
* @returns {string} | ||
*/ | ||
convertToMac: function convertToMac (macNum) { | ||
convertToMac: function convertToMac (macNum, debug) { | ||
@@ -45,3 +46,6 @@ var macStr, macStrLength, macStrLengthDiff, completeMacStr; | ||
console.warn('convertToMac - Invalid MAC number length'); | ||
if (debug) { | ||
console.warn('convertToMac - Invalid MAC number length'); | ||
} | ||
} | ||
@@ -62,6 +66,9 @@ | ||
console.warn( | ||
'convertToMac - Invalid complete MAC string', | ||
completeMacStr | ||
); | ||
if (debug) { | ||
console.warn( | ||
'convertToMac - Invalid complete MAC string', | ||
completeMacStr | ||
); | ||
} | ||
} | ||
@@ -71,3 +78,6 @@ | ||
console.warn('convertToMac - Invalid MAC number'); | ||
if (debug) { | ||
console.warn('convertToMac - Invalid MAC number'); | ||
} | ||
} | ||
@@ -82,5 +92,6 @@ | ||
* @param {string} macStr | ||
* @param {boolean} [debug] | ||
* @returns {number} | ||
*/ | ||
convertToNumber: function convertToNumber (macStr) { | ||
convertToNumber: function convertToNumber (macStr, debug) { | ||
@@ -104,6 +115,9 @@ var splits, length, macHexStr; | ||
console.warn( | ||
'convertToNumber - Invalid MAC address' + | ||
' - Unknown separator' | ||
); | ||
if (debug) { | ||
console.warn( | ||
'convertToNumber - Invalid MAC address' + | ||
' - Unknown separator' | ||
); | ||
} | ||
} | ||
@@ -123,7 +137,10 @@ | ||
console.warn( | ||
'convertToNumber - Invalid MAC address' + | ||
' - Invalid split', | ||
splits | ||
); | ||
if (debug) { | ||
console.warn( | ||
'convertToNumber - Invalid MAC address' + | ||
' - Invalid split', | ||
splits | ||
); | ||
} | ||
} | ||
@@ -134,3 +151,6 @@ } | ||
console.warn('convertToNumber - Invalid MAC address'); | ||
if (debug) { | ||
console.warn('convertToNumber - Invalid MAC address'); | ||
} | ||
} | ||
@@ -137,0 +157,0 @@ |
{ | ||
"name": "@gidw/mac-address-util", | ||
"version": "0.0.1", | ||
"version": "1.0.0", | ||
"description": "Utility functions for working with MAC addresses", | ||
"author": "Gilles De Waele", | ||
"keywords": [ | ||
"mac", | ||
"convert", | ||
"MAC address", | ||
"utility" | ||
], | ||
"license": "MIT", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"dependencies": {}, | ||
@@ -9,0 +16,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5935
5
108
1
1
19