Comparing version 3.5.4 to 3.5.5
"use strict"; | ||
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; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -67,2 +44,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
var path_1 = __importDefault(require("path")); | ||
var FileRetriever_1 = require("./FileRetriever"); | ||
var ArgumentParser; | ||
@@ -77,3 +55,2 @@ (function (ArgumentParser) { | ||
return __generator(this, function (_a) { | ||
var _b, _c; | ||
switch (_a.label) { | ||
@@ -95,6 +72,6 @@ case 0: | ||
}; | ||
return [4, (_b = path_1.default.join(pack.directory, "node_modules", "commander"), Promise.resolve().then(function () { return __importStar(require(_b)); }))]; | ||
return [4, FileRetriever_1.FileRetriever.require(path_1.default.join("node_modules", "commander"))(pack.directory)]; | ||
case 1: | ||
command = (_a.sent()).program; | ||
return [4, (_c = path_1.default.join(pack.directory, "node_modules", "inquirer"), Promise.resolve().then(function () { return __importStar(require(_c)); }))]; | ||
return [4, FileRetriever_1.FileRetriever.require(path_1.default.join("node_modules", "inquirer"))(pack.directory)]; | ||
case 2: | ||
@@ -101,0 +78,0 @@ prompt = (_a.sent()).createPromptModule; |
@@ -46,2 +46,3 @@ "use strict"; | ||
var CommandExecutor_1 = require("./CommandExecutor"); | ||
var FileRetriever_1 = require("./FileRetriever"); | ||
var PackageManager = (function () { | ||
@@ -65,3 +66,3 @@ function PackageManager(directory, data) { | ||
switch (_c.label) { | ||
case 0: return [4, find(process.cwd())]; | ||
case 0: return [4, FileRetriever_1.FileRetriever.directory("package.json")(process.cwd())]; | ||
case 1: | ||
@@ -99,3 +100,3 @@ location = _c.sent(); | ||
if (!!(container === null || container === void 0 ? void 0 : container[props.modulo]) && | ||
fs_1.default.existsSync(path_1.default.join(this.directory, "node_modules", props.modulo))) | ||
FileRetriever_1.FileRetriever.file(path_1.default.join("node_modules", props.modulo))(this.directory) !== null) | ||
return false; | ||
@@ -128,17 +129,2 @@ var middle = this.manager === "yarn" | ||
exports.PackageManager = PackageManager; | ||
function find(directory, depth) { | ||
if (directory === void 0) { directory = process.cwd(); } | ||
if (depth === void 0) { depth = 0; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var location; | ||
return __generator(this, function (_a) { | ||
location = path_1.default.join(directory, "package.json"); | ||
if (fs_1.default.existsSync(location)) | ||
return [2, directory]; | ||
else if (depth > 1) | ||
return [2, null]; | ||
return [2, find(path_1.default.join(directory, ".."), depth + 1)]; | ||
}); | ||
}); | ||
} | ||
//# sourceMappingURL=PackageManager.js.map |
"use strict"; | ||
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; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -68,2 +45,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
var path_1 = __importDefault(require("path")); | ||
var FileRetriever_1 = require("./FileRetriever"); | ||
var PluginConfigurator; | ||
@@ -120,5 +98,4 @@ (function (PluginConfigurator) { | ||
return __generator(this, function (_c) { | ||
var _d; | ||
switch (_c.label) { | ||
case 0: return [4, (_d = path_1.default.join(pack.directory, "node_modules", "comment-json"), Promise.resolve().then(function () { return __importStar(require(_d)); }))]; | ||
case 0: return [4, FileRetriever_1.FileRetriever.require(path_1.default.join("node_modules", "comment-json"))(pack.directory)]; | ||
case 1: | ||
@@ -125,0 +102,0 @@ Comment = _c.sent(); |
{ | ||
"name": "typia", | ||
"version": "3.5.4", | ||
"version": "3.5.5", | ||
"description": "Superfast runtime validators with only one line", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -5,2 +5,3 @@ import type CommanderModule from "commander"; | ||
import { FileRetriever } from "./FileRetriever"; | ||
import { PackageManager } from "./PackageManager"; | ||
@@ -50,9 +51,10 @@ | ||
// LOAD INSTALLED MODULES | ||
const { program: command }: typeof CommanderModule = await import( | ||
path.join(pack.directory, "node_modules", "commander") | ||
); | ||
const { program: command }: typeof CommanderModule = | ||
await FileRetriever.require( | ||
path.join("node_modules", "commander"), | ||
)(pack.directory); | ||
const { createPromptModule: prompt }: typeof InquirerModule = | ||
await import( | ||
path.join(pack.directory, "node_modules", "inquirer") | ||
); | ||
await FileRetriever.require( | ||
path.join("node_modules", "inquirer"), | ||
)(pack.directory); | ||
@@ -59,0 +61,0 @@ // TAKE OPTIONS |
@@ -5,2 +5,3 @@ import fs from "fs"; | ||
import { CommandExecutor } from "./CommandExecutor"; | ||
import { FileRetriever } from "./FileRetriever"; | ||
@@ -14,3 +15,5 @@ export class PackageManager { | ||
public static async mount(): Promise<PackageManager> { | ||
const location: string | null = await find(process.cwd()); | ||
const location: string | null = await FileRetriever.directory( | ||
"package.json", | ||
)(process.cwd()); | ||
if (location === null) | ||
@@ -48,5 +51,5 @@ throw new Error(`Unable to find "package.json" file`); | ||
!!container?.[props.modulo] && | ||
fs.existsSync( | ||
path.join(this.directory, "node_modules", props.modulo), | ||
) | ||
FileRetriever.file(path.join("node_modules", props.modulo))( | ||
this.directory, | ||
) !== null | ||
) | ||
@@ -93,11 +96,1 @@ return false; | ||
} | ||
async function find( | ||
directory: string = process.cwd(), | ||
depth: number = 0, | ||
): Promise<string | null> { | ||
const location: string = path.join(directory, "package.json"); | ||
if (fs.existsSync(location)) return directory; | ||
else if (depth > 1) return null; | ||
return find(path.join(directory, ".."), depth + 1); | ||
} |
@@ -6,2 +6,3 @@ import type Comment from "comment-json"; | ||
import { TypiaSetupWizard } from "../TypiaSetupWizard"; | ||
import { FileRetriever } from "./FileRetriever"; | ||
import { PackageManager } from "./PackageManager"; | ||
@@ -46,5 +47,6 @@ | ||
// GET COMPILER-OPTIONS | ||
const Comment: typeof import("comment-json") = await import( | ||
path.join(pack.directory, "node_modules", "comment-json") | ||
); | ||
const Comment: typeof import("comment-json") = | ||
await FileRetriever.require( | ||
path.join("node_modules", "comment-json"), | ||
)(pack.directory); | ||
@@ -51,0 +53,0 @@ const config: Comment.CommentObject = Comment.parse( |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1638120
787
28962
5