feat(pear-platform): deepen runtime, link, and bundle APIs
Add merge/remove hints, link cache helpers, applink flags and validation, import-map merge/remove, runtime configure, deep-link peek, OTA rollback, and bundle unregister for manual pear-platform expansion. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -62,6 +62,27 @@ class HyperBareImportMap extends EventEmitter {
|
||||
return Object.prototype.hasOwnProperty.call(this._imports, specifier)
|
||||
}
|
||||
|
||||
remove (specifier) {
|
||||
const k = String(specifier)
|
||||
const had = Object.prototype.hasOwnProperty.call(this._imports, k)
|
||||
if (had) delete this._imports[k]
|
||||
return had
|
||||
}
|
||||
|
||||
keys () {
|
||||
return Object.keys(this._imports)
|
||||
}
|
||||
|
||||
mergeImports (extra) {
|
||||
if (!extra || typeof extra !== 'object') throw new Error('extra imports object required')
|
||||
let n = 0
|
||||
for (const [k, v] of Object.entries(extra)) {
|
||||
if (!Object.prototype.hasOwnProperty.call(this._imports, k)) n++
|
||||
this._imports[k] = v
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
getStats () {
|
||||
return platformStats(this._stats, PROTOCOL, { entries: Object.keys(this._imports).length })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user