UNPKG

colleges.js

Version:

A module that gives data about colleges around the world

27 lines (26 loc) 19.9 kB
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>College | colleges.js</title><meta name="description" content="Documentation for colleges.js"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/varvara.css"/><link rel="stylesheet" href="../assets/overrides.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";</script><div class="container container-main"><header class="page-toolbar"><div class="search" id="tsd-search"><div class="field va-button-group"><div class="va-button-group va-button-group--horizontal"><a href="../index.html" class="va-button"><b>colleges.js</b></a><label for="tsd-search-field" class="va-button"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><a href="#" class="va-button" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div><input type="text" id="tsd-search-field" class="va-input" placeholder="Search" aria-label="Search"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul></div><div class="navigation-links va-button-group"></div></header><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">colleges.js</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.College.html">College</a></li></ul><h1>Class College</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>The College class, containing all the neccessary methods</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-author"><h4 class="tsd-anchor-link"><a id="author" class="tsd-anchor"></a>Author<a href="#author" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>jez020</p> </div></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/jez020/colleges.js/blob/0b1c08df6d832709819827cb19dd77e920424fc4/src/index.ts#L47">index.ts:47</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="index.College.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a> </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="index.College.html#collegedata" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>college<wbr/>Data</span></a> <a href="index.College.html#countrycode" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>country<wbr/>Code</span></a> </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="index.College.html#getcollege" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>College</span></a> <a href="index.College.html#getregion" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Region</span></a> </div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructorcollege" class="tsd-anchor"></a><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">College</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">customCollegeData</span><span class="tsd-signature-symbol">?:</span> <a href="../types/intefaces.collegeDataInterface.html" class="tsd-signature-type tsd-kind-type-alias">collegeDataInterface</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="index.College.html" class="tsd-signature-type tsd-kind-class">College</a><a href="#constructorcollege" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initiates an instance of College</p> </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">customCollegeData</span>: <a href="../types/intefaces.collegeDataInterface.html" class="tsd-signature-type tsd-kind-type-alias">collegeDataInterface</a><span class="tsd-signature-symbol"> = collegedata</span></span><div class="tsd-comment tsd-typography"><p>Custom college data, defaults to the built in json.</p> </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.College.html" class="tsd-signature-type tsd-kind-class">College</a></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-author"><h4 class="tsd-anchor-link"><a id="author-1" class="tsd-anchor"></a>Author<a href="#author-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>jez020</p> </div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/jez020/colleges.js/blob/0b1c08df6d832709819827cb19dd77e920424fc4/src/index.ts#L68">index.ts:68</a></li></ul></aside></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="collegedata" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>college<wbr/>Data</span><a href="#collegedata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">collegeData</span><span class="tsd-signature-symbol">:</span> <a href="../types/intefaces.collegeDataInterface.html" class="tsd-signature-type tsd-kind-type-alias">collegeDataInterface</a><span class="tsd-signature-symbol"> = collegedata</span></div><div class="tsd-comment tsd-typography"><p>Get the original college data in JSON</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-author"><h4 class="tsd-anchor-link"><a id="author-2" class="tsd-anchor"></a>Author<a href="#author-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Hipo</p> </div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/jez020/colleges.js/blob/0b1c08df6d832709819827cb19dd77e920424fc4/src/index.ts#L53">index.ts:53</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="countrycode" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>country<wbr/>Code</span><a href="#countrycode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">countryCode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-comment tsd-typography"><p>All the 2 characters country codes</p> </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-author"><h4 class="tsd-anchor-link"><a id="author-3" class="tsd-anchor"></a>Author<a href="#author-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>jez020</p> </div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/jez020/colleges.js/blob/0b1c08df6d832709819827cb19dd77e920424fc4/src/index.ts#L59">index.ts:59</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="getcollege" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>College</span><a href="#getcollege" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getcollege-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">getCollege</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="../types/intefaces.collegeDataInterface.html" class="tsd-signature-type tsd-kind-type-alias">collegeDataInterface</a><a href="#getcollege-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Get the colleges with the same name as the input</p> </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;University of California, San Diego&quot;</span></span><div class="tsd-comment tsd-typography"><p>The name of the college, case sensitive</p> </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../types/intefaces.collegeDataInterface.html" class="tsd-signature-type tsd-kind-type-alias">collegeDataInterface</a></h4><p>An array of objects containing the college data</p> <div class="tsd-comment tsd-typography"><div class="tsd-tag-author"><h4 class="tsd-anchor-link"><a id="author-4" class="tsd-anchor"></a>Author<a href="#author-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>jez020</p> </div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/jez020/colleges.js/blob/0b1c08df6d832709819827cb19dd77e920424fc4/src/index.ts#L122">index.ts:122</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getregion" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Region</span><a href="#getregion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getregion-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">getRegion</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">regionCode</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="../types/intefaces.collegeDataInterface.html" class="tsd-signature-type tsd-kind-type-alias">collegeDataInterface</a><a href="#getregion-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Get all the colleges based on a country code</p> </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">regionCode</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = ...</span></span><div class="tsd-comment tsd-typography"><p>an array of 2 letters country codes to include in the data</p> </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../types/intefaces.collegeDataInterface.html" class="tsd-signature-type tsd-kind-type-alias">collegeDataInterface</a></h4><p>Returns an array of colleges belonging to the countries provided</p> <div class="tsd-comment tsd-typography"><div class="tsd-tag-author"><h4 class="tsd-anchor-link"><a id="author-5" class="tsd-anchor"></a>Author<a href="#author-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>jez020</p> </div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/jez020/colleges.js/blob/0b1c08df6d832709819827cb19dd77e920424fc4/src/index.ts#L84">index.ts:84</a></li></ul></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="va-button-group"><details class="va-collapse settings tsd-accordion"><summary>Settings</summary><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="va-select-group"><label>Theme</label><select id="tsd-theme" class="va-select"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></details><details class="va-collapse page-navigation tsd-accordion"><summary>On This Page</summary><details open class="va-collapse tsd-accordion"><summary data-key="section-Constructors">Constructors</summary><a href="#constructor" class=" va-button" style="padding-left: 18px"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></details><details open class="va-collapse tsd-accordion"><summary data-key="section-Properties">Properties</summary><a href="#collegedata" class=" va-button" style="padding-left: 18px"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>collegeData</span></a><a href="#countrycode" class=" va-button" style="padding-left: 18px"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>countryCode</span></a></details><details open class="va-collapse tsd-accordion"><summary data-key="section-Methods">Methods</summary><a href="#getcollege" class=" va-button" style="padding-left: 18px"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>getCollege</span></a><a href="#getregion" class=" va-button" style="padding-left: 18px"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>getRegion</span></a></details></details></div></div><div class="site-menu"><nav class="va-button-group"><details class="va-collapse tsd-accordion"><summary><a href="../modules.html">Modules</a></summary><a href="../modules/collegeData.json.html" class="va-button false"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-2"></use></svg>collegeData.json</a><a href="../modules/definitions.html" class="va-button false"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-2"></use></svg>definitions</a><a href="../modules/index.html" class="va-button false"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-2"></use></svg>index</a><a href="../modules/intefaces.html" class="va-button false"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-2"></use></svg>intefaces</a></details></nav></div></div></div><footer><div class="container"><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a> &amp; <a href="https://varvara.js.org/" target="_blank">Varvara CSS</a></p></div></footer><div class="overlay"></div></body></html>