isEqualLocals.js 535 B

1234567891011121314151617181920212223242526272829303132333435
  1. "use strict";
  2. function isEqualLocals(a, b, isNamedExport) {
  3. if (!a && b || a && !b) {
  4. return false;
  5. }
  6. var p;
  7. for (p in a) {
  8. if (isNamedExport && p === 'default') {
  9. // eslint-disable-next-line no-continue
  10. continue;
  11. }
  12. if (a[p] !== b[p]) {
  13. return false;
  14. }
  15. }
  16. for (p in b) {
  17. if (isNamedExport && p === 'default') {
  18. // eslint-disable-next-line no-continue
  19. continue;
  20. }
  21. if (!a[p]) {
  22. return false;
  23. }
  24. }
  25. return true;
  26. }
  27. module.exports = isEqualLocals;