Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-tsconfig

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-tsconfig - npm Package Compare versions

Comparing version 4.3.0 to 4.4.0

2

package.json
{
"name": "get-tsconfig",
"version": "4.3.0",
"version": "4.4.0",
"description": "Find and parse the tsconfig.json file from a directory path",

@@ -5,0 +5,0 @@ "keywords": [

@@ -100,2 +100,43 @@ # get-tsconfig [![Latest version](https://badgen.net/npm/v/get-tsconfig)](https://npm.im/get-tsconfig)

### createFileMatcher(tsconfig: TsconfigResult, caseSensitivePaths?: boolean)
Given a `tsconfig.json` file, it returns a file-matcher function that determines whether it should apply to a file path.
```ts
type FileMatcher = (filePath: string) => TsconfigResult['config'] | undefined
```
#### tsconfig
Type: `TsconfigResult`
Pass in the return value from `getTsconfig`, or a `TsconfigResult` object.
#### caseSensitivePaths
Type: `boolean`
By default, it uses [`is-fs-case-sensitive`](https://github.com/privatenumber/is-fs-case-sensitive) to detect whether the file-system is case-sensitive.
Pass in `true` to make it case-sensitive.
#### Example
For example, if it's called with a `tsconfig.json` file that has `include`/`exclude`/`files` defined, the file-matcher will return the config for files that match `include`/`files`, and return `undefined` for files that don't match or match `exclude`.
```ts
const tsconfig = getTsconfig()
const fileMatcher = tsconfig && createFileMatcher(tsconfig)
/*
* Returns tsconfig.json if it matches the file,
* undefined if not
*/
const configForFile = fileMatcher?.('/path/to/file.ts')
const distCode = compileTypescript({
code: sourceCode,
tsconfig: configForFile
})
```
---
### createPathsMatcher(tsconfig: TsconfigResult)

@@ -102,0 +143,0 @@

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc