Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit 01cac58

Browse files
Closure Teamcopybara-github
authored andcommitted
Changes the tpl to output goog.modules.
RELNOTES: Changes the tpl to output goog.modules. PiperOrigin-RevId: 500698187 Change-Id: I19617466b64318fe680052cd95be27d669d79be7
1 parent fcafa66 commit 01cac58

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

closure/goog/html/safeurl_test_vectors.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
// AUTOGENERATED. DO NOT EDIT.
88
// clang-format off
99

10-
goog.provide('goog.html.safeUrlTestVectors');
10+
goog.module('goog.html.safeUrlTestVectors');
1111
goog.setTestOnly('goog.html.safeUrlTestVectors');
1212

13-
goog.html.safeUrlTestVectors.BASE_VECTORS = [
13+
/** @typedef {{input: string, expected: string, safe: boolean }} */
14+
let TestVector;
15+
16+
/** @const {!Array<!TestVector>} */
17+
const BASE_VECTORS = [
1418
{input: '', expected: '', safe: true},
1519
{input: 'http://example.com/', expected: 'http://example.com/', safe: true},
1620
{input: 'https://example.com', expected: 'https://example.com', safe: true},
@@ -71,7 +75,8 @@ goog.html.safeUrlTestVectors.BASE_VECTORS = [
7175
{input: 'data:video/webm;codecs\u003D\"vp8, opus\";base64,z\u003D', expected: 'data:video/webm;codecs\u003D\"vp8, opus\";base64,z\u003D', safe: true}
7276
];
7377

74-
goog.html.safeUrlTestVectors.TEL_VECTORS = [
78+
/** @const {!Array<!TestVector>} */
79+
const TEL_VECTORS = [
7580
{input: 'tEl:+1(23)129-29192A.ABC#;eXt\u003D29', expected: 'tEl:+1(23)129-29192A.ABC#;eXt\u003D29', safe: true},
7681
{input: 'tEL:123;randmomparam\u003D123', expected: 'tEL:123;randmomparam\u003D123', safe: true},
7782
{input: ':', expected: 'about:invalid#zClosurez', safe: false},
@@ -82,18 +87,22 @@ goog.html.safeUrlTestVectors.TEL_VECTORS = [
8287
{input: 'tel:+1234567890', expected: 'tel:+1234567890', safe: true}
8388
];
8489

85-
goog.html.safeUrlTestVectors.SMS_VECTORS = [
90+
/** @const {!Array<!TestVector>} */
91+
const SMS_VECTORS = [
8692
{input: 'sms:+1234567890', expected: 'sms:+1234567890', safe: true},
8793
{input: 'sms:?body\u003Dmessage', expected: 'sms:?body\u003Dmessage', safe: true},
8894
{input: 'sms:?body\u003DHello, World!', expected: 'about:invalid#zClosurez', safe: false},
8995
{input: 'sms:?body\u003Da\u0026body\u003Db', expected: 'about:invalid#zClosurez', safe: false}
9096
];
9197

92-
goog.html.safeUrlTestVectors.SSH_VECTORS = [
98+
/** @const {!Array<!TestVector>} */
99+
const SSH_VECTORS = [
93100
{input: 'ssh://cloud.google.com', expected: 'ssh://cloud.google.com', safe: true},
94101
{input: '', expected: 'about:invalid#zClosurez', safe: false},
95102
{input: ':', expected: 'about:invalid#zClosurez', safe: false},
96103
{input: 'ssh:cloud.google.com', expected: 'about:invalid#zClosurez', safe: false},
97104
{input: ' ssh://cloud.google.com', expected: 'about:invalid#zClosurez', safe: false},
98105
{input: 'javascript:evil()', expected: 'about:invalid#zClosurez', safe: false}
99106
];
107+
108+
exports = {BASE_VECTORS, TEL_VECTORS, SMS_VECTORS, SSH_VECTORS};

0 commit comments

Comments
 (0)