当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript url-join.default方法代码示例

本文整理汇总了TypeScript中url-join.default方法的典型用法代码示例。如果您正苦于以下问题:TypeScript url-join.default方法的具体用法?TypeScript url-join.default怎么用?TypeScript url-join.default使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在url-join的用法示例。


在下文中一共展示了url-join.default方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: urlJoin

export const addAttributePath = (
  productTypeId: string,
  type: AttributeTypeEnum
) =>
  type === AttributeTypeEnum.PRODUCT
    ? urlJoin(productTypePath(productTypeId), "attribute/product/add")
    : urlJoin(productTypePath(productTypeId), "attribute/variant/add");
开发者ID:krzysztofwolski,项目名称:saleor,代码行数:7,代码来源:urls.ts

示例2: webpack

export function webpack(assetName: string) {
    if (ENV === 'production') {
        const manifestPath = path.join(WEBPACK_OUTPUT_PATH, 'manifest.json')
        const manifest = JSON.parse(fs.readFileSync(manifestPath).toString('utf8'))
        return urljoin('/admin/build/', manifest[assetName])
    } else {
        if (assetName.match(/\.js$/)) {
            assetName = `js/${assetName}`
        } else if (assetName.match(/\.css$/)) {
            assetName = `css/${assetName}`
        }

        return urljoin(WEBPACK_DEV_URL, assetName)
    }
}
开发者ID:OurWorldInData,项目名称:owid-grapher,代码行数:15,代码来源:webpack.ts

示例3: Error

export async function startReplyChainInChannel(chatConnector: builder.ChatConnector, message: builder.Message, channelId: string): Promise<builder.IChatConnectorAddress> {
    let activity = message.toMessage();

    // Build request
    let options: request.Options = {
        method: "POST",
        // We use urlJoin to concatenate urls. url.resolve should not be used here,
        // since it resolves urls as hrefs are resolved, which could result in losing
        // the last fragment of the serviceUrl
        url: urlJoin((activity.address as any).serviceUrl, "/v3/conversations"),
        body: {
            isGroup: true,
            activity: activity,
            channelData: {
                teamsChannelId: channelId,
            },
        },
        json: true,
    };

    let response = await sendRequestWithAccessToken(chatConnector, options);
    if (response && response.hasOwnProperty("id")) {
        let address = createAddressFromResponse(activity.address, response) as any;
        if (address.user) {
            delete address.user;
        }
        if (address.correlationId) {
            delete address.correlationId;
        }
        return address;
    } else {
        throw new Error("Failed to start reply chain: no conversation ID returned.");
    }
}
开发者ID:gvprime,项目名称:microsoft-teams-sample-complete-node,代码行数:34,代码来源:DialogUtils.ts

示例4: urlJoin

export const productListUrl = (params?: ProductListQueryParams): string => {
  if (params === undefined) {
    return productListPath;
  } else {
    return urlJoin(productListPath, "?" + stringifyQs(params));
  }
};
开发者ID:krzysztofwolski,项目名称:saleor,代码行数:7,代码来源:urls.ts

示例5: urlJoin

export const orderListUrl = (params?: OrderListUrlQueryParams): string => {
  const orderList = orderListPath;
  if (params === undefined) {
    return orderList;
  } else {
    return urlJoin(orderList, "?" + stringifyQs(params));
  }
};
开发者ID:mirumee,项目名称:saleor,代码行数:8,代码来源:urls.ts

示例6: setupCommands

export function setupCommands(server: Server, commands: CommandDefinition[]) {
    // Generate and register routes for commands
    for (let command of commands) {
        server.route({
            method: command.method || "GET",
            path: urljoin("/commands", command.path || slug(command.name)),
            config: {
                auth: command.auth
            },
            handler: buildCommandHandler({ command: command.command, options: command.options })
        });
    }
}
开发者ID:msurdi,项目名称:smu,代码行数:13,代码来源:commands.ts

示例7: urlJoin

export const saleAssignProductsPath = (id: string) =>
  urlJoin(salePath(id), "assign-products");
开发者ID:krzysztofwolski,项目名称:saleor,代码行数:2,代码来源:urls.ts

示例8: urlPathJoin

function urlPathJoin(...parts: string[]): string {
  return urljoin(...parts);
}
开发者ID:afshin,项目名称:jupyter-js-services,代码行数:3,代码来源:utils.ts

示例9: stringifyQs

export const customerSection = "/customers/";

export const customerListPath = customerSection;
export type CustomerListUrlDialog = "remove";
export type CustomerListUrlQueryParams = BulkAction &
  Dialog<CustomerListUrlDialog> &
  Pagination;
export const customerListUrl = (params?: CustomerListUrlQueryParams) =>
  customerListPath + "?" + stringifyQs(params);

export const customerPath = (id: string) => urlJoin(customerSection, id);
export type CustomerUrlDialog = "remove";
export type CustomerUrlQueryParams = Dialog<CustomerUrlDialog>;
export const customerUrl = (id: string, params?: CustomerUrlQueryParams) =>
  customerPath(encodeURIComponent(id)) + "?" + stringifyQs(params);

export const customerAddPath = urlJoin(customerSection, "add");
export const customerAddUrl = customerAddPath;

export const customerAddressesPath = (id: string) =>
  urlJoin(customerPath(id), "addresses");
export type CustomerAddressesUrlDialog = "add" | "edit" | "remove";
export type CustomerAddressesUrlQueryParams = Dialog<
  CustomerAddressesUrlDialog
> &
  SingleAction;
export const customerAddressesUrl = (
  id: string,
  params?: CustomerAddressesUrlQueryParams
) => customerAddressesPath(encodeURIComponent(id)) + "?" + stringifyQs(params);
开发者ID:mirumee,项目名称:saleor,代码行数:30,代码来源:urls.ts

示例10: urlEncodeParts

function urlEncodeParts(uri: string): string {
  // Normalize and join, split, encode, then join.
  uri = urljoin(uri);
  let parts = uri.split('/').map(encodeURIComponent);
  return urljoin(...parts);
}
开发者ID:afshin,项目名称:jupyter-js-services,代码行数:6,代码来源:utils.ts


注:本文中的url-join.default方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。