Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ulu/utils

Package Overview
Dependencies
Maintainers
0
Versions
16
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

20

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;
}

2

package.json
{
"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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc