This repository was archived by the owner on Oct 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
sp core library.validate
John Nguyen edited this page Apr 22, 2021
·
2 revisions
Home > @microsoft/sp-core-library > Validate
Performs common validation tests for properties and function parameters.
Signature:
export default class ValidateThis 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.
| 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. |