]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/nerf-dart.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / lib / config / nerf-dart.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/nerf-dart.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/nerf-dart.js
new file mode 100644 (file)
index 0000000..07c8175
--- /dev/null
@@ -0,0 +1,23 @@
+var url = require("url")
+
+module.exports = toNerfDart
+
+/**
+ * Maps a URL to an identifier.
+ *
+ * Name courtesy schiffertronix media LLC, a New Jersey corporation
+ *
+ * @param {String} uri The URL to be nerfed.
+ *
+ * @returns {String} A nerfed URL.
+ */
+function toNerfDart(uri) {
+  var parsed = url.parse(uri)
+  delete parsed.protocol
+  delete parsed.auth
+  delete parsed.query
+  delete parsed.search
+  delete parsed.hash
+
+  return url.resolve(url.format(parsed), ".")
+}