Wondering what’s next for npm?Check out our public roadmap! »

    @zionapps/core
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0 • Public • Published

    @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

    Install

    npm i @zionapps/core

    DownloadsWeekly Downloads

    123

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    202 kB

    Total Files

    74

    Last publish

    Collaborators

    • avatar