From 599eb7fd34a8990b343e28f16d5590f6b5de05d3 Mon Sep 17 00:00:00 2001 From: Itai Steinherz Date: Sun, 9 Dec 2018 15:43:52 +0200 Subject: [PATCH] Add usage examples --- readme.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/readme.md b/readme.md index 53ed990..97c023b 100644 --- a/readme.md +++ b/readme.md @@ -261,6 +261,16 @@ Returns `true` if `value` is a URL string. Note: this only does basic checking using the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL) constructor. +```js +const url = 'https://example.com'; + +is.url(url); +//=> true + +is.url(new URL(url)); +//=> false +``` + ##### .truthy(value) Returns `true` for all values that evaluate to true in a boolean context: