Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cocktail

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cocktail - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

59

lib/cocktail.js
/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -198,6 +198,14 @@ */

* @private
* returns true if the given subject has a pseudo annotation `@as` with the given value.
*/
_isSubjectDefinedAs: function (subject, asType) {
return (subject && subject['@as'] && subject['@as'].toLowerCase() === asType);
},
/**
* @private
* returns true if the given subject is a class definition object.
*/
_isClassDefition: function (subject) {
var isClassDef = (subject && subject['@as'] && subject['@as'].toLowerCase() === 'class'),
var isClassDef = this._isSubjectDefinedAs(subject, 'class'),
definitionProps = ['constructor', '@extends', '@traits', '@requires', '@annotation'],

@@ -215,3 +223,2 @@ key;

return isClassDef;

@@ -222,2 +229,10 @@ },

* @private
* returns true if the given subject is a module definition object.
*/
_isModuleDefinition: function (subject) {
return this._isSubjectDefinedAs(subject, 'module');
},
/**
* @private
* If the subject has a property construtor returns it,

@@ -273,3 +288,12 @@ * if no constructor on subject but it extends then return a function() calling super constructor,

return this.mix(defaultConstructor, options);
},
/**
* @private
* @experimental 0.5.1
* returns a call to mix() with the subject module and options
*/
_processModuleDefinition: function (subject) {
var options = subject;
return this.mix(subject, options);
},

@@ -281,5 +305,10 @@

mix: function(subject, options){
if(!options && this._isClassDefition(subject)) {
return this._processClassDefition(subject);
}
if(!options){
if (this._isClassDefition(subject)) {
return this._processClassDefition(subject);
}
if (this._isModuleDefinition(subject)) {
return this._processModuleDefinition(subject);
}
}

@@ -299,3 +328,3 @@ if(subject){

//export module
module.exports = cocktail;

@@ -309,3 +338,3 @@

'no-op' : require('./processor/NoOp'),
'@as' : undefined,
'@as' : undefined, /*pseudo-processor*/
'@merge' : require('./processor/annotation/Merge'),

@@ -322,11 +351,9 @@ '@extends' : require('./processor/annotation/Extends'),

//register processors
cocktail.registerProcessors(cocktail._DEFAULT_PROCESSORS);
cocktail.mix(cocktail, {
/**
* @public
* SEQUENCE is used to define a enumeration of priorities for annotations
*/
SEQUENCE: sequence
});
/**
* @public
* SEQUENCE is used to define an enumeration of priorities for annotations
*/
cocktail.SEQUENCE = sequence;
/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -5,0 +5,0 @@ */

/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -34,3 +34,2 @@ */

}
}

@@ -37,0 +36,0 @@ };

/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -5,0 +5,0 @@ */

/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -5,0 +5,0 @@ */

/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -5,0 +5,0 @@ */

/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -5,0 +5,0 @@ */

/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -5,0 +5,0 @@ */

/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -5,0 +5,0 @@ */

/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -5,0 +5,0 @@ */

/*
*
* Copyright (c) 2013 Maximiliano Fierro
* Copyright (c) 2013 - 2014 Maximiliano Fierro
* Licensed under the MIT license.

@@ -5,0 +5,0 @@ */

{
"name": "cocktail",
"description": "CocktailJS is a small library to explore traits, talents, inheritance and annotations concepts in nodejs - Shake your objects and classes with Cocktail!",
"version": "0.5.0",
"version": "0.5.1",
"homepage": "http://cocktailjs.github.io",

@@ -31,12 +31,12 @@ "author": {

"devDependencies": {
"grunt-simple-mocha": "~0.4.0",
"chai": "1.4.2",
"mocha": "1.8.1",
"grunt-mocha": "0.2.1",
"grunt-contrib-jshint": "~0.7.2",
"grunt-contrib-watch": "~0.2.0",
"grunt": "~0.4.1",
"sinon-chai": "~2.3.1",
"sinon": "~1.6.0",
"proxyquire": "~0.4.0"
"grunt-simple-mocha": "~0.4",
"chai": "1.9.1",
"mocha": "1.18.2",
"grunt-mocha": "0.4.10",
"grunt-contrib-jshint": "~0.10",
"grunt-contrib-watch": "~0.6",
"grunt": "~0.4",
"sinon-chai": "~2.5",
"sinon": "~1.9",
"grunt-cli": "~0.1.13"
},

@@ -43,0 +43,0 @@ "keywords": [

@@ -116,3 +116,3 @@ # Cocktail JS

## License
Copyright (c) 2013 Maximiliano Fierro
Copyright (c) 2013 - 2014 Maximiliano Fierro
Licensed under the MIT license.

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