@evg-b/evg-ui
Version:
EVG-UI library inspired by Material Design.
19 lines (16 loc) • 781 B
JavaScript
var signatureByProps = function signatureByProps() {
var displayName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'componentEVG';
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var hashByProps = Object.values(props).reduce(function (nowP, nextP) {
if (typeof nextP === 'string' || typeof nextP === 'boolean' || typeof nextP === 'number') {
return nowP + nextP;
} else if (Array.isArray(nextP)) {
return nowP + nextP.length;
} else {
return nowP;
}
}, "".concat(displayName, "-")); // typeof nextP === 'string' || typeof nextP === 'boolean' || typeof nextP === 'number' ? nowP + nextP : nowP
// , `${displayName}-`)
return hashByProps;
};
export default signatureByProps;