mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-14 18:42:24 +03:00
feat(plugin-helper): move getUniqAttr from preset to plugin helper (#63)
This commit is contained in:
committed by
GitHub
parent
2cfe729d75
commit
f28f19e64c
@@ -63,11 +63,23 @@ const attrsToString = (values) => {
|
||||
.join(' ');
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets value from
|
||||
* @example
|
||||
* getUniqAttr({ 'foo': true, 'bar': bar' }) => 'bar'
|
||||
* @param attrs
|
||||
* @returns {string}
|
||||
*/
|
||||
const getUniqAttr = (attrs) => Object
|
||||
.keys(attrs)
|
||||
.reduce((res, key) => (attrs[key] === key ? attrs[key] : null), null);
|
||||
|
||||
export {
|
||||
attrsToString,
|
||||
attrValue,
|
||||
appendToNode,
|
||||
getNodeLength,
|
||||
getUniqAttr,
|
||||
isTagNode,
|
||||
isStringNode,
|
||||
isEOL,
|
||||
|
||||
Reference in New Issue
Block a user