UNPKG

@charmr/oauth-button-web

Version:

A lightweight, framework-agnostic OAuth login button as a custom Web Component. Easily drop it into any HTML, React, Angular, or Vue project.

11 lines (10 loc) 313 B
import { kebabsToCamel } from "./kebabsToCamel"; export function extractPropsFromAttributes(el, keys) { const result = {}; keys.forEach((key) => { const camelKey = kebabsToCamel(key); const value = el.getAttribute(key) || ''; result[camelKey] = value; }); return result; }