Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ltgt

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ltgt

implement correct ranges for level-*

  • 2.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
742K
decreased by-7.48%
Maintainers
1
Weekly downloads
 
Created

What is ltgt?

The 'ltgt' npm package provides utility functions for comparing values with less than, greater than, less than or equal to, and greater than or equal to operations. It is particularly useful for range queries and sorting operations.

What are ltgt's main functionalities?

Less Than Comparison

This feature allows you to compare if one value is less than another. In this example, it checks if 3 is less than 5.

const ltgt = require('ltgt');
const result = ltgt.compare(3, 5, '<');
console.log(result); // true

Greater Than Comparison

This feature allows you to compare if one value is greater than another. In this example, it checks if 7 is greater than 5.

const ltgt = require('ltgt');
const result = ltgt.compare(7, 5, '>');
console.log(result); // true

Range Query

This feature allows you to check if a value falls within a specified range. In this example, it checks if 5 is within the range of 1 to 10.

const ltgt = require('ltgt');
const range = { start: 1, end: 10 };
const result = ltgt.contains(range, 5);
console.log(result); // true

Less Than or Equal To Comparison

This feature allows you to compare if one value is less than or equal to another. In this example, it checks if 5 is less than or equal to 5.

const ltgt = require('ltgt');
const result = ltgt.compare(5, 5, '<=');
console.log(result); // true

Greater Than or Equal To Comparison

This feature allows you to compare if one value is greater than or equal to another. In this example, it checks if 5 is greater than or equal to 5.

const ltgt = require('ltgt');
const result = ltgt.compare(5, 5, '>=');
console.log(result); // true

Other packages similar to ltgt

FAQs

Package last updated on 25 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc