mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-19 06:35:44 +01:00
Answer architecture round 1: 0 🔴, 7 🟡 (0 misread); test BlockText's measures and the batching against one run per pass, one withinLongest, marker facts beside their readers
This commit is contained in:
+2
-2
@@ -18,8 +18,8 @@ export function tooLong<T>(): Result<T> {
|
||||
return failure('unsupported-node-shape', `this conversion would build text longer than ${longestOutput} characters, the longest this library writes`, [])
|
||||
}
|
||||
|
||||
export function withinLongest(text: string): Result<string> {
|
||||
return text.length > longestOutput ? tooLong() : success(text)
|
||||
export function withinLongest<T>(length: number, value: T): Result<T> {
|
||||
return length > longestOutput ? tooLong() : success(value)
|
||||
}
|
||||
|
||||
export function joinedWithin(pieces: Iterable<string>): Result<string> {
|
||||
|
||||
Reference in New Issue
Block a user