Skip to content

Commit

Permalink
chore: improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
luolonghao committed Nov 4, 2024
1 parent 84b5f5c commit cfccfef
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/append-break.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Nodes } from '../models/nodes';
import { query } from './query';

// Appends a line break to the end of a block.
// Appends a line break to the end of the specified block.
// Example:
// case 1: <p></p> to <p><br /></p>
// case 2: <p><br /></p> to <p><br /></p>
Expand Down
1 change: 1 addition & 0 deletions src/utils/camel-case.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Converts the specified string to camel case.
export function camelCase(value: string): string {
const valueList = value.split('-');
let camelString = '';
Expand Down
1 change: 1 addition & 0 deletions src/utils/change-tag-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Nodes } from '../models/nodes';
import { query } from './query';
import { safeTemplate } from './safe-template';

// Changes the tag name of the specified element.
export function changeTagName(element: Nodes, newTagName: string): Nodes {
const nativeElement = element.get(0) as Element;
const newElement = query(safeTemplate`<${newTagName} />`);
Expand Down
1 change: 1 addition & 0 deletions src/utils/debug.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint no-console: "off" */

// Outputs a message to the console.
export function debug(...data: any[]): void {
if (window.LAKE_DEBUG) {
console.log.apply(console.log, data);
Expand Down
1 change: 1 addition & 0 deletions src/utils/fix-numbered-list.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Nodes } from '../models/nodes';

// Fixes incorrect number for numbered list.
export function fixNumberedList(blocks: Nodes[]): void {
if (blocks.length === 0) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/get-css.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { camelCase } from './camel-case';
import { toHex } from './to-hex';

// Returns a property value of all CSS properties of an element
// Returns a property value of all CSS properties of an element.
export function getCSS(element: Element, propertyName: string): string {
const camelPropertyName = camelCase(propertyName);
const computedStyle = window.getComputedStyle(element, null);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/in-string.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Search for a specified value within an string and return true or false (false if not found).
// Returns a boolean value indicating whether the specified string includes the value.
export function inString(string: string, value: string, delimiter?: string): boolean {
if (delimiter === undefined) {
delimiter = ',';
Expand Down

0 comments on commit cfccfef

Please sign in to comment.