-
Notifications
You must be signed in to change notification settings - Fork 16
/
camelcase.node.txt
98 lines (70 loc) · 5.65 KB
/
camelcase.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
CAMELCASE
ALTERNATIVES ==> # - camelcase (preferred for case changing)
# - underscore.string (preferred if camelcase does not have enough features)
VERSION ==> #8.0.0
CAMELCASE(STR[_ARR][, OPTS])->STR #Transforms to camelCase:
# - aa_BB_cc -> aaBbCc
# - aa-BB-cc -> aaBbCc
# - aa BB cc -> aaBbCc
# - aa.BB.cc -> aaBbCc
# - aaBBCc -> aaBbCc
#If STR_ARR, joined.
#Trimmed.
#Correctly handles Unicode characters.
#OPTS:
# - pascalCase BOOL (def: false): capitalize first character
# - locale STR[_ARR]|BOOL (def: current): used when lowercasing|uppercasing
# - preserveConsecutiveUppercase BOOL (def: false): if multiple uppercase letters, keep them uppercase
/=+===============================+=\
/ : : \
)==: CAMELCASE-KEYS :==(
\ :_______________________________: /
\=+===============================+=/
VERSION ==> #9.1.2
CAMELCASEKEYS(OBJ[_ARR][, OPTS]) #Applies CAMELCASE() on OBJ keys
->OBJ[_ARR] #OPTS:
# - deep BOOL (def: false)
# - stopPaths 'VARR'_ARR: exclude those paths
# - exclude STR|REGEXP_ARR
# - pascalCase|preserveConsecutiveUppercase: like CAMELCASE()
#Do nothing if key length > 100 (to prevent abuse)
/=+===============================+=\
/ : : \
)==: DECAMELIZE :==(
\ :_______________________________: /
\=+===============================+=/
VERSION ==> #6.0.0
DECAMELIZE(STR[, OPTS])->STR #Transforms from camelCase to underscored:
# - aaBbCc -> aa_bb_cc
# - aaBBCc -> aa_bb_cc
# - aa BB Cc -> aa bb cc
#Lowercased.
#OPTS:
# - separator STR2 (def: '_')
# - preserveConsecutiveUppercase BOOL (def: false)
/=+===============================+=\
/ : : \
)==: HUMANIZE-STRING :==(
\ :_______________________________: /
\=+===============================+=/
VERSION ==> #3.0.0
HUMANIZESTRING(STR)->STR #Like DECAMELIZE(STR, ' ') except:
# - trims
# - capitalize first letter
# - transform - to spaces
# - transform multiple spaces to single spaces
#Example:
# - aaBbCc -> Aa bb cc
# - aaBBCc -> Aa bb cc
# - aa BB Cc -> Aa bb cc
/=+===============================+=\
/ : : \
)==: TITLEIZE :==(
\ :_______________________________: /
\=+===============================+=/
VERSION ==> #4.0.0
TITLEIZE(STR)->STR #Capitalizes every space|dash-separated word:
# - aa BB cc -> Aa Bb Cc
# - aa-BB-cc -> Aa-Bb-Cc