( module: SourceModule, specifier: ImportSpecifier )
| 1143 | |
| 1144 | // arktype/runtime's `type` holds only `errors` |
| 1145 | const readsRuntimeExport = ( |
| 1146 | module: SourceModule, |
| 1147 | specifier: ImportSpecifier |
| 1148 | ): boolean => { |
| 1149 | const name = exportNameOf(specifier.imported) |
| 1150 | if (name in runtimeExports) return true |
| 1151 | const binding = module.scopes.bindingsById.get(specifier.local) |
| 1152 | return ( |
| 1153 | name === "type" && |
| 1154 | !!binding?.references.every( |
| 1155 | ({ id, isWrite }) => |
| 1156 | !isWrite && |
| 1157 | id.parent?.type === "MemberExpression" && |
| 1158 | id.parent.object === id && |
| 1159 | !id.parent.computed && |
| 1160 | id.parent.property.name === "errors" |
| 1161 | ) |
| 1162 | ) |
| 1163 | } |
| 1164 | |
| 1165 | export class ModuleGraph { |
| 1166 | host: PrecompileHost |
no test coverage detected