Skip to content

Commit

Permalink
Remove unused keys from function declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii Kirmas committed Feb 6, 2021
1 parent 43428ce commit bb57f7d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ export {
classNaming
}

function classNaming<C extends string>(
classNames: ClassNamesMap<C>
function classNaming(
classNames: ClassNamesMap<string>
): ClassName;
function classNaming<C extends string>(
function classNaming(
className: undefined|string,
classNames: ClassNamesMap<C>
classNames: ClassNamesMap<string>
): ClassName;
function classNaming(...args: any[]) {
return _classNaming(args.pop(), args.pop())
}

function _classNaming<C extends string>(
classNames: ClassNamesMap<C>,
function _classNaming(
classNames: ClassNamesMap<string>,
className: undefined|string
): ClassName {
const keys = $keys(classNames)
, {length} = keys

for (let i = length; i--;) {
const key = keys[i] as C
const key = keys[i]
, value = classNames[key]

if (typeof value === "string")
Expand Down

0 comments on commit bb57f7d

Please sign in to comment.