This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
admin-panel/graphql-types/node_modules/@graphql-codegen/plugin-helpers/index.esm.js.map

1 line
38 KiB
Plaintext
Raw Normal View History

2021-03-09 18:44:13 +00:00
{"version":3,"file":"index.esm.js","sources":["../../../dist/utils/plugins-helpers/src/resolve-external-module-and-fn.js","../../../dist/utils/plugins-helpers/src/types.js","../../../dist/utils/plugins-helpers/src/utils.js","../../../dist/utils/plugins-helpers/src/helpers.js","../../../dist/utils/plugins-helpers/src/federation.js","../../../dist/utils/plugins-helpers/src/errors.js"],"sourcesContent":["export function resolveExternalModuleAndFn(pointer) {\n // eslint-disable-next-line no-eval\n const importExternally = (moduleName) => eval(`require('${moduleName}')`);\n if (typeof pointer === 'function') {\n return pointer;\n }\n // eslint-disable-next-line prefer-const\n let [moduleName, functionName] = pointer.split('#');\n // Temp workaround until v2\n if (moduleName === 'change-case') {\n moduleName = 'change-case-all';\n }\n const { resolve } = importExternally('path');\n const localFilePath = resolve(process.cwd(), moduleName);\n const { existsSync } = importExternally('fs');\n const localFileExists = existsSync(localFilePath);\n const importFrom = importExternally('import-from');\n const loadedModule = localFileExists ? importExternally(localFilePath) : importFrom(process.cwd(), moduleName);\n if (!(functionName in loadedModule) && typeof loadedModule !== 'function') {\n throw new Error(`${functionName} couldn't be found in module ${moduleName}!`);\n }\n return loadedModule[functionName] || loadedModule;\n}\n//# sourceMappingURL=resolve-external-module-and-fn.js.map","export function isComplexPluginOutput(obj) {\n return typeof obj === 'object' && obj.hasOwnProperty('content');\n}\n//# sourceMappingURL=types.js.map","import { isListType, isNonNullType } from 'graphql';\nexport function mergeOutputs(content) {\n const result = { content: '', prepend: [], append: [] };\n if (Array.isArray(content)) {\n content.forEach(item => {\n if (typeof item === 'string') {\n result.content += item;\n }\n else {\n result.content += item.content;\n result.prepend.push(...(item.prepend || []));\n result.append.push(...(item.append || []));\n }\n });\n }\n return [...result.prepend, result.content, ...result.append].join('\\n');\n}\nexport function isWrapperType(t) {\n return isListType(t) || isNonNullType(t);\n}\nexport function getBaseType(type) {\n if (isWrapperType(type)) {\n return getBaseType(type.ofType);\n }\n else {\n return type;\n }\n}\nexport function removeNonNullWrapper(type) {\n return isNonNullType(type) ? type.ofType : type;\n}\n//# sourceMappingURL=utils.js.map","import { visit, isListType, isObjectType, Kind, isNonNullType, } from 'graphql';\nimport { getBaseType } from './utils';\nexport function isOutputConfigArray(type) {\n return Array.isArray(type);\n}\nexport function isConfiguredOutput(type) {\n return typeof type === 'object' && type.plugins;\n}\nexport function normalizeOutputParam(config) {\n // In case of direct array with a list of plugins\n if (isOutputConfigArray(config)) {\n return {\n documents: [],\n schema: [],\n plugins: isConfiguredOutput(config) ? config.plugins : config,\n };\n }\n else if (isConfiguredOutput(config)) {\n return config;\n }\n else {\n throw new Error(`Invalid \"generates\" config!`);\n }\n}\nexport function normalizeInstanceOrArray(type) {\n if (Array.isArray(type)) {\n return type;\n }\n else if (!type) {\n return [];\n }\n return [type];\n}\nexport function normalizeConfig(config) {\n if (typeof config === 'string') {\n return [{ [config]: {} }];\n }\n else if (Array.isArray(config)) {\n return config.map(plugin => (typeof plugin === 'string' ? { [plugin]: {} } : plugin));\n }\n else if (typeof config === 'object') {\n return Object.keys(config).reduce((prev, pluginName) => [...prev, { [