(url, type = kImplicitTypeAttribute, job)
| 97 | return super.get(url)?.[type]; |
| 98 | } |
| 99 | set(url, type = kImplicitTypeAttribute, job) { |
| 100 | validateString(url, 'url'); |
| 101 | validateString(type, 'type'); |
| 102 | |
| 103 | const { ModuleJobBase } = require('internal/modules/esm/module_job'); |
| 104 | if (job instanceof ModuleJobBase !== true && |
| 105 | typeof job !== 'function') { |
| 106 | throw new ERR_INVALID_ARG_TYPE('job', 'ModuleJob', job); |
| 107 | } |
| 108 | debug(`Storing ${url} (${ |
| 109 | type === kImplicitTypeAttribute ? 'implicit type' : type |
| 110 | }) in ModuleLoadMap`); |
| 111 | const cachedJobsForUrl = super.get(url) ?? { __proto__: null }; |
| 112 | cachedJobsForUrl[type] = job; |
| 113 | return super.set(url, cachedJobsForUrl); |
| 114 | } |
| 115 | has(url, type = kImplicitTypeAttribute) { |
| 116 | validateString(url, 'url'); |
| 117 | validateString(type, 'type'); |
no test coverage detected