Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nguniversal/common

Package Overview
Dependencies
Maintainers
3
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nguniversal/common - npm Package Compare versions

Comparing version 11.0.0-next.1 to 11.0.0-next.2

esm2015/engine/src/utils.js

69

bundles/common-engine.umd.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('fs'), require('@angular/compiler'), require('@angular/core'), require('@angular/platform-server')) :
typeof define === 'function' && define.amd ? define('@nguniversal/common/engine', ['exports', 'fs', '@angular/compiler', '@angular/core', '@angular/platform-server'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.nguniversal = global.nguniversal || {}, global.nguniversal.common = global.nguniversal.common || {}, global.nguniversal.common.engine = {}), global.fs, global.ng.compiler, global.ng.core, global.ng.platformServer));
}(this, (function (exports, fs, compiler, core, platformServer) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('fs'), require('util'), require('@angular/compiler'), require('@angular/core'), require('@angular/platform-server')) :
typeof define === 'function' && define.amd ? define('@nguniversal/common/engine', ['exports', 'fs', 'util', '@angular/compiler', '@angular/core', '@angular/platform-server'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.nguniversal = global.nguniversal || {}, global.nguniversal.common = global.nguniversal.common || {}, global.nguniversal.common.engine = {}), global.fs, global.util, global.ng.compiler, global.ng.core, global.ng.platformServer));
}(this, (function (exports, fs, util, compiler, core, platformServer) { 'use strict';
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var readFile = util.promisify(fs.readFile);
/** ResourceLoader implementation for loading files */

@@ -12,10 +21,3 @@ var FileLoader = /** @class */ (function () {

FileLoader.prototype.get = function (url) {
return new Promise(function (resolve, reject) {
fs.readFile(url, function (err, data) {
if (err) {
return reject(err);
}
resolve(data.toString());
});
});
return readFile(url, 'utf-8');
};

@@ -337,3 +339,3 @@ return FileLoader;

this.factoryCacheMap = new Map();
this.templateCache = {};
this.templateCache = new Map();
}

@@ -353,13 +355,18 @@ /** Return an instance of the platformServer compiler */

return __awaiter(this, void 0, void 0, function () {
var doc, _a, extraProviders, moduleOrFactory, factory;
return __generator(this, function (_b) {
switch (_b.label) {
var doc, _a, _b, extraProviders, moduleOrFactory, factory;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = opts.document;
if (_a) return [3 /*break*/, 2];
if (_a) return [3 /*break*/, 3];
_b = opts.documentFilePath;
if (!_b) return [3 /*break*/, 2];
return [4 /*yield*/, this.getDocument(opts.documentFilePath)];
case 1:
_a = (_b.sent());
_b.label = 2;
_b = (_c.sent());
_c.label = 2;
case 2:
_a = _b;
_c.label = 3;
case 3:
doc = _a;

@@ -377,4 +384,4 @@ extraProviders = __spread((opts.providers || []), (this.providers || []), [

return [4 /*yield*/, this.getFactory(moduleOrFactory)];
case 3:
factory = _b.sent();
case 4:
factory = _c.sent();
return [2 /*return*/, platformServer.renderModuleFactory(factory, { extraProviders: extraProviders })];

@@ -411,6 +418,18 @@ }

CommonEngine.prototype.getDocument = function (filePath) {
var doc = this.templateCache[filePath] = this.templateCache[filePath] ||
fs.readFileSync(filePath).toString();
// As promise so we can change the API later without breaking
return Promise.resolve(doc);
return __awaiter(this, void 0, void 0, function () {
var doc;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
doc = this.templateCache.get(filePath);
if (!!doc) return [3 /*break*/, 2];
return [4 /*yield*/, readFile(filePath, 'utf-8')];
case 1:
doc = _a.sent();
this.templateCache.set(filePath, doc);
_a.label = 2;
case 2: return [2 /*return*/, doc];
}
});
});
};

@@ -417,0 +436,0 @@ return CommonEngine;

@@ -1,16 +0,2 @@

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("fs"),require("@angular/compiler"),require("@angular/core"),require("@angular/platform-server")):"function"==typeof define&&define.amd?define("@nguniversal/common/engine",["exports","fs","@angular/compiler","@angular/core","@angular/platform-server"],r):r(((e="undefined"!=typeof globalThis?globalThis:e||self).nguniversal=e.nguniversal||{},e.nguniversal.common=e.nguniversal.common||{},e.nguniversal.common.engine={}),e.fs,e.ng.compiler,e.ng.core,e.ng.platformServer)}(this,(function(e,r,t,n,o){"use strict";var i=function(){function e(){}return e.prototype.get=function(e){return new Promise((function(t,n){r.readFile(e,(function(e,r){if(e)return n(e);t(r.toString())}))}))},e}();
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function a(e,r,t,n){return new(t||(t=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):function r(e){return e instanceof t?e:new t((function(r){r(e)}))}(e.value).then(a,u)}c((n=n.apply(e,r||[])).next())}))}function u(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function c(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function c(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,o,i=t.call(e),a=[];try{for(;(void 0===r||r-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}var l=function(){function e(e,r){void 0===r&&(r=[]),this.moduleOrFactory=e,this.providers=r,this.factoryCacheMap=new Map,this.templateCache={}}return e.prototype.getCompiler=function(){return o.platformDynamicServer().injector.get(n.CompilerFactory).createCompiler([{providers:[{provide:t.ResourceLoader,useClass:i,deps:[]}]}])},e.prototype.render=function(e){return a(this,void 0,void 0,(function(){var r,t,n;return u(this,(function(i){switch(i.label){case 0:return(r=e.document)?[3,2]:[4,this.getDocument(e.documentFilePath)];case 1:r=i.sent(),i.label=2;case 2:return t=function a(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(c(arguments[r]));return e}(e.providers||[],this.providers||[],[{provide:o.INITIAL_CONFIG,useValue:{document:r,url:e.url}}]),[4,this.getFactory(this.moduleOrFactory||e.bootstrap)];case 3:return n=i.sent(),[2,o.renderModuleFactory(n,{extraProviders:t})]}}))}))},e.prototype.getFactory=function(e){return a(this,void 0,void 0,(function(){var r,t;return u(this,(function(o){switch(o.label){case 0:return e instanceof n.NgModuleFactory?[2,e]:[3,1];case 1:return(r=this.factoryCacheMap.get(e))?[2,r]:[4,this.getCompiler().compileModuleAsync(e)];case 2:return t=o.sent(),this.factoryCacheMap.set(e,t),[2,t]}}))}))},e.prototype.getDocument=function(e){var t=this.templateCache[e]=this.templateCache[e]||r.readFileSync(e).toString();return Promise.resolve(t)},e}();
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("fs"),require("util"),require("@angular/compiler"),require("@angular/core"),require("@angular/platform-server")):"function"==typeof define&&define.amd?define("@nguniversal/common/engine",["exports","fs","util","@angular/compiler","@angular/core","@angular/platform-server"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).nguniversal=e.nguniversal||{},e.nguniversal.common=e.nguniversal.common||{},e.nguniversal.common.engine={}),e.fs,e.util,e.ng.compiler,e.ng.core,e.ng.platformServer)}(this,(function(e,t,r,n,o,i){"use strict";
/**

@@ -22,2 +8,9 @@ * @license

* found in the LICENSE file at https://angular.io/license
*/var a=r.promisify(t.readFile),u=function(){function e(){}return e.prototype.get=function(e){return a(e,"utf-8")},e}();function c(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):function t(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,u)}c((n=n.apply(e,t||[])).next())}))}function l(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function c(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}var f=function(){function e(e,t){void 0===t&&(t=[]),this.moduleOrFactory=e,this.providers=t,this.factoryCacheMap=new Map,this.templateCache=new Map}return e.prototype.getCompiler=function(){return i.platformDynamicServer().injector.get(o.CompilerFactory).createCompiler([{providers:[{provide:n.ResourceLoader,useClass:u,deps:[]}]}])},e.prototype.render=function(e){return c(this,void 0,void 0,(function(){var t,r,n,o;return l(this,(function(a){switch(a.label){case 0:return(t=e.document)?[3,3]:(r=e.documentFilePath)?[4,this.getDocument(e.documentFilePath)]:[3,2];case 1:r=a.sent(),a.label=2;case 2:t=r,a.label=3;case 3:return n=function u(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}(e.providers||[],this.providers||[],[{provide:i.INITIAL_CONFIG,useValue:{document:t,url:e.url}}]),[4,this.getFactory(this.moduleOrFactory||e.bootstrap)];case 4:return o=a.sent(),[2,i.renderModuleFactory(o,{extraProviders:n})]}}))}))},e.prototype.getFactory=function(e){return c(this,void 0,void 0,(function(){var t,r;return l(this,(function(n){switch(n.label){case 0:return e instanceof o.NgModuleFactory?[2,e]:[3,1];case 1:return(t=this.factoryCacheMap.get(e))?[2,t]:[4,this.getCompiler().compileModuleAsync(e)];case 2:return r=n.sent(),this.factoryCacheMap.set(e,r),[2,r]}}))}))},e.prototype.getDocument=function(e){return c(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return(t=this.templateCache.get(e))?[3,2]:[4,a(e,"utf-8")];case 1:t=r.sent(),this.templateCache.set(e,t),r.label=2;case 2:return[2,t]}}))}))},e}();
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

