| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2016 The Chromium Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style license that can be | |
| 4 * found in the LICENSE file. | |
| 5 */ | |
| 6 | |
| 7 /** | |
| 8 * Prints the message. | |
| 9 * @param {String} msg - The message to print. | |
| 10 */ | |
| 11 function print(msg) { // eslint-disable-line no-unused-vars | |
| 12 document.getElementById('result').innerHTML = msg; | |
| 13 } | |
| 14 | |
| 15 /** | |
| 16 * Converts ShippingAddress into a dictionary. | |
| 17 * @param {ShippingAddress} addr - The object to convert. | |
| 18 * @return {object} The dictionary output. | |
| 19 */ | |
| 20 function toDictionary(addr) { // eslint-disable-line no-unused-vars | |
| 21 var dict = {}; | |
| 22 if (addr) { | |
| 23 dict.country = addr.country; | |
| 24 dict.region = addr.region; | |
| 25 dict.city = addr.city; | |
| 26 dict.dependentLocality = addr.dependentLocality; | |
| 27 dict.addressLine = addr.addressLine; | |
| 28 dict.postalCode = addr.postalCode; | |
| 29 dict.sortingCode = addr.sortingCode; | |
| 30 dict.languageCode = addr.languageCode; | |
| 31 dict.organization = addr.organization; | |
| 32 dict.recipient = addr.recipient; | |
| 33 dict.phone = addr.phone; | |
| 34 } | |
| 35 return dict; | |
| 36 } | |
| OLD | NEW |