WireBootstrap
HomeDocsBuySupport
  • Introduction
  • Overview
  • Getting Started
  • Installation
  • Connecting to Data
    • Data Connectors
      • SQL Data
      • Custom Web Services
      • Local Data
      • Other Sources
    • Data Sources
    • Discovery
    • Building a Data Connector
  • Working With Queries
    • Select Queries
      • Query Extensions
    • Stored Procedures
    • Custom Web Services
    • Executing Queries
    • ORM
  • Writing Data
  • Updates
  • Deletes
  • Working with DataTables
    • Introduction
    • Filter and Sort
    • Select and Calculate
    • Joins
    • Rows
    • Columns
  • Working with DataSets
  • Introduction
  • Executing Queries
  • Transforms
  • Writing Data
  • Data Events
  • Working with Components
    • Introduction
    • Encapsulation
    • Configuration
      • Data
      • Events
      • Observables
      • Validation
      • Display
      • Vendor
      • Custom
    • Component
    • Web Frameworks
    • Building a Component
      • Hello World
      • Data Events
      • DataSets
  • Working With Data Events
    • Introduction
    • Event Basics
    • Event Data
    • Event Actions
  • Working with Themes
    • Introduction
    • Sample Data
    • Libraries
    • Pages
    • Building a Theme Project
  • Utilities
    • Formatting
    • Expressions
    • Collections
    • Spinners
    • Copy and Merge
    • Validation
    • Loading Assets
    • Service Calls
    • Download Files
    • Browser Location
    • Types
    • Promise
  • Reference
    • wire
      • wire.Collection
      • wire.download
      • wire.validate
    • wire.data
      • wire.data.DataEvent
      • wire.data.DataModel
      • wire.data.DataPromise
      • wire.data.DataSet
      • wire.data.DataSource
      • wire.data.DataTable
        • Columns
        • Rows
      • wire.data.StoredProcedure
      • wire.data.TableQuery
    • wire.ui
      • wire.ui.Component
      • wire.ui.validate
Powered by GitBook
On this page
  • Boolean
  • Numeric
  • Guid
  • Short Guid

Was this helpful?

  1. Utilities

Types

PreviousBrowser LocationNextPromise

Last updated 1 year ago

Was this helpful?

Boolean

Use the wire.toBoolean function to determine if a value of any type is . Use the second parameter to return a default if the value passed in is not able to be evaluated.

The following example sets the bool variable to truebecause the string "true" will evaluate to true.

const bool = wire.toBoolean("true", false);

The following example also sets the bool variable to true because the value null passed in cannot be evaluated as a proper Boolean. The function defaults to the second parameter true. If the second parameter was not passed in, the function would return false.

const bool = wire.toBoolean(null, true);

Numeric

To determine whether a value of any type is a number, use the wire.inNumeric function.

const number = wire.isNumeric("1234");

Guid

To create a universal unique identifier, use the wire.guid function.

const id = wire.guid();

// id = f09a1e51-7dbf-49c2-b252-ff16c3b42a7a

Short Guid

To create a 6 character random alphanumeric value, use the guidShort function.

const id = wire.guidShort();

// id = nzcp6z

truthy