open-index/open-npm huggingface dataset:
npm package: @michaelcoxon/ensure
Description: Helpers for method argument checking
Author: Michael Coxon
Latest version: 1.0.2
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

﻿# ensure-js
*A port of [EnsureFramework](https://github.com/michaelcoxon/EnsureFramework) for JavaScript/TypeScript.*

---
> Argument assertion with ease

Ensure is designed to take the pain out of null checking and making sure (ensuring)
your methods are being used the way they were intended and throwing exceptions when unsupported 
values are passed to them.

You can make sure values are in a specific range or simply make sure that an argument is not 
null.

It was designed to be readable and fluent based, meaning you can chain ensurables together and 
the first one that fails will result in the exception.

## Installation

It's in NPM man...
```sh
npm i @michaelcoxon/ensure --save
```

## Usage
> **NOTE**: Check the tests for full documentation. I am getting to filling out this 
> readme file as I can. The tests have full coverage though.

It's designed to be a one-liner to assert that your arguments are within the bounds of the method. So using
it is as simple as...

```js
Ensure.arg(         // Step 1: open up the fluent interface
    myArgument,     // Step 2: pass in your argument
    "myArgument"    // Step 3: tell it the name of your argument
    )               // Step 4: ???
    .isNotNull();   // Step 5: Make your assertions/profit!!
```

Your assertions can be chained and will execute in the order defined for example
```js
Ensure.arg(str, "str")
    .isNotNull()
    .isOneOf("str", "foo", "bar");
```


### Strings

#### Ensure a string is not null
```js
function testMethod(str: string | null)
{
    Ensure.arg(str, "str").isNotNull();
}
```
npm package: @michaelcoxon/rest-client
Description: A simple REST client.
Author: Michael Coxon
Latest version: 1.6.0

# rest-client
A simple REST client

 - See the api docs at: https://michaelcoxon.github.io/rest-client/
 - Check out the tests to see how to use it better.

# Installation
The library is available on NPM...

```sh
npm -i @michaelcoxon/rest-client
```

# 101

The only implementation at the moment is for in-browser XMLHttpRequest.

use it like this...

```js
import { XhrHttpClient } from '@michaelcoxon/rest-client'

const client = new XhrHttpClient();
const url = 'https://example.com/api/get-data';
const result = await client.getObjectAsync(url);
```
npm package: @michaelcoxon/utilities
Description: utilities for JS and TypeScript
Author: Michael Coxon
Latest version: 13.0.0-alpha-0.0.2

# utilities

[![Get it on NPM](https://img.shields.io/npm/dt/@michaelcoxon/utilities.svg?style=flat)](https://www.npmjs.com/package/@michaelcoxon/utilities)

Simple utility classes and function for JS and TypeScript

Check out the tests for a more comprehesive doco. Also check out the [project site for the api docs](https://michaelcoxon.github.io/utilities/)

This project is opinionated and based on .NET.

```
npm i @michaelcoxon/utilities
```