@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.
@@ -24,4 +24,5 @@ export declare class StringRatchet {
24
24
  private static trimAllStringPropertiesInPlace;
25
25
  static stripNonNumeric(input: string): string;
26
26
  static csvSafe(input: any): string;
27
+ static stripNonAscii(value: string): string;
27
28
  }
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitblit/ratchet-common",
3
- "version": "4.0.112-alpha",
3
+ "version": "4.0.115-alpha",
4
4
  "description": "Common tools for general use",
5
5
  "type": "module",
6
6
  "module": "index.js",