mirror of
https://github.com/KevinMidboe/inline-html.git
synced 2025-10-29 17:40:29 +00:00
Replace lodash with ramda.
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
var _ = require('lodash');
|
||||
var co = require('co');
|
||||
var cheerio = require('cheerio');
|
||||
var fs = require('mz/fs');
|
||||
var isLocalPath = require('is-local-path');
|
||||
var less = require('less');
|
||||
var path = require('path');
|
||||
var R = require('ramda');
|
||||
var Ru = require('@panosoft/ramda-utils');
|
||||
var url = require('url');
|
||||
|
||||
var render = co.wrap(function * (filename, options) {
|
||||
options = _.assign(options || {}, {
|
||||
options = R.merge(options || {}, {
|
||||
filename: filename
|
||||
});
|
||||
var contents = yield fs.readFile(filename, 'utf8');
|
||||
@@ -23,9 +24,9 @@ var render = co.wrap(function * (filename, options) {
|
||||
var inline = co.wrap(function * (html, filename, options) {
|
||||
var files = [];
|
||||
var basedir = path.dirname(filename);
|
||||
options = _.defaults(options || {}, {
|
||||
options = Ru.defaults({
|
||||
relativeUrls: true
|
||||
});
|
||||
}, options || {});
|
||||
|
||||
// TODO Import less links
|
||||
// get links
|
||||
@@ -52,9 +53,9 @@ var inline = co.wrap(function * (html, filename, options) {
|
||||
});
|
||||
|
||||
// create list of imported files from all outputs, unique listing
|
||||
files.push(_.map(outputs, function (output) {
|
||||
files.push(R.map(function (output) {
|
||||
return output.imports;
|
||||
}));
|
||||
}, outputs));
|
||||
|
||||
return {
|
||||
html: $.xml(),
|
||||
|
||||
Reference in New Issue
Block a user