Skip to content

Commit

Permalink
chore(wasm): map methods to names that relate
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Sep 28, 2023
1 parent 3eaa6a9 commit f9a2f3c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions kayle/lib/wasm/extract.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { radiant_blast } from "kayle_innate";
import { get_document_links } from "kayle_innate";
import type { RunnerConfig } from "../config";

/**
Expand All @@ -10,5 +10,5 @@ import type { RunnerConfig } from "../config";
export async function extractLinks(config: RunnerConfig, target?: string) {
const htmlContent = await config.page.content();
const domain = typeof target === "string" ? target : config.page.url();
return radiant_blast(htmlContent, domain !== "about:blank" ? domain : "");
return get_document_links(htmlContent, domain !== "about:blank" ? domain : "");
}
2 changes: 1 addition & 1 deletion kayle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kayle",
"version": "0.7.8",
"version": "0.7.9",
"description": "Extremely fast and accurate accessibility engine built for any headless tool like playwright or puppeteer.",
"main": "./build/index.js",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion kayle_innate/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion kayle_innate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kayle_innate"
version = "0.0.16"
version = "0.0.17"
authors = ["j-mendez"]
edition = "2018"
license = "MIT"
Expand Down
18 changes: 9 additions & 9 deletions kayle_innate/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// all API conventions base mapped from https://www.leagueoflegends.com/en-pl/champions/kayle/

#[macro_use]
extern crate lazy_static;

Expand Down Expand Up @@ -34,7 +32,7 @@ pub fn domain_name(domain: &url::Url) -> &str {

#[wasm_bindgen]
/// setup a structure tree alg for parsing and find links in document. Allow user to perform hybrid audits realtime.
pub fn radiant_blast(res: &str, domain: &str) -> Box<[JsValue]> {
pub fn get_document_links(res: &str, domain: &str) -> Box<[JsValue]> {
set_panic_hook();

lazy_static! {
Expand Down Expand Up @@ -117,18 +115,20 @@ pub fn radiant_blast(res: &str, domain: &str) -> Box<[JsValue]> {

#[wasm_bindgen]
/// try to fix all possible issues using a spec against the tree.
pub fn celestial_blessing() {
println!("Celestial blessing from kayle!");
pub fn parse_accessibility_tree(_html: &str) {
set_panic_hook();
// mark nodes that should be checked.
todo!("Parsing an accessibility tree from rust soon.")
}

#[wasm_bindgen]
/// use gpu to accelerate layout rendering or workers.
pub fn starfire_spellblade() {
println!("Starfire Spellblase from kayle!");
pub fn validate_node() {
todo!("It will validate a node whether accessibility checks should arise.")
}

#[wasm_bindgen]
/// Perform the a judgement against a page to determine effort, access, and more.
pub fn divine_judgement() {
println!("Divine judgement from kayle!");
pub fn judge() {
todo!("Determine the score of the website after the tree was built.")
}
8 changes: 4 additions & 4 deletions kayle_innate/tests/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
#![cfg(target_arch = "wasm32")]
extern crate wasm_bindgen_test;

use kayle_innate::radiant_blast;
use kayle_innate::get_document_links;
use wasm_bindgen_test::*;

wasm_bindgen_test_configure!(run_in_browser);

#[wasm_bindgen_test]
fn _radiant_blast() {
let links = radiant_blast(
fn _get_document_links() {
let links = get_document_links(
r#"
<html>
<body>
Expand All @@ -33,7 +33,7 @@ fn _radiant_blast() {

let base_domain = "https://a11ywatch.com";

let links = radiant_blast(
let links = get_document_links(
r#"
<html>
<body>
Expand Down

0 comments on commit f9a2f3c

Please sign in to comment.