Identifier: {
    accessesInternal(this: void, id: Identifier): undefined | boolean;
    dotdotdot(this: void): BrandedIdentifier;
    getName(this: void, id: Identifier): BrandedIdentifier;
    getNamespace(this: void, id: Identifier): undefined | BrandedNamespace;
    isDotDotDotAccess(this: void, id: Identifier): boolean;
    make(
        this: void,
        name: BrandedIdentifier,
        namespace?: BrandedNamespace,
        internal?: boolean,
    ): Identifier;
    mapName(
        this: void,
        id: Identifier,
        fn: (name: BrandedIdentifier) => BrandedIdentifier,
    ): Identifier;
    mapNamespace(
        this: void,
        id: Identifier,
        fn: (ns: BrandedNamespace) => BrandedNamespace,
    ): Identifier;
    matches(
        this: void,
        id: Identifier,
        target: Identifier,
        s3?: boolean,
    ): boolean;
    parse(this: void, str: string): Identifier;
    toArray(
        this: void,
        id: Identifier,
    ): [BrandedIdentifier, undefined | BrandedNamespace, undefined | boolean];
    toString(this: void, id: Identifier): string;
}

Helper functions to work with identifiers. Use Identifier.matches to check if two identifiers match according to R's scoping rules!

Type declaration

const id1 = Identifier.make('a', 'pkg');
const id2 = Identifier.parse('pkg::a');
const id3 = Identifier.parse('a');
Identifier.matches(id1, id2); // true
Identifier.matches(id3, id2); // true, as id3 has no namespace