'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const path = require('path'); const readEnv = require('read-env'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } const path__default = /*#__PURE__*/_interopDefaultLegacy(path); function toPrefix(str) { const prefix = str.replace(/[@]/g, "").replace(/[-/]/g, "_").toUpperCase(); return prefix.match(/^[A-Z0-9_]+$/) ? prefix : false; } function $parse(opts) { const prefix = toPrefix((opts == null ? void 0 : opts.prefix) || process.env.npm_package_name || path__default["default"].parse(process.cwd()).name); if (!prefix) { throw new Error("Invalid characters provided for prefix. The prefix can only contain letters, digits, -, _, @, and /."); } return { ...opts == null ? void 0 : opts.defaults, ...readEnv.readEnv(prefix, opts) }; } exports.$parse = $parse; exports["default"] = $parse;