UNPKG

tspace-spear

Version:

tspace-spear is a lightweight, high-performance API framework for Node.js that leverages the native HTTP server and supports uWebSockets.js (C++) for maximum speed and efficiency.

42 lines 1.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Package = void 0; class Package { static import(name) { try { return require(name); } catch (err) { throw new Error(`The package '${name}' caused by '${err.message}'. Please try installing the package using : npm install ${name} --save`); } } static get classTransformer() { try { const { plainToInstance } = require('class-transformer'); return { plainToInstance: (cls, plain) => { return plainToInstance(cls, plain); } }; } catch (err) { throw new Error(`The package 'class-transformer' caused by '${err.message}'. Please try installing the package using : npm install class-transformer --save`); } } static get classValidator() { try { const { validate } = require('class-validator'); return { validate: async (dto) => { return await validate(dto); } }; } catch (err) { throw new Error(`The package 'class-validator' caused by '${err.message}'. Please try installing the package using : npm install class-validator --save`); } } } exports.Package = Package; exports.default = Package; //# sourceMappingURL=index.js.map