@ukon1990/js-utilities
Advanced tools
Comparing version 0.0.4 to 0.0.5
import { Match } from '../models/match.model'; | ||
export declare class TextUtil { | ||
static isEmpty(source: string): boolean; | ||
static contains(source: string, target: string): boolean; | ||
@@ -4,0 +5,0 @@ static getIndexOf(source: string, target: string): number; |
@@ -6,2 +6,11 @@ "use strict"; | ||
class TextUtil { | ||
static isEmpty(source) { | ||
if (!source) | ||
return true; | ||
if (source === null) | ||
return true; | ||
if (source.length === 0) | ||
return true; | ||
return false; | ||
} | ||
static contains(source, target) { | ||
@@ -8,0 +17,0 @@ if (empty_util_1.EmptyUtil.isNullOrUndefined(source) || empty_util_1.EmptyUtil.isNullOrUndefined(target)) { |
{ | ||
"name": "@ukon1990/js-utilities", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "A light weight package for object and array manipulation. As well as some utilities for matching text.", | ||
@@ -20,3 +20,4 @@ "main": "dist/index.js", | ||
"Difference", | ||
"Equality" | ||
"Equality", | ||
"isEmpty" | ||
], | ||
@@ -23,0 +24,0 @@ "author": "Jonas Munthe Flønes", |
@@ -5,2 +5,8 @@ import {Match} from '../models/match.model'; | ||
export class TextUtil { | ||
public static isEmpty(source: string): boolean { | ||
if (!source) return true; | ||
if (source === null) return true; | ||
if (source.length === 0) return true; | ||
return false; | ||
} | ||
@@ -7,0 +13,0 @@ public static contains(source: string, target: string): boolean { |
66105
639