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

@zionapps/core

v1.0.6

Published

Helper Methods for Angular, Ionic and NgRx projects.

Downloads

92

Readme

@zionapps/core

Build status

Helper Methods for Angular, Ionic, NgRx or any TypeScript projects. This library is designed to prevent bugs from null and undefined variables and properties in runtime. Key areas of use include, but are not limited to:

  • NgRx selectors
  • Utility functions
npm install @zionapps/core --save

Contents

  1. Constants
  2. Identity
  3. Comparison
  4. Sanitize
  5. Transform
  6. Get
  7. Sort
  8. Filter
  9. Count
  10. Time

1. Constants

export const DEFAULT_COUNT = 0;
export const DEFAULT_ID = null;
export const DEFAULT_GUID = null;
export const DEFAULT_GUID_LENGTH = 36;
export const DEFAULT_NUMBER = 0;
export const DEFAULT_STRING = '';
export const MINIMUM_COUNT = 0;
export const MINIMUM_ID = 1;

// Time
export const HOURS_PER_DAY = 24;
export const MILLISECONDS = 1000;
export const MINUTES_PER_HOUR = 60;
export const SECONDS_PER_MINUTE = 60;

2. Identity

| | Item | Object | List | | :---------------------- | :-----: | :-----: | :-----: | | hasAllItemsInList | | | ✓ | | hasAllQueryValuesInList | | | ✓ | | hasAnyItems | | | ✓ | | hasItemInList | | | ✓ | | hasNoItems | | | ✓ | | hasQueryValueInList | | | ✓ | | hasUrl | ✓ | | | | isArray | ✓ | | | | isBoolean | ✓ | | | | isCount | ✓ | | | | isGuid | ✓ | | | | isId | ✓ | | | | isIframe | ✓ | | | | isIframeUrlMatching | ✓ | | | | isNumber | ✓ | | | | isObject | ✓ | | | | isString | ✓ | | | | isUrl | ✓ | | | | isUrlMatching | ✓ | | | | isItemDefined | ✓ | ✓ | ✓ | | isItemNotDefined | ✓ | ✓ | ✓ | | isPropertyDefined | | ✓ | |

3. Comparison Functions

| | Item | Object | List | | :------------------------- | :-----: | :-----: | :-----: | | caseInsensitiveEquals | ✓ | | | | caseInsensitiveIncludes | ✓ | | | | caseInsensitiveStartsWith | ✓ | | | | startsWith | ✓ | | |

4. Sanitize Functions

| | Item | Object | List | | :------------------ | :-----: | :-----: | :-----: | | sanitizeArray | | | ✓ | | sanitizeArrayList | | | ✓ | | sanitizeBoolean | ✓ | | | | sanitizeBooleanList | | | ✓ | | sanitizeCount | ✓ | | | | sanitizeCountList | | | ✓ | | sanitizeGuid | ✓ | | | | sanitizeGuidList | | | ✓ | | sanitizeId | ✓ | | | | sanitizeIdList | | | ✓ | | sanitizeList | | | ✓ | | sanitizeNumber | ✓ | | | | sanitizeNumberList | | | ✓ | | sanitizeObject | | ✓ | | | sanitizeObjectList | | | ✓ | | sanitizeString | ✓ | | | | sanitizeStringList | | | ✓ |

5. Get Functions

| | Item | Object | List | | :---------------------- | :-----: | :-----: | :-----: | | getArrayPropertyValue | | ✓ | | | getBooleanPropertyValue | | ✓ | | | getCountPropertyValue | | ✓ | | | getGuidPropertyValue | | ✓ | | | getIdPropertyValue | | ✓ | | | getNumericPropertyValue | | ✓ | | | getObjectPropertyValue | | ✓ | | | getPropertyValue | | ✓ | | | getStringPropertyValue | | ✓ | | | getSrcFromIframe | ✓ | | |

6. Transform

| | Item | Object | List | | :---------- | :-----: | :-----: | :-----: | | stringUtils | ✓ | | |

7. Sort Functions

| | Item | Object | List | | :-------------------------------- | :-----: | :-----: | :-----: | | sortNumbersAscending | | | ✓ | | sortNumbersDescending | | | ✓ | | sortStringAscending | | | ✓ | | sortNumbersDescending | | | ✓ | | sortCaseSensitiveStringAscending | | | ✓ | | sortStringDescending | | | ✓ | | sortCaseSensitiveStringDescending | | | ✓ | | sortNumberPropertyAscending | | | ✓ | | sortNumberPropertyDescending | | | ✓ | | sortStringPropertyAscending | | | ✓ | | sortStringPropertyDescending | | | ✓ |

8. Filter Functions

| | Item | Object | List | | :-------------------------------- | :-----: | :-----: | :-----: | | filterItemsEqualing | | | ✓ | | filterItemsNotEqualing | | | ✓ | | filterStringIncluding | | | ✓ | | filterPropertyEqualing | | | ✓ | | filterPropertyNotEqualing | | | ✓ |

9. Count Functions

| | Item | Object | List | | :------------------- | :-----: | :-----: | :-----: | | countItems | | | ✓ | | countPropertyValue | | | ✓ |

10. Time

| | Item | Object | List | | :------------------- | :-----: | :-----: | :-----: | | getISOTimestamp | ✓ | | |