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

14 lines
283 B
Plaintext
Raw Normal View History

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