Skip to content

Commit

Permalink
tinyglobby can replace is-glob as well
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Oct 2, 2024
1 parent 0b6c892 commit fbdf978
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
10 changes: 2 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@apidevtools/json-schema-ref-parser": "^11.5.5",
"@types/json-schema": "^7.0.15",
"@types/lodash": "^4.17.7",
"is-glob": "^4.0.3",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"minimist": "^1.2.8",
Expand All @@ -60,7 +59,6 @@
},
"devDependencies": {
"@types/cli-color": "^2.0.6",
"@types/is-glob": "^4.0.4",
"@types/js-yaml": "^4.0.9",
"@types/minimist": "^1.2.5",
"@types/node": "^20.12.7",
Expand Down
5 changes: 2 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import minimist from 'minimist'
import {readFileSync, writeFileSync, existsSync, lstatSync, readdirSync, mkdirSync} from 'fs'
import {glob} from 'tinyglobby'
import isGlob from 'is-glob'
import {glob, isDynamicPattern} from 'tinyglobby'
import {join, resolve, dirname} from 'path'
import {compile, DEFAULT_OPTIONS, Options} from './index'
import {pathTransform, error, parseFileAsJSONSchema, justName} from './utils'
Expand Down Expand Up @@ -39,7 +38,7 @@ async function main(argv: minimist.ParsedArgs) {
const argIn: string = argv._[0] || argv.input
const argOut: string | undefined = argv._[1] || argv.output // the output can be omitted so this can be undefined

const ISGLOB = isGlob(argIn)
const ISGLOB = isDynamicPattern(argIn)
const ISDIR = isDir(argIn)

if ((ISGLOB || ISDIR) && argOut && argOut.includes('.d.ts')) {
Expand Down

0 comments on commit fbdf978

Please sign in to comment.