🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

hb-utils

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hb-utils - npm Package Compare versions

Comparing version

to
0.0.2

dist/lib/index.d.ts

3

dist/lib/ObjectUtils.d.ts
/**
* Class for common operations with js literal objects
*/
declare class ObjectUtils {
export declare class ObjectUtils {
/**

@@ -36,2 +36,1 @@ *

}
export default ObjectUtils;

@@ -64,3 +64,3 @@ "use strict";

}
exports.default = ObjectUtils;
exports.ObjectUtils = ObjectUtils;
//# sourceMappingURL=ObjectUtils.js.map
/**
* Class for common operations with strings
*/
declare class StringUtils {
export declare class StringUtils {
/**

@@ -13,2 +13,1 @@ *

}
export default StringUtils;

@@ -21,3 +21,3 @@ "use strict";

}
exports.default = StringUtils;
exports.StringUtils = StringUtils;
//# sourceMappingURL=StringUtils.js.map
/**
* Class for time management
*/
declare class TimeUtils {
export declare class TimeUtils {
/**

@@ -26,2 +26,1 @@ *

}
export default TimeUtils;

@@ -40,3 +40,3 @@ "use strict";

}
exports.default = TimeUtils;
exports.TimeUtils = TimeUtils;
//# sourceMappingURL=TimeUtils.js.map

@@ -13,3 +13,3 @@ "use strict";

};
const str = ObjectUtils_1.default.toString(obj);
const str = ObjectUtils_1.ObjectUtils.toString(obj);
chai_1.assert.equal("name=Some Name,company=Hanaboso,timestamp=1496993205364", str);

@@ -23,3 +23,3 @@ });

};
obj = ObjectUtils_1.default.escapeProperties(obj, ["+", "=", " ", "*"]);
obj = ObjectUtils_1.ObjectUtils.escapeProperties(obj, ["+", "=", " ", "*"]);
chai_1.assert.deepEqual({

@@ -38,3 +38,3 @@ name: "Escape\\ Spaces",

obj.baz = null;
obj = ObjectUtils_1.default.removeNullableProperties(obj);
obj = ObjectUtils_1.ObjectUtils.removeNullableProperties(obj);
chai_1.assert.deepEqual({

@@ -54,3 +54,3 @@ foo: "bar",

};
const merged = ObjectUtils_1.default.mergeObjectsProperties(one, two);
const merged = ObjectUtils_1.ObjectUtils.mergeObjectsProperties(one, two);
chai_1.assert.deepEqual(merged, {

@@ -57,0 +57,0 @@ foo: "changed",

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

it("should escape selected chars in string", () => {
const res = StringUtils_1.default.escapeChars("some=string + to be escaped", ["+", "="]);
const res = StringUtils_1.StringUtils.escapeChars("some=string + to be escaped", ["+", "="]);
chai_1.assert.typeOf(res, "string");

@@ -11,0 +11,0 @@ chai_1.assert.equal("some\\=string \\+ to be escaped", res);

@@ -11,15 +11,15 @@ "use strict";

// seconds
const sec = `${TimeUtils_1.default.nowSeconds()}`;
const sec = `${TimeUtils_1.TimeUtils.nowSeconds()}`;
chai_1.assert.equal(10, sec.length);
chai_1.assert.include(sec, approxNow);
// miliseconds
const mili = `${TimeUtils_1.default.nowMili()}`;
const mili = `${TimeUtils_1.TimeUtils.nowMili()}`;
chai_1.assert.equal(13, mili.length);
chai_1.assert.include(mili, approxNow);
// microseconds
const micro = `${TimeUtils_1.default.nowMicro()}`;
const micro = `${TimeUtils_1.TimeUtils.nowMicro()}`;
chai_1.assert.equal(16, micro.length);
chai_1.assert.include(micro, approxNow);
// nanoseconds
const nano = TimeUtils_1.default.nowNano();
const nano = TimeUtils_1.TimeUtils.nowNano();
chai_1.assert.equal(19, nano.length);

@@ -26,0 +26,0 @@ chai_1.assert.include(nano, approxNow);

{
"name": "hb-utils",
"version": "0.0.1",
"version": "0.0.2",
"description": "Hanaboso custom utilities for work with objects, string, time etc.",
"main": "./dist/src/Metrics.js",
"main": "./dist/lib/index.js",
"scripts": {

@@ -7,0 +7,0 @@ "test": "NODE_ENV=test ./node_modules/mocha/bin/mocha dist/test/**/*.test.js --recursive --reporter spec",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet