cx 24.9.2 → 24.9.4
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/dist/data.js +5 -4
- package/dist/manifest.js +744 -741
- package/dist/util.js +7 -0
- package/dist/widgets.css +1 -1
- package/dist/widgets.js +3 -3
- package/package.json +1 -1
- package/src/data/Expression.js +221 -220
- package/src/data/Expression.spec.js +184 -174
- package/src/util/index.d.ts +51 -50
- package/src/util/index.js +54 -53
- package/src/util/isValidIdentifierName.d.ts +1 -0
- package/src/util/isValidIdentifierName.js +5 -0
- package/src/util/isValidIdentifierName.spec.js +33 -0
- package/src/widgets/HighlightedSearchText.js +36 -36
- package/src/widgets/HighlightedSearchText.scss +18 -18
- package/src/widgets/form/LookupField.d.ts +179 -176
- package/src/widgets/form/variables.scss +353 -352
- package/src/widgets/variables.scss +144 -144
|
@@ -1,174 +1,184 @@
|
|
|
1
|
-
import { Expression } from "./Expression";
|
|
2
|
-
import assert from "assert";
|
|
3
|
-
|
|
4
|
-
describe("Expression", function () {
|
|
5
|
-
describe("#compile()", function () {
|
|
6
|
-
it("returns a selector", function () {
|
|
7
|
-
var e = Expression.compile("{person.name}");
|
|
8
|
-
var state = {
|
|
9
|
-
person: {
|
|
10
|
-
name: "Jim",
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
assert.equal(e(state), "Jim");
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it("ignores bindings in strings", function () {
|
|
17
|
-
var e = Expression.compile('"{person.name}"');
|
|
18
|
-
var state = {
|
|
19
|
-
person: {
|
|
20
|
-
name: "Jim",
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
assert.equal(e(state), "{person.name}");
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it("properly encodes quotes #1", function () {
|
|
27
|
-
var e = Expression.compile('"\'"');
|
|
28
|
-
var state = {};
|
|
29
|
-
assert.equal(e(state), "'");
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it("properly encodes quotes #2", function () {
|
|
33
|
-
var e = Expression.compile('"\\""');
|
|
34
|
-
var state = {};
|
|
35
|
-
assert.equal(e(state), '"');
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
describe("allow subexpressions", function () {
|
|
40
|
-
it("in square brackets", function () {
|
|
41
|
-
var e = Expression.compile("{[{person.name}]}");
|
|
42
|
-
var state = {
|
|
43
|
-
person: {
|
|
44
|
-
name: "Jim",
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
assert.equal(e(state), "Jim");
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it("in square brackets", function () {
|
|
51
|
-
var e = Expression.compile("{[{person.alias} || {person.name}]}");
|
|
52
|
-
var state = {
|
|
53
|
-
person: {
|
|
54
|
-
name: "Jim",
|
|
55
|
-
alias: "J",
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
assert.equal(e(state), "J");
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it("prefixed with % sign", function () {
|
|
62
|
-
var e = Expression.compile("%{1+1}");
|
|
63
|
-
assert.equal(e(), "2");
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it("can be formatted", function () {
|
|
67
|
-
var e = Expression.compile("{[1+1]:f;2}");
|
|
68
|
-
assert.equal(e(), "2.00");
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it("n level deep", function () {
|
|
72
|
-
var e = Expression.compile("{[{[{[1+1]}]}]:f;2}");
|
|
73
|
-
assert.equal(e(), "2.00");
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it("with complex math inside", function () {
|
|
77
|
-
var e = Expression.compile("%{{data}.reduce((a,b)=>a+b, 0):f;2}");
|
|
78
|
-
var state = {
|
|
79
|
-
data: [1, 2, 3],
|
|
80
|
-
};
|
|
81
|
-
assert.equal(e(state), "6.00");
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it("with a conditional operator inside", function () {
|
|
85
|
-
var e = Expression.compile('{[true ? "T" : "F"]}');
|
|
86
|
-
assert.equal(e(), "T");
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it("with string interpolation inside", function () {
|
|
90
|
-
var e = Expression.compile("{[`${{test}}`]}");
|
|
91
|
-
assert.equal(e({ test: "T" }), "T");
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
describe("are working", function () {
|
|
96
|
-
it("function expressions with get", function () {
|
|
97
|
-
var e = Expression.get((get) => get("a") + get("b"));
|
|
98
|
-
assert.equal(e({ a: 1, b: 2 }), 3);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it("are properly memoized", function () {
|
|
102
|
-
let inv = 0;
|
|
103
|
-
var e = Expression.get((get) => {
|
|
104
|
-
inv++;
|
|
105
|
-
return get("a") + get("b");
|
|
106
|
-
}).memoize();
|
|
107
|
-
|
|
108
|
-
assert.equal(e({ a: 1, b: 1 }), 2);
|
|
109
|
-
assert.equal(inv, 1);
|
|
110
|
-
|
|
111
|
-
assert.equal(e({ a: 1, b: 1 }), 2);
|
|
112
|
-
assert.equal(inv, 1);
|
|
113
|
-
|
|
114
|
-
assert.equal(e({ a: 1, b: 2 }), 3);
|
|
115
|
-
assert.equal(inv, 2);
|
|
116
|
-
|
|
117
|
-
assert.equal(e({ a: 1, b: 2 }), 3);
|
|
118
|
-
assert.equal(inv, 2);
|
|
119
|
-
|
|
120
|
-
assert.equal(e({ a: 2, b: 2 }), 4);
|
|
121
|
-
assert.equal(inv, 3);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
it("formatting can be used inside bindings", function () {
|
|
125
|
-
var e = Expression.get((get) => get("name:prefix;Hello "));
|
|
126
|
-
assert(e({ name: "CxJS" }), "Hello CxJS");
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it("allows using the fmt function inside", function () {
|
|
130
|
-
var e = Expression.compile('{[fmt({text}, "prefix;Hello ")]}');
|
|
131
|
-
assert.equal(e({ text: "CxJS" }), "Hello CxJS");
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
// assert.equal(
|
|
149
|
-
//
|
|
150
|
-
//
|
|
151
|
-
// assert.equal(
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
// assert.equal(
|
|
159
|
-
//
|
|
160
|
-
//
|
|
161
|
-
// assert.equal(
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
//
|
|
166
|
-
//
|
|
167
|
-
//
|
|
168
|
-
// assert.equal(
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
// assert.equal(
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
});
|
|
1
|
+
import { Expression } from "./Expression";
|
|
2
|
+
import assert from "assert";
|
|
3
|
+
|
|
4
|
+
describe("Expression", function () {
|
|
5
|
+
describe("#compile()", function () {
|
|
6
|
+
it("returns a selector", function () {
|
|
7
|
+
var e = Expression.compile("{person.name}");
|
|
8
|
+
var state = {
|
|
9
|
+
person: {
|
|
10
|
+
name: "Jim",
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
assert.equal(e(state), "Jim");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("ignores bindings in strings", function () {
|
|
17
|
+
var e = Expression.compile('"{person.name}"');
|
|
18
|
+
var state = {
|
|
19
|
+
person: {
|
|
20
|
+
name: "Jim",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
assert.equal(e(state), "{person.name}");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("properly encodes quotes #1", function () {
|
|
27
|
+
var e = Expression.compile('"\'"');
|
|
28
|
+
var state = {};
|
|
29
|
+
assert.equal(e(state), "'");
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("properly encodes quotes #2", function () {
|
|
33
|
+
var e = Expression.compile('"\\""');
|
|
34
|
+
var state = {};
|
|
35
|
+
assert.equal(e(state), '"');
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
describe("allow subexpressions", function () {
|
|
40
|
+
it("in square brackets", function () {
|
|
41
|
+
var e = Expression.compile("{[{person.name}]}");
|
|
42
|
+
var state = {
|
|
43
|
+
person: {
|
|
44
|
+
name: "Jim",
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
assert.equal(e(state), "Jim");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("in square brackets", function () {
|
|
51
|
+
var e = Expression.compile("{[{person.alias} || {person.name}]}");
|
|
52
|
+
var state = {
|
|
53
|
+
person: {
|
|
54
|
+
name: "Jim",
|
|
55
|
+
alias: "J",
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
assert.equal(e(state), "J");
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("prefixed with % sign", function () {
|
|
62
|
+
var e = Expression.compile("%{1+1}");
|
|
63
|
+
assert.equal(e(), "2");
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("can be formatted", function () {
|
|
67
|
+
var e = Expression.compile("{[1+1]:f;2}");
|
|
68
|
+
assert.equal(e(), "2.00");
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("n level deep", function () {
|
|
72
|
+
var e = Expression.compile("{[{[{[1+1]}]}]:f;2}");
|
|
73
|
+
assert.equal(e(), "2.00");
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("with complex math inside", function () {
|
|
77
|
+
var e = Expression.compile("%{{data}.reduce((a,b)=>a+b, 0):f;2}");
|
|
78
|
+
var state = {
|
|
79
|
+
data: [1, 2, 3],
|
|
80
|
+
};
|
|
81
|
+
assert.equal(e(state), "6.00");
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("with a conditional operator inside", function () {
|
|
85
|
+
var e = Expression.compile('{[true ? "T" : "F"]}');
|
|
86
|
+
assert.equal(e(), "T");
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("with string interpolation inside", function () {
|
|
90
|
+
var e = Expression.compile("{[`${{test}}`]}");
|
|
91
|
+
assert.equal(e({ test: "T" }), "T");
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe("are working", function () {
|
|
96
|
+
it("function expressions with get", function () {
|
|
97
|
+
var e = Expression.get((get) => get("a") + get("b"));
|
|
98
|
+
assert.equal(e({ a: 1, b: 2 }), 3);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("are properly memoized", function () {
|
|
102
|
+
let inv = 0;
|
|
103
|
+
var e = Expression.get((get) => {
|
|
104
|
+
inv++;
|
|
105
|
+
return get("a") + get("b");
|
|
106
|
+
}).memoize();
|
|
107
|
+
|
|
108
|
+
assert.equal(e({ a: 1, b: 1 }), 2);
|
|
109
|
+
assert.equal(inv, 1);
|
|
110
|
+
|
|
111
|
+
assert.equal(e({ a: 1, b: 1 }), 2);
|
|
112
|
+
assert.equal(inv, 1);
|
|
113
|
+
|
|
114
|
+
assert.equal(e({ a: 1, b: 2 }), 3);
|
|
115
|
+
assert.equal(inv, 2);
|
|
116
|
+
|
|
117
|
+
assert.equal(e({ a: 1, b: 2 }), 3);
|
|
118
|
+
assert.equal(inv, 2);
|
|
119
|
+
|
|
120
|
+
assert.equal(e({ a: 2, b: 2 }), 4);
|
|
121
|
+
assert.equal(inv, 3);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it("formatting can be used inside bindings", function () {
|
|
125
|
+
var e = Expression.get((get) => get("name:prefix;Hello "));
|
|
126
|
+
assert(e({ name: "CxJS" }), "Hello CxJS");
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("allows using the fmt function inside", function () {
|
|
130
|
+
var e = Expression.compile('{[fmt({text}, "prefix;Hello ")]}');
|
|
131
|
+
assert.equal(e({ text: "CxJS" }), "Hello CxJS");
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it("allows using dashes inside names", function () {
|
|
135
|
+
var e = Expression.compile("{framework-name}");
|
|
136
|
+
assert.equal(e({ "framework-name": "CxJS" }), "CxJS");
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it("allows using spaces and other characters inside names", function () {
|
|
140
|
+
var e = Expression.compile("{inv@lid js ident1fier}");
|
|
141
|
+
assert.equal(e({ "inv@lid js ident1fier": "CxJS" }), "CxJS");
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// it('are properly memoized with proxies', function () {
|
|
145
|
+
// let inv = 0;
|
|
146
|
+
// var e = Expression.get(d => { inv++; return d.a + d.b}).memoize();
|
|
147
|
+
//
|
|
148
|
+
// assert.equal(e({ a: 1, b: 1 }), 2);
|
|
149
|
+
// assert.equal(inv, 1);
|
|
150
|
+
//
|
|
151
|
+
// assert.equal(e({ a: 1, b: 1 }), 2);
|
|
152
|
+
// assert.equal(inv, 1);
|
|
153
|
+
//
|
|
154
|
+
// assert.equal(e({ a: 1, b: 2 }), 3);
|
|
155
|
+
// assert.equal(inv, 2);
|
|
156
|
+
//
|
|
157
|
+
// assert.equal(e({ a: 1, b: 2 }), 3);
|
|
158
|
+
// assert.equal(inv, 2);
|
|
159
|
+
//
|
|
160
|
+
// assert.equal(e({ a: 2, b: 2 }), 4);
|
|
161
|
+
// assert.equal(inv, 3);
|
|
162
|
+
// });
|
|
163
|
+
//
|
|
164
|
+
// it('are properly memoized with proxies and deep data', function () {
|
|
165
|
+
// let inv = 0;
|
|
166
|
+
// var e = Expression.get(d => { inv++; return d.v.a + d.v.b}).memoize();
|
|
167
|
+
//
|
|
168
|
+
// assert.equal(e({ v: { a: 1, b: 1 }}), 2);
|
|
169
|
+
// assert.equal(inv, 1);
|
|
170
|
+
//
|
|
171
|
+
// assert.equal(e({ v: { a: 1, b: 1 }}), 2);
|
|
172
|
+
// assert.equal(inv, 1);
|
|
173
|
+
//
|
|
174
|
+
// assert.equal(e({ v: { a: 1, b: 2 }}), 3);
|
|
175
|
+
// assert.equal(inv, 2);
|
|
176
|
+
//
|
|
177
|
+
// assert.equal(e({ v: { a: 1, b: 2 }}), 3);
|
|
178
|
+
// assert.equal(inv, 2);
|
|
179
|
+
//
|
|
180
|
+
// assert.equal(e({ v: { a: 2, b: 2 }}), 4);
|
|
181
|
+
// assert.equal(inv, 3);
|
|
182
|
+
// });
|
|
183
|
+
});
|
|
184
|
+
});
|
package/src/util/index.d.ts
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
export * from "./Console";
|
|
2
|
-
export * from "./Debug";
|
|
3
|
-
export * from "./DOM";
|
|
4
|
-
export * from "./Format";
|
|
5
|
-
export * from "./expandFatArrows";
|
|
6
|
-
export * from "./GlobalCacheIdentifier";
|
|
7
|
-
export * from "./innerTextTrim";
|
|
8
|
-
export * from "./isDigit";
|
|
9
|
-
export * from "./isPromise";
|
|
10
|
-
export * from "./isTouchDevice";
|
|
11
|
-
export * from "./KeyCode";
|
|
12
|
-
export * from "./parseStyle";
|
|
13
|
-
export * from "./quote";
|
|
14
|
-
export * from "./scrollElementIntoView";
|
|
15
|
-
export * from "./shallowEquals";
|
|
16
|
-
export * from "./Timing";
|
|
17
|
-
export * from "./date/index";
|
|
18
|
-
export * from "./color/index";
|
|
19
|
-
export * from "./getVendorPrefix";
|
|
20
|
-
export * from "./eventCallbacks";
|
|
21
|
-
export * from "./getSearchQueryPredicate";
|
|
22
|
-
export * from "./escapeSpecialRegexCharacters";
|
|
23
|
-
export * from "./browserSupportsPassiveEventHandlers";
|
|
24
|
-
export * from "./isTouchEvent";
|
|
25
|
-
export * from "./debounce";
|
|
26
|
-
export * from "./throttle";
|
|
27
|
-
export * from "./SubscriberList";
|
|
28
|
-
export * from "./findScrollableParent";
|
|
29
|
-
export * from "./getScrollerBoundingClientRect";
|
|
30
|
-
export * from "./isNonEmptyArray";
|
|
31
|
-
export * from "./isArray";
|
|
32
|
-
export * from "./isObject";
|
|
33
|
-
export * from "./isNumber";
|
|
34
|
-
export * from "./isFunction";
|
|
35
|
-
export * from "./isString";
|
|
36
|
-
export * from "./isUndefined";
|
|
37
|
-
export * from "./isDefined";
|
|
38
|
-
export * from "./routeAppend";
|
|
39
|
-
export * from "./reverseSlice";
|
|
40
|
-
export * from "./getTopLevelBoundingClientRect";
|
|
41
|
-
export * from "./getParentFrameBoundingClientRect";
|
|
42
|
-
export * from "./getActiveElement";
|
|
43
|
-
export * from "./Component";
|
|
44
|
-
export * from "./onIdleCallback";
|
|
45
|
-
export * from "./validatedDebounce";
|
|
46
|
-
export * from "./addEventListenerWithOptions";
|
|
47
|
-
export * from "./coalesce";
|
|
48
|
-
export * from "./dummyCallback";
|
|
49
|
-
export * from "./calculateNaturalElementHeight";
|
|
50
|
-
export * from "./isTextInputElement";
|
|
1
|
+
export * from "./Console";
|
|
2
|
+
export * from "./Debug";
|
|
3
|
+
export * from "./DOM";
|
|
4
|
+
export * from "./Format";
|
|
5
|
+
export * from "./expandFatArrows";
|
|
6
|
+
export * from "./GlobalCacheIdentifier";
|
|
7
|
+
export * from "./innerTextTrim";
|
|
8
|
+
export * from "./isDigit";
|
|
9
|
+
export * from "./isPromise";
|
|
10
|
+
export * from "./isTouchDevice";
|
|
11
|
+
export * from "./KeyCode";
|
|
12
|
+
export * from "./parseStyle";
|
|
13
|
+
export * from "./quote";
|
|
14
|
+
export * from "./scrollElementIntoView";
|
|
15
|
+
export * from "./shallowEquals";
|
|
16
|
+
export * from "./Timing";
|
|
17
|
+
export * from "./date/index";
|
|
18
|
+
export * from "./color/index";
|
|
19
|
+
export * from "./getVendorPrefix";
|
|
20
|
+
export * from "./eventCallbacks";
|
|
21
|
+
export * from "./getSearchQueryPredicate";
|
|
22
|
+
export * from "./escapeSpecialRegexCharacters";
|
|
23
|
+
export * from "./browserSupportsPassiveEventHandlers";
|
|
24
|
+
export * from "./isTouchEvent";
|
|
25
|
+
export * from "./debounce";
|
|
26
|
+
export * from "./throttle";
|
|
27
|
+
export * from "./SubscriberList";
|
|
28
|
+
export * from "./findScrollableParent";
|
|
29
|
+
export * from "./getScrollerBoundingClientRect";
|
|
30
|
+
export * from "./isNonEmptyArray";
|
|
31
|
+
export * from "./isArray";
|
|
32
|
+
export * from "./isObject";
|
|
33
|
+
export * from "./isNumber";
|
|
34
|
+
export * from "./isFunction";
|
|
35
|
+
export * from "./isString";
|
|
36
|
+
export * from "./isUndefined";
|
|
37
|
+
export * from "./isDefined";
|
|
38
|
+
export * from "./routeAppend";
|
|
39
|
+
export * from "./reverseSlice";
|
|
40
|
+
export * from "./getTopLevelBoundingClientRect";
|
|
41
|
+
export * from "./getParentFrameBoundingClientRect";
|
|
42
|
+
export * from "./getActiveElement";
|
|
43
|
+
export * from "./Component";
|
|
44
|
+
export * from "./onIdleCallback";
|
|
45
|
+
export * from "./validatedDebounce";
|
|
46
|
+
export * from "./addEventListenerWithOptions";
|
|
47
|
+
export * from "./coalesce";
|
|
48
|
+
export * from "./dummyCallback";
|
|
49
|
+
export * from "./calculateNaturalElementHeight";
|
|
50
|
+
export * from "./isTextInputElement";
|
|
51
|
+
export * from "./isValidIdentifierName";
|
package/src/util/index.js
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
export * from "./Console";
|
|
2
|
-
export * from "./Debug";
|
|
3
|
-
export * from "./DOM";
|
|
4
|
-
export * from "./Format";
|
|
5
|
-
export * from "./expandFatArrows";
|
|
6
|
-
export * from "./GlobalCacheIdentifier";
|
|
7
|
-
export * from "./innerTextTrim";
|
|
8
|
-
export * from "./isDigit";
|
|
9
|
-
export * from "./isPromise";
|
|
10
|
-
export * from "./isTouchDevice";
|
|
11
|
-
export * from "./KeyCode";
|
|
12
|
-
export * from "./parseStyle";
|
|
13
|
-
export * from "./quote";
|
|
14
|
-
export * from "./scrollElementIntoView";
|
|
15
|
-
export * from "./shallowEquals";
|
|
16
|
-
export * from "./Timing";
|
|
17
|
-
export * from "./date/index";
|
|
18
|
-
export * from "./color/index";
|
|
19
|
-
export * from "./getVendorPrefix";
|
|
20
|
-
export * from "./eventCallbacks";
|
|
21
|
-
export * from "./getSearchQueryPredicate";
|
|
22
|
-
export * from "./escapeSpecialRegexCharacters";
|
|
23
|
-
export * from "./browserSupportsPassiveEventHandlers";
|
|
24
|
-
export * from "./isTouchEvent";
|
|
25
|
-
export * from "./debounce";
|
|
26
|
-
export * from "./throttle";
|
|
27
|
-
export * from "./SubscriberList";
|
|
28
|
-
export * from "./findScrollableParent";
|
|
29
|
-
export * from "./getScrollerBoundingClientRect";
|
|
30
|
-
export * from "./isNonEmptyArray";
|
|
31
|
-
export * from "./isArray";
|
|
32
|
-
export * from "./isObject";
|
|
33
|
-
export * from "./isNumber";
|
|
34
|
-
export * from "./isFunction";
|
|
35
|
-
export * from "./isString";
|
|
36
|
-
export * from "./isUndefined";
|
|
37
|
-
export * from "./isDefined";
|
|
38
|
-
export * from "./routeAppend";
|
|
39
|
-
export * from "./reverseSlice";
|
|
40
|
-
export * from "./getTopLevelBoundingClientRect";
|
|
41
|
-
export * from "./getParentFrameBoundingClientRect";
|
|
42
|
-
export * from "./getActiveElement";
|
|
43
|
-
export * from "./Component";
|
|
44
|
-
export * from "./onIdleCallback";
|
|
45
|
-
export * from "./validatedDebounce";
|
|
46
|
-
export * from "./addEventListenerWithOptions";
|
|
47
|
-
export * from "./coalesce";
|
|
48
|
-
export * from "./dummyCallback";
|
|
49
|
-
export * from "./calculateNaturalElementHeight";
|
|
50
|
-
export * from "./isTextInputElement";
|
|
51
|
-
export * from "./capitalize";
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
export * from "./Console";
|
|
2
|
+
export * from "./Debug";
|
|
3
|
+
export * from "./DOM";
|
|
4
|
+
export * from "./Format";
|
|
5
|
+
export * from "./expandFatArrows";
|
|
6
|
+
export * from "./GlobalCacheIdentifier";
|
|
7
|
+
export * from "./innerTextTrim";
|
|
8
|
+
export * from "./isDigit";
|
|
9
|
+
export * from "./isPromise";
|
|
10
|
+
export * from "./isTouchDevice";
|
|
11
|
+
export * from "./KeyCode";
|
|
12
|
+
export * from "./parseStyle";
|
|
13
|
+
export * from "./quote";
|
|
14
|
+
export * from "./scrollElementIntoView";
|
|
15
|
+
export * from "./shallowEquals";
|
|
16
|
+
export * from "./Timing";
|
|
17
|
+
export * from "./date/index";
|
|
18
|
+
export * from "./color/index";
|
|
19
|
+
export * from "./getVendorPrefix";
|
|
20
|
+
export * from "./eventCallbacks";
|
|
21
|
+
export * from "./getSearchQueryPredicate";
|
|
22
|
+
export * from "./escapeSpecialRegexCharacters";
|
|
23
|
+
export * from "./browserSupportsPassiveEventHandlers";
|
|
24
|
+
export * from "./isTouchEvent";
|
|
25
|
+
export * from "./debounce";
|
|
26
|
+
export * from "./throttle";
|
|
27
|
+
export * from "./SubscriberList";
|
|
28
|
+
export * from "./findScrollableParent";
|
|
29
|
+
export * from "./getScrollerBoundingClientRect";
|
|
30
|
+
export * from "./isNonEmptyArray";
|
|
31
|
+
export * from "./isArray";
|
|
32
|
+
export * from "./isObject";
|
|
33
|
+
export * from "./isNumber";
|
|
34
|
+
export * from "./isFunction";
|
|
35
|
+
export * from "./isString";
|
|
36
|
+
export * from "./isUndefined";
|
|
37
|
+
export * from "./isDefined";
|
|
38
|
+
export * from "./routeAppend";
|
|
39
|
+
export * from "./reverseSlice";
|
|
40
|
+
export * from "./getTopLevelBoundingClientRect";
|
|
41
|
+
export * from "./getParentFrameBoundingClientRect";
|
|
42
|
+
export * from "./getActiveElement";
|
|
43
|
+
export * from "./Component";
|
|
44
|
+
export * from "./onIdleCallback";
|
|
45
|
+
export * from "./validatedDebounce";
|
|
46
|
+
export * from "./addEventListenerWithOptions";
|
|
47
|
+
export * from "./coalesce";
|
|
48
|
+
export * from "./dummyCallback";
|
|
49
|
+
export * from "./calculateNaturalElementHeight";
|
|
50
|
+
export * from "./isTextInputElement";
|
|
51
|
+
export * from "./capitalize";
|
|
52
|
+
export * from "./isValidIdentifierName";
|
|
53
|
+
|
|
54
|
+
export * from "./TraversalStack";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function isValidIdentifierName(name: string): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isValidIdentifierName } from "./isValidIdentifierName";
|
|
2
|
+
import assert from "assert";
|
|
3
|
+
|
|
4
|
+
describe("isValidIdentifierName", function () {
|
|
5
|
+
it("names starting with a number are not valid", function () {
|
|
6
|
+
assert(!isValidIdentifierName("1a"));
|
|
7
|
+
assert(!isValidIdentifierName("00"));
|
|
8
|
+
assert(!isValidIdentifierName("0_abc"));
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("names starting with a dollar sign are valid", function () {
|
|
12
|
+
assert(isValidIdentifierName("$a"));
|
|
13
|
+
assert(isValidIdentifierName("$"));
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("names starting with an underscore are valid", function () {
|
|
17
|
+
assert(isValidIdentifierName("_a"));
|
|
18
|
+
assert(isValidIdentifierName("_"));
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("names starting with a letter are valid", function () {
|
|
22
|
+
assert(isValidIdentifierName("a"));
|
|
23
|
+
assert(isValidIdentifierName("abc"));
|
|
24
|
+
assert(isValidIdentifierName("abc0123"));
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("names with invalid characters are not valid", function () {
|
|
28
|
+
assert(!isValidIdentifierName("a b"));
|
|
29
|
+
assert(!isValidIdentifierName("a-b"));
|
|
30
|
+
assert(!isValidIdentifierName("a.b"));
|
|
31
|
+
assert(!isValidIdentifierName("a!b"));
|
|
32
|
+
});
|
|
33
|
+
});
|