utiller 1.0.49 → 1.0.50
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.
- package/lib/utiller/index.js +24 -0
- package/package.json +1 -1
- package/template/sample.package.json +1 -1
package/lib/utiller/index.js
CHANGED
|
@@ -1695,6 +1695,30 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
1695
1695
|
return minor[key] === undefined;
|
|
1696
1696
|
});
|
|
1697
1697
|
}
|
|
1698
|
+
/**
|
|
1699
|
+
*
|
|
1700
|
+
const obj1 = {b:4,c:2};
|
|
1701
|
+
const obj2 = {b:4,c:3};
|
|
1702
|
+
const obj3 = {a:1,b:4,c:3};
|
|
1703
|
+
console.log(util.isContainAndEqual(obj1,obj3)) false
|
|
1704
|
+
console.log(util.isContainAndEqual(obj1,obj3)) true
|
|
1705
|
+
targetObject 是數量比較小那個
|
|
1706
|
+
*/
|
|
1707
|
+
|
|
1708
|
+
}, {
|
|
1709
|
+
key: "isContainAndEqual",
|
|
1710
|
+
value: function isContainAndEqual(targetObject, mainObject) {
|
|
1711
|
+
var equal = true;
|
|
1712
|
+
|
|
1713
|
+
for (var key in targetObject) {
|
|
1714
|
+
if (mainObject[key] === undefined || mainObject[key] !== targetObject[key]) {
|
|
1715
|
+
equal = false;
|
|
1716
|
+
break;
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
return equal;
|
|
1721
|
+
}
|
|
1698
1722
|
}]);
|
|
1699
1723
|
return Utiller;
|
|
1700
1724
|
}();
|
package/package.json
CHANGED