@zipify/wysiwyg 1.1.1 → 1.2.1-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/actions/lint-css/action.yaml +1 -3
- package/.release-it.json +2 -1
- package/dist/cli.js +3 -3
- package/dist/wysiwyg.css +24 -25
- package/dist/wysiwyg.mjs +641 -618
- package/jest.config.js +3 -0
- package/lib/components/base/Modal.vue +21 -2
- package/lib/components/base/__tests__/Modal.test.js +1 -0
- package/lib/components/toolbar/controls/link/LinkControl.vue +22 -10
- package/lib/components/toolbar/controls/link/LinkControlHeader.vue +3 -3
- package/lib/components/toolbar/controls/link/__tests__/LinkControl.test.js +8 -8
- package/lib/components/toolbar/controls/link/__tests__/LinkControlHeader.test.js +1 -1
- package/lib/components/toolbar/controls/link/composables/useLink.js +10 -6
- package/lib/composables/__tests__/__snapshots__/useEditor.test.js.snap +1 -1
- package/lib/composables/useEditor.js +4 -3
- package/lib/enums/TextSettings.js +2 -0
- package/lib/extensions/FontStyle.js +2 -2
- package/lib/extensions/FontWeight.js +2 -0
- package/lib/extensions/Link.js +13 -15
- package/lib/extensions/StylePreset.js +33 -3
- package/lib/extensions/TextDecoration.js +6 -12
- package/lib/extensions/__tests__/FontFamily.test.js +7 -6
- package/lib/extensions/__tests__/FontWeight.test.js +19 -10
- package/lib/extensions/__tests__/StylePreset.test.js +52 -2
- package/lib/extensions/__tests__/TextDecoration.test.js +11 -40
- package/lib/extensions/__tests__/__snapshots__/Alignment.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/BackgroundColor.test.js.snap +1 -1
- package/lib/extensions/__tests__/__snapshots__/FontColor.test.js.snap +1 -1
- package/lib/extensions/__tests__/__snapshots__/FontFamily.test.js.snap +19 -1
- package/lib/extensions/__tests__/__snapshots__/FontSize.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/FontStyle.test.js.snap +17 -1
- package/lib/extensions/__tests__/__snapshots__/FontWeight.test.js.snap +26 -1
- package/lib/extensions/__tests__/__snapshots__/LineHeight.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/Margin.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/StylePreset.test.js.snap +22 -2
- package/lib/extensions/__tests__/__snapshots__/TextDecoration.test.js.snap +3 -46
- package/package.json +22 -22
- package/lib/components/toolbar/controls/link/LinkControlApply.vue +0 -35
- package/node_modules_lambda/acorn-globals/node_modules/.bin/acorn +0 -4
- package/node_modules_lambda/acorn-globals/node_modules/acorn/CHANGELOG.md +0 -620
- package/node_modules_lambda/acorn-globals/node_modules/acorn/LICENSE +0 -21
- package/node_modules_lambda/acorn-globals/node_modules/acorn/README.md +0 -269
- package/node_modules_lambda/acorn-globals/node_modules/acorn/bin/acorn +0 -4
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.d.ts +0 -209
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js +0 -5186
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js.map +0 -1
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs +0 -5155
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.d.ts +0 -2
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.map +0 -1
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/bin.js +0 -64
- package/node_modules_lambda/acorn-globals/node_modules/acorn/package.json +0 -35
- package/node_modules_lambda/cssstyle/node_modules/cssom/LICENSE.txt +0 -20
- package/node_modules_lambda/cssstyle/node_modules/cssom/README.mdown +0 -67
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSDocumentRule.js +0 -39
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSFontFaceRule.js +0 -36
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSHostRule.js +0 -37
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSImportRule.js +0 -132
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframeRule.js +0 -37
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframesRule.js +0 -39
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSMediaRule.js +0 -41
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSOM.js +0 -3
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSRule.js +0 -43
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleDeclaration.js +0 -148
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleRule.js +0 -190
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleSheet.js +0 -88
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSSupportsRule.js +0 -36
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValue.js +0 -43
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValueExpression.js +0 -344
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MatcherList.js +0 -62
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MediaList.js +0 -61
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/StyleSheet.js +0 -17
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/clone.js +0 -82
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/index.js +0 -21
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/parse.js +0 -464
- package/node_modules_lambda/cssstyle/node_modules/cssom/package.json +0 -18
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/LICENSE.txt +0 -21
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/README.md +0 -106
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/index.js +0 -27
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/Function.js +0 -42
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL-impl.js +0 -209
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL.js +0 -442
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams-impl.js +0 -130
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams.js +0 -472
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/VoidFunction.js +0 -26
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/encoding.js +0 -16
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/infra.js +0 -26
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/percent-encoding.js +0 -142
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/url-state-machine.js +0 -1244
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/urlencoded.js +0 -106
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/utils.js +0 -190
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/package.json +0 -58
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/webidl2js-wrapper.js +0 -7
- package/node_modules_lambda/escodegen/node_modules/estraverse/.jshintrc +0 -16
- package/node_modules_lambda/escodegen/node_modules/estraverse/LICENSE.BSD +0 -19
- package/node_modules_lambda/escodegen/node_modules/estraverse/README.md +0 -153
- package/node_modules_lambda/escodegen/node_modules/estraverse/estraverse.js +0 -805
- package/node_modules_lambda/escodegen/node_modules/estraverse/gulpfile.js +0 -70
- package/node_modules_lambda/escodegen/node_modules/estraverse/package.json +0 -40
- package/node_modules_lambda/escodegen/node_modules/levn/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/levn/README.md +0 -196
- package/node_modules_lambda/escodegen/node_modules/levn/lib/cast.js +0 -298
- package/node_modules_lambda/escodegen/node_modules/levn/lib/coerce.js +0 -285
- package/node_modules_lambda/escodegen/node_modules/levn/lib/index.js +0 -22
- package/node_modules_lambda/escodegen/node_modules/levn/lib/parse-string.js +0 -113
- package/node_modules_lambda/escodegen/node_modules/levn/lib/parse.js +0 -102
- package/node_modules_lambda/escodegen/node_modules/levn/package.json +0 -47
- package/node_modules_lambda/escodegen/node_modules/optionator/CHANGELOG.md +0 -56
- package/node_modules_lambda/escodegen/node_modules/optionator/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/optionator/README.md +0 -238
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/help.js +0 -260
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/index.js +0 -465
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/util.js +0 -54
- package/node_modules_lambda/escodegen/node_modules/optionator/package.json +0 -44
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/CHANGELOG.md +0 -99
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/README.md +0 -15
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Func.js +0 -65
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/List.js +0 -686
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Num.js +0 -130
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Obj.js +0 -154
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Str.js +0 -92
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/index.js +0 -178
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/package.json +0 -52
- package/node_modules_lambda/escodegen/node_modules/source-map/CHANGELOG.md +0 -301
- package/node_modules_lambda/escodegen/node_modules/source-map/LICENSE +0 -28
- package/node_modules_lambda/escodegen/node_modules/source-map/README.md +0 -742
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.debug.js +0 -3234
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.js +0 -3233
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js +0 -2
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js.map +0 -1
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/array-set.js +0 -121
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64-vlq.js +0 -140
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64.js +0 -67
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/binary-search.js +0 -111
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/mapping-list.js +0 -79
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/quick-sort.js +0 -114
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-consumer.js +0 -1145
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-generator.js +0 -425
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-node.js +0 -413
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/util.js +0 -488
- package/node_modules_lambda/escodegen/node_modules/source-map/package.json +0 -73
- package/node_modules_lambda/escodegen/node_modules/source-map/source-map.d.ts +0 -98
- package/node_modules_lambda/escodegen/node_modules/source-map/source-map.js +0 -8
- package/node_modules_lambda/escodegen/node_modules/type-check/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/type-check/README.md +0 -210
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/check.js +0 -126
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/index.js +0 -16
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/parse-type.js +0 -196
- package/node_modules_lambda/escodegen/node_modules/type-check/package.json +0 -40
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/.github/dependabot.yml +0 -11
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/Changelog.md +0 -212
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/LICENSE +0 -21
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/README.md +0 -130
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -597
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-data.js +0 -188
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/index.js +0 -23
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/internal.js +0 -198
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data.js +0 -179
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -56
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf16.js +0 -197
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf32.js +0 -319
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf7.js +0 -290
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/bom-handling.js +0 -52
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.d.ts +0 -41
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.js +0 -180
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/streams.js +0 -109
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/package.json +0 -44
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
// Generated by LiveScript 1.4.0
|
|
2
|
-
var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm;
|
|
3
|
-
max = curry$(function(x$, y$){
|
|
4
|
-
return x$ > y$ ? x$ : y$;
|
|
5
|
-
});
|
|
6
|
-
min = curry$(function(x$, y$){
|
|
7
|
-
return x$ < y$ ? x$ : y$;
|
|
8
|
-
});
|
|
9
|
-
negate = function(x){
|
|
10
|
-
return -x;
|
|
11
|
-
};
|
|
12
|
-
abs = Math.abs;
|
|
13
|
-
signum = function(x){
|
|
14
|
-
if (x < 0) {
|
|
15
|
-
return -1;
|
|
16
|
-
} else if (x > 0) {
|
|
17
|
-
return 1;
|
|
18
|
-
} else {
|
|
19
|
-
return 0;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
quot = curry$(function(x, y){
|
|
23
|
-
return ~~(x / y);
|
|
24
|
-
});
|
|
25
|
-
rem = curry$(function(x$, y$){
|
|
26
|
-
return x$ % y$;
|
|
27
|
-
});
|
|
28
|
-
div = curry$(function(x, y){
|
|
29
|
-
return Math.floor(x / y);
|
|
30
|
-
});
|
|
31
|
-
mod = curry$(function(x$, y$){
|
|
32
|
-
var ref$;
|
|
33
|
-
return (((x$) % (ref$ = y$) + ref$) % ref$);
|
|
34
|
-
});
|
|
35
|
-
recip = (function(it){
|
|
36
|
-
return 1 / it;
|
|
37
|
-
});
|
|
38
|
-
pi = Math.PI;
|
|
39
|
-
tau = pi * 2;
|
|
40
|
-
exp = Math.exp;
|
|
41
|
-
sqrt = Math.sqrt;
|
|
42
|
-
ln = Math.log;
|
|
43
|
-
pow = curry$(function(x$, y$){
|
|
44
|
-
return Math.pow(x$, y$);
|
|
45
|
-
});
|
|
46
|
-
sin = Math.sin;
|
|
47
|
-
tan = Math.tan;
|
|
48
|
-
cos = Math.cos;
|
|
49
|
-
asin = Math.asin;
|
|
50
|
-
acos = Math.acos;
|
|
51
|
-
atan = Math.atan;
|
|
52
|
-
atan2 = curry$(function(x, y){
|
|
53
|
-
return Math.atan2(x, y);
|
|
54
|
-
});
|
|
55
|
-
truncate = function(x){
|
|
56
|
-
return ~~x;
|
|
57
|
-
};
|
|
58
|
-
round = Math.round;
|
|
59
|
-
ceiling = Math.ceil;
|
|
60
|
-
floor = Math.floor;
|
|
61
|
-
isItNaN = function(x){
|
|
62
|
-
return x !== x;
|
|
63
|
-
};
|
|
64
|
-
even = function(x){
|
|
65
|
-
return x % 2 === 0;
|
|
66
|
-
};
|
|
67
|
-
odd = function(x){
|
|
68
|
-
return x % 2 !== 0;
|
|
69
|
-
};
|
|
70
|
-
gcd = curry$(function(x, y){
|
|
71
|
-
var z;
|
|
72
|
-
x = Math.abs(x);
|
|
73
|
-
y = Math.abs(y);
|
|
74
|
-
while (y !== 0) {
|
|
75
|
-
z = x % y;
|
|
76
|
-
x = y;
|
|
77
|
-
y = z;
|
|
78
|
-
}
|
|
79
|
-
return x;
|
|
80
|
-
});
|
|
81
|
-
lcm = curry$(function(x, y){
|
|
82
|
-
return Math.abs(Math.floor(x / gcd(x, y) * y));
|
|
83
|
-
});
|
|
84
|
-
module.exports = {
|
|
85
|
-
max: max,
|
|
86
|
-
min: min,
|
|
87
|
-
negate: negate,
|
|
88
|
-
abs: abs,
|
|
89
|
-
signum: signum,
|
|
90
|
-
quot: quot,
|
|
91
|
-
rem: rem,
|
|
92
|
-
div: div,
|
|
93
|
-
mod: mod,
|
|
94
|
-
recip: recip,
|
|
95
|
-
pi: pi,
|
|
96
|
-
tau: tau,
|
|
97
|
-
exp: exp,
|
|
98
|
-
sqrt: sqrt,
|
|
99
|
-
ln: ln,
|
|
100
|
-
pow: pow,
|
|
101
|
-
sin: sin,
|
|
102
|
-
tan: tan,
|
|
103
|
-
cos: cos,
|
|
104
|
-
acos: acos,
|
|
105
|
-
asin: asin,
|
|
106
|
-
atan: atan,
|
|
107
|
-
atan2: atan2,
|
|
108
|
-
truncate: truncate,
|
|
109
|
-
round: round,
|
|
110
|
-
ceiling: ceiling,
|
|
111
|
-
floor: floor,
|
|
112
|
-
isItNaN: isItNaN,
|
|
113
|
-
even: even,
|
|
114
|
-
odd: odd,
|
|
115
|
-
gcd: gcd,
|
|
116
|
-
lcm: lcm
|
|
117
|
-
};
|
|
118
|
-
function curry$(f, bound){
|
|
119
|
-
var context,
|
|
120
|
-
_curry = function(args) {
|
|
121
|
-
return f.length > 1 ? function(){
|
|
122
|
-
var params = args ? args.concat() : [];
|
|
123
|
-
context = bound ? context || this : this;
|
|
124
|
-
return params.push.apply(params, arguments) <
|
|
125
|
-
f.length && arguments.length ?
|
|
126
|
-
_curry.call(context, params) : f.apply(context, params);
|
|
127
|
-
} : f;
|
|
128
|
-
};
|
|
129
|
-
return _curry();
|
|
130
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
// Generated by LiveScript 1.4.0
|
|
2
|
-
var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find;
|
|
3
|
-
values = function(object){
|
|
4
|
-
var i$, x, results$ = [];
|
|
5
|
-
for (i$ in object) {
|
|
6
|
-
x = object[i$];
|
|
7
|
-
results$.push(x);
|
|
8
|
-
}
|
|
9
|
-
return results$;
|
|
10
|
-
};
|
|
11
|
-
keys = function(object){
|
|
12
|
-
var x, results$ = [];
|
|
13
|
-
for (x in object) {
|
|
14
|
-
results$.push(x);
|
|
15
|
-
}
|
|
16
|
-
return results$;
|
|
17
|
-
};
|
|
18
|
-
pairsToObj = function(object){
|
|
19
|
-
var i$, len$, x, resultObj$ = {};
|
|
20
|
-
for (i$ = 0, len$ = object.length; i$ < len$; ++i$) {
|
|
21
|
-
x = object[i$];
|
|
22
|
-
resultObj$[x[0]] = x[1];
|
|
23
|
-
}
|
|
24
|
-
return resultObj$;
|
|
25
|
-
};
|
|
26
|
-
objToPairs = function(object){
|
|
27
|
-
var key, value, results$ = [];
|
|
28
|
-
for (key in object) {
|
|
29
|
-
value = object[key];
|
|
30
|
-
results$.push([key, value]);
|
|
31
|
-
}
|
|
32
|
-
return results$;
|
|
33
|
-
};
|
|
34
|
-
listsToObj = curry$(function(keys, values){
|
|
35
|
-
var i$, len$, i, key, resultObj$ = {};
|
|
36
|
-
for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) {
|
|
37
|
-
i = i$;
|
|
38
|
-
key = keys[i$];
|
|
39
|
-
resultObj$[key] = values[i];
|
|
40
|
-
}
|
|
41
|
-
return resultObj$;
|
|
42
|
-
});
|
|
43
|
-
objToLists = function(object){
|
|
44
|
-
var keys, values, key, value;
|
|
45
|
-
keys = [];
|
|
46
|
-
values = [];
|
|
47
|
-
for (key in object) {
|
|
48
|
-
value = object[key];
|
|
49
|
-
keys.push(key);
|
|
50
|
-
values.push(value);
|
|
51
|
-
}
|
|
52
|
-
return [keys, values];
|
|
53
|
-
};
|
|
54
|
-
empty = function(object){
|
|
55
|
-
var x;
|
|
56
|
-
for (x in object) {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
return true;
|
|
60
|
-
};
|
|
61
|
-
each = curry$(function(f, object){
|
|
62
|
-
var i$, x;
|
|
63
|
-
for (i$ in object) {
|
|
64
|
-
x = object[i$];
|
|
65
|
-
f(x);
|
|
66
|
-
}
|
|
67
|
-
return object;
|
|
68
|
-
});
|
|
69
|
-
map = curry$(function(f, object){
|
|
70
|
-
var k, x, resultObj$ = {};
|
|
71
|
-
for (k in object) {
|
|
72
|
-
x = object[k];
|
|
73
|
-
resultObj$[k] = f(x);
|
|
74
|
-
}
|
|
75
|
-
return resultObj$;
|
|
76
|
-
});
|
|
77
|
-
compact = function(object){
|
|
78
|
-
var k, x, resultObj$ = {};
|
|
79
|
-
for (k in object) {
|
|
80
|
-
x = object[k];
|
|
81
|
-
if (x) {
|
|
82
|
-
resultObj$[k] = x;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return resultObj$;
|
|
86
|
-
};
|
|
87
|
-
filter = curry$(function(f, object){
|
|
88
|
-
var k, x, resultObj$ = {};
|
|
89
|
-
for (k in object) {
|
|
90
|
-
x = object[k];
|
|
91
|
-
if (f(x)) {
|
|
92
|
-
resultObj$[k] = x;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return resultObj$;
|
|
96
|
-
});
|
|
97
|
-
reject = curry$(function(f, object){
|
|
98
|
-
var k, x, resultObj$ = {};
|
|
99
|
-
for (k in object) {
|
|
100
|
-
x = object[k];
|
|
101
|
-
if (!f(x)) {
|
|
102
|
-
resultObj$[k] = x;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return resultObj$;
|
|
106
|
-
});
|
|
107
|
-
partition = curry$(function(f, object){
|
|
108
|
-
var passed, failed, k, x;
|
|
109
|
-
passed = {};
|
|
110
|
-
failed = {};
|
|
111
|
-
for (k in object) {
|
|
112
|
-
x = object[k];
|
|
113
|
-
(f(x) ? passed : failed)[k] = x;
|
|
114
|
-
}
|
|
115
|
-
return [passed, failed];
|
|
116
|
-
});
|
|
117
|
-
find = curry$(function(f, object){
|
|
118
|
-
var i$, x;
|
|
119
|
-
for (i$ in object) {
|
|
120
|
-
x = object[i$];
|
|
121
|
-
if (f(x)) {
|
|
122
|
-
return x;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
module.exports = {
|
|
127
|
-
values: values,
|
|
128
|
-
keys: keys,
|
|
129
|
-
pairsToObj: pairsToObj,
|
|
130
|
-
objToPairs: objToPairs,
|
|
131
|
-
listsToObj: listsToObj,
|
|
132
|
-
objToLists: objToLists,
|
|
133
|
-
empty: empty,
|
|
134
|
-
each: each,
|
|
135
|
-
map: map,
|
|
136
|
-
filter: filter,
|
|
137
|
-
compact: compact,
|
|
138
|
-
reject: reject,
|
|
139
|
-
partition: partition,
|
|
140
|
-
find: find
|
|
141
|
-
};
|
|
142
|
-
function curry$(f, bound){
|
|
143
|
-
var context,
|
|
144
|
-
_curry = function(args) {
|
|
145
|
-
return f.length > 1 ? function(){
|
|
146
|
-
var params = args ? args.concat() : [];
|
|
147
|
-
context = bound ? context || this : this;
|
|
148
|
-
return params.push.apply(params, arguments) <
|
|
149
|
-
f.length && arguments.length ?
|
|
150
|
-
_curry.call(context, params) : f.apply(context, params);
|
|
151
|
-
} : f;
|
|
152
|
-
};
|
|
153
|
-
return _curry();
|
|
154
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// Generated by LiveScript 1.4.0
|
|
2
|
-
var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize;
|
|
3
|
-
split = curry$(function(sep, str){
|
|
4
|
-
return str.split(sep);
|
|
5
|
-
});
|
|
6
|
-
join = curry$(function(sep, xs){
|
|
7
|
-
return xs.join(sep);
|
|
8
|
-
});
|
|
9
|
-
lines = function(str){
|
|
10
|
-
if (!str.length) {
|
|
11
|
-
return [];
|
|
12
|
-
}
|
|
13
|
-
return str.split('\n');
|
|
14
|
-
};
|
|
15
|
-
unlines = function(it){
|
|
16
|
-
return it.join('\n');
|
|
17
|
-
};
|
|
18
|
-
words = function(str){
|
|
19
|
-
if (!str.length) {
|
|
20
|
-
return [];
|
|
21
|
-
}
|
|
22
|
-
return str.split(/[ ]+/);
|
|
23
|
-
};
|
|
24
|
-
unwords = function(it){
|
|
25
|
-
return it.join(' ');
|
|
26
|
-
};
|
|
27
|
-
chars = function(it){
|
|
28
|
-
return it.split('');
|
|
29
|
-
};
|
|
30
|
-
unchars = function(it){
|
|
31
|
-
return it.join('');
|
|
32
|
-
};
|
|
33
|
-
reverse = function(str){
|
|
34
|
-
return str.split('').reverse().join('');
|
|
35
|
-
};
|
|
36
|
-
repeat = curry$(function(n, str){
|
|
37
|
-
var result, i$;
|
|
38
|
-
result = '';
|
|
39
|
-
for (i$ = 0; i$ < n; ++i$) {
|
|
40
|
-
result += str;
|
|
41
|
-
}
|
|
42
|
-
return result;
|
|
43
|
-
});
|
|
44
|
-
capitalize = function(str){
|
|
45
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
46
|
-
};
|
|
47
|
-
camelize = function(it){
|
|
48
|
-
return it.replace(/[-_]+(.)?/g, function(arg$, c){
|
|
49
|
-
return (c != null ? c : '').toUpperCase();
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
dasherize = function(str){
|
|
53
|
-
return str.replace(/([^-A-Z])([A-Z]+)/g, function(arg$, lower, upper){
|
|
54
|
-
return lower + "-" + (upper.length > 1
|
|
55
|
-
? upper
|
|
56
|
-
: upper.toLowerCase());
|
|
57
|
-
}).replace(/^([A-Z]+)/, function(arg$, upper){
|
|
58
|
-
if (upper.length > 1) {
|
|
59
|
-
return upper + "-";
|
|
60
|
-
} else {
|
|
61
|
-
return upper.toLowerCase();
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
module.exports = {
|
|
66
|
-
split: split,
|
|
67
|
-
join: join,
|
|
68
|
-
lines: lines,
|
|
69
|
-
unlines: unlines,
|
|
70
|
-
words: words,
|
|
71
|
-
unwords: unwords,
|
|
72
|
-
chars: chars,
|
|
73
|
-
unchars: unchars,
|
|
74
|
-
reverse: reverse,
|
|
75
|
-
repeat: repeat,
|
|
76
|
-
capitalize: capitalize,
|
|
77
|
-
camelize: camelize,
|
|
78
|
-
dasherize: dasherize
|
|
79
|
-
};
|
|
80
|
-
function curry$(f, bound){
|
|
81
|
-
var context,
|
|
82
|
-
_curry = function(args) {
|
|
83
|
-
return f.length > 1 ? function(){
|
|
84
|
-
var params = args ? args.concat() : [];
|
|
85
|
-
context = bound ? context || this : this;
|
|
86
|
-
return params.push.apply(params, arguments) <
|
|
87
|
-
f.length && arguments.length ?
|
|
88
|
-
_curry.call(context, params) : f.apply(context, params);
|
|
89
|
-
} : f;
|
|
90
|
-
};
|
|
91
|
-
return _curry();
|
|
92
|
-
}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
// Generated by LiveScript 1.4.0
|
|
2
|
-
var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString;
|
|
3
|
-
Func = require('./Func.js');
|
|
4
|
-
List = require('./List.js');
|
|
5
|
-
Obj = require('./Obj.js');
|
|
6
|
-
Str = require('./Str.js');
|
|
7
|
-
Num = require('./Num.js');
|
|
8
|
-
id = function(x){
|
|
9
|
-
return x;
|
|
10
|
-
};
|
|
11
|
-
isType = curry$(function(type, x){
|
|
12
|
-
return toString$.call(x).slice(8, -1) === type;
|
|
13
|
-
});
|
|
14
|
-
replicate = curry$(function(n, x){
|
|
15
|
-
var i$, results$ = [];
|
|
16
|
-
for (i$ = 0; i$ < n; ++i$) {
|
|
17
|
-
results$.push(x);
|
|
18
|
-
}
|
|
19
|
-
return results$;
|
|
20
|
-
});
|
|
21
|
-
Str.empty = List.empty;
|
|
22
|
-
Str.slice = List.slice;
|
|
23
|
-
Str.take = List.take;
|
|
24
|
-
Str.drop = List.drop;
|
|
25
|
-
Str.splitAt = List.splitAt;
|
|
26
|
-
Str.takeWhile = List.takeWhile;
|
|
27
|
-
Str.dropWhile = List.dropWhile;
|
|
28
|
-
Str.span = List.span;
|
|
29
|
-
Str.breakStr = List.breakList;
|
|
30
|
-
prelude = {
|
|
31
|
-
Func: Func,
|
|
32
|
-
List: List,
|
|
33
|
-
Obj: Obj,
|
|
34
|
-
Str: Str,
|
|
35
|
-
Num: Num,
|
|
36
|
-
id: id,
|
|
37
|
-
isType: isType,
|
|
38
|
-
replicate: replicate
|
|
39
|
-
};
|
|
40
|
-
prelude.each = List.each;
|
|
41
|
-
prelude.map = List.map;
|
|
42
|
-
prelude.filter = List.filter;
|
|
43
|
-
prelude.compact = List.compact;
|
|
44
|
-
prelude.reject = List.reject;
|
|
45
|
-
prelude.partition = List.partition;
|
|
46
|
-
prelude.find = List.find;
|
|
47
|
-
prelude.head = List.head;
|
|
48
|
-
prelude.first = List.first;
|
|
49
|
-
prelude.tail = List.tail;
|
|
50
|
-
prelude.last = List.last;
|
|
51
|
-
prelude.initial = List.initial;
|
|
52
|
-
prelude.empty = List.empty;
|
|
53
|
-
prelude.reverse = List.reverse;
|
|
54
|
-
prelude.difference = List.difference;
|
|
55
|
-
prelude.intersection = List.intersection;
|
|
56
|
-
prelude.union = List.union;
|
|
57
|
-
prelude.countBy = List.countBy;
|
|
58
|
-
prelude.groupBy = List.groupBy;
|
|
59
|
-
prelude.fold = List.fold;
|
|
60
|
-
prelude.foldl = List.foldl;
|
|
61
|
-
prelude.fold1 = List.fold1;
|
|
62
|
-
prelude.foldl1 = List.foldl1;
|
|
63
|
-
prelude.foldr = List.foldr;
|
|
64
|
-
prelude.foldr1 = List.foldr1;
|
|
65
|
-
prelude.unfoldr = List.unfoldr;
|
|
66
|
-
prelude.andList = List.andList;
|
|
67
|
-
prelude.orList = List.orList;
|
|
68
|
-
prelude.any = List.any;
|
|
69
|
-
prelude.all = List.all;
|
|
70
|
-
prelude.unique = List.unique;
|
|
71
|
-
prelude.uniqueBy = List.uniqueBy;
|
|
72
|
-
prelude.sort = List.sort;
|
|
73
|
-
prelude.sortWith = List.sortWith;
|
|
74
|
-
prelude.sortBy = List.sortBy;
|
|
75
|
-
prelude.sum = List.sum;
|
|
76
|
-
prelude.product = List.product;
|
|
77
|
-
prelude.mean = List.mean;
|
|
78
|
-
prelude.average = List.average;
|
|
79
|
-
prelude.concat = List.concat;
|
|
80
|
-
prelude.concatMap = List.concatMap;
|
|
81
|
-
prelude.flatten = List.flatten;
|
|
82
|
-
prelude.maximum = List.maximum;
|
|
83
|
-
prelude.minimum = List.minimum;
|
|
84
|
-
prelude.maximumBy = List.maximumBy;
|
|
85
|
-
prelude.minimumBy = List.minimumBy;
|
|
86
|
-
prelude.scan = List.scan;
|
|
87
|
-
prelude.scanl = List.scanl;
|
|
88
|
-
prelude.scan1 = List.scan1;
|
|
89
|
-
prelude.scanl1 = List.scanl1;
|
|
90
|
-
prelude.scanr = List.scanr;
|
|
91
|
-
prelude.scanr1 = List.scanr1;
|
|
92
|
-
prelude.slice = List.slice;
|
|
93
|
-
prelude.take = List.take;
|
|
94
|
-
prelude.drop = List.drop;
|
|
95
|
-
prelude.splitAt = List.splitAt;
|
|
96
|
-
prelude.takeWhile = List.takeWhile;
|
|
97
|
-
prelude.dropWhile = List.dropWhile;
|
|
98
|
-
prelude.span = List.span;
|
|
99
|
-
prelude.breakList = List.breakList;
|
|
100
|
-
prelude.zip = List.zip;
|
|
101
|
-
prelude.zipWith = List.zipWith;
|
|
102
|
-
prelude.zipAll = List.zipAll;
|
|
103
|
-
prelude.zipAllWith = List.zipAllWith;
|
|
104
|
-
prelude.at = List.at;
|
|
105
|
-
prelude.elemIndex = List.elemIndex;
|
|
106
|
-
prelude.elemIndices = List.elemIndices;
|
|
107
|
-
prelude.findIndex = List.findIndex;
|
|
108
|
-
prelude.findIndices = List.findIndices;
|
|
109
|
-
prelude.apply = Func.apply;
|
|
110
|
-
prelude.curry = Func.curry;
|
|
111
|
-
prelude.flip = Func.flip;
|
|
112
|
-
prelude.fix = Func.fix;
|
|
113
|
-
prelude.over = Func.over;
|
|
114
|
-
prelude.split = Str.split;
|
|
115
|
-
prelude.join = Str.join;
|
|
116
|
-
prelude.lines = Str.lines;
|
|
117
|
-
prelude.unlines = Str.unlines;
|
|
118
|
-
prelude.words = Str.words;
|
|
119
|
-
prelude.unwords = Str.unwords;
|
|
120
|
-
prelude.chars = Str.chars;
|
|
121
|
-
prelude.unchars = Str.unchars;
|
|
122
|
-
prelude.repeat = Str.repeat;
|
|
123
|
-
prelude.capitalize = Str.capitalize;
|
|
124
|
-
prelude.camelize = Str.camelize;
|
|
125
|
-
prelude.dasherize = Str.dasherize;
|
|
126
|
-
prelude.values = Obj.values;
|
|
127
|
-
prelude.keys = Obj.keys;
|
|
128
|
-
prelude.pairsToObj = Obj.pairsToObj;
|
|
129
|
-
prelude.objToPairs = Obj.objToPairs;
|
|
130
|
-
prelude.listsToObj = Obj.listsToObj;
|
|
131
|
-
prelude.objToLists = Obj.objToLists;
|
|
132
|
-
prelude.max = Num.max;
|
|
133
|
-
prelude.min = Num.min;
|
|
134
|
-
prelude.negate = Num.negate;
|
|
135
|
-
prelude.abs = Num.abs;
|
|
136
|
-
prelude.signum = Num.signum;
|
|
137
|
-
prelude.quot = Num.quot;
|
|
138
|
-
prelude.rem = Num.rem;
|
|
139
|
-
prelude.div = Num.div;
|
|
140
|
-
prelude.mod = Num.mod;
|
|
141
|
-
prelude.recip = Num.recip;
|
|
142
|
-
prelude.pi = Num.pi;
|
|
143
|
-
prelude.tau = Num.tau;
|
|
144
|
-
prelude.exp = Num.exp;
|
|
145
|
-
prelude.sqrt = Num.sqrt;
|
|
146
|
-
prelude.ln = Num.ln;
|
|
147
|
-
prelude.pow = Num.pow;
|
|
148
|
-
prelude.sin = Num.sin;
|
|
149
|
-
prelude.tan = Num.tan;
|
|
150
|
-
prelude.cos = Num.cos;
|
|
151
|
-
prelude.acos = Num.acos;
|
|
152
|
-
prelude.asin = Num.asin;
|
|
153
|
-
prelude.atan = Num.atan;
|
|
154
|
-
prelude.atan2 = Num.atan2;
|
|
155
|
-
prelude.truncate = Num.truncate;
|
|
156
|
-
prelude.round = Num.round;
|
|
157
|
-
prelude.ceiling = Num.ceiling;
|
|
158
|
-
prelude.floor = Num.floor;
|
|
159
|
-
prelude.isItNaN = Num.isItNaN;
|
|
160
|
-
prelude.even = Num.even;
|
|
161
|
-
prelude.odd = Num.odd;
|
|
162
|
-
prelude.gcd = Num.gcd;
|
|
163
|
-
prelude.lcm = Num.lcm;
|
|
164
|
-
prelude.VERSION = '1.1.2';
|
|
165
|
-
module.exports = prelude;
|
|
166
|
-
function curry$(f, bound){
|
|
167
|
-
var context,
|
|
168
|
-
_curry = function(args) {
|
|
169
|
-
return f.length > 1 ? function(){
|
|
170
|
-
var params = args ? args.concat() : [];
|
|
171
|
-
context = bound ? context || this : this;
|
|
172
|
-
return params.push.apply(params, arguments) <
|
|
173
|
-
f.length && arguments.length ?
|
|
174
|
-
_curry.call(context, params) : f.apply(context, params);
|
|
175
|
-
} : f;
|
|
176
|
-
};
|
|
177
|
-
return _curry();
|
|
178
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "prelude-ls",
|
|
3
|
-
"version": "1.1.2",
|
|
4
|
-
"author": "George Zahariev <z@georgezahariev.com>",
|
|
5
|
-
"description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"prelude",
|
|
8
|
-
"livescript",
|
|
9
|
-
"utility",
|
|
10
|
-
"ls",
|
|
11
|
-
"coffeescript",
|
|
12
|
-
"javascript",
|
|
13
|
-
"library",
|
|
14
|
-
"functional",
|
|
15
|
-
"array",
|
|
16
|
-
"list",
|
|
17
|
-
"object",
|
|
18
|
-
"string"
|
|
19
|
-
],
|
|
20
|
-
"main": "lib/",
|
|
21
|
-
"files": [
|
|
22
|
-
"lib/",
|
|
23
|
-
"README.md",
|
|
24
|
-
"LICENSE"
|
|
25
|
-
],
|
|
26
|
-
"homepage": "http://preludels.com",
|
|
27
|
-
"bugs": "https://github.com/gkz/prelude-ls/issues",
|
|
28
|
-
"licenses": [
|
|
29
|
-
{
|
|
30
|
-
"type": "MIT",
|
|
31
|
-
"url": "https://raw.github.com/gkz/prelude-ls/master/LICENSE"
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"engines": {
|
|
35
|
-
"node": ">= 0.8.0"
|
|
36
|
-
},
|
|
37
|
-
"repository": {
|
|
38
|
-
"type": "git",
|
|
39
|
-
"url": "git://github.com/gkz/prelude-ls.git"
|
|
40
|
-
},
|
|
41
|
-
"scripts": {
|
|
42
|
-
"test": "make test"
|
|
43
|
-
},
|
|
44
|
-
"devDependencies": {
|
|
45
|
-
"livescript": "~1.4.0",
|
|
46
|
-
"uglify-js": "~2.4.12",
|
|
47
|
-
"mocha": "~2.2.4",
|
|
48
|
-
"istanbul": "~0.2.4",
|
|
49
|
-
"browserify": "~3.24.13",
|
|
50
|
-
"sinon": "~1.10.2"
|
|
51
|
-
}
|
|
52
|
-
}
|