8.0.6 • Published 4 years ago

@terminus/ngx-tools v8.0.6

Weekly downloads
41
License
MIT
Repository
github
Last release
4 years ago

@terminus/ngx-tools

CircleCI codecov semantic-release MIT License NPM version Github release

A collection of tools and utilities for Terminus applications.

Table of Contents

Installation

Install the library and required dependencies:

# Primary dependencies:
$ yarn add @terminus/ngx-tools

# Peer dependencies that need to be installed (you will likely already have some of these installed):
$ yarn add @angular/{core,common,forms,platform-browser} @ngrx/{effects,store} rxjs typescript@~3.4.5

Then import your item from the associated endpoint: import { debounce } from '@terminus/ngx-tools/utilities';

You can play with the library live on StackBlitz: https://stackblitz.com/github/GetTerminus/ngx-tools

Library Structure

Import locationDescriptionDocsSize
@terminus/ngx-tools/browserHelpers to deal directly with browsers (TsCookieService..):books:File size
@terminus/ngx-tools/coercionFunctions to coerce values to specific types (Array..):books:File size
@terminus/ngx-tools/jwtUtilities for dealing with JWT tokens (TokenEscalator..):books:File size
@terminus/ngx-tools/keycodesConstants for commonly needed key codes (ESC..):books:File size
@terminus/ngx-tools/regexRegex definitions (creditCardRegex..):books:File size
@terminus/ngx-tools/testingTest helpers and test mocks (dispatchFakeEvent..):books:File size
@terminus/ngx-tools/type-guardsTypeScript type guards (isSet, isArray..):books:File size
@terminus/ngx-tools/utilitiesBasic utilities (debounce, groupBy..):books:File size

Features

Browser Utilities

Import from: @terminus/ngx-tools/browser

:books: Browser Documentation

// Example usage:
import { TsCookieService } from '@terminus/ngx-tools/browser';

...

this.cookieService.set('myName', 'myValue'); // Sets a cookie

Coercion

Import from: @terminus/ngx-tools/coercion

:books: Coercion Documentation

// Example usage:
import { coerceBooleanProperty } from '@terminus/ngx-tools/coercion';

coerceBooleanProperty('true'); // Returns: true

JWT Token Managment

Store, escalate, renew and use a named set of JWT tokens with ease!

:books: JWT Documentation

Key Codes

Import from: @terminus/ngx-tools/keycodes

:books: Key Codes Documentation

// Example usage:
import { KEYS } from '@terminus/ngx-tools/keycodes';
import { dispatchKeyboardEvent } from '@terminus/ngx-tools/testing';

KEYS.ENTER.code    // 'Enter'
KEYS.ENTER.keyCode // 13

// Example usage:
dispatchKeyboardEvent(myElementRef, KEYS.ENTER.keycode);

Regex

Import from: @terminus/ngx-tools/regex

:books: RegEx Documentation

// Example usage:
import { emailRegex } from '@terminus/ngx-tools/regex';

emailRegex.test('foo@bar.com'); // Returns: true

Testing Utilities

Import from: @terminus/ngx-tools/testing

:books: Testing Documentation

// Example usage:
import { dispatchFakeEvent } from '@terminus/ngx-tools/testing';

dispatchFakeEvent(window, 'resize');

Type Guards

Import from: @terminus/ngx-tools/type-guards

:books: Type Guards Documentation

// Example usage:
import { arrayHasAllElementsSet } from '@terminus/ngx-tools/type-guards';

arrayHasAllElementsSet<string>(['foo', 'bar']) // Returns: true
arrayHasAllElementsSet<number>([1, 'bar'])     // Returns: false

General Utilities

Import from: @terminus/ngx-tools/utilities

:books: Utilities Documentation

// Example usage:
import { groupBy } from '@terminus/ngx-tools/utilites';

groupBy<MyObj, keyof MyObj>(myArray, 'a');

Contributing

See the development workflow for the @terminus/ui library: Terminus Library Contribution Docs

Contributors

Thanks goes to these wonderful people (emoji key):

