Launch Week Day 3: Introducing Organization Notifications in Socket.Learn More
Socket
Book a DemoSign in
Socket

@ulu/utils

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ulu/utils - npm Package Compare versions

Comparing version
0.0.13
to
0.0.15
+12
-8
CHANGELOG.md
# Change Log
## 0.0.14
- (Added) Array > filterInPlace() Will not copy array, mutates the array passed (instead of copy [ie. Array.filter()])
## 0.0.13
- Browser > dom > isBrowser() Test whether script is executing in browser environment
- (Added) Browser > dom > isBrowser() Test whether script is executing in browser environment
## 0.0.12
- Array > getFirstLast() Test whether an index in an array is first or last
- (Added) Array > getFirstLast() Test whether an index in an array is first or last
## 0.0.11
- Array > joinForSentence (Used for joining array of strings/numbers for a sentence)
- (Added) Array > joinForSentence (Used for joining array of strings/numbers for a sentence)
- Example [1,2,3] "1, 2 and 3"

@@ -18,13 +22,13 @@

- String > separateCssUnit (change returned value to number [versus string])
- (Added) String > separateCssUnit (change returned value to number [versus string])
## 0.0.9
- Add String (toInitials) Creates initials from string
- (Added) Add String (toInitials) Creates initials from string
## 0.0.8
- add number (sum and average)
- Add array (removeDuplicates, createEmptyMatrix)
- Add string (titleCase)
- (Added) number (sum and average)
- (Added) array (removeDuplicates, createEmptyMatrix)
- (Added) string (titleCase)

@@ -31,0 +35,0 @@ ## 0.0.7

@@ -121,2 +121,20 @@ /**

};
}
/**
* Filter Array In Place
* - Will not copy array, mutates the array passed (instead of copy [ie. Array.filter()])
* - Note, removes items in reverse order (end-to-start of array), test will be called on last item first and so on
* @param {Array} array The array to filter items from
* @param {Function} test A function to filter elements based on a truthy/falsy condition
* @returns {Array} The original array
*/
export function filterInPlace(array, test) {
for (let i = array.length - 1; i >= 0; i--) {
if (!test(array[i], i, array)) {
array.splice(i, 1);
}
}
return array;
}
+1
-1
{
"name": "@ulu/utils",
"version": "0.0.13",
"version": "0.0.15",
"description": "Low level utility library",

@@ -5,0 +5,0 @@ "keywords": [

@@ -67,2 +67,11 @@ /**

export function getFirstLast(array: any[], index: number): any;
/**
* Filter Array In Place
* - Will not copy array, mutates the array passed (instead of copy [ie. Array.filter()])
* - Note, removes items in reverse order (end-to-start of array), test will be called on last item first and so on
* @param {Array} array The array to filter items from
* @param {Function} test A function to filter elements based on a truthy/falsy condition
* @returns {Array} The original array
*/
export function filterInPlace(array: any[], test: Function): any[];
//# sourceMappingURL=array.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../lib/array.js"],"names":[],"mappings":"AAAA;;GAEG;AAGH;;;;;;GAMG;AACH,iEAEC;AAED;;;;GAIG;AACH,6DAGC;AAGD;;;;;GAKG;AACH,qEAEC;AAED;;;;GAIG;AACH,0DAFW,OAAO,QAOjB;AAED;;;;;GAKG;AACH,2FAQC;AAED;;;;GAIG;AACH,sDAGC;AAED;;;;;;GAMG;AACH,mGAOC;AAGD;;;;;GAKG;AACH,oDAQC;AAED;;;;;;GAMG;AACH,+DAKC"}
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../lib/array.js"],"names":[],"mappings":"AAAA;;GAEG;AAGH;;;;;;GAMG;AACH,iEAEC;AAED;;;;GAIG;AACH,6DAGC;AAGD;;;;;GAKG;AACH,qEAEC;AAED;;;;GAIG;AACH,0DAFW,OAAO,QAOjB;AAED;;;;;GAKG;AACH,2FAQC;AAED;;;;GAIG;AACH,sDAGC;AAED;;;;;;GAMG;AACH,mGAOC;AAGD;;;;;GAKG;AACH,oDAQC;AAED;;;;;;GAMG;AACH,+DAKC;AAGD;;;;;;;GAOG;AACH,mEAOC"}