Last active
January 28, 2016 20:53
-
-
Save sometimesalready/aa6407230f76de84907c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let R = require('ramda') | |
var prepend = R.when( | |
R.propSatisfies(R.lt(R.__, 2), 'length'), | |
R.pipe(R.prepend(0), R.join('')) | |
); | |
let normalize = R.pipe(R.toLower, R.split(':'), R.map(prepend), R.join(':')); | |
normalize('4:46:65:F2:2b:7'); //=> 04:46:65:f2:2b:07 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cookie