File tree Expand file tree Collapse file tree 1 file changed +3
-19
lines changed
Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Original file line number Diff line number Diff line change 11export default class Constant {
22 #value;
33 constructor ( value , ...rest ) {
4- if ( rest . length ) {
5- this . #value = [ value , ...rest ] ;
6- } else {
7- this . #value = value ;
8- }
4+ this . #value = [ value , ...rest ] ;
95 }
106
117 equals ( other ) {
12- return this === other || valueEquals ( this . #value, other ) ;
8+ return this === other || this . #value. includes ( other ?. valueOf ( ) ) ;
139 }
1410
1511 toString ( ) {
1612 return this . valueOf ( ) ;
1713 }
1814
1915 valueOf ( ) {
20- const value = this . #value;
21- if ( Array . isArray ( value ) ) {
22- return value [ 0 ] ;
23- }
24- return value ;
16+ return this . #value[ 0 ] ;
2517 }
2618}
27-
28- function valueEquals ( value , other ) {
29- const otherValue = other ?. valueOf ( ) ;
30- if ( Array . isArray ( value ) ) {
31- return value . includes ( otherValue ) ;
32- }
33- return value === otherValue ;
34- }
You can’t perform that action at this time.
0 commit comments