@schibsted/account-sdk-browser 4.7.3 → 4.7.5
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/README.md +54 -203
- package/es5/global.js +6 -1
- package/es5/global.js.map +1 -1
- package/es5/global.min.js +1 -1
- package/es5/global.min.js.map +1 -1
- package/es5/identity.js +6 -1
- package/es5/identity.js.map +1 -1
- package/es5/identity.min.js +1 -1
- package/es5/identity.min.js.map +1 -1
- package/es5/index.js +6 -1
- package/es5/index.js.map +1 -1
- package/es5/index.min.js +1 -1
- package/es5/index.min.js.map +1 -1
- package/es5/monetization.js +6 -1
- package/es5/monetization.js.map +1 -1
- package/es5/monetization.min.js +1 -1
- package/es5/monetization.min.js.map +1 -1
- package/package.json +4 -2
- package/src/cache.js +5 -0
- package/src/identity.d.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schibsted/account-sdk-browser",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.5",
|
|
4
4
|
"description": "Schibsted account SDK for browsers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"test": "jest",
|
|
13
13
|
"precover": "npm run lint",
|
|
14
14
|
"cover": "jest --coverage",
|
|
15
|
-
"postcover": "codecov"
|
|
15
|
+
"postcover": "codecov",
|
|
16
|
+
"preversion": "npm test",
|
|
17
|
+
"postversion": "git push && git push --tags"
|
|
16
18
|
},
|
|
17
19
|
"author": "",
|
|
18
20
|
"license": "MIT",
|
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
|
|
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"
|