Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contrail/util

Package Overview
Dependencies
Maintainers
4
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrail/util - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

lib/string-util.d.ts
export declare class StringUtil {
static convertToHyphenCase(entityName: string): string;
static convertToHyphenCase(entityName: string, transformToLowerCase?: boolean): string;
}

@@ -5,4 +5,7 @@ "use strict";

class StringUtil {
static convertToHyphenCase(entityName) {
const slugName = entityName === null || entityName === void 0 ? void 0 : entityName.split(/(?=[A-Z])/).join('-').toLowerCase();
static convertToHyphenCase(entityName, transformToLowerCase = true) {
const slugName = entityName === null || entityName === void 0 ? void 0 : entityName.split(/(?=[A-Z])/).join('-');
if (slugName && transformToLowerCase) {
return slugName.toLowerCase();
}
return slugName;

@@ -9,0 +12,0 @@ }

@@ -25,2 +25,7 @@ "use strict";

});
it('should handle the composite entity name but no lower case', () => {
const entityName = 'ItemContentHolder';
const slug = string_util_1.StringUtil.convertToHyphenCase(entityName, false);
expect(slug).toEqual('Item-Content-Holder');
});
it('should handle the empty name', () => {

@@ -27,0 +32,0 @@ const entityName = '';

{
"name": "@contrail/util",
"version": "1.0.3",
"version": "1.0.4",
"description": "General javascript utilities",

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

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