How to use the deep-equal function in deep-equal

To help you get started, we’ve selected a few deep-equal 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 pubkey / rxdb / dist / es / rx-query.js View on Github external
if (missedChangeEvents === null) {
      // changeEventBuffer is of bounds -> we must re-execute over the database
      mustReExec = true;
    } else {
      rxQuery._latestChangeEvent = rxQuery.collection._changeEventBuffer.counter;

      var runChangeEvents = rxQuery.collection._changeEventBuffer.reduceByLastOfDoc(missedChangeEvents);

      var changeResult = rxQuery._queryChangeDetector.runChangeDetection(runChangeEvents);

      if (!Array.isArray(changeResult) && changeResult) {
        // could not calculate the new results, execute must be done
        mustReExec = true;
      }

      if (Array.isArray(changeResult) && !deepEqual(changeResult, rxQuery._resultsData)) {
        // we got the new results, we do not have to re-execute, mustReExec stays false
        ret = true; // true because results changed

        rxQuery._setResultData(changeResult);
      }
    }
  } // oh no we have to re-execute the whole query over the database


  if (mustReExec) {
    // counter can change while _execOverDatabase() is running so we save it here
    var latestAfter = rxQuery.collection._changeEventBuffer.counter;
    return rxQuery._execOverDatabase().then(function (newResultData) {
      rxQuery._latestChangeEvent = latestAfter;

      if (!deepEqual(newResultData, rxQuery._resultsData)) {
github unfoldingWord / translationCore / src / js / actions / SelectionsActions.js View on Github external
export const sameContext = (contextId1, contextId2) => {
  if (!!contextId1 && !!contextId2) {
    return isEqual(contextId1.reference, contextId2.reference)
      && (contextId1.groupId === contextId2.groupId)
      && (contextId1.occurrence === contextId2.occurrence);
  }
  return false;
};
github codecks-io / react-reform / src / index.jsx View on Github external
handleValidationResults(fieldName, results) {
    const {validationResults} = this.state;
    if (!deepEqual(validationResults[fieldName], results)) {
      validationResults[fieldName] = results;
      this.setState(validationResults);
    }
  }
github cozy / cozy-bar / src / lib / config.js View on Github external
async function updateApps (config) {
  const oldApps = config.apps.slice()

  await updateAppsItems(config)

  return !deepEqual(oldApps, config.apps)
}
github unfoldingWord / translationCore / src / js / actions / GroupsDataActions.js View on Github external
export const findGroupDataItem = (contextId, groupData) => {
  let index = -1;
  const isQuoteString = typeof contextId.quote === 'string';

  for (let i = groupData.length - 1; i >= 0; i--) {
    const grpContextId = groupData[i].contextId;

    if (isSameVerse(grpContextId, contextId) &&
      (grpContextId.occurrence === contextId.occurrence) &&
      (isQuoteString ? (grpContextId.quote === contextId.quote) :
        isEqual(grpContextId.quote, contextId.quote))) {
      index = i;
      break;
    }
  }
  return index;
};
github paularmstrong / build-tracker / packages / webapp / src / Main.js View on Github external
componentWillReceiveProps(nextProps: Object) {
    if (!deepEqual(this.props.bundles, nextProps.bundles)) {
      this._stats = statsForBundles(nextProps.bundles);
    }
  }
github quilljs / quill / core / selection.js View on Github external
update(source = Emitter.sources.USER) {
    const oldRange = this.lastRange;
    const [lastRange, nativeRange] = this.getRange();
    this.lastRange = lastRange;
    if (this.lastRange != null) {
      this.savedRange = this.lastRange;
    }
    if (!equal(oldRange, this.lastRange)) {
      if (
        !this.composing &&
        nativeRange != null &&
        nativeRange.native.collapsed &&
        nativeRange.start.node !== this.cursor.textNode
      ) {
        const range = this.cursor.restore();
        if (range) {
          this.setNativeRange(
            range.startNode,
            range.startOffset,
            range.endNode,
            range.endOffset,
          );
        }
      }

deep-equal

node's assert.deepEqual algorithm

MIT
Latest version published 4 months ago

Package Health Score

77 / 100
Full package analysis