@tsed/engines
Advanced tools
Comparing version 7.0.0-beta.12 to 7.0.0-beta.13
@@ -11,7 +11,4 @@ "use strict"; | ||
let DustEngine = class DustEngine extends Engine_1.Engine { | ||
constructor() { | ||
super(...arguments); | ||
this.views = "."; | ||
this.ext = "dust"; | ||
} | ||
views = "."; | ||
ext = "dust"; | ||
configure(options) { | ||
@@ -18,0 +15,0 @@ if (options) { |
@@ -6,2 +6,5 @@ "use strict"; | ||
class Engine { | ||
name; | ||
options; | ||
driverName; | ||
constructor(name, options) { | ||
@@ -8,0 +11,0 @@ this.name = name; |
@@ -9,2 +9,3 @@ "use strict"; | ||
let TwingEngine = class TwingEngine extends Engine_1.Engine { | ||
instance; | ||
$compile(template, options) { | ||
@@ -11,0 +12,0 @@ const engine = this.engine; |
"use strict"; | ||
var _VueEngine_renderToString; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -25,6 +24,3 @@ exports.VueEngine = void 0; | ||
let VueEngine = class VueEngine extends Engine_1.Engine { | ||
constructor() { | ||
super(...arguments); | ||
_VueEngine_renderToString.set(this, void 0); | ||
} | ||
#renderToString; | ||
async $onInit() { | ||
@@ -36,3 +32,3 @@ await super.$onInit(); | ||
const ssrRenderer = this.vueServerRenderer.createRenderer(); | ||
tslib_1.__classPrivateFieldSet(this, _VueEngine_renderToString, (0, util_1.promisify)(ssrRenderer.renderToString.bind(this)), "f"); | ||
this.#renderToString = (0, util_1.promisify)(ssrRenderer.renderToString.bind(this)); | ||
} | ||
@@ -131,6 +127,5 @@ get pronto() { | ||
let instance = new Factory({ propsData: options }); | ||
return tslib_1.__classPrivateFieldGet(this, _VueEngine_renderToString, "f").call(this, instance); | ||
return this.#renderToString(instance); | ||
} | ||
}; | ||
_VueEngine_renderToString = new WeakMap(); | ||
VueEngine = tslib_1.__decorate([ | ||
@@ -137,0 +132,0 @@ (0, viewEngine_1.ViewEngine)("vue", { |
"use strict"; | ||
var _EnginesContainer_providers; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.engines = exports.EnginesContainer = void 0; | ||
const tslib_1 = require("tslib"); | ||
class EnginesContainer { | ||
constructor() { | ||
_EnginesContainer_providers.set(this, new Map()); | ||
} | ||
#providers = new Map(); | ||
has(key) { | ||
return tslib_1.__classPrivateFieldGet(this, _EnginesContainer_providers, "f").has(key); | ||
return this.#providers.has(key); | ||
} | ||
get(key) { | ||
const provider = tslib_1.__classPrivateFieldGet(this, _EnginesContainer_providers, "f").get(key); | ||
const provider = this.#providers.get(key); | ||
if (provider && !provider.instance) { | ||
provider.instance = new provider.useClass(provider.name, provider.options); | ||
} | ||
return provider === null || provider === void 0 ? void 0 : provider.instance; | ||
return provider?.instance; | ||
} | ||
set(key, provider) { | ||
tslib_1.__classPrivateFieldGet(this, _EnginesContainer_providers, "f").set(key, provider); | ||
tslib_1.__classPrivateFieldGet(this, _EnginesContainer_providers, "f").set(provider.name, provider); | ||
this.#providers.set(key, provider); | ||
this.#providers.set(provider.name, provider); | ||
} | ||
getSupportedEngines() { | ||
return [...tslib_1.__classPrivateFieldGet(this, _EnginesContainer_providers, "f").keys()].filter((key) => typeof key === "string"); | ||
return [...this.#providers.keys()].filter((key) => typeof key === "string"); | ||
} | ||
} | ||
exports.EnginesContainer = EnginesContainer; | ||
_EnginesContainer_providers = new WeakMap(); | ||
exports.engines = new EnginesContainer(); | ||
//# sourceMappingURL=EnginesContainer.js.map |
@@ -8,7 +8,4 @@ import { __decorate } from "tslib"; | ||
let DustEngine = class DustEngine extends Engine { | ||
constructor() { | ||
super(...arguments); | ||
this.views = "."; | ||
this.ext = "dust"; | ||
} | ||
views = "."; | ||
ext = "dust"; | ||
configure(options) { | ||
@@ -15,0 +12,0 @@ if (options) { |
import { cache, getCachedEngine, importEngine, read, readPartials } from "../utils/cache.js"; | ||
export class Engine { | ||
name; | ||
options; | ||
driverName; | ||
constructor(name, options) { | ||
@@ -4,0 +7,0 @@ this.name = name; |
@@ -6,2 +6,3 @@ import { __decorate } from "tslib"; | ||
let TwingEngine = class TwingEngine extends Engine { | ||
instance; | ||
$compile(template, options) { | ||
@@ -8,0 +9,0 @@ const engine = this.engine; |
@@ -1,3 +0,2 @@ | ||
var _VueEngine_renderToString; | ||
import { __classPrivateFieldGet, __classPrivateFieldSet, __decorate } from "tslib"; | ||
import { __decorate } from "tslib"; | ||
import { Engine } from "./Engine.js"; | ||
@@ -22,6 +21,3 @@ import { ViewEngine } from "../decorators/viewEngine.js"; | ||
let VueEngine = class VueEngine extends Engine { | ||
constructor() { | ||
super(...arguments); | ||
_VueEngine_renderToString.set(this, void 0); | ||
} | ||
#renderToString; | ||
async $onInit() { | ||
@@ -33,3 +29,3 @@ await super.$onInit(); | ||
const ssrRenderer = this.vueServerRenderer.createRenderer(); | ||
__classPrivateFieldSet(this, _VueEngine_renderToString, promisify(ssrRenderer.renderToString.bind(this)), "f"); | ||
this.#renderToString = promisify(ssrRenderer.renderToString.bind(this)); | ||
} | ||
@@ -128,6 +124,5 @@ get pronto() { | ||
let instance = new Factory({ propsData: options }); | ||
return __classPrivateFieldGet(this, _VueEngine_renderToString, "f").call(this, instance); | ||
return this.#renderToString(instance); | ||
} | ||
}; | ||
_VueEngine_renderToString = new WeakMap(); | ||
VueEngine = __decorate([ | ||
@@ -134,0 +129,0 @@ ViewEngine("vue", { |
@@ -1,27 +0,22 @@ | ||
var _EnginesContainer_providers; | ||
import { __classPrivateFieldGet } from "tslib"; | ||
export class EnginesContainer { | ||
constructor() { | ||
_EnginesContainer_providers.set(this, new Map()); | ||
} | ||
#providers = new Map(); | ||
has(key) { | ||
return __classPrivateFieldGet(this, _EnginesContainer_providers, "f").has(key); | ||
return this.#providers.has(key); | ||
} | ||
get(key) { | ||
const provider = __classPrivateFieldGet(this, _EnginesContainer_providers, "f").get(key); | ||
const provider = this.#providers.get(key); | ||
if (provider && !provider.instance) { | ||
provider.instance = new provider.useClass(provider.name, provider.options); | ||
} | ||
return provider === null || provider === void 0 ? void 0 : provider.instance; | ||
return provider?.instance; | ||
} | ||
set(key, provider) { | ||
__classPrivateFieldGet(this, _EnginesContainer_providers, "f").set(key, provider); | ||
__classPrivateFieldGet(this, _EnginesContainer_providers, "f").set(provider.name, provider); | ||
this.#providers.set(key, provider); | ||
this.#providers.set(provider.name, provider); | ||
} | ||
getSupportedEngines() { | ||
return [...__classPrivateFieldGet(this, _EnginesContainer_providers, "f").keys()].filter((key) => typeof key === "string"); | ||
return [...this.#providers.keys()].filter((key) => typeof key === "string"); | ||
} | ||
} | ||
_EnginesContainer_providers = new WeakMap(); | ||
export const engines = new EnginesContainer(); | ||
//# sourceMappingURL=EnginesContainer.js.map |
{ | ||
"name": "@tsed/engines", | ||
"version": "7.0.0-beta.12", | ||
"version": "7.0.0-beta.13", | ||
"description": "Template engines library. Provide an API to adding custom engines from decorators.", | ||
@@ -20,3 +20,3 @@ "source": "./src/index.ts", | ||
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"", | ||
"test": "cross-env NODE_ENV=test nyc mocha" | ||
"test": "cross-env NODE_ENV=test nyc mocha --timeout 15000" | ||
}, | ||
@@ -26,3 +26,3 @@ "private": false, | ||
"fs-extra": "10.0.1", | ||
"tslib": "^2.3.1" | ||
"tslib": "2.4.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "devDependencies": { |
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
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
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
2
139
299693
2936
12
+ Addedtslib@2.4.0(transitive)
- Removedtslib@2.8.1(transitive)
Updatedtslib@2.4.0