New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@typescript-package/length

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typescript-package/length

A lightweight TypeScript library for the length.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

typescript-package/length

npm version GitHub issues GitHub license

A lightweight TypeScript library for the length.

Version: v0.1.0


Table of contents

Installation

1. Install peer dependencies

npm install @typedly/length --save-peer

2. Install the package

npm install @typescript-package/length --save-peer

Api

import {
  // Class.
  Length,
} from '@typescript-package/length';

Length

Represents a length value with optional minimum and maximum constraints.

Usage Example

import { Length } from '@typescript-package/length';

// Example 1: Exact value
const exactLength = new Length(5);
console.log(exactLength.length);  // 5
console.log(exactLength.min);    // undefined
console.log(exactLength.max);    // undefined

// Example 2: Min/Max range
const rangeLength = new Length({ min: 2, max: 10 });
console.log(rangeLength.length);  // undefined
console.log(rangeLength.min);    // 2
console.log(rangeLength.max);    // 10

// Example 3: Set min, max, and value dynamically
const flexibleLength = new Length();
flexibleLength.setMin(3).setMax(7);
console.log(flexibleLength.min); // 3
console.log(flexibleLength.max); // 7

flexibleLength.setLength(5);
console.log(flexibleLength.length); // 5

// Example 4: Use setMinMax and reset
flexibleLength.setMinMax(4, 8);
console.log(flexibleLength.min); // 4
console.log(flexibleLength.max); // 8

flexibleLength.setMinMax(undefined, undefined);
console.log(flexibleLength.min); // undefined
console.log(flexibleLength.max); // undefined

Contributing

Your contributions are valued! If you'd like to contribute, please feel free to submit a pull request. Help is always appreciated.

Support

If you find this package useful and would like to support its and general development, you can contribute through one of the following payment methods. Your support helps maintain the packages and continue adding new.

Support via:

or via Trust Wallet

Thanks for your support!

Code of Conduct

By participating in this project, you agree to follow Code of Conduct.

GIT

Commit

Versioning

Semantic Versioning 2.0.0

Given a version number MAJOR.MINOR.PATCH, increment the:

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards-compatible manner, and
  • PATCH version when you make backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

FAQ How should I deal with revisions in the 0.y.z initial development phase?

The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.

How do I know when to release 1.0.0?

If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.

License

MIT © angular-package (license)

Keywords

@typescript-package

FAQs

Package last updated on 03 Jun 2025

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