Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.

Commit 5247c53

Browse files
committed
allow shrink variables minification in by specify di params manually in
array (like in angular) for moduleDom
1 parent 5962923 commit 5247c53

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

js.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
$js - asynchronous module definition framework
33
or just simple lightweight javascript dependencies manager
44
5-
@version 3.0
5+
@version 3.1
66
@link http://github.com/redcatphp/js/
77
@author Jo Surikat <jo@surikat.pro>
88
@website http://redcatphp.com
@@ -509,9 +509,24 @@
509509
}
510510
}
511511
var loadModuleDomElement = function(){
512-
var func = $js.module(module);
513-
var params = paramsReflection(func);
514-
var apply = [];
512+
var
513+
func = $js.module(module),
514+
apply = [],
515+
params
516+
;
517+
if(func instanceof Array){
518+
var tmpParams = func;
519+
func = tmpParams.pop();
520+
params = {};
521+
for(var k in tmpParams){
522+
if(tmpParams.hasOwnProperty(k)){
523+
params[tmpParams[k]] = null;
524+
}
525+
}
526+
}
527+
else{
528+
params = paramsReflection(func);
529+
}
515530
for(var k in params){
516531
if(params.hasOwnProperty(k)){
517532
if(k=='$di'){

0 commit comments

Comments
 (0)