From 04ccf21dba99e9c07c41a38bcf3e4881c06b1bac Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 1 Feb 2022 11:37:28 +0700 Subject: [PATCH] Document TypeScript naming limitation Fixes #157 --- readme.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index ecd9028..1450f83 100644 --- a/readme.md +++ b/readme.md @@ -17,8 +17,8 @@ For example, `is.string('🦄') //=> true` ## Install -``` -$ npm install @sindresorhus/is +```sh +npm install @sindresorhus/is ``` ## Usage @@ -82,6 +82,9 @@ All the below methods accept a value and returns a boolean for whether the value ##### .undefined(value) ##### .null(value) + +**Note:** TypeScript users must use `.null_()` because of a TypeScript naming limitation. + ##### .string(value) ##### .number(value) @@ -103,6 +106,9 @@ is.array(value, is.number); // Validate `value` is an array and all of its items ``` ##### .function(value) + +**Note:** TypeScript users must use `.function_()` because of a TypeScript naming limitation. + ##### .buffer(value) ##### .object(value) @@ -372,6 +378,8 @@ An object is plain if it's created by either `{}`, `new Object()`, or `Object.cr Returns `true` for instances created by a class. +**Note:** TypeScript users must use `.class_()` because of a TypeScript naming limitation. + ##### .typedArray(value) ##### .arrayLike(value)