How to use pascal-case - 10 common examples

To help you get started, we’ve selected a few pascal-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 trufflesuite / truffle / packages / truffle-db / src / data / util-helpers.ts View on Github external
export function prefixType({ typeDef, name }): GraphQLObjectType {
  return Object.assign(
    // assign prototype
    Object.create(typeDef),

    // assign all fields
    typeDef,

    // override name
    {
      name: `${pascalCase(name)}${typeDef.name}`,
    },
  );
}
github trufflesuite / truffle / packages / truffle-db / src / data / util-helpers.ts View on Github external
.map(([operation, typeDef]) => ({
      [operation]: new GraphQLObjectType({
        name: pascalCase(operation),
        fields: {
          [name]: {
            type: new GraphQLNonNull(typeDef),
            resolve: () => true
          },
        },
      }),
    }))
    .reduce((a, b) => ({ ...a, ...b }), {}); // combine objects
github TradeMe / tractor / plugins / page-objects / src / tractor / client / models / meta / page-object-meta.js View on Github external
constructor (pageObject, options = {}) {
            let { basename, meta, path, url } = pageObject;
            let { includeName, isPlugin } = options;
            
            // `meta` may not exist if this is an empty, brand new .po.js file:
            if (!meta) {
                this.name = basename;
                this.actions = [];
                this.elements = [];
            }

            this.name = this.name || meta.name;
            this.path = path;
            this.url = url;
            this.variableName = pascalcase(this.name);
            this.instanceName = camelcase(this.name);

            this.actions = this.actions || meta.actions.map(action => new ActionMetaModel({
                ...action,
                returns: 'promise'
            }));
            this.elements = this.elements || meta.elements.map(element => new ValueModel(element));

            this.elementsWithType = this.elements.filter((_, i) => meta.elements[i].type);
            this.elementGroups = this.elements.filter((_, i) => meta.elements[i].group);

            this.isIncluded = !!includeName;
            this.isPlugin = !!isPlugin;
            this.displayName = this.isIncluded ? `${includeName} - ${this.name}` : this.name;
        }
    };
github octokit / webhooks.js / scripts / generate-types.js View on Github external
webhooks.forEach(({ name, actions, examples }) => {
  if (!examples) {
    return;
  }

  const typeName = `WebhookPayload${pascalCase(name)}`;
  tw.add(examples, {
    rootTypeName: typeName,
    namedKeyPaths: {
      [`${typeName}.repository`]: "PayloadRepository",
      // This prevents a naming colision between the payload of a `installation_repositories` event
      // and the `repositories` attribute of a `installation` event
      "WebhookPayloadInstallation.repositories":
        "WebhookPayloadInstallation_Repositories"
    }
  });

  const events = [
    `'${name}'`,
    ...actions.map(action => `'${name}.${action}'`)
  ].join(" | ");
  signatures.push(`
github alibaba / uform / packages / react-schema-renderer / src / shared / registry.ts View on Github external
name &&
    (isFn(component) || typeof component.styledComponentId === 'string')
  ) {
    name = lowercase(name)
    if (noWrapper) {
      registry.fields[name] = component
      registry.fields[name].__WRAPPERS__ = []
    } else {
      registry.fields[name] = compose(
        component,
        registry.wrappers,
        true
      )
      registry.fields[name].__WRAPPERS__ = registry.wrappers
    }
    registry.fields[name].displayName = pascalCase(name)
  }
}
github alibaba / uform / packages / react / src / shared / virtualbox.tsx View on Github external
{children}
    
  )

  if (component.defaultProps) {
    VirtualBox.defaultProps = component.defaultProps
  }

  VirtualBox.displayName = pascalCase(name)

  return VirtualBox
}
github wadackel / css-keyframer / src / get-animation-prop.js View on Github external
export default function getAnimationProp() {
  const prop = "animation";
  const animation = cssVendor.supportedProperty(prop) || prop;
  const prefix = animation.replace("animation", "");

  return {
    css: animation,
    js: prefix === "" ? animation : pascalCase(animation)
  };
}
github expo / expo-cli / packages / xdl / src / detach / IosShellApp.js View on Github external
.info('Using manifest:', JSON.stringify(manifest));
  } else if (args.url && args.sdkVersion) {
    const { url, sdkVersion, releaseChannel } = args;
    manifest = await getManifestAsync(url, {
      'Exponent-SDK-Version': sdkVersion,
      'Exponent-Platform': 'ios',
      'Expo-Release-Channel': releaseChannel ? releaseChannel : 'default',
      Accept: 'application/expo+json,application/json',
    });
  }

  let bundleExecutable = args.type === 'client' ? EXPONENT_APP : EXPOKIT_APP;
  if (has(manifest, 'ios.infoPlist.CFBundleExecutable')) {
    bundleExecutable = get(manifest, 'ios.infoPlist.CFBundleExecutable');
  } else if (privateConfig && privateConfig.bundleIdentifier) {
    bundleExecutable = pascalCase(privateConfig.bundleIdentifier);
  }

  const buildFlags = StandaloneBuildFlags.createIos(args.configuration, {
    workspaceSourcePath,
    appleTeamId: args.appleTeamId,
    buildType: args.type,
    bundleExecutable,
  });
  const context = StandaloneContext.createServiceContext(
    expoSourcePath,
    args.archivePath,
    manifest,
    privateConfig,
    args.testEnvironment,
    buildFlags,
    args.url,
github bosonic / bosonic / react / src / reactify.js View on Github external
export default function (CustomElement, opts) {
  opts = assign({}, defaults, opts);
  if (typeof CustomElement !== 'function') {
    throw new Error('Given element is not a valid constructor');
  }
  const tagName = (new CustomElement()).tagName.toLowerCase();
  const displayName = pascalCase(tagName);
  const { React, ReactDOM } = opts;

  if (!React || !ReactDOM) {
    throw new Error('React and ReactDOM must be dependencies, globally on your `window` object or passed via opts.');
  }

  class ReactComponent extends React.Component {
    static get displayName() {
      return displayName;
    }
    componentDidMount() {
      this.componentWillReceiveProps(this.props);
    }
    componentWillReceiveProps(props) {
      const node = ReactDOM.findDOMNode(this);
      Object.keys(props).forEach(name => {
github alibaba / uform / packages / react / src / shared / virtualbox.js View on Github external
{children}
    
  )

  if (component.defaultProps) {
    VirtualBox.defaultProps = component.defaultProps
  }

  VirtualBox.displayName = pascalCase(name)

  return VirtualBox
}

pascal-case

Transform into a string of capitalized words without separators

MIT
Latest version published 6 months ago

Package Health Score

63 / 100
Full package analysis