How to use the min-dash.isFunction function in min-dash

To help you get started, we’ve selected a few min-dash 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 bpmn-io / bpmn-moddle / test / integration / camunda / write.js View on Github external
function write(element, options, callback) {
        if (isFunction(options)) {
          callback = options;
          options = {};
        }

        // skip preamble for tests
        options = assign({ preamble: false }, options);

        moddle.toXML(element, options, callback);
      }
github bpmn-io / diagram-js / test / spec / features / popup-menu / PopupMenuSpec.js View on Github external
function Provider(entries, headerEntries) {
  this.getPopupMenuEntries = isFunction(entries) ? entries : function() {
    return entries || {};
  };

  if (headerEntries) {
    this.getPopupMenuHeaderEntries = isFunction(headerEntries) ? headerEntries : function() {
      return headerEntries;
    };
  }
}
github bpmn-io / bpmn-js / test / spec / import / ImporterSpec.js View on Github external
function runImport(diagram, xml, diagramId, done) {

    if (isFunction(diagramId)) {
      done = diagramId;
      diagramId = null;
    }

    var moddle = new BpmnModdle();

    moddle.fromXML(xml, function(err, definitions) {

      var selectedDiagram = find(definitions.diagrams, function(element) {
        return element.id === diagramId;
      });

      importBpmnDiagram(diagram, definitions, selectedDiagram, done);
    });
  }
github bpmn-io / diagram-js / lib / features / context-pad / ContextPad.js View on Github external
forEach(providers, function(provider) {
    var entriesOrUpdater = provider.getContextPadEntries(element);

    if (isFunction(entriesOrUpdater)) {
      entries = entriesOrUpdater(entries);
    } else {
      forEach(entriesOrUpdater, function(entry, id) {
        entries[id] = entry;
      });
    }
  });
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / BpmnEditor.js View on Github external
handleLayoutChange(newLayout) {
    const {
      onLayoutChanged
    } = this.props;

    if (isFunction(onLayoutChanged)) {
      onLayoutChanged(newLayout);
    }
  }
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / BpmnEditor.js View on Github external
middlewares
        }
      });
    };

    const {
      options,
      warnings
    } = configureModeler(getPlugins, {
      exporter: {
        name,
        version
      },
    }, handleMiddlewareExtensions);

    if (warnings.length && isFunction(onError)) {
      onError(
        'Problem(s) configuring BPMN editor: \n\t' +
        warnings.map(error => error.message).join('\n\t') +
        '\n'
      );
    }

    const modeler = new CamundaBpmnModeler({
      ...options,
      position: 'absolute'
    });

    const commandStack = modeler.get('commandStack');

    const stackIdx = commandStack._stackIdx;
github bpmn-io / dmn-js / packages / dmn-js-shared / src / base / viewer / core / Components.js View on Github external
onGetComponent(type, priority, callback) {
    if (isFunction(priority)) {
      callback = priority;
      priority = DEFAULT_PRIORITY;
    }

    if (!isNumber(priority)) {
      throw new Error('priority must be a number');
    }

    const listeners = this._getListeners(type);

    let existingListener,
        idx;

    const newListener = { priority, callback };

    for (idx = 0; (existingListener = listeners[idx]); idx++) {
github zeebe-io / zeebe-modeler / app / lib / menu / menu-builder.js View on Github external
menuEntries.map((entry) => {

              const {
                accelerator,
                action,
                enabled,
                label,
                submenu,
                visible
              } = entry;

              return new MenuItem({
                label,
                accelerator,
                enabled: isFunction(enabled) ? Boolean(enabled()) : enabled,
                click: action && wrapPluginAction(action, name),
                submenu,
                visible
              });
            })
          );
github zeebe-io / zeebe-modeler / client / src / app / cached / Cache.js View on Github external
Object.keys(this._entries).forEach((k) => {
      if (k.indexOf(key) === 0) {
        const entry = this._entries[k];

        if (isFunction(entry[__DESTROY])) {
          entry[__DESTROY]();
        }

        delete this._entries[k];
      }
    });
  }
github bpmn-io / diagram-js / lib / features / keyboard / Keyboard.js View on Github external
Keyboard.prototype.addListener = function(priority, listener, type) {
  if (isFunction(priority)) {
    type = listener;
    listener = priority;
    priority = DEFAULT_PRIORITY;
  }

  this._eventBus.on(type || KEYDOWN_EVENT, priority, listener);
};