UNPKG

@omni-door/tpl-ssr-react

Version:
10 lines (9 loc) 775 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.tpl_src_utils_mapctx = void 0; var utils_1 = require("@omni-door/utils"); var tpl = "`${ts ? `/* import types */\nimport type { GetServerSidePropsContext } from 'next';\n\nexport interface MapCtxToProps extends Pick<GetServerSidePropsContext, 'params' | 'query'> {\n page: string;\n}\n` : '' }\nexport function mapCtxToProps(ctx${ts ? ': GetServerSidePropsContext' : ''}) {\n const { params = null, query, resolvedUrl } = ctx;\n return {\n props: {\n params,\n query,\n page: resolvedUrl\n }\n };\n}\n\nexport default mapCtxToProps;\n`"; exports.tpl_src_utils_mapctx = { tpl: tpl }; exports.default = utils_1.tplEngineInit(exports.tpl_src_utils_mapctx, 'tpl');