operationParameter.js 896 B

123456789101112131415161718192021222324
  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License. See License.txt in the project root for license information.
  3. /**
  4. * Get the path to this parameter's value as a dotted string (a.b.c).
  5. * @param parameter The parameter to get the path string for.
  6. * @returns The path to this parameter's value as a dotted string.
  7. */
  8. export function getPathStringFromParameter(parameter) {
  9. return getPathStringFromParameterPath(parameter.parameterPath, parameter.mapper);
  10. }
  11. export function getPathStringFromParameterPath(parameterPath, mapper) {
  12. var result;
  13. if (typeof parameterPath === "string") {
  14. result = parameterPath;
  15. }
  16. else if (Array.isArray(parameterPath)) {
  17. result = parameterPath.join(".");
  18. }
  19. else {
  20. result = mapper.serializedName;
  21. }
  22. return result;
  23. }
  24. //# sourceMappingURL=operationParameter.js.map