all files / firebase/modules/firestore/ FieldPath.js

100% Statements 3/3
100% Branches 0/0
100% Functions 2/2
100% Lines 3/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                          42×              
/**
 * @flow
 * FieldPath representation wrapper
 */
 
/**
 * @class FieldPath
 */
export default class FieldPath {
  _segments: string[];
 
  constructor(...segments: string[]) {
    // TODO: Validation
    this._segments = segments;
  }
 
  static documentId(): FieldPath {
    return DOCUMENT_ID;
  }
}
 
export const DOCUMENT_ID = new FieldPath('__name__');