How to use constant-case - 7 common examples

To help you get started, we’ve selected a few constant-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 akameco / s2s / .deprecated / babel-plugin-s2s-d-action-tests / src / index.js View on Github external
const createTest = name =>
  builders.test({
    NAME: t.stringLiteral(constantCase(name)),
    FUNC: t.identifier(_.camelCase(name)),
  })
github reworkjs / reworkjs / src / framework / common / decorators / provider / ProviderDecorator.js View on Github external
function parseActionType(actionType, domainIdentifier, propertyName) {
  if (actionType === ACTION_TYPE_DYNAMIC) {
    return `@@provider/${constantCase(domainIdentifier)}/action/${constantCase(propertyName)}`;
  }

  return actionType;
}
github reworkjs / reworkjs / src / framework / common / decorators / provider / ProviderDecorator.js View on Github external
function extractSaga(propertyName: string, dataBag: DataBag) {
  const { ProviderClass, sagaList } = dataBag;

  const property = ProviderClass[propertyName];
  const metadata = getPropertyMetadata(property);

  let callActionHandler;
  const actionBuilder = installActionBuilder(dataBag, propertyName);

  if (metadata.trackStatus) {
    const { initialState, addActionListener } = dataBag;

    const trackActionType = `@@provider/${dataBag.domainIdentifier}/setRunning/${constantCase(propertyName)}`;
    callActionHandler = function *callActionHandlerWithTracking(action) {
      try {
        yield put({ type: trackActionType, payload: true });
        yield* property.apply(ProviderClass, action.payload);
      } finally {
        yield put({ type: trackActionType, payload: false });
      }
    };

    const runningPropertyName = `${propertyName}.running`;
    installSelector(runningPropertyName, dataBag);
    initialState[runningPropertyName] = false;

    Object.defineProperty(actionBuilder, 'running', Object.getOwnPropertyDescriptor(ProviderClass, runningPropertyName));

    addActionListener(trackActionType, function changeRunningStatus(runningStatus) {
github taion / flux-resource-marty / src / constants.js View on Github external
STATUSES.forEach(function mapStatusConstants(status) {
      const statusName = status === 'starting' ? '' : status;
      const constantName = constantCase(`${methodName} ${statusName}`);

      methodConstantMappings[status] = constants[constantName];
    });
  });
github taion / flux-resource-marty / src / constants.js View on Github external
      method => constantCase(methodNames[method])
  );
github ts-graphql / ts-graphql / src / wrappers / enumType.ts View on Github external
const performChangeCase = (type: EnumTypeCase, value: string): string => {
  switch (type) {
    case EnumTypeCase.Constant:
      return constantCase(value);
    case EnumTypeCase.Pascal:
      return pascalCase(value);
  }
};

constant-case

Transform into upper case string with an underscore between words

MIT
Latest version published 7 months ago

Package Health Score

63 / 100
Full package analysis

Popular constant-case functions