1.1.7 • Published 4 years ago

kolbeinsson-utility v1.1.7

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

What is it

Utility package that gives you access to a vast array of utility functions

Getting started

yarn add --dev kolbeinsson-utility

Example use

import { arraySize } from 'kolbeinsson-utility';

console.log(arraySize(["One", "Two", "Three"])); 

// output --> 2





/*
    Other examples:


    // Dates
    getCurrentTime();
    getCurrentTimeISOStandart();
    parseDateToTime(new Date(96, 2, 2, 2, 2, 2));
    parseDateToDate(new Date(96, 2, 2, 2, 2, 2));
    getMonthFromDate(getCurrentTime());
    getYearFromDate(getCurrentTime());
    getDayFromDate(getCurrentTime());
    getHoursFromDate(getCurrentTime());
    dateToLocaleString(new Date(92,2,2,2,2,2), 'en-US');
    getForeignLocaleTimeNow('en-US');
    
    // Arrays
    arraySize(["One", "Two", "Three"]);
    arrayfind(["One", "Two", "Three"], "Three");
    arrayAdd(["One", "Two", "Three"], "Adding");
    arrayEmpty([]);
    arrayEmpty(["One", "Two", "Three"]);
    arraySize(["One", "Two"]);
    filterNumbersArray(["1", 2, 3, 4]);
    filterStringArray(["1", 2, 3, 4]);
    objectValuesToArray({ name: 'John Doe', year: '1992' });
    objectKeysToArray({ name: 'John Doe', year: '1992' });
    flattenArray(["one", "two", ["three", "four", ["five", "six"]]]);
    removeValueFromArray(["one", "two", "three", "four", "five", "six"], "six");
    removeIndexFromArray(["one", "two", "three", "four", "five", "six"], 5);
    
    // Map
    createMapFromObjectArray([{ keyOne: 'First', KeyTwo: 'Second', KeyThree: 1, keyFour: true }]);

    // Objects
    mapObjectKeys({ name: 'John Doe', year: '1992' });
    mapObjectValues({ name: 'John Doe', year: '1992' });
    objectTypeCheck({ name: 'John Doe', year: '1992' });

    // Strings
    searchStr("this", "String does actually contain this and should return true at this point.");
    trimStr("Here is a term you should notice       ");
    trimStr("             Here is a term you should notice. Congratulations. Dont thank me.      ");
    stringTypeCheck("Strring");

    // Numbers
    numberTypeCheck(234);
    numberPositive(234);
*/
1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago