federation/gateway/node_modules/graphql/jsutils/printPathArray.js.flow
2020-11-14 16:43:58 +01:00

13 lines
283 B
Text

// @flow strict
/**
* Build a string describing the path.
*/
export default function printPathArray(
path: $ReadOnlyArray<string | number>,
): string {
return path
.map((key) =>
typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key,
)
.join('');
}