New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@therms/web-js

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@therms/web-js - npm Package Compare versions

Comparing version 1.3.5 to 1.4.0

dist/utils/address.d.ts

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [1.4.0](http://bitbucket.org/thermsio/web-js/compare/v1.3.5...v1.4.0) (2022-01-09)
### Features
* **formatAddress:** add util for formatting addresses ([a4a3ff2](http://bitbucket.org/thermsio/web-js/commits/a4a3ff2e3e3e16443970b44098d756258f15c710))
## [1.3.5](http://bitbucket.org/thermsio/web-js/compare/v1.3.4...v1.3.5) (2021-12-28)

@@ -2,0 +9,0 @@

@@ -222,2 +222,51 @@ 'use strict';

/**
* This helper will format a JSON-schema "like" address (https://schema.org/PostalAddress). THERMS addresses are
* stored in this schema that this func accepts as the param.
*
* @param address
* @param inline
*/
const formatAddress = (address = {
country: '',
locality: '',
region: '',
postalCode: '',
streetAddress: '',
}, inline = true) => {
let value = ``;
if (inline) {
if (address.streetAddress) {
value += `${address.streetAddress}, `;
}
if (address.locality) {
value += `${address.locality}, `;
}
if (address.region) {
value += `${address.region} `;
}
if (address.postalCode) {
value += `${address.postalCode}`;
}
}
else {
if (address.streetAddress) {
value += `${address.streetAddress}
`;
}
if (address.locality) {
value += `${address.locality}, `;
}
if (address.region) {
value += `${address.region} `;
}
if (address.postalCode) {
value += `${address.postalCode}`;
}
}
if (value.replace(' ', '').length === 0)
return '';
return value;
};
const calculatedMap = {};

@@ -362,2 +411,3 @@ /**

type: 'browser',
// todo: needs to be implemented - should look for sessionStorage, localStorage & cookie for a value
uuid: '',

@@ -416,2 +466,3 @@ };

exports.flashBrowserTitle = flashBrowserTitle;
exports.formatAddress = formatAddress;
exports.getColorContrast = getColorContrast;

@@ -418,0 +469,0 @@ exports.getCookie = getCookie;

1

dist/index.d.ts
export * from './services/browser-focus';
export * from './services/browser-title';
export * from './services/browser-to-browser-communications';
export * from './utils/address';
export * from './utils/color';

@@ -5,0 +6,0 @@ export * from './services/cookies';

export { checkIsBrowserVisible, onBrowserFocusChange } from './services/browser-focus.js';
export { flashBrowserTitle, setBrowserTitle } from './services/browser-title.js';
export { b2bComms } from './services/browser-to-browser-communications.js';
export { formatAddress } from './utils/address.js';
export { getColorContrast } from './utils/color.js';

@@ -5,0 +6,0 @@ export { deleteCookie, getCookie, setCookie } from './services/cookies.js';

@@ -29,2 +29,3 @@ import Browser from 'bowser';

type: 'browser',
// todo: needs to be implemented - should look for sessionStorage, localStorage & cookie for a value
uuid: '',

@@ -31,0 +32,0 @@ };

2

package.json
{
"name": "@therms/web-js",
"version": "1.3.5",
"version": "1.4.0",
"description": "Common web/JS tools & utilities",

@@ -5,0 +5,0 @@ "main": "dist/cjs.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc