MCPcopy Create free account
hub / github.com/angular/angular / assertValidDateFormatLength

Function assertValidDateFormatLength

packages/common/src/i18n/format_date.ts:138–146  ·  view source on GitHub ↗
(format: string)

Source from the content-addressed store, hash-verified

136}
137
138function assertValidDateFormatLength(format: string) {
139 if (format.length > MAX_DATE_FORMAT_LENGTH) {
140 throw new RuntimeError(
141 RuntimeErrorCode.SUSPICIOUS_DATE_FORMAT,
142 ngDevMode &&
143 `Date format is too long. Exceeded maximum length of ${MAX_DATE_FORMAT_LENGTH} characters.`,
144 );
145 }
146}
147
148/**
149 * Asserts that the given date format is free from common mistakes. Throws an

Callers 1

formatDateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected