Skip to content

Commit

Permalink
Switch to named exports within sources
Browse files Browse the repository at this point in the history
  • Loading branch information
dmythro committed Mar 4, 2024
1 parent d342f5b commit c65b2d6
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion dist/cjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.iife.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/countries/src/data/continents.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
export const continents = {
AF: 'Africa',
AN: 'Antarctica',
AS: 'Asia',
Expand Down
4 changes: 2 additions & 2 deletions packages/countries/src/data/countries.2to3.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TCountryCode } from '../types.ts'

export default {
export const countries2to3 = {
AD: 'AND',
AE: 'ARE',
AF: 'AFG',
Expand Down Expand Up @@ -251,4 +251,4 @@ export default {
ZA: 'ZAF',
ZM: 'ZMB',
ZW: 'ZWE',
} satisfies Record<TCountryCode, string>
} as const satisfies Record<TCountryCode, string>
4 changes: 2 additions & 2 deletions packages/countries/src/data/countries.3to2.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TCountryCode } from '../types.ts'

export default {
export const countries3to2 = {
AND: 'AD',
ARE: 'AE',
AFG: 'AF',
Expand Down Expand Up @@ -251,4 +251,4 @@ export default {
ZAF: 'ZA',
ZMB: 'ZM',
ZWE: 'ZW',
} satisfies Record<string, TCountryCode>
} as const satisfies Record<string, TCountryCode>
4 changes: 2 additions & 2 deletions packages/countries/src/data/countries.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ICountry } from '../types.ts'

export default {
export const countries = {
AD: {
name: 'Andorra',
native: 'Andorra',
Expand Down Expand Up @@ -2264,4 +2264,4 @@ export default {
currency: ['USD', 'ZAR', 'BWP', 'GBP', 'AUD', 'CNY', 'INR', 'JPY'],
languages: ['en', 'sn', 'nd'],
},
} satisfies Record<string, ICountry>
} as const satisfies Record<string, ICountry>
4 changes: 2 additions & 2 deletions packages/countries/src/data/languages.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ILanguage } from '../types.ts'

export default {
export const languages = {
aa: {
name: 'Afar',
native: 'Afar',
Expand Down Expand Up @@ -751,4 +751,4 @@ export default {
name: 'Zulu',
native: 'isiZulu',
},
} satisfies Record<string, ILanguage>
} as const satisfies Record<string, ILanguage>
4 changes: 2 additions & 2 deletions packages/countries/src/getCountryData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import countries from './data/countries.ts'
import countries2to3 from './data/countries.2to3.ts'
import { countries } from './data/countries.ts'
import { countries2to3 } from './data/countries.2to3.ts'
import { ICountryData, TCountryCode } from './types.ts'

export const getCountryData = (iso2: TCountryCode): ICountryData => ({
Expand Down
6 changes: 3 additions & 3 deletions packages/countries/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { default as continents } from './data/continents.ts'
export { default as countries } from './data/countries.ts'
export { default as languages } from './data/languages.ts'
export { continents } from './data/continents.ts'
export { countries } from './data/countries.ts'
export { languages } from './data/languages.ts'

export { getCountryCode } from './getCountryCode.ts'
export { getCountryData, getCountryDataList } from './getCountryData.ts'
Expand Down
6 changes: 3 additions & 3 deletions packages/countries/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import continents from './data/continents.ts'
import countries from './data/countries.ts'
import languages from './data/languages.ts'
import { continents } from './data/continents.ts'
import { countries } from './data/countries.ts'
import { languages } from './data/languages.ts'

export type TContinentCode = keyof typeof continents
export type TCountryCode = keyof typeof countries
Expand Down
10 changes: 5 additions & 5 deletions packages/scripts/data.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { getLanguagesInUse } from 'scripts/utils.ts'

export { default as continents } from 'countries/data/continents.ts'
import countries from 'countries/data/countries.ts'
import languages from 'countries/data/languages.ts'
export { continents } from 'countries/data/continents.ts'
import { countries } from 'countries/data/countries.ts'
import { languages } from 'countries/data/languages.ts'

export { countries, languages }

export const languagesInUse = getLanguagesInUse(countries, languages)

export { default as countries2to3 } from 'countries/data/countries.2to3.ts'
export { default as countries3to2 } from 'countries/data/countries.3to2.ts'
export { countries2to3 } from 'countries/data/countries.2to3.ts'
export { countries3to2 } from 'countries/data/countries.3to2.ts'
4 changes: 2 additions & 2 deletions packages/scripts/tasks/generateSql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
TCountryCode,
TLanguageCode,
} from 'countries/types.ts'
import continents from 'countries/data/continents.ts'
import countries from 'countries/data/countries.ts'
import { continents } from 'countries/data/continents.ts'
import { countries } from 'countries/data/countries.ts'

import { DATA_FILE, LF, SQL_EXT } from 'scripts/constants.ts'
import { languagesInUse } from 'scripts/data.ts'
Expand Down
2 changes: 1 addition & 1 deletion packages/test-node/getCountryData.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert'
import { test } from 'node:test'

import countries from 'src/data/countries.ts'
import { countries } from 'src/data/countries.ts'
import { getCountryData, getCountryDataList } from 'src/getCountryData.ts'

test('getCountryData()', () => {
Expand Down

0 comments on commit c65b2d6

Please sign in to comment.