evilj0e / unity-utils

Some useful utility functions for the Unity team.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unity Utils

Travis-CI npm version Scrutinizer Deps Deps-Dev

Some useful utility functions for the Unity team.

Table of Contents

Installation

npm i --save unity-utils

API

uri

URI utilities.

join([arg1, [arg2, ...]])

Deafult: '/'

Returns: {String}

Joins path parts, dropping all falsy parts, except for 0. Accepts any amount of arguments of any type.

Example:

import { join } from 'unity-utils/uri';
console.log(join('path', 'with', null)); // outputs: "path/with"

query(queryObject)

Returns: {Object}

Filters query object, dropping undefined, null and '' values.

queryObject {Object}

Any query-like object.

Example:

import { query } from 'unity-utils/uri';
console.log(query({ param: 'val', 'null': null })); // outputs: "{"param": "val"}"

License

MIT © AuRu

About

Some useful utility functions for the Unity team.


Languages

Language:JavaScript 100.0%