How to use the is.fn function in is

To help you get started, we’ve selected a few is examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / nodejs-datastore / src / transaction.ts View on Github external
run(options?, callback?) {
    if (is.fn(options)) {
      callback = options;
      options = {};
    }

    options = options || {};
    callback = callback || (() => {});

    // tslint:disable-next-line no-any
    const reqOpts: any = {
      transactionOptions: {},
    };

    if (options.readOnly || this.readOnly) {
      reqOpts.transactionOptions.readOnly = {};
    }
github floatdrop / connect-once / test / heartbeat.js View on Github external
heartbeat: function (error, one, two, beat) {
                is.fn(beat).should.be.ok;
                one.should.eql('one');
                two.should.eql('two');
                done();
            }
        }, function (cb) { cb(null, 'one', 'two'); });
github hanxi / note-md / client / components / tree.vue View on Github external
selected () {
      if (is.fn(this.$root.onSelected)) {
        this.$root.onSelected(this.model)
      }
      this.$root.activePath = this.model.path
    }
  },
github googleapis / nodejs-spanner / src / transaction.ts View on Github external
shouldRetry_(err) {
    return (
        this.isRetryableErrorCode_(err.code) && is.fn(this.runFn_) &&
        Date.now() - this.beginTime_! < this.timeout_);
  }
  /**
github googleapis / nodejs-datastore / src / request.ts View on Github external
delete(keys, gaxOptions, callback?) {
    if (is.fn(gaxOptions)) {
      callback = gaxOptions;
      gaxOptions = {};
    }

    callback = callback || (() => {});

    const reqOpts = {
      mutations: arrify(keys).map(key => {
        return {
          delete: entity.keyToKeyProto(key),
        };
      }),
    };

    if (this.id) {
      this.requests_.push(reqOpts);
github googleapis / nodejs-storage / src / bucket.js View on Github external
setMetadata(metadata, options, callback) {
    if (is.fn(options)) {
      callback = options;
      options = {};
    }

    callback = callback || common.util.noop;

    this.request(
      {
        method: 'PATCH',
        uri: '',
        json: metadata,
        qs: options,
      },
      (err, resp) => {
        if (err) {
          callback(err, resp);
github massgov / mayflower / react / src / components / molecules / MainNav / index.js View on Github external
onNavigate = ({ e, href }) => {
    e.stopPropagation();
    const { onNavigateCallBack, closeMobileMenu, updateHeaderState } = this.props;
    if (is.fn(closeMobileMenu)) {
      closeMobileMenu();
    }
    if (is.fn(onNavigateCallBack)) {
      onNavigateCallBack(href);
    } else if (typeof window !== 'undefined') {
      window.location.assign(href);
    }
    updateHeaderState({
      navSelected: -1
    });
  };
github googleapis / nodejs-storage / src / bucket.js View on Github external
deleteFiles(query, callback) {
    if (is.fn(query)) {
      callback = query;
      query = {};
    }

    query = query || {};

    const MAX_PARALLEL_LIMIT = 10;
    const errors = [];

    this.getFiles(query, (err, files) => {
      if (err) {
        callback(err);
        return;
      }

      const deleteFile = (file, callback) => {
github googleapis / nodejs-datastore / src / request.ts View on Github external
get(keys, options, callback?) {
    if (is.fn(options)) {
      callback = options;
      options = {};
    }

    options = options || {};

    this.createReadStream(keys, options)
        .on('error', callback)
        .pipe(concat(results => {
          const isSingleLookup = !is.array(keys);
          callback(null, isSingleLookup ? results[0] : results);
        }));
  }
github googleapis / nodejs-spanner / src / index.ts View on Github external
getInstanceConfigs(query, callback?) {
    if (is.fn(query)) {
      callback = query;
      query = {};
    }
    const reqOpts = extend({}, query, {
      parent: 'projects/' + this.projectId,
    });
    return this.request(
        {
          client: 'InstanceAdminClient',
          method: 'listInstanceConfigs',
          reqOpts,
          gaxOpts: query,
        },
        callback);
  }

is

the definitive JavaScript type testing library

MIT
Latest version published 5 years ago

Package Health Score

71 / 100
Full package analysis