@teleporthq/teleport-shared
Advanced tools
Comparing version 0.10.1 to 0.10.4
@@ -10,1 +10,2 @@ export declare const camelCaseToDashCase: (str: string) => string; | ||
export declare const encode: (str: string) => string; | ||
export declare const generateRandomString: () => string; |
@@ -51,2 +51,3 @@ "use strict"; | ||
'}': '}', | ||
"'": ''', | ||
}; | ||
@@ -62,2 +63,7 @@ exports.encode = function (str) { | ||
}; | ||
exports.generateRandomString = function () { | ||
return Math.random() | ||
.toString(36) | ||
.substring(2, 6); | ||
}; | ||
//# sourceMappingURL=string-utils.js.map |
@@ -131,2 +131,3 @@ "use strict"; | ||
case 'dynamic': | ||
case 'raw': | ||
break; | ||
@@ -172,2 +173,3 @@ default: | ||
case 'dynamic': | ||
case 'raw': | ||
break; | ||
@@ -201,2 +203,3 @@ default: | ||
case 'dynamic': | ||
case 'raw': | ||
break; | ||
@@ -273,3 +276,7 @@ default: | ||
// Traverses the style object and applies the convert funtion to all the dynamic styles | ||
exports.transformDynamicStyles = function (style, transform) { | ||
exports.transformDynamicStyles = function (style, | ||
// tslint:disable-next-line no-any | ||
transform | ||
// tslint:disable-next-line no-any | ||
) { | ||
return Object.keys(style).reduce(function (resultedStyles, styleKey) { | ||
@@ -398,2 +405,4 @@ var styleValue = style[styleKey]; | ||
return exports.findFirstElementNode(childNode); | ||
default: | ||
throw new Error("Invalid node type '" + node + "'"); | ||
} | ||
@@ -400,0 +409,0 @@ }; |
@@ -10,1 +10,2 @@ export declare const camelCaseToDashCase: (str: string) => string; | ||
export declare const encode: (str: string) => string; | ||
export declare const generateRandomString: () => string; |
@@ -45,2 +45,3 @@ export const camelCaseToDashCase = (str) => str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase(); | ||
'}': '}', | ||
"'": ''', | ||
}; | ||
@@ -56,2 +57,5 @@ export const encode = (str) => { | ||
}; | ||
export const generateRandomString = () => Math.random() | ||
.toString(36) | ||
.substring(2, 6); | ||
//# sourceMappingURL=string-utils.js.map |
@@ -125,2 +125,3 @@ import { ASSETS_IDENTIFIER } from '../constants'; | ||
case 'dynamic': | ||
case 'raw': | ||
break; | ||
@@ -166,2 +167,3 @@ default: | ||
case 'dynamic': | ||
case 'raw': | ||
break; | ||
@@ -195,2 +197,3 @@ default: | ||
case 'dynamic': | ||
case 'raw': | ||
break; | ||
@@ -267,3 +270,7 @@ default: | ||
// Traverses the style object and applies the convert funtion to all the dynamic styles | ||
export const transformDynamicStyles = (style, transform) => { | ||
export const transformDynamicStyles = (style, | ||
// tslint:disable-next-line no-any | ||
transform | ||
// tslint:disable-next-line no-any | ||
) => { | ||
return Object.keys(style).reduce((resultedStyles, styleKey) => { | ||
@@ -392,2 +399,4 @@ const styleValue = style[styleKey]; | ||
return findFirstElementNode(childNode); | ||
default: | ||
throw new Error(`Invalid node type '${node}'`); | ||
} | ||
@@ -394,0 +403,0 @@ }; |
{ | ||
"name": "@teleporthq/teleport-shared", | ||
"version": "0.10.1", | ||
"version": "0.10.4", | ||
"description": "A utility belt for the entire teleportHQ ecosystem", | ||
@@ -30,7 +30,7 @@ "author": "teleportHQ", | ||
"@babel/types": "^7.5.5", | ||
"@teleporthq/teleport-types": "^0.10.1", | ||
"@teleporthq/teleport-types": "^0.10.4", | ||
"jss": "^10.0.0", | ||
"jss-preset-default": "^10.0.0" | ||
}, | ||
"gitHead": "7a290387c6a68eec58f6cc2aac5e5bcdced0184e" | ||
"gitHead": "b5f838aac54b6af2c6bed73e4044ead5b747ecf4" | ||
} |
@@ -57,2 +57,3 @@ export const camelCaseToDashCase = (str: string): string => | ||
'}': '}', | ||
"'": ''', | ||
} | ||
@@ -69,1 +70,6 @@ | ||
} | ||
export const generateRandomString = () => | ||
Math.random() | ||
.toString(36) | ||
.substring(2, 6) |
@@ -179,2 +179,3 @@ import { ASSETS_IDENTIFIER } from '../constants' | ||
case 'dynamic': | ||
case 'raw': | ||
break | ||
@@ -233,2 +234,3 @@ | ||
case 'dynamic': | ||
case 'raw': | ||
break | ||
@@ -272,2 +274,3 @@ | ||
case 'dynamic': | ||
case 'raw': | ||
break | ||
@@ -376,3 +379,5 @@ | ||
style: UIDLStyleDefinitions, | ||
// tslint:disable-next-line no-any | ||
transform: (value: UIDLDynamicReference, key?: string) => any | ||
// tslint:disable-next-line no-any | ||
): Record<string, any> => { | ||
@@ -509,5 +514,5 @@ return Object.keys(style).reduce((resultedStyles: Record<string, unknown>, styleKey) => { | ||
if (['string', 'number'].indexOf(entityType) !== -1) { | ||
acc[key] = transformStringAssignmentToJson(attributeContent as | ||
| string | ||
| number) as UIDLAttributeValue | ||
acc[key] = transformStringAssignmentToJson( | ||
attributeContent as string | number | ||
) as UIDLAttributeValue | ||
return acc | ||
@@ -557,2 +562,4 @@ } | ||
return findFirstElementNode(childNode) | ||
default: | ||
throw new Error(`Invalid node type '${node}'`) | ||
} | ||
@@ -559,0 +566,0 @@ } |
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
2392
324720