Socket
Socket
Sign inDemoInstall

multimix

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multimix - npm Package Compare versions

Comparing version 2.1.4 to 2.1.5

lib/tests/main.js

10

lib/experiments/demo.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 2.4.1
// Generated by CoffeeScript 2.5.1
(function() {

@@ -35,3 +35,3 @@ 'use strict';

/* The little dance around the module_keywords variable is to ensure we have callback support when mixins
extend a class. See https://arcturo.github.io/library/coffeescript/03_classes.html */
extend a class. See https://arcturo.github.io/library/coffeescript/03_classes.html */
//---------------------------------------------------------------------------------------------------------

@@ -206,4 +206,4 @@ module_keywords = ['extended', 'included'];

//#########################################################################################################
intertype_1 = new Intertype;
intertype_2 = new Intertype;
intertype_1 = new Intertype();
intertype_2 = new Intertype();
info('µ002-1', Intertype.base_types);

@@ -332,3 +332,3 @@ info('µ002-2', intertype_1.declare('new_on_it1', 'a new hope'));

intertype_1 = new Intertype(target);
intertype_2 = new Intertype;
intertype_2 = new Intertype();
info('µ002-1', Intertype.base_types);

@@ -335,0 +335,0 @@ info('µ002-2', intertype_1.declare('new_on_it1', 'a new hope'));

(function() {
'use strict';
var CND, Multimix, alert, badge, debug, help, info, module_keywords, rpr, urge, warn, whisper,
var CND, Multimix, alert, badge, debug, help, info, isa, module_keywords, rpr, type_of, types, urge, warn, whisper,
indexOf = [].indexOf;

@@ -27,2 +27,6 @@

types = new (require('intertype')).Intertype();
({isa, type_of} = types.export());
//===========================================================================================================

@@ -89,5 +93,5 @@ // MODULE METACLASS provides static methods `@extend()`, `@include()`

R = target != null ? target : {};
ref = this;
for (k in ref) {
v = ref[k];
ref = types.walk_all_keys_of(this);
for (k of ref) {
v = this[k];
if ((v != null ? v.bind : void 0) == null) {

@@ -114,3 +118,3 @@ R[k] = v;

}
if ((Multimix.js_type_of(key)) === 'symbol') {
if (isa.symbol(key)) {
return target[key];

@@ -127,9 +131,6 @@ }

//=========================================================================================================
static js_type_of(x) {
return ((Object.prototype.toString.call(x)).slice(8, -1)).toLowerCase();
}
};
//=========================================================================================================
// @js_type_of = ( x ) -> return ( ( Object::toString.call x ).slice 8, -1 ).toLowerCase()
Multimix.isa_keymethod_proxy = Symbol('proxy');

@@ -136,0 +137,0 @@

@@ -15,3 +15,3 @@ (function() {

badge = 'INTERTYPE/tests/main';
badge = 'MULTIMIX/TESTS/BASICS';

@@ -41,2 +41,47 @@ log = CND.get_logger('plain', badge);

// #===========================================================================================================
// # OBJECT PROPERTY CATALOGUING
// #-----------------------------------------------------------------------------------------------------------
// provide_cataloguing = ->
// @keys_of = ( P... ) -> @values_of @walk_keys_of P...
// @all_keys_of = ( P... ) -> @values_of @walk_all_keys_of P...
// @all_own_keys_of = ( x ) -> if x? then Object.getOwnPropertyNames x else []
// @walk_all_own_keys_of = ( x ) -> yield k for k in @all_own_keys_of x
// #-----------------------------------------------------------------------------------------------------------
// @walk_keys_of = ( x, settings ) ->
// defaults = { skip_undefined: true, }
// settings = if settings? then ( assign {}, settings, defaults ) else defaults
// for k of x
// ### TAINT should use property descriptors to avoid possible side effects ###
// continue if ( x[ k ] is undefined ) and settings.skip_undefined
// yield k
// #-----------------------------------------------------------------------------------------------------------
// @walk_all_keys_of = ( x, settings ) ->
// defaults = { skip_object: true, skip_undefined: true, }
// settings = { defaults..., settings..., }
// return @_walk_all_keys_of x, new Set(), settings
// #-----------------------------------------------------------------------------------------------------------
// @_walk_all_keys_of = ( x, seen, settings ) ->
// if ( not settings.skip_object ) and x is Object::
// yield return
// #.........................................................................................................
// for k from @walk_all_own_keys_of x
// continue if seen.has k
// seen.add k
// ### TAINT should use property descriptors to avoid possible side effects ###
// ### TAINT trying to access `arguments` causes error ###
// try value = x[ k ] catch error then continue
// continue if ( value is undefined ) and settings.skip_undefined
// if settings.symbol?
// continue unless value?
// continue unless value[ settings.symbol ]
// yield [ x, k, ]
// #.........................................................................................................
// if ( proto = Object.getPrototypeOf x )?
// yield from @_walk_all_keys_of proto, seen, settings
// provide_cataloguing.apply C = {}
//-----------------------------------------------------------------------------------------------------------

@@ -49,3 +94,2 @@ this["classes with MultiMix"] = function(T, done) {

method1(x) {
// urge '^33442^', intertype.all_keys_of @
return x + 2;

@@ -65,3 +109,2 @@ }

method1(x) {
// urge '^33442^', intertype.all_keys_of @
return x + 2;

@@ -81,2 +124,46 @@ }

//-----------------------------------------------------------------------------------------------------------
this["multimix.export()"] = function(T, done) {
var A, B, Multimix, a, b, identify_1, identify_2, types;
Multimix = require('../..');
types = new (require('intertype')).Intertype();
//.........................................................................................................
A = class A extends Multimix {
constructor() {
super();
this.name = 'class A';
}
identify_1() {
return this.name;
}
};
//.........................................................................................................
B = class B extends A {
constructor() {
super();
this.name = 'class B';
}
identify_2() {
return this.name;
}
};
//.........................................................................................................
a = new A();
b = new B();
//.........................................................................................................
({identify_1, identify_2} = a.export());
T.eq(identify_1(), 'class A');
T.eq(identify_2, void 0);
//.........................................................................................................
({identify_1, identify_2} = b.export());
T.eq(identify_1(), 'class B');
T.eq(identify_2(), 'class B');
//.........................................................................................................
return done();
};
}).call(this);
{
"name": "multimix",
"version": "2.1.4",
"version": "2.1.5",
"description": "flexible object copying",

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

"build": "coffee --map -o lib -c src",
"push": "git add . && git commit -m'update' && git push",
"pub": "npm run build && npm run push && npm version patch && npm publish",
"test": "npm run build && node lib/tests.js"
"test": "npm run build && node lib/tests/main.js"
},

@@ -34,4 +32,5 @@ "repository": {

"dependencies": {
"cnd": "^5.3.0"
"cnd": "^5.3.0",
"intertype": "^3.1.1"
}
}

Sorry, the diff of this file is not supported yet

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