當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。