@wordpress/url 4.26.0 → 4.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +12 -12
  3. package/build/add-query-args.js +4 -4
  4. package/build/add-query-args.js.map +1 -1
  5. package/build/build-query-string.js +3 -3
  6. package/build/build-query-string.js.map +1 -1
  7. package/build/clean-for-slug.js +2 -2
  8. package/build/clean-for-slug.js.map +1 -1
  9. package/build/filter-url-for-display.js +3 -3
  10. package/build/filter-url-for-display.js.map +1 -1
  11. package/build/get-authority.js +2 -2
  12. package/build/get-authority.js.map +1 -1
  13. package/build/get-filename.js +2 -2
  14. package/build/get-filename.js.map +1 -1
  15. package/build/get-fragment.js +2 -2
  16. package/build/get-fragment.js.map +1 -1
  17. package/build/get-path-and-query-string.js +2 -2
  18. package/build/get-path-and-query-string.js.map +1 -1
  19. package/build/get-path.js +2 -2
  20. package/build/get-path.js.map +1 -1
  21. package/build/get-protocol.js +2 -2
  22. package/build/get-protocol.js.map +1 -1
  23. package/build/get-query-arg.js +3 -11
  24. package/build/get-query-arg.js.map +1 -1
  25. package/build/get-query-args.js +5 -11
  26. package/build/get-query-args.js.map +1 -1
  27. package/build/get-query-string.js +2 -2
  28. package/build/get-query-string.js.map +1 -1
  29. package/build/has-query-arg.js +3 -3
  30. package/build/has-query-arg.js.map +1 -1
  31. package/build/index.js.map +1 -1
  32. package/build/is-email.js +2 -2
  33. package/build/is-email.js.map +1 -1
  34. package/build/is-phone-number.js +2 -2
  35. package/build/is-phone-number.js.map +1 -1
  36. package/build/is-url.js +2 -2
  37. package/build/is-url.js.map +1 -1
  38. package/build/is-valid-authority.js +2 -2
  39. package/build/is-valid-authority.js.map +1 -1
  40. package/build/is-valid-fragment.js +2 -2
  41. package/build/is-valid-fragment.js.map +1 -1
  42. package/build/is-valid-path.js +2 -2
  43. package/build/is-valid-path.js.map +1 -1
  44. package/build/is-valid-protocol.js +2 -2
  45. package/build/is-valid-protocol.js.map +1 -1
  46. package/build/is-valid-query-string.js +2 -2
  47. package/build/is-valid-query-string.js.map +1 -1
  48. package/build/normalize-path.js +2 -2
  49. package/build/normalize-path.js.map +1 -1
  50. package/build/prepend-http.js +2 -2
  51. package/build/prepend-http.js.map +1 -1
  52. package/build/prepend-https.js +2 -2
  53. package/build/prepend-https.js.map +1 -1
  54. package/build/remove-query-args.js +3 -3
  55. package/build/remove-query-args.js.map +1 -1
  56. package/build/safe-decode-uri-component.js +2 -2
  57. package/build/safe-decode-uri-component.js.map +1 -1
  58. package/build/safe-decode-uri.js +2 -2
  59. package/build/safe-decode-uri.js.map +1 -1
  60. package/build-module/add-query-args.js +4 -4
  61. package/build-module/add-query-args.js.map +1 -1
  62. package/build-module/build-query-string.js +3 -3
  63. package/build-module/build-query-string.js.map +1 -1
  64. package/build-module/clean-for-slug.js +2 -2
  65. package/build-module/clean-for-slug.js.map +1 -1
  66. package/build-module/filter-url-for-display.js +3 -3
  67. package/build-module/filter-url-for-display.js.map +1 -1
  68. package/build-module/get-authority.js +2 -2
  69. package/build-module/get-authority.js.map +1 -1
  70. package/build-module/get-filename.js +2 -2
  71. package/build-module/get-filename.js.map +1 -1
  72. package/build-module/get-fragment.js +2 -2
  73. package/build-module/get-fragment.js.map +1 -1
  74. package/build-module/get-path-and-query-string.js +2 -2
  75. package/build-module/get-path-and-query-string.js.map +1 -1
  76. package/build-module/get-path.js +2 -2
  77. package/build-module/get-path.js.map +1 -1
  78. package/build-module/get-protocol.js +2 -2
  79. package/build-module/get-protocol.js.map +1 -1
  80. package/build-module/get-query-arg.js +3 -12
  81. package/build-module/get-query-arg.js.map +1 -1
  82. package/build-module/get-query-args.js +5 -12
  83. package/build-module/get-query-args.js.map +1 -1
  84. package/build-module/get-query-string.js +2 -2
  85. package/build-module/get-query-string.js.map +1 -1
  86. package/build-module/has-query-arg.js +3 -3
  87. package/build-module/has-query-arg.js.map +1 -1
  88. package/build-module/index.js.map +1 -1
  89. package/build-module/is-email.js +2 -2
  90. package/build-module/is-email.js.map +1 -1
  91. package/build-module/is-phone-number.js +2 -2
  92. package/build-module/is-phone-number.js.map +1 -1
  93. package/build-module/is-url.js +2 -2
  94. package/build-module/is-url.js.map +1 -1
  95. package/build-module/is-valid-authority.js +2 -2
  96. package/build-module/is-valid-authority.js.map +1 -1
  97. package/build-module/is-valid-fragment.js +2 -2
  98. package/build-module/is-valid-fragment.js.map +1 -1
  99. package/build-module/is-valid-path.js +2 -2
  100. package/build-module/is-valid-path.js.map +1 -1
  101. package/build-module/is-valid-protocol.js +2 -2
  102. package/build-module/is-valid-protocol.js.map +1 -1
  103. package/build-module/is-valid-query-string.js +2 -2
  104. package/build-module/is-valid-query-string.js.map +1 -1
  105. package/build-module/normalize-path.js +2 -2
  106. package/build-module/normalize-path.js.map +1 -1
  107. package/build-module/prepend-http.js +2 -2
  108. package/build-module/prepend-http.js.map +1 -1
  109. package/build-module/prepend-https.js +2 -2
  110. package/build-module/prepend-https.js.map +1 -1
  111. package/build-module/remove-query-args.js +3 -3
  112. package/build-module/remove-query-args.js.map +1 -1
  113. package/build-module/safe-decode-uri-component.js +2 -2
  114. package/build-module/safe-decode-uri-component.js.map +1 -1
  115. package/build-module/safe-decode-uri.js +2 -2
  116. package/build-module/safe-decode-uri.js.map +1 -1
  117. package/build-types/add-query-args.d.ts +5 -5
  118. package/build-types/add-query-args.d.ts.map +1 -1
  119. package/build-types/build-query-string.d.ts +3 -3
  120. package/build-types/build-query-string.d.ts.map +1 -1
  121. package/build-types/clean-for-slug.d.ts +3 -3
  122. package/build-types/clean-for-slug.d.ts.map +1 -1
  123. package/build-types/filter-url-for-display.d.ts +4 -4
  124. package/build-types/filter-url-for-display.d.ts.map +1 -1
  125. package/build-types/get-authority.d.ts +3 -3
  126. package/build-types/get-authority.d.ts.map +1 -1
  127. package/build-types/get-filename.d.ts +3 -3
  128. package/build-types/get-filename.d.ts.map +1 -1
  129. package/build-types/get-fragment.d.ts +3 -3
  130. package/build-types/get-fragment.d.ts.map +1 -1
  131. package/build-types/get-path-and-query-string.d.ts +3 -3
  132. package/build-types/get-path-and-query-string.d.ts.map +1 -1
  133. package/build-types/get-path.d.ts +3 -3
  134. package/build-types/get-path.d.ts.map +1 -1
  135. package/build-types/get-protocol.d.ts +3 -3
  136. package/build-types/get-protocol.d.ts.map +1 -1
  137. package/build-types/get-query-arg.d.ts +8 -14
  138. package/build-types/get-query-arg.d.ts.map +1 -1
  139. package/build-types/get-query-args.d.ts +6 -5
  140. package/build-types/get-query-args.d.ts.map +1 -1
  141. package/build-types/get-query-string.d.ts +3 -3
  142. package/build-types/get-query-string.d.ts.map +1 -1
  143. package/build-types/has-query-arg.d.ts +4 -4
  144. package/build-types/has-query-arg.d.ts.map +1 -1
  145. package/build-types/index.d.ts +28 -28
  146. package/build-types/index.d.ts.map +1 -1
  147. package/build-types/is-email.d.ts +3 -3
  148. package/build-types/is-email.d.ts.map +1 -1
  149. package/build-types/is-phone-number.d.ts +3 -3
  150. package/build-types/is-phone-number.d.ts.map +1 -1
  151. package/build-types/is-url.d.ts +3 -3
  152. package/build-types/is-url.d.ts.map +1 -1
  153. package/build-types/is-valid-authority.d.ts +3 -3
  154. package/build-types/is-valid-authority.d.ts.map +1 -1
  155. package/build-types/is-valid-fragment.d.ts +3 -3
  156. package/build-types/is-valid-fragment.d.ts.map +1 -1
  157. package/build-types/is-valid-path.d.ts +3 -3
  158. package/build-types/is-valid-path.d.ts.map +1 -1
  159. package/build-types/is-valid-protocol.d.ts +3 -3
  160. package/build-types/is-valid-protocol.d.ts.map +1 -1
  161. package/build-types/is-valid-query-string.d.ts +3 -3
  162. package/build-types/is-valid-query-string.d.ts.map +1 -1
  163. package/build-types/normalize-path.d.ts +3 -3
  164. package/build-types/normalize-path.d.ts.map +1 -1
  165. package/build-types/prepend-http.d.ts +3 -3
  166. package/build-types/prepend-http.d.ts.map +1 -1
  167. package/build-types/prepend-https.d.ts +3 -3
  168. package/build-types/prepend-https.d.ts.map +1 -1
  169. package/build-types/remove-query-args.d.ts +4 -4
  170. package/build-types/remove-query-args.d.ts.map +1 -1
  171. package/build-types/safe-decode-uri-component.d.ts +3 -3
  172. package/build-types/safe-decode-uri-component.d.ts.map +1 -1
  173. package/build-types/safe-decode-uri.d.ts +3 -3
  174. package/build-types/safe-decode-uri.d.ts.map +1 -1
  175. package/package.json +2 -2
  176. package/src/{add-query-args.js → add-query-args.ts} +8 -5
  177. package/src/{build-query-string.js → build-query-string.ts} +7 -6
  178. package/src/{clean-for-slug.js → clean-for-slug.ts} +3 -3
  179. package/src/{filter-url-for-display.js → filter-url-for-display.ts} +7 -4
  180. package/src/{get-authority.js → get-authority.ts} +3 -3
  181. package/src/{get-filename.js → get-filename.ts} +3 -3
  182. package/src/{get-fragment.js → get-fragment.ts} +3 -3
  183. package/src/{get-path-and-query-string.js → get-path-and-query-string.ts} +3 -3
  184. package/src/{get-path.js → get-path.ts} +3 -3
  185. package/src/{get-protocol.js → get-protocol.ts} +3 -3
  186. package/src/get-query-arg.ts +30 -0
  187. package/src/{get-query-args.js → get-query-args.ts} +9 -12
  188. package/src/{get-query-string.js → get-query-string.ts} +3 -3
  189. package/src/{has-query-arg.js → has-query-arg.ts} +4 -4
  190. package/src/{is-email.js → is-email.ts} +3 -3
  191. package/src/{is-phone-number.js → is-phone-number.ts} +3 -3
  192. package/src/{is-url.js → is-url.ts} +3 -3
  193. package/src/{is-valid-authority.js → is-valid-authority.ts} +3 -3
  194. package/src/{is-valid-fragment.js → is-valid-fragment.ts} +3 -3
  195. package/src/{is-valid-path.js → is-valid-path.ts} +3 -3
  196. package/src/{is-valid-protocol.js → is-valid-protocol.ts} +3 -3
  197. package/src/{is-valid-query-string.js → is-valid-query-string.ts} +3 -3
  198. package/src/{normalize-path.js → normalize-path.ts} +3 -3
  199. package/src/{prepend-http.js → prepend-http.ts} +3 -3
  200. package/src/{prepend-https.js → prepend-https.ts} +3 -3
  201. package/src/{remove-query-args.js → remove-query-args.ts} +4 -4
  202. package/src/{safe-decode-uri-component.js → safe-decode-uri-component.ts} +3 -3
  203. package/src/{safe-decode-uri.js → safe-decode-uri.ts} +3 -3
  204. package/src/test/index.js +2 -2
  205. package/tsconfig.tsbuildinfo +1 -1
  206. package/src/get-query-arg.js +0 -29
  207. /package/src/{index.js → index.ts} +0 -0
