New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pojo-observer

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pojo-observer - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

21

lib/useObserver.js

@@ -64,4 +64,8 @@ "use strict";

function isPrimitiveField(field) {
return typeof field !== 'object' || field === null;
}
function isWriteablePrimitiveField(object, fieldName) {
return isWritableField(object, fieldName) && (typeof object[fieldName] !== 'object' || object[fieldName] === null);
return isWritableField(object, fieldName) && isPrimitiveField(object[fieldName]);
}

@@ -118,11 +122,8 @@

attachProxyToProperties(value, callback, id);
} // NON WORKING FIX FOR BUGS RELATED TO SETTING AN OBJECT FILED TO NULL OR A PRIMITIVE
}
if (typeof value !== 'object' || value === null) {
throw new Error('pojo-observer: Unsupported operation.'); // how do we handle non object types here?
// ideally we'll just set the value like this:
// object[fieldName] = value // but this causes a stack overflow
// callback()
// return true
if (isPrimitiveField(value)) {
newProxy = value;
callback();
return true;
}

@@ -299,2 +300,2 @@

exports.default = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91c2VPYnNlcnZlci50cyJdLCJuYW1lcyI6WyJFdmVudEVtaXR0ZXIiLCJjYWxsYmFja3MiLCJvbiIsImV2ZW50SWQiLCJzdWJzY3JpcHRpb25JZCIsImNiIiwicHVzaCIsInJlbW92ZSIsImZpbHRlciIsImMiLCJlbWl0IiwiZm9yRWFjaCIsImV2ZW50RW1pdHRlciIsImdldEZpZWxkTmFtZXMiLCJ0b0NoZWNrIiwicHJvcHMiLCJvYmoiLCJjb25jYXQiLCJPYmplY3QiLCJnZXRPd25Qcm9wZXJ0eU5hbWVzIiwiZ2V0UHJvdG90eXBlT2YiLCJzb3J0IiwiZSIsImkiLCJhcnIiLCJpc1dyaXRhYmxlRmll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ZWxkKHZhbHVlKSkge1xuICAgICAgICAgIG5ld1Byb3h5ID0gdmFsdWVcbiAgICAgICAgICBjYWxsYmFjaygpXG4gICAgICAgICAgcmV0dXJuIHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIG5ld1Byb3h5ID0gbmV3IFByb3h5KHZhbHVlLCB7XG4gICAgICAgICAgZ2V0KHRhcmdldCwgcHJvcGVydHkpOiBvYmplY3Qge1xuICAgICAgICAgICAgcmV0dXJuIHRhcmdldFtwcm9wZXJ0eV1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHNldCh0YXJnZXQsIHByb3BlcnR5LCBpbm5lclZhbHVlKTogYm9vbGVhbiB7XG4gICAgICAgICAgICBpZiAocHJvcGVydHkgIT09ICdfX3Byb3RvX18nICYmIHByb3BlcnR5ICE9PSAnbGVuZ3RoJykge1xuICAgICAgICAgICAgICBpZiAodHlwZW9mIGlubmVyVmFsdWUgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgYXR0YWNoUHJveHlUb1Byb3BlcnRpZXMoaW5uZXJWYWx1ZSwgY2FsbGJhY2ssIGlkKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1wYXJhbS1yZWFzc2lnblxuICAgICAgICAgICAgICB0YXJnZXRbcHJvcGVydHldID0gaW5uZXJWYWx1ZVxuICAgICAgICAgICAgICBjYWxsYmFjaygpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZVxuICAgICAgICAgIH0sXG4gICAgICAgIH0pXG4gICAgICAgIHJldHVybiBjYWxsYmFjaygpXG4gICAgICB9LFxuICAgIH0pXG4gIH0gY2F0Y2ggKGUpIHtcbiAgICAvLyBUaGlzIGlmIGRvZXNuJ3Qgc2VlbSB0byBtYWtlIGFueSBkaWZmZXJlbmNlXG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KG9iamVjdCwgZmllbGROYW1lLCB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FjayA9IHVzZVJlYWN0aWZ5KG1vZGVsKVxuICBhdHRhY2hQcm94eVRvUHJvcGVydGllcyhtb2RlbCwgY2FsbGJhY2spXG4gIHJldHVybiBtb2RlbFxufVxuXG5leHBvcnQgZnVuY3Rpb24gcHVyZU9ic2VydmVyPFQgZXh0ZW5kcyBNb2RlbD4obW9kZWw6IFQsIGNhbGxiYWNrOiBGdW5jdGlvbik6IFQge1xuICBkZWNvcmF0ZShtb2RlbClcbiAgYXR0YWNoUHJveHlUb1Byb3BlcnRpZXMobW9kZWwsIGNhbGxiYWNrKVxuICByZXR1cm4gbW9kZWxcbn1cblxuZXhwb3J0IGRlZmF1bHQgdXNlT2JzZXJ2ZXJcbiJdfQ==

@@ -8,3 +8,3 @@ {

],
"version": "1.1.5",
"version": "1.1.6",
"description": "## What? A minimalist object observer that works with React hooks.",

@@ -11,0 +11,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc