File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 209
209
210
210
var slice = Array . prototype . slice ;
211
211
var hasOwnProperty = Object . prototype . hasOwnProperty ;
212
+ var toString = Object . prototype . toString ;
212
213
213
214
var inspect = ( function ( ) {
214
215
/* istanbul ignore else */
599
600
function ( x ) { return RegExp_ . _test ( x ) && x . global ; }
600
601
) ;
601
602
603
+ //# HtmlElement :: Type
604
+ //.
605
+ //. Type comprising every [HTML element][].
606
+ var HtmlElement = NullaryTypeWithUrl (
607
+ 'sanctuary-def/HtmlElement' ,
608
+ function ( x ) {
609
+ return / ^ \[ o b j e c t H T M L .+ E l e m e n t \] $ / . test ( toString . call ( x ) ) ;
610
+ }
611
+ ) ;
612
+
602
613
//# Integer :: Type
603
614
//.
604
615
//. Type comprising every integer in the range
879
890
Boolean_ ,
880
891
Date_ ,
881
892
Error_ ,
893
+ HtmlElement ,
882
894
Null ,
883
895
Number_ ,
884
896
Object_ ,
2615
2627
FiniteNumber : FiniteNumber ,
2616
2628
Function : def ( 'Function' ) ( { } ) ( [ Array_ ( Type ) , Type ] ) ( Function_ ) ,
2617
2629
GlobalRegExp : GlobalRegExp ,
2630
+ HtmlElement : HtmlElement ,
2618
2631
Integer : Integer ,
2619
2632
NegativeFiniteNumber : NegativeFiniteNumber ,
2620
2633
NegativeInteger : NegativeInteger ,
2661
2674
} ) ) ;
2662
2675
2663
2676
//. [FL:Semigroup]: https://github.com/fantasyland/fantasy-land#semigroup
2677
+ //. [HTML element]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element
2664
2678
//. [Monoid]: https://github.com/fantasyland/fantasy-land#monoid
2665
2679
//. [Setoid]: https://github.com/fantasyland/fantasy-land#setoid
2666
2680
//. [`Array`]: #Array
Original file line number Diff line number Diff line change @@ -1440,6 +1440,11 @@ See https://github.com/sanctuary-js/sanctuary-def/tree/v${version}#Array2 for in
1440
1440
eq ( ( $ . Function ( [ a , a ] ) ) . url ) ( '' ) ;
1441
1441
} ) ;
1442
1442
1443
+ test ( 'provides the "HtmlElement" type' , ( ) => {
1444
+ eq ( $ . HtmlElement . name ) ( 'sanctuary-def/HtmlElement' ) ;
1445
+ eq ( $ . HtmlElement . url ) ( `https://github.com/sanctuary-js/sanctuary-def/tree/v${ version } #HtmlElement` ) ;
1446
+ } ) ;
1447
+
1443
1448
test ( 'provides the "NonEmpty" type constructor' , ( ) => {
1444
1449
eq ( ( $ . NonEmpty ( $ . String ) ) . name ) ( 'sanctuary-def/NonEmpty' ) ;
1445
1450
eq ( ( $ . NonEmpty ( $ . String ) ) . url ) ( `https://github.com/sanctuary-js/sanctuary-def/tree/v${ version } #NonEmpty` ) ;
You can’t perform that action at this time.
0 commit comments