Module:Vanguard funds/data/doc

This module holds the data table that Module:Vanguard funds uses to generate Vanguard mutual fund and ETF web page URLs.

Entry format
The table maps Vanguard mutual fund symbols, Vanguard ETF tickers, and Vanguard fund numbers to a string that identifies two pieces of information: the type of fund (a mutual fund or an ETF); and a URL fragment that can be used to build a Vanguard fund page URL.

The format rules are:
 * Entries are all pairs, formatted as: ["X"] = "(f, where:
 * X is a Vanguard mutual fund symbol or Vanguard ETF ticker
 * N is the corresponding Vanguard fund number
 * (f indicates whether this is a mutual fund 'f:' or an ETF 'e:'.
 * Fund symbols, ETF tickers, and fund numbers must be all lowercase.

Examples
For example, to add (hypothetical) Vanguard mutual fund VABCD with fund number 1234, the entry would read: ["vabcd"] = "f:vabcd", ["1234"] = "f:vabcd",

To add (hypothetical) Vanguard ETF VZZZ with fund number 6789, the entry would read: ["vzzz"] = "e:vzzz", ["6789"] = "e:vzzz",

Notice that the f:... or e:... appears identically twice. This is because the table is an effective 2:1 mapping. Each fund or ETF has two ways it can be addressed, and both must map to this same string.

Table errors
For efficiency, the data structure used for this table is a simple string:string map.

However, because the code that consumes this data relies on some constraints on the format of these strings and their relationships to each other, the module's unit tests validate all the entries found in this table. Any that are not formatted correctly should show up in the unit tests as test failures.