Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else if (existingMessage) {
return prev;
}
// Add the new message to the data
return Object.assign({}, prev, {
...prev,
directMessageThread: {
...prev.directMessageThread,
messageConnection: {
...prev.directMessageThread.messageConnection,
edges: [
...prev.directMessageThread.messageConnection.edges,
{
node: newMessage,
cursor: btoa(newMessage.id),
__typename: 'DirectMessageEdge',
},
],
},
},
});
},
});
function getRequestParams(argv) {
// use `--host=https://somedomain.com:5601` or else http://localhost:5601 is defaulted
const host = argv.host || 'http://localhost:5601';
// use `--auth=myuser:mypassword` or else elastic:changeme is defaulted
// passing `--auth` with no value effectively sends no auth
const auth = argv.auth || 'elastic:changeme';
const authStr = abab.btoa(auth);
// auto-add a leading slash to basePath
const basePath = argv.basePath ? '/' + argv.basePath : '';
return {
host,
auth: `Basic ${authStr}`,
basePath,
};
}
isBase64Encoded(obj){
try{
return obj && (btoa(atob(obj)) === obj);
}catch(e){
return false;
}
}
};
edge => {
if (edge.node.id === messageInStore.id)
return {
...edge,
cursor: btoa(addMessage.id),
node: addMessage,
};
return edge;
}
);
this.btoa = function (str) {
const result = btoa(str);
if (result === null) {
throw new DOMException("The string to be encoded contains invalid characters.", "InvalidCharacterError");
}
return result;
};
this.btoa = function (str) {
const result = btoa(str);
if (result === null) {
throw new DOMException("The string to be encoded contains invalid characters.", "InvalidCharacterError");
}
return result;
};
this.btoa = function (str) {
const result = btoa(str);
if (result === null) {
throw new DOMException("The string to be encoded contains invalid characters.", "InvalidCharacterError");
}
return result;
};