Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp core library.validate

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-core-library > Validate

Validate class

Performs common validation tests for properties and function parameters.

Signature:

export default class Validate

Remarks

This class implements provides a standard way to validate properties and function parameters. Unlike debug assertions, Validate checks are always performed and will always throw an error, even in a production release. As such, be careful not to overuse these checks in a way that might impact performance.

Methods

Method Modifiers Description
isNonemptyString(value, variableName) static Throws an exception if the specified string is null, undefined, or an empty string.
isNotDisposed(value, className) static Throws an exception if the specified object has been disposed.
isNotNullOrUndefined(value, variableName) static Throws an exception if the specified value is null or undefined.
isTrue(value, variableName) static Throws an exception if the specified value is not true.
Clone this wiki locally