Commit 41d0317
committed
Fix the implementation of length validation for strings
The Smithy spec specifies that string length is defined as the number of code
points. JavaScript's String.length returns the number of code units, leading to
inaccurate validation when a string contains characters that use multiple code
units to represent one code point.
Fixes #5091 parent 2f013f6 commit 41d0317
File tree
2 files changed
+8
-2
lines changed- smithy-typescript-ssdk-libs/server-common/src/validation
2 files changed
+8
-2
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
| |||
0 commit comments