@@ -17,7 +17,7 @@ let counter = 0
1717export function stableHash ( arg : any ) : string {
1818 const type = typeof arg
1919 const constructor = arg && arg . constructor
20- const isDate = constructor == Date
20+ const isDate = constructor === Date
2121
2222 if ( Object ( arg ) === arg && ! isDate && constructor != RegExp ) {
2323 // Object/function, not null/date/regexp. Use WeakMap to store the id first.
@@ -31,14 +31,14 @@ export function stableHash(arg: any): string {
3131 table . set ( arg , result )
3232 let index : any
3333
34- if ( constructor == Array ) {
34+ if ( constructor === Array ) {
3535 // Array.
3636 result = "@"
3737 for ( index = 0 ; index < arg . length ; index ++ ) {
3838 result += stableHash ( arg [ index ] ) + ","
3939 }
4040 table . set ( arg , result )
41- } else if ( constructor == Object ) {
41+ } else if ( constructor === Object ) {
4242 // Object, sort keys.
4343 result = "#"
4444 const keys = Object . keys ( arg ) . sort ( )
@@ -52,8 +52,8 @@ export function stableHash(arg: any): string {
5252 return result
5353 }
5454 if ( isDate ) return arg . toJSON ( )
55- if ( type == "symbol" ) return arg . toString ( )
56- return type == "string" ? JSON . stringify ( arg ) : "" + arg
55+ if ( type === "symbol" ) return arg . toString ( )
56+ return type === "string" ? JSON . stringify ( arg ) : "" + arg
5757}
5858
5959export default stableHash
0 commit comments