chore(angular.toJson): use charAt instead of regexp