@bitblit/ratchet-common 4.0.112-alpha → 4.0.115-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -188,4 +188,14 @@ export class StringRatchet {
|
|
|
188
188
|
}
|
|
189
189
|
return rval;
|
|
190
190
|
}
|
|
191
|
+
static stripNonAscii(value) {
|
|
192
|
+
const reduced = [...value].reduce((previousValue, currentValue) => {
|
|
193
|
+
const charCode = currentValue.charCodeAt(0);
|
|
194
|
+
if (charCode > 127) {
|
|
195
|
+
return previousValue;
|
|
196
|
+
}
|
|
197
|
+
return previousValue + currentValue;
|
|
198
|
+
});
|
|
199
|
+
return reduced;
|
|
200
|
+
}
|
|
191
201
|
}
|