index.js
function getUSPSCode(searchKey, strict) {
    searchKey = searchKey && NODE_RATIFY.isString(searchKey) ? _toTitleCase(searchKey) : null;
    var topLevel = (US_STATE_NAME_TO_CODE[searchKey] || US_STATE_NAME_TO_CODE[US_CAPITAL_TO_STATE_NAME[searchKey]]);

    if(strict) {
        return topLevel;
    } else {
        searchKey = (searchKey === 'HagåTñA') ? 'Hagatna' : searchKey;
        return (US_INHABITED_TERRITORIES_NAME_TO_CODE[searchKey] ||
                US_INHABITED_TERRITORIES_NAME_TO_CODE[US_CAPITAL_TO_INHABITED_TERRITORY_NAME[searchKey]] ||
                topLevel);
    }
}
function getUSPSCode(searchKey, strict) {
    searchKey = searchKey && NODE_RATIFY.isString(searchKey) ? _toTitleCase(searchKey) : null;
    var topLevel = (US_STATE_NAME_TO_CODE[searchKey] || US_STATE_NAME_TO_CODE[US_CAPITAL_TO_STATE_NAME[searchKey]]);

    if(strict) {
        return topLevel;
    } else {
        searchKey = (searchKey === 'HagåTñA') ? 'Hagatna' : searchKey;
        return (US_INHABITED_TERRITORIES_NAME_TO_CODE[searchKey] ||
                US_INHABITED_TERRITORIES_NAME_TO_CODE[US_CAPITAL_TO_INHABITED_TERRITORY_NAME[searchKey]] ||
                topLevel);
    }
}
function getUSPSCode ( searchKey , strict ) { searchKey = searchKey && NODE_RATIFY . isString ( searchKey ) ? _toTitleCase ( searchKey ) : null ; var topLevel = ( US_STATE_NAME_TO_CODE [ searchKey ] || US_STATE_NAME_TO_CODE [ US_CAPITAL_TO_STATE_NAME [ searchKey ] ] ) ; if ( strict ) { return topLevel ; } else { searchKey = ( searchKey === 'HagåTñA')  ? ' agatna' : s archKey; return ( US_INHABITED_TERRITORIES_NAME_TO_CODE [ searchKey ] || US_INHABITED_TERRITORIES_NAME_TO_CODE [ US_CAPITAL_TO_INHABITED_TERRITORY_NAME [ searchKey ] ] || topLevel ) ; } }
Given a state name or state capital it finds the USPS Code
Given a state name or state capital it finds the USPS Code