Skip to content

Commit

Permalink
adding ret types
Browse files Browse the repository at this point in the history
  • Loading branch information
mike dupont committed Oct 14, 2024
1 parent 6b19b25 commit 28db539
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export function associate_cache(url: string,
hostname: string,
url_parts :string[],
fn_parts:string[]) {
fn_parts:string[]): any {
const alen = url_parts.length-1;
//const filename = url_parts[url_parts.length-1];
//console.log("cache url: " + url);
Expand Down
2 changes: 1 addition & 1 deletion clinic_report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const clinic_functions: Functions = {
'clinic-flame': isp_clinic_flame_report
}

export function isp_clinic_report(report_url:string,callback:any) {
export function isp_clinic_report(report_url:string,callback:any):any {
callback.debug("clinit report");
const reportUrl = new URL(report_url);
const parts = reportUrl.pathname.split("/");
Expand Down
21 changes: 19 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
{
"name": "@introspector/introspector",
"version": "0.1.0",
"version": "0.1.1",
"license": "agpl-3",
"exports": "./main.ts",
"exports": {
"./main":"./main.ts",
"./cache":"./cache.ts",
"./functions":"./functions.ts",
"./process_statements":"./process_statements.ts",
"./rdf":"./rdf.ts",
"./test_driver":"./test_driver.ts",
"./clinic_report":"./clinic_report.ts",
"./is":"./introspector.ts",
"./missing" : "./missing.ts",
"./process" : "./process.ts",
"./rdf_type":"./rdf_type.ts",
"./test_driver":"./test_driver.ts",
"./filter":"./filter.ts",
"./pf":"./process_files.ts",
"./rdf":"./rdf_callbacks.ts",
"./st":"./statement.ts",
},
"nodeModulesDir": "auto",
"tasks": {
"dev": "deno run --watch main.ts"
Expand Down
7 changes: 0 additions & 7 deletions filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ export function find_calls(event:any,
filter:any) {
}

export function create_find_function(visit_function:any,
filter_function:any
) {
return [0,1]
}

export interface Introspector {
(): any;
Expand All @@ -41,8 +36,6 @@ export function test_frame(){
function visit_function_name(function_name:string, function_value:any) {
add_to_frame(empty_frame,function_name, function_value);
}
// let find_functions = create_find_function(visit_function_name,filter_function_name)
// find_calls(event,find_functions);
return empty_frame
};

Expand Down
6 changes: 4 additions & 2 deletions process.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import { test_driver } from "./test_driver";
test_driver();
import { test_driver } from "./test_driver.ts";

let callback = function(){}
test_driver(callback);
3 changes: 2 additions & 1 deletion process_files.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Functions } from "./functions.ts"
import { missing } from "./missing.ts"
import { associate_cache, save_cache } from "./cache.ts"
const fs = require('node:fs');
//const fs = require('node:fs');
import * as fs from 'node:fs';
function process_chunk(line:string)
{
const chunk = line;
Expand Down
4 changes: 2 additions & 2 deletions rdf_callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ const functions: Functions = {
'http://www.w3.org/1999/02/22-rdf-syntax-ns#type': rdf_type
}

export function find_function(x:string, callback:any) {
export function find_function(x:string, callback:any):any {
// skip callback for now
return functions[x];
}

export type Callback = (x: any) => void;
export function set_function(x:string,y:Callback) {
export function set_function(x:string,y:Callback):any {
return functions[x]=y;
}
2 changes: 1 addition & 1 deletion rdf_type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type TypeObjectCallback = (subject:string,callback:any) => string;

export function rdf_type(type_function: TypeObjectCallback, subj:string,callback:any) {
export function rdf_type(type_function: TypeObjectCallback, subj:string,callback:any):any {
//const obj = obj;
//console.log("rdf_type type_obj: " + type_obj);
// console.log("type_obj:" + typeof(type_obj) );
Expand Down
2 changes: 1 addition & 1 deletion statement.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function statement(x:any) {
export function statement(x:any):any {
return "fixme"
}

0 comments on commit 28db539

Please sign in to comment.