PHP 7.4.33
Preview: Utils.js Size: 1.07 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/@react-native/codegen/lib/generators/Utils.js
/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 *
 * @format
 */

'use strict';

function capitalize(string) {
  return string.charAt(0).toUpperCase() + string.slice(1);
}
function indent(nice, spaces) {
  return nice
    .split('\n')
    .map((line, index) => {
      if (line.length === 0 || index === 0) {
        return line;
      }
      const emptySpaces = new Array(spaces + 1).join(' ');
      return emptySpaces + line;
    })
    .join('\n');
}
function toPascalCase(inString) {
  if (inString.length === 0) {
    return inString;
  }
  return inString[0].toUpperCase() + inString.slice(1);
}
function toSafeCppString(input) {
  return input.split('-').map(toPascalCase).join('');
}
function getEnumName(moduleName, origEnumName) {
  const uppercasedPropName = toSafeCppString(origEnumName);
  return `${moduleName}${uppercasedPropName}`;
}
module.exports = {
  capitalize,
  indent,
  toPascalCase,
  toSafeCppString,
  getEnumName,
};

Directory Contents

Dirs: 4 × Files: 5
Name Size Perms Modified Actions
- drwxr-xr-x 2025-03-28 11:04:37
Edit Download
modules DIR
- drwxr-xr-x 2025-03-28 11:04:37
Edit Download
TypeUtils DIR
- drwxr-xr-x 2025-03-28 11:04:37
Edit Download
- drwxr-xr-x 2025-03-28 11:04:37
Edit Download
2.98 KB lrw-r--r-- 2025-03-28 11:04:37
Edit Download
9.37 KB lrw-r--r-- 2025-03-28 11:04:37
Edit Download
10.65 KB lrw-r--r-- 2025-03-28 11:04:37
Edit Download
1.07 KB lrw-r--r-- 2025-03-28 11:04:37
Edit Download
1.18 KB lrw-r--r-- 2025-03-28 11:04:37
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).