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

guy

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

guy - npm Package Compare versions

Comparing version 5.0.1 to 5.1.0

57

lib/props.js

@@ -100,6 +100,25 @@ (function() {

//---------------------------------------------------------------------------------------------------------
constructor() {
/* thx to https://stackoverflow.com/a/40714458/7568091 */
var has_target, self;
self = this;
constructor(cfg) {
var R, has_target;
cfg = {
target: this,
...cfg
};
//.......................................................................................................
R = new Proxy(cfg.target, {
//.....................................................................................................
get: (target, key) => {
if (key === Symbol.toStringTag) {
return void 0;
}
if ((R = target[key]) === void 0) {
throw new Error(`^guy.props.Strict_owner@1^ ${this.constructor.name} instance does not have property ${rpr(key)}`);
}
return R;
}
});
// set: ( target, key, value ) =>
// target[key] = value
// return true
//.......................................................................................................
has_target = (key) => {

@@ -109,7 +128,7 @@ if (key === Symbol.toStringTag) {

}
return self[key] !== void 0;
return cfg.target[key] !== void 0;
};
//.......................................................................................................
if (this.has == null) {
hide(this, 'has', new Proxy(has_target, {
if (cfg.target.has == null) {
hide(cfg.target, 'has', new Proxy(has_target, {
get: (_, key) => {

@@ -121,7 +140,7 @@ return has_target(key);

//.......................................................................................................
if (this.get == null) {
hide(this, 'get', (key, fallback = misfit) => {
if (cfg.target.get == null) {
hide(cfg.target, 'get', (key, fallback = misfit) => {
var error;
try {
return self[key];
return cfg.target[key];
} catch (error1) {

@@ -137,15 +156,3 @@ error = error1;

//.......................................................................................................
return new Proxy(this, {
//.....................................................................................................
get: (target, key) => {
var R;
if (key === Symbol.toStringTag) {
return void 0;
}
if ((R = target[key]) === void 0) {
throw new Error(`^guy.props.Strict_owner@1^ ${this.constructor.name} instance does not have property ${rpr(key)}`);
}
return R;
}
});
return R;
}

@@ -155,8 +162,4 @@

// set: ( target, key, value ) =>
// target[key] = value
// return true
}).call(this);
//# sourceMappingURL=props.js.map
{
"name": "guy",
"version": "5.0.1",
"version": "5.1.0",
"description": "npm dependencies checker",

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

@@ -78,2 +78,10 @@

**Note** Most often one will want to define a class that extends `Strict_owner`, however, it is also
possible to pass in an arbitrary object—including a function—as property `target` to the constructor, e.g.
```coffee
f = ( x ) -> x * 2
x = new GUY.props.Strict_owner { target: f, }
```
### `guy.async`: Asynchronous Helpers

@@ -80,0 +88,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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