Add tslint (#151)

This commit is contained in:
Jaco Greeff
2018-06-27 10:15:46 +02:00
committed by GitHub
parent 499a877f15
commit 73477a2809
134 changed files with 989 additions and 884 deletions
+11 -11
View File
@@ -6,17 +6,17 @@ import isNull from '../is/null';
import isUndefined from '../is/undefined';
/**
@name arrayFilter
@signature arrayFilter (array: Array<any>, allowNulls: boolean = true): Array<any>
@summary Filters undefined and (optionally) null values from an array
@description
Returns a new array with all `undefined` values removed. Optionally, when `allowNulls = false`, it removes the `null` values as well
@example
import { arrayFilter } from '@polkadot/util';
arrayFilter([0, void 0, true, null, false, '']); // [0, true, null, false, '']
arrayFilter([0, void 0, true, null, false, ''], false); // [0, true, false, '']
*/
* @name arrayFilter
* @signature arrayFilter (array: Array<any>, allowNulls: boolean = true): Array<any>
* @summary Filters undefined and (optionally) null values from an array
* @description
* Returns a new array with all `undefined` values removed. Optionally, when `allowNulls = false`, it removes the `null` values as well
* @example
* import { arrayFilter } from '@polkadot/util';
*
* arrayFilter([0, void 0, true, null, false, '']); // [0, true, null, false, '']
* arrayFilter([0, void 0, true, null, false, ''], false); // [0, true, false, '']
*/
export default function arrayFilter (array: Array<any>, allowNulls: boolean = true): Array<any> {
return array.filter((value) => {
return !isUndefined(value) && (allowNulls || !isNull(value));
+2 -2
View File
@@ -5,8 +5,8 @@
import arrayFilter from './filter';
/**
@summary Utility methods that operates on arrays
*/
* @summary Utility methods that operates on arrays
*/
export {
arrayFilter
};