-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.bundle.js
141 lines (111 loc) · 2.59 KB
/
client.bundle.js
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
var singleton = (function () {
'use strict';
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
var client = typeof window != 'undefined';
var owner = client ? /* istanbul ignore next */ window : commonjsGlobal;
var is_1 = is;
is.fn = isFunction;
is.str = isString;
is.num = isNumber;
is.obj = isObject;
is.lit = isLiteral;
is.bol = isBoolean;
is.truthy = isTruthy;
is.falsy = isFalsy;
is.arr = isArray;
is.null = isNull;
is.def = isDef;
is.in = isIn;
is.promise = isPromise;
is.stream = isStream;
function is(v){
return function(d){
return d == v
}
}
function isFunction(d) {
return typeof d == 'function'
}
function isBoolean(d) {
return typeof d == 'boolean'
}
function isString(d) {
return typeof d == 'string'
}
function isNumber(d) {
return typeof d == 'number'
}
function isObject(d) {
return typeof d == 'object'
}
function isLiteral(d) {
return typeof d == 'object'
&& !(d instanceof Array)
}
function isTruthy(d) {
return !!d == true
}
function isFalsy(d) {
return !!d == false
}
function isArray(d) {
return d instanceof Array
}
function isNull(d) {
return d === null
}
function isDef(d) {
return typeof d !== 'undefined'
}
function isPromise(d) {
return d instanceof Promise
}
function isStream(d) {
return !!(d && d.next)
}
function isIn(set) {
return function(d){
return !set ? false
: set.indexOf ? ~set.indexOf(d)
: d in set
}
}
var to = {
arr: toArray
, obj: toObject
};
function toArray(d){
return Array.prototype.slice.call(d, 0)
}
function toObject(d) {
var by = 'id';
return arguments.length == 1
? (by = d, reduce)
: reduce.apply(this, arguments)
function reduce(p,v,i){
if (i === 0) { p = {}; }
p[is_1.fn(by) ? by(v, i) : v[by]] = v;
return p
}
}
var log$1 = function log(ns){
return function(d){
if (!owner.console || !console.log.apply) { return d; }
is_1.arr(arguments[2]) && (arguments[2] = arguments[2].length);
var args = to.arr(arguments)
, prefix = '[log][' + (new Date()).toISOString() + ']' + ns;
args.unshift(prefix.grey ? prefix.grey : prefix);
return console.log.apply(console, args), d
}
};
// -------------------------------------------
// Exposes a convenient global instance
// -------------------------------------------
var singleton = function singleton(ripple){
log('creating');
if (!owner.ripple) { owner.ripple = ripple; }
return ripple
};
var log = log$1('[ri/singleton]');
return singleton;
}());