How to use arr-diff - 2 common examples

To help you get started, we’ve selected a few arr-diff 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 hjkcai / vue-modal-dialogs / dist / index.js View on Github external
} else if (isVueComponent(options.component)) {
    props = options.props
    component = options.component
  } else {
    if (debug) { console.error('[vue-modal-dialogs] No Vue component specified') }
    return
  }

  // Dialog component and props
  var dialogConfig = {
    props: props,

    // Inject a `$close` function and pre-defined props into dialog component
    component: Vue.extend({
      extends: component,
      props: diff(['dialogId', 'arguments' ].concat( props), Object.keys(component.props || [])),
      methods: {
        $close: function $close (data) {
          this.$emit('vue-modal-dialogs:close', data)
        }
      }
    })
  }

  // Return dialog function
  return function dialogFunction () {
    var args = [], len = arguments.length;
    while ( len-- ) args[ len ] = arguments[ len ];

    if (dialogsWrapper) {
      // Add dialog component into dialogsWrapper component
      return dialogsWrapper.add(dialogConfig, args)
github jonschlinkert / utils / lib / array / difference.js View on Github external
module.exports = function difference_(arr) {
  if (!Array.isArray(arr)) {
    throw new TypeError('utils#array.difference() expects an array.');
  }
  return diff.apply(diff, arguments);
};

arr-diff

Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.

MIT
Latest version published 7 years ago

Package Health Score

68 / 100
Full package analysis

Popular arr-diff functions