index.js 1.2 KB

123456789101112131415161718192021222324252627
  1. "use strict";
  2. const { URL, URLSearchParams } = require("./webidl2js-wrapper");
  3. const urlStateMachine = require("./lib/url-state-machine");
  4. const percentEncoding = require("./lib/percent-encoding");
  5. const sharedGlobalObject = { Array, Object, Promise, String, TypeError };
  6. URL.install(sharedGlobalObject, ["Window"]);
  7. URLSearchParams.install(sharedGlobalObject, ["Window"]);
  8. exports.URL = sharedGlobalObject.URL;
  9. exports.URLSearchParams = sharedGlobalObject.URLSearchParams;
  10. exports.parseURL = urlStateMachine.parseURL;
  11. exports.basicURLParse = urlStateMachine.basicURLParse;
  12. exports.serializeURL = urlStateMachine.serializeURL;
  13. exports.serializePath = urlStateMachine.serializePath;
  14. exports.serializeHost = urlStateMachine.serializeHost;
  15. exports.serializeInteger = urlStateMachine.serializeInteger;
  16. exports.serializeURLOrigin = urlStateMachine.serializeURLOrigin;
  17. exports.setTheUsername = urlStateMachine.setTheUsername;
  18. exports.setThePassword = urlStateMachine.setThePassword;
  19. exports.cannotHaveAUsernamePasswordPort = urlStateMachine.cannotHaveAUsernamePasswordPort;
  20. exports.hasAnOpaquePath = urlStateMachine.hasAnOpaquePath;
  21. exports.percentDecodeString = percentEncoding.percentDecodeString;
  22. exports.percentDecodeBytes = percentEncoding.percentDecodeBytes;