UNPKG

mp-holistic

Version:

si prefigge l'umile compito di aiutare nella creazione di : - un server API REST mediante express - un semplice ORM per Postgres Questo tramite decoratori o classi particolari.

69 lines 2.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MetodoParametri = void 0; class MetodoParametri { constructor() { this.percorsi = { pathGlobal: '', patheader: '', porta: 0 }; this.percorsoIndipendente = false; this.tipo = 'get'; this.path = ''; this.interazione = 'rotta'; } Init(item, pathAlternativo) { if (item.percorsoIndipendente) { this.percorsoIndipendente = item.percorsoIndipendente; } else { this.percorsoIndipendente = false; } if (item.tipo != undefined) { this.tipo = item.tipo; } /* else if (item.tipo == undefined && pramsIndex == 0) this.tipo = 'get'; else if (item.tipo == undefined && pramsIndex > 0) this.tipo = 'post'; */ else if (this.tipo == undefined) { this.tipo = 'get'; } if (item.interazione != undefined) { this.interazione = item.interazione; } else { this.interazione = 'rotta'; } if (item.path != undefined) { this.path = item.path; } else if (pathAlternativo && (this.path == undefined || this.path == '')) { this.path = pathAlternativo; } if (item.percorsi) { this.percorsi.patheader = item.percorsi.patheader; this.percorsi.porta = item.percorsi.porta; } if (this.percorsoIndipendente) { this.percorsi.pathGlobal = '/' + this.path; } else { this.percorsi.pathGlobal = this.percorsi.pathGlobal + '/' + this.path; } if (item.isFile) { this.isFile = item.isFile; } } PrintStruttura() { let ritorno = ''; if (this.percorsi) ritorno = ritorno + '\npercorsi :' + JSON.stringify(this.percorsi); if (this.percorsoIndipendente) ritorno = ritorno + '\npercorsoIndipendente :' + JSON.stringify(this.percorsoIndipendente); if (this.tipo) ritorno = ritorno + '\ntipo :' + this.tipo; if (this.path) ritorno = ritorno + '\npath :' + this.path; if (this.interazione) ritorno = ritorno + '\ninterazione :' + this.interazione; return ritorno; } } exports.MetodoParametri = MetodoParametri; //# sourceMappingURL=MetodoParametri.js.map