mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-09 06:55:03 +00:00
feat: add copy and paste functionality for requests (#5907)
This commit is contained in:
27
packages/bruno-app/src/utils/bruno-clipboard.js
Normal file
27
packages/bruno-app/src/utils/bruno-clipboard.js
Normal file
@@ -0,0 +1,27 @@
|
||||
class BrunoClipboard {
|
||||
constructor() {
|
||||
this.items = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} item - Item to copy
|
||||
*/
|
||||
write(item) {
|
||||
// Limit to one item for now
|
||||
this.items = [item];
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Object} Result with items array
|
||||
*/
|
||||
read() {
|
||||
return {
|
||||
items: this.items,
|
||||
hasData: this.items.length > 0
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const brunoClipboard = new BrunoClipboard();
|
||||
|
||||
export default brunoClipboard;
|
||||
Reference in New Issue
Block a user