How to use the empty function from is

Find comprehensive JavaScript is.empty code examples handpicked from public code repositorys.

164
165
166
167
168
169
170
171
172
173
is.defined = function (value) {
  return typeof value !== 'undefined';
};

/**
 * is.empty
 * Test if `value` is empty.
 *
 * @param {Mixed} value value to test
 * @return {Boolean} true if `value` is empty, false otherwise
fork icon7
star icon24
watch icon8

85
86
87
88
89
90
91
92
93
94
            empty: function (form) { return resolve({ empty: true, form: form }); }
        };
    });
}

if (typeof obj === 'undefined' || obj === null || (is.object(obj) && is.empty(obj))) {
    (callbacks.empty || callbacks.other)(f, callbacks);
} else if (obj instanceof http.IncomingMessage) {
    if (obj.method === 'GET') {
        var qs = parse(obj.url, { parseArrays: false }).query;
fork icon170
star icon0
watch icon29

+ 15 other calls in file

36
37
38
39
40
41
42
43
44
45
  return;
}

const sess = config.get('sess');

if (is.undef(sess) || is.empty(sess)) {
  throw new Error('No valid session found. Please authorize first');
}

api.sid = sess.sid;
fork icon1
star icon7
watch icon3