Skip to content

Commit 68cda73

Browse files
committed
docs(README): explain type guards
1 parent 7aa345e commit 68cda73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
This package provides [TypeScript guards](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) for the Google Maps JavaScript API.
1414

15+
A type guard (or type predicate) is an expression that performs a runtime check that guarantees the type in some scope. Type guards are used to narrow the type of a variable or parameter.
16+
1517
## Documentation
1618

1719
For the complete API check the [reference documentation](https://googlemaps.github.io/js-typescript-guards/index.html).
@@ -40,4 +42,4 @@ if (isLatLngLiteral(latLng)) {
4042
lat = latLng.lat();
4143
lng = latLng.lng();
4244
}
43-
```
45+
```

0 commit comments

Comments
 (0)