angular-tpl2js
Advanced tools
Comparing version 0.0.7 to 0.0.8
44
index.js
@@ -20,7 +20,7 @@ var async = require('async'); | ||
var obj3 = {}; | ||
for (var attrname in obj1) { | ||
obj3[attrname] = obj1[attrname]; | ||
for (var a1 in obj1) { | ||
obj3[a1] = obj1[a1]; | ||
} | ||
for (var attrname in obj2) { | ||
obj3[attrname] = obj2[attrname]; | ||
for (var a2 in obj2) { | ||
obj3[a2] = obj2[a2]; | ||
} | ||
@@ -139,7 +139,2 @@ return obj3; | ||
// TODO - pathing madness | ||
// TODO - refine templateUrl regex check | ||
// TODO - identify failure points and return errors | ||
// TODO - recurse deeply nested ng-include templates | ||
function TemplateManager() { | ||
@@ -154,3 +149,3 @@ | ||
// shift optional config argument | ||
if(arguments.length === 2 && Object.prototype.toString.call(arguments[1]) == '[object Function]') { | ||
if (arguments.length === 2 && Object.prototype.toString.call(arguments[1]) === '[object Function]') { | ||
done = config; | ||
@@ -161,9 +156,6 @@ } else { | ||
// more robust gulp check mayhaps? | ||
if (typeof input === 'object') { | ||
var base, css; | ||
var base = '/' + path.dirname(path.relative(__dirname, config.target)); | ||
var source = engine.source.hash(input.toString(), base); | ||
engine.templates.get(source).then(function (transformed) { | ||
function run(css) { | ||
engine.templates.get(css).then(function (transformed) { | ||
engine.templates.set(transformed).then(function (output) { | ||
@@ -175,15 +167,13 @@ done(null, output); // -- out | ||
}); | ||
} | ||
if (input instanceof Buffer) { | ||
base = '/' + path.dirname(path.relative(__dirname, config.target)); | ||
css = engine.source.hash(input.toString(), base); | ||
run(css); | ||
} else { | ||
engine.source.read(input).then(function (data) { | ||
var base = path.dirname(input); | ||
var source = engine.source.hash(data, base); | ||
engine.templates.get(source).then(function (transformed) { | ||
engine.templates.set(transformed).then(function (output) { | ||
done(null, output); // -- out | ||
}); | ||
}, function (error) { | ||
done(error); | ||
}); | ||
base = path.dirname(input); | ||
css = engine.source.hash(data, base); | ||
run(css); | ||
}); | ||
@@ -190,0 +180,0 @@ } |
{ | ||
"name": "angular-tpl2js", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Convert Angular templates to inline JavaScript", | ||
@@ -21,3 +21,4 @@ "files": [ | ||
"gulp-util": "^3.0.7", | ||
"mocha": "^2.4.5" | ||
"mocha": "^2.4.5", | ||
"vinyl": "^1.1.1" | ||
}, | ||
@@ -24,0 +25,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9223
8
139