@instructure/ui-react-utils
Advanced tools
Comparing version 6.3.1-rc.11 to 6.3.1-rc.12
@@ -34,4 +34,4 @@ /* | ||
export { matchComponentTypes } from './matchComponentTypes'; | ||
export { omitProps, pickProps } from './passthroughProps'; | ||
export { omitProps, pickProps, passthroughProps } from './passthroughProps'; | ||
export { safeCloneElement } from './safeCloneElement'; | ||
export { windowMessageListener } from './windowMessageListener'; |
@@ -24,2 +24,3 @@ /* | ||
*/ | ||
import isPropValid from '@emotion/is-prop-valid'; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
@@ -71,2 +72,13 @@ | ||
export { pickProps, omitProps }; | ||
function passthroughProps(props) { | ||
var validProps = {}; | ||
Object.keys(props) // style and className need to be explicitly passed through | ||
.filter(function (propName) { | ||
return isPropValid(propName) && propName !== 'style' && propName !== 'className'; | ||
}).forEach(function (propName) { | ||
validProps[propName] = props[propName]; | ||
}); | ||
return validProps; | ||
} | ||
export { pickProps, omitProps, passthroughProps }; |
@@ -66,2 +66,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "passthroughProps", { | ||
enumerable: true, | ||
get: function get() { | ||
return _passthroughProps.passthroughProps; | ||
} | ||
}); | ||
Object.defineProperty(exports, "safeCloneElement", { | ||
@@ -68,0 +74,0 @@ enumerable: true, |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,3 +10,6 @@ value: true | ||
exports.omitProps = omitProps; | ||
exports.passthroughProps = passthroughProps; | ||
var _isPropValid = _interopRequireDefault(require("@emotion/is-prop-valid")); | ||
/* | ||
@@ -77,2 +82,13 @@ * The MIT License (MIT) | ||
return pick(props, combined); | ||
} | ||
function passthroughProps(props) { | ||
var validProps = {}; | ||
Object.keys(props) // style and className need to be explicitly passed through | ||
.filter(function (propName) { | ||
return (0, _isPropValid.default)(propName) && propName !== 'style' && propName !== 'className'; | ||
}).forEach(function (propName) { | ||
validProps[propName] = props[propName]; | ||
}); | ||
return validProps; | ||
} |
{ | ||
"name": "@instructure/ui-react-utils", | ||
"version": "6.3.1-rc.11+319abb7c", | ||
"version": "6.3.1-rc.12+df5f505b", | ||
"description": "A React utility library made by Instructure Inc.", | ||
@@ -23,11 +23,12 @@ "author": "Instructure, Inc. Engineering and Product Design", | ||
"devDependencies": { | ||
"@instructure/ui-babel-preset": "6.3.1-rc.11+319abb7c", | ||
"@instructure/ui-test-utils": "6.3.1-rc.11+319abb7c" | ||
"@instructure/ui-babel-preset": "6.3.1-rc.12+df5f505b", | ||
"@instructure/ui-test-utils": "6.3.1-rc.12+df5f505b" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7", | ||
"@instructure/console": "6.3.1-rc.11+319abb7c", | ||
"@instructure/ui-decorator": "6.3.1-rc.11+319abb7c", | ||
"@instructure/ui-dom-utils": "6.3.1-rc.11+319abb7c", | ||
"@instructure/ui-utils": "6.3.1-rc.11+319abb7c", | ||
"@emotion/is-prop-valid": "^0.7.3", | ||
"@instructure/console": "6.3.1-rc.12+df5f505b", | ||
"@instructure/ui-decorator": "6.3.1-rc.12+df5f505b", | ||
"@instructure/ui-dom-utils": "6.3.1-rc.12+df5f505b", | ||
"@instructure/ui-utils": "6.3.1-rc.12+df5f505b", | ||
"prop-types": "^15" | ||
@@ -43,3 +44,3 @@ }, | ||
"sideEffects": false, | ||
"gitHead": "319abb7cb87456002320318f0acd9cbe0f23b136" | ||
"gitHead": "df5f505b1029ca8f21c7d546a800426cf7d8fcad" | ||
} |
@@ -34,4 +34,4 @@ /* | ||
export { matchComponentTypes } from './matchComponentTypes' | ||
export { omitProps, pickProps } from './passthroughProps' | ||
export { omitProps, pickProps, passthroughProps } from './passthroughProps' | ||
export { safeCloneElement } from './safeCloneElement' | ||
export { windowMessageListener } from './windowMessageListener' |
@@ -24,2 +24,3 @@ /* | ||
*/ | ||
import isPropValid from '@emotion/is-prop-valid' | ||
@@ -68,5 +69,19 @@ const hasOwnProperty = Object.prototype.hasOwnProperty | ||
function passthroughProps (props) { | ||
const validProps = {} | ||
Object.keys(props) | ||
// style and className need to be explicitly passed through | ||
.filter(propName => isPropValid(propName) && propName !== 'style' && propName !== 'className') | ||
.forEach((propName) => { | ||
validProps[propName] = props[propName] | ||
}) | ||
return validProps | ||
} | ||
export { | ||
pickProps, | ||
omitProps | ||
omitProps, | ||
passthroughProps | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
129943
3004
9
+ Added@emotion/is-prop-valid@0.7.3(transitive)
+ Added@emotion/memoize@0.7.1(transitive)