@hestia-earth/utils
Advanced tools
Comparing version 0.10.17 to 0.10.18
export declare const ellipsis: (text?: string, maxlength?: number) => string; | ||
export declare const keyToLabel: (key: string) => string; | ||
export declare const toDashCase: (value?: string) => string; | ||
export declare const now: () => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.now = exports.keyToLabel = exports.ellipsis = void 0; | ||
exports.now = exports.toDashCase = exports.keyToLabel = exports.ellipsis = void 0; | ||
var ellipsis = function (text, maxlength) { | ||
@@ -14,3 +14,19 @@ if (text === void 0) { text = ''; } | ||
exports.keyToLabel = keyToLabel; | ||
var toDashCase = function (value) { | ||
return value | ||
? value | ||
.replace(/([\d]{4})([A-Z]{1})/g, function (g) { return g.substring(0, 4) + "-" + g[4].toLowerCase(); }) | ||
.replace(/([\d]{1}[A-Z]{1}?)([A-Z]{1})/g, function (_g) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
return (args[0] + "-" + args[1]).toLowerCase(); | ||
}) | ||
.replace(/([A-Z])/g, function (g) { return "-" + g[0].toLowerCase(); }) | ||
.replace(/([0-9]{4})/g, function (g) { return "-" + g; }) | ||
: null; | ||
}; | ||
exports.toDashCase = toDashCase; | ||
var now = function () { return new Date().toJSON().substring(0, 10); }; | ||
exports.now = now; |
{ | ||
"name": "@hestia-earth/utils", | ||
"version": "0.10.17", | ||
"version": "0.10.18", | ||
"description": "Hestia Utils library", | ||
@@ -35,2 +35,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@hestia-earth/glossary": "^0.2.5", | ||
"@types/chai": "^4.2.21", | ||
@@ -51,3 +52,6 @@ "@types/mocha": "^7.0.2", | ||
"typescript": "^4.3.5" | ||
}, | ||
"peerDependencies": { | ||
"@hestia-earth/glossary": "^0.2.5" | ||
} | ||
} |
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
28327
26
589
1
16