]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/shim.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / node-gyp / node_modules / path-array / node_modules / array-index / node_modules / es6-symbol / node_modules / es5-ext / string / from-code-point / shim.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/shim.js
new file mode 100644 (file)
index 0000000..41fd737
--- /dev/null
@@ -0,0 +1,30 @@
+// Based on:
+// http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/
+// and:
+// https://github.com/mathiasbynens/String.fromCodePoint/blob/master
+// /fromcodepoint.js
+
+'use strict';
+
+var floor = Math.floor, fromCharCode = String.fromCharCode;
+
+module.exports = function (codePoint/*, â€¦codePoints*/) {
+       var chars = [], l = arguments.length, i, c, result = '';
+       for (i = 0; i < l; ++i) {
+               c = Number(arguments[i]);
+               if (!isFinite(c) || c < 0 || c > 0x10FFFF || floor(c) !== c) {
+                       throw new RangeError("Invalid code point " + c);
+               }
+
+               if (c < 0x10000) {
+                       chars.push(c);
+               } else {
+                       c -= 0x10000;
+                       chars.push((c >> 10) + 0xD800, (c % 0x400) + 0xDC00);
+               }
+               if (i + 1 !== l && chars.length <= 0x4000) continue;
+               result += fromCharCode.apply(null, chars);
+               chars.length = 0;
+       }
+       return result;
+};