diff --git a/README.md b/README.md index b2418c4..ed5213a 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ const languageData = getLanguageData({ name: 'Python' })[0]; // Use the `languageData` object to get the language data. console.log(languageData.name); // Python console.log(languageData.fileExtension[0]); // py -console.log(languageData.namingConvension); // snake_case +console.log(languageData.namingConvention); // snake_case console.log(languageData.prismTag); // python console.log(languageData.logo); // https://user-images.githubusercontent.com/54644599/227718034-fe84d827-4f53-4466-b37a-2cdd3e817ba2.png ``` @@ -87,7 +87,7 @@ console.log(renameFile({ fileName: sampleFileName, name: 'python' })); // sample -| Language | File Extension | Naming Convension | Tag | Logo | +| Language | File Extension | Naming Convention | Tag | Logo | | --- | --- | --- | --- | --- | | C | `c` `cats` `h` `idc` `w` | PascalCase | `c` | ![][c] | | C# | `cs` `cake` `cshtml` `csx` | PascalCase | `csharp` | ![][csharp] | diff --git a/lib/data.js b/lib/data.js index 0ca942b..e9500b7 100644 --- a/lib/data.js +++ b/lib/data.js @@ -4,56 +4,56 @@ var LanguageData = [ { name: 'C', fileExtension: ['c', 'cats', 'h', 'idc', 'w'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'c', logo: 'https://user-images.githubusercontent.com/54644599/227718065-9c0b7fb1-7ee4-4e27-99dd-d93bb6bde1de.png', }, { name: 'C#', fileExtension: ['cs', 'cake', 'cshtml', 'csx'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'csharp', logo: 'https://user-images.githubusercontent.com/54644599/227718064-c9b9f17a-6f55-4955-85ba-19e2c0420751.png', }, { name: 'C++', fileExtension: ['cpp', 'c++', 'cc', 'cp', 'cxx', 'h', 'h++', 'hh', 'hpp', 'hxx', 'inc', 'inl', 'ipp', 'tcc', 'tpp'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'cpp', logo: 'https://user-images.githubusercontent.com/54644599/227718062-7de51f0d-3710-4e1e-9d29-466e801c6de7.png', }, { name: 'Dart', fileExtension: ['dart'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'dart', logo: 'https://user-images.githubusercontent.com/54644599/227718060-a2d16833-cdd3-4d39-8b29-f7e928bea5f9.png', }, { name: 'F#', fileExtension: ['fs', 'fsi', 'fsx'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'fsharp', logo: 'https://user-images.githubusercontent.com/54644599/227718057-577fec2b-5a9b-451e-a221-218319af5cc6.png', }, { name: 'GO', fileExtension: ['go'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'go', logo: 'https://user-images.githubusercontent.com/54644599/227718055-cc760c85-aab1-4c6c-9b6e-095fedfbb12f.png', }, { name: 'Haskell', fileExtension: ['hs', 'hsc'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'haskell', logo: 'https://user-images.githubusercontent.com/54644599/227718051-caef203f-2584-479d-b0e2-47fb8e59b265.png', }, { name: 'Java', fileExtension: ['java'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'java', logo: 'https://user-images.githubusercontent.com/54644599/227718049-78c3fb05-f06b-4b70-bfe5-7dc8cae5df8f.png', }, @@ -93,49 +93,49 @@ var LanguageData = [ 'xsjs', 'xsjslib', ], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'javascript', logo: 'https://user-images.githubusercontent.com/54644599/227724565-dd199753-04ef-4262-bb48-e01b187ab4df.png', }, { name: 'Julia', fileExtension: ['jl'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'julia', logo: 'https://user-images.githubusercontent.com/54644599/227718045-9211a19c-7974-4324-aecc-4a4d0fb6a310.png', }, { name: 'Kotlin', fileExtension: ['kt', 'ktm', 'kts'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'kotlin', logo: 'https://user-images.githubusercontent.com/54644599/227724578-6b384641-911f-43b7-8e7b-63a2c96226a6.png', }, { name: 'Perl', fileExtension: ['pl', 'al', 'cgi', 'fcgi', 'perl', 'ph', 'plx', 'pm', 'pod', 'psgi', 't'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'perl', logo: 'https://user-images.githubusercontent.com/54644599/227718041-b6b21f17-675b-485d-92a1-76f9ec1d80a4.png', }, { name: 'PHP', fileExtension: ['php', 'aw', 'ctp', 'fcgi', 'inc', 'php3', 'php4', 'php5', 'phps', 'phpt'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'php', logo: 'https://user-images.githubusercontent.com/54644599/227718037-2d3cbe05-e678-453e-8a22-a615794645b6.png', }, { name: 'Python', fileExtension: ['py', 'bzl', 'cgi', 'fcgi', 'gyp', 'lmi', 'pyde', 'pyp', 'pyt', 'pyw', 'rpy', 'tac', 'wsgi', 'xpy'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'python', logo: 'https://user-images.githubusercontent.com/54644599/227718034-fe84d827-4f53-4466-b37a-2cdd3e817ba2.png', }, { name: 'R', fileExtension: ['r', 'rd', 'rsx'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'r', logo: 'https://user-images.githubusercontent.com/54644599/227718032-6746f588-346e-4818-b656-c6a3a1a6fd06.png', }, @@ -162,35 +162,35 @@ var LanguageData = [ 'thor', 'watchr', ], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'ruby', logo: 'https://user-images.githubusercontent.com/54644599/227718029-89cc56ce-5285-4981-a79d-1d4f98048a0c.png', }, { name: 'Rust', fileExtension: ['rs', 'rs.in'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'rust', logo: 'https://user-images.githubusercontent.com/54644599/227718026-c1ee3b0c-1e70-4f3c-99a5-23c93ca2040e.png', }, { name: 'Scala', fileExtension: ['scala', 'sbt', 'sc'], - namingConvension: 'camelCase', + namingConvention: 'camelCase', prismTag: 'scala', logo: 'https://user-images.githubusercontent.com/54644599/227718024-b9dae41e-16b1-4d0f-944e-5d39f894552f.png', }, { name: 'Swift', fileExtension: ['swift'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'swift', logo: 'https://user-images.githubusercontent.com/54644599/227718021-6f0d1954-e71c-45d2-8ec3-be2b75d6adcd.png', }, { name: 'TypeScript', fileExtension: ['ts', 'tsx'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'typescript', logo: 'https://user-images.githubusercontent.com/54644599/227724573-d958c16a-4b78-4bc1-b05f-599167150e8a.png', }, diff --git a/lib/renameFile/index.js b/lib/renameFile/index.js index be8ed22..2c6e51c 100644 --- a/lib/renameFile/index.js +++ b/lib/renameFile/index.js @@ -25,10 +25,10 @@ function renameFile(_a) { } } }); - var namingConvension = language[0].namingConvension; + var namingConvention = language[0].namingConvention; var fileSlug = fileName.split('.')[0]; var fileExt = fileName.split('.').pop(); - switch (namingConvension) { + switch (namingConvention) { case 'PascalCase': fileSlug = (0, codinasion_tools_1.FormatToPascalCase)(fileSlug); break; diff --git a/lib/type.d.ts b/lib/type.d.ts index 6a47652..e5833d1 100644 --- a/lib/type.d.ts +++ b/lib/type.d.ts @@ -1,7 +1,7 @@ export type LanguageDataType = { name: string; fileExtension: string[]; - namingConvension: 'PascalCase' | 'camelCase' | 'snake_case' | 'kebab-case'; + namingConvention: 'PascalCase' | 'camelCase' | 'snake_case' | 'kebab-case'; prismTag: string; logo: string; }; diff --git a/package.json b/package.json index 41e9770..a0d1522 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "get-language-data", - "version": "0.0.5", + "version": "0.0.6", "private": false, "description": "Get data related to programming languages", "main": "lib/index.js", @@ -28,7 +28,7 @@ "language data", "programming language data", "file extension", - "naming convension", + "naming convention", "programming language logo" ], "scripts": { diff --git a/src/UpdateReadme.ts b/src/UpdateReadme.ts index d992fef..ba55141 100644 --- a/src/UpdateReadme.ts +++ b/src/UpdateReadme.ts @@ -16,10 +16,10 @@ const startIndex = readmeText.indexOf(startTag); const endIndex = readmeText.indexOf(endTag); // Generate Table Text -let tableText = '\n| Language | File Extension | Naming Convension | Tag | Logo |\n'; +let tableText = '\n| Language | File Extension | Naming Convention | Tag | Logo |\n'; tableText += '| --- | --- | --- | --- | --- |\n'; for (const language of LanguageData) { - tableText += `| ${language.name} | \`${language.fileExtension.join('` `')}\` | ${language.namingConvension} | \`${ + tableText += `| ${language.name} | \`${language.fileExtension.join('` `')}\` | ${language.namingConvention} | \`${ language.prismTag }\` | ![][${language.prismTag}] |\n`; } diff --git a/src/data.ts b/src/data.ts index bc0620b..c6072fe 100644 --- a/src/data.ts +++ b/src/data.ts @@ -4,56 +4,56 @@ const LanguageData: LanguageDataType[] = [ { name: 'C', fileExtension: ['c', 'cats', 'h', 'idc', 'w'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'c', logo: 'https://user-images.githubusercontent.com/54644599/227718065-9c0b7fb1-7ee4-4e27-99dd-d93bb6bde1de.png', }, { name: 'C#', fileExtension: ['cs', 'cake', 'cshtml', 'csx'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'csharp', logo: 'https://user-images.githubusercontent.com/54644599/227718064-c9b9f17a-6f55-4955-85ba-19e2c0420751.png', }, { name: 'C++', fileExtension: ['cpp', 'c++', 'cc', 'cp', 'cxx', 'h', 'h++', 'hh', 'hpp', 'hxx', 'inc', 'inl', 'ipp', 'tcc', 'tpp'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'cpp', logo: 'https://user-images.githubusercontent.com/54644599/227718062-7de51f0d-3710-4e1e-9d29-466e801c6de7.png', }, { name: 'Dart', fileExtension: ['dart'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'dart', logo: 'https://user-images.githubusercontent.com/54644599/227718060-a2d16833-cdd3-4d39-8b29-f7e928bea5f9.png', }, { name: 'F#', fileExtension: ['fs', 'fsi', 'fsx'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'fsharp', logo: 'https://user-images.githubusercontent.com/54644599/227718057-577fec2b-5a9b-451e-a221-218319af5cc6.png', }, { name: 'GO', fileExtension: ['go'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'go', logo: 'https://user-images.githubusercontent.com/54644599/227718055-cc760c85-aab1-4c6c-9b6e-095fedfbb12f.png', }, { name: 'Haskell', fileExtension: ['hs', 'hsc'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'haskell', logo: 'https://user-images.githubusercontent.com/54644599/227718051-caef203f-2584-479d-b0e2-47fb8e59b265.png', }, { name: 'Java', fileExtension: ['java'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'java', logo: 'https://user-images.githubusercontent.com/54644599/227718049-78c3fb05-f06b-4b70-bfe5-7dc8cae5df8f.png', }, @@ -93,49 +93,49 @@ const LanguageData: LanguageDataType[] = [ 'xsjs', 'xsjslib', ], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'javascript', logo: 'https://user-images.githubusercontent.com/54644599/227724565-dd199753-04ef-4262-bb48-e01b187ab4df.png', }, { name: 'Julia', fileExtension: ['jl'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'julia', logo: 'https://user-images.githubusercontent.com/54644599/227718045-9211a19c-7974-4324-aecc-4a4d0fb6a310.png', }, { name: 'Kotlin', fileExtension: ['kt', 'ktm', 'kts'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'kotlin', logo: 'https://user-images.githubusercontent.com/54644599/227724578-6b384641-911f-43b7-8e7b-63a2c96226a6.png', }, { name: 'Perl', fileExtension: ['pl', 'al', 'cgi', 'fcgi', 'perl', 'ph', 'plx', 'pm', 'pod', 'psgi', 't'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'perl', logo: 'https://user-images.githubusercontent.com/54644599/227718041-b6b21f17-675b-485d-92a1-76f9ec1d80a4.png', }, { name: 'PHP', fileExtension: ['php', 'aw', 'ctp', 'fcgi', 'inc', 'php3', 'php4', 'php5', 'phps', 'phpt'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'php', logo: 'https://user-images.githubusercontent.com/54644599/227718037-2d3cbe05-e678-453e-8a22-a615794645b6.png', }, { name: 'Python', fileExtension: ['py', 'bzl', 'cgi', 'fcgi', 'gyp', 'lmi', 'pyde', 'pyp', 'pyt', 'pyw', 'rpy', 'tac', 'wsgi', 'xpy'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'python', logo: 'https://user-images.githubusercontent.com/54644599/227718034-fe84d827-4f53-4466-b37a-2cdd3e817ba2.png', }, { name: 'R', fileExtension: ['r', 'rd', 'rsx'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'r', logo: 'https://user-images.githubusercontent.com/54644599/227718032-6746f588-346e-4818-b656-c6a3a1a6fd06.png', }, @@ -162,35 +162,35 @@ const LanguageData: LanguageDataType[] = [ 'thor', 'watchr', ], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'ruby', logo: 'https://user-images.githubusercontent.com/54644599/227718029-89cc56ce-5285-4981-a79d-1d4f98048a0c.png', }, { name: 'Rust', fileExtension: ['rs', 'rs.in'], - namingConvension: 'snake_case', + namingConvention: 'snake_case', prismTag: 'rust', logo: 'https://user-images.githubusercontent.com/54644599/227718026-c1ee3b0c-1e70-4f3c-99a5-23c93ca2040e.png', }, { name: 'Scala', fileExtension: ['scala', 'sbt', 'sc'], - namingConvension: 'camelCase', + namingConvention: 'camelCase', prismTag: 'scala', logo: 'https://user-images.githubusercontent.com/54644599/227718024-b9dae41e-16b1-4d0f-944e-5d39f894552f.png', }, { name: 'Swift', fileExtension: ['swift'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'swift', logo: 'https://user-images.githubusercontent.com/54644599/227718021-6f0d1954-e71c-45d2-8ec3-be2b75d6adcd.png', }, { name: 'TypeScript', fileExtension: ['ts', 'tsx'], - namingConvension: 'PascalCase', + namingConvention: 'PascalCase', prismTag: 'typescript', logo: 'https://user-images.githubusercontent.com/54644599/227724573-d958c16a-4b78-4bc1-b05f-599167150e8a.png', }, diff --git a/src/renameFile/index.ts b/src/renameFile/index.ts index 0f6ef8d..a713c78 100644 --- a/src/renameFile/index.ts +++ b/src/renameFile/index.ts @@ -21,11 +21,11 @@ export default function renameFile({ name, fileExtension, fileName = 'file-name' } }); - const namingConvension = language[0].namingConvension; + const namingConvention = language[0].namingConvention; let fileSlug = fileName.split('.')[0]; const fileExt = fileName.split('.').pop(); - switch (namingConvension) { + switch (namingConvention) { case 'PascalCase': fileSlug = FormatToPascalCase(fileSlug); break; diff --git a/src/type.ts b/src/type.ts index 7447f10..b02e8fb 100644 --- a/src/type.ts +++ b/src/type.ts @@ -1,7 +1,7 @@ export type LanguageDataType = { name: string; fileExtension: string[]; - namingConvension: 'PascalCase' | 'camelCase' | 'snake_case' | 'kebab-case'; + namingConvention: 'PascalCase' | 'camelCase' | 'snake_case' | 'kebab-case'; prismTag: string; logo: string; };