Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
content = content.replace(styleRegex, '');
if (templateArray.length === 0) {
let error = `I had an error processing component templates. in this file \n${templatePath}`;
console.error(new Error(error));
reject(error);
}
let templateName = templateArray[templateArray.length - 1].replace('.vue', '');
let componentScript = script || {};
componentScript.template = body;
resolve({
type: type,
style: style,
name: camelCase(templateName),
script: componentScript
});
}
});
});
return Object.keys(obj).reduce((memo, key) => {
memo[camel(key)] = obj[key];
return memo;
}, {});
}
get () {
return camelcase(this.name);
}
},
export function getModifier(styleObj, modifier, defaultModifier) {
if (!styleObj) {
return null;
}
const modifiers = styleObj.modifiers || styleObj;
return modifiers[modifier] || modifiers[camelcase(modifier)] || defaultModifier;
}
_bindHandler(name, paramPath = null) {
const fullPath = (paramPath === null)
? `/${name}`
: `/${name}/${paramPath}`;
const handlerMethod = this[`_handle_${camelCase(name)}`].bind(this);
function handleRequest(req, res, next) {
try {
Promise.resolve(handlerMethod(req, res)).catch((error) => {
next(error);
});
} catch (error) {
next(error);
}
}
this._router.get(fullPath, handleRequest);
}
async function mockRequestFileNameChange (file, data) {
let { oldName, newName } = data;
let oldInstanceName = camelcase(oldName);
let newInstanceName = camelcase(newName);
await file.refactor('identifierChange', {
oldName: oldInstanceName,
newName: newInstanceName,
context: MOCK_REQUEST_INSTANCE_REQUIRE_QUERY
});
return file.refactor('identifierChange', {
oldName: oldInstanceName,
newName: newInstanceName,
context: MOCK_REQUEST_INSTANCE_BODY_PROPERTY_QUERY
});
}
constructor (meta) {
let { description, name, parameters, returns } = meta;
this.description = description;
this.name = name;
this.variableName = camelcase(this.name);
this.parameters = this._getParameters(parameters);
if (returns) {
if (typeof returns === 'string') {
returns = { type: returns };
}
this.returns = new ValueModel(returns);
}
}
async function mockRequestFileNameChange (file, data) {
let { oldName, newName } = data;
let oldInstanceName = camelcase(oldName);
let newInstanceName = camelcase(newName);
await file.refactor('identifierChange', {
oldName: oldInstanceName,
newName: newInstanceName,
context: MOCK_REQUEST_INSTANCE_REQUIRE_QUERY
});
return file.refactor('identifierChange', {
oldName: oldInstanceName,
newName: newInstanceName,
context: MOCK_REQUEST_INSTANCE_BODY_PROPERTY_QUERY
});
}
fields: mutations.reduce((memo, mutationDefinition) => {
const definition = transformSimpleMutationDefinition(
mutationDefinition(types)
);
memo[camel(definition.name)] = mutationWithClientMutationId(definition);
return memo;
}, {}),
});
childFragmentSpread.map(spread => ({
name: camelCase(spread.name),
type: spread.name,
annotations: ['Nonnull'],
})),
[],