@@ -7,15 +7,15 @@ import { buildQueryString } from './build-query-string';
7
7
  /**
8
8
  * Removes arguments from the query string of the url
9
9
  *
10
- * @param {string} url URL.
11
- * @param {...string} args Query Args.
10
+ * @param url URL.
11
+ * @param args Query Args.
12
12
  *
13
13
  * @example
14
14
  * ```js
15
15
  * const newUrl = removeQueryArgs( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar', 'foo', 'bar' ); // https://wordpress.org?baz=foobar
16
16
  * ```
17
17
  *
18
- * @return {string} Updated URL.
18
+ * @return Updated URL.
19
19
  */
20
20
  export function removeQueryArgs(url, ...args) {
21
21
  const fragment = url.replace(/^[^#]*/, '');
@@ -1 +1 @@
1
- {"version":3,"names":["getQueryArgs","buildQueryString","removeQueryArgs","url","args","fragment","replace","queryStringIndex","indexOf","query","baseURL","substr","forEach","arg","queryString","updatedUrl"],"sources":["@wordpress/url/src/remove-query-args.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\nimport { buildQueryString } from './build-query-string';\n\n/**\n * Removes arguments from the query string of the url\n *\n * @param {string} url URL.\n * @param {...string} args Query Args.\n *\n * @example\n * ```js\n * const newUrl = removeQueryArgs( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar', 'foo', 'bar' ); // https://wordpress.org?baz=foobar\n * ```\n *\n * @return {string} Updated URL.\n */\nexport function removeQueryArgs( url, ...args ) {\n\tconst fragment = url.replace( /^[^#]*/, '' );\n\turl = url.replace( /#.*/, '' );\n\n\tconst queryStringIndex = url.indexOf( '?' );\n\tif ( queryStringIndex === -1 ) {\n\t\treturn url + fragment;\n\t}\n\n\tconst query = getQueryArgs( url );\n\tconst baseURL = url.substr( 0, queryStringIndex );\n\targs.forEach( ( arg ) => delete query[ arg ] );\n\tconst queryString = buildQueryString( query );\n\tconst updatedUrl = queryString ? baseURL + '?' + queryString : baseURL;\n\treturn updatedUrl + fragment;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,gBAAgB,QAAQ,sBAAsB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAEC,GAAG,EAAE,GAAGC,IAAI,EAAG;EAC/C,MAAMC,QAAQ,GAAGF,GAAG,CAACG,OAAO,CAAE,QAAQ,EAAE,EAAG,CAAC;EAC5CH,GAAG,GAAGA,GAAG,CAACG,OAAO,CAAE,KAAK,EAAE,EAAG,CAAC;EAE9B,MAAMC,gBAAgB,GAAGJ,GAAG,CAACK,OAAO,CAAE,GAAI,CAAC;EAC3C,IAAKD,gBAAgB,KAAK,CAAC,CAAC,EAAG;IAC9B,OAAOJ,GAAG,GAAGE,QAAQ;EACtB;EAEA,MAAMI,KAAK,GAAGT,YAAY,CAAEG,GAAI,CAAC;EACjC,MAAMO,OAAO,GAAGP,GAAG,CAACQ,MAAM,CAAE,CAAC,EAAEJ,gBAAiB,CAAC;EACjDH,IAAI,CAACQ,OAAO,CAAIC,GAAG,IAAM,OAAOJ,KAAK,CAAEI,GAAG,CAAG,CAAC;EAC9C,MAAMC,WAAW,GAAGb,gBAAgB,CAAEQ,KAAM,CAAC;EAC7C,MAAMM,UAAU,GAAGD,WAAW,GAAGJ,OAAO,GAAG,GAAG,GAAGI,WAAW,GAAGJ,OAAO;EACtE,OAAOK,UAAU,GAAGV,QAAQ;AAC7B","ignoreList":[]}
1
+ {"version":3,"names":["getQueryArgs","buildQueryString","removeQueryArgs","url","args","fragment","replace","queryStringIndex","indexOf","query","baseURL","substr","forEach","arg","queryString","updatedUrl"],"sources":["@wordpress/url/src/remove-query-args.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\nimport { buildQueryString } from './build-query-string';\n\n/**\n * Removes arguments from the query string of the url\n *\n * @param url URL.\n * @param args Query Args.\n *\n * @example\n * ```js\n * const newUrl = removeQueryArgs( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar', 'foo', 'bar' ); // https://wordpress.org?baz=foobar\n * ```\n *\n * @return Updated URL.\n */\nexport function removeQueryArgs( url: string, ...args: string[] ): string {\n\tconst fragment = url.replace( /^[^#]*/, '' );\n\turl = url.replace( /#.*/, '' );\n\n\tconst queryStringIndex = url.indexOf( '?' );\n\tif ( queryStringIndex === -1 ) {\n\t\treturn url + fragment;\n\t}\n\n\tconst query = getQueryArgs( url );\n\tconst baseURL = url.substr( 0, queryStringIndex );\n\targs.forEach( ( arg ) => delete query[ arg ] );\n\tconst queryString = buildQueryString( query );\n\tconst updatedUrl = queryString ? baseURL + '?' + queryString : baseURL;\n\treturn updatedUrl + fragment;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,gBAAgB,QAAQ,sBAAsB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAEC,GAAW,EAAE,GAAGC,IAAc,EAAW;EACzE,MAAMC,QAAQ,GAAGF,GAAG,CAACG,OAAO,CAAE,QAAQ,EAAE,EAAG,CAAC;EAC5CH,GAAG,GAAGA,GAAG,CAACG,OAAO,CAAE,KAAK,EAAE,EAAG,CAAC;EAE9B,MAAMC,gBAAgB,GAAGJ,GAAG,CAACK,OAAO,CAAE,GAAI,CAAC;EAC3C,IAAKD,gBAAgB,KAAK,CAAC,CAAC,EAAG;IAC9B,OAAOJ,GAAG,GAAGE,QAAQ;EACtB;EAEA,MAAMI,KAAK,GAAGT,YAAY,CAAEG,GAAI,CAAC;EACjC,MAAMO,OAAO,GAAGP,GAAG,CAACQ,MAAM,CAAE,CAAC,EAAEJ,gBAAiB,CAAC;EACjDH,IAAI,CAACQ,OAAO,CAAIC,GAAG,IAAM,OAAOJ,KAAK,CAAEI,GAAG,CAAG,CAAC;EAC9C,MAAMC,WAAW,GAAGb,gBAAgB,CAAEQ,KAAM,CAAC;EAC7C,MAAMM,UAAU,GAAGD,WAAW,GAAGJ,OAAO,GAAG,GAAG,GAAGI,WAAW,GAAGJ,OAAO;EACtE,OAAOK,UAAU,GAAGV,QAAQ;AAC7B","ignoreList":[]}
@@ -2,9 +2,9 @@
2
2
  * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if
3
3
  * `decodeURIComponent` throws an error.
4
4
  *
5
- * @param {string} uriComponent URI component to decode.
5
+ * @param uriComponent URI component to decode.
6
6
  *
7
- * @return {string} Decoded URI component if possible.
7
+ * @return Decoded URI component if possible.
8
8
  */
9
9
  export function safeDecodeURIComponent(uriComponent) {
10
10
  try {
@@ -1 +1 @@
1
- {"version":3,"names":["safeDecodeURIComponent","uriComponent","decodeURIComponent","uriComponentError"],"sources":["@wordpress/url/src/safe-decode-uri-component.js"],"sourcesContent":["/**\n * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if\n * `decodeURIComponent` throws an error.\n *\n * @param {string} uriComponent URI component to decode.\n *\n * @return {string} Decoded URI component if possible.\n */\nexport function safeDecodeURIComponent( uriComponent ) {\n\ttry {\n\t\treturn decodeURIComponent( uriComponent );\n\t} catch ( uriComponentError ) {\n\t\treturn uriComponent;\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,sBAAsBA,CAAEC,YAAY,EAAG;EACtD,IAAI;IACH,OAAOC,kBAAkB,CAAED,YAAa,CAAC;EAC1C,CAAC,CAAC,OAAQE,iBAAiB,EAAG;IAC7B,OAAOF,YAAY;EACpB;AACD","ignoreList":[]}
1
+ {"version":3,"names":["safeDecodeURIComponent","uriComponent","decodeURIComponent","uriComponentError"],"sources":["@wordpress/url/src/safe-decode-uri-component.ts"],"sourcesContent":["/**\n * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if\n * `decodeURIComponent` throws an error.\n *\n * @param uriComponent URI component to decode.\n *\n * @return Decoded URI component if possible.\n */\nexport function safeDecodeURIComponent( uriComponent: string ): string {\n\ttry {\n\t\treturn decodeURIComponent( uriComponent );\n\t} catch ( uriComponentError ) {\n\t\treturn uriComponent;\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,sBAAsBA,CAAEC,YAAoB,EAAW;EACtE,IAAI;IACH,OAAOC,kBAAkB,CAAED,YAAa,CAAC;EAC1C,CAAC,CAAC,OAAQE,iBAAiB,EAAG;IAC7B,OAAOF,YAAY;EACpB;AACD","ignoreList":[]}
@@ -2,14 +2,14 @@
2
2
  * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if
3
3
  * `decodeURI` throws an error.
4
4
  *
5
- * @param {string} uri URI to decode.
5
+ * @param uri URI to decode.
6
6
  *
7
7
  * @example
8
8
  * ```js
9
9
  * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'
10
10
  * ```
11
11
  *
12
- * @return {string} Decoded URI if possible.
12
+ * @return Decoded URI if possible.
13
13
  */
14
14
  export function safeDecodeURI(uri) {
15
15
  try {
@@ -1 +1 @@
1
- {"version":3,"names":["safeDecodeURI","uri","decodeURI","uriError"],"sources":["@wordpress/url/src/safe-decode-uri.js"],"sourcesContent":["/**\n * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if\n * `decodeURI` throws an error.\n *\n * @param {string} uri URI to decode.\n *\n * @example\n * ```js\n * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'\n * ```\n *\n * @return {string} Decoded URI if possible.\n */\nexport function safeDecodeURI( uri ) {\n\ttry {\n\t\treturn decodeURI( uri );\n\t} catch ( uriError ) {\n\t\treturn uri;\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAAEC,GAAG,EAAG;EACpC,IAAI;IACH,OAAOC,SAAS,CAAED,GAAI,CAAC;EACxB,CAAC,CAAC,OAAQE,QAAQ,EAAG;IACpB,OAAOF,GAAG;EACX;AACD","ignoreList":[]}
1
+ {"version":3,"names":["safeDecodeURI","uri","decodeURI","uriError"],"sources":["@wordpress/url/src/safe-decode-uri.ts"],"sourcesContent":["/**\n * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if\n * `decodeURI` throws an error.\n *\n * @param uri URI to decode.\n *\n * @example\n * ```js\n * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'\n * ```\n *\n * @return Decoded URI if possible.\n */\nexport function safeDecodeURI( uri: string ): string {\n\ttry {\n\t\treturn decodeURI( uri );\n\t} catch ( uriError ) {\n\t\treturn uri;\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAAEC,GAAW,EAAW;EACpD,IAAI;IACH,OAAOC,SAAS,CAAED,GAAI,CAAC;EACxB,CAAC,CAAC,OAAQE,QAAQ,EAAG;IACpB,OAAOF,GAAG;EACX;AACD","ignoreList":[]}
@@ -3,16 +3,16 @@
3
3
  * includes query arguments, the arguments are merged with (and take precedent
4
4
  * over) the existing set.
5
5
  *
6
- * @param {string} [url=''] URL to which arguments should be appended. If omitted,
7
- * only the resulting querystring is returned.
8
- * @param {Object} [args] Query arguments to apply to URL.
6
+ * @param url URL to which arguments should be appended. If omitted,
7
+ * only the resulting querystring is returned.
8
+ * @param args Query arguments to apply to URL.
9
9
  *
10
10
  * @example
11
11
  * ```js
12
12
  * const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test
13
13
  * ```
14
14
  *
15
- * @return {string} URL with arguments applied.
15
+ * @return URL with arguments applied.
16
16
  */
17
- export function addQueryArgs(url?: string, args?: Object): string;
17
+ export declare function addQueryArgs(url?: string, args?: Record<string, unknown>): string;
18
18
  //# sourceMappingURL=add-query-args.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-query-args.d.ts","sourceRoot":"","sources":["../src/add-query-args.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;GAeG;AACH,mCAXW,MAAM,SAEN,MAAM,GAOL,MAAM,CAsBjB"}
1
+ {"version":3,"file":"add-query-args.d.ts","sourceRoot":"","sources":["../src/add-query-args.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC3B,GAAG,GAAE,MAAW,EAChB,IAAI,CAAC,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,GAC9B,MAAM,CAoBR"}
@@ -18,9 +18,9 @@
18
18
  * // "simple=is%20ok&arrays%5B0%5D=are&arrays%5B1%5D=fine&arrays%5B2%5D=too&objects%5BevenNested%5D%5Bok%5D=yes"
19
19
  * ```
20
20
  *
21
- * @param {Record<string,*>} data Data to encode.
21
+ * @param data Data to encode.
22
22
  *
23
- * @return {string} Query string.
23
+ * @return Query string.
24
24
  */
25
- export function buildQueryString(data: Record<string, any>): string;
25
+ export declare function buildQueryString(data: Record<string, unknown>): string;
26
26
  //# sourceMappingURL=build-query-string.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-query-string.d.ts","sourceRoot":"","sources":["../src/build-query-string.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,uCAJW,MAAM,CAAC,MAAM,EAAC,GAAC,CAAC,GAEf,MAAM,CAsCjB"}
1
+ {"version":3,"file":"build-query-string.d.ts","sourceRoot":"","sources":["../src/build-query-string.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,GAAI,MAAM,CAqC1E"}
@@ -10,9 +10,9 @@
10
10
  * except hyphens. Converts remaining string to lowercase. It does not account
11
11
  * for octets, HTML entities, or other encoded characters.
12
12
  *
13
- * @param {string} string Title or slug to be processed.
13
+ * @param string Title or slug to be processed.
14
14
  *
15
- * @return {string} Processed string.
15
+ * @return Processed string.
16
16
  */
17
- export function cleanForSlug(string: string): string;
17
+ export declare function cleanForSlug(string: string): string;
18
18
  //# sourceMappingURL=clean-for-slug.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clean-for-slug.d.ts","sourceRoot":"","sources":["../src/clean-for-slug.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;GAeG;AACH,qCAJW,MAAM,GAEL,MAAM,CAuBjB"}
1
+ {"version":3,"file":"clean-for-slug.d.ts","sourceRoot":"","sources":["../src/clean-for-slug.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAE,MAAM,EAAE,MAAM,GAAI,MAAM,CAqBrD"}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Returns a URL for display.
3
3
  *
4
- * @param {string} url Original URL.
5
- * @param {number|null} maxLength URL length.
4
+ * @param url Original URL.
5
+ * @param maxLength URL length.
6
6
  *
7
7
  * @example
8
8
  * ```js
@@ -10,7 +10,7 @@
10
10
  * const imageUrl = filterURLForDisplay( 'https://www.wordpress.org/wp-content/uploads/img.png', 20 ); // …ent/uploads/img.png
11
11
  * ```
12
12
  *
13
- * @return {string} Displayed URL.
13
+ * @return Displayed URL.
14
14
  */
15
- export function filterURLForDisplay(url: string, maxLength?: number | null): string;
15
+ export declare function filterURLForDisplay(url: string, maxLength?: number | null): string;
16
16
  //# sourceMappingURL=filter-url-for-display.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter-url-for-display.d.ts","sourceRoot":"","sources":["../src/filter-url-for-display.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,yCAXW,MAAM,cACN,MAAM,GAAC,IAAI,GAQV,MAAM,CAgDjB"}
1
+ {"version":3,"file":"filter-url-for-display.d.ts","sourceRoot":"","sources":["../src/filter-url-for-display.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,MAAM,GAAG,IAAW,GAC7B,MAAM,CA8CR"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Returns the authority part of the URL.
3
3
  *
4
- * @param {string} url The full URL.
4
+ * @param url The full URL.
5
5
  *
6
6
  * @example
7
7
  * ```js
@@ -9,7 +9,7 @@
9
9
  * const authority2 = getAuthority( 'https://localhost:8080/test/' ); // 'localhost:8080'
10
10
  * ```
11
11
  *
12
- * @return {string|void} The authority part of the URL.
12
+ * @return The authority part of the URL.
13
13
  */
14
- export function getAuthority(url: string): string | void;
14
+ export declare function getAuthority(url: string): string | void;
15
15
  //# sourceMappingURL=get-authority.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-authority.d.ts","sourceRoot":"","sources":["../src/get-authority.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,kCAVW,MAAM,GAQL,MAAM,GAAC,IAAI,CAStB"}
1
+ {"version":3,"file":"get-authority.d.ts","sourceRoot":"","sources":["../src/get-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAE,GAAG,EAAE,MAAM,GAAI,MAAM,GAAG,IAAI,CAOzD"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Returns the filename part of the URL.
3
3
  *
4
- * @param {string} url The full URL.
4
+ * @param url The full URL.
5
5
  *
6
6
  * @example
7
7
  * ```js
@@ -9,7 +9,7 @@
9
9
  * const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png'
10
10
  * ```
11
11
  *
12
- * @return {string|void} The filename part of the URL.
12
+ * @return The filename part of the URL.
13
13
  */
14
- export function getFilename(url: string): string | void;
14
+ export declare function getFilename(url: string): string | void;
15
15
  //# sourceMappingURL=get-filename.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-filename.d.ts","sourceRoot":"","sources":["../src/get-filename.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,iCAVW,MAAM,GAQL,MAAM,GAAC,IAAI,CAkBtB"}
1
+ {"version":3,"file":"get-filename.d.ts","sourceRoot":"","sources":["../src/get-filename.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAE,GAAG,EAAE,MAAM,GAAI,MAAM,GAAG,IAAI,CAgBxD"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Returns the fragment part of the URL.
3
3
  *
4
- * @param {string} url The full URL
4
+ * @param url The full URL
5
5
  *
6
6
  * @example
7
7
  * ```js
@@ -9,7 +9,7 @@
9
9
  * const fragment2 = getFragment( 'https://wordpress.org#another-fragment?query=true' ); // '#another-fragment'
10
10
  * ```
11
11
  *
12
- * @return {string|void} The fragment part of the URL.
12
+ * @return The fragment part of the URL.
13
13
  */
14
- export function getFragment(url: string): string | void;
14
+ export declare function getFragment(url: string): string | void;
15
15
  //# sourceMappingURL=get-fragment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-fragment.d.ts","sourceRoot":"","sources":["../src/get-fragment.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,iCAVW,MAAM,GAQL,MAAM,GAAC,IAAI,CAOtB"}
1
+ {"version":3,"file":"get-fragment.d.ts","sourceRoot":"","sources":["../src/get-fragment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAE,GAAG,EAAE,MAAM,GAAI,MAAM,GAAG,IAAI,CAKxD"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Returns the path part and query string part of the URL.
3
3
  *
4
- * @param {string} url The full URL.
4
+ * @param url The full URL.
5
5
  *
6
6
  * @example
7
7
  * ```js
@@ -9,7 +9,7 @@
9
9
  * const pathAndQueryString2 = getPathAndQueryString( 'https://wordpress.org/help/faq/' ); // '/help/faq'
10
10
  * ```
11
11
  *
12
- * @return {string} The path part and query string part of the URL.
12
+ * @return The path part and query string part of the URL.
13
13
  */
14
- export function getPathAndQueryString(url: string): string;
14
+ export declare function getPathAndQueryString(url: string): string;
15
15
  //# sourceMappingURL=get-path-and-query-string.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-path-and-query-string.d.ts","sourceRoot":"","sources":["../src/get-path-and-query-string.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH,2CAVW,MAAM,GAQL,MAAM,CAajB"}
1
+ {"version":3,"file":"get-path-and-query-string.d.ts","sourceRoot":"","sources":["../src/get-path-and-query-string.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAE,GAAG,EAAE,MAAM,GAAI,MAAM,CAW3D"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Returns the path part of the URL.
3
3
  *
4
- * @param {string} url The full URL.
4
+ * @param url The full URL.
5
5
  *
6
6
  * @example
7
7
  * ```js
@@ -9,7 +9,7 @@
9
9
  * const path2 = getPath( 'https://wordpress.org/help/faq/' ); // 'help/faq'
10
10
  * ```
11
11
  *
12
- * @return {string|void} The path part of the URL.
12
+ * @return The path part of the URL.
13
13
  */
14
- export function getPath(url: string): string | void;
14
+ export declare function getPath(url: string): string | void;
15
15
  //# sourceMappingURL=get-path.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-path.d.ts","sourceRoot":"","sources":["../src/get-path.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,6BAVW,MAAM,GAQL,MAAM,GAAC,IAAI,CAQtB"}
1
+ {"version":3,"file":"get-path.d.ts","sourceRoot":"","sources":["../src/get-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAE,GAAG,EAAE,MAAM,GAAI,MAAM,GAAG,IAAI,CAMpD"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Returns the protocol part of the URL.
3
3
  *
4
- * @param {string} url The full URL.
4
+ * @param url The full URL.
5
5
  *
6
6
  * @example
7
7
  * ```js
@@ -9,7 +9,7 @@
9
9
  * const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:'
10
10
  * ```
11
11
  *
12
- * @return {string|void} The protocol part of the URL.
12
+ * @return The protocol part of the URL.
13
13
  */
14
- export function getProtocol(url: string): string | void;
14
+ export declare function getProtocol(url: string): string | void;
15
15
  //# sourceMappingURL=get-protocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-protocol.d.ts","sourceRoot":"","sources":["../src/get-protocol.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,iCAVW,MAAM,GAQL,MAAM,GAAC,IAAI,CAOtB"}
1
+ {"version":3,"file":"get-protocol.d.ts","sourceRoot":"","sources":["../src/get-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAE,GAAG,EAAE,MAAM,GAAI,MAAM,GAAG,IAAI,CAKxD"}
@@ -1,25 +1,19 @@
1
- /**
2
- * @typedef {{[key: string]: QueryArgParsed}} QueryArgObject
3
- */
4
- /**
5
- * @typedef {string|string[]|QueryArgObject} QueryArgParsed
6
- */
1
+ export interface QueryArgObject {
2
+ [key: string]: QueryArgParsed;
3
+ }
4
+ export type QueryArgParsed = string | string[] | QueryArgObject;
7
5
  /**
8
6
  * Returns a single query argument of the url
9
7
  *
10
- * @param {string} url URL.
11
- * @param {string} arg Query arg name.
8
+ * @param url URL.
9
+ * @param arg Query arg name.
12
10
  *
13
11
  * @example
14
12
  * ```js
15
13
  * const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar
16
14
  * ```
17
15
  *
18
- * @return {QueryArgParsed|void} Query arg value.
16
+ * @return Query arg value.
19
17
  */
20
- export function getQueryArg(url: string, arg: string): QueryArgParsed | void;
21
- export type QueryArgObject = {
22
- [key: string]: QueryArgParsed;
23
- };
24
- export type QueryArgParsed = string | string[] | QueryArgObject;
18
+ export declare function getQueryArg(url: string, arg: string): QueryArgParsed | undefined;
25
19
  //# sourceMappingURL=get-query-arg.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-query-arg.d.ts","sourceRoot":"","sources":["../src/get-query-arg.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH,iCAVW,MAAM,OACN,MAAM,GAOL,cAAc,GAAC,IAAI,CAI9B;6BAtBY;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;CAAC;6BAI/B,MAAM,GAAC,MAAM,EAAE,GAAC,cAAc"}
1
+ {"version":3,"file":"get-query-arg.d.ts","sourceRoot":"","sources":["../src/get-query-arg.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,cAAc;IAC9B,CAAE,GAAG,EAAE,MAAM,GAAI,cAAc,CAAC;CAChC;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC;AAEhE;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAC1B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACT,cAAc,GAAG,SAAS,CAE5B"}
@@ -1,8 +1,10 @@
1
+ import type { QueryArgParsed } from './get-query-arg';
2
+ type QueryArgs = Record<string, QueryArgParsed>;
1
3
  /**
2
4
  * Returns an object of query arguments of the given URL. If the given URL is
3
5
  * invalid or has no querystring, an empty object is returned.
4
6
  *
5
- * @param {string} url URL.
7
+ * @param url URL.
6
8
  *
7
9
  * @example
8
10
  * ```js
@@ -10,9 +12,8 @@
10
12
  * // { "foo": "bar", "bar": "baz" }
11
13
  * ```
12
14
  *
13
- * @return {QueryArgs} Query args object.
15
+ * @return Query args object.
14
16
  */
15
- export function getQueryArgs(url: string): QueryArgs;
16
- export type QueryArgParsed = import("./get-query-arg").QueryArgParsed;
17
- export type QueryArgs = Record<string, QueryArgParsed>;
17
+ export declare function getQueryArgs(url: string): QueryArgs;
18
+ export {};
18
19
  //# sourceMappingURL=get-query-args.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-query-args.d.ts","sourceRoot":"","sources":["../src/get-query-args.js"],"names":[],"mappings":"AA2DA;;;;;;;;;;;;;GAaG;AACH,kCAVW,MAAM,GAQL,SAAS,CA2BpB;6BA5Fa,OAAO,iBAAiB,EAAE,cAAc;wBAGzC,MAAM,CAAC,MAAM,EAAC,cAAc,CAAC"}
1
+ {"version":3,"file":"get-query-args.d.ts","sourceRoot":"","sources":["../src/get-query-args.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,KAAK,SAAS,GAAG,MAAM,CAAE,MAAM,EAAE,cAAc,CAAE,CAAC;AAiDlD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAE,GAAG,EAAE,MAAM,GAAI,SAAS,CAyBrD"}
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * Returns the query string part of the URL.
3
3
  *
4
- * @param {string} url The full URL.
4
+ * @param url The full URL.
5
5
  *
6
6
  * @example
7
7
  * ```js
8
8
  * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'
9
9
  * ```
10
10
  *
11
- * @return {string|void} The query string part of the URL.
11
+ * @return The query string part of the URL.
12
12
  */
13
- export function getQueryString(url: string): string | void;
13
+ export declare function getQueryString(url: string): string | void;
14
14
  //# sourceMappingURL=get-query-string.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-query-string.d.ts","sourceRoot":"","sources":["../src/get-query-string.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,oCATW,MAAM,GAOL,MAAM,GAAC,IAAI,CAWtB"}
1
+ {"version":3,"file":"get-query-string.d.ts","sourceRoot":"","sources":["../src/get-query-string.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAE,GAAG,EAAE,MAAM,GAAI,MAAM,GAAG,IAAI,CAS3D"}
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Determines whether the URL contains a given query arg.
3
3
  *
4
- * @param {string} url URL.
5
- * @param {string} arg Query arg name.
4
+ * @param url URL.
5
+ * @param arg Query arg name.
6
6
  *
7
7
  * @example
8
8
  * ```js
9
9
  * const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true
10
10
  * ```
11
11
  *
12
- * @return {boolean} Whether or not the URL contains the query arg.
12
+ * @return Whether or not the URL contains the query arg.
13
13
  */
14
- export function hasQueryArg(url: string, arg: string): boolean;
14
+ export declare function hasQueryArg(url: string, arg: string): boolean;
15
15
  //# sourceMappingURL=has-query-arg.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"has-query-arg.d.ts","sourceRoot":"","sources":["../src/has-query-arg.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH,iCAVW,MAAM,OACN,MAAM,GAOL,OAAO,CAIlB"}
1
+ {"version":3,"file":"has-query-arg.d.ts","sourceRoot":"","sources":["../src/has-query-arg.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAI,OAAO,CAE/D"}
@@ -1,29 +1,29 @@
1
- export { isURL } from "./is-url";
2
- export { isEmail } from "./is-email";
3
- export { isPhoneNumber } from "./is-phone-number";
4
- export { getProtocol } from "./get-protocol";
5
- export { isValidProtocol } from "./is-valid-protocol";
6
- export { getAuthority } from "./get-authority";
7
- export { isValidAuthority } from "./is-valid-authority";
8
- export { getPath } from "./get-path";
9
- export { isValidPath } from "./is-valid-path";
10
- export { getQueryString } from "./get-query-string";
11
- export { buildQueryString } from "./build-query-string";
12
- export { isValidQueryString } from "./is-valid-query-string";
13
- export { getPathAndQueryString } from "./get-path-and-query-string";
14
- export { getFragment } from "./get-fragment";
15
- export { isValidFragment } from "./is-valid-fragment";
16
- export { addQueryArgs } from "./add-query-args";
17
- export { getQueryArg } from "./get-query-arg";
18
- export { getQueryArgs } from "./get-query-args";
19
- export { hasQueryArg } from "./has-query-arg";
20
- export { removeQueryArgs } from "./remove-query-args";
21
- export { prependHTTP } from "./prepend-http";
22
- export { safeDecodeURI } from "./safe-decode-uri";
23
- export { safeDecodeURIComponent } from "./safe-decode-uri-component";
24
- export { filterURLForDisplay } from "./filter-url-for-display";
25
- export { cleanForSlug } from "./clean-for-slug";
26
- export { getFilename } from "./get-filename";
27
- export { normalizePath } from "./normalize-path";
28
- export { prependHTTPS } from "./prepend-https";
1
+ export { isURL } from './is-url';
2
+ export { isEmail } from './is-email';
3
+ export { isPhoneNumber } from './is-phone-number';
4
+ export { getProtocol } from './get-protocol';
5
+ export { isValidProtocol } from './is-valid-protocol';
6
+ export { getAuthority } from './get-authority';
7
+ export { isValidAuthority } from './is-valid-authority';
8
+ export { getPath } from './get-path';
9
+ export { isValidPath } from './is-valid-path';
10
+ export { getQueryString } from './get-query-string';
11
+ export { buildQueryString } from './build-query-string';
12
+ export { isValidQueryString } from './is-valid-query-string';
13
+ export { getPathAndQueryString } from './get-path-and-query-string';
14
+ export { getFragment } from './get-fragment';
15
+ export { isValidFragment } from './is-valid-fragment';
16
+ export { addQueryArgs } from './add-query-args';
17
+ export { getQueryArg } from './get-query-arg';
18
+ export { getQueryArgs } from './get-query-args';
19
+ export { hasQueryArg } from './has-query-arg';
20
+ export { removeQueryArgs } from './remove-query-args';
21
+ export { prependHTTP } from './prepend-http';
22
+ export { safeDecodeURI } from './safe-decode-uri';
23
+ export { safeDecodeURIComponent } from './safe-decode-uri-component';
24
+ export { filterURLForDisplay } from './filter-url-for-display';
25
+ export { cleanForSlug } from './clean-for-slug';
26
+ export { getFilename } from './get-filename';
27
+ export { normalizePath } from './normalize-path';
28
+ export { prependHTTPS } from './prepend-https';
29
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * Determines whether the given string looks like an email.
3
3
  *
4
- * @param {string} email The string to scrutinise.
4
+ * @param email The string to scrutinise.
5
5
  *
6
6
  * @example
7
7
  * ```js
8
8
  * const isEmail = isEmail( 'hello@wordpress.org' ); // true
9
9
  * ```
10
10
  *
11
- * @return {boolean} Whether or not it looks like an email.
11
+ * @return Whether or not it looks like an email.
12
12
  */
13
- export function isEmail(email: string): boolean;
13
+ export declare function isEmail(email: string): boolean;
14
14
  //# sourceMappingURL=is-email.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-email.d.ts","sourceRoot":"","sources":["../src/is-email.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,+BATW,MAAM,GAOL,OAAO,CAIlB"}
1
+ {"version":3,"file":"is-email.d.ts","sourceRoot":"","sources":["../src/is-email.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAE,KAAK,EAAE,MAAM,GAAI,OAAO,CAEhD"}
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * Determines whether the given string looks like a phone number.
3
3
  *
4
- * @param {string} phoneNumber The string to scrutinize.
4
+ * @param phoneNumber The string to scrutinize.
5
5
  *
6
6
  * @example
7
7
  * ```js
8
8
  * const isPhoneNumber = isPhoneNumber('+1 (555) 123-4567'); // true
9
9
  * ```
10
10
  *
11
- * @return {boolean} Whether or not it looks like a phone number.
11
+ * @return Whether or not it looks like a phone number.
12
12
  */
13
- export function isPhoneNumber(phoneNumber: string): boolean;
13
+ export declare function isPhoneNumber(phoneNumber: string): boolean;
14
14
  //# sourceMappingURL=is-phone-number.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-phone-number.d.ts","sourceRoot":"","sources":["../src/is-phone-number.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,2CATW,MAAM,GAOL,OAAO,CAMlB"}
1
+ {"version":3,"file":"is-phone-number.d.ts","sourceRoot":"","sources":["../src/is-phone-number.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAE,WAAW,EAAE,MAAM,GAAI,OAAO,CAI5D"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Determines whether the given string looks like a URL.
3
3
  *
4
- * @param {string} url The string to scrutinise.
4
+ * @param url The string to scrutinise.
5
5
  *
6
6
  * @example
7
7
  * ```js
@@ -11,7 +11,7 @@
11
11
  * @see https://url.spec.whatwg.org/
12
12
  * @see https://url.spec.whatwg.org/#valid-url-string
13
13
  *
14
- * @return {boolean} Whether or not it looks like a URL.
14
+ * @return Whether or not it looks like a URL.
15
15
  */
16
- export function isURL(url: string): boolean;
16
+ export declare function isURL(url: string): boolean;
17
17
  //# sourceMappingURL=is-url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-url.d.ts","sourceRoot":"","sources":["../src/is-url.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,2BAZW,MAAM,GAUL,OAAO,CAWlB"}
1
+ {"version":3,"file":"is-url.d.ts","sourceRoot":"","sources":["../src/is-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAE,GAAG,EAAE,MAAM,GAAI,OAAO,CAS5C"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Checks for invalid characters within the provided authority.
3
3
  *
4
- * @param {string} authority A string containing the URL authority.
4
+ * @param authority A string containing the URL authority.
5
5
  *
6
6
  * @example
7
7
  * ```js
@@ -9,7 +9,7 @@
9
9
  * const isNotValid = isValidAuthority( 'wordpress#org' ); // false
10
10
  * ```
11
11
  *
12
- * @return {boolean} True if the argument contains a valid authority.
12
+ * @return True if the argument contains a valid authority.
13
13
  */
14
- export function isValidAuthority(authority: string): boolean;
14
+ export declare function isValidAuthority(authority: string): boolean;
15
15
  //# sourceMappingURL=is-valid-authority.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-valid-authority.d.ts","sourceRoot":"","sources":["../src/is-valid-authority.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,4CAVW,MAAM,GAQL,OAAO,CAOlB"}
1
+ {"version":3,"file":"is-valid-authority.d.ts","sourceRoot":"","sources":["../src/is-valid-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAE,SAAS,EAAE,MAAM,GAAI,OAAO,CAK7D"}