[Pkg-javascript-commits] [node-entities] 27/63: convert all values to strings

Wolfgang Borgert debacle at moszumanska.debian.org
Mon Sep 22 08:15:46 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository node-entities.

commit 4506c33274e9a0d8b84265e4d20f724fedbadce4
Author: Felix Böhm <me at feedic.com>
Date:   Mon Nov 4 20:05:12 2013 +0100

    convert all values to strings
    
    seemed to cause troubles in MatthewMueller/cheerio#295
---
 index.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index ba80a90..a50d980 100644
--- a/index.js
+++ b/index.js
@@ -113,7 +113,7 @@ function getReverse(obj){
 	}
 
 	return function(data){
-		return data
+		return (data + "")
 				.replace(regex, func)
 				.replace(re_astralSymbols, astralReplacer)
 				.replace(re_nonASCII, nonUTF8Replacer);
@@ -122,6 +122,7 @@ function getReverse(obj){
 
 function genReplaceFunc(regex, func){
 	return function(data){
-		return data.replace(regex, func);
+		return (data + "")
+				.replace(regex, func);
 	};
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-entities.git



More information about the Pkg-javascript-commits mailing list