Home / Function/ trimChar() — drizzle-orm Function Reference

trimChar() — drizzle-orm Function Reference

Architecture documentation for the trimChar() function in gelSerializer.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  6342c0f6_3fba_20d2_10c6_c4e192f835a0["trimChar()"]
  33990744_4141_72e3_2ae9_3c695bf71d75["gelSerializer.ts"]
  6342c0f6_3fba_20d2_10c6_c4e192f835a0 -->|defined in| 33990744_4141_72e3_2ae9_3c695bf71d75
  4e4d6d58_9452_ce92_00b8_77a3b8ffd541["fromDatabase()"]
  4e4d6d58_9452_ce92_00b8_77a3b8ffd541 -->|calls| 6342c0f6_3fba_20d2_10c6_c4e192f835a0
  d6ed66aa_aafe_f478_835c_7c02934633eb["schemaToTypeScript()"]
  d6ed66aa_aafe_f478_835c_7c02934633eb -->|calls| 6342c0f6_3fba_20d2_10c6_c4e192f835a0
  style 6342c0f6_3fba_20d2_10c6_c4e192f835a0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/serializer/gelSerializer.ts lines 901–910

const trimChar = (str: string, char: string) => {
	let start = 0;
	let end = str.length;

	while (start < end && str[start] === char) ++start;
	while (end > start && str[end - 1] === char) --end;

	// this.toString() due to ava deep equal issue with String { "value" }
	return start > 0 || end < str.length ? str.substring(start, end) : str.toString();
};

Domain

Subdomains

Frequently Asked Questions

What does trimChar() do?
trimChar() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/serializer/gelSerializer.ts.
Where is trimChar() defined?
trimChar() is defined in drizzle-kit/src/serializer/gelSerializer.ts at line 901.
What calls trimChar()?
trimChar() is called by 2 function(s): fromDatabase, schemaToTypeScript.

Analyze Your Own Codebase

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

Try Supermodel Free