@nath-green/utils

0.0.2 • Public • Published

utils

Collection of utils

formatUrlWithProtocol

Returns formatted url

import { formatUrlWithProtocol } from "@nath-green/utils";

const formattedUrl = formatUrlWithProtocol({
  url: "www.test.co.uk",
  secure: true,
});

// returns https://www.test.co.uk

Parameters

An object of values

Param Type Default Description
url String URL to be formatted
secure Boolean false To prefix with https

isEmptyObject

Returns a boolean

import { isEmptyObject } from "@nath-green/utils";

const models = {};

const noModels = isEmptyObject(models);

// returns true
import { isEmptyObject } from "@nath-green/utils";

const models = { latest: "Mustang", fastest: "Polo" };

const hasModels = !isEmptyObject(models);

// returns true

Parameters

A single parameter

Param Type Default Description
obj Object Object to be tested

Readme

Keywords

none

Package Sidebar

Install

npm i @nath-green/utils

Weekly Downloads

0

Version

0.0.2

License

none

Unpacked Size

3.61 kB

Total Files

4

Last publish

Collaborators

  • nath-green