MessagesForMacintosh/JS/node_modules/graphql/jsutils/printPathArray.js.flow

14 lines
283 B
Plaintext

// @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('');
}