@gapi/ac 1.8.168 → 1.8.170
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/coverage/block-navigation.js +9 -1
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +8 -3
- package/coverage/index.ts.html +8 -3
- package/coverage/lcov-report/block-navigation.js +9 -1
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +8 -3
- package/coverage/lcov-report/index.ts.html +8 -3
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +40 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +40 -0
- package/dist/index.js +22 -20
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +4 -4
- package/eslint.config.mjs +38 -0
- package/package.json +12 -12
- package/src/types.ts +1 -1
- package/test/main.spec.ts +1 -0
- package/.eslintrc.js +0 -27
|
@@ -9,7 +9,7 @@ var jumpToCode = (function init() {
|
|
|
9
9
|
// We don't want to select elements that are direct descendants of another match
|
|
10
10
|
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
|
|
11
11
|
|
|
12
|
-
//
|
|
12
|
+
// Selector that finds elements on the page to which we can jump
|
|
13
13
|
var selector =
|
|
14
14
|
fileListingElements.join(', ') +
|
|
15
15
|
', ' +
|
|
@@ -63,6 +63,14 @@ var jumpToCode = (function init() {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
return function jump(event) {
|
|
66
|
+
if (
|
|
67
|
+
document.getElementById('fileSearch') === document.activeElement &&
|
|
68
|
+
document.activeElement != null
|
|
69
|
+
) {
|
|
70
|
+
// if we're currently focused on the search input, we don't want to navigate
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
switch (event.which) {
|
|
67
75
|
case 78: // n
|
|
68
76
|
case 74: // j
|
package/coverage/favicon.png
CHANGED
|
Binary file
|
package/coverage/index.html
CHANGED
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line medium'></div>
|
|
59
65
|
<div class="pad1">
|
|
@@ -94,10 +100,9 @@
|
|
|
94
100
|
</div><!-- /wrapper -->
|
|
95
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
96
102
|
Code coverage generated by
|
|
97
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
98
|
-
at
|
|
103
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
+
at 2025-12-23T14:26:32.245Z
|
|
99
105
|
</div>
|
|
100
|
-
</div>
|
|
101
106
|
<script src="prettify.js"></script>
|
|
102
107
|
<script>
|
|
103
108
|
window.onload = function () {
|
package/coverage/index.ts.html
CHANGED
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line medium'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -309,10 +315,9 @@ export * from './types';
|
|
|
309
315
|
</div><!-- /wrapper -->
|
|
310
316
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
311
317
|
Code coverage generated by
|
|
312
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
313
|
-
at
|
|
318
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
319
|
+
at 2025-12-23T14:26:32.245Z
|
|
314
320
|
</div>
|
|
315
|
-
</div>
|
|
316
321
|
<script src="prettify.js"></script>
|
|
317
322
|
<script>
|
|
318
323
|
window.onload = function () {
|
|
@@ -9,7 +9,7 @@ var jumpToCode = (function init() {
|
|
|
9
9
|
// We don't want to select elements that are direct descendants of another match
|
|
10
10
|
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
|
|
11
11
|
|
|
12
|
-
//
|
|
12
|
+
// Selector that finds elements on the page to which we can jump
|
|
13
13
|
var selector =
|
|
14
14
|
fileListingElements.join(', ') +
|
|
15
15
|
', ' +
|
|
@@ -63,6 +63,14 @@ var jumpToCode = (function init() {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
return function jump(event) {
|
|
66
|
+
if (
|
|
67
|
+
document.getElementById('fileSearch') === document.activeElement &&
|
|
68
|
+
document.activeElement != null
|
|
69
|
+
) {
|
|
70
|
+
// if we're currently focused on the search input, we don't want to navigate
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
switch (event.which) {
|
|
67
75
|
case 78: // n
|
|
68
76
|
case 74: // j
|
|
Binary file
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line medium'></div>
|
|
59
65
|
<div class="pad1">
|
|
@@ -94,10 +100,9 @@
|
|
|
94
100
|
</div><!-- /wrapper -->
|
|
95
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
96
102
|
Code coverage generated by
|
|
97
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
98
|
-
at
|
|
103
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
+
at 2025-12-23T14:26:32.236Z
|
|
99
105
|
</div>
|
|
100
|
-
</div>
|
|
101
106
|
<script src="prettify.js"></script>
|
|
102
107
|
<script>
|
|
103
108
|
window.onload = function () {
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line medium'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -309,10 +315,9 @@ export * from './types';
|
|
|
309
315
|
</div><!-- /wrapper -->
|
|
310
316
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
311
317
|
Code coverage generated by
|
|
312
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
313
|
-
at
|
|
318
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
319
|
+
at 2025-12-23T14:26:32.236Z
|
|
314
320
|
</div>
|
|
315
|
-
</div>
|
|
316
321
|
<script src="prettify.js"></script>
|
|
317
322
|
<script>
|
|
318
323
|
window.onload = function () {
|
|
Binary file
|
|
@@ -24,6 +24,45 @@ var addSorting = (function() {
|
|
|
24
24
|
return getTableHeader().querySelectorAll('th')[n];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
function onFilterInput() {
|
|
28
|
+
const searchValue = document.getElementById('fileSearch').value;
|
|
29
|
+
const rows = document.getElementsByTagName('tbody')[0].children;
|
|
30
|
+
|
|
31
|
+
// Try to create a RegExp from the searchValue. If it fails (invalid regex),
|
|
32
|
+
// it will be treated as a plain text search
|
|
33
|
+
let searchRegex;
|
|
34
|
+
try {
|
|
35
|
+
searchRegex = new RegExp(searchValue, 'i'); // 'i' for case-insensitive
|
|
36
|
+
} catch (error) {
|
|
37
|
+
searchRegex = null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
for (let i = 0; i < rows.length; i++) {
|
|
41
|
+
const row = rows[i];
|
|
42
|
+
let isMatch = false;
|
|
43
|
+
|
|
44
|
+
if (searchRegex) {
|
|
45
|
+
// If a valid regex was created, use it for matching
|
|
46
|
+
isMatch = searchRegex.test(row.textContent);
|
|
47
|
+
} else {
|
|
48
|
+
// Otherwise, fall back to the original plain text search
|
|
49
|
+
isMatch = row.textContent
|
|
50
|
+
.toLowerCase()
|
|
51
|
+
.includes(searchValue.toLowerCase());
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
row.style.display = isMatch ? '' : 'none';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// loads the search box
|
|
59
|
+
function addSearchBox() {
|
|
60
|
+
var template = document.getElementById('filterTemplate');
|
|
61
|
+
var templateClone = template.content.cloneNode(true);
|
|
62
|
+
templateClone.getElementById('fileSearch').oninput = onFilterInput;
|
|
63
|
+
template.parentElement.appendChild(templateClone);
|
|
64
|
+
}
|
|
65
|
+
|
|
27
66
|
// loads all columns
|
|
28
67
|
function loadColumns() {
|
|
29
68
|
var colNodes = getTableHeader().querySelectorAll('th'),
|
|
@@ -162,6 +201,7 @@ var addSorting = (function() {
|
|
|
162
201
|
}
|
|
163
202
|
cols = loadColumns();
|
|
164
203
|
loadData();
|
|
204
|
+
addSearchBox();
|
|
165
205
|
addSortIndicators();
|
|
166
206
|
enableUI();
|
|
167
207
|
};
|
|
Binary file
|
package/coverage/sorter.js
CHANGED
|
@@ -24,6 +24,45 @@ var addSorting = (function() {
|
|
|
24
24
|
return getTableHeader().querySelectorAll('th')[n];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
function onFilterInput() {
|
|
28
|
+
const searchValue = document.getElementById('fileSearch').value;
|
|
29
|
+
const rows = document.getElementsByTagName('tbody')[0].children;
|
|
30
|
+
|
|
31
|
+
// Try to create a RegExp from the searchValue. If it fails (invalid regex),
|
|
32
|
+
// it will be treated as a plain text search
|
|
33
|
+
let searchRegex;
|
|
34
|
+
try {
|
|
35
|
+
searchRegex = new RegExp(searchValue, 'i'); // 'i' for case-insensitive
|
|
36
|
+
} catch (error) {
|
|
37
|
+
searchRegex = null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
for (let i = 0; i < rows.length; i++) {
|
|
41
|
+
const row = rows[i];
|
|
42
|
+
let isMatch = false;
|
|
43
|
+
|
|
44
|
+
if (searchRegex) {
|
|
45
|
+
// If a valid regex was created, use it for matching
|
|
46
|
+
isMatch = searchRegex.test(row.textContent);
|
|
47
|
+
} else {
|
|
48
|
+
// Otherwise, fall back to the original plain text search
|
|
49
|
+
isMatch = row.textContent
|
|
50
|
+
.toLowerCase()
|
|
51
|
+
.includes(searchValue.toLowerCase());
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
row.style.display = isMatch ? '' : 'none';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// loads the search box
|
|
59
|
+
function addSearchBox() {
|
|
60
|
+
var template = document.getElementById('filterTemplate');
|
|
61
|
+
var templateClone = template.content.cloneNode(true);
|
|
62
|
+
templateClone.getElementById('fileSearch').oninput = onFilterInput;
|
|
63
|
+
template.parentElement.appendChild(templateClone);
|
|
64
|
+
}
|
|
65
|
+
|
|
27
66
|
// loads all columns
|
|
28
67
|
function loadColumns() {
|
|
29
68
|
var colNodes = getTableHeader().querySelectorAll('th'),
|
|
@@ -162,6 +201,7 @@ var addSorting = (function() {
|
|
|
162
201
|
}
|
|
163
202
|
cols = loadColumns();
|
|
164
203
|
loadData();
|
|
204
|
+
addSearchBox();
|
|
165
205
|
addSortIndicators();
|
|
166
206
|
enableUI();
|
|
167
207
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
17
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -18,29 +22,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
18
22
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
23
|
});
|
|
20
24
|
};
|
|
21
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return value;
|
|
25
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
26
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
27
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
28
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
29
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
27
30
|
};
|
|
28
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
29
|
-
if (!
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return privateMap.get(receiver);
|
|
31
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
32
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
33
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
34
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
33
35
|
};
|
|
34
|
-
var
|
|
36
|
+
var _AccessControl_roles;
|
|
35
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
38
|
exports.AccessControl = void 0;
|
|
37
39
|
class AccessControl {
|
|
38
40
|
constructor(roles) {
|
|
39
|
-
|
|
40
|
-
__classPrivateFieldSet(this,
|
|
41
|
+
_AccessControl_roles.set(this, void 0);
|
|
42
|
+
__classPrivateFieldSet(this, _AccessControl_roles, roles, "f");
|
|
41
43
|
}
|
|
42
44
|
can(role, action, resource) {
|
|
43
|
-
const selectedRole = __classPrivateFieldGet(this,
|
|
45
|
+
const selectedRole = __classPrivateFieldGet(this, _AccessControl_roles, "f")[role];
|
|
44
46
|
const hasResource = !!selectedRole && !!selectedRole[resource];
|
|
45
47
|
const hasAction = hasResource && !!selectedRole[resource][action];
|
|
46
48
|
const isActionActive = hasAction && !!selectedRole[resource][action].enabled;
|
|
@@ -48,7 +50,7 @@ class AccessControl {
|
|
|
48
50
|
}
|
|
49
51
|
getRoles(role, action, resource) {
|
|
50
52
|
return (this.can(role, action, resource) &&
|
|
51
|
-
__classPrivateFieldGet(this,
|
|
53
|
+
__classPrivateFieldGet(this, _AccessControl_roles, "f")[role][resource][action]);
|
|
52
54
|
}
|
|
53
55
|
validate(role, action, resource) {
|
|
54
56
|
return (args, context) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -70,7 +72,7 @@ class AccessControl {
|
|
|
70
72
|
}
|
|
71
73
|
filter(role, action, resource) {
|
|
72
74
|
const can = this.can(role, action, resource);
|
|
73
|
-
const attributes = __classPrivateFieldGet(this,
|
|
75
|
+
const attributes = __classPrivateFieldGet(this, _AccessControl_roles, "f")[role][resource][action].attributes ||
|
|
74
76
|
[];
|
|
75
77
|
return (res) => __awaiter(this, void 0, void 0, function* () {
|
|
76
78
|
if (!can) {
|
|
@@ -101,6 +103,6 @@ class AccessControl {
|
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
exports.AccessControl = AccessControl;
|
|
104
|
-
|
|
106
|
+
_AccessControl_roles = new WeakMap();
|
|
105
107
|
__exportStar(require("./types"), exports);
|
|
106
108
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAa,aAAa;IAExB,YAAY,KAAwB;QADpC,uCAA0B;QAExB,uBAAA,IAAI,wBAAU,KAAK,MAAA,CAAC;IACtB,CAAC;IAED,GAAG,CAAC,IAAa,EAAE,MAAe,EAAE,QAAiB;QACnD,MAAM,YAAY,GAAG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CAAC;oBAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;YACD,OAAO,IAAS,CAAC;QACnB,CAAC,CAAA,CAAC;IACJ,CAAC;CACF;AA7ED,sCA6EC;;AAED,0CAAwB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type GenericEnumType<T, K> = {
|
|
2
2
|
[key in keyof T]: Partial<K>;
|
|
3
3
|
};
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type Unboxed<T> = T extends (infer U)[] ? U : T;
|
|
5
|
+
export type Validator<T = never, C = never> = {
|
|
6
6
|
validators?: ((args: Unboxed<T>, context: C) => boolean | Promise<boolean>)[];
|
|
7
7
|
enabled: boolean;
|
|
8
8
|
attributes?: GenericEnumType<Unboxed<T>, boolean>;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type Union<Roles, Resolvers, Actions, Context = unknown> = GenericEnumType<Roles, {
|
|
11
11
|
[resolver in keyof Resolvers]: Partial<Record<keyof Actions, Validator<Resolvers[resolver], Context>>>;
|
|
12
12
|
}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
2
|
+
import tsParser from '@typescript-eslint/parser';
|
|
3
|
+
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
4
|
+
import prettierPlugin from 'eslint-plugin-prettier';
|
|
5
|
+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
6
|
+
import prettierConfig from 'eslint-config-prettier';
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
globalIgnores(['dist', './test']),
|
|
10
|
+
{
|
|
11
|
+
files: ['./src/**/*.ts', './src/**/*.tsx'],
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parser: tsParser,
|
|
14
|
+
ecmaVersion: 2018,
|
|
15
|
+
sourceType: 'module',
|
|
16
|
+
},
|
|
17
|
+
plugins: {
|
|
18
|
+
'@typescript-eslint': tsPlugin,
|
|
19
|
+
prettier: prettierPlugin,
|
|
20
|
+
'simple-import-sort': simpleImportSort, // ✅ MUST MATCH RULE PREFIX
|
|
21
|
+
},
|
|
22
|
+
rules: {
|
|
23
|
+
...tsPlugin.configs.recommended.rules,
|
|
24
|
+
...prettierConfig.rules,
|
|
25
|
+
|
|
26
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
27
|
+
'@typescript-eslint/camelcase': 'off',
|
|
28
|
+
'@typescript-eslint/interface-name-prefix': 'off',
|
|
29
|
+
|
|
30
|
+
'simple-import-sort/imports': 'error',
|
|
31
|
+
'simple-import-sort/exports': 'error',
|
|
32
|
+
'sort-imports': 'off',
|
|
33
|
+
'import/order': 'off',
|
|
34
|
+
|
|
35
|
+
'prettier/prettier': 'error',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gapi/ac",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.170",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/Stradivario/gapi.git"
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
"url": "https://github.com/Stradivario/gapi/issues"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^
|
|
32
|
+
"@types/node": "^25.0.3",
|
|
33
33
|
"@types/jest": "^25.2.1",
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
35
|
-
"@typescript-eslint/parser": "^
|
|
36
|
-
"eslint": "^
|
|
37
|
-
"prettier": "^
|
|
38
|
-
"typescript": "^
|
|
39
|
-
"eslint-config-prettier": "^
|
|
40
|
-
"eslint-plugin-prettier": "^
|
|
41
|
-
"eslint-plugin-simple-import-sort": "^
|
|
42
|
-
"jest": "^
|
|
43
|
-
"ts-jest": "^
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^8.50.1",
|
|
35
|
+
"@typescript-eslint/parser": "^8.50.1",
|
|
36
|
+
"eslint": "^9.39.2",
|
|
37
|
+
"prettier": "^3.7.4",
|
|
38
|
+
"typescript": "^5.9.3",
|
|
39
|
+
"eslint-config-prettier": "^10.1.8",
|
|
40
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
41
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
42
|
+
"jest": "^30.2.0",
|
|
43
|
+
"ts-jest": "^29.4.6"
|
|
44
44
|
},
|
|
45
45
|
"main": "./dist/index.js",
|
|
46
46
|
"types": "./dist/index.d.ts",
|
package/src/types.ts
CHANGED
package/test/main.spec.ts
CHANGED
package/.eslintrc.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
// Specifies the ESLint parser
|
|
3
|
-
parser: "@typescript-eslint/parser",
|
|
4
|
-
extends: [
|
|
5
|
-
// Uses the recommended rules from the @typescript-eslint/eslint-plugin
|
|
6
|
-
"plugin:@typescript-eslint/recommended",
|
|
7
|
-
// Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
|
|
8
|
-
"prettier/@typescript-eslint",
|
|
9
|
-
// Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
|
|
10
|
-
"plugin:prettier/recommended"
|
|
11
|
-
],
|
|
12
|
-
parserOptions: {
|
|
13
|
-
// Allows for the parsing of modern ECMAScript features
|
|
14
|
-
ecmaVersion: 2018,
|
|
15
|
-
// Allows for the use of imports
|
|
16
|
-
sourceType: "module"
|
|
17
|
-
},
|
|
18
|
-
rules: {
|
|
19
|
-
"@typescript-eslint/explicit-function-return-type": 0,
|
|
20
|
-
"simple-import-sort/sort": "error",
|
|
21
|
-
"sort-imports": "off",
|
|
22
|
-
"import/order": "off",
|
|
23
|
-
"@typescript-eslint/camelcase": 0,
|
|
24
|
-
"@typescript-eslint/interface-name-prefix": 0
|
|
25
|
-
},
|
|
26
|
-
plugins: ["simple-import-sort"]
|
|
27
|
-
};
|