Files
NapCatQQ/.pnpm-store/v3/files/a3/6c3a0aeb66884d8df041f99726d4e370e522d7f35e7968164b68656e4d2baff1c3119d5ea2dd4a671817735951a5ae3a5dca4a5b7e733fb6abd53c826104db
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

1 line
1.9 KiB
Plaintext

{"mappings":";;AAAA;;;;;;;;;;CAUC;AAKD,MAAM,8BAAQ,IAAI;AAEX,SAAS,0CAAgB,UAA+B;IAC7D,IAAI,QAAQ,4BAAM,GAAG,CAAC;IACtB,IAAI,SAAS,MACX,OAAO;IAGT,uFAAuF;IACvF,IAAI,UAAU;IACd,IAAI,aAAa,CAAC;QAChB,KAAK,IAAI,QAAQ,MAAO;YACtB,IAAI,KAAK,IAAI,KAAK,WAChB,WAAW,CAAA,GAAA,yCAAY,EAAE,MAAM;iBAC1B,IAAI,KAAK,IAAI,KAAK,QACvB;QAEJ;IACF;IAEA,WAAW;IACX,4BAAM,GAAG,CAAC,YAAY;IACtB,OAAO;AACT","sources":["packages/@react-stately/collections/src/getItemCount.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, Node} from '@react-types/shared';\nimport {getChildNodes} from './getChildNodes';\n\nconst cache = new WeakMap<Iterable<unknown>, number>();\n\nexport function getItemCount<T>(collection: Collection<Node<T>>): number {\n let count = cache.get(collection);\n if (count != null) {\n return count;\n }\n\n // TS isn't smart enough to know we've ensured count is a number, so use a new variable\n let counter = 0;\n let countItems = (items: Iterable<Node<T>>) => {\n for (let item of items) {\n if (item.type === 'section') {\n countItems(getChildNodes(item, collection));\n } else if (item.type === 'item') {\n counter++;\n }\n }\n };\n\n countItems(collection);\n cache.set(collection, counter);\n return counter;\n}\n"],"names":[],"version":3,"file":"getItemCount.module.js.map"}