Tabnine Logo For Javascript
isNull
Code IndexAdd Tabnine to your IDE (free)

How to use
isNull
function
in
lodash

Best JavaScript code snippets using lodash.isNull(Showing top 15 results out of 315)

origin: manaflair/mylittledom

export function onNullSwitch(trigger) {

  return function (node, newValue, oldValue) {

    if (isNull(newValue) === isNull(oldValue))
      return;

    trigger(node, newValue, oldValue);

  };

}
origin: manaflair/mylittledom

export function parseSelector(selector) {

  if (isNull(selector))
    return new Set();

  if (!isString(selector))
    throw new Error(`Failed to execute 'parseSelector': Parameter 1 is not a string.`);

  if (!selector.match(/^(:[a-z]+([A-Z][a-z]+)*)+$/))
    throw new Error(`Failed to execute 'parseSelector': '${selector}' is not a valid selector.`);

  return new Set(selector.match(/[a-zA-Z]+/g));

}
origin: manaflair/mylittledom

if (!isNull(child.style.$.zIndex)) {
  subContexts.push(child);
} else if (child.style.$.position.isAbsolutelyPositioned) {
origin: mrijk/speculaas

describe('Test the exercise function', () => {
  it('should generate 10 integers', () => {
    expect(s.exercise(isInteger)).to.have.length(10);
  });

  it('should generate 10 booleans', () => {
    expect(s.exercise(isBoolean)).to.have.length(10).to.satisfy(sample => every(sample, ([b]) => isBoolean(b)));
  });

  it('should generate 5 random values from a set', () => {
    s.def('::color', ['Red', 'Blue', 'Dun']);
    expect(s.exercise('::color', 5)).to.have.length(5);
  });

  it('should generate 7 random values from a named spec', () => {
    s.def('::pairs', s.cat(':n', isInteger, ':s', isString));
    expect(s.exercise('::pairs', 7)).to.have.length(7).to.satisfy(sample => every(sample, ([[n, s]]) =>
                                           isInteger(n) && isString(s)));
  });

  it('should generate 10 random values from a spec object', () => {
    expect(s.exercise(s.nilable(isString))).to.have.length(10).to.satisfy(sample => every(sample, ([s]) => isNull(s) || isString(s)));
  });

  it('should throw an exception', () => {
    s.def('::impossible', s.and(isInteger, isString));
    expect(() => s.exercise('::impossible')).to.throw(Error, /sampleFromSpec failed.*/);
  });
});
origin: mariobermudezjr/ecommerce-react-graphql-stripe

case 'biginteger':
case 'decimal':
 return !isNull(value) ? toString(value) : '-';
case 'boolean':
 return value !== null ? toString(value) : '-';
origin: mariobermudezjr/ecommerce-react-graphql-stripe

const entryLink = (isNull(value) || isUndefined(value) || excludeModel ? 
 '' : 
   onSelectResetsInput={false}
   simpleValue
   value={isNull(value) || isUndefined(value) ? null : {
    value: isFunction(value.toJS) ? value.toJS() : value,
    label: templateObject({ mainField: this.props.relation.displayedAttribute }, isFunction(value.toJS) ? value.toJS() : value).mainField || (isFunction(value.toJS) ? get(value.toJS(), 'id') : get(value, 'id')),
origin: manaflair/mylittledom

return isNull(value) || isString(value);
origin: ArcBlock/forge-js

/**
 * Converts value to hex representation
 *
 * @public
 * @static
 * @method numberToHex
 * @param {String|Number|BN} value
 * @returns {String}
 */
const numberToHex = value => {
 if (isNull(value) || typeof value === 'undefined') {
  return value;
 }

 // eslint-disable-next-line no-restricted-globals
 if (!isFinite(value) && !isHex(value)) {
  throw new Error(`Given input "${value}" is not a number.`);
 }

 const number = toBN(value);
 const result = number.toString(16);

 return number.lt(new BN(0)) ? `-0x${result.substr(1)}` : `0x${result}`;
}
origin: ryrudnev/spa-react-redux-example

 isFunction(payloadCreator) || isNull(payloadCreator),
 'Expected payloadCreator to be a function, undefined or null.',
);
let finalPayloadCreator = isNull(payloadCreator)
 ? identity
 : payloadCreator;
origin: mariobermudezjr/ecommerce-react-graphql-stripe

if (validationValue === 'json') {
 try {
  if (isObject(value) || isBoolean(value) || isNumber(value) || isArray(value) || isNaN(value) || isNull(value)) {
   value = JSON.parse(JSON.stringify(value));
  } else {
origin: mrijk/speculaas

    .to.satisfy(sample => _.every(sample, ([v]) => isNull(v) || isString(v)));
});
origin: manaflair/mylittledom

if (!isNull(name) && isUndefined(this.grammar.registry.get(name)))
  throw new Error(`Failed to execute 'grammar.use': '${name}' is not a valid grammar name.`);
if (!isNull(name))
  this.grammar.active = this.grammar.registry.get(name);
else
if (!isNull(name) && isUndefined(this.theme.registry.get(name)))
  throw new Error(`Failed to execute 'theme.use': '${name}' is not a valid theme name.`);
if (!isNull(name))
  this.theme.active = this.theme.registry.get(name);
else
let props = isNull(this.theme.active) ? {} : merge({}, ... this.theme.active.settings.filter(({ scope }) => {
  return isNil(scope) || scopes.some(other => scope === other || other.startsWith(`${scope}.`));
}).map(({ settings }) => {
origin: mariobermudezjr/ecommerce-react-graphql-stripe

<SortableList
 items={
  isNull(value) || isUndefined(value) || value.size === 0
   ? null
   : value.map(item => {
origin: ryrudnev/spa-react-redux-example

 isFunction(mapProps) || isNull(mapProps),
 'Expected mapProps to be a function, undefined or null.',
);
origin: manaflair/mylittledom

if (isNull(this.name))
  return;
if (isNull(this.name))
  return;
return isNull(value) || isString(value);
if (!isNull(value)) {
if (!isNull(this.name)) {
lodash(npm)isNull

Most used lodash functions

  • LoDashStatic.map
    Creates an array of values by running each element in collection through iteratee. The iteratee is
  • LoDashStatic.isEmpty
    Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string
  • LoDashStatic.forEach
    Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked wit
  • LoDashStatic.find
    Iterates over elements of collection, returning the first element predicate returns truthy for.
  • LoDashStatic.pick
    Creates an object composed of the picked `object` properties.
  • LoDashStatic.get,
  • LoDashStatic.isArray,
  • LoDashStatic.filter,
  • LoDashStatic.merge,
  • LoDashStatic.isString,
  • LoDashStatic.isFunction,
  • LoDashStatic.assign,
  • LoDashStatic.extend,
  • LoDashStatic.includes,
  • LoDashStatic.keys,
  • LoDashStatic.cloneDeep,
  • LoDashStatic.uniq,
  • LoDashStatic.isObject,
  • LoDashStatic.omit

Popular in JavaScript

  • fs
  • request
    Simplified HTTP request client.
  • postcss
  • redis
    Redis client library
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • async
    Higher-order functions and common patterns for asynchronous code
  • fs-extra
    fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now