@lendi-ui/utils
Advanced tools
Comparing version 2.0.0 to 2.1.0
# Changelog - @lendi-ui/utils | ||
## [2.1.0] - 2019-04-30 - [HUB-54] (https://creditandfinance.atlassian.net/browse/HUB-54) | ||
### Added | ||
- Added method to fetch all 'data-' props for a component. | ||
## [2.0.0] - 2019-04-30 - [HUB-54] (https://creditandfinance.atlassian.net/browse/HUB-54) | ||
@@ -4,0 +9,0 @@ |
@@ -13,2 +13,15 @@ import { map } from '@lendi-ui/breakpoint'; | ||
}; | ||
/** | ||
* return all the props of an object where the key begins with 'data-' | ||
* @param props The props object of a given component | ||
*/ | ||
export var getDataProps = function (props) { | ||
var dataProps = {}; | ||
for (var key in props) { | ||
if (key.startsWith('data-')) { | ||
dataProps[key] = props[key]; | ||
} | ||
} | ||
return dataProps; | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -9,1 +9,13 @@ import { BreakpointValue, BreakpointValueMap } from '@lendi-ui/breakpoint'; | ||
export declare const deriveSize: (multiplier: number) => string; | ||
interface ComponentProps { | ||
[key: string]: any; | ||
} | ||
interface DataObject { | ||
[key: string]: string; | ||
} | ||
/** | ||
* return all the props of an object where the key begins with 'data-' | ||
* @param props The props object of a given component | ||
*/ | ||
export declare const getDataProps: (props: ComponentProps) => DataObject; | ||
export {}; |
{ | ||
"name": "@lendi-ui/utils", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"source": "src/index.ts", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
Sorry, the diff of this file is not supported yet
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
3307
45