File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
- const { hasOwnProperty : hasOwnProp } = Object . prototype ;
2
1
3
2
/**
4
3
* @typedef {null|boolean|number|string|PlainObject|GenericArray } JSONObject
@@ -12,6 +11,17 @@ const {hasOwnProperty: hasOwnProp} = Object.prototype;
12
11
* @typedef {any } AnyResult
13
12
*/
14
13
14
+ /**
15
+ * Check if the provided property name exists on the object.
16
+ * @param {string } name Name of the property to check
17
+ * @returns {boolean } Whether the object has the property or not
18
+ */
19
+ function hasOwnProp ( name ) {
20
+ return typeof this === 'object'
21
+ ? name in this
22
+ : Object . prototype . hasOwnProperty . call ( this , name ) ;
23
+ }
24
+
15
25
/**
16
26
* Copies array and then pushes item into it.
17
27
* @param {GenericArray } arr Array to copy and into which to push
You can’t perform that action at this time.
0 commit comments