gulp-html-partial.js
function getPartial(attributes) {
        const splitAttr = partition(attributes, (attribute) => attribute.key === 'src');
        const sourcePath = splitAttr[0][0] && splitAttr[0][0].value;
        let file;

        if (sourcePath && fs.existsSync(options.basePath + sourcePath)) {
            file = injectHTML(fs.readFileSync(options.basePath + sourcePath))
        } else if (!sourcePath) {
            gutil.log(`${pluginName}:`, new gutil.PluginError(pluginName, gutil.colors.red(`Some partial does not have 'src' attribute`)).message);
        } else {
            gutil.log(`${pluginName}:`, new gutil.PluginError(pluginName, gutil.colors.red(`File ${options.basePath + sourcePath} does not exist.`)).message);
        }

        return replaceAttributes(file, splitAttr[1]);
    }
function getPartial(attributes) {
        const splitAttr = partition(attributes, (attribute) => attribute.key === 'src');
        const sourcePath = splitAttr[0][0] && splitAttr[0][0].value;
        let file;

        if (sourcePath && fs.existsSync(options.basePath + sourcePath)) {
            file = injectHTML(fs.readFileSync(options.basePath + sourcePath))
        } else if (!sourcePath) {
            gutil.log(`${pluginName}:`, new gutil.PluginError(pluginName, gutil.colors.red(`Some partial does not have 'src' attribute`)).message);
        } else {
            gutil.log(`${pluginName}:`, new gutil.PluginError(pluginName, gutil.colors.red(`File ${options.basePath + sourcePath} does not exist.`)).message);
        }

        return replaceAttributes(file, splitAttr[1]);
    }
function getPartial ( attributes ) { const splitAttr = partition ( attributes , ( attribute ) => attribute . key === 'src' ) ; const sourcePath = splitAttr [ 0 ] [ 0 ] && splitAttr [ 0 ] [ 0 ] . value ; let file ; if ( sourcePath && fs . existsSync ( options . basePath + sourcePath ) ) { file = injectHTML ( fs . readFileSync ( options . basePath + sourcePath ) ) } else if ( ! sourcePath ) { gutil . log ( ` ${ pluginName } ` , new gutil . PluginError ( pluginName , gutil . colors . red ( ` ` ) ) . message ) ; } else { gutil . log ( ` ${ pluginName } ` , new gutil . PluginError ( pluginName , gutil . colors . red ( ` ${ options . basePath + sourcePath } ` ) ) . message ) ; } return replaceAttributes ( file , splitAttr [ 1 ] ) ; }
Gets file using node.js' file system based on src attribute

@param {Array.<Object>} attributes - tag
@returns {String}
Gets file using node . js file system based on src attribute