Range
PackagesGitHub
v1.0
v1.0
  • Introduction
  • ❤ Benefits
  • General concepts
  • Getting started
    • Skeleton
    • Installation
      • npm
    • Public API
    • Basic concepts
  • Greater {}
    • Overview
    • Generic type variables
    • ★ Constructor
    • Accessors
      • get [Symbol.toStringTag]()
    • Methods
      • static create()
      • static isGreater()
      • than()
      • thanEvery()
      • thanSome()
      • valueOf()
  • Inequality {}
    • Overview
    • Generic type variables
    • Constructor
    • Accessors
      • get greater()
      • get less()
    • Properties
      • #greater
      • #less
    • Methods
      • greaterThan()
      • greaterThanEvery()
      • greaterThanSome()
      • lessThan()
      • lessThanEvery()
      • lessThanSome()
  • Less {}
    • Overview
    • Generic type variables
    • ★ Constructor
    • Accessors
      • get [Symbol.toStringTag]()
    • Methods
      • static create()
      • static isLess()
      • than()
      • thanEvery()
      • thanSome()
      • valueOf()
    • Example usage
  • Maximum {}
    • Overview
    • Generic type variables
    • ★ Constructor
    • Accessors
      • get [Symbol.toStringTag]()
    • Methods
      • static create()
      • static isMaximum()
      • valueOf()
  • Minimum {}
    • Overview
    • Generic type variables
    • ★ Constructor
    • Accessors
      • get [Symbol.toStringTag]()
    • Methods
      • static create()
      • static isMinimum()
      • valueOf()
  • Number {}
    • Overview
    • Generic type variables
    • ★ Constructor
    • Methods
      • static create()
      • static isNumber()
      • valueOf()
  • Range {}
    • Overview
    • Generic type variables
    • ★ Constructor
    • Accessors
      • get range()
      • get step()
      • get steps()
      • value()?
      • get [Symbol.toStringTag]()
    • Properties
      • max!
      • min!
      • #maximum
      • #minimum
      • #step
      • #value?
    • Methods
      • ↓ Static
      • static create()
      • static createFrom()
      • static createMaximum()
      • static createMinimum()
      • static isRange()
      • ↓ Instance
      • forEachStep()
      • getCurrentRange()
      • getCurrentStep()
      • ⚠ getMax()
      • ⚠ getMin()
      • getRange()
      • getRangeOfStep()
      • getValueOfStep()
      • has()
      • hasEvery()
      • hasSome()
      • isBetween()
      • isBetweenEvery()
      • isBetweenSome()
      • maxGreaterThan()
      • maxLessThan()
      • minGreaterThan()
      • minLessThan()
      • setValue()
      • setValueToStep()
      • stepByStep()
      • ⚠ toArray()
      • valueDown()
      • ⚠ valueOf()
      • valueUp()
  • Change log
    • Keep a changelog
    • CHANGELOG.md
    • v1.0.0-rc.0
    • v1.0.0-rc
    • v1.0.0-beta.0
  • GIT
    • Commit
    • Semantic Versioning
  • License
    • MIT
  • Social
    • Gettr
    • Twitter
    • YouTube
  • Contact
    • ⋯ Chat
    • @ Email
    • ✆ Phone
  • Donate
    • ฿ Cryptocurrency
    • $ Fiat
Powered by GitBook
On this page
  • Less.isLess()
  • Generic type variables
  • Parameters
  • Return type
  • Returns
  • Example usage
  1. Less {}
  2. Methods

static isLess()

Checks whether the given value is the Less instance of any or given primitive value

Less.isLess()

Checks whether the given value is the Less instance of any or given primitive value.

less.class.ts
public static isLess<Value extends number>(
  value: any,
  lessValue?: Value
): value is Less<Value> {
  return (
    typeof value === 'object' &&
    value instanceof this &&
    (typeof lessValue === 'number' ? value.valueOf() === lessValue : true)
  );
}

Generic type variables

Valueextendsnumber

A generic type variable indicates captured type of the supplied lessValue via the return type.

Parameters

value:any

The value of any type to test against the Less instance.

lessValue:Value

An optional value of generic type variable Value to check whether it's the primitive value of the given value.

Return type

Lees<Value>

The return type is a boolean resulting from its statement indicating the value is the Less object that takes the generic type variable Value.

Returns

The return value is a boolean indicating whether the given value is the Less instance of any or given primitive value.

Example usage

// Example usage.
import { Less } from '@angular-package/range';

// Define constant `id`.
const id = 390;

// Returns Less {390} of Less<390>.
const id390 = Less.create(id);

// Returns `true`.
Less.isLess(id390);

// Returns `false`.
Less.isLess(id390, 381);

// Returns `true`.
Less.isLess(id390, 390);
Previousstatic create()Nextthan()

Last updated 1 year ago