UNPKG

log-ocd

Version:
36 lines (32 loc) 1.09 kB
/** * ----------------------------------------------------------------------------- * LOG-OCD: FORMAT VALUES HELPER - NEW-ALIGN-STR * ----------------------------------------------------------------------------- * @version 1.0.0-beta.11 * @see [log-ocd]{@link https://github.com/imaginate/log-ocd} * * @author Adam Smith <imagineadamsmith@gmail.com> (https://github.com/imaginate) * @copyright 2022 Adam A Smith <imagineadamsmith@gmail.com> (https://github.com/imaginate) * * Supporting Libraries: * @see [chalk]{@link https://github.com/chalk/chalk} * @see [vitals]{@link https://github.com/imaginate/vitals} * * Annotations: * @see [JSDoc3]{@link http://usejsdoc.org/} * @see [Closure Compiler specific JSDoc]{@link https://developers.google.com/closure/compiler/docs/js-for-compiler} */ 'use strict'; /** @type {!Object} */ var ALIGN = { 'left': true, 'right': true }; /** * @param {string} newVal * @param {string} nowVal * @return {string} */ module.exports = function newAlignStr(newVal, nowVal) { return newVal && ALIGN[newVal] ? newVal : nowVal; };