@aws-amplify/graphql-transformer-core
Advanced tools
Comparing version 2.4.3 to 2.4.4
@@ -21,2 +21,5 @@ import { ArgumentNode, DirectiveNode, NameNode, ValueNode } from 'graphql'; | ||
export declare const generateGetArgumentsInput: ({ shouldDeepMergeDirectiveConfigDefaults }: TransformParameters) => GetArgumentsOptions; | ||
export declare const needsDeepMerge: <T>(defaultValue: Required<T>, argValues: { | ||
[x: string]: any; | ||
}) => boolean; | ||
//# sourceMappingURL=directive-wrapper.d.ts.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateGetArgumentsInput = exports.DirectiveWrapper = exports.ArgumentWrapper = void 0; | ||
exports.needsDeepMerge = exports.generateGetArgumentsInput = exports.DirectiveWrapper = exports.ArgumentWrapper = void 0; | ||
const graphql_1 = require("graphql"); | ||
@@ -40,3 +40,3 @@ const lodash_1 = __importDefault(require("lodash")); | ||
}), {}); | ||
if (options === null || options === void 0 ? void 0 : options.deepMergeArguments) { | ||
if ((options === null || options === void 0 ? void 0 : options.deepMergeArguments) && (0, exports.needsDeepMerge)(defaultValue, argValues)) { | ||
return lodash_1.default.merge(lodash_1.default.cloneDeep(defaultValue), argValues); | ||
@@ -56,2 +56,13 @@ } | ||
exports.generateGetArgumentsInput = generateGetArgumentsInput; | ||
const needsDeepMerge = (defaultValue, argValues) => { | ||
var _a; | ||
if (lodash_1.default.isEmpty(argValues)) { | ||
return false; | ||
} | ||
if (typeof defaultValue === 'object') { | ||
return (_a = Object.keys(argValues)) === null || _a === void 0 ? void 0 : _a.some((key) => { var _a; return (_a = Object.keys(defaultValue)) === null || _a === void 0 ? void 0 : _a.includes(key); }); | ||
} | ||
return true; | ||
}; | ||
exports.needsDeepMerge = needsDeepMerge; | ||
//# sourceMappingURL=directive-wrapper.js.map |
{ | ||
"name": "@aws-amplify/graphql-transformer-core", | ||
"version": "2.4.3", | ||
"version": "2.4.4", | ||
"description": "A framework to transform from GraphQL SDL to AWS CloudFormation.", | ||
@@ -82,3 +82,3 @@ "repository": { | ||
}, | ||
"gitHead": "7f17ef972d6acd0c3ca8206f9264a74f21e83b72" | ||
"gitHead": "b8eb11b504c0a35045148a1bd81dae6adb46aeca" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
618742
5360