Skip to content

Commit

Permalink
chore(fragment): improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
luolonghao committed Jan 7, 2025
1 parent 8100267 commit 64e3a0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/models/fragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export class Fragment {
this.fragment = fragment ?? document.createDocumentFragment();
}

// Gets a native fragment.
// Returns a native DocumentFragment object from the fragment.
public get(): DocumentFragment {
return this.fragment;
}

// Returns the descendants of the fragment which are selected by the specified CSS selector.
// Returns the descendants of the fragment that match the specified CSS selector.
public find(selector: string): Nodes {
const nodeList: Node[] = [];
let child = new Nodes(this.fragment.firstChild);
Expand All @@ -32,9 +32,9 @@ export class Fragment {
return new Nodes(nodeList);
}

// Inserts the specified node as the last child.
public append(node: string | Node | Nodes): void {
query(node).each(nativeNode => {
// Inserts the specified content just inside the fragment, after its last child.
public append(content: string | Node | Nodes): void {
query(content).each(nativeNode => {
this.fragment.appendChild(nativeNode);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/models/range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ export class Range {
return new Range(this.range.cloneRange());
}

// Returns a document fragment copying the nodes included in the range.
// Returns a DocumentFragment object copying the nodes included in the range.
public cloneContents(): DocumentFragment {
return this.range.cloneContents();
}
Expand Down

0 comments on commit 64e3a0c

Please sign in to comment.