npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

typescript-angular-utilities

v4.1.15

Published

Typescript utility classes published as angular services

Downloads

158

Readme

TypeScript-Angular-Utilities

Contains a list of reusable TypeScript libraries, services, and general utilities. These are all defined as angular 2 services, easily made available via providers.

Behaviors

Angular directives that are applied as attributes to an element in order to modify the element's behavior.

Filters

Contains Angular pipes, which can be applied to bindings using the Angular pipe operator <span>{{myMoney | currency}}</span>

Contains interfaces for several types of pipes. Also an abstract base class for defining serializable filters.

Services

Contains miscellaneous tools and utilities for working with objects and other useful tasks.

  • array
  • boolean
  • [dataContracts] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/dataContracts/dataContracts.md)
  • date
  • [errorHandler] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/errorHandler/errorHandler.md)
  • [fileSize] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/fileSize/fileSize.md)
  • [genericSearchFilter] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/genericSearchFilter/genericSearchFilter.md)
  • [guid] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/guid/guid.md)
  • [moment] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/moment/moment.md)
  • [notification] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/notification/notification.md)
  • [number] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/number/number.md)
  • object
  • [observable] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/observable/observable.md)
  • [parentChildBehavior] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/parentChildBehavior/parentChildBehavior.md)
  • [promise] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/promise/promise.md)
  • [string] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/string/string.md)
  • [synchronizedRequests] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/synchronizedRequests/synchronizedRequests.md)
  • [test] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/test/test.md)
  • [time] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/time/time.md)
  • [transform] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/transform/transform.md)
  • [validation] (https://github.com/RenovoSolutions/TypeScript-Angular-Utilities/blob/master/source/services/validation/validation.md)

Injecting a service

import { Component, Inject } from '@angular/core';
import { object, OBJECT_PROVIDER } from 'typescript-angular-utilities/services';

@Component({
  selector: 'some-selector',
  template: '<span>html!</span>',
  providers: [OBJECT_PROVIDER], // Or include UTILITY_PROVIDERS in a root component
})
export class MyComponent {
  private objectService: object.IObjectUtility;

  constructor(@Inject(object.objectToken) objectService: object.IObjectUtility): void {
    this.objectService = objectService;
  }

  ...

  private testForEmpty(): boolean {
    return this.objectService.isNullOrEmpty(this.someValue);
  }
}

Types

Contains common type definitions or objects.

CompareResult

Contains a simple enumeration describing less than, equal, greater than along with a primitive number comparison function.

export enum CompareResult {
	greater = 1,
	equal = 0,
	less = -1,
}

itemList

Can be used to build more descriptive enumerations were each entry contains a value, a machine name (or abbreviation), and a display / pretty name. Extend to build enumeration lists. IItem can also be extended to provide additional meta information on items in the list.

Building and Testing

Please always test new builds to ensure non-breaking commits and PRs

The primary build scripts are:

npm install

Installs external libraries and dependencies. Should be run after pulling down code changes.

npm run build

Compiles TypeScript files into JavaScript.

npm test or npm run test

Runs the tests.

Use npm run test.debug to debug test failures. npm run test.tc uses the TeamCity reporter to print out results for TeamCity. npm run test.full runs the tests in multiple browsers instead of Chrome alone.

npm run bundle

Bundle all of the javascript files together and put in the output folder.

Combinations

In addition, there are some useful combination tasks: npm run install-build npm run build-test

To perform a full build from scratch, including install, build, bundle, run: npm run full-build

Watch

Several tasks can be modified with .watch in order to watch the file system for changes: npm run build.watch npm run build-bundle.watch npm run build-test.watch

In general, - is used to indicate combined / joint tasks; . is used to indicate a subtask or a modification or variation of a task.