Skip to content

Commit

Permalink
Change file to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Feb 16, 2020
1 parent 8f4756e commit fe90182
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/custom-properties/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"access": "public"
},
"dependencies": {
"@theme-ui/core": "^0.3.1",
"pluralize": "^8.0.0"
},
"devDependencies": {
Expand Down
11 changes: 8 additions & 3 deletions packages/custom-properties/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import pluralize from 'pluralize'
import { Theme } from '@theme-ui/core/dist/theme'

export default (theme, prefix) => {
const customProperties = {}
interface CustomProperties {
[key: string]: string | number
}

export default (theme: Theme, prefix?: string) => {
const customProperties: CustomProperties = {}

const generateProperties = (object, previousKey) => {
const generateProperties = (object: object, previousKey?: string) => {
Object.entries(object).forEach(([key, value]) => {
let formattedKey = pluralize(key, 1)

Expand Down

0 comments on commit fe90182

Please sign in to comment.