@common-utilities/filter-array
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -13,4 +13,5 @@ "use strict"; | ||
*/ | ||
exports.filterArray = (arr) => arr.filter((item, index, self) => self.indexOf(item) === index); | ||
const filterArray = (arr) => arr.filter((item, index, self) => self.indexOf(item) === index); | ||
exports.filterArray = filterArray; | ||
exports.default = exports.filterArray; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@common-utilities/filter-array", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A basic implementation of the common utility function, filter-array 🧹", | ||
@@ -33,3 +33,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "3de4a71ca5c0192f988bfdede188fc72f941f9a4" | ||
"gitHead": "896fa6971331656a6762f2215104bf5d01fbe21c" | ||
} |
@@ -18,14 +18,9 @@ # @common-utilities/filter-array 🧰🧹 | ||
```typescript | ||
```javascript | ||
const filterArray = (arr) => arr.filter((item, index, self) => self.indexOf(item) === index) | ||
``` | ||
```typescript | ||
const filterArray = (arr: unknown[]): unknown[] => | ||
arr.filter((item: unknown, index: number, self: unknown[]) => self.indexOf(item) === index) | ||
``` | ||
## Usage | ||
```typescript | ||
```javascript | ||
filterArray(['test', 'test', 'foo', 'bar', 'biz']) | ||
@@ -32,0 +27,0 @@ // ['test', 'foo', 'bar', 'biz']) |
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
9
55
4892
40