File tree Expand file tree Collapse file tree 5 files changed +71
-0
lines changed Expand file tree Collapse file tree 5 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 1+ *
2+ ! ** /* .d.ts
3+ ! ** /* .d.cts
4+ ! ** /* .d.mts
5+ ! ** /* .d. * .ts
Original file line number Diff line number Diff line change 1+ /**
2+ * Performs a shallow comparison between two objects.
3+ *
4+ * @param a - The first object to compare
5+ * @param b - The second object to compare
6+ * @returns `true` if the objects have identical top-level property values, otherwise `false`
7+ */
8+ declare function isEqual ( a : object , b : object ) : boolean ;
9+
10+ export = isEqual ;
Original file line number Diff line number Diff line change 1+ import isEqual from "is-equal-shallow" ;
2+
3+ // $ExpectType boolean
4+ isEqual ( { a : 1 } , { a : 1 } ) ;
5+
6+ // $ExpectType boolean
7+ isEqual ( { a : 1 } , { a : 2 } ) ;
8+
9+ // @ts -expect-error
10+ isEqual ( 1 , 1 ) ;
11+
12+ // @ts -expect-error
13+ isEqual ( "test" , "test" ) ;
14+
15+ // Nested objects (shallow comparison only checks top level)
16+ const obj1 = { a : { b : 1 } } ;
17+ const obj2 = { a : { b : 1 } } ;
18+
19+ // $ExpectType boolean
20+ isEqual ( obj1 , obj2 ) ;
Original file line number Diff line number Diff line change 1+ {
2+ "private" : true ,
3+ "name" : " @types/is-equal-shallow" ,
4+ "version" : " 0.1.9999" ,
5+ "projects" : [
6+ " https://github.com/jonschlinkert/is-equal-shallow"
7+ ],
8+ "devDependencies" : {
9+ "@types/is-equal-shallow" : " workspace:."
10+ },
11+ "owners" : [
12+ {
13+ "name" : " Laurens Tobias" ,
14+ "githubUsername" : " akeldamas"
15+ }
16+ ]
17+ }
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "module" : " node16" ,
4+ "lib" : [
5+ " es6"
6+ ],
7+ "noImplicitAny" : true ,
8+ "noImplicitThis" : true ,
9+ "strictFunctionTypes" : true ,
10+ "strictNullChecks" : true ,
11+ "types" : [],
12+ "noEmit" : true ,
13+ "forceConsistentCasingInFileNames" : true
14+ },
15+ "files" : [
16+ " index.d.ts" ,
17+ " is-equal-shallow-tests.ts"
18+ ]
19+ }
You can’t perform that action at this time.
0 commit comments