Home / File/ checker.ts — drizzle-orm Source File

checker.ts — drizzle-orm Source File

Architecture documentation for checker.ts, a typescript file in the drizzle-orm codebase. 5 imports, 2 dependents.

File typescript DrizzleORM RelationalQuery 5 imports 2 dependents 2 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  c2197456_e6cc_1614_c507_f516244187b1["checker.ts"]
  8bf87654_6856_e67c_24ad_740dca24cecc["analyze.ts"]
  c2197456_e6cc_1614_c507_f516244187b1 --> 8bf87654_6856_e67c_24ad_740dca24cecc
  20ebf920_edb3_abd5_6b3a_24bc2b348a46["analyze"]
  c2197456_e6cc_1614_c507_f516244187b1 --> 20ebf920_edb3_abd5_6b3a_24bc2b348a46
  9a46d98d_eb2d_c1e4_a37b_506dd514a6a7["fs"]
  c2197456_e6cc_1614_c507_f516244187b1 --> 9a46d98d_eb2d_c1e4_a37b_506dd514a6a7
  a5c3bbd8_074c_ae37_3d3b_0dde0d493c56["micromatch"]
  c2197456_e6cc_1614_c507_f516244187b1 --> a5c3bbd8_074c_ae37_3d3b_0dde0d493c56
  412eac48_6e13_8b0f_b7b2_5c943c225130["path"]
  c2197456_e6cc_1614_c507_f516244187b1 --> 412eac48_6e13_8b0f_b7b2_5c943c225130
  5425e03c_cd8c_825c_2738_101d93d1ae2a["index.ts"]
  5425e03c_cd8c_825c_2738_101d93d1ae2a --> c2197456_e6cc_1614_c507_f516244187b1
  98f9fc2a_cdea_d6d3_bf7b_31da8875221b["bin.test.ts"]
  98f9fc2a_cdea_d6d3_bf7b_31da8875221b --> c2197456_e6cc_1614_c507_f516244187b1
  style c2197456_e6cc_1614_c507_f516244187b1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import fs from 'fs';
import m from 'micromatch';
import { dirname, join as joinPath, relative, resolve as resolvePath } from 'path';
import { analyze } from './analyze';

type External = {
	file: string;
	import: string;
	type: 'data' | 'types';
};

export type Issue = {
	file: string;
	imports: IssueImport[];
	accessChains: ChainLink[][];
};

export type IssueImport = {
	name: string;
	type: 'data' | 'types';
};

export type ChainLink = {
	file: string;
	import: string;
};

type ListMode = 'whitelist' | 'blacklist';

class ImportAnalyzer {
	private localImportRegex = /^(\.?\.?\/|\.\.?$)/;
	private importedFileFormatRegex = /^.*\.(ts|tsx|mts|cts|js|jsx|mjs|cjs|json)$/i;

	private visited: Set<string> = new Set<string>();

	private externals: External[] = [];
	private accessChains: Record<string, ChainLink[][]> = {};

	constructor(
		private basePath: string,
		private entry: string,
		private listMode: ListMode,
		private readonly wantedList: string[],
		private localPaths: string[],
		private logger?: boolean,
		private ignoreTypes?: boolean,
	) {}

	private isDirectory = (path: string) => {
		try {
			return fs.lstatSync(path).isDirectory();
		} catch (e) {
			return false;
		}
	};

	private isFile = (path: string) => {
		try {
			return fs.lstatSync(path).isFile();
		} catch (e) {
// ... (237 more lines)

Domain

Subdomains

Classes

Dependencies

Frequently Asked Questions

What does checker.ts do?
checker.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain, RelationalQuery subdomain.
What functions are defined in checker.ts?
checker.ts defines 2 function(s): analyzeImports, basePath.
What does checker.ts depend on?
checker.ts imports 5 module(s): analyze, analyze.ts, fs, micromatch, path.
What files import checker.ts?
checker.ts is imported by 2 file(s): bin.test.ts, index.ts.
Where is checker.ts in the architecture?
checker.ts is located at drizzle-kit/imports-checker/checker.ts (domain: DrizzleORM, subdomain: RelationalQuery, directory: drizzle-kit/imports-checker).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free