utiller 1.0.131 → 1.0.132

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.
@@ -553,13 +553,18 @@ var Utiller = /*#__PURE__*/function () {
553
553
  }()
554
554
  /** 如果是array,用 indexOf檢查each
555
555
  * 如果是object,看有沒有這個key
556
- * 如果是string, 就檢查有沒有包含 */
556
+ * 如果是string, 就檢查有沒有包含
557
+ * precisely 就是用findIndex,去比較value
558
+ *
559
+ * */
557
560
 
558
561
  }, {
559
562
  key: "has",
560
563
  value: function has(collection, item) {
564
+ var precisely = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
565
+
561
566
  if (_lodash["default"].isArray(collection)) {
562
- return _lodash["default"].indexOf(collection, item) > -1;
567
+ if (precisely) return _lodash["default"].findIndex(collection, item) > -1;else return _lodash["default"].indexOf(collection, item) > -1;
563
568
  }
564
569
 
565
570
  if (_lodash["default"].isObject(item)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utiller",
3
- "version": "1.0.131",
3
+ "version": "1.0.132",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "configerer": "^1.0.11",
14
- "utiller": "^1.0.130",
14
+ "utiller": "^1.0.131",
15
15
  "linepayer": "^1.0.4",
16
16
  "databazer": "^1.0.11",
17
17
  "lodash": "^4.17.20",