Sha256: c7c683e592d5c43e7c62171b2c63da40e378b79d8e11ba576e76eb2462a68825

Contents?: true

Size: 881 Bytes

Versions: 6

Compression:

Stored size: 881 Bytes

Contents

// ORGINAL: https://github.com/quilljs/delta/blob/ddda3bf088cda3ec03d5dbcc1179679d147f3a02/src/AttributeMap.ts

((exports) => {
  const attributeDiff = (attributes1, attributes2) => {
    let alpha = attributes1;
    let beta = attributes2;
    if (typeof alpha !== "object") {
      alpha = {};
    }
    if (typeof beta !== "object") {
      beta = {};
    }
    const attributes = Object.keys(alpha).concat(Object.keys(beta)).reduce((attrs, key) => {
      // ORGINAL: import isEqual from 'lodash.isequal'; if (!isEqual(a[key], b[key]))
      if ((alpha[key] !== beta[key])) {
        attrs[key] = null;
        if (beta[key]) {
          attrs[key] = beta[key]
        }
      }
      return attrs;
    }, {});

    if (Object.keys(attributes).length > 0) {
      return attributes;
    }
    return null;
  }

  exports.Decidim.Editor.attributeDiff = attributeDiff
})(window)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-core-0.24.3 app/assets/javascripts/decidim/editor/modified_backspace_utils.js.es6
decidim-core-0.24.2 app/assets/javascripts/decidim/editor/modified_backspace_utils.js.es6
decidim-core-0.24.1 app/assets/javascripts/decidim/editor/modified_backspace_utils.js.es6
decidim-core-0.24.0 app/assets/javascripts/decidim/editor/modified_backspace_utils.js.es6
decidim-core-0.24.0.rc2 app/assets/javascripts/decidim/editor/modified_backspace_utils.js.es6
decidim-core-0.24.0.rc1 app/assets/javascripts/decidim/editor/modified_backspace_utils.js.es6