]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/tag.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / npm-registry-client / lib / tag.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/tag.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/tag.js
new file mode 100644 (file)
index 0000000..3b6dad1
--- /dev/null
@@ -0,0 +1,23 @@
+module.exports = tag
+
+var assert = require('assert')
+
+function tag (uri, params, cb) {
+  assert(typeof uri === 'string', 'must pass registry URI to tag')
+  assert(params && typeof params === 'object', 'must pass params to tag')
+  assert(typeof cb === 'function', 'must pass callback to tag')
+
+  assert(typeof params.version === 'string', 'must pass version to tag')
+  assert(typeof params.tag === 'string', 'must pass tag name to tag')
+  assert(
+    params.auth && typeof params.auth === 'object',
+    'must pass auth to tag'
+  )
+
+  var options = {
+    method: 'PUT',
+    body: JSON.stringify(params.version),
+    auth: params.auth
+  }
+  this.request(uri + '/' + params.tag, options, cb)
+}