Skip to content

Commit

Permalink
fix(build): add missing build
Browse files Browse the repository at this point in the history
  • Loading branch information
kalitine committed Sep 12, 2016
1 parent fe53c78 commit c0fe60e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 12 deletions.
34 changes: 28 additions & 6 deletions bin/index.es5.min.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
#!/usr/bin/env node
var set = function set(object, property, value, receiver) {
var desc = Object.getOwnPropertyDescriptor(object, property);

if (desc === undefined) {
var parent = Object.getPrototypeOf(object);

if (parent !== null) {
set(parent, property, value, receiver);
}
} else if ("value" in desc && desc.writable) {
desc.value = value;
} else {
var setter = desc.set;

if (setter !== undefined) {
setter.call(receiver, value);
}
}

return value;
};

var slicedToArray = function () {
function sliceIterator(arr, i) {
var _arr = [];
Expand Down Expand Up @@ -73,13 +95,13 @@ function start(host, port) {
try {
msg = JSON.parse(data);
} catch (event) {
error(socket, MESSAGE_TYPE_ERROR, 'Server accepts only JSON string');
error$1(socket, MESSAGE_TYPE_ERROR, 'Server accepts only JSON string');
}
try {
if ('key' in msg) {
if (keyExists(msg.key)) {
socket.send('{"isKeyOk":false}');
error(socket, KEY_ALREADY_EXISTS, 'The key ' + msg.key + ' exists already');
error$1(socket, KEY_ALREADY_EXISTS, 'The key ' + msg.key + ' exists already');
} else {
socket.send('{"isKeyOk":true}');
socket.$connectingPeers = new Map();
Expand Down Expand Up @@ -121,7 +143,7 @@ function start(host, port) {
})();
} else {
socket.send('{"isKeyOk":false}');
error(socket, KEY_UNKNOWN, 'Unknown key: ' + msg.join);
error$1(socket, KEY_UNKNOWN, 'Unknown key: ' + msg.join);
}
} else if ('data' in msg) {
if ('$keyHolder' in socket) {
Expand Down Expand Up @@ -162,10 +184,10 @@ function start(host, port) {
console.log('The client has not been assigned yet to a keyHolder');
}
} else {
error(socket, MESSAGE_UNKNOWN_ATTRIBUTE, 'Unknown JSON attribute: ' + data);
error$1(socket, MESSAGE_UNKNOWN_ATTRIBUTE, 'Unknown JSON attribute: ' + data);
}
} catch (err) {
error(socket, err.code, err.message);
error$1(socket, err.code, err.message);
}
});

Expand All @@ -175,7 +197,7 @@ function start(host, port) {
});
}

function error(socket, code, msg) {
function error$1(socket, code, msg) {
console.trace();
console.log('Error ' + code + ': ' + msg);
socket.close(code, msg);
Expand Down
34 changes: 28 additions & 6 deletions dist/sigver.es5.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@
(factory((global.sigver = global.sigver || {})));
}(this, (function (exports) { 'use strict';

var set = function set(object, property, value, receiver) {
var desc = Object.getOwnPropertyDescriptor(object, property);

if (desc === undefined) {
var parent = Object.getPrototypeOf(object);

if (parent !== null) {
set(parent, property, value, receiver);
}
} else if ("value" in desc && desc.writable) {
desc.value = value;
} else {
var setter = desc.set;

if (setter !== undefined) {
setter.call(receiver, value);
}
}

return value;
};

var slicedToArray = function () {
function sliceIterator(arr, i) {
var _arr = [];
Expand Down Expand Up @@ -78,13 +100,13 @@ function start(host, port) {
try {
msg = JSON.parse(data);
} catch (event) {
error(socket, MESSAGE_TYPE_ERROR, 'Server accepts only JSON string');
error$1(socket, MESSAGE_TYPE_ERROR, 'Server accepts only JSON string');
}
try {
if ('key' in msg) {
if (keyExists(msg.key)) {
socket.send('{"isKeyOk":false}');
error(socket, KEY_ALREADY_EXISTS, 'The key ' + msg.key + ' exists already');
error$1(socket, KEY_ALREADY_EXISTS, 'The key ' + msg.key + ' exists already');
} else {
socket.send('{"isKeyOk":true}');
socket.$connectingPeers = new Map();
Expand Down Expand Up @@ -126,7 +148,7 @@ function start(host, port) {
})();
} else {
socket.send('{"isKeyOk":false}');
error(socket, KEY_UNKNOWN, 'Unknown key: ' + msg.join);
error$1(socket, KEY_UNKNOWN, 'Unknown key: ' + msg.join);
}
} else if ('data' in msg) {
if ('$keyHolder' in socket) {
Expand Down Expand Up @@ -167,10 +189,10 @@ function start(host, port) {
console.log('The client has not been assigned yet to a keyHolder');
}
} else {
error(socket, MESSAGE_UNKNOWN_ATTRIBUTE, 'Unknown JSON attribute: ' + data);
error$1(socket, MESSAGE_UNKNOWN_ATTRIBUTE, 'Unknown JSON attribute: ' + data);
}
} catch (err) {
error(socket, err.code, err.message);
error$1(socket, err.code, err.message);
}
});

Expand All @@ -185,7 +207,7 @@ function stop() {
server.close();
}

function error(socket, code, msg) {
function error$1(socket, code, msg) {
console.trace();
console.log('Error ' + code + ': ' + msg);
socket.close(code, msg);
Expand Down

0 comments on commit c0fe60e

Please sign in to comment.