use-zod-default 1.0.10 → 1.0.12

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.
@@ -1,163 +0,0 @@
1
- "use strict";
2
- /* eslint-disable */
3
- var addSorting = (function () {
4
- 'use strict';
5
- var cols, currentSort = {
6
- index: 0,
7
- desc: false
8
- };
9
- // returns the summary table element
10
- function getTable() {
11
- return document.querySelector('.coverage-summary');
12
- }
13
- // returns the thead element of the summary table
14
- function getTableHeader() {
15
- return getTable().querySelector('thead tr');
16
- }
17
- // returns the tbody element of the summary table
18
- function getTableBody() {
19
- return getTable().querySelector('tbody');
20
- }
21
- // returns the th element for nth column
22
- function getNthColumn(n) {
23
- return getTableHeader().querySelectorAll('th')[n];
24
- }
25
- function onFilterInput() {
26
- const searchValue = document.getElementById('fileSearch').value;
27
- const rows = document.getElementsByTagName('tbody')[0].children;
28
- for (let i = 0; i < rows.length; i++) {
29
- const row = rows[i];
30
- if (row.textContent
31
- .toLowerCase()
32
- .includes(searchValue.toLowerCase())) {
33
- row.style.display = '';
34
- }
35
- else {
36
- row.style.display = 'none';
37
- }
38
- }
39
- }
40
- // loads the search box
41
- function addSearchBox() {
42
- var template = document.getElementById('filterTemplate');
43
- var templateClone = template.content.cloneNode(true);
44
- templateClone.getElementById('fileSearch').oninput = onFilterInput;
45
- template.parentElement.appendChild(templateClone);
46
- }
47
- // loads all columns
48
- function loadColumns() {
49
- var colNodes = getTableHeader().querySelectorAll('th'), colNode, cols = [], col, i;
50
- for (i = 0; i < colNodes.length; i += 1) {
51
- colNode = colNodes[i];
52
- col = {
53
- key: colNode.getAttribute('data-col'),
54
- sortable: !colNode.getAttribute('data-nosort'),
55
- type: colNode.getAttribute('data-type') || 'string'
56
- };
57
- cols.push(col);
58
- if (col.sortable) {
59
- col.defaultDescSort = col.type === 'number';
60
- colNode.innerHTML =
61
- colNode.innerHTML + '<span class="sorter"></span>';
62
- }
63
- }
64
- return cols;
65
- }
66
- // attaches a data attribute to every tr element with an object
67
- // of data values keyed by column name
68
- function loadRowData(tableRow) {
69
- var tableCols = tableRow.querySelectorAll('td'), colNode, col, data = {}, i, val;
70
- for (i = 0; i < tableCols.length; i += 1) {
71
- colNode = tableCols[i];
72
- col = cols[i];
73
- val = colNode.getAttribute('data-value');
74
- if (col.type === 'number') {
75
- val = Number(val);
76
- }
77
- data[col.key] = val;
78
- }
79
- return data;
80
- }
81
- // loads all row data
82
- function loadData() {
83
- var rows = getTableBody().querySelectorAll('tr'), i;
84
- for (i = 0; i < rows.length; i += 1) {
85
- rows[i].data = loadRowData(rows[i]);
86
- }
87
- }
88
- // sorts the table using the data for the ith column
89
- function sortByIndex(index, desc) {
90
- var key = cols[index].key, sorter = function (a, b) {
91
- a = a.data[key];
92
- b = b.data[key];
93
- return a < b ? -1 : a > b ? 1 : 0;
94
- }, finalSorter = sorter, tableBody = document.querySelector('.coverage-summary tbody'), rowNodes = tableBody.querySelectorAll('tr'), rows = [], i;
95
- if (desc) {
96
- finalSorter = function (a, b) {
97
- return -1 * sorter(a, b);
98
- };
99
- }
100
- for (i = 0; i < rowNodes.length; i += 1) {
101
- rows.push(rowNodes[i]);
102
- tableBody.removeChild(rowNodes[i]);
103
- }
104
- rows.sort(finalSorter);
105
- for (i = 0; i < rows.length; i += 1) {
106
- tableBody.appendChild(rows[i]);
107
- }
108
- }
109
- // removes sort indicators for current column being sorted
110
- function removeSortIndicators() {
111
- var col = getNthColumn(currentSort.index), cls = col.className;
112
- cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
113
- col.className = cls;
114
- }
115
- // adds sort indicators for current column being sorted
116
- function addSortIndicators() {
117
- getNthColumn(currentSort.index).className += currentSort.desc
118
- ? ' sorted-desc'
119
- : ' sorted';
120
- }
121
- // adds event listeners for all sorter widgets
122
- function enableUI() {
123
- var i, el, ithSorter = function ithSorter(i) {
124
- var col = cols[i];
125
- return function () {
126
- var desc = col.defaultDescSort;
127
- if (currentSort.index === i) {
128
- desc = !currentSort.desc;
129
- }
130
- sortByIndex(i, desc);
131
- removeSortIndicators();
132
- currentSort.index = i;
133
- currentSort.desc = desc;
134
- addSortIndicators();
135
- };
136
- };
137
- for (i = 0; i < cols.length; i += 1) {
138
- if (cols[i].sortable) {
139
- // add the click event handler on the th so users
140
- // dont have to click on those tiny arrows
141
- el = getNthColumn(i).querySelector('.sorter').parentElement;
142
- if (el.addEventListener) {
143
- el.addEventListener('click', ithSorter(i));
144
- }
145
- else {
146
- el.attachEvent('onclick', ithSorter(i));
147
- }
148
- }
149
- }
150
- }
151
- // adds sorting functionality to the UI
152
- return function () {
153
- if (!getTable()) {
154
- return;
155
- }
156
- cols = loadColumns();
157
- loadData();
158
- addSearchBox();
159
- addSortIndicators();
160
- enableUI();
161
- };
162
- })();
163
- window.addEventListener('load', addSorting);
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
@@ -1,10 +0,0 @@
1
- import { defineConfig } from 'vitest/config';
2
- export default defineConfig({
3
- test: {
4
- coverage: {
5
- provider: 'v8',
6
- reporter: ['text', 'html'],
7
- exclude: ['dist', '**/*.spec.ts', 'vitest.config.mts']
8
- }
9
- }
10
- });