@trapi/metadata
Version:
Generate REST-API metadata scheme from TypeScript Decorators.
27 lines • 957 B
JavaScript
;
/*
* Copyright (c) 2023.
* Author Peter Placzek (tada5hi)
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.generatePresetLookupPaths = void 0;
const node_path_1 = __importDefault(require("node:path"));
function generatePresetLookupPaths(input) {
if (node_path_1.default.isAbsolute(input) || input.startsWith('./')) {
return [input];
}
if (input.startsWith('module:')) {
return [input.substring(0, 'module:'.length)];
}
if (!input.startsWith('@')) {
return [input, `@trapi/${input}`];
}
return [input];
}
exports.generatePresetLookupPaths = generatePresetLookupPaths;
//# sourceMappingURL=normalize.js.map