Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

turkish-string

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

turkish-string

isomorphic turkish string utilities for javascript

    1.1.2latest

Version published
Maintainers
1
Yearly downloads
13,502
increased by148.98%

Weekly downloads

Readme

Source

turkish-string

isomorphic turkish string utilities for javascript

GitHub version npm version Build Status codecov

NPM

Installation

$ yarn add turkish-string

Documentation

initialize via constructor, create or clone methods

const TurkishString = require("turkish-string"); const str1 = new TurkishString("string"); const str2 = TurkishString.create("string"); const str3 = new TurkishString(str1); const str4 = TurkishString.create(str2); const str5 = str4.clone();

Lowercase transform

const TurkishString = require("turkish-string"); const instance = new TurkishString("Ç-Ğ-I-İ-Ö-Ş-Ü"); const str1 = instance.toLowerCase(); //ç-ğ-ı-i-ö-ş-ü const str2 = TurkishString.toLowerCase("Ç-Ğ-I-İ-Ö-Ş-Ü"); //ç-ğ-ı-i-ö-ş-ü const str3 = TurkishString.toLowerCase(instance); //ç-ğ-ı-i-ö-ş-ü

Uppercase transform

const TurkishString = require("turkish-string"); const instance = new TurkishString("ç-ğ-ı-i-ö-ş-ü"); const str1 = instance.toUpperCase(); //Ç-Ğ-I-İ-Ö-Ş-Ü const str2 = TurkishString.toUpperCase("Ç-Ğ-I-İ-Ö-Ş-Ü"); //Ç-Ğ-I-İ-Ö-Ş-Ü const str3 = TurkishString.toUpperCase(instance); //Ç-Ğ-I-İ-Ö-Ş-Ü

Clear turkish characters

const TurkishString = require("turkish-string"); const instance = new TurkishString("Ç-Ğ-I-İ-Ö-Ş-Ü"); const str1 = instance.clear(); //C-G-I-I-O-S-U const str2 = TurkishString.clear("Ç-Ğ-I-İ-Ö-Ş-Ü"); //C-G-I-I-O-S-U const str3 = TurkishString.clear(instance); //C-G-I-I-O-S-U

Sorting support

For sorting TurkishString.compare method can be use as compare function

const letters = ["ğ", "g'", "f", "e", "d", "ç", "c", "b", "a"]; const englishSorted = letters.sort(); //["a", "b", "c", "d", "e", "f", "g", "ç", "ğ"] const turkishSorted = letters.sort(TurkishString.compare); //["a", "b", "c", "ç", "d", "e", "f", "g", "ğ"]

Other instance and static methods

  • isLessThan
  • isLessThanOrEqual
  • isGreaterThan
  • isGreaterThanOrEqual

Keywords

FAQs

What is turkish-string?

isomorphic turkish string utilities for javascript

Is turkish-string popular?

The npm package turkish-string receives a total of 240 weekly downloads. As such, turkish-string popularity was classified as not popular.

Is turkish-string well maintained?

We found that turkish-string demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.

Last updated on 03 Jul 2018
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc