Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kelbyone/core

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kelbyone/core - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

package.json

@@ -39,3 +39,3 @@ {

},
"version": "0.0.5"
"version": "0.0.6"
}
const uri = `https://kelbycerts.wpengine.com/wp-json/ko/v3`;
export async function loadItems(type, category = null) {
let url = `${uri}/${type}?per_page=24&token=w5a0c4fe21f4593.95564850`;
let url = `${uri}/${type}?per_page=24`;
if (category && category.id != 0)
url = `${uri}/categories/${
category.id
}/${type}?per_page=24&token=w5a0c4fe21f4593.95564850`;
}/${type}?per_page=24`;
return await load(url);

@@ -13,3 +13,3 @@ }

export async function loadItem(type, id) {
const url = `${uri}/${type}/${id}?token=w5a0c4fe21f4593.95564850`;
const url = `${uri}/${type}/${id}`;
return await load(url);

@@ -19,3 +19,3 @@ }

export async function loadRelated(type, id, resource) {
const url = `${uri}/${type}/${id}/${resource}?per_page=-1&token=w5a0c4fe21f4593.95564850`;
const url = `${uri}/${type}/${id}/${resource}?per_page=-1`;
return await load(url);

@@ -30,3 +30,3 @@ }

export async function loadCategories() {
const url = `${uri}/categories/?token=w5a0c4fe21f4593.95564850`;
const url = `${uri}/categories/`;
return await load(url);

@@ -33,0 +33,0 @@ }

export { loadItems, loadItem, loadRelated } from './api-service';
export * from './user-service';
export * from './storage-service';
export * from './utils';

@@ -6,5 +6,11 @@ const storage = window.localStorage;

try {
window.dispatchEvent(
new CustomEvent('storage:set', { key: key, value: value })
);
storage && storage.setItem(key, JSON.stringify(value));
resolve();
} catch (err) {
window.dispatchEvent(
new CustomEvent('storage:error', { key: key, value: value, error: err })
);
reject(`Couldn't store object ${err}`);

@@ -18,5 +24,9 @@ }

try {
window.dispatchEvent(new CustomEvent('storage:remove', key));
storage && storage.removeItem(key);
resolve();
} catch (err) {
window.dispatchEvent(
new CustomEvent('storage:error', { key: key, error: err })
);
reject(`Couldn't remove object ${err}`);

@@ -30,8 +40,9 @@ }

try {
if (storage) {
const item = storage.getItem(key);
resolve(JSON.parse(item));
}
resolve(undefined);
window.dispatchEvent(new CustomEvent('storage:get', key));
const item = storage.getItem(key);
resolve(JSON.parse(item));
} catch (err) {
window.dispatchEvent(
new CustomEvent('storage:error', { key: key, error: err })
);
reject(`Couldn't get object: ${err}`);

@@ -38,0 +49,0 @@ }

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