@teleporthq/teleport-shared
Advanced tools
Comparing version 0.45.1-alpha.0 to 0.45.3-alpha.0
@@ -135,2 +135,5 @@ import { | ||
}) | ||
it('works with single upper case words', () => { | ||
expect(camelCaseToDashCase('AiAmAComponent')).toBe('ai-am-a-component') | ||
}) | ||
}) | ||
@@ -137,0 +140,0 @@ |
@@ -5,3 +5,3 @@ "use strict"; | ||
var camelCaseToDashCase = function (str) { | ||
return str.replace(/([a-z])(?=[A-Z])|([A-Z0-9][A-Z])(?=[A-Z][a-z])/g, '$1$2-').toLowerCase(); | ||
return str.replace(/([a-z])(?=[A-Z])|([A-Z0-9])(?=[A-Z][a-z])/g, '$1$2-').toLowerCase(); | ||
}; | ||
@@ -8,0 +8,0 @@ exports.camelCaseToDashCase = camelCaseToDashCase; |
export var camelCaseToDashCase = function (str) { | ||
return str.replace(/([a-z])(?=[A-Z])|([A-Z0-9][A-Z])(?=[A-Z][a-z])/g, '$1$2-').toLowerCase(); | ||
return str.replace(/([a-z])(?=[A-Z])|([A-Z0-9])(?=[A-Z][a-z])/g, '$1$2-').toLowerCase(); | ||
}; | ||
@@ -4,0 +4,0 @@ export var dashCaseToCamelCase = function (str) { |
{ | ||
"name": "@teleporthq/teleport-shared", | ||
"version": "0.45.1-alpha.0", | ||
"version": "0.45.3-alpha.0", | ||
"description": "A utility belt for the entire teleportHQ ecosystem", | ||
@@ -28,7 +28,7 @@ "author": "teleportHQ", | ||
"@babel/types": "^7.5.5", | ||
"@teleporthq/teleport-types": "^0.45.1-alpha.0", | ||
"@teleporthq/teleport-types": "^0.45.3-alpha.0", | ||
"jss": "^10.0.0", | ||
"jss-preset-default": "^10.0.0" | ||
}, | ||
"gitHead": "9dcc55b9c3a2ee0a23fa0133c722fe3600dddb2e" | ||
"gitHead": "760994b7309da1fd8a9956691d760f5b88aa268a" | ||
} |
export const camelCaseToDashCase = (str: string): string => | ||
str.replace(/([a-z])(?=[A-Z])|([A-Z0-9][A-Z])(?=[A-Z][a-z])/g, '$1$2-').toLowerCase() | ||
str.replace(/([a-z])(?=[A-Z])|([A-Z0-9])(?=[A-Z][a-z])/g, '$1$2-').toLowerCase() | ||
export const dashCaseToCamelCase = (str: string): string => | ||
@@ -4,0 +4,0 @@ str.replace(/[-_]+(.)?/g, (_, chr) => (chr ? chr.toUpperCase() : '')) |
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
252516
3616
+ Added@teleporthq/teleport-types@0.45.3-alpha.0(transitive)
- Removed@teleporthq/teleport-types@0.45.1-alpha.0(transitive)