# core/converters/style.converter.ts

> 12 lines of code and 6 definitions.

Tree: Bane's Lab Social Share
Language: typescript
Layer: processing
Canonical: https://banes-lab.com/anatomy/social-share#file-social-share-core-converters-style-converter-ts
Source text: https://banes-lab.com/source/social-share/core/converters/style.converter.ts.txt

Listed in [core/converters](https://banes-lab.com/api/source/social-share/core/converters.md), after [core/converters/image.converter.ts](https://banes-lab.com/source/social-share/core/converters/image.converter.ts.md).

## Definitions

- `propertyOf` (lexical_declaration, line 7, exported)
- `isUpper` (lexical_declaration, line 3)
- `HYPHEN` (lexical_declaration, line 1)
- `property` (lexical_declaration, line 8, exported)
- `index` (lexical_declaration, line 9, exported)
- `letter` (lexical_declaration, line 10, exported)

## Contained in

- [core/converters](https://banes-lab.com/anatomy/social-share/folder-social-share-core-converters.md)

## Used by

- [core/renderers/stage.renderer.ts](https://banes-lab.com/source/social-share/core/renderers/stage.renderer.ts.md)

## Linked from

- [core/converters](https://banes-lab.com/anatomy/social-share/folder-social-share-core-converters.md)
- [core/renderers](https://banes-lab.com/anatomy/social-share/folder-social-share-core-renderers.md)

## Source

```typescript
const HYPHEN = "-";

const isUpper = function isUpper(letter: string): boolean {
    return letter !== letter.toLowerCase();
};

export const propertyOf = function propertyOf(key: string): string {
    let property = "";
    for (let index = 0; index < key.length; index += 1) {
        const letter = key.charAt(index);
        property += isUpper(letter) ? HYPHEN + letter.toLowerCase() : letter;
    }
    return property;
};
```
