New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ts-commons

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-commons - npm Package Compare versions

Comparing version 0.0.37 to 0.0.38

0

.vscode/launch.json

@@ -0,0 +0,0 @@ {

15

dist/utils/array.utils.d.ts
export declare class ArrayUtils {
/**
* check whether current array is empty.
* eg: ArrayUtils.isEmpty([]) = true;
* eg: ArrayUtils.isEmpty(null) = true;
* eg: ArrayUtils.isEmpty(underfind) = true;
* eg: ArrayUtils.isEmtpy([1]) = fase;
* eg: ArrayUtils.isEmtpy("string") = fase;
* eg: ArrayUtils.isEmtpy(123) = fase;
* @param array
*/
static isEmpty<T>(array: T[]): boolean;
/**
* Determines whether an element is in the array.
* @param array
* @param obj
*/
static contains<T>(array: T[], obj: T): boolean;

@@ -4,0 +19,0 @@ static containsAny<T>(array: T[], candidates: T[]): boolean;

@@ -5,9 +5,29 @@ "use strict";

var number_utils_1 = require("./number.utils");
// from org.springframework.util.CollectionUtils
var ArrayUtils = /** @class */ (function () {
function ArrayUtils() {
}
/**
* check whether current array is empty.
* eg: ArrayUtils.isEmpty([]) = true;
* eg: ArrayUtils.isEmpty(null) = true;
* eg: ArrayUtils.isEmpty(underfind) = true;
* eg: ArrayUtils.isEmtpy([1]) = fase;
* eg: ArrayUtils.isEmtpy("string") = fase;
* eg: ArrayUtils.isEmtpy(123) = fase;
* @param array
*/
ArrayUtils.isEmpty = function (array) {
return !object_utils_1.ObjectUtils.isArray(array) || array.length === 0;
if (object_utils_1.ObjectUtils.isNullOrUndefined(array)) {
return true;
}
if (!object_utils_1.ObjectUtils.isArray(array)) {
return false;
}
return array.length === 0;
};
/**
* Determines whether an element is in the array.
* @param array
* @param obj
*/
ArrayUtils.contains = function (array, obj) {

@@ -14,0 +34,0 @@ if (this.isEmpty(array) || object_utils_1.ObjectUtils.isNullOrUndefined(obj)) {

@@ -18,3 +18,8 @@ "use strict";

}
return new Date(timestamp * 1000);
if (timestamp > 1000000000000) {
return new Date(timestamp);
}
else {
return new Date(timestamp * 1000);
}
};

@@ -21,0 +26,0 @@ return DateUtils;

2

package.json
{
"name": "ts-commons",
"version": "0.0.37",
"version": "0.0.38",
"description": "common methods for typescript",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

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