github-pages-deploy-action/node_modules/graphql/jsutils/printPathArray.js.flow
2020-03-06 22:45:40 -05:00

15 lines
282 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('');
}