mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
🎨
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
/** @babel */
|
||||
|
||||
import crypto from 'crypto'
|
||||
import {clipboard} from 'electron'
|
||||
const crypto = require('crypto')
|
||||
const {clipboard} = require('electron')
|
||||
|
||||
// Extended: Represents the clipboard used for copying and pasting in Atom.
|
||||
//
|
||||
@@ -9,12 +7,13 @@ import {clipboard} from 'electron'
|
||||
//
|
||||
// ## Examples
|
||||
//
|
||||
// ```coffee
|
||||
// ```js
|
||||
// atom.clipboard.write('hello')
|
||||
//
|
||||
// console.log(atom.clipboard.read()) # 'hello'
|
||||
// console.log(atom.clipboard.read()) // 'hello'
|
||||
// ```
|
||||
export default class Clipboard {
|
||||
module.exports =
|
||||
class Clipboard {
|
||||
constructor () {
|
||||
this.reset()
|
||||
}
|
||||
@@ -60,7 +59,7 @@ export default class Clipboard {
|
||||
// * `text` The {String} clipboard text.
|
||||
// * `metadata` The metadata stored by an earlier call to {::write}.
|
||||
readWithMetadata () {
|
||||
let text = this.read()
|
||||
const text = this.read()
|
||||
if (this.signatureForMetadata === this.md5(text)) {
|
||||
return {text, metadata: this.metadata}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user