@clawject/di
Version:
<p align="center"> <a href="https://clawject.com/" target="_blank"><img src="https://clawject.com/img/logo.svg" align="center" alt="Clawject Logo" width="120" height="120" /></a> </p>
46 lines (45 loc) • 2.02 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTSMorphProject = void 0;
const Context_1 = require("@clawject/core/compilation-context/Context");
const ImportMap = {
'5.0': 'ts-morph-bootstrap-ts50',
'5.1': 'ts-morph-bootstrap-ts51',
'5.2': 'ts-morph-bootstrap-ts52',
'5.3': 'ts-morph-bootstrap-ts53',
'5.4': 'ts-morph-bootstrap-ts54',
'5.5': 'ts-morph-bootstrap-ts55',
'5.6': 'ts-morph-bootstrap-ts56-57',
'5.7': 'ts-morph-bootstrap-ts56-57',
};
const createTSMorphProject = async (...args) => {
if (!Object.hasOwn(ImportMap, Context_1.Context.ts.versionMajorMinor)) {
throw new Error(`Unsupported TypeScript version: ${Context_1.Context.ts.versionMajorMinor}`);
}
const module = await Promise.resolve(`${ImportMap[Context_1.Context.ts.versionMajorMinor]}`).then(s => __importStar(require(s)));
return module.createProject(...args);
};
exports.createTSMorphProject = createTSMorphProject;