MCPcopy Create free account
hub / github.com/cryptii/cryptii / init

Function init

src/index.js:38–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 document.querySelector('script[data-cryptii-config]') !== null) {
37 // Define app initialization in the browser
38 const init = () => {
39 // Read optional pipe content
40 const $pipeData = document.querySelector('script[data-cryptii-pipe]')
41 const pipeData = $pipeData !== null ? JSON.parse($pipeData.innerHTML) : null
42
43 // Read optional app config
44 const $config = document.querySelector('script[data-cryptii-config]')
45 const config = $config !== null ? JSON.parse($config.innerHTML) : {}
46
47 // Configure app and bootstrap it
48 const app = new App(config)
49 app.run(pipeData)
50 }
51
52 // Trigger initialization when the DOM is ready
53 if (document.readyState !== 'loading') {

Callers 1

index.jsFile · 0.85

Calls 1

runMethod · 0.95

Tested by

no test coverage detected