This commit is contained in:
s2
2019-04-18 15:10:03 +02:00
parent 018ccb7e08
commit 883bc2fc85
11 changed files with 121 additions and 79 deletions

View File

@@ -14,12 +14,6 @@
//if the template is already cached, return it and we are done
if (templateFn) {
//but first check if there is still a getter function for this template in the cache
//if yes, remove it so we clean up a bit
if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) {
ejs.cache.remove('getFnFor' + templateUrl);
}
return templateFn(data);
} else { //if the template is not cached, we need to get it and render it later once we have it. remember: this happens only if the template is not already cached
@@ -41,6 +35,11 @@
filename: templateUrl
}
));
//clean up the getFnFor
if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) {
ejs.cache.remove('getFnFor' + templateUrl);
}
});
return '<span class="ejs-templateplaceholder" style="display: none;" id="' + r + '"></span>';

View File

@@ -1,27 +1,28 @@
{
"_from": "ejs-render-remote@^1.0.3",
"_id": "ejs-render-remote@1.0.3",
"_from": "ejs-render-remote@1.0.4",
"_id": "ejs-render-remote@1.0.4",
"_inBundle": false,
"_integrity": "sha512-5Tj0RGLQvBlpZdT1y1F/k7S4ayv9/WkljL/T2PiTJSh5NT4mgm2G+kPXYorfZyb4pomMqDc1vSo+VbLaaLHACg==",
"_integrity": "sha512-3DvdLYDVIIM7qNBUAIfxJjkhmfq8vg36Cqh0nQSqEz17DEaPELLjxYTjfFOYgvirUN4o+Fla2ulBsEnK+5MnTg==",
"_location": "/ejs-render-remote",
"_phantomChildren": {},
"_requested": {
"type": "range",
"type": "version",
"registry": true,
"raw": "ejs-render-remote@^1.0.3",
"raw": "ejs-render-remote@1.0.4",
"name": "ejs-render-remote",
"escapedName": "ejs-render-remote",
"rawSpec": "^1.0.3",
"rawSpec": "1.0.4",
"saveSpec": null,
"fetchSpec": "^1.0.3"
"fetchSpec": "1.0.4"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/ejs-render-remote/-/ejs-render-remote-1.0.3.tgz",
"_shasum": "425ae3451c557bfddf4fcc7e790545338068a865",
"_spec": "ejs-render-remote@^1.0.3",
"_where": "F:\\projects\\vanillajs-seed",
"_resolved": "https://registry.npmjs.org/ejs-render-remote/-/ejs-render-remote-1.0.4.tgz",
"_shasum": "68556c9ebceb5bb4b5a74fb06a20cd3e4a834890",
"_spec": "ejs-render-remote@1.0.4",
"_where": "F:\\projects\\p\\vanillajs-seed",
"author": {
"name": "s2",
"email": "s2@31337.it"
@@ -41,5 +42,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "1.0.3"
"version": "1.0.4"
}