Skip to content

Commit

Permalink
Rename function to extractData()
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Aug 21, 2024
1 parent 985c4f7 commit 070b712
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const extractor = extractors[ 0 ];
console.log( `Found extractor ${ extractor.info().slug }` );

extractor
.extract( document, ( entry ) => {
.extractData( document, ( entry ) => {
console.log( entry );
} )
.then( () => console.log( 'Extraction finished' ) )
Expand Down
10 changes: 5 additions & 5 deletions src/extractor/extractor.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* A piece of data in the site, like a post or a page.
* A piece of data in the site under extraction, like a post or a page.
*/
export interface SiteData {
/**
* Slug of the Extractor which extracted this entry.
* Slug of the Extractor which extracted this data.
* This is automatically set, the Extractor does not need to set it.
*/
extractor: string;
Expand Down Expand Up @@ -42,10 +42,10 @@ export interface Extractor {
handles( document: Document ): boolean;

/**
* Extracts Entries from a given Document.
* Extracts data from a given Document.
*/
extract(
extractData(
document: Document,
callback: ( entry: SiteData ) => void
callback: ( siteData: SiteData ) => void
): Promise< void >;
}
2 changes: 1 addition & 1 deletion src/extractor/wordpress-rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class WordPressRestExtractor implements Extractor {
return false;
}

async extract(
async extractData(
document: Document,
callback: ( entry: SiteData ) => void
): Promise< void > {
Expand Down

0 comments on commit 070b712

Please sign in to comment.