22
33import { css } from "styled-components" ;
44
5- export const is = ( prop : string ) => ( ...args : [ any ] ) => ( props : object ) =>
6- props [ prop ] ? css ( ...args ) : "" ;
7-
8- export const isnt = ( prop : string ) => ( ...args : [ any ] ) => ( props : object ) =>
9- ! props [ prop ] ? css ( ...args ) : "" ;
10-
11- export const isAny = ( prop : string , matches : any [ ] ) => ( ...args : [ any ] ) => (
5+ export const is = ( prop : string ) => ( str : any , ...args : any [ ] ) => (
126 props : object
13- ) => ( matches . includes ( props [ prop ] ) ? css ( ...args ) : "" ) ;
7+ ) => ( props [ prop ] ? css ( str , ...args ) : "" ) ;
148
15- export const isntAny = ( prop : string , matches : any [ ] ) => ( ...args : [ any ] ) => (
9+ export const isnt = ( prop : string ) => ( str : any , ...args : any [ ] ) => (
1610 props : object
17- ) => ( ! matches . includes ( props [ prop ] ) ? css ( ...args ) : "" ) ;
11+ ) => ( ! props [ prop ] ? css ( str , ...args ) : "" ) ;
12+
13+ export const isAny = ( prop : string , matches : any [ ] ) => (
14+ str : any ,
15+ ...args : any [ ]
16+ ) => ( props : object ) =>
17+ matches . includes ( props [ prop ] ) ? css ( str , ...args ) : "" ;
18+
19+ export const isntAny = ( prop : string , matches : any [ ] ) => (
20+ str : any ,
21+ ...args : any [ ]
22+ ) => ( props : object ) =>
23+ ! matches . includes ( props [ prop ] ) ? css ( str , ...args ) : "" ;
1824
1925export const value = ( prop : string ) => ( props : object ) => props [ prop ] ;
2026
@@ -24,10 +30,12 @@ export const swap = (prop: string, yup: any, nope: any) => (props: object) =>
2430export const choose = ( prop : string , map : object ) => ( props : object ) =>
2531 map [ props [ prop ] ] ;
2632
27- export const over = ( prop : string , amount : number ) => ( ...args : [ any ] ) => (
28- props : object
29- ) => ( props [ prop ] > amount ? css ( ...args ) : "" ) ;
33+ export const over = ( prop : string , amount : number ) => (
34+ str : any ,
35+ ...args : any [ ]
36+ ) => ( props : object ) => ( props [ prop ] > amount ? css ( str , ...args ) : "" ) ;
3037
31- export const under = ( prop : string , amount : number ) => ( ...args : [ any ] ) => (
32- props : object
33- ) => ( props [ prop ] < amount ? css ( ...args ) : "" ) ;
38+ export const under = ( prop : string , amount : number ) => (
39+ str : any ,
40+ ...args : any [ ]
41+ ) => ( props : object ) => ( props [ prop ] < amount ? css ( str , ...args ) : "" ) ;
0 commit comments