From d7a5ecda67dd08835083fcbe79f4c77f3c637b0b Mon Sep 17 00:00:00 2001 From: Nishimura Wataru Date: Thu, 21 Mar 2024 23:54:54 +0900 Subject: [PATCH] fix(glob): change import method from default export to named export (#24) --- src/generate.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generate.ts b/src/generate.ts index 12687fe..3bed16d 100644 --- a/src/generate.ts +++ b/src/generate.ts @@ -2,7 +2,7 @@ import { print } from "./print"; import { CLIOptions } from "./cli"; import { createSource as createModelSource } from "./models/createSource"; import { createRouteParamsSource } from "./routes/createSource"; -import glob from "glob"; +import { sync } from "glob"; import fs from "fs"; import { execSync } from "child_process"; import { LaravelModelType, LaravelRouteListType } from "./types"; @@ -25,12 +25,12 @@ export async function generate(options: CLIOptions) { const parsedModelPath = path .join(options.modelPath, "**", "*.php") .replace(/\\/g, "/"); - const models = glob.sync(parsedModelPath); + const models = sync(parsedModelPath); const modelData: LaravelModelType[] = []; const parsedEnumPath = path .join(options.enumPath, "**", "*.php") .replace(/\\/g, "/"); - const enums = glob.sync(parsedEnumPath); + const enums = sync(parsedEnumPath); if (!fs.existsSync(tmpDir)) { fs.mkdirSync(tmpDir); }