@ulu/utils
Advanced tools
Comparing version 0.0.11 to 0.0.12
# Change Log | ||
## 0.0.12 | ||
- Array > getFirstLast() Test whether an index in an array is first or last | ||
## 0.0.11 | ||
@@ -4,0 +8,0 @@ |
@@ -107,2 +107,16 @@ /** | ||
} | ||
} | ||
/** | ||
* Test whether an index in an array is first or last | ||
* - Returns an object with both first/last keys (true/false) | ||
* @param {Array} array Array to check index against (uses .length) | ||
* @param {Number} index Index to get info for | ||
* @returns {Object} { first: {Boolean}, last: {Boolean} } | ||
*/ | ||
export function getFirstLast(array, index) { | ||
return { | ||
first: index === 0, | ||
last: index === array.length - 1 | ||
}; | ||
} |
{ | ||
"name": "@ulu/utils", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Low level utility library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -59,2 +59,10 @@ /** | ||
export function joinForSentence(array: any): string; | ||
/** | ||
* Test whether an index in an array is first or last | ||
* - Returns an object with both first/last keys (true/false) | ||
* @param {Array} array Array to check index against (uses .length) | ||
* @param {Number} index Index to get info for | ||
* @returns {Object} { first: {Boolean}, last: {Boolean} } | ||
*/ | ||
export function getFirstLast(array: any[], index: number): any; | ||
//# sourceMappingURL=array.d.ts.map |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38000
979