Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

code repetition trim() stripWhitespace() #2890

Closed
fernandolguevara opened this issue Jun 6, 2013 · 1 comment
Closed

code repetition trim() stripWhitespace() #2890

fernandolguevara opened this issue Jun 6, 2013 · 1 comment

Comments

@fernandolguevara
Copy link

both functions do the same thing

function trim(value) {
  return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value;
}

var START_SPACE = /^\s*/;
var END_SPACE = /\s*$/;
function stripWhitespace(str) {
  return isString(str) ? str.replace(START_SPACE, '').replace(END_SPACE, '') : str;
}
@ericsubach
Copy link
Contributor

Issue #2949 addresses this, and a pull request has been issued.

pkozlowski-opensource pushed a commit to pkozlowski-opensource/angular.js that referenced this issue Jul 11, 2013
ctrahey pushed a commit to ctrahey/angular.js that referenced this issue Jul 22, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants