* Parse an unparse type decls (and refactor impl attributes slightly) Signed-off-by: Nick Cameron <nrc@ncameron.org> * Remove special treatment of geometric types from parser and executor Signed-off-by: Nick Cameron <nrc@ncameron.org> * Generate docs for std types Signed-off-by: Nick Cameron <nrc@ncameron.org> * Hover tool-tips for types and fixup the frontend Signed-off-by: Nick Cameron <nrc@ncameron.org> * Fixes Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
		
			
				
	
	
		
			41 lines
		
	
	
		
			26 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			26 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
---
 | 
						|
title: "assert"
 | 
						|
excerpt: "Check a value at runtime, and raise an error if the argument provided is false."
 | 
						|
layout: manual
 | 
						|
---
 | 
						|
 | 
						|
Check a value at runtime, and raise an error if the argument provided is false.
 | 
						|
 | 
						|
 | 
						|
 | 
						|
```js
 | 
						|
assert(
 | 
						|
  data: bool,
 | 
						|
  message: string,
 | 
						|
): ()
 | 
						|
```
 | 
						|
 | 
						|
 | 
						|
### Arguments
 | 
						|
 | 
						|
| Name | Type | Description | Required |
 | 
						|
|----------|------|-------------|----------|
 | 
						|
| `data` | [`bool`](/docs/kcl/types/bool) |  | Yes |
 | 
						|
| `message` | [`string`](/docs/kcl/types/string) |  | Yes |
 | 
						|
 | 
						|
### Returns
 | 
						|
 | 
						|
`()`
 | 
						|
 | 
						|
 | 
						|
### Examples
 | 
						|
 | 
						|
```js
 | 
						|
myVar = true
 | 
						|
assert(myVar, "should always be true")
 | 
						|
```
 | 
						|
 | 
						|

 | 
						|
 | 
						|
 |