pick-react-known-prop
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -280,25 +280,143 @@ module.exports = | ||
'use strict'; | ||
/** | ||
* lodash (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
* Released under MIT license <https://lodash.com/license> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
/** `Object#toString` result references. */ | ||
var objectTag = '[object Object]'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/** | ||
* Checks if `value` is a host object in IE < 9. | ||
* | ||
* @private | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a host object, else `false`. | ||
*/ | ||
function isHostObject(value) { | ||
// Many host objects are `Object` objects that can coerce to strings | ||
// despite having improperly defined `toString` methods. | ||
var result = false; | ||
if (value != null && typeof value.toString != 'function') { | ||
try { | ||
result = !!(value + ''); | ||
} catch (e) {} | ||
} | ||
return result; | ||
} | ||
exports.default = isPlainObject; | ||
function isPlainObject(obj) { | ||
var isObjectLike = obj !== null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object'; | ||
if (!isObjectLike || Object.prototype.toString.call(obj) !== '[object Object]') { | ||
/** | ||
* Creates a unary function that invokes `func` with its argument transformed. | ||
* | ||
* @private | ||
* @param {Function} func The function to wrap. | ||
* @param {Function} transform The argument transform. | ||
* @returns {Function} Returns the new function. | ||
*/ | ||
function overArg(func, transform) { | ||
return function(arg) { | ||
return func(transform(arg)); | ||
}; | ||
} | ||
/** Used for built-in method references. */ | ||
var funcProto = Function.prototype, | ||
objectProto = Object.prototype; | ||
/** Used to resolve the decompiled source of functions. */ | ||
var funcToString = funcProto.toString; | ||
/** Used to check objects for own properties. */ | ||
var hasOwnProperty = objectProto.hasOwnProperty; | ||
/** Used to infer the `Object` constructor. */ | ||
var objectCtorString = funcToString.call(Object); | ||
/** | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var objectToString = objectProto.toString; | ||
/** Built-in value references. */ | ||
var getPrototype = overArg(Object.getPrototypeOf, Object); | ||
/** | ||
* Checks if `value` is object-like. A value is object-like if it's not `null` | ||
* and has a `typeof` result of "object". | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
* @example | ||
* | ||
* _.isObjectLike({}); | ||
* // => true | ||
* | ||
* _.isObjectLike([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObjectLike(_.noop); | ||
* // => false | ||
* | ||
* _.isObjectLike(null); | ||
* // => false | ||
*/ | ||
function isObjectLike(value) { | ||
return !!value && typeof value == 'object'; | ||
} | ||
/** | ||
* Checks if `value` is a plain object, that is, an object created by the | ||
* `Object` constructor or one with a `[[Prototype]]` of `null`. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 0.8.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`. | ||
* @example | ||
* | ||
* function Foo() { | ||
* this.a = 1; | ||
* } | ||
* | ||
* _.isPlainObject(new Foo); | ||
* // => false | ||
* | ||
* _.isPlainObject([1, 2, 3]); | ||
* // => false | ||
* | ||
* _.isPlainObject({ 'x': 0, 'y': 0 }); | ||
* // => true | ||
* | ||
* _.isPlainObject(Object.create(null)); | ||
* // => true | ||
*/ | ||
function isPlainObject(value) { | ||
if (!isObjectLike(value) || | ||
objectToString.call(value) != objectTag || isHostObject(value)) { | ||
return false; | ||
} | ||
var proto = Object.getPrototypeOf(obj); | ||
var proto = getPrototype(value); | ||
if (proto === null) { | ||
return true; | ||
} | ||
var Ctor = Object.hasOwnProperty.call(proto, 'constructor') && proto.constructor; | ||
return typeof Ctor == 'function' && Ctor instanceof Ctor && Function.prototype.toString.call(Ctor) === Function.prototype.toString.call(Object); | ||
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; | ||
return (typeof Ctor == 'function' && | ||
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); | ||
} | ||
module.exports = isPlainObject; | ||
/***/ }, | ||
@@ -305,0 +423,0 @@ /* 5 */ |
{ | ||
"name": "pick-react-known-prop", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "filters unknown dom properties from props object", | ||
@@ -49,2 +49,3 @@ "main": "dist/index.js", | ||
"html-attributes": "^1.1.0", | ||
"lodash.isplainobject": "^4.0.6", | ||
"svg-attributes": "^1.0.0" | ||
@@ -63,8 +64,17 @@ }, | ||
{ | ||
"name": "Anshul Sahni", | ||
"email": "anshul_sahni@live.com", | ||
"url": "https://github.com/anshulsahni", | ||
"contributions": 4, | ||
"additions": 3, | ||
"deletions": 90, | ||
"hireable": true | ||
}, | ||
{ | ||
"name": "Yuri Tkachenko", | ||
"email": "yuri@ya.ru", | ||
"url": "https://github.com/tyv", | ||
"contributions": 3, | ||
"additions": 262, | ||
"deletions": 26, | ||
"contributions": 4, | ||
"additions": 284, | ||
"deletions": 28, | ||
"hireable": null | ||
@@ -71,0 +81,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22432
653
0
3
+ Addedlodash.isplainobject@^4.0.6
+ Addedlodash.isplainobject@4.0.6(transitive)