Comparing version 0.1.8 to 0.1.9
@@ -7,3 +7,3 @@ 'use strict'; | ||
var util = require('util'); | ||
var path = require('path'); | ||
var path = _interopDefault(require('path')); | ||
var escape = _interopDefault(require('lodash.escape')); | ||
@@ -99,3 +99,3 @@ var unescape = _interopDefault(require('lodash.unescape')); | ||
const createFromFileSystem = filename => { | ||
return read(path.path.resolve(filename)).then(content => compile(content)); | ||
return read(path.resolve(filename)).then(content => compile(content)); | ||
}; | ||
@@ -129,3 +129,3 @@ | ||
const createLayoutFromFilePath = () => { | ||
return read(path.path.resolve(filePath)).then(layoutContents => compileTemplate(layoutContents)); | ||
return read(path.resolve(filePath)).then(layoutContents => compileTemplate(layoutContents)); | ||
}; | ||
@@ -167,3 +167,4 @@ | ||
.then(([Layout, executeTemplate]) => { | ||
let localsKeys = Object.keys(templateParameters); | ||
try { | ||
let localsKeys = Object.keys(templateParameters); | ||
let localsValues = localsKeys.map(i => escapeWrapper(templateParameters[i])); | ||
@@ -182,2 +183,6 @@ | ||
callback(null, value); | ||
} catch (error) { | ||
} | ||
}) | ||
@@ -184,0 +189,0 @@ .catch(callback); |
{ | ||
"name": "backticks", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Express engine creator for the basic use of ES6 template literals (backticks) for templating", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import { readFile } from "fs"; | ||
import { promisify } from "util"; | ||
import { path } from "path"; | ||
import path from "path"; | ||
import html from "./htmlTemplate"; | ||
@@ -87,3 +87,4 @@ import { createEscapeWrapper } from "./utils"; | ||
.then(([Layout, executeTemplate]) => { | ||
let localsKeys = Object.keys(templateParameters); | ||
try { | ||
let localsKeys = Object.keys(templateParameters); | ||
let localsValues = localsKeys.map(i => escapeWrapper(templateParameters[i])); | ||
@@ -102,2 +103,6 @@ | ||
callback(null, value); | ||
} catch (error) { | ||
} | ||
}) | ||
@@ -104,0 +109,0 @@ .catch(callback); |
23738
582