tastypie
Version:
Tastypie is a webservice API framework for Node.js based on Django's Tastypie Framework. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style interfaces
15 lines (12 loc) • 376 B
JavaScript
define(['../lang/toString'], function(toString){
/**
* Remove non-printable ASCII chars
*/
function removeNonASCII(str){
str = toString(str);
// Matches non-printable ASCII chars -
// http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
return str.replace(/[^\x20-\x7E]/g, '');
}
return removeNonASCII;
});