Created
December 17, 2023 19:04
-
-
Save zerkalica/439f1a99550d294e3aa96867b3b86fe4 to your computer and use it in GitHub Desktop.
mol alt links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$gd_kit_link $mol_link |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace $.$$ { | |
export class $gd_kit_link extends $.$gd_kit_link { | |
dict() { | |
const self_args = this.arg() | |
const dict = this.$.$mol_state_arg.dict() | |
const result = {} as Record<string, string> | |
for (let dict_key in dict) { | |
for (let self_key in self_args) { | |
if (! dict_key.startsWith(self_key)) { | |
result[dict_key] = dict[dict_key] | |
} | |
} | |
} | |
return result | |
} | |
@ $mol_mem | |
uri() { | |
return this.$.$mol_state_arg.make_link( { ... this.dict(), ... this.arg() } ) | |
} | |
@ $mol_mem | |
uri_off() { | |
const result = { ...this.dict() } as Record<string, string | null> | |
for (let key in this.arg()) result[key] = null | |
return this.$.$mol_state_arg.make_link( result ) | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class $gd_kit_page { | |
@ $mol_mem | |
param() { | |
return this.toString().replace( /^.*?\)\./, '' ).replace( /[()]/g, '' ).toLowerCase() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment