選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

13 行
376B

  1. 'use strict';
  2. const url = require('url');
  3. const prependHttp = require('prepend-http');
  4. module.exports = (input, options) => {
  5. if (typeof input !== 'string') {
  6. throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof input}\` instead.`);
  7. }
  8. const finalUrl = prependHttp(input, Object.assign({https: true}, options));
  9. return url.parse(finalUrl);
  10. };