@wordpress/url 4.26.1-next.719a03cbe.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.
- package/CHANGELOG.md +2 -0
- package/README.md +12 -12
- package/build/add-query-args.js +4 -4
- package/build/add-query-args.js.map +1 -1
- package/build/build-query-string.js +3 -3
- package/build/build-query-string.js.map +1 -1
- package/build/clean-for-slug.js +2 -2
- package/build/clean-for-slug.js.map +1 -1
- package/build/filter-url-for-display.js +3 -3
- package/build/filter-url-for-display.js.map +1 -1
- package/build/get-authority.js +2 -2
- package/build/get-authority.js.map +1 -1
- package/build/get-filename.js +2 -2
- package/build/get-filename.js.map +1 -1
- package/build/get-fragment.js +2 -2
- package/build/get-fragment.js.map +1 -1
- package/build/get-path-and-query-string.js +2 -2
- package/build/get-path-and-query-string.js.map +1 -1
- package/build/get-path.js +2 -2
- package/build/get-path.js.map +1 -1
- package/build/get-protocol.js +2 -2
- package/build/get-protocol.js.map +1 -1
- package/build/get-query-arg.js +3 -11
- package/build/get-query-arg.js.map +1 -1
- package/build/get-query-args.js +5 -11
- package/build/get-query-args.js.map +1 -1
- package/build/get-query-string.js +2 -2
- package/build/get-query-string.js.map +1 -1
- package/build/has-query-arg.js +3 -3
- package/build/has-query-arg.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/is-email.js +2 -2
- package/build/is-email.js.map +1 -1
- package/build/is-phone-number.js +2 -2
- package/build/is-phone-number.js.map +1 -1
- package/build/is-url.js +2 -2
- package/build/is-url.js.map +1 -1
- package/build/is-valid-authority.js +2 -2
- package/build/is-valid-authority.js.map +1 -1
- package/build/is-valid-fragment.js +2 -2
- package/build/is-valid-fragment.js.map +1 -1
- package/build/is-valid-path.js +2 -2
- package/build/is-valid-path.js.map +1 -1
- package/build/is-valid-protocol.js +2 -2
- package/build/is-valid-protocol.js.map +1 -1
- package/build/is-valid-query-string.js +2 -2
- package/build/is-valid-query-string.js.map +1 -1
- package/build/normalize-path.js +2 -2
- package/build/normalize-path.js.map +1 -1
- package/build/prepend-http.js +2 -2
- package/build/prepend-http.js.map +1 -1
- package/build/prepend-https.js +2 -2
- package/build/prepend-https.js.map +1 -1
- package/build/remove-query-args.js +3 -3
- package/build/remove-query-args.js.map +1 -1
- package/build/safe-decode-uri-component.js +2 -2
- package/build/safe-decode-uri-component.js.map +1 -1
- package/build/safe-decode-uri.js +2 -2
- package/build/safe-decode-uri.js.map +1 -1
- package/build-module/add-query-args.js +4 -4
- package/build-module/add-query-args.js.map +1 -1
- package/build-module/build-query-string.js +3 -3
- package/build-module/build-query-string.js.map +1 -1
- package/build-module/clean-for-slug.js +2 -2
- package/build-module/clean-for-slug.js.map +1 -1
- package/build-module/filter-url-for-display.js +3 -3
- package/build-module/filter-url-for-display.js.map +1 -1
- package/build-module/get-authority.js +2 -2
- package/build-module/get-authority.js.map +1 -1
- package/build-module/get-filename.js +2 -2
- package/build-module/get-filename.js.map +1 -1
- package/build-module/get-fragment.js +2 -2
- package/build-module/get-fragment.js.map +1 -1
- package/build-module/get-path-and-query-string.js +2 -2
- package/build-module/get-path-and-query-string.js.map +1 -1
- package/build-module/get-path.js +2 -2
- package/build-module/get-path.js.map +1 -1
- package/build-module/get-protocol.js +2 -2
- package/build-module/get-protocol.js.map +1 -1
- package/build-module/get-query-arg.js +3 -12
- package/build-module/get-query-arg.js.map +1 -1
- package/build-module/get-query-args.js +5 -12
- package/build-module/get-query-args.js.map +1 -1
- package/build-module/get-query-string.js +2 -2
- package/build-module/get-query-string.js.map +1 -1
- package/build-module/has-query-arg.js +3 -3
- package/build-module/has-query-arg.js.map +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/is-email.js +2 -2
- package/build-module/is-email.js.map +1 -1
- package/build-module/is-phone-number.js +2 -2
- package/build-module/is-phone-number.js.map +1 -1
- package/build-module/is-url.js +2 -2
- package/build-module/is-url.js.map +1 -1
- package/build-module/is-valid-authority.js +2 -2
- package/build-module/is-valid-authority.js.map +1 -1
- package/build-module/is-valid-fragment.js +2 -2
- package/build-module/is-valid-fragment.js.map +1 -1
- package/build-module/is-valid-path.js +2 -2
- package/build-module/is-valid-path.js.map +1 -1
- package/build-module/is-valid-protocol.js +2 -2
- package/build-module/is-valid-protocol.js.map +1 -1
- package/build-module/is-valid-query-string.js +2 -2
- package/build-module/is-valid-query-string.js.map +1 -1
- package/build-module/normalize-path.js +2 -2
- package/build-module/normalize-path.js.map +1 -1
- package/build-module/prepend-http.js +2 -2
- package/build-module/prepend-http.js.map +1 -1
- package/build-module/prepend-https.js +2 -2
- package/build-module/prepend-https.js.map +1 -1
- package/build-module/remove-query-args.js +3 -3
- package/build-module/remove-query-args.js.map +1 -1
- package/build-module/safe-decode-uri-component.js +2 -2
- package/build-module/safe-decode-uri-component.js.map +1 -1
- package/build-module/safe-decode-uri.js +2 -2
- package/build-module/safe-decode-uri.js.map +1 -1
- package/build-types/add-query-args.d.ts +5 -5
- package/build-types/add-query-args.d.ts.map +1 -1
- package/build-types/build-query-string.d.ts +3 -3
- package/build-types/build-query-string.d.ts.map +1 -1
- package/build-types/clean-for-slug.d.ts +3 -3
- package/build-types/clean-for-slug.d.ts.map +1 -1
- package/build-types/filter-url-for-display.d.ts +4 -4
- package/build-types/filter-url-for-display.d.ts.map +1 -1
- package/build-types/get-authority.d.ts +3 -3
- package/build-types/get-authority.d.ts.map +1 -1
- package/build-types/get-filename.d.ts +3 -3
- package/build-types/get-filename.d.ts.map +1 -1
- package/build-types/get-fragment.d.ts +3 -3
- package/build-types/get-fragment.d.ts.map +1 -1
- package/build-types/get-path-and-query-string.d.ts +3 -3
- package/build-types/get-path-and-query-string.d.ts.map +1 -1
- package/build-types/get-path.d.ts +3 -3
- package/build-types/get-path.d.ts.map +1 -1
- package/build-types/get-protocol.d.ts +3 -3
- package/build-types/get-protocol.d.ts.map +1 -1
- package/build-types/get-query-arg.d.ts +8 -14
- package/build-types/get-query-arg.d.ts.map +1 -1
- package/build-types/get-query-args.d.ts +6 -5
- package/build-types/get-query-args.d.ts.map +1 -1
- package/build-types/get-query-string.d.ts +3 -3
- package/build-types/get-query-string.d.ts.map +1 -1
- package/build-types/has-query-arg.d.ts +4 -4
- package/build-types/has-query-arg.d.ts.map +1 -1
- package/build-types/index.d.ts +28 -28
- package/build-types/index.d.ts.map +1 -1
- package/build-types/is-email.d.ts +3 -3
- package/build-types/is-email.d.ts.map +1 -1
- package/build-types/is-phone-number.d.ts +3 -3
- package/build-types/is-phone-number.d.ts.map +1 -1
- package/build-types/is-url.d.ts +3 -3
- package/build-types/is-url.d.ts.map +1 -1
- package/build-types/is-valid-authority.d.ts +3 -3
- package/build-types/is-valid-authority.d.ts.map +1 -1
- package/build-types/is-valid-fragment.d.ts +3 -3
- package/build-types/is-valid-fragment.d.ts.map +1 -1
- package/build-types/is-valid-path.d.ts +3 -3
- package/build-types/is-valid-path.d.ts.map +1 -1
- package/build-types/is-valid-protocol.d.ts +3 -3
- package/build-types/is-valid-protocol.d.ts.map +1 -1
- package/build-types/is-valid-query-string.d.ts +3 -3
- package/build-types/is-valid-query-string.d.ts.map +1 -1
- package/build-types/normalize-path.d.ts +3 -3
- package/build-types/normalize-path.d.ts.map +1 -1
- package/build-types/prepend-http.d.ts +3 -3
- package/build-types/prepend-http.d.ts.map +1 -1
- package/build-types/prepend-https.d.ts +3 -3
- package/build-types/prepend-https.d.ts.map +1 -1
- package/build-types/remove-query-args.d.ts +4 -4
- package/build-types/remove-query-args.d.ts.map +1 -1
- package/build-types/safe-decode-uri-component.d.ts +3 -3
- package/build-types/safe-decode-uri-component.d.ts.map +1 -1
- package/build-types/safe-decode-uri.d.ts +3 -3
- package/build-types/safe-decode-uri.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/{add-query-args.js → add-query-args.ts} +8 -5
- package/src/{build-query-string.js → build-query-string.ts} +7 -6
- package/src/{clean-for-slug.js → clean-for-slug.ts} +3 -3
- package/src/{filter-url-for-display.js → filter-url-for-display.ts} +7 -4
- package/src/{get-authority.js → get-authority.ts} +3 -3
- package/src/{get-filename.js → get-filename.ts} +3 -3
- package/src/{get-fragment.js → get-fragment.ts} +3 -3
- package/src/{get-path-and-query-string.js → get-path-and-query-string.ts} +3 -3
- package/src/{get-path.js → get-path.ts} +3 -3
- package/src/{get-protocol.js → get-protocol.ts} +3 -3
- package/src/get-query-arg.ts +30 -0
- package/src/{get-query-args.js → get-query-args.ts} +9 -12
- package/src/{get-query-string.js → get-query-string.ts} +3 -3
- package/src/{has-query-arg.js → has-query-arg.ts} +4 -4
- package/src/{is-email.js → is-email.ts} +3 -3
- package/src/{is-phone-number.js → is-phone-number.ts} +3 -3
- package/src/{is-url.js → is-url.ts} +3 -3
- package/src/{is-valid-authority.js → is-valid-authority.ts} +3 -3
- package/src/{is-valid-fragment.js → is-valid-fragment.ts} +3 -3
- package/src/{is-valid-path.js → is-valid-path.ts} +3 -3
- package/src/{is-valid-protocol.js → is-valid-protocol.ts} +3 -3
- package/src/{is-valid-query-string.js → is-valid-query-string.ts} +3 -3
- package/src/{normalize-path.js → normalize-path.ts} +3 -3
- package/src/{prepend-http.js → prepend-http.ts} +3 -3
- package/src/{prepend-https.js → prepend-https.ts} +3 -3
- package/src/{remove-query-args.js → remove-query-args.ts} +4 -4
- package/src/{safe-decode-uri-component.js → safe-decode-uri-component.ts} +3 -3
- package/src/{safe-decode-uri.js → safe-decode-uri.ts} +3 -3
- package/src/test/index.js +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/src/get-query-arg.js +0 -29
- /package/src/{index.js → index.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns the fragment part of the URL.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
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
|
|
12
|
+
* @return The fragment part of the URL.
|
|
13
13
|
*/
|
|
14
14
|
export function getFragment(url) {
|
|
15
15
|
const matches = /^\S+?(#[^\s\?]*)/.exec(url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getFragment","url","matches","exec"],"sources":["@wordpress/url/src/get-fragment.
|
|
1
|
+
{"version":3,"names":["getFragment","url","matches","exec"],"sources":["@wordpress/url/src/get-fragment.ts"],"sourcesContent":["/**\n * Returns the fragment part of the URL.\n *\n * @param url The full URL\n *\n * @example\n * ```js\n * const fragment1 = getFragment( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // '#fragment'\n * const fragment2 = getFragment( 'https://wordpress.org#another-fragment?query=true' ); // '#another-fragment'\n * ```\n *\n * @return The fragment part of the URL.\n */\nexport function getFragment( url: string ): string | void {\n\tconst matches = /^\\S+?(#[^\\s\\?]*)/.exec( url );\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,WAAWA,CAAEC,GAAW,EAAkB;EACzD,MAAMC,OAAO,GAAG,kBAAkB,CAACC,IAAI,CAAEF,GAAI,CAAC;EAC9C,IAAKC,OAAO,EAAG;IACd,OAAOA,OAAO,CAAE,CAAC,CAAE;EACpB;AACD","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ import { getPath, getQueryString } from '.';
|
|
|
6
6
|
/**
|
|
7
7
|
* Returns the path part and query string part of the URL.
|
|
8
8
|
*
|
|
9
|
-
* @param
|
|
9
|
+
* @param url The full URL.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```js
|
|
@@ -14,7 +14,7 @@ import { getPath, getQueryString } from '.';
|
|
|
14
14
|
* const pathAndQueryString2 = getPathAndQueryString( 'https://wordpress.org/help/faq/' ); // '/help/faq'
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
-
* @return
|
|
17
|
+
* @return The path part and query string part of the URL.
|
|
18
18
|
*/
|
|
19
19
|
export function getPathAndQueryString(url) {
|
|
20
20
|
const path = getPath(url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getPath","getQueryString","getPathAndQueryString","url","path","queryString","value"],"sources":["@wordpress/url/src/get-path-and-query-string.
|
|
1
|
+
{"version":3,"names":["getPath","getQueryString","getPathAndQueryString","url","path","queryString","value"],"sources":["@wordpress/url/src/get-path-and-query-string.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getPath, getQueryString } from '.';\n\n/**\n * Returns the path part and query string part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const pathAndQueryString1 = getPathAndQueryString( 'http://localhost:8080/this/is/a/test?query=true' ); // '/this/is/a/test?query=true'\n * const pathAndQueryString2 = getPathAndQueryString( 'https://wordpress.org/help/faq/' ); // '/help/faq'\n * ```\n *\n * @return The path part and query string part of the URL.\n */\nexport function getPathAndQueryString( url: string ): string {\n\tconst path = getPath( url );\n\tconst queryString = getQueryString( url );\n\tlet value = '/';\n\tif ( path ) {\n\t\tvalue += path;\n\t}\n\tif ( queryString ) {\n\t\tvalue += `?${ queryString }`;\n\t}\n\treturn value;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,cAAc,QAAQ,GAAG;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAAEC,GAAW,EAAW;EAC5D,MAAMC,IAAI,GAAGJ,OAAO,CAAEG,GAAI,CAAC;EAC3B,MAAME,WAAW,GAAGJ,cAAc,CAAEE,GAAI,CAAC;EACzC,IAAIG,KAAK,GAAG,GAAG;EACf,IAAKF,IAAI,EAAG;IACXE,KAAK,IAAIF,IAAI;EACd;EACA,IAAKC,WAAW,EAAG;IAClBC,KAAK,IAAI,IAAKD,WAAW,EAAG;EAC7B;EACA,OAAOC,KAAK;AACb","ignoreList":[]}
|
package/build-module/get-path.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns the path part of the URL.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
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
|
|
12
|
+
* @return The path part of the URL.
|
|
13
13
|
*/
|
|
14
14
|
export function getPath(url) {
|
|
15
15
|
const matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getPath","url","matches","exec"],"sources":["@wordpress/url/src/get-path.
|
|
1
|
+
{"version":3,"names":["getPath","url","matches","exec"],"sources":["@wordpress/url/src/get-path.ts"],"sourcesContent":["/**\n * Returns the path part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const path1 = getPath( 'http://localhost:8080/this/is/a/test?query=true' ); // 'this/is/a/test'\n * const path2 = getPath( 'https://wordpress.org/help/faq/' ); // 'help/faq'\n * ```\n *\n * @return The path part of the URL.\n */\nexport function getPath( url: string ): string | void {\n\tconst matches =\n\t\t/^[^\\/\\s:]+:(?:\\/\\/)?[^\\/\\s#?]+[\\/]([^\\s#?]+)[#?]{0,1}\\S*$/.exec( url );\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,OAAOA,CAAEC,GAAW,EAAkB;EACrD,MAAMC,OAAO,GACZ,2DAA2D,CAACC,IAAI,CAAEF,GAAI,CAAC;EACxE,IAAKC,OAAO,EAAG;IACd,OAAOA,OAAO,CAAE,CAAC,CAAE;EACpB;AACD","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns the protocol part of the URL.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
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
|
|
12
|
+
* @return The protocol part of the URL.
|
|
13
13
|
*/
|
|
14
14
|
export function getProtocol(url) {
|
|
15
15
|
const matches = /^([^\s:]+:)/.exec(url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getProtocol","url","matches","exec"],"sources":["@wordpress/url/src/get-protocol.
|
|
1
|
+
{"version":3,"names":["getProtocol","url","matches","exec"],"sources":["@wordpress/url/src/get-protocol.ts"],"sourcesContent":["/**\n * Returns the protocol part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const protocol1 = getProtocol( 'tel:012345678' ); // 'tel:'\n * const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:'\n * ```\n *\n * @return The protocol part of the URL.\n */\nexport function getProtocol( url: string ): string | void {\n\tconst matches = /^([^\\s:]+:)/.exec( url );\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,WAAWA,CAAEC,GAAW,EAAkB;EACzD,MAAMC,OAAO,GAAG,aAAa,CAACC,IAAI,CAAEF,GAAI,CAAC;EACzC,IAAKC,OAAO,EAAG;IACd,OAAOA,OAAO,CAAE,CAAC,CAAE;EACpB;AACD","ignoreList":[]}
|
|
@@ -2,27 +2,18 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { getQueryArgs } from './get-query-args';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {{[key: string]: QueryArgParsed}} QueryArgObject
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @typedef {string|string[]|QueryArgObject} QueryArgParsed
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
5
|
/**
|
|
15
6
|
* Returns a single query argument of the url
|
|
16
7
|
*
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
8
|
+
* @param url URL.
|
|
9
|
+
* @param arg Query arg name.
|
|
19
10
|
*
|
|
20
11
|
* @example
|
|
21
12
|
* ```js
|
|
22
13
|
* const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar
|
|
23
14
|
* ```
|
|
24
15
|
*
|
|
25
|
-
* @return
|
|
16
|
+
* @return Query arg value.
|
|
26
17
|
*/
|
|
27
18
|
export function getQueryArg(url, arg) {
|
|
28
19
|
return getQueryArgs(url)[arg];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getQueryArgs","getQueryArg","url","arg"],"sources":["@wordpress/url/src/get-query-arg.
|
|
1
|
+
{"version":3,"names":["getQueryArgs","getQueryArg","url","arg"],"sources":["@wordpress/url/src/get-query-arg.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\n\nexport interface QueryArgObject {\n\t[ key: string ]: QueryArgParsed;\n}\n\nexport type QueryArgParsed = string | string[] | QueryArgObject;\n\n/**\n * Returns a single query argument of the url\n *\n * @param url URL.\n * @param arg Query arg name.\n *\n * @example\n * ```js\n * const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar\n * ```\n *\n * @return Query arg value.\n */\nexport function getQueryArg(\n\turl: string,\n\targ: string\n): QueryArgParsed | undefined {\n\treturn getQueryArgs( url )[ arg ];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,kBAAkB;AAQ/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAC1BC,GAAW,EACXC,GAAW,EACkB;EAC7B,OAAOH,YAAY,CAAEE,GAAI,CAAC,CAAEC,GAAG,CAAE;AAClC","ignoreList":[]}
|
|
@@ -3,20 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { safeDecodeURIComponent } from './safe-decode-uri-component';
|
|
5
5
|
import { getQueryString } from './get-query-string';
|
|
6
|
-
|
|
7
|
-
/** @typedef {import('./get-query-arg').QueryArgParsed} QueryArgParsed */
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {Record<string,QueryArgParsed>} QueryArgs
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
6
|
/**
|
|
14
7
|
* Sets a value in object deeply by a given array of path segments. Mutates the
|
|
15
8
|
* object reference.
|
|
16
9
|
*
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
19
|
-
* @param
|
|
10
|
+
* @param object Object in which to assign.
|
|
11
|
+
* @param path Path segment at which to set value.
|
|
12
|
+
* @param value Value to set.
|
|
20
13
|
*/
|
|
21
14
|
function setPath(object, path, value) {
|
|
22
15
|
const length = path.length;
|
|
@@ -56,7 +49,7 @@ function setPath(object, path, value) {
|
|
|
56
49
|
* Returns an object of query arguments of the given URL. If the given URL is
|
|
57
50
|
* invalid or has no querystring, an empty object is returned.
|
|
58
51
|
*
|
|
59
|
-
* @param
|
|
52
|
+
* @param url URL.
|
|
60
53
|
*
|
|
61
54
|
* @example
|
|
62
55
|
* ```js
|
|
@@ -64,7 +57,7 @@ function setPath(object, path, value) {
|
|
|
64
57
|
* // { "foo": "bar", "bar": "baz" }
|
|
65
58
|
* ```
|
|
66
59
|
*
|
|
67
|
-
* @return
|
|
60
|
+
* @return Query args object.
|
|
68
61
|
*/
|
|
69
62
|
export function getQueryArgs(url) {
|
|
70
63
|
return (getQueryString(url) || ''
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["safeDecodeURIComponent","getQueryString","setPath","object","path","value","length","lastIndex","i","key","Array","isArray","toString","includes","toUpperCase","isNextKeyArrayIndex","isNaN","Number","getQueryArgs","url","replace","split","reduce","accumulator","keyValue","filter","Boolean","map","segments","Object","create"],"sources":["@wordpress/url/src/get-query-args.
|
|
1
|
+
{"version":3,"names":["safeDecodeURIComponent","getQueryString","setPath","object","path","value","length","lastIndex","i","key","Array","isArray","toString","includes","toUpperCase","isNextKeyArrayIndex","isNaN","Number","getQueryArgs","url","replace","split","reduce","accumulator","keyValue","filter","Boolean","map","segments","Object","create"],"sources":["@wordpress/url/src/get-query-args.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { safeDecodeURIComponent } from './safe-decode-uri-component';\nimport { getQueryString } from './get-query-string';\nimport type { QueryArgParsed } from './get-query-arg';\n\ntype QueryArgs = Record< string, QueryArgParsed >;\n\n/**\n * Sets a value in object deeply by a given array of path segments. Mutates the\n * object reference.\n *\n * @param object Object in which to assign.\n * @param path Path segment at which to set value.\n * @param value Value to set.\n */\nfunction setPath( object: Record< string, any >, path: string[], value: any ) {\n\tconst length = path.length;\n\tconst lastIndex = length - 1;\n\tfor ( let i = 0; i < length; i++ ) {\n\t\tlet key = path[ i ];\n\n\t\tif ( ! key && Array.isArray( object ) ) {\n\t\t\t// If key is empty string and next value is array, derive key from\n\t\t\t// the current length of the array.\n\t\t\tkey = object.length.toString();\n\t\t}\n\n\t\tkey = [ '__proto__', 'constructor', 'prototype' ].includes( key )\n\t\t\t? key.toUpperCase()\n\t\t\t: key;\n\n\t\t// If the next key in the path is numeric (or empty string), it will be\n\t\t// created as an array. Otherwise, it will be created as an object.\n\t\tconst isNextKeyArrayIndex = ! isNaN( Number( path[ i + 1 ] ) );\n\n\t\tobject[ key ] =\n\t\t\ti === lastIndex\n\t\t\t\t? // If at end of path, assign the intended value.\n\t\t\t\t value\n\t\t\t\t: // Otherwise, advance to the next object in the path, creating\n\t\t\t\t // it if it does not yet exist.\n\t\t\t\t object[ key ] || ( isNextKeyArrayIndex ? [] : {} );\n\n\t\tif ( Array.isArray( object[ key ] ) && ! isNextKeyArrayIndex ) {\n\t\t\t// If we current key is non-numeric, but the next value is an\n\t\t\t// array, coerce the value to an object.\n\t\t\tobject[ key ] = { ...object[ key ] };\n\t\t}\n\n\t\t// Update working reference object to the next in the path.\n\t\tobject = object[ key ];\n\t}\n}\n\n/**\n * Returns an object of query arguments of the given URL. If the given URL is\n * invalid or has no querystring, an empty object is returned.\n *\n * @param url URL.\n *\n * @example\n * ```js\n * const foo = getQueryArgs( 'https://wordpress.org?foo=bar&bar=baz' );\n * // { \"foo\": \"bar\", \"bar\": \"baz\" }\n * ```\n *\n * @return Query args object.\n */\nexport function getQueryArgs( url: string ): QueryArgs {\n\treturn (\n\t\t( getQueryString( url ) || '' )\n\t\t\t// Normalize space encoding, accounting for PHP URL encoding\n\t\t\t// corresponding to `application/x-www-form-urlencoded`.\n\t\t\t//\n\t\t\t// See: https://tools.ietf.org/html/rfc1866#section-8.2.1\n\t\t\t.replace( /\\+/g, '%20' )\n\t\t\t.split( '&' )\n\t\t\t.reduce( ( accumulator, keyValue ) => {\n\t\t\t\tconst [ key, value = '' ] = keyValue\n\t\t\t\t\t.split( '=' )\n\t\t\t\t\t// Filtering avoids decoding as `undefined` for value, where\n\t\t\t\t\t// default is restored in destructuring assignment.\n\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t.map( safeDecodeURIComponent );\n\n\t\t\t\tif ( key ) {\n\t\t\t\t\tconst segments = key.replace( /\\]/g, '' ).split( '[' );\n\t\t\t\t\tsetPath( accumulator, segments, value );\n\t\t\t\t}\n\n\t\t\t\treturn accumulator;\n\t\t\t}, Object.create( null ) )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,6BAA6B;AACpE,SAASC,cAAc,QAAQ,oBAAoB;AAKnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,OAAOA,CAAEC,MAA6B,EAAEC,IAAc,EAAEC,KAAU,EAAG;EAC7E,MAAMC,MAAM,GAAGF,IAAI,CAACE,MAAM;EAC1B,MAAMC,SAAS,GAAGD,MAAM,GAAG,CAAC;EAC5B,KAAM,IAAIE,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,EAAEE,CAAC,EAAE,EAAG;IAClC,IAAIC,GAAG,GAAGL,IAAI,CAAEI,CAAC,CAAE;IAEnB,IAAK,CAAEC,GAAG,IAAIC,KAAK,CAACC,OAAO,CAAER,MAAO,CAAC,EAAG;MACvC;MACA;MACAM,GAAG,GAAGN,MAAM,CAACG,MAAM,CAACM,QAAQ,CAAC,CAAC;IAC/B;IAEAH,GAAG,GAAG,CAAE,WAAW,EAAE,aAAa,EAAE,WAAW,CAAE,CAACI,QAAQ,CAAEJ,GAAI,CAAC,GAC9DA,GAAG,CAACK,WAAW,CAAC,CAAC,GACjBL,GAAG;;IAEN;IACA;IACA,MAAMM,mBAAmB,GAAG,CAAEC,KAAK,CAAEC,MAAM,CAAEb,IAAI,CAAEI,CAAC,GAAG,CAAC,CAAG,CAAE,CAAC;IAE9DL,MAAM,CAAEM,GAAG,CAAE,GACZD,CAAC,KAAKD,SAAS;IACZ;IACAF,KAAK;IACL;IACA;IACAF,MAAM,CAAEM,GAAG,CAAE,KAAMM,mBAAmB,GAAG,EAAE,GAAG,CAAC,CAAC,CAAE;IAEtD,IAAKL,KAAK,CAACC,OAAO,CAAER,MAAM,CAAEM,GAAG,CAAG,CAAC,IAAI,CAAEM,mBAAmB,EAAG;MAC9D;MACA;MACAZ,MAAM,CAAEM,GAAG,CAAE,GAAG;QAAE,GAAGN,MAAM,CAAEM,GAAG;MAAG,CAAC;IACrC;;IAEA;IACAN,MAAM,GAAGA,MAAM,CAAEM,GAAG,CAAE;EACvB;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,YAAYA,CAAEC,GAAW,EAAc;EACtD,OACC,CAAElB,cAAc,CAAEkB,GAAI,CAAC,IAAI;EAC1B;EACA;EACA;EACA;EAAA,EACCC,OAAO,CAAE,KAAK,EAAE,KAAM,CAAC,CACvBC,KAAK,CAAE,GAAI,CAAC,CACZC,MAAM,CAAE,CAAEC,WAAW,EAAEC,QAAQ,KAAM;IACrC,MAAM,CAAEf,GAAG,EAAEJ,KAAK,GAAG,EAAE,CAAE,GAAGmB,QAAQ,CAClCH,KAAK,CAAE,GAAI;IACZ;IACA;IAAA,CACCI,MAAM,CAAEC,OAAQ,CAAC,CACjBC,GAAG,CAAE3B,sBAAuB,CAAC;IAE/B,IAAKS,GAAG,EAAG;MACV,MAAMmB,QAAQ,GAAGnB,GAAG,CAACW,OAAO,CAAE,KAAK,EAAE,EAAG,CAAC,CAACC,KAAK,CAAE,GAAI,CAAC;MACtDnB,OAAO,CAAEqB,WAAW,EAAEK,QAAQ,EAAEvB,KAAM,CAAC;IACxC;IAEA,OAAOkB,WAAW;EACnB,CAAC,EAAEM,MAAM,CAACC,MAAM,CAAE,IAAK,CAAE,CAAC;AAE7B","ignoreList":[]}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns the query string part of the URL.
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param url The full URL.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```js
|
|
9
9
|
* const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'
|
|
10
10
|
* ```
|
|
11
11
|
*
|
|
12
|
-
* @return
|
|
12
|
+
* @return The query string part of the URL.
|
|
13
13
|
*/
|
|
14
14
|
export function getQueryString(url) {
|
|
15
15
|
let query;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getQueryString","url","query","URL","search","substring","error"],"sources":["@wordpress/url/src/get-query-string.
|
|
1
|
+
{"version":3,"names":["getQueryString","url","query","URL","search","substring","error"],"sources":["@wordpress/url/src/get-query-string.ts"],"sourcesContent":["/**\n * Returns the query string part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'\n * ```\n *\n * @return The query string part of the URL.\n */\nexport function getQueryString( url: string ): string | void {\n\tlet query;\n\ttry {\n\t\tquery = new URL( url, 'http://example.com' ).search.substring( 1 );\n\t} catch ( error ) {}\n\n\tif ( query ) {\n\t\treturn query;\n\t}\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,cAAcA,CAAEC,GAAW,EAAkB;EAC5D,IAAIC,KAAK;EACT,IAAI;IACHA,KAAK,GAAG,IAAIC,GAAG,CAAEF,GAAG,EAAE,oBAAqB,CAAC,CAACG,MAAM,CAACC,SAAS,CAAE,CAAE,CAAC;EACnE,CAAC,CAAC,OAAQC,KAAK,EAAG,CAAC;EAEnB,IAAKJ,KAAK,EAAG;IACZ,OAAOA,KAAK;EACb;AACD","ignoreList":[]}
|
|
@@ -6,15 +6,15 @@ import { getQueryArg } from './get-query-arg';
|
|
|
6
6
|
/**
|
|
7
7
|
* Determines whether the URL contains a given query arg.
|
|
8
8
|
*
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
9
|
+
* @param url URL.
|
|
10
|
+
* @param arg Query arg name.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```js
|
|
14
14
|
* const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
-
* @return
|
|
17
|
+
* @return Whether or not the URL contains the query arg.
|
|
18
18
|
*/
|
|
19
19
|
export function hasQueryArg(url, arg) {
|
|
20
20
|
return getQueryArg(url, arg) !== undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getQueryArg","hasQueryArg","url","arg","undefined"],"sources":["@wordpress/url/src/has-query-arg.
|
|
1
|
+
{"version":3,"names":["getQueryArg","hasQueryArg","url","arg","undefined"],"sources":["@wordpress/url/src/has-query-arg.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getQueryArg } from './get-query-arg';\n\n/**\n * Determines whether the URL contains a given query arg.\n *\n * @param url URL.\n * @param arg Query arg name.\n *\n * @example\n * ```js\n * const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true\n * ```\n *\n * @return Whether or not the URL contains the query arg.\n */\nexport function hasQueryArg( url: string, arg: string ): boolean {\n\treturn getQueryArg( url, arg ) !== undefined;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAEC,GAAW,EAAEC,GAAW,EAAY;EAChE,OAAOH,WAAW,CAAEE,GAAG,EAAEC,GAAI,CAAC,KAAKC,SAAS;AAC7C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isURL","isEmail","isPhoneNumber","getProtocol","isValidProtocol","getAuthority","isValidAuthority","getPath","isValidPath","getQueryString","buildQueryString","isValidQueryString","getPathAndQueryString","getFragment","isValidFragment","addQueryArgs","getQueryArg","getQueryArgs","hasQueryArg","removeQueryArgs","prependHTTP","safeDecodeURI","safeDecodeURIComponent","filterURLForDisplay","cleanForSlug","getFilename","normalizePath","prependHTTPS"],"sources":["@wordpress/url/src/index.
|
|
1
|
+
{"version":3,"names":["isURL","isEmail","isPhoneNumber","getProtocol","isValidProtocol","getAuthority","isValidAuthority","getPath","isValidPath","getQueryString","buildQueryString","isValidQueryString","getPathAndQueryString","getFragment","isValidFragment","addQueryArgs","getQueryArg","getQueryArgs","hasQueryArg","removeQueryArgs","prependHTTP","safeDecodeURI","safeDecodeURIComponent","filterURLForDisplay","cleanForSlug","getFilename","normalizePath","prependHTTPS"],"sources":["@wordpress/url/src/index.ts"],"sourcesContent":["export { isURL } from './is-url';\nexport { isEmail } from './is-email';\nexport { isPhoneNumber } from './is-phone-number';\nexport { getProtocol } from './get-protocol';\nexport { isValidProtocol } from './is-valid-protocol';\nexport { getAuthority } from './get-authority';\nexport { isValidAuthority } from './is-valid-authority';\nexport { getPath } from './get-path';\nexport { isValidPath } from './is-valid-path';\nexport { getQueryString } from './get-query-string';\nexport { buildQueryString } from './build-query-string';\nexport { isValidQueryString } from './is-valid-query-string';\nexport { getPathAndQueryString } from './get-path-and-query-string';\nexport { getFragment } from './get-fragment';\nexport { isValidFragment } from './is-valid-fragment';\nexport { addQueryArgs } from './add-query-args';\nexport { getQueryArg } from './get-query-arg';\nexport { getQueryArgs } from './get-query-args';\nexport { hasQueryArg } from './has-query-arg';\nexport { removeQueryArgs } from './remove-query-args';\nexport { prependHTTP } from './prepend-http';\nexport { safeDecodeURI } from './safe-decode-uri';\nexport { safeDecodeURIComponent } from './safe-decode-uri-component';\nexport { filterURLForDisplay } from './filter-url-for-display';\nexport { cleanForSlug } from './clean-for-slug';\nexport { getFilename } from './get-filename';\nexport { normalizePath } from './normalize-path';\nexport { prependHTTPS } from './prepend-https';\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,UAAU;AAChC,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,qBAAqB,QAAQ,6BAA6B;AACnE,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,sBAAsB,QAAQ,6BAA6B;AACpE,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,YAAY,QAAQ,iBAAiB","ignoreList":[]}
|
package/build-module/is-email.js
CHANGED
|
@@ -3,14 +3,14 @@ const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}
|
|
|
3
3
|
/**
|
|
4
4
|
* Determines whether the given string looks like an email.
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param email The string to scrutinise.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```js
|
|
10
10
|
* const isEmail = isEmail( 'hello@wordpress.org' ); // true
|
|
11
11
|
* ```
|
|
12
12
|
*
|
|
13
|
-
* @return
|
|
13
|
+
* @return Whether or not it looks like an email.
|
|
14
14
|
*/
|
|
15
15
|
export function isEmail(email) {
|
|
16
16
|
return EMAIL_REGEXP.test(email);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EMAIL_REGEXP","isEmail","email","test"],"sources":["@wordpress/url/src/is-email.
|
|
1
|
+
{"version":3,"names":["EMAIL_REGEXP","isEmail","email","test"],"sources":["@wordpress/url/src/is-email.ts"],"sourcesContent":["const EMAIL_REGEXP =\n\t/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\\.[a-z]{2,63}$/i;\n\n/**\n * Determines whether the given string looks like an email.\n *\n * @param email The string to scrutinise.\n *\n * @example\n * ```js\n * const isEmail = isEmail( 'hello@wordpress.org' ); // true\n * ```\n *\n * @return Whether or not it looks like an email.\n */\nexport function isEmail( email: string ): boolean {\n\treturn EMAIL_REGEXP.test( email );\n}\n"],"mappings":"AAAA,MAAMA,YAAY,GACjB,8DAA8D;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CAAEC,KAAa,EAAY;EACjD,OAAOF,YAAY,CAACG,IAAI,CAAED,KAAM,CAAC;AAClC","ignoreList":[]}
|
|
@@ -3,14 +3,14 @@ const PHONE_REGEXP = /^(tel:)?(\+)?\d{6,15}$/;
|
|
|
3
3
|
/**
|
|
4
4
|
* Determines whether the given string looks like a phone number.
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param phoneNumber The string to scrutinize.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```js
|
|
10
10
|
* const isPhoneNumber = isPhoneNumber('+1 (555) 123-4567'); // true
|
|
11
11
|
* ```
|
|
12
12
|
*
|
|
13
|
-
* @return
|
|
13
|
+
* @return Whether or not it looks like a phone number.
|
|
14
14
|
*/
|
|
15
15
|
export function isPhoneNumber(phoneNumber) {
|
|
16
16
|
// Remove any separator from phone number.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PHONE_REGEXP","isPhoneNumber","phoneNumber","replace","test"],"sources":["@wordpress/url/src/is-phone-number.
|
|
1
|
+
{"version":3,"names":["PHONE_REGEXP","isPhoneNumber","phoneNumber","replace","test"],"sources":["@wordpress/url/src/is-phone-number.ts"],"sourcesContent":["const PHONE_REGEXP = /^(tel:)?(\\+)?\\d{6,15}$/;\n\n/**\n * Determines whether the given string looks like a phone number.\n *\n * @param phoneNumber The string to scrutinize.\n *\n * @example\n * ```js\n * const isPhoneNumber = isPhoneNumber('+1 (555) 123-4567'); // true\n * ```\n *\n * @return Whether or not it looks like a phone number.\n */\nexport function isPhoneNumber( phoneNumber: string ): boolean {\n\t// Remove any separator from phone number.\n\tphoneNumber = phoneNumber.replace( /[-.() ]/g, '' );\n\treturn PHONE_REGEXP.test( phoneNumber );\n}\n"],"mappings":"AAAA,MAAMA,YAAY,GAAG,wBAAwB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,WAAmB,EAAY;EAC7D;EACAA,WAAW,GAAGA,WAAW,CAACC,OAAO,CAAE,UAAU,EAAE,EAAG,CAAC;EACnD,OAAOH,YAAY,CAACI,IAAI,CAAEF,WAAY,CAAC;AACxC","ignoreList":[]}
|
package/build-module/is-url.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Determines whether the given string looks like a URL.
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param url The string to scrutinise.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```js
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* @see https://url.spec.whatwg.org/
|
|
13
13
|
* @see https://url.spec.whatwg.org/#valid-url-string
|
|
14
14
|
*
|
|
15
|
-
* @return
|
|
15
|
+
* @return Whether or not it looks like a URL.
|
|
16
16
|
*/
|
|
17
17
|
export function isURL(url) {
|
|
18
18
|
// A URL can be considered value if the `URL` constructor is able to parse
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isURL","url","URL"],"sources":["@wordpress/url/src/is-url.
|
|
1
|
+
{"version":3,"names":["isURL","url","URL"],"sources":["@wordpress/url/src/is-url.ts"],"sourcesContent":["/**\n * Determines whether the given string looks like a URL.\n *\n * @param url The string to scrutinise.\n *\n * @example\n * ```js\n * const isURL = isURL( 'https://wordpress.org' ); // true\n * ```\n *\n * @see https://url.spec.whatwg.org/\n * @see https://url.spec.whatwg.org/#valid-url-string\n *\n * @return Whether or not it looks like a URL.\n */\nexport function isURL( url: string ): boolean {\n\t// A URL can be considered value if the `URL` constructor is able to parse\n\t// it. The constructor throws an error for an invalid URL.\n\ttry {\n\t\tnew URL( url );\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,KAAKA,CAAEC,GAAW,EAAY;EAC7C;EACA;EACA,IAAI;IACH,IAAIC,GAAG,CAAED,GAAI,CAAC;IACd,OAAO,IAAI;EACZ,CAAC,CAAC,MAAM;IACP,OAAO,KAAK;EACb;AACD","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks for invalid characters within the provided authority.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
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
|
|
12
|
+
* @return True if the argument contains a valid authority.
|
|
13
13
|
*/
|
|
14
14
|
export function isValidAuthority(authority) {
|
|
15
15
|
if (!authority) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isValidAuthority","authority","test"],"sources":["@wordpress/url/src/is-valid-authority.
|
|
1
|
+
{"version":3,"names":["isValidAuthority","authority","test"],"sources":["@wordpress/url/src/is-valid-authority.ts"],"sourcesContent":["/**\n * Checks for invalid characters within the provided authority.\n *\n * @param authority A string containing the URL authority.\n *\n * @example\n * ```js\n * const isValid = isValidAuthority( 'wordpress.org' ); // true\n * const isNotValid = isValidAuthority( 'wordpress#org' ); // false\n * ```\n *\n * @return True if the argument contains a valid authority.\n */\nexport function isValidAuthority( authority: string ): boolean {\n\tif ( ! authority ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?]+$/.test( authority );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,gBAAgBA,CAAEC,SAAiB,EAAY;EAC9D,IAAK,CAAEA,SAAS,EAAG;IAClB,OAAO,KAAK;EACb;EACA,OAAO,YAAY,CAACC,IAAI,CAAED,SAAU,CAAC;AACtC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks for invalid characters within the provided fragment.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
4
|
+
* @param fragment The url fragment.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```js
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* const isNotValid = isValidFragment( '#invalid-#fragment' ); // false
|
|
10
10
|
* ```
|
|
11
11
|
*
|
|
12
|
-
* @return
|
|
12
|
+
* @return True if the argument contains a valid fragment.
|
|
13
13
|
*/
|
|
14
14
|
export function isValidFragment(fragment) {
|
|
15
15
|
if (!fragment) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isValidFragment","fragment","test"],"sources":["@wordpress/url/src/is-valid-fragment.
|
|
1
|
+
{"version":3,"names":["isValidFragment","fragment","test"],"sources":["@wordpress/url/src/is-valid-fragment.ts"],"sourcesContent":["/**\n * Checks for invalid characters within the provided fragment.\n *\n * @param fragment The url fragment.\n *\n * @example\n * ```js\n * const isValid = isValidFragment( '#valid-fragment' ); // true\n * const isNotValid = isValidFragment( '#invalid-#fragment' ); // false\n * ```\n *\n * @return True if the argument contains a valid fragment.\n */\nexport function isValidFragment( fragment: string ): boolean {\n\tif ( ! fragment ) {\n\t\treturn false;\n\t}\n\treturn /^#[^\\s#?\\/]*$/.test( fragment );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAeA,CAAEC,QAAgB,EAAY;EAC5D,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA,OAAO,eAAe,CAACC,IAAI,CAAED,QAAS,CAAC;AACxC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks for invalid characters within the provided path.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
4
|
+
* @param path The URL path.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```js
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* const isNotValid = isValidPath( '/invalid?test/path/' ); // false
|
|
10
10
|
* ```
|
|
11
11
|
*
|
|
12
|
-
* @return
|
|
12
|
+
* @return True if the argument contains a valid path
|
|
13
13
|
*/
|
|
14
14
|
export function isValidPath(path) {
|
|
15
15
|
if (!path) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isValidPath","path","test"],"sources":["@wordpress/url/src/is-valid-path.
|
|
1
|
+
{"version":3,"names":["isValidPath","path","test"],"sources":["@wordpress/url/src/is-valid-path.ts"],"sourcesContent":["/**\n * Checks for invalid characters within the provided path.\n *\n * @param path The URL path.\n *\n * @example\n * ```js\n * const isValid = isValidPath( 'test/path/' ); // true\n * const isNotValid = isValidPath( '/invalid?test/path/' ); // false\n * ```\n *\n * @return True if the argument contains a valid path\n */\nexport function isValidPath( path: string ): boolean {\n\tif ( ! path ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?]+$/.test( path );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,WAAWA,CAAEC,IAAY,EAAY;EACpD,IAAK,CAAEA,IAAI,EAAG;IACb,OAAO,KAAK;EACb;EACA,OAAO,YAAY,CAACC,IAAI,CAAED,IAAK,CAAC;AACjC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tests if a url protocol is valid.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
4
|
+
* @param protocol The url protocol.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```js
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* const isNotValid = isValidProtocol( 'https :' ); // false
|
|
10
10
|
* ```
|
|
11
11
|
*
|
|
12
|
-
* @return
|
|
12
|
+
* @return True if the argument is a valid protocol (e.g. http:, tel:).
|
|
13
13
|
*/
|
|
14
14
|
export function isValidProtocol(protocol) {
|
|
15
15
|
if (!protocol) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isValidProtocol","protocol","test"],"sources":["@wordpress/url/src/is-valid-protocol.
|
|
1
|
+
{"version":3,"names":["isValidProtocol","protocol","test"],"sources":["@wordpress/url/src/is-valid-protocol.ts"],"sourcesContent":["/**\n * Tests if a url protocol is valid.\n *\n * @param protocol The url protocol.\n *\n * @example\n * ```js\n * const isValid = isValidProtocol( 'https:' ); // true\n * const isNotValid = isValidProtocol( 'https :' ); // false\n * ```\n *\n * @return True if the argument is a valid protocol (e.g. http:, tel:).\n */\nexport function isValidProtocol( protocol: string ): boolean {\n\tif ( ! protocol ) {\n\t\treturn false;\n\t}\n\treturn /^[a-z\\-.\\+]+[0-9]*:$/i.test( protocol );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAeA,CAAEC,QAAgB,EAAY;EAC5D,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA,OAAO,uBAAuB,CAACC,IAAI,CAAED,QAAS,CAAC;AAChD","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks for invalid characters within the provided query string.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
4
|
+
* @param queryString The query string.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```js
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* const isNotValid = isValidQueryString( 'query=true?another=false' ); // false
|
|
10
10
|
* ```
|
|
11
11
|
*
|
|
12
|
-
* @return
|
|
12
|
+
* @return True if the argument contains a valid query string.
|
|
13
13
|
*/
|
|
14
14
|
export function isValidQueryString(queryString) {
|
|
15
15
|
if (!queryString) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isValidQueryString","queryString","test"],"sources":["@wordpress/url/src/is-valid-query-string.
|
|
1
|
+
{"version":3,"names":["isValidQueryString","queryString","test"],"sources":["@wordpress/url/src/is-valid-query-string.ts"],"sourcesContent":["/**\n * Checks for invalid characters within the provided query string.\n *\n * @param queryString The query string.\n *\n * @example\n * ```js\n * const isValid = isValidQueryString( 'query=true&another=false' ); // true\n * const isNotValid = isValidQueryString( 'query=true?another=false' ); // false\n * ```\n *\n * @return True if the argument contains a valid query string.\n */\nexport function isValidQueryString( queryString: string ): boolean {\n\tif ( ! queryString ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?\\/]+$/.test( queryString );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,kBAAkBA,CAAEC,WAAmB,EAAY;EAClE,IAAK,CAAEA,WAAW,EAAG;IACpB,OAAO,KAAK;EACb;EACA,OAAO,cAAc,CAACC,IAAI,CAAED,WAAY,CAAC;AAC1C","ignoreList":[]}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* will be treated as identical, regardless of order they appear in the original
|
|
4
4
|
* text.
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param path Original path.
|
|
7
7
|
*
|
|
8
|
-
* @return
|
|
8
|
+
* @return Normalized path.
|
|
9
9
|
*/
|
|
10
10
|
export function normalizePath(path) {
|
|
11
11
|
const split = path.split('?');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["normalizePath","path","split","query","base","map","entry","pair","decodeURIComponent","sort","a","b","localeCompare","encodeURIComponent","join"],"sources":["@wordpress/url/src/normalize-path.
|
|
1
|
+
{"version":3,"names":["normalizePath","path","split","query","base","map","entry","pair","decodeURIComponent","sort","a","b","localeCompare","encodeURIComponent","join"],"sources":["@wordpress/url/src/normalize-path.ts"],"sourcesContent":["/**\n * Given a path, returns a normalized path where equal query parameter values\n * will be treated as identical, regardless of order they appear in the original\n * text.\n *\n * @param path Original path.\n *\n * @return Normalized path.\n */\nexport function normalizePath( path: string ): string {\n\tconst split = path.split( '?' );\n\tconst query = split[ 1 ];\n\tconst base = split[ 0 ];\n\tif ( ! query ) {\n\t\treturn base;\n\t}\n\n\t// 'b=1%2C2&c=2&a=5'\n\treturn (\n\t\tbase +\n\t\t'?' +\n\t\tquery\n\t\t\t// [ 'b=1%2C2', 'c=2', 'a=5' ]\n\t\t\t.split( '&' )\n\t\t\t// [ [ 'b, '1%2C2' ], [ 'c', '2' ], [ 'a', '5' ] ]\n\t\t\t.map( ( entry ) => entry.split( '=' ) )\n\t\t\t// [ [ 'b', '1,2' ], [ 'c', '2' ], [ 'a', '5' ] ]\n\t\t\t.map( ( pair ) => pair.map( decodeURIComponent ) )\n\t\t\t// [ [ 'a', '5' ], [ 'b, '1,2' ], [ 'c', '2' ] ]\n\t\t\t.sort( ( a, b ) => a[ 0 ].localeCompare( b[ 0 ] ) )\n\t\t\t// [ [ 'a', '5' ], [ 'b, '1%2C2' ], [ 'c', '2' ] ]\n\t\t\t.map( ( pair ) => pair.map( encodeURIComponent ) )\n\t\t\t// [ 'a=5', 'b=1%2C2', 'c=2' ]\n\t\t\t.map( ( pair ) => pair.join( '=' ) )\n\t\t\t// 'a=5&b=1%2C2&c=2'\n\t\t\t.join( '&' )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAAEC,IAAY,EAAW;EACrD,MAAMC,KAAK,GAAGD,IAAI,CAACC,KAAK,CAAE,GAAI,CAAC;EAC/B,MAAMC,KAAK,GAAGD,KAAK,CAAE,CAAC,CAAE;EACxB,MAAME,IAAI,GAAGF,KAAK,CAAE,CAAC,CAAE;EACvB,IAAK,CAAEC,KAAK,EAAG;IACd,OAAOC,IAAI;EACZ;;EAEA;EACA,OACCA,IAAI,GACJ,GAAG,GACHD;EACC;EAAA,CACCD,KAAK,CAAE,GAAI;EACZ;EAAA,CACCG,GAAG,CAAIC,KAAK,IAAMA,KAAK,CAACJ,KAAK,CAAE,GAAI,CAAE;EACtC;EAAA,CACCG,GAAG,CAAIE,IAAI,IAAMA,IAAI,CAACF,GAAG,CAAEG,kBAAmB,CAAE;EACjD;EAAA,CACCC,IAAI,CAAE,CAAEC,CAAC,EAAEC,CAAC,KAAMD,CAAC,CAAE,CAAC,CAAE,CAACE,aAAa,CAAED,CAAC,CAAE,CAAC,CAAG,CAAE;EAClD;EAAA,CACCN,GAAG,CAAIE,IAAI,IAAMA,IAAI,CAACF,GAAG,CAAEQ,kBAAmB,CAAE;EACjD;EAAA,CACCR,GAAG,CAAIE,IAAI,IAAMA,IAAI,CAACO,IAAI,CAAE,GAAI,CAAE;EACnC;EAAA,CACCA,IAAI,CAAE,GAAI,CAAC;AAEf","ignoreList":[]}
|
|
@@ -7,14 +7,14 @@ const USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
|
|
|
7
7
|
/**
|
|
8
8
|
* Prepends "http://" to a url, if it looks like something that is meant to be a TLD.
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
10
|
+
* @param url The URL to test.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```js
|
|
14
14
|
* const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
-
* @return
|
|
17
|
+
* @return The updated URL.
|
|
18
18
|
*/
|
|
19
19
|
export function prependHTTP(url) {
|
|
20
20
|
if (!url) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isEmail","USABLE_HREF_REGEXP","prependHTTP","url","trim","test"],"sources":["@wordpress/url/src/prepend-http.
|
|
1
|
+
{"version":3,"names":["isEmail","USABLE_HREF_REGEXP","prependHTTP","url","trim","test"],"sources":["@wordpress/url/src/prepend-http.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { isEmail } from './is-email';\n\nconst USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\\?|\\.|\\/)/i;\n\n/**\n * Prepends \"http://\" to a url, if it looks like something that is meant to be a TLD.\n *\n * @param url The URL to test.\n *\n * @example\n * ```js\n * const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org\n * ```\n *\n * @return The updated URL.\n */\nexport function prependHTTP( url: string ): string {\n\tif ( ! url ) {\n\t\treturn url;\n\t}\n\n\turl = url.trim();\n\tif ( ! USABLE_HREF_REGEXP.test( url ) && ! isEmail( url ) ) {\n\t\treturn 'http://' + url;\n\t}\n\n\treturn url;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,YAAY;AAEpC,MAAMC,kBAAkB,GAAG,0BAA0B;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAEC,GAAW,EAAW;EAClD,IAAK,CAAEA,GAAG,EAAG;IACZ,OAAOA,GAAG;EACX;EAEAA,GAAG,GAAGA,GAAG,CAACC,IAAI,CAAC,CAAC;EAChB,IAAK,CAAEH,kBAAkB,CAACI,IAAI,CAAEF,GAAI,CAAC,IAAI,CAAEH,OAAO,CAAEG,GAAI,CAAC,EAAG;IAC3D,OAAO,SAAS,GAAGA,GAAG;EACvB;EAEA,OAAOA,GAAG;AACX","ignoreList":[]}
|
|
@@ -8,14 +8,14 @@ import { prependHTTP } from './prepend-http';
|
|
|
8
8
|
*
|
|
9
9
|
* Note: this will not replace "http://" with "https://".
|
|
10
10
|
*
|
|
11
|
-
* @param
|
|
11
|
+
* @param url The URL to test.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```js
|
|
15
15
|
* const actualURL = prependHTTPS( 'wordpress.org' ); // https://wordpress.org
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
|
-
* @return
|
|
18
|
+
* @return The updated URL.
|
|
19
19
|
*/
|
|
20
20
|
export function prependHTTPS(url) {
|
|
21
21
|
if (!url) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["prependHTTP","prependHTTPS","url","startsWith","replace"],"sources":["@wordpress/url/src/prepend-https.
|
|
1
|
+
{"version":3,"names":["prependHTTP","prependHTTPS","url","startsWith","replace"],"sources":["@wordpress/url/src/prepend-https.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { prependHTTP } from './prepend-http';\n\n/**\n * Prepends \"https://\" to a url, if it looks like something that is meant to be a TLD.\n *\n * Note: this will not replace \"http://\" with \"https://\".\n *\n * @param url The URL to test.\n *\n * @example\n * ```js\n * const actualURL = prependHTTPS( 'wordpress.org' ); // https://wordpress.org\n * ```\n *\n * @return The updated URL.\n */\nexport function prependHTTPS( url: string ): string {\n\tif ( ! url ) {\n\t\treturn url;\n\t}\n\n\t// If url starts with http://, return it as is.\n\tif ( url.startsWith( 'http://' ) ) {\n\t\treturn url;\n\t}\n\n\turl = prependHTTP( url );\n\n\treturn url.replace( /^http:/, 'https:' );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,gBAAgB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAEC,GAAW,EAAW;EACnD,IAAK,CAAEA,GAAG,EAAG;IACZ,OAAOA,GAAG;EACX;;EAEA;EACA,IAAKA,GAAG,CAACC,UAAU,CAAE,SAAU,CAAC,EAAG;IAClC,OAAOD,GAAG;EACX;EAEAA,GAAG,GAAGF,WAAW,CAAEE,GAAI,CAAC;EAExB,OAAOA,GAAG,CAACE,OAAO,CAAE,QAAQ,EAAE,QAAS,CAAC;AACzC","ignoreList":[]}
|