1.2.0 • Published 4 months ago

@wc-toolkit/cem-utilities v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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 object
  • getComponentByClassName - Gets a component from a CEM object based on the class name
  • getComponentByTagName - Gets a component from a CEM object based on the tag name
  • getComponentPublicProperties - Gets a list of public properties from a CEM component
  • getComponentPublicMethods - Get all public methods for a component
  • getComponentEventsWithType - Get all events for a component with the complete event type
  • getCustomEventDetailTypes - 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 description
  • getAttrsAndProps - returns an array of AttributeAndProperty 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 string
  • toKebabCase - 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.
1.2.0

4 months ago

1.1.0

4 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago