Bring Ruby methods to JavaScript/TypeScript
import ruby from "ruby-ts";
ruby('foo', s => s.upcase().center(9)) // return ***FOO***
- capitalize
- casecmp
- center
- chars
- chomp
- chop
- chr
- clear
- codepoints
- concat
- count
- delete
- delete_prefix => deletePrefix
- delete_suffix => deleteSuffix
- downcase
- dump
- each_char => eachChar
- each_codepoint => eachCodepoint
- each_line => eachLine
- empty? => empty / isEmpty
- end_with? => end_with / endWith / isEndWith
- eql? => eql / isEql
- gsub
- hash
- hex
- include? => include / isInclude
- index
- initialize_copy
- insert
- inspect
- length
- lines
- ljust
- lstrip
- match
- match? => isMatch
- next
- oct
- ord
- partition
- prepend
- replace
- reverse
- rindex
- rjust
- rpartition
- rstrip
- scan
- scrub
- size
- slice
- split
- squeeze
- start_with? => start_with / startWith / isStartWith
- strip
- sub
- succ
- sum
- swapcase
- to_c => toC
- to_f => toF
- to_i => toI
- to_s => toS
- to_str => toStr
- to_sym => toSym
- tr
- tr_s => trS
- undump
- upcase
- upto
- ascii_only?
- b
- byteindex
- byterindex
- bytes
- bytesize
- byteslice
- bytesplice
- crypt
- each_byte
- force_encoding
- freeze
- getbyte
- grapheme_clusters
- intern
- to_r
- unicode_normalize
- unicode_normalized?
- unpack
- unpack1
- validEncoding?
- each
- include? => include / isInclude
- member? => member / isMember