@ecodev/natural 41.1.3 → 41.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -654,6 +654,18 @@
654
654
  return source;
655
655
  }
656
656
  }
657
+ /**
658
+ * Copy text to clipboard.
659
+ * Accepts line breaks `\n` as textarea do.
660
+ */
661
+ function copyToClipboard(document, text) {
662
+ var input = document.createElement('textarea');
663
+ document.body.append(input);
664
+ input.value = text;
665
+ input.select();
666
+ document.execCommand('copy');
667
+ document.body.removeChild(input);
668
+ }
657
669
 
658
670
  // Basic; loosely typed structure for graphql-doctrine filters
659
671
  // Logical operator to be used in conditions
@@ -742,9 +754,13 @@
742
754
  }
743
755
  this.updateVariables();
744
756
  };
757
+ /**
758
+ * Return a deep clone of the variables for the given channel name.
759
+ *
760
+ * Avoid returning the same reference to prevent an attribute change, then another channel update that would
761
+ * used this changed attribute without having explicitly asked QueryVariablesManager to update it.
762
+ */
745
763
  NaturalQueryVariablesManager.prototype.get = function (channelName) {
746
- // Avoid to return the same reference to prevent an attribute change, then another channel update that would used this changed
747
- // attribute without having explicitly asked QueryVariablesManager to update it.
748
764
  return lodashEs.cloneDeep(this.channels.get(channelName));
749
765
  };
750
766
  /**
@@ -11248,6 +11264,7 @@
11248
11264
  exports.cancellableTimeout = cancellableTimeout;
11249
11265
  exports.cleanSameValues = cleanSameValues;
11250
11266
  exports.collectErrors = collectErrors;
11267
+ exports.copyToClipboard = copyToClipboard;
11251
11268
  exports.debug = debug;
11252
11269
  exports.decimal = decimal;
11253
11270
  exports.deliverableEmail = deliverableEmail;