[Pkg-javascript-commits] [node-entities] 47/63: moved decode_codepoint, fixed requires

Wolfgang Borgert debacle at moszumanska.debian.org
Mon Sep 22 08:15:48 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 884e10e82aad31d9fdf237d9487b38c9ffdc0755
Author: fb55 <me at feedic.com>
Date:   Mon Mar 17 20:37:27 2014 +0100

    moved decode_codepoint, fixed requires
---
 lib/decode.js                                  | 6 +++---
 decode_codepoint.js => lib/decode_codepoint.js | 2 +-
 lib/encode.js                                  | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/decode.js b/lib/decode.js
index ebf586d..e53d617 100644
--- a/lib/decode.js
+++ b/lib/decode.js
@@ -1,6 +1,6 @@
-var entityMap = require("./entities/entities.json"),
-    legacyMap = require("./entities/legacy.json"),
-    xmlMap    = require("./entities/xml.json"),
+var entityMap = require("../entities/entities.json"),
+    legacyMap = require("../entities/legacy.json"),
+    xmlMap    = require("../entities/xml.json"),
     decodeCodePoint = require("./decode_codepoint.js");
 
 var decodeXMLStrict  = getStrictDecoder(xmlMap),
diff --git a/decode_codepoint.js b/lib/decode_codepoint.js
similarity index 91%
rename from decode_codepoint.js
rename to lib/decode_codepoint.js
index ff0e23e..eefecaa 100644
--- a/decode_codepoint.js
+++ b/lib/decode_codepoint.js
@@ -1,4 +1,4 @@
-var decodeMap = require("./entities/decode.json");
+var decodeMap = require("../entities/decode.json");
 
 module.exports = decodeCodePoint;
 
diff --git a/lib/encode.js b/lib/encode.js
index 726f860..76df2c0 100644
--- a/lib/encode.js
+++ b/lib/encode.js
@@ -1,16 +1,16 @@
-var inverseXML = getInverseObj(require("./entities/xml.json")),
+var inverseXML = getInverseObj(require("../entities/xml.json")),
     xmlReplacer = getInverseReplacer(inverseXML);
 
 exports.XML = getInverse(inverseXML, xmlReplacer);
 
-var inverseHTML = getInverseObj(require("./entities/entities.json")),
+var inverseHTML = getInverseObj(require("../entities/entities.json")),
     htmlReplacer = getInverseReplacer(inverseHTML);
 
 exports.HTML = getInverse(inverseHTML, htmlReplacer);
 
 function getInverseObj(obj){
 	return Object.keys(obj).sort().reduce(function(inverse, name){
-		inverse[obj[name]] = name + ";";
+		inverse[obj[name]] = "&" + name + ";";
 		return inverse;
 	}, {});
 }
@@ -36,7 +36,7 @@ function astralReplacer(c){
 
 function getInverse(inverse, re){
 	function func(name){
-		return "&" + inverse[name];
+		return inverse[name];
 	}
 
 	return function(data){

-- 
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