Benjamin Charity💻 🔧 🤔 📖 💬 🐛 💡 🚇 🚧 👀 ⚠️Brian Malinconico💻 🤔Wendy💻 📖 ⚠️ 🚧 👀shani-terminus🐛 💻 📖 🚧 ⚠️ 👀

This project follows the all-contributors specification. Contributions of any kind welcome!

Basic Commands

CommandFunction
buildBuild release
testRun unit tests
test:ci:localRun all unit tests and output coverage
start:appStart demo project
lintLint all library files and attempt to fix issues
lint:ciLint all library files
docs:tocUpdate the Table of Contents in all files
cmCommit with commitizen cli

See package.json for the full list of available commands.

8.0.6

4 years ago

8.0.5

4 years ago

8.0.4

4 years ago

8.0.3

4 years ago

8.0.2

4 years ago

7.5.0

4 years ago

8.0.1

4 years ago

8.0.0

4 years ago

7.4.0

4 years ago

7.3.1

4 years ago

7.3.0

4 years ago

7.2.13

4 years ago

7.2.12

4 years ago

7.2.11

4 years ago

7.2.10

4 years ago

7.2.9

4 years ago

7.2.8

4 years ago

7.2.7

4 years ago

7.2.6

5 years ago

7.2.5

5 years ago

7.2.4

5 years ago

7.2.3

5 years ago

7.2.2

5 years ago

7.2.1

5 years ago

7.2.0

5 years ago

7.1.0

5 years ago

7.0.1-beta.1

5 years ago

7.0.1

5 years ago

7.0.0

5 years ago

6.11.0

5 years ago

6.10.0

5 years ago

6.9.0

5 years ago

6.8.1-beta-0.1

5 years ago

6.8.1

5 years ago

6.7.1

5 years ago

6.8.0

5 years ago

6.7.0

5 years ago

6.6.1

5 years ago

6.6.0

5 years ago

6.5.1

5 years ago

6.5.0

5 years ago

6.4.1

5 years ago

6.4.0

5 years ago

6.3.0

5 years ago

6.2.0

5 years ago

6.1.0-beta-1.0

5 years ago

6.1.0

5 years ago

6.0.0

5 years ago

5.2.0

5 years ago

5.1.0

5 years ago

5.0.3

5 years ago

5.0.0

5 years ago

4.0.0

5 years ago

3.1.0

5 years ago

3.0.0

6 years ago

2.26.0

6 years ago

2.25.3

6 years ago

2.25.2

6 years ago

2.25.1

6 years ago

2.25.0

6 years ago

2.24.1

6 years ago

2.24.0

6 years ago

2.23.0

6 years ago

2.22.0

6 years ago

2.21.2

6 years ago

2.21.1

6 years ago

2.21.0

6 years ago

2.20.0

6 years ago

2.19.0

6 years ago

2.18.2

6 years ago

2.18.1

6 years ago

2.18.0-beta.1

6 years ago

2.18.0

6 years ago

2.17.0

6 years ago

2.16.1

6 years ago

2.16.0

6 years ago

2.15.4

6 years ago

2.15.3

6 years ago

2.15.2

6 years ago

2.15.1

6 years ago

2.15.0

6 years ago

2.14.0

6 years ago

2.13.0

6 years ago

2.12.2-beta.1

6 years ago

2.12.2

6 years ago

2.12.1

6 years ago

2.12.0

6 years ago

2.11.0

6 years ago

2.10.0

6 years ago

2.9.0-beta.1

6 years ago

2.9.0

6 years ago

2.8.0

6 years ago

2.7.0

6 years ago

2.6.0

6 years ago

2.5.0

6 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.3

6 years ago

2.3.2-beta.1

6 years ago

2.3.2

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.6.4-beta.2

6 years ago

1.6.4-beta.1

6 years ago

1.6.4

6 years ago

1.6.3

6 years ago

1.6.2-alpha.1

6 years ago

1.6.2

6 years ago

1.6.1

6 years ago

1.6.0-beta.1

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.0-beta.1

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago