feat(tl-ref): find usages in array arguments
This commit is contained in:
parent
14dc62e912
commit
7a463f22a3
2 changed files with 6 additions and 1 deletions
|
@ -84,6 +84,11 @@ function prepareData(data) {
|
||||||
// add hex constructor id
|
// add hex constructor id
|
||||||
if (item.id) item.tlId = item.id.toString(16).padStart(8, '0')
|
if (item.id) item.tlId = item.id.toString(16).padStart(8, '0')
|
||||||
|
|
||||||
|
if (item.arguments) item.arguments.forEach((arg) => {
|
||||||
|
// raw non-array type for usages count
|
||||||
|
arg.rawType = arg.type.replace(/\[]$/, '')
|
||||||
|
})
|
||||||
|
|
||||||
// add typescript types for the item and arguments
|
// add typescript types for the item and arguments
|
||||||
// basically copy-pasted from generate-types.js
|
// basically copy-pasted from generate-types.js
|
||||||
const prefix_ = item.prefix === 'mtproto/' ? 'mt_' : ''
|
const prefix_ = item.prefix === 'mtproto/' ? 'mt_' : ''
|
||||||
|
|
|
@ -471,7 +471,7 @@ export const query = graphql`
|
||||||
usageTypes: allTlObject(
|
usageTypes: allTlObject(
|
||||||
filter: {
|
filter: {
|
||||||
prefix: { eq: $prefix }
|
prefix: { eq: $prefix }
|
||||||
arguments: { elemMatch: { type: { eq: $name } } }
|
arguments: { elemMatch: { rawType: { eq: $name } } }
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
nodes {
|
nodes {
|
||||||
|
|
Loading…
Reference in a new issue