You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: GLOSSARY.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,6 @@ Fakat bazı terimlerin Türkçe çevrimi, cümleyi anlamsız bir hale getirebilm
25
25
| Optional | İsteğe bağlı |
26
26
| Type | Tip |
27
27
| Engine | Motor |
28
-
28
+
| Namespace | Aduzayı |
29
29
# Terim açıklamaları
30
30
* Duck Typing: Eğer bir ördek gibi yürüyor ve bir ördek gibi "vak"lıyorsa, o zaman bu bir ördektir. Bir nesne yapısal olarak tüm üyelere sahipse, diğer şeylerin de (ne olduğu önemli değil) var olduğu kabul edilir.
Copy file name to clipboardExpand all lines: docs/project/namespaces.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
-
## Namespaces
2
-
Namespaces provide you with a convenient syntax around a common pattern used in JavaScript:
1
+
## Aduzayları (Namespaces)
2
+
Aduzayları, JavaScript'te kullanılan yaygın bir kalıp için uygun sözdizimi sağlar:
3
3
4
4
```ts
5
5
(function(something) {
@@ -8,8 +8,9 @@ Namespaces provide you with a convenient syntax around a common pattern used in
8
8
9
9
})(something||something= {})
10
10
```
11
+
Basit olarak anlatmak gerekirse `something || something = {}` ifadesi, anonim fonksiyonun *varolan bir nesneye eklenti yapmasını* (`something ||` kısmı) veya *yeni bir obje yaratarak yaratılan bu yeni objeye eklenti yapılmasına* (`|| something = {}` kısmı) imkan tanır.
12
+
Bunun anlamı şudur, bir çalıştırma sınırıyla ayrılmış iki farklı kod bloğuna sahip olabilirsiniz:
11
13
12
-
Basically `something || something = {}` allows an anonymous function `function(something) {}` to *add stuff to an existing object* (the `something ||` portion) or *start a new object then add stuff to that object* (the `|| something = {}` portion). This means that you can have two such blocks split by some execution boundary :
This is commonly used in the JavaScript land for making sure that stuff doesn't leak into the global namespace. With file based modules you don't need to worry about this, but the pattern is still useful for *logical grouping* of a bunch of functions. Therefore TypeScript provides the `namespace` keyword to group these e.g.
33
+
Javascript'te bunun en yaygın kullanım amacı global(küresel) aduzayına bilgi sızmasını önlemektir. Dosya tabanlı modüller kullanıldığında bu konu hakkında endişe etmenize gerek olmamakla birlikte, bu kalıp fonksiyonlarınızı *mantıksal olarak gruplamak* için oldukça kullanışlıdır. Bu tip gruplamaları yapabilmeniz için TypeScript `namespace` anahtar kelimesini sunmaktadır. Ör:
34
34
35
35
```ts
36
36
namespaceUtility {
@@ -46,7 +46,7 @@ namespace Utility {
46
46
Utility.log('Call me');
47
47
Utility.error('maybe!');
48
48
```
49
-
The `namespace`keyword generates the same JavaScript that we saw earlier:
49
+
`namespace`anahtar kelimesi ilk bölümde gördüğümüz JavaScript kodunun aynısını üretmektedir.
50
50
51
51
```ts
52
52
(function (Utility) {
@@ -55,7 +55,6 @@ The `namespace` keyword generates the same JavaScript that we saw earlier:
55
55
56
56
})(Utility|| (Utility= {}));
57
57
```
58
+
Bir diğer nokta ise, aduzaylarının iç içe geçebiliyor olmalarıdır, bu sayede `namespace Utility.Messaging` gibi bir ifadeyle `Messaging` aduzayını `Utility` aduzayının içerisinde tanımlamak mümkün olmaktadır.
58
59
59
-
One thing to note is that namespaces can be nested so you can do stuff like `namespace Utility.Messaging` to nest a `Messaging` namespace under `Utility`.
60
-
61
-
For most projects we recommend using external modules and using `namespace` for quick demos and porting old JavaScript code.
60
+
Örnek proje oluştururken veya eski JavaScript kodunu port ederken harici modül ve `namespace` kullanılması tavsiye edilmektedir.
0 commit comments