mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
rolling back to the 'or' operator approach. Is safer if the passed parameter is an empty string, for example
This commit is contained in:
parent
14baab7386
commit
439d4bb624
@ -140,8 +140,8 @@ class ClipboardAction {
|
||||
* Sets the `action` to be performed which can be either 'copy' or 'cut'.
|
||||
* @param {String} action
|
||||
*/
|
||||
set action(action = 'copy') {
|
||||
this._action = action;
|
||||
set action(action) {
|
||||
this._action = action || 'copy';
|
||||
|
||||
if (this._action !== 'copy' && this._action !== 'cut') {
|
||||
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
||||
|
Loading…
Reference in New Issue
Block a user