@tko/utils 4.0.0-beta1.0 → 4.0.0

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.
Files changed (55) hide show
  1. package/dist/array.js +39 -35
  2. package/dist/array.js.map +2 -2
  3. package/dist/async.js +4 -3
  4. package/dist/async.js.map +2 -2
  5. package/dist/css.js +5 -4
  6. package/dist/css.js.map +2 -2
  7. package/dist/dom/data.js +36 -46
  8. package/dist/dom/data.js.map +2 -2
  9. package/dist/dom/disposal.js +23 -16
  10. package/dist/dom/disposal.js.map +2 -2
  11. package/dist/dom/event.js +39 -41
  12. package/dist/dom/event.js.map +2 -2
  13. package/dist/dom/fixes.js +5 -24
  14. package/dist/dom/fixes.js.map +2 -2
  15. package/dist/dom/html.js +46 -61
  16. package/dist/dom/html.js.map +2 -2
  17. package/dist/dom/info.js +10 -8
  18. package/dist/dom/info.js.map +2 -2
  19. package/dist/dom/manipulation.js +16 -24
  20. package/dist/dom/manipulation.js.map +2 -2
  21. package/dist/dom/selectExtensions.js +33 -23
  22. package/dist/dom/selectExtensions.js.map +2 -2
  23. package/dist/dom/virtualElements.js +40 -32
  24. package/dist/dom/virtualElements.js.map +3 -3
  25. package/dist/error.js +2 -1
  26. package/dist/error.js.map +2 -2
  27. package/dist/function.js +2 -1
  28. package/dist/function.js.map +2 -2
  29. package/dist/index.cjs +446 -449
  30. package/dist/index.cjs.map +4 -4
  31. package/dist/index.js +2 -3
  32. package/dist/index.js.map +2 -2
  33. package/dist/index.mjs +2 -3
  34. package/dist/index.mjs.map +2 -2
  35. package/dist/memoization.js +18 -13
  36. package/dist/memoization.js.map +3 -3
  37. package/dist/object.js +10 -8
  38. package/dist/object.js.map +2 -2
  39. package/dist/options.js +97 -35
  40. package/dist/options.js.map +2 -2
  41. package/dist/string.js +3 -5
  42. package/dist/string.js.map +2 -2
  43. package/dist/symbol.js +3 -2
  44. package/dist/symbol.js.map +2 -2
  45. package/dist/tasks.js +10 -20
  46. package/dist/tasks.js.map +2 -2
  47. package/helpers/jasmine-13-helper.ts +198 -147
  48. package/package.json +2 -3
  49. package/LICENSE +0 -22
  50. package/dist/bind-shim.js +0 -18
  51. package/dist/bind-shim.js.map +0 -7
  52. package/dist/ie.js +0 -15
  53. package/dist/ie.js.map +0 -7
  54. package/dist/jquery.js +0 -6
  55. package/dist/jquery.js.map +0 -7
@@ -1,207 +1,258 @@
1
+ /// <reference types="jasmine" />
2
+
3
+ import jQuery from 'jquery'
4
+ window.jQuery = jQuery
5
+
1
6
  /*
2
7
  * Configure the Jasmine testing framework.
3
8
  */
4
- /* globals runs, waitsFor, jasmine */
5
-
6
- import {
7
- arrayMap, arrayFilter, ieVersion, selectExtensions, hasOwnProperty
8
- } from '../dist/'
9
+ /* globals runs, waitsFor, jasmine */
9
10
 
11
+ import { arrayMap, arrayFilter, selectExtensions, hasOwnProperty, options } from '../dist/'
10
12
 
11
- window.DEBUG = true;
12
- window.amdRequire = window.require;
13
+ window.DEBUG = true
14
+ window.amdRequire = window.require
13
15
 
14
- // Use a different variable name (not 'jQuery') to avoid overwriting
15
- // window.jQuery with 'undefined' on IE < 9
16
- window.jQueryInstance = window.jQuery;
17
-
18
- // export var testNode;
19
- jasmine.updateInterval = 500;
16
+ jasmine.updateInterval = 500
20
17
 
