@schibsted/account-sdk-browser 4.7.3 → 4.8.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/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@schibsted/account-sdk-browser",
3
- "version": "4.7.3",
3
+ "version": "4.8.0",
4
4
  "description": "Schibsted account SDK for browsers",
5
5
  "main": "index.js",
6
+ "type": "module",
6
7
  "scripts": {
7
8
  "build": "./build.sh",
8
9
  "clean": "rimraf .cache coverage dist docs",
9
- "docs": "rimraf docs && jsdoc -c ./utils/jsdoc.js --verbose",
10
+ "docs": "rimraf docs && jsdoc -c ./jsdoc.conf.json --verbose",
10
11
  "lint": "eslint .",
11
12
  "pretest": "npm run lint",
12
13
  "test": "jest",
13
14
  "precover": "npm run lint",
14
15
  "cover": "jest --coverage",
15
- "postcover": "codecov"
16
+ "postcover": "codecov",
17
+ "preversion": "npm test",
18
+ "postversion": "git push && git push --tags"
16
19
  },
17
20
  "author": "",
18
21
  "license": "MIT",
@@ -30,7 +33,7 @@
30
33
  "eslint-plugin-import": "^2.20.2",
31
34
  "jest": "^26.4.2",
32
35
  "jest-junit": "^10.0.0",
33
- "jsdoc": "^3.6.5",
36
+ "jsdoc": "^3.6.11",
34
37
  "node-fetch": "^2.6.0",
35
38
  "regenerator-runtime": "^0.13.7",
36
39
  "webpack": "^4.44.1",
package/src/cache.js CHANGED
@@ -93,6 +93,11 @@ export default class Cache {
93
93
  * @returns {*} - The value if it exists, otherwise null
94
94
  */
95
95
  get(key) {
96
+ /**
97
+ * JSON.parse safe wrapper
98
+ * @param {string} raw
99
+ * @returns {*} parsed value or null if failed to parse
100
+ */
96
101
  function getObj(raw) {
97
102
  try {
98
103
  return JSON.parse(raw);
package/src/identity.d.ts CHANGED
@@ -1,7 +1,9 @@
1
+ import type { TinyEmitter } from 'tiny-emitter';
2
+
1
3
  /**
2
- * Provides Identity functionalty to a web page
4
+ * Provides Identity functionality to a web page
3
5
  */
4
- export class Identity {
6
+ export class Identity extends TinyEmitter {
5
7
  /**
6
8
  * @param {object} options
7
9
  * @param {string} options.clientId - Example: "1234567890abcdef12345678"
package/src/identity.js CHANGED
@@ -14,7 +14,7 @@ import * as popup from './popup';
14
14
  import RESTClient from './RESTClient';
15
15
  import SDKError from './SDKError';
16
16
  import * as spidTalk from './spidTalk';
17
- const { version } = require('../package.json');
17
+ import { version } from '../package.json';
18
18
 
19
19
  /**
20
20
  * @typedef {object} LoginOptions
@@ -12,7 +12,7 @@ import RESTClient from './RESTClient';
12
12
  import Cache from './cache';
13
13
  import * as spidTalk from './spidTalk';
14
14
  import SDKError from './SDKError';
15
- const { version } = require('../package.json');
15
+ import { version } from '../package.json';
16
16
 
17
17
  const globalWindow = () => window;
18
18