refactor(ccdaservice): extract and test safeTrim function (#6788)
[openemr.git] / ccdaservice / utils / clean-code / clean-code.js
blob709b97afdf313c39ce45e5186479e339e11868c5
1 'use strict';
3 const NULL_FLAVOR = require('../constants').NULL_FLAVOR;
5 function cleanCode(code) {
6     return typeof code === 'undefined' || code.length < 1
7         ? NULL_FLAVOR
8         : code.replace(/[.#]/, '');
11 exports.cleanCode = cleanCode;