
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Base 是一个基础类,提供 Class、Events、Attribute 和 Aspect 支持。
Base.extend(properties)
基于 Base 创建子类。例子:
/* pig.js */
define(function(require, exports, module) {
var Base = require('base');
var Pig = Base.extend({
attrs: {
name: ''
},
talk: function() {
alert('我是' + this.get('name'));
}
});
module.exports = Pig;
});
继承 Base 可覆盖 initialize 构造函数, 但需要调用父类构造函数,如 arale 的 widget 定义了组件的生命周期
/* widget.js */
define(function(require, exports, module) {
var Base = require('base');
var Widget = Base.extend({
initialize: function(config) {
Widget.superclass.initialize.call(this, config);
this.parseElement()
this.initProps()
this.delegateEvents()
this.setup()
},
...
});
module.exports = Widget;
});
Base 继承和混入了一下功能,可查看文档 :
Base 是使用 Class
创建的一个基础类,默认混入了 Events
、Attribute
、Aspect
模块:
/* base.js */
define(function(require) {
var Class = require('class');
var Events = require('events');
var Aspect = require('./aspect');
var Attribute = require('./attribute');
var Base = Class.create({
Implements: [Events, Aspect, Attribute],
initialize: function(config) {
...
},
...
});
...
});
1.2.0
improved
升级到 spm@3.x 规范。
FAQs
Base 是一个基础类,提供 Class、Events、Attribute 和 Aspect 支持。
The npm package arale-base receives a total of 1 weekly downloads. As such, arale-base popularity was classified as not popular.
We found that arale-base demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.