@@ -44,2 +37,2 @@ /**

* found in the LICENSE file at https://angular.io/license
*/e.ɵCommonEngine=l,e.ɵFileLoader=i,Object.defineProperty(e,"__esModule",{value:!0})}));
*/e.ɵCommonEngine=f,e.ɵFileLoader=u,Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -426,2 +426,6 @@ (function (global, factory) {

return function () { return new Promise(function (resolve, _reject) {
if (doc.readyState === 'complete' || doc.readyState === 'interactive') {
resolve();
return;
}
var contentLoaded = function () {

@@ -431,8 +435,3 @@ doc.removeEventListener('DOMContentLoaded', contentLoaded);

};
if (doc.readyState === 'complete' || doc.readyState === 'interactive') {
resolve();
}
else {
doc.addEventListener('DOMContentLoaded', contentLoaded);
}
doc.addEventListener('DOMContentLoaded', contentLoaded);
}); };

@@ -439,0 +438,0 @@ }

@@ -23,3 +23,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common/http"),require("@angular/core"),require("@angular/platform-browser"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("@nguniversal/common",["exports","@angular/common/http","@angular/core","@angular/platform-browser","rxjs","rxjs/operators","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).nguniversal=e.nguniversal||{},e.nguniversal.common={}),e.ng.common.http,e.ng.core,e.ng.platformBrowser,e.rxjs,e.rxjs.operators,e.ng.common)}(this,(function(e,t,r,n,o,a,i){"use strict";

*/
function f(e){return function(){return new Promise((function(t,r){var n=function(){e.removeEventListener("DOMContentLoaded",n),t()};"complete"===e.readyState||"interactive"===e.readyState?t():e.addEventListener("DOMContentLoaded",n)}))}}l.decorators=[{type:r.Injectable}],l.ctorParameters=function(){return[{type:r.ApplicationRef},{type:n.TransferState}]},(u=function u(){}).decorators=[{type:r.NgModule,args:[{imports:[n.BrowserTransferStateModule],providers:[l,{provide:t.HTTP_INTERCEPTORS,useExisting:l,multi:!0}]}]}],(c=function c(){}).decorators=[{type:r.NgModule,args:[{providers:[{provide:r.APP_INITIALIZER,multi:!0,useFactory:f,deps:[i.DOCUMENT]}]}]}],
function f(e){return function(){return new Promise((function(t,r){if("complete"!==e.readyState&&"interactive"!==e.readyState){var n=function(){e.removeEventListener("DOMContentLoaded",n),t()};e.addEventListener("DOMContentLoaded",n)}else t()}))}}l.decorators=[{type:r.Injectable}],l.ctorParameters=function(){return[{type:r.ApplicationRef},{type:n.TransferState}]},(u=function u(){}).decorators=[{type:r.NgModule,args:[{imports:[n.BrowserTransferStateModule],providers:[l,{provide:t.HTTP_INTERCEPTORS,useExisting:l,multi:!0}]}]}],(c=function c(){}).decorators=[{type:r.NgModule,args:[{providers:[{provide:r.APP_INITIALIZER,multi:!0,useFactory:f,deps:[i.DOCUMENT]}]}]}],
/**

@@ -26,0 +26,0 @@ * @license

@@ -21,3 +21,3 @@

export declare function ɵnguniversal_modules_common_common_a(doc: Document): () => Promise<unknown>;
export declare function ɵnguniversal_modules_common_common_a(doc: Document): () => Promise<void>;

@@ -24,0 +24,0 @@ export declare class ɵTransferHttpCacheInterceptor implements HttpInterceptor {

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"ɵnguniversal_modules_common_common_a":{"__symbolic":"function","parameters":["doc"],"value":{"__symbolic":"error","message":"Lambda not supported","line":12,"character":9,"module":"./common"}},"TransferHttpCacheModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":125,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"BrowserTransferStateModule","line":126,"character":12}],"providers":[{"__symbolic":"reference","name":"ɵTransferHttpCacheInterceptor"},{"provide":{"__symbolic":"reference","module":"@angular/common/http","name":"HTTP_INTERCEPTORS","line":129,"character":14},"useExisting":{"__symbolic":"reference","name":"ɵTransferHttpCacheInterceptor"},"multi":true}]}]}],"members":{}},"StateTransferInitializerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":26,"character":1},"arguments":[{"providers":[{"provide":{"__symbolic":"reference","module":"@angular/core","name":"APP_INITIALIZER","line":28,"character":14},"multi":true,"useFactory":{"__symbolic":"reference","name":"ɵnguniversal_modules_common_common_a"},"deps":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":28,"character":88}]}]}]}],"members":{}},"ɵTransferHttpCacheInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":44,"character":1}}],"members":{"invalidateCacheEntry":[{"__symbolic":"method"}],"makeCacheKey":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ApplicationRef","line":62,"character":22},{"__symbolic":"reference","module":"@angular/platform-browser","name":"TransferState","line":62,"character":61}]}],"intercept":[{"__symbolic":"method"}]}}},"origins":{"ɵnguniversal_modules_common_common_a":"./common","TransferHttpCacheModule":"./common","StateTransferInitializerModule":"./common","ɵTransferHttpCacheInterceptor":"./common"},"importAs":"@nguniversal/common"}
{"__symbolic":"module","version":4,"metadata":{"ɵnguniversal_modules_common_common_a":{"__symbolic":"function","parameters":["doc"],"value":{"__symbolic":"error","message":"Lambda not supported","line":13,"character":9,"module":"./common"}},"TransferHttpCacheModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":125,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"BrowserTransferStateModule","line":126,"character":12}],"providers":[{"__symbolic":"reference","name":"ɵTransferHttpCacheInterceptor"},{"provide":{"__symbolic":"reference","module":"@angular/common/http","name":"HTTP_INTERCEPTORS","line":129,"character":14},"useExisting":{"__symbolic":"reference","name":"ɵTransferHttpCacheInterceptor"},"multi":true}]}]}],"members":{}},"StateTransferInitializerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":30,"character":1},"arguments":[{"providers":[{"provide":{"__symbolic":"reference","module":"@angular/core","name":"APP_INITIALIZER","line":32,"character":14},"multi":true,"useFactory":{"__symbolic":"reference","name":"ɵnguniversal_modules_common_common_a"},"deps":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":32,"character":88}]}]}]}],"members":{}},"ɵTransferHttpCacheInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":44,"character":1}}],"members":{"invalidateCacheEntry":[{"__symbolic":"method"}],"makeCacheKey":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ApplicationRef","line":62,"character":22},{"__symbolic":"reference","module":"@angular/platform-browser","name":"TransferState","line":62,"character":61}]}],"intercept":[{"__symbolic":"method"}]}}},"origins":{"ɵnguniversal_modules_common_common_a":"./common","TransferHttpCacheModule":"./common","StateTransferInitializerModule":"./common","ɵTransferHttpCacheInterceptor":"./common"},"importAs":"@nguniversal/common"}

@@ -29,3 +29,3 @@

/** Retrieve the document from the cache or the filesystem */
private getDocument;
getDocument(filePath: string): Promise<string>;
}

@@ -32,0 +32,0 @@

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"ɵFileLoader":{"__symbolic":"class","members":{"get":[{"__symbolic":"method"}]}},"ɵCommonEngine":{"__symbolic":"class","members":{"getCompiler":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Type","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Expression form not supported","line":34,"character":45,"module":"./engine"}]},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"@angular/core","name":"StaticProvider","line":35,"character":33}]}]}],"render":[{"__symbolic":"method"}],"getFactory":[{"__symbolic":"method"}],"getDocument":[{"__symbolic":"method"}]}},"ɵRenderOptions":{"__symbolic":"interface"}},"origins":{"ɵFileLoader":"./engine","ɵCommonEngine":"./engine","ɵRenderOptions":"./engine"},"importAs":"@nguniversal/common/engine"}
{"__symbolic":"module","version":4,"metadata":{"ɵFileLoader":{"__symbolic":"class","members":{"get":[{"__symbolic":"method"}]}},"ɵCommonEngine":{"__symbolic":"class","members":{"getCompiler":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Type","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Expression form not supported","line":42,"character":45,"module":"./engine"}]},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"@angular/core","name":"StaticProvider","line":43,"character":33}]}]}],"render":[{"__symbolic":"method"}],"getFactory":[{"__symbolic":"method"}],"getDocument":[{"__symbolic":"method"}]}},"ɵRenderOptions":{"__symbolic":"interface"}},"origins":{"ɵFileLoader":"./engine","ɵCommonEngine":"./engine","ɵRenderOptions":"./engine"},"importAs":"@nguniversal/common/engine"}

@@ -8,3 +8,3 @@ /**

*/
export { FileLoader as ɵFileLoader, CommonEngine as ɵCommonEngine } from './src/index';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9hcGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9tb2R1bGVzL2NvbW1vbi9lbmdpbmUvcHJpdmF0ZV9hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFFLFVBQVUsSUFBSSxXQUFXLEVBQUUsWUFBWSxJQUFJLGFBQWEsRUFDOUIsTUFBTSxhQUFhLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cblxuZXhwb3J0IHsgRmlsZUxvYWRlciBhcyDJtUZpbGVMb2FkZXIsIENvbW1vbkVuZ2luZSBhcyDJtUNvbW1vbkVuZ2luZSxcbiAgUmVuZGVyT3B0aW9ucyBhcyDJtVJlbmRlck9wdGlvbnMgfSBmcm9tICcuL3NyYy9pbmRleCc7XG4iXX0=
export { FileLoader as ɵFileLoader, CommonEngine as ɵCommonEngine, } from './src/index';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9hcGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9tb2R1bGVzL2NvbW1vbi9lbmdpbmUvcHJpdmF0ZV9hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUNMLFVBQVUsSUFBSSxXQUFXLEVBQ3pCLFlBQVksSUFBSSxhQUFhLEdBRTlCLE1BQU0sYUFBYSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbmV4cG9ydCB7XG4gIEZpbGVMb2FkZXIgYXMgybVGaWxlTG9hZGVyLFxuICBDb21tb25FbmdpbmUgYXMgybVDb21tb25FbmdpbmUsXG4gIFJlbmRlck9wdGlvbnMgYXMgybVSZW5kZXJPcHRpb25zLFxufSBmcm9tICcuL3NyYy9pbmRleCc7XG4iXX0=

@@ -12,4 +12,4 @@ import { __awaiter } from "tslib";

import { INITIAL_CONFIG, platformDynamicServer, renderModuleFactory } from '@angular/platform-server';
import * as fs from 'fs';
import { FileLoader } from './file-loader';
import { readFile } from './utils';
/**

@@ -25,3 +25,3 @@ * A common rendering engine utility. This abstracts the logic

this.factoryCacheMap = new Map();
this.templateCache = {};
this.templateCache = new Map();
}

@@ -42,3 +42,3 @@ /** Return an instance of the platformServer compiler */

// if opts.document dosen't exist then opts.documentFilePath must
const doc = opts.document || (yield this.getDocument(opts.documentFilePath));
const doc = opts.document || opts.documentFilePath && (yield this.getDocument(opts.documentFilePath));
const extraProviders = [

@@ -83,8 +83,12 @@ ...(opts.providers || []),

getDocument(filePath) {
const doc = this.templateCache[filePath] = this.templateCache[filePath] ||
fs.readFileSync(filePath).toString();
// As promise so we can change the API later without breaking
return Promise.resolve(doc);
return __awaiter(this, void 0, void 0, function* () {
let doc = this.templateCache.get(filePath);
if (!doc) {
doc = yield readFile(filePath, 'utf-8');
this.templateCache.set(filePath, doc);
}
return doc;
});
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5naW5lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbW9kdWxlcy9jb21tb24vZW5naW5lL3NyYy9lbmdpbmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRztBQUNILE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNuRCxPQUFPLEVBQVksZUFBZSxFQUFFLGVBQWUsRUFBd0IsTUFBTSxlQUFlLENBQUM7QUFDakcsT0FBTyxFQUFFLGNBQWMsRUFBRSxxQkFBcUIsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ3RHLE9BQU8sS0FBSyxFQUFFLE1BQU0sSUFBSSxDQUFDO0FBRXpCLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFHM0M7Ozs7R0FJRztBQUNILE1BQU0sT0FBTyxZQUFZO0lBY3ZCLFlBQW9CLGVBQWdELEVBQ2hELFlBQThCLEVBQUU7UUFEaEMsb0JBQWUsR0FBZixlQUFlLENBQWlDO1FBQ2hELGNBQVMsR0FBVCxTQUFTLENBQXVCO1FBSjVDLG9CQUFlLEdBQUcsSUFBSSxHQUFHLEVBQWlDLENBQUM7UUFDM0Qsa0JBQWEsR0FBNEIsRUFBRSxDQUFDO0lBR0csQ0FBQztJQWJ4RCx3REFBd0Q7SUFDeEQsV0FBVztRQUNULE1BQU0sZUFBZSxHQUFvQixxQkFBcUIsRUFBRSxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsZUFBZSxDQUFDLENBQUM7UUFFL0YsT0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ader implementation for loading files */
export class FileLoader {
get(url) {
return new Promise((resolve, reject) => {
fs.readFile(url, (err, data) => {
if (err) {
return reject(err);
}
resolve(data.toString());
});
});
return readFile(url, 'utf-8');
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZS1sb2FkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9tb2R1bGVzL2NvbW1vbi9lbmdpbmUvc3JjL2ZpbGUtbG9hZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVFBLE9BQU8sS0FBSyxFQUFFLE1BQU0sSUFBSSxDQUFDO0FBRXpCLHNEQUFzRDtBQUN0RCxNQUFNLE9BQU8sVUFBVTtJQUNyQixHQUFHLENBQUMsR0FBVztRQUNiLE9BQU8sSUFBSSxPQUFPLENBQUMsQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQUU7WUFDckMsRUFBRSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxHQUFpQyxFQUFFLElBQVksRUFBRSxFQUFFO2dCQUNuRSxJQUFJLEdBQUcsRUFBRTtvQkFDUCxPQUFPLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztpQkFDcEI7Z0JBRUQsT0FBTyxDQUFDLElBQUksQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFDO1lBQzNCLENBQUMsQ0FBQyxDQUFDO1FBQ0wsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIH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QUFVO0lBQ3JCLEdBQUcsQ0FBQyxHQUFXO1FBQ2IsT0FBTyxRQUFRLENBQUMsR0FBRyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0lBQ2hDLENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCBHb29nbGUgTExDIEFsbCBSaWdodHMgUmVzZXJ2ZWQuXG4gKlxuICogVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgYW4gTUlULXN0eWxlIGxpY2Vuc2UgdGhhdCBjYW4gYmVcbiAqIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9hbmd1bGFyLmlvL2xpY2Vuc2VcbiAqL1xuaW1wb3J0IHsgUmVzb3VyY2VMb2FkZXIgfSBmcm9tICdAYW5ndWxhci9jb21waWxlcic7XG5pbXBvcnQgeyByZWFkRmlsZSB9IGZyb20gJy4vdXRpbHMnO1xuXG4vKiogUmVzb3VyY2VMb2FkZXIgaW1wbGVtZW50YXRpb24gZm9yIGxvYWRpbmcgZmlsZXMgKi9cbmV4cG9ydCBjbGFzcyBGaWxlTG9hZGVyIGltcGxlbWVudHMgUmVzb3VyY2VMb2FkZXIge1xuICBnZXQodXJsOiBzdHJpbmcpOiBQcm9taXNlPHN0cmluZz4ge1xuICAgIHJldHVybiByZWFkRmlsZSh1cmwsICd1dGYtOCcpO1xuICB9XG59XG4iXX0=

@@ -8,5 +8,4 @@ /**

*/
export * from './interfaces';
export * from './file-loader';
export * from './engine';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9tb2R1bGVzL2NvbW1vbi9lbmdpbmUvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJ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gZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5leHBvcnQgKiBmcm9tICcuL2ZpbGUtbG9hZGVyJztcbmV4cG9ydCAqIGZyb20gJy4vZW5naW5lJztcbiJdfQ==

@@ -12,2 +12,6 @@ /**

return () => new Promise((resolve, _reject) => {
if (doc.readyState === 'complete' || doc.readyState === 'interactive') {
resolve();
return;
}
const contentLoaded = () => {

@@ -17,8 +21,3 @@ doc.removeEventListener('DOMContentLoaded', contentLoaded);

};
if (doc.readyState === 'complete' || doc.readyState === 'interactive') {
resolve();
}
else {
doc.addEventListener('DOMContentLoaded', contentLoaded);
}
doc.addEventListener('DOMContentLoaded', contentLoaded);
});

@@ -35,2 +34,2 @@ }

];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbW9kdWxlcy9jb21tb24vc3JjL3N0YXRlLXRyYW5zZmVyLWluaXRpYWxpemVyL21vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDM0MsT0FBTyxFQUFFLGVBQWUsRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFMUQsTUFBTSxVQUFVLHVCQUF1QixDQUFDLEdBQWE7SUFDbkQsT0FBTyxHQUFHLEVBQUUsQ0FBQyxJQUFJLE9BQU8sQ0FBRSxDQUFDLE9BQU8sRUFBRSxPQUFPLEVBQUUsRUFBRTtRQUM3QyxNQUFNLGFBQWEsR0FBRyxHQUFHLEVBQUU7WUFDekIsR0FBRyxDQUFDLG1CQUFtQixDQUFDLGtCQUFrQixFQUFFLGFBQWEsQ0FBQyxDQUFDO1lBQzNELE9BQU8sRUFBR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pdGlhbGl6ZXJNb2R1bGUge31cbiJdfQ==

@@ -115,2 +115,6 @@ import { HttpResponse, HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';

return () => new Promise((resolve, _reject) => {
if (doc.readyState === 'complete' || doc.readyState === 'interactive') {
resolve();
return;
}
const contentLoaded = () => {

@@ -120,8 +124,3 @@ doc.removeEventListener('DOMContentLoaded', contentLoaded);

};
if (doc.readyState === 'complete' || doc.readyState === 'interactive') {
resolve();
}
else {
doc.addEventListener('DOMContentLoaded', contentLoaded);
}
doc.addEventListener('DOMContentLoaded', contentLoaded);
});

@@ -128,0 +127,0 @@ }

@@ -1,2 +0,3 @@

import { readFile, readFileSync } from 'fs';
import { readFile as readFile$1 } from 'fs';
import { promisify } from 'util';
import { __awaiter } from 'tslib';

@@ -7,13 +8,15 @@ import { ResourceLoader } from '@angular/compiler';

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const readFile = promisify(readFile$1);
/** ResourceLoader implementation for loading files */
class FileLoader {
get(url) {
return new Promise((resolve, reject) => {
readFile(url, (err, data) => {
if (err) {
return reject(err);
}
resolve(data.toString());
});
});
return readFile(url, 'utf-8');
}

@@ -32,3 +35,3 @@ }

this.factoryCacheMap = new Map();
this.templateCache = {};
this.templateCache = new Map();
}

@@ -49,3 +52,3 @@ /** Return an instance of the platformServer compiler */

// if opts.document dosen't exist then opts.documentFilePath must
const doc = opts.document || (yield this.getDocument(opts.documentFilePath));
const doc = opts.document || opts.documentFilePath && (yield this.getDocument(opts.documentFilePath));
const extraProviders = [

@@ -90,6 +93,10 @@ ...(opts.providers || []),

getDocument(filePath) {
const doc = this.templateCache[filePath] = this.templateCache[filePath] ||
readFileSync(filePath).toString();
// As promise so we can change the API later without breaking
return Promise.resolve(doc);
return __awaiter(this, void 0, void 0, function* () {
let doc = this.templateCache.get(filePath);
if (!doc) {
doc = yield readFile(filePath, 'utf-8');
this.templateCache.set(filePath, doc);
}
return doc;
});
}

@@ -96,0 +103,0 @@ }

{
"name": "@nguniversal/common",
"version": "11.0.0-next.1",
"version": "11.0.0-next.2",
"description": "Angular Universal common utilities",

@@ -17,4 +17,4 @@ "license": "MIT",

"peerDependencies": {
"@angular/common": "^11.0.0-next.3",
"@angular/core": "^11.0.0-next.3"
"@angular/common": "^11.0.0-rc.2",
"@angular/core": "^11.0.0-rc.2"
},

@@ -21,0 +21,0 @@ "ng-update": {

@@ -225,3 +225,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

type: dependencies_1.NodeDependencyType.Dev,
version: '^11.0.0-next.1',
version: '^11.0.0-next.2',
});

@@ -228,0 +228,0 @@ return host;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc