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

angular-es-utils

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-es-utils - npm Package Compare versions

Comparing version 1.2.33 to 1.2.34

16

decorators/Inject.js

@@ -44,9 +44,9 @@ 'use strict';

/* ----------------- 以下这一段恶心的代码都是为了兼容function跟class定义controller这两种情况 ------------------------ */
/* ----------------- 因为class定义的Constructor有时候需要直接访问this中以绑定的数据(fn.apply(instance, locals)) ------------------------ */
/* ----------------- 因为class定义的Constructor有时候需要直接访问this中已绑定的数据(fn.apply(instance, locals)) ---- */
// 存在通过 fn.apply(instance, locals) 的方式调用的情况,所以这里直接将依赖的服务拷贝到this里(服务已下划线作为前缀)
// 存在通过 fn.apply(instance, locals) 的方式调用的情况,所以这里直接将依赖的服务拷贝到this里(服务以下划线作为前缀)
dependencies.forEach(function (dependency, i) {
return _this['_' + dependency] = args[i];
});
// 将构造器初始化时就需要访问的数据挂载到prototype上,这样即使通过new方式实例化也能在constructor里的this也具备完整信息
// 将构造器初始化时就需要访问的数据挂载到prototype上,这样即使通过new方式实例化,constructor里的this也具备完整信息
Object.assign(OriginalConstructor.prototype, this);

@@ -62,7 +62,11 @@

}
// 属性可能会被重新定义,比如 this.name = this.name + 'xx';
// 所以这里不能直接Object.assign(instance, this)
// 只有this上存在但是instance上不存在的属性才复制过去
if (!instance.hasOwnProperty(prop)) {
instance[prop] = _this[prop];
}
});
// 将this上的信息绑定到实例上
Object.assign(instance, this);
return instance;

@@ -69,0 +73,0 @@ };

{
"name": "angular-es-utils",
"version": "1.2.33",
"version": "1.2.34",
"description": "es utils design for angular1.x",

@@ -5,0 +5,0 @@ "main": "./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