Skip to content

Commit

Permalink
wip: types
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Apr 20, 2022
1 parent f4f36a7 commit e001fa9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/doc/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export class Document<T = unknown> {
* Removes a value from the document.
* @returns `true` if the item was found and removed.
*/
delete(key: any) {
delete(key: unknown) {
return assertCollection(this.contents) ? this.contents.delete(key) : false
}

Expand Down
6 changes: 3 additions & 3 deletions src/nodes/YAMLMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ export class YAMLMap<K = unknown, V = unknown> extends Collection {
}
}

delete(key: K) {
delete(key: unknown) {
const it = findPair(this.items, key)
if (!it) return false
const del = this.items.splice(this.items.indexOf(it), 1)
return del.length > 0
}

get(key: K, keepScalar?: boolean) {
get(key: unknown, keepScalar?: boolean) {
const it = findPair(this.items, key)
const node = it?.value
return !keepScalar && isScalar(node) ? node.value : node
}

has(key: K) {
has(key: unknown) {
return !!findPair(this.items, key)
}

Expand Down

0 comments on commit e001fa9

Please sign in to comment.