Sha256: c1e8887342e2c9690f948105a1641eb8a70620545dfac30cf5b026d072ae0d6b

Contents?: true

Size: 990 Bytes

Versions: 2

Compression:

Stored size: 990 Bytes

Contents

import isBlank from './is_blank';
/**
 @module @ember/utils
*/
/**
  A value is present if it not `isBlank`.

  ```javascript
  isPresent();                // false
  isPresent(null);            // false
  isPresent(undefined);       // false
  isPresent('');              // false
  isPresent('  ');            // false
  isPresent('\n\t');          // false
  isPresent([]);              // false
  isPresent({ length: 0 })    // false
  isPresent(false);           // true
  isPresent(true);            // true
  isPresent('string');        // true
  isPresent(0);               // true
  isPresent(function() {})    // true
  isPresent({});              // true
  isPresent(false);           // true
  isPresent('\n\t Hello');    // true
  isPresent([1,2,3]);         // true
  ```

  @method isPresent
  @static
  @for @ember/utils
  @param {Object} obj Value to test
  @return {Boolean}
  @since 1.8.0
  @public
*/
export default function isPresent(obj) {
    return !isBlank(obj);
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
discourse-ember-source-3.5.1.1 dist/es/ember-metal/lib/is_present.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-metal/lib/is_present.js