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

normalizeFieldValue() — drizzle-orm Function Reference

Architecture documentation for the normalizeFieldValue() function in session.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  26fdc4c5_884c_5e0a_0a4a_2a55076a179c["normalizeFieldValue()"]
  058d4164_8a6e_e307_11eb_23f5c52611d5["session.ts"]
  26fdc4c5_884c_5e0a_0a4a_2a55076a179c -->|defined in| 058d4164_8a6e_e307_11eb_23f5c52611d5
  aeaeb9a8_8f44_2e12_6c95_c00b1bd0a997["all()"]
  aeaeb9a8_8f44_2e12_6c95_c00b1bd0a997 -->|calls| 26fdc4c5_884c_5e0a_0a4a_2a55076a179c
  b77391e5_131a_4f3c_614d_65fffc9bed0b["get()"]
  b77391e5_131a_4f3c_614d_65fffc9bed0b -->|calls| 26fdc4c5_884c_5e0a_0a4a_2a55076a179c
  style 26fdc4c5_884c_5e0a_0a4a_2a55076a179c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/sql-js/session.ts lines 197–211

function normalizeFieldValue(value: unknown) {
	if (value instanceof Uint8Array) { // eslint-disable-line no-instanceof/no-instanceof
		if (typeof Buffer !== 'undefined') {
			if (!(value instanceof Buffer)) { // eslint-disable-line no-instanceof/no-instanceof
				return Buffer.from(value);
			}
			return value;
		}
		if (typeof TextDecoder !== 'undefined') {
			return new TextDecoder().decode(value);
		}
		throw new Error('TextDecoder is not available. Please provide either Buffer or TextDecoder polyfill.');
	}
	return value;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does normalizeFieldValue() do?
normalizeFieldValue() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/sql-js/session.ts.
Where is normalizeFieldValue() defined?
normalizeFieldValue() is defined in drizzle-orm/src/sql-js/session.ts at line 197.
What calls normalizeFieldValue()?
normalizeFieldValue() is called by 2 function(s): all, get.

Analyze Your Own Codebase

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

Try Supermodel Free