1.2.0 • Published 4 months ago
@wc-toolkit/cem-utilities v1.2.0
CEM Utilities
These are a set of tools of retrieving and transforming data from the Custom Elements Manifest.
The following docs serve as a quick reference guide to the features of the library. To find out more about these tools, be sure to check out the official docs.
CEM Utility Functions
You can find more details on these functions here.
getAllComponents
- Gets a list of all components from a Custom Elements Manifest objectgetComponentByClassName
- Gets a component from a CEM object based on the class namegetComponentByTagName
- Gets a component from a CEM object based on the tag namegetComponentPublicProperties
- Gets a list of public properties from a CEM componentgetComponentPublicMethods
- Get all public methods for a componentgetComponentEventsWithType
- Get all events for a component with the complete event typegetCustomEventDetailTypes
- Gets a list of event detail types for a given component.
Deep Merge
You can find more details on these functions here.
deepMerge
- a simple utility for merging two objects together.
Component Descriptions
You can find more details on these functions here.
getComponentDetailsTemplate
- returns a formatted string with the details of the various APIs of a custom element.getMainComponentDescription
- returns the component's primary descriptiongetAttrsAndProps
- returns an array ofAttributeAndProperty
objects that contain the attributes and public properties (including those not associated with an attribute) for a component.getPropertyOnlyFields
- returns a list of properties that do not have a corresponding attribute.getMemberDescription
- returns a description for a member of a component with any relevant deprecation information.
String Utilities
You can find more details on these functions here.
removeQuotes
- removes single or double quotes that wrap a stringtoKebabCase
- converts a string to kebab-case.toSentenceCase
- converts a string to sentence-case.toPascalCase
- converts a string to pascal-case.toCamelCase
- converts a string to camel-case.