'use strict';

var chunkAF3E2D32_cjs = require('./chunk-AF3E2D32.cjs');
var types = require('@stryke/env/types');
var camelCase = require('@stryke/string-format/camel-case');
var isString = require('@stryke/type-checks/is-string');

var removeEnvPrefix = /* @__PURE__ */ chunkAF3E2D32_cjs.__name((env) => {
  if (isString.isString(env)) {
    let name = types.ENV_PREFIXES.reduce((ret, prefix) => {
      if (ret.startsWith(prefix)) {
        ret = ret.slice(prefix.length);
      }
      return ret;
    }, env.toUpperCase());
    while (name.startsWith("_")) {
      name = name.slice(1);
    }
    return name;
  }
  return Object.keys(env).reduce((ret, key) => {
    const name = removeEnvPrefix(key);
    if (name) {
      ret[name] = env[key];
    }
    return ret;
  }, {});
}, "removeEnvPrefix");
var formatEnvField = /* @__PURE__ */ chunkAF3E2D32_cjs.__name((key) => {
  return camelCase.camelCase(removeEnvPrefix(key));
}, "formatEnvField");

exports.formatEnvField = formatEnvField;
exports.removeEnvPrefix = removeEnvPrefix;
//# sourceMappingURL=chunk-7Z3M6OQQ.cjs.map
//# sourceMappingURL=chunk-7Z3M6OQQ.cjs.map