@bbn/bbn 1.0.431 → 1.0.433

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.
@@ -13,9 +13,10 @@ import isFunction from '../type/isFunction.js';
13
13
  * @param {String} st The string to copy.
14
14
  * @returns
15
15
  */
16
- var fire = function (st) {
16
+ var fire = function (st, type) {
17
+ if (type === void 0) { type = 'text/plain'; }
17
18
  var transfer = new DataTransfer();
18
- transfer.setData("text/plain", st);
19
+ transfer.setData(type, st);
19
20
  var copyEvent = new ClipboardEvent('copy', {
20
21
  bubbles: true,
21
22
  cancelable: true,
@@ -32,6 +33,9 @@ export default function copy(st, noDispatch) {
32
33
  navigator.clipboard.write([new ClipboardItem((_a = {}, _a[st.type.toString()] = st, _a))]).then(function () {
33
34
  resolve(true);
34
35
  });
36
+ if (!noDispatch) {
37
+ fire(st, st.type.toString());
38
+ }
35
39
  }
36
40
  else if (isObject(st) && isFunction(st.toBlob)) {
37
41
  st.toBlob(function (blob) {
@@ -39,7 +43,7 @@ export default function copy(st, noDispatch) {
39
43
  var item = new ClipboardItem((_a = {}, _a[blob.type.toString()] = blob, _a));
40
44
  navigator.clipboard.write([item]).then(function () {
41
45
  if (!noDispatch) {
42
- fire(st);
46
+ fire(st, blob.type.toString());
43
47
  }
44
48
  resolve(true);
45
49
  });
@@ -61,7 +61,6 @@ export default function filter(arr, prop, val, operator) {
61
61
  if (!prop || !arr.length) {
62
62
  return arr;
63
63
  }
64
- bbn.env._enumerated.push(true);
65
64
  if (typeof prop === 'object') {
66
65
  operator = val;
67
66
  cfg = prop;
@@ -74,9 +73,13 @@ export default function filter(arr, prop, val, operator) {
74
73
  }
75
74
  if (typeof (prop) === 'function') {
76
75
  for (var i = 0; i < arr.length; i++) {
76
+ bbn.env._enumerated.push(true);
77
77
  if (prop(arr[i], i)) {
78
+ bbn.env._enumerated.pop();
78
79
  res.push(arr[i]);
80
+ bbn.env._enumerated.push(true);
79
81
  }
82
+ bbn.env._enumerated.pop();
80
83
  }
81
84
  }
82
85
  else {
@@ -89,7 +92,6 @@ export default function filter(arr, prop, val, operator) {
89
92
  }
90
93
  }
91
94
  }
92
- bbn.env._enumerated.pop();
93
95
  return res;
94
96
  }
95
97
  ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.431",
3
+ "version": "1.0.433",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",