Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Stable version 1
Browse files Browse the repository at this point in the history
Require for node added
Dead code removed
Checking added
Models/modules updated
  • Loading branch information
Tomek Marchi committed Nov 23, 2015
1 parent 712fef2 commit c8b0764
Show file tree
Hide file tree
Showing 13 changed files with 514 additions and 437 deletions.
2 changes: 1 addition & 1 deletion build/end/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ $.lucy = {
platform: 'stable'
};
//log out the ACID version
console.log(`Lucy v${$.lucy.version}`);
acidConsole(`Lucy v${$.lucy.version} ${$.lucy.platform}`,'notify');
6 changes: 4 additions & 2 deletions build/modules/array/modules/apply.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$.pushApply=function(item,array){
var pushApply=function(item,array){
return _array_push.apply(item,array);
}
};

$.pushApply=pushApply;
27 changes: 4 additions & 23 deletions build/modules/array/modules/equal.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
/**
* Determines if the arrays are equal by doing a shallow comparison of their elements using strict equality.
*
* __Note:__ The order of elements in the arrays __does__ matter. The elements must be found in the same order
* for the arrays to be considered equal.
*
* @function Array#equals
* @param {Array} array - An array to compare for equality.
* @returns {boolean} `true` if the arrays are equal, `false` otherwise.
*
* @example
* var array = [1, 2, 3];
*
* array.equals(array);
* // -> true
*
* array.equals([1, 2, 3]);
* // -> true
*
* array.equals([3, 2, 1]);
* // -> false
*/
/*
Determines if the arrays are equal by doing a shallow comparison of their elements using strict equality.
*/
$.isEqualArray = function(item,array) {
if (array === item) {
return true;
Expand All @@ -36,4 +17,4 @@
}

return true;
};
};
30 changes: 18 additions & 12 deletions build/modules/native/is.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,28 @@ $.isRegex = isRegex;
$.isArgs = isArgs;
$.isBool = isBool;
$.isDate = isDate;
$.isError =isError;
$.isError = isError;
$.isMap = isMap;
$.isSet = isSet;
$.isWeakMap =isWeakMap;
$.isSet = isSet;
$.isWeakMap = isWeakMap;
$.isFloat32 = isFloat32;
$.isFloat64 = isFloat64;
$.isInt8 = isInt8;
$.isInt16 = isInt16;
$.isFloat64 = isFloat64;
$.isInt8 = isInt8;
$.isInt16 = isInt16;
$.isInt32 = isInt32;
$.isUnit8 = isUnit8;
$.isUnit8clamped = isUnit8clamped;
$.isUnit16 =isUnit16;
$.isUnit32 =isUnit32;
$.isNative =isNative;
$.isUnit16 = isUnit16;
$.isUnit32 = isUnit32;
$.isNative = isNative;
$.isUndefined = isUndefined;
$.isNaN = _isNaN;
$.isNaN = _isNaN;
$.isInt = _isInt;
$.isNull = isNull;
$.isEmpty = isEmpty;
$.isNull = isNull;
$.isEmpty = isEmpty;
$.isFileCSS = isFileCSS;
$.isFileJSON = isFileJSON;
$.isFileJS = isFileJS;
$.hasDot = hasDot;
$.getModelProperty = getModelProperty;
$.getModelRootName = getModelRootName;
94 changes: 72 additions & 22 deletions build/modules/native/model.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,75 @@
var _model= (() => {
//get model -> (bool) option for a lean model meaning no methods will be attached
var model_function = (modelName, object, bool) => {
if (hasValue(object)) {
var model = _model[modelName] = object;
if(_isFunction(model)){
model=model.bind(model);
}else if(isPlainObject(model)){
_each_object(model,(item,key) => {
if(_isFunction(item)){
model[key]=item.bind(model);
}
});
var _model = (() => {
//get model -> (bool) option for a lean model meaning no methods will be attached
var model_function = (modelName, object, bool) => {
if (hasValue(object)) {
var model = _model[modelName] = object;
if (_isFunction(model)) {
model = model.bind(model);
} else if (isPlainObject(model)) {
_each_object(model, (item, key) => {
if (_isFunction(item)) {
model[key] = item.bind(model);
}
});
}
model.modelName = modelName;
return model;
} else if (_has(modelName, '.')) {
return _find(modelName, _model);
}
return _model[modelName];
};
return model_function;
})(),
buildArgumentsMethod = (item) => {
if (_isString(item)) {
item = _find(item, $);
}
return item;
},
requireAvailable=false,
importScriptsAvailable=false,
requireMethod =(()=>{
if(_global){
if(_global.require && !_global.importScripts){
return _global.require;
}else if(_global.importScripts){
return _global.importScripts;
}
}else if(require){
return require;
}
})(),
buildArgumentsRequireMethod = (item) => {
if (_isString(item)) {
item = requireMethod(item);
}
return item;
},
define = (data) => {
var funct = data.invoke,
modelName = data.name,
argsRequire = data.require,
args = _each_array(data.import, buildArgumentsMethod),
wrapFunct = function() {
var freshArgs;
if (arguments.length > 0) {
freshArgs = _toArray(args);
pushApply(freshArgs, arguments);
} else {
freshArgs = args;
}
model.modelName=modelName;
return model;
}else if (_has(modelName, '.')) {
return _find(modelName, _model);
}
return _model[modelName];
};
return model_function;
})();
return funct.apply(wrapFunct, freshArgs);
}.bind(wrapFunct);
if (modelName) {
_model[modelName] = wrapFunct;
}
if (argsRequire) {
pushApply(args, _each_array(argsRequire, buildArgumentsRequireMethod));
}

return wrapFunct;
};

$.model = _model;
$.define = define;
Loading

0 comments on commit c8b0764

Please sign in to comment.