21
18
  /*
22
19
  Some helper functions for jasmine on the browser
23
20
  */
24
- jasmine.resolve = function (promise) {
21
+ jasmine.resolve = function (promise: Promise<boolean>) {
25
22
  let complete = false
26
- runs(() => promise.then((result) => { complete = result || true }))
23
+ runs(() =>
24
+ promise.then(result => {
25
+ complete = result || true
26
+ })
27
+ )
27
28
  waitsFor(() => complete)
28
29
  }
29
30
 
30
- jasmine.prepareTestNode = function() {
31
- // The bindings specs make frequent use of this utility function to set up
32
- // a clean new DOM node they can execute code against
33
- var existingNode = document.getElementById("testNode");
34
- if (existingNode !== null)
35
- existingNode.parentNode.removeChild(existingNode);
36
- window.testNode = document.createElement("div");
37
- window.testNode.id = "testNode";
38
- document.body.appendChild(window.testNode);
39
- };
31
+ jasmine.prepareTestNode = function (): HTMLElement {
32
+ // The bindings specs make frequent use of this utility function to set up
33
+ // a clean new DOM node they can execute code against
34
+ const existingNode = document.getElementById('testNode')
35
+ if (existingNode !== null && existingNode.parentNode) existingNode.parentNode.removeChild(existingNode)
36
+ const testNode = document.createElement('div')
37
+ testNode.id = 'testNode'
38
+ document.body.appendChild(testNode)
40
39
 
41
- jasmine.Clock.mockScheduler = function (callback) {
42
- setTimeout(callback, 0);
43
- };
40
+ return testNode
41
+ }
44
42
 
43
+ jasmine.Clock.mockScheduler = function (callback) {
44
+ setTimeout(callback, 0)
45
+ }
45
46
 
46
47
  export function useMockForTasks(options) {
47
- jasmine.Clock.useMock();
48
+ jasmine.Clock.useMock()
48
49
 
49
- // Make sure tasks is using setTimeout so that it uses the mock clock
50
- if (options.taskScheduler != jasmine.Clock.mockScheduler) {
51
- jasmine.getEnv().currentSpec.restoreAfter(options, 'taskScheduler');
52
- options.taskScheduler = jasmine.Clock.mockScheduler;
53
- }
50
+ // Make sure tasks is using setTimeout so that it uses the mock clock
51
+ if (options.taskScheduler != jasmine.Clock.mockScheduler) {
52
+ jasmine.getEnv().currentSpec.restoreAfter(options, 'taskScheduler')
53
+ options.taskScheduler = jasmine.Clock.mockScheduler
54
+ }
55
+ }
56
+
57
+ jasmine.Spec.prototype.restoreAfter = function (object, propertyName) {
58
+ const originalValue = object[propertyName]
59
+ this.after(function () {
60
+ object[propertyName] = originalValue
61
+ })
54
62
  }
55
63
 
56
- jasmine.Spec.prototype.restoreAfter = function(object, propertyName) {
57
- var originalValue = object[propertyName];
58
- this.after(function() {
59
- object[propertyName] = originalValue;
60
- });
61
- };
64
+ jasmine.nodeText = function (node) {
65
+ return node.nodeType === Node.TEXT_NODE ? node.data : 'textContent' in node ? node.textContent : node.innerText
66
+ }
62
67
 
63
- jasmine.nodeText = function(node) {
64
- return node.nodeType == 3 ? node.data : 'textContent' in node ? node.textContent : node.innerText;
65
- };
68
+ jasmine.browserSupportsProtoAssignment = { __proto__: [] } instanceof Array
66
69
 
67
- jasmine.browserSupportsProtoAssignment = { __proto__: [] } instanceof Array;
70
+ jasmine.setNodeText = function (node, text: string) {
71
+ if ('textContent' in node) {
72
+ node.textContent = text
73
+ } else {
74
+ node.innerText = text
75
+ }
76
+ }
68
77
 
78
+ function cleanedHtml(node) {
79
+ let cleanedHtml = node.innerHTML.toLowerCase().replace(/\r\n/g, '')
80
+ // IE < 9 strips whitespace immediately following comment nodes. Normalize by doing the same on all browsers.
81
+ cleanedHtml = cleanedHtml.replace(/(<!--.*?-->)\s*/g, '$1')
82
+ // Also remove __ko__ expando properties (for DOM data) - most browsers hide these anyway but IE < 9 includes them in innerHTML
83
+ cleanedHtml = cleanedHtml.replace(/ __ko__\d+=\"(ko\d+|null)\"/g, '')
84
+ return cleanedHtml
85
+ }
69
86
 
70
- jasmine.ieVersion = ieVersion;
71
87
  /*
72
88
  Custom Matchers
73
89
  ~~~~~~~~~~~~~~~
74
90
  */
75
- var matchers = {
91
+ const matchers = {
92
+ toHaveNodeTypes(expectedTypes) {
93
+ const values = arrayMap(this.actual, function (node) {
94
+ return node.nodeType
95
+ })
96
+ this.actual = values // Fix explanatory message
97
+ return this.env.equals_(values, expectedTypes)
98
+ },
76
99
 
77
- toContainText (expectedText, ignoreSpaces) {
78
- if (ignoreSpaces) {
79
- expectedText = expectedText.replace(/\s/g, "");
80
- }
100
+ toContainHtmlElementsAndText(expectedHtml) {
101
+ this.actual = cleanedHtml(this.actual).replace(/<!--.+?-->/g, '') // remove comments
102
+ return this.actual === expectedHtml
103
+ },
81
104
 
82
- var actualText = jasmine.nodeText(this.actual);
83
- var cleanedActualText = actualText.replace(/\r\n/g, "\n");
84
- if (ignoreSpaces) {
85
- cleanedActualText = cleanedActualText.replace(/\s/g, "");
86
- }
105
+ toContainText(expectedText, ignoreSpaces) {
106
+ if (ignoreSpaces) {
107
+ expectedText = expectedText.replace(/\s/g, '')
108
+ }
87
109
 
88
- this.actual = cleanedActualText; // Fix explanatory message
89
- return cleanedActualText === expectedText;
110
+ const actualText = jasmine.nodeText(this.actual)
111
+ let cleanedActualText = actualText.replace(/\r\n/g, '\n')
112
+ if (ignoreSpaces) {
113
+ cleanedActualText = cleanedActualText.replace(/\s/g, '')
114
+ }
115
+
116
+ this.actual = cleanedActualText // Fix explanatory message
117
+ return cleanedActualText === expectedText
90
118
  },
91
119
 
92
- toHaveOwnProperties (expectedProperties) {
93
- var ownProperties = [];
94
- for (var prop in this.actual) {
95
- if (hasOwnProperty(this.actual, prop)) {
96
- ownProperties.push(prop);
97
- }
120
+ toHaveOwnProperties(expectedProperties) {
121
+ const ownProperties = new Array()
122
+ for (const prop in this.actual) {
123
+ if (hasOwnProperty(this.actual, prop)) {
124
+ ownProperties.push(prop)
98
125
  }
99
- return this.env.equals_(ownProperties, expectedProperties);
126
+ }
127
+ return this.env.equals_(ownProperties, expectedProperties)
100
128
  },
101
129
 
102
- toHaveTexts (expectedTexts) {
103
- var texts = arrayMap(this.actual.childNodes, jasmine.nodeText);
104
- this.actual = texts; // Fix explanatory message
105
- return this.env.equals_(texts, expectedTexts);
130
+ toHaveTexts(expectedTexts) {
131
+ const texts = arrayMap(this.actual.childNodes, jasmine.nodeText)
132
+ this.actual = texts // Fix explanatory message
133
+ return this.env.equals_(texts, expectedTexts)
106
134
  },
107
135
 
108
- toHaveValues (expectedValues) {
109
- var values = arrayFilter(
110
- arrayMap(this.actual.childNodes, node => node.value),
111
- value => value !== undefined)
112
- this.actual = values // Fix explanatory message
113
- return this.env.equals_(values, expectedValues)
136
+ toHaveValues(expectedValues) {
137
+ const values = arrayFilter(
138
+ arrayMap(this.actual.childNodes, node => node.value),
139
+ value => value !== undefined
140
+ )
141
+ this.actual = values // Fix explanatory message
142
+ return this.env.equals_(values, expectedValues)
114
143
  },
115
144
 
116
-
117
- toHaveCheckedStates (expectedValues) {
118
- const values = arrayMap(this.actual.childNodes, (node) => node.checked)
119
- this.actual = values; // Fix explanatory message
120
- return this.env.equals_(values, expectedValues)
145
+ toHaveCheckedStates(expectedValues) {
146
+ const values = arrayMap(this.actual.childNodes, node => node.checked)
147
+ this.actual = values // Fix explanatory message
148
+ return this.env.equals_(values, expectedValues)
121
149
  },
122
150
 
123
151
  toThrowContaining(expected) {
124
- var exception;
125
- try {
126
- this.actual();
127
- } catch (e) {
128
- exception = e;
129
- }
130
- var exceptionMessage = exception && (exception.message || exception);
131
-
132
- this.message = function () {
133
- var notText = this.isNot ? " not" : "";
134
- var expectation = "Expected " + this.actual.toString() + notText + " to throw exception containing '" + expected + "'";
135
- var result = exception ? (", but it threw '" + exceptionMessage + "'") : ", but it did not throw anything";
136
- return expectation + result;
137
- };
152
+ let exception
153
+ try {
154
+ this.actual()
155
+ } catch (e) {
156
+ exception = e
157
+ }
158
+ const exceptionMessage = exception && (exception.message || exception)
159
+
160
+ this.message = function () {
161
+ const notText = this.isNot ? ' not' : ''
162
+ const expectation =
163
+ 'Expected ' + this.actual.toString() + notText + " to throw exception containing '" + expected + "'"
164
+ const result = exception ? ", but it threw '" + exceptionMessage + "'" : ', but it did not throw anything'
165
+ return expectation + result
166
+ }
138
167
 
139
- return exception ? this.env.contains_(exceptionMessage, expected) : false;
168
+ return exception ? this.env.contains_(exceptionMessage, expected) : false
140
169
  },
141
170
 
142
- toEqualOneOf (expectedPossibilities) {
143
- for (var i = 0; i < expectedPossibilities.length; i++) {
144
- if (this.env.equals_(this.actual, expectedPossibilities[i])) {
145
- return true;
146
- }
171
+ toEqualOneOf(expectedPossibilities) {
172
+ for (let i = 0; i < expectedPossibilities.length; i++) {
173
+ if (this.env.equals_(this.actual, expectedPossibilities[i])) {
174
+ return true
147
175
  }
148
- return false;
176
+ }
177
+ return false
149
178
  },
150
179
 
151
- toContainHtml (expectedHtml, postProcessCleanedHtml) {
152
- var cleanedHtml = this.actual.innerHTML.toLowerCase().replace(/\r\n/g, "");
153
- // IE < 9 strips whitespace immediately following comment nodes. Normalize by doing the same on all browsers.
154
- cleanedHtml = cleanedHtml.replace(/(<!--.*?-->)\s*/g, "$1");
155
- expectedHtml = expectedHtml.replace(/(<!--.*?-->)\s*/g, "$1");
156
- // Also remove __ko__ expando properties (for DOM data) - most browsers hide these anyway but IE < 9 includes them in innerHTML
157
- cleanedHtml = cleanedHtml.replace(/ __ko__\d+=\"(ko\d+|null)\"/g, "");
158
- if (postProcessCleanedHtml) {
159
- cleanedHtml = postProcessCleanedHtml(cleanedHtml);
160
- }
161
- this.actual = cleanedHtml; // Fix explanatory message
162
- return cleanedHtml === expectedHtml;
180
+ toContainHtml(expectedHtml, postProcessCleanedHtml) {
181
+ let cleanedHtml = this.actual.innerHTML.toLowerCase().replace(/\r\n/g, '')
182
+ // IE < 9 strips whitespace immediately following comment nodes. Normalize by doing the same on all browsers.
183
+ cleanedHtml = cleanedHtml.replace(/(<!--.*?-->)\s*/g, '$1')
184
+ expectedHtml = expectedHtml.replace(/(<!--.*?-->)\s*/g, '$1')
185
+ // Also remove __ko__ expando properties (for DOM data) - most browsers hide these anyway but IE < 9 includes them in innerHTML
186
+ cleanedHtml = cleanedHtml.replace(/ __ko__\d+=\"(ko\d+|null)\"/g, '')
187
+ if (postProcessCleanedHtml) {
188
+ cleanedHtml = postProcessCleanedHtml(cleanedHtml)
189
+ }
190
+ this.actual = cleanedHtml // Fix explanatory message
191
+ return cleanedHtml === expectedHtml
192
+ },
193
+
194
+ toHaveSelectedValues(expectedValues) {
195
+ const selectedNodes = arrayFilter(this.actual.childNodes, node => node.selected)
196
+ const selectedValues = arrayMap(selectedNodes, node => selectExtensions.readValue(node))
197
+ this.actual = selectedValues // Fix explanatory message
198
+ return this.env.equals_(selectedValues, expectedValues)
163
199
  }
164
200
  }
165
201
 
166
202
  //
167
203
  // bmh: Monkeypatch so we can catch errors in asynchronous functions.
168
204
  //
169
- jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
170
- var scheduledFunc;
171
- var funcsToRun = [];
172
- for (var timeoutKey in this.scheduledFunctions) {
173
- scheduledFunc = this.scheduledFunctions[timeoutKey];
174
- if (scheduledFunc != jasmine.undefined &&
175
- scheduledFunc.runAtMillis >= oldMillis &&
176
- scheduledFunc.runAtMillis <= nowMillis) {
177
- funcsToRun.push(scheduledFunc);
178
- this.scheduledFunctions[timeoutKey] = jasmine.undefined;
179
- }
205
+ jasmine.FakeTimer.prototype.runFunctionsWithinRange = function (oldMillis, nowMillis) {
206
+ let scheduledFunc
207
+ const funcsToRun = new Array()
208
+ for (const timeoutKey in this.scheduledFunctions) {
209
+ scheduledFunc = this.scheduledFunctions[timeoutKey]
210
+ if (
211
+ scheduledFunc != jasmine.undefined
212
+ && scheduledFunc.runAtMillis >= oldMillis
213
+ && scheduledFunc.runAtMillis <= nowMillis
214
+ ) {
215
+ funcsToRun.push(scheduledFunc)
216
+ this.scheduledFunctions[timeoutKey] = jasmine.undefined
180
217
  }
218
+ }
181
219
 
182
- if (funcsToRun.length > 0) {
183
- funcsToRun.sort(function(a, b) {
184
- return a.runAtMillis - b.runAtMillis;
185
- });
186
-
187
- for (var i = 0; i < funcsToRun.length; ++i) {
188
- //try { // mbest: Removed so we can catch errors in asynchronous functions
189
- var funcToRun = funcsToRun[i];
190
- this.nowMillis = funcToRun.runAtMillis;
191
- funcToRun.funcToCall();
192
- if (funcToRun.recurring) {
193
- this.scheduleFunction(funcToRun.timeoutKey,
194
- funcToRun.funcToCall,
195
- funcToRun.millis,
196
- true);
197
- }
198
- //} catch(e) {
199
- //}
200
- }
201
- this.runFunctionsWithinRange(oldMillis, nowMillis);
220
+ if (funcsToRun.length > 0) {
221
+ funcsToRun.sort(function (a: any, b: any) {
222
+ return a.runAtMillis - b.runAtMillis
223
+ })
224
+
225
+ for (let i = 0; i < funcsToRun.length; ++i) {
226
+ //try { // mbest: Removed so we can catch errors in asynchronous functions
227
+ const funcToRun = funcsToRun[i]
228
+ this.nowMillis = funcToRun.runAtMillis
229
+ funcToRun.funcToCall()
230
+ if (funcToRun.recurring) {
231
+ this.scheduleFunction(funcToRun.timeoutKey, funcToRun.funcToCall, funcToRun.millis, true)
232
+ }
233
+ //} catch(e) {
234
+ //}
202
235
  }
203
- };
236
+ this.runFunctionsWithinRange(oldMillis, nowMillis)
237
+ }
238
+ }
204
239
 
205
- beforeEach(function() {
206
- this.addMatchers(matchers);
207
- });
240
+ beforeEach(function () {
241
+ this.addMatchers(matchers)
242
+
243
+ switchJQueryState()
244
+ })
245
+
246
+ afterEach(function () {
247
+ expect(disableJQueryUsage).toEqual(options.disableJQueryUsage)
248
+ })
249
+
250
+ const KARMA_STRING = '__karma__'
251
+ let disableJQueryUsage = true
252
+ function switchJQueryState() {
253
+ if (window[KARMA_STRING] && window[KARMA_STRING].config.args.includes('--noJQuery')) {
254
+ options.disableJQueryUsage = disableJQueryUsage = true
255
+ } else {
256
+ options.disableJQueryUsage = disableJQueryUsage = false
257
+ }
258
+ }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.0-beta1.0",
2
+ "version": "4.0.0",
3
3
  "name": "@tko/utils",
4
4
  "description": "TKO Utilities",
5
5
  "type": "module",
@@ -42,6 +42,5 @@
42
42
  "import": "./dist/index.js"
43
43
  },
44
44
  "./helpers/*": "./helpers/*"
45
- },
46
- "gitHead": "99114c4deded3fc5dbddd5c7c9c63c845a18263b"
45
+ }
47
46
  }
package/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- The MIT License (MIT) - http://www.opensource.org/licenses/mit-license.php
2
-
3
- Copyright (c) Steven Sanderson, the Knockout.js team, and other contributors
4
- http://knockoutjs.com/
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in
14
- all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- THE SOFTWARE.
package/dist/bind-shim.js DELETED
@@ -1,18 +0,0 @@
1
- // @tko/utils 🥊 4.0.0-beta1.0 ESM
2
- if (!Function.prototype["bind"]) {
3
- Function.prototype["bind"] = function(object) {
4
- var originalFunction = this;
5
- if (arguments.length === 1) {
6
- return function() {
7
- return originalFunction.apply(object, arguments);
8
- };
9
- } else {
10
- var partialArgs = Array.prototype.slice.call(arguments, 1);
11
- return function() {
12
- var args = partialArgs.slice(0);
13
- args.push.apply(args, arguments);
14
- return originalFunction.apply(object, args);
15
- };
16
- }
17
- };
18
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/bind-shim.ts"],
4
- "sourcesContent": ["\nif (!Function.prototype['bind']) {\n // Shim/polyfill JavaScript Function.bind.\n // This implementation is based on the one in prototype.js\n Function.prototype['bind'] = function (object) {\n var originalFunction = this\n if (arguments.length === 1) {\n return function () {\n return originalFunction.apply(object, arguments)\n }\n } else {\n var partialArgs = Array.prototype.slice.call(arguments, 1)\n return function () {\n var args = partialArgs.slice(0)\n args.push.apply(args, arguments)\n return originalFunction.apply(object, args)\n }\n }\n }\n}\n"],
5
- "mappings": ";AACA,IAAI,CAAC,SAAS,UAAU,SAAS;AAG/B,WAAS,UAAU,UAAU,SAAU,QAAQ;AAC7C,QAAI,mBAAmB;AACvB,QAAI,UAAU,WAAW,GAAG;AAC1B,aAAO,WAAY;AACjB,eAAO,iBAAiB,MAAM,QAAQ,SAAS;AAAA,MACjD;AAAA,IACF,OAAO;AACL,UAAI,cAAc,MAAM,UAAU,MAAM,KAAK,WAAW,CAAC;AACzD,aAAO,WAAY;AACjB,YAAI,OAAO,YAAY,MAAM,CAAC;AAC9B,aAAK,KAAK,MAAM,MAAM,SAAS;AAC/B,eAAO,iBAAiB,MAAM,QAAQ,IAAI;AAAA,MAC5C;AAAA,IACF;AAAA,EACF;AACF;",
6
- "names": []
7
- }
package/dist/ie.js DELETED
@@ -1,15 +0,0 @@
1
- // @tko/utils 🥊 4.0.0-beta1.0 ESM
2
- import options from "./options";
3
- const ieVersion = options.document && function() {
4
- var version = 3, div = options.document.createElement("div"), iElems = div.getElementsByTagName("i");
5
- while (div.innerHTML = "<!--[if gt IE " + ++version + "]><i></i><![endif]-->", iElems[0]) {
6
- }
7
- if (!version) {
8
- const userAgent = window.navigator.userAgent;
9
- return ua.match(/MSIE ([^ ]+)/) || ua.match(/rv:([^ )]+)/);
10
- }
11
- return version > 4 ? version : void 0;
12
- }();
13
- const isIe6 = ieVersion === 6;
14
- const isIe7 = ieVersion === 7;
15
- export { ieVersion, isIe6, isIe7 };
package/dist/ie.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/ie.ts"],
4
- "sourcesContent": ["//\n// Detection and Workarounds for Internet Explorer\n//\nimport options from './options'\n\nconst ieVersion = options.document && (function () {\n var version = 3, div = options.document.createElement('div'), iElems = div.getElementsByTagName('i')\n\n // Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment\n while (\n div.innerHTML = '<!--[if gt IE ' + (++version) + ']><i></i><![endif]-->',\n iElems[0]\n ) {}\n\n if (!version) {\n const userAgent = window.navigator.userAgent\n // Detect IE 10/11\n return ua.match(/MSIE ([^ ]+)/) || ua.match(/rv:([^ )]+)/)\n }\n return version > 4 ? version : undefined\n}())\n\nconst isIe6 = ieVersion === 6\nconst isIe7 = ieVersion === 7\n\nexport { ieVersion, isIe6, isIe7 }\n"],
5
- "mappings": ";AAGA;AAEA,MAAM,YAAY,QAAQ,YAAa,WAAY;AACjD,MAAI,UAAU,GAAG,MAAM,QAAQ,SAAS,cAAc,KAAK,GAAG,SAAS,IAAI,qBAAqB,GAAG;AAGnG,SACM,IAAI,YAAY,mBAAoB,EAAE,UAAW,yBACjD,OAAO,IACT;AAAA,EAAC;AAEL,MAAI,CAAC,SAAS;AACZ,UAAM,YAAY,OAAO,UAAU;AAEnC,WAAO,GAAG,MAAM,cAAc,KAAK,GAAG,MAAM,aAAa;AAAA,EAC3D;AACA,SAAO,UAAU,IAAI,UAAU;AACjC,EAAE;AAEF,MAAM,QAAQ,cAAc;AAC5B,MAAM,QAAQ,cAAc;AAE5B;",
6
- "names": []
7
- }
package/dist/jquery.js DELETED
@@ -1,6 +0,0 @@
1
- // @tko/utils 🥊 4.0.0-beta1.0 ESM
2
- import options from "./options";
3
- export var jQueryInstance = options.global && options.global.jQuery;
4
- export function jQuerySetInstance(jquery) {
5
- options.jQuery = jQueryInstance = jquery;
6
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/jquery.ts"],
4
- "sourcesContent": ["//\n// jQuery\n//\n// TODO: deprecate in favour of options.$\n\nimport options from './options'\n\nexport var jQueryInstance = options.global && options.global.jQuery\n\nexport function jQuerySetInstance (jquery) {\n options.jQuery = jQueryInstance = jquery\n}\n"],
5
- "mappings": ";AAKA;AAEO,WAAI,iBAAiB,QAAQ,UAAU,QAAQ,OAAO;AAEtD,kCAA4B,QAAQ;AACzC,UAAQ,SAAS,iBAAiB;AACpC;",
6
- "names": []
7
- }