lib/script/nej/util.js
function(name,config,plugins){
        var plugin = config.plugin;
        if (!plugin){
            return;
        }
        // check plugin content
        var key = plugin+':'+config.uri;
        if (_io.getFromCache(key)!=null){
            return;
        }
        // update plugin content
        var content = _io.getFromCache(config.uri)||'';
        // check content
        if (typeof content!=='string'&&
            _util.isFunction(content.stringify)){
            content = content.stringify();
        }
        // check plugin precessor
        var func = plugins[plugin];
        if (!!func){
            if (typeof func=='string'){
                func = plugins[func];
            }
            if (_util.isFunction(func)){
                var ret = func({
                    file:config.uri,
                    content:content
                });
                if (ret!=null){
                    content = ret;
                }
            }
        }
        // cache content after process
        _io.cache(key,util.format(
            '%s(%s,%s);',name,
            _path.uri2key(key),content
        ));
    }
function(name,config,plugins){
        var plugin = config.plugin;
        if (!plugin){
            return;
        }
        // check plugin content
        var key = plugin+':'+config.uri;
        if (_io.getFromCache(key)!=null){
            return;
        }
        // update plugin content
        var content = _io.getFromCache(config.uri)||'';
        // check content
        if (typeof content!=='string'&&
            _util.isFunction(content.stringify)){
            content = content.stringify();
        }
        // check plugin precessor
        var func = plugins[plugin];
        if (!!func){
            if (typeof func=='string'){
                func = plugins[func];
            }
            if (_util.isFunction(func)){
                var ret = func({
                    file:config.uri,
                    content:content
                });
                if (ret!=null){
                    content = ret;
                }
            }
        }
        // cache content after process
        _io.cache(key,util.format(
            '%s(%s,%s);',name,
            _path.uri2key(key),content
        ));
    }
function ( name , config , plugins ) { var plugin = config . plugin ; if ( ! plugin ) { return ; } // check plugin content var key = plugin + ':' + config . uri ; if ( _io . getFromCache ( key ) != null ) { return ; } // update plugin content var content = _io . getFromCache ( config . uri ) || '' ; // check content if ( typeof content !== 'string' && _util . isFunction ( content . stringify ) ) { content = content . stringify ( ) ; } // check plugin precessor var func = plugins [ plugin ] ; if ( ! ! func ) { if ( typeof func == 'string' ) { func = plugins [ func ] ; } if ( _util . isFunction ( func ) ) { var ret = func ( { file : config . uri , content : content } ) ; if ( ret != null ) { content = ret ; } } } // cache content after process _io . cache ( key , util . format ( '%s(%s,%s);' , name , _path . uri2key ( key ) , content ) ) ; }
format plugin
format plugin