ghost-portal/packages/page-js/src/snippets/wrapping.ts
2022-01-01 09:30:15 +02:00

15 lines
431 B
TypeScript

// Copyright 2017-2022 @polkadot/app-js authors & contributors
// SPDX-License-Identifier: Apache-2.0
export default function makeWrapper (isDevelopment: boolean): string {
const args = `api, hashing, ${isDevelopment ? 'keyring, ' : ''}types, util`;
return `// All code is wrapped within an async closure,
// allowing access to ${args}.
// (async ({ ${args} }) => {
// ... any user code is executed here ...
// })();
`;
}