mirror of
https://github.com/hanzoai/Detox.git
synced 2026-09-24 16:55:12 +00:00
* update babel to version 7 This enables us to generate better comments * use new addComment function of babel to generate nicer comments * improve tightly coupled test
23 lines
540 B
JavaScript
23 lines
540 B
JavaScript
const t = require("@babel/types");
|
|
|
|
function capitalizeFirstLetter(string) {
|
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
}
|
|
|
|
function methodNameToSnakeCase(name) {
|
|
return name
|
|
.split(':')
|
|
.map((item, index) =>
|
|
index === 0 ? item : capitalizeFirstLetter(item)
|
|
).join('');
|
|
}
|
|
|
|
function callGlobal(sanitizerName) {
|
|
return argIdentifier =>
|
|
t.callExpression(t.identifier(sanitizerName), [t.identifier(argIdentifier)]);
|
|
}
|
|
|
|
module.exports = {
|
|
methodNameToSnakeCase,
|
|
callGlobal
|
|
}; |