How to use the param-case.paramCase function in param-case

To help you get started, we’ve selected a few param-case examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dotansimha / graphql-code-generator / packages / plugins / typescript / stencil-apollo / src / visitor.ts View on Github external
private _buildClassComponent(node: OperationDefinitionNode, documentVariableName: string, operationType: string, operationResultType: string, operationVariablesTypes: string): string {
    const componentName: string = this.convertName(node.name.value + 'Component');
    const apolloStencilComponentTag = paramCase(`Apollo${operationType}`);
    const rendererSignature = toPascalCase(`${operationType}Renderer`);

    return `
@Component({
    tag: '${paramCase(`Apollo${toPascalCase(node.name.value)}`)}'
})
export class ${componentName} {
    @Prop() renderer: import('stencil-apollo').${rendererSignature}<${operationResultType}, ${operationVariablesTypes}>;
    @Prop() variables: ${operationVariablesTypes};
    render() {
        return <${apolloStencilComponentTag} ${operationType.toLowerCase()}={ ${documentVariableName} } variables={ this.variables } renderer={ this.renderer } />;
    }
}
      `;
  }
github dotansimha / graphql-code-generator / packages / plugins / typescript / stencil-apollo / src / visitor.ts View on Github external
private _buildClassComponent(node: OperationDefinitionNode, documentVariableName: string, operationType: string, operationResultType: string, operationVariablesTypes: string): string {
    const componentName: string = this.convertName(node.name.value + 'Component');
    const apolloStencilComponentTag = paramCase(`Apollo${operationType}`);
    const rendererSignature = toPascalCase(`${operationType}Renderer`);

    return `
@Component({
    tag: '${paramCase(`Apollo${toPascalCase(node.name.value)}`)}'
})
export class ${componentName} {
    @Prop() renderer: import('stencil-apollo').${rendererSignature}<${operationResultType}, ${operationVariablesTypes}>;
    @Prop() variables: ${operationVariablesTypes};
    render() {
        return <${apolloStencilComponentTag} ${operationType.toLowerCase()}={ ${documentVariableName} } variables={ this.variables } renderer={ this.renderer } />;
    }
}
      `;
  }
github pnp / generator-spfx / lib / util.js View on Github external
deployTemplates(yeoman, injections) {

        const component = this.getComponentManifest(yeoman);

        if (component === null) {
            return null;
        }

        const templatePath = yeoman.templatePath(component.templatePath);

        const ejsInject = {
            componentClassName: component.componentClassName,
            componentClassNameKebabCase: paramCase(component.componentClassName),
            componentNameCamelCase: component.componentClassName,
            componentStrings: component.componentClassName + 'Strings',
            componentPath: component.componentPath,
            componentName: component.componentName
        };

        Object.assign(ejsInject, injections);

        this.deployTemplatesToPath(yeoman, ejsInject, templatePath, component.componentPath);
    }
github skovy / typed-scss-modules / lib / sass / file-to-class-names.ts View on Github external
      return className => paramCase(className);
    case "camel":
github dotansimha / graphql-code-generator / packages / plugins / typescript / stencil-apollo / src / visitor.ts View on Github external
private _buildOperationFunctionalComponent(node: OperationDefinitionNode, documentVariableName: string, operationType: string, operationResultType: string, operationVariablesTypes: string): string {
    const operationName: string = this.convertName(node.name.value);
    const propsTypeName: string = this.convertName(operationName + 'Props');
    const rendererSignature = toPascalCase(`${operationType}Renderer`) + `<${operationResultType}, ${operationVariablesTypes}>`;
    const apolloStencilComponentTag = paramCase(`Apollo${operationType}`);
    const componentName = this.convertName(`${operationName}Component`);

    const propsVar = `
export type ${propsTypeName} = {
    variables ?: ${operationVariablesTypes};
    inlist ?: StencilApollo.${rendererSignature};
};
      `;

    const component = `
export const ${componentName} = (props: ${propsTypeName}, children: [StencilApollo.${rendererSignature}]) => (
  <${apolloStencilComponentTag} ${operationType.toLowerCase()}={ ${documentVariableName} } { ...props } renderer={ children[0] } />
);
      `;

    return [propsVar, component].filter(a => a).join('\n');

param-case

Transform into a lower cased string with dashes between words

MIT
Latest version published 1 year ago

Package Health Score

63 / 100
Full package analysis

Popular param-case functions