all files / couch/util/ stringify-unless-empty.js

80% Statements 4/5
75% Branches 3/4
100% Functions 0/0
80% Lines 4/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15            19× 19× 19×          
import Ember from 'ember';
 
const {
  typeOf
} = Ember;
 
export default value => {
  let type = typeOf(value);
  Eif(type === 'null' || type === 'undefined') {
    return;
  }
  return JSON.stringify(value);
};