@graphql-inspector/similar-command 3.3.0 → 3.4.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.
- package/index.js +4 -4
- package/index.mjs +4 -4
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -25,7 +25,7 @@ function handler({ schema, writePath, type, threshold, }) {
|
|
|
25
25
|
logger.Logger.log('');
|
|
26
26
|
logger.Logger.log(`${prefix} ${sourceType}`);
|
|
27
27
|
logger.Logger.log(printResult(name, matches.bestMatch.rating));
|
|
28
|
-
matches.ratings.forEach(
|
|
28
|
+
matches.ratings.forEach(match => {
|
|
29
29
|
logger.Logger.log(printResult(match.target.typeId, match.rating));
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -53,7 +53,7 @@ function handler({ schema, writePath, type, threshold, }) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
const index = commands.createCommand(
|
|
56
|
+
const index = commands.createCommand(api => {
|
|
57
57
|
const { loaders } = api;
|
|
58
58
|
return {
|
|
59
59
|
command: 'similar <schema>',
|
|
@@ -139,8 +139,8 @@ function printScale(ratio) {
|
|
|
139
139
|
const percentage = Math.floor(ratio * 100);
|
|
140
140
|
const levels = [0, 30, 50, 70, 90];
|
|
141
141
|
return levels
|
|
142
|
-
.map(
|
|
143
|
-
.map(
|
|
142
|
+
.map(level => percentage >= level)
|
|
143
|
+
.map(enabled => (enabled ? logger.figures.bullet : logger.chalk.gray(logger.figures.bullet)))
|
|
144
144
|
.join('');
|
|
145
145
|
}
|
|
146
146
|
function formatRating(ratio) {
|
package/index.mjs
CHANGED
|
@@ -21,7 +21,7 @@ function handler({ schema, writePath, type, threshold, }) {
|
|
|
21
21
|
Logger.log('');
|
|
22
22
|
Logger.log(`${prefix} ${sourceType}`);
|
|
23
23
|
Logger.log(printResult(name, matches.bestMatch.rating));
|
|
24
|
-
matches.ratings.forEach(
|
|
24
|
+
matches.ratings.forEach(match => {
|
|
25
25
|
Logger.log(printResult(match.target.typeId, match.rating));
|
|
26
26
|
});
|
|
27
27
|
}
|
|
@@ -49,7 +49,7 @@ function handler({ schema, writePath, type, threshold, }) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
const index = createCommand(
|
|
52
|
+
const index = createCommand(api => {
|
|
53
53
|
const { loaders } = api;
|
|
54
54
|
return {
|
|
55
55
|
command: 'similar <schema>',
|
|
@@ -135,8 +135,8 @@ function printScale(ratio) {
|
|
|
135
135
|
const percentage = Math.floor(ratio * 100);
|
|
136
136
|
const levels = [0, 30, 50, 70, 90];
|
|
137
137
|
return levels
|
|
138
|
-
.map(
|
|
139
|
-
.map(
|
|
138
|
+
.map(level => percentage >= level)
|
|
139
|
+
.map(enabled => (enabled ? figures.bullet : chalk.gray(figures.bullet)))
|
|
140
140
|
.join('');
|
|
141
141
|
}
|
|
142
142
|
function formatRating(ratio) {
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-inspector/similar-command",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Find similar types in GraphQL Schema",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"graphql": "^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-inspector/commands": "3.
|
|
11
|
-
"@graphql-inspector/core": "3.
|
|
12
|
-
"@graphql-inspector/logger": "3.
|
|
10
|
+
"@graphql-inspector/commands": "3.4.0",
|
|
11
|
+
"@graphql-inspector/core": "3.4.0",
|
|
12
|
+
"@graphql-inspector/logger": "3.4.0",
|
|
13
13
|
"tslib": "^2.0.0"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|