New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

turkce

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turkce - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

62

index.js
const fetch = require("node-fetch");
/**
* "turkce"nin çıktısı
* Çıktı sınıfı
*/
class Cikti {
/**

@@ -18,12 +21,43 @@ * Çıktı objesi

*/
constructor(kelime = null, anlam = null, lisan = null, ornek = null, atasozu = null, anlamlar = [], ornekler = [], atasozleri = []) {
/**
* Aratılan kelime
*/
this.kelime = kelime;
this.kelime = kelime;
/**
* Kelimenin anlamı
*/
this.anlam = anlam;
/**
* Kelimenin lisanı
*/
this.lisan = lisan;
/**
* Kelime hakkında örnek
*/
this.ornek = ornek;
/**
* Kelime hakkında atasözü
*/
this.atasozu = atasozu;
/**
* Kelimenin tüm anlamları
*/
this.anlamlar = anlamlar;
/**
* Kelimenin ilk anlamının tüm örnekleri
*/
this.ornekler = ornekler;
/**
* Kelime hakkında tüm atasözleri
*/
this.atasozleri = atasozleri;

@@ -34,6 +68,9 @@ }

/**
* "turkce"nin Örneği
* Örnek sınıfı
*/
class Ornek {
/**

@@ -44,2 +81,3 @@ * Örnek objesi

*/
constructor(ornek = null, yazar = null) {

@@ -51,10 +89,14 @@ this.ornek = ornek;

/**
* Nesne yönelimli, en kusursuz kolay TDK api modülü.
* @async
* Nesne-yönelimli, en kusursuz kolay TDK api modülü
* @param {String} kelime TDK'de aranacak kelime
* @returns {Promise<Cikti>} Çıktı varsa Çıktı döndürür
*/
module.exports = async kelime => {
if (!kelime) throw TypeError("Kelime parametresi boş geçilemez.");
try {

@@ -66,5 +108,9 @@ const response = await fetch("https://sozluk.gov.tr/gts?ara=" + encodeURI(kelime.toLocaleLowerCase("tr")), {

if (response.error) throw Error("Böyle bir kelime yok.");
const { anlamlarListe, atasozu, lisan = null } = response[0];
const [sonuc = null] = response;
if (!sonuc) throw Error("API'de sonuç yok.");
const { anlamlarListe, atasozu, lisan = null } = sonuc;
const anlamlar = anlamlarListe?.map(anlam => anlam.anlam) ?? [];

@@ -74,3 +120,3 @@ const ornekler = anlamlarListe[0]?.orneklerListe?.map(ornek => new Ornek(ornek?.ornek, ornek?.yazar[0]?.tam_adi)) ?? [];

return new Cikti(response[0].madde, anlamlar[0], lisan, ornekler[0], atasozleri[0], anlamlar, ornekler, atasozleri);
return new Cikti(sonuc.madde, anlamlar[0], lisan, ornekler[0], atasozleri[0], anlamlar, ornekler, atasozleri);
} catch (e) {

@@ -77,0 +123,0 @@ return e;

8

package.json
{
"name": "turkce",
"version": "1.0.1",
"version": "1.0.2",
"description": "Nesne-yönelimli, en kusursuz kolay TDK api modülü",

@@ -11,3 +11,3 @@ "main": "index.js",

"type": "git",
"url": "git+https://github.com/Akif9748/tdk.js.git"
"url": "git+https://github.com/Akif9748/node-turkce.git"
},

@@ -25,5 +25,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/Akif9748/tdk.js/issues"
"url": "https://github.com/Akif9748/node-turkce/issues"
},
"homepage": "https://github.com/Akif9748/tdk.js#readme",
"homepage": "https://github.com/Akif9748/node-turkce#readme",
"dependencies": {

@@ -30,0 +30,0 @@ "node-fetch": "^2.6.7"

@@ -10,3 +10,2 @@ const turkce = require(".");

}
})();
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc