[Pkg-javascript-commits] [node-entities] 49/63: renamed entities/ dir to maps/

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 6f17c8b813e976df10e8765db5f491eda611f96e
Author: fb55 <me at feedic.com>
Date:   Mon Mar 17 21:14:46 2014 +0100

    renamed entities/ dir to maps/
---
 lib/decode.js                    | 6 +++---
 lib/decode_codepoint.js          | 5 +++--
 lib/encode.js                    | 4 ++--
 {entities => maps}/decode.json   | 0
 {entities => maps}/entities.json | 0
 {entities => maps}/legacy.json   | 0
 {entities => maps}/xml.json      | 0
 7 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/decode.js b/lib/decode.js
index e53d617..5e48bdb 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("../maps/entities.json"),
+    legacyMap = require("../maps/legacy.json"),
+    xmlMap    = require("../maps/xml.json"),
     decodeCodePoint = require("./decode_codepoint.js");
 
 var decodeXMLStrict  = getStrictDecoder(xmlMap),
diff --git a/lib/decode_codepoint.js b/lib/decode_codepoint.js
index eefecaa..730d5bf 100644
--- a/lib/decode_codepoint.js
+++ b/lib/decode_codepoint.js
@@ -1,10 +1,9 @@
-var decodeMap = require("../entities/decode.json");
+var decodeMap = require("../maps/decode.json");
 
 module.exports = decodeCodePoint;
 
 // modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
 function decodeCodePoint(codePoint){
-	var output = "";
 
 	if((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF){
 		return "\uFFFD";
@@ -14,6 +13,8 @@ function decodeCodePoint(codePoint){
 		codePoint = decodeMap[codePoint];
 	}
 
+	var output = "";
+
 	if(codePoint > 0xFFFF){
 		codePoint -= 0x10000;
 		output += String.fromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
diff --git a/lib/encode.js b/lib/encode.js
index 76df2c0..04f1d2a 100644
--- a/lib/encode.js
+++ b/lib/encode.js
@@ -1,9 +1,9 @@
-var inverseXML = getInverseObj(require("../entities/xml.json")),
+var inverseXML = getInverseObj(require("../maps/xml.json")),
     xmlReplacer = getInverseReplacer(inverseXML);
 
 exports.XML = getInverse(inverseXML, xmlReplacer);
 
-var inverseHTML = getInverseObj(require("../entities/entities.json")),
+var inverseHTML = getInverseObj(require("../maps/entities.json")),
     htmlReplacer = getInverseReplacer(inverseHTML);
 
 exports.HTML = getInverse(inverseHTML, htmlReplacer);
diff --git a/entities/decode.json b/maps/decode.json
similarity index 100%
rename from entities/decode.json
rename to maps/decode.json
diff --git a/entities/entities.json b/maps/entities.json
similarity index 100%
rename from entities/entities.json
rename to maps/entities.json
diff --git a/entities/legacy.json b/maps/legacy.json
similarity index 100%
rename from entities/legacy.json
rename to maps/legacy.json
diff --git a/entities/xml.json b/maps/xml.json
similarity index 100%
rename from entities/xml.json
rename to maps/xml.json

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