@@ -1013,10 +1013,11 @@ module.exports = function (chai, util) {
1013
1013
} ;
1014
1014
1015
1015
/**
1016
- * ### .nestedInclude(targetObj , nestedObject, [msg ])
1016
+ * ### .nestedInclude(targetObject , nestedObject, [message ])
1017
1017
*
1018
1018
* Asserts that 'targetObject' includes 'nestedObject'.
1019
- * Enables the use of dot- and bracket-notation for referencing nested properties.
1019
+ * Enables the use of dot- and bracket-notation for referencing nested
1020
+ * properties.
1020
1021
* '[]' and '.' in property names can be escaped using double backslashes.
1021
1022
*
1022
1023
* assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'});
@@ -1035,10 +1036,11 @@ module.exports = function (chai, util) {
1035
1036
} ;
1036
1037
1037
1038
/**
1038
- * ### .notNestedInclude(targetObj, nestedObj , [msg ])
1039
+ * ### .notNestedInclude(targetObject, nestedObject , [message ])
1039
1040
*
1040
1041
* Asserts that 'targetObject' does not include 'nestedObject'.
1041
- * Enables the use of dot- and bracket-notation for referencing nested properties.
1042
+ * Enables the use of dot- and bracket-notation for referencing nested
1043
+ * properties.
1042
1044
* '[]' and '.' in property names can be escaped using double backslashes.
1043
1045
*
1044
1046
* assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'y'});
@@ -1054,18 +1056,21 @@ module.exports = function (chai, util) {
1054
1056
*/
1055
1057
1056
1058
assert . notNestedInclude = function ( exp , inc , msg ) {
1057
- new Assertion ( exp , msg , assert . notNestedInclude , true ) . not . nested . include ( inc ) ;
1059
+ new Assertion ( exp , msg , assert . notNestedInclude , true )
1060
+ . not . nested . include ( inc ) ;
1058
1061
} ;
1059
1062
1060
1063
/**
1061
- * ### .deepNestedInclude(targetObject, nestedObject, [msg ])
1064
+ * ### .deepNestedInclude(targetObject, nestedObject, [message ])
1062
1065
*
1063
- * Asserts that 'targetObj' includes 'nestedObject' while checking for deep equality.
1064
- * Enables the user of dot- and bracket-notation for referencing nested properties.
1066
+ * Asserts that 'targetObject' includes 'nestedObject' while checking for
1067
+ * deep equality.
1068
+ * Enables the use of dot- and bracket-notation for referencing nested
1069
+ * properties.
1065
1070
* '[]' and '.' in property names can be escaped using double backslashes.
1066
1071
*
1067
- * assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}})
1068
- * assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}});
1072
+ * assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}})
1073
+ * assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}});
1069
1074
*
1070
1075
* @name deepNestedInclude
1071
1076
* @param {Object } targetObject
@@ -1076,18 +1081,21 @@ module.exports = function (chai, util) {
1076
1081
*/
1077
1082
1078
1083
assert . deepNestedInclude = function ( exp , inc , msg ) {
1079
- new Assertion ( exp , msg , assert . deepNestedInclude , true ) . deep . nested . include ( inc ) ;
1084
+ new Assertion ( exp , msg , assert . deepNestedInclude , true )
1085
+ . deep . nested . include ( inc ) ;
1080
1086
} ;
1081
1087
1082
1088
/**
1083
- * ### .notDeepNestedInclude(targetObject, nestedObject, [msg ])
1089
+ * ### .notDeepNestedInclude(targetObject, nestedObject, [message ])
1084
1090
*
1085
- * Asserts that 'targetObj' does not include 'nestedObject' while checking for deep equality.
1086
- * Enables the user of dot- and bracket-notation for referencing nested properties.
1091
+ * Asserts that 'targetObject' does not include 'nestedObject' while
1092
+ * checking for deep equality.
1093
+ * Enables the use of dot- and bracket-notation for referencing nested
1094
+ * properties.
1087
1095
* '[]' and '.' in property names can be escaped using double backslashes.
1088
1096
*
1089
- * assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}})
1090
- * assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}});
1097
+ * assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}})
1098
+ * assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}});
1091
1099
*
1092
1100
* @name notDeepNestedInclude
1093
1101
* @param {Object } targetObject
@@ -1098,7 +1106,50 @@ module.exports = function (chai, util) {
1098
1106
*/
1099
1107
1100
1108
assert . notDeepNestedInclude = function ( exp , inc , msg ) {
1101
- new Assertion ( exp , msg , assert . notDeepNestedInclude , true ) . not . deep . nested . include ( inc ) ;
1109
+ new Assertion ( exp , msg , assert . notDeepNestedInclude , true )
1110
+ . not . deep . nested . include ( inc ) ;
1111
+ } ;
1112
+
1113
+ /**
1114
+ * ### .ownInclude(targetObject, objectToBeIncluded, [message])
1115
+ *
1116
+ * Asserts that 'targetObject' includes 'objectToBeIncluded' while
1117
+ * ignoring inherited properties.
1118
+ *
1119
+ * assert.OwnInclude({ a: 1 }, { a: 1 });
1120
+ *
1121
+ * @name ownInclude
1122
+ * @param {Object } targetObject
1123
+ * @param {Object } objectToBeIncluded
1124
+ * @param {String } message
1125
+ * @namespace Assert
1126
+ * @api public
1127
+ */
1128
+
1129
+ assert . ownInclude = function ( exp , inc , msg ) {
1130
+ new Assertion ( exp , msg , assert . ownInclude , true ) . own . include ( inc ) ;
B41A
1131
+ } ;
1132
+
1133
+ /**
1134
+ * ### .notOwnInclude(targetObject, objectToNotBeIncluded, [message])
1135
+ *
1136
+ * Asserts that 'targetObject' does not include 'objectToNotBeIncluded' while
1137
+ * ignoring inherited properties.
1138
+ *
1139
+ * Object.prototype.b = 2;
1140
+ *
1141
+ * assert.notOwnInclude({ a: 1 }, { b: 2 });
1142
+ *
1143
+ * @name notOwnInclude
1144
+ * @param {Object } targetObject
1145
+ * @param {Object } objectToNotBeIncluded
1146
+ * @param {String } message
1147
+ * @namespace Assert
1148
+ * @api public
1149
+ */
1150
+
1151
+ assert . notOwnInclude = function ( exp , inc , msg ) {
1152
+ new Assertion ( exp , msg , assert . notOwnInclude , true ) . not . own . include ( inc ) ;
1102
1153
} ;
1103
1154
1104
1155
/**
0 commit comments