forked from purescript/purescript-strings
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommon.js
More file actions
54 lines (46 loc) · 1.01 KB
/
Common.js
File metadata and controls
54 lines (46 loc) · 1.01 KB
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
"use strict";
exports._localeCompare = function (lt) {
return function (eq) {
return function (gt) {
return function (s1) {
return function (s2) {
var result = s1.localeCompare(s2);
return result < 0 ? lt : result > 0 ? gt : eq;
};
};
};
};
};
exports.replace = function (s1) {
return function (s2) {
return function (s3) {
return s3.replace(s1, s2);
};
};
};
exports.replaceAll = function (s1) {
return function (s2) {
return function (s3) {
return s3.replace(new RegExp(s1.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), "g"), s2); // eslint-disable-line no-useless-escape
};
};
};
exports.split = function (sep) {
return function (s) {
return s.split(sep);
};
};
exports.toLower = function (s) {
return s.toLowerCase();
};
exports.toUpper = function (s) {
return s.toUpperCase();
};
exports.trim = function (s) {
return s.trim();
};
exports.joinWith = function (s) {
return function (xs) {
return xs.join(s);
};
};