
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@deckweiss/cart
Advanced tools
This is a shopping cart implementation for SvelteKit applications at Deckweiss.
This is a shopping cart implementation for SvelteKit applications at Deckweiss.
pnpm i @deckweiss/cart
// src/hooks.server.ts
import { handle } from '@deckweiss/cart'
export { handle }
// +layout.server.ts
export const load: LayoutServerLoad = function (event) {
return { cart: event.locals.cart.cart };
};
// +layout.svelte
<script lang="ts">
import { setCartContext } from '@deckweiss/cart';
let { data, children } = $props();
setCartContext(data.cart);
</script>
{@render children()}
<script lang="ts">
import { useCart } from '@deckweiss/cart'
let cart = useCart()
</script>
<button on:click={() => cart.addProduct('id1', 1)}>Add product 1</button>
<button on:click={() => cart.addProduct('id2', 1)}>Add product 2</button>
<button on:click={() => cart.clear()}>Clear cart</button>
{#each cart.cart.products as product}
<div>
<h3>{product.id}</h3>
<p>Amount: {product.amount}</p>
<button on:click={() => cart.removeProduct(product.id)}>Remove product</button>
</div>
{:else}
<p>Cart is empty</p>
{/each}
The types CartMetaData
and CartProductMetaData
support to be extended/augmented via TypeScript. This means, your editor will recognize the custom types and give you intellisense.
// src/app.d.ts
declare module '@deckweiss/cart' {
interface CartMetaData {
userId?: string
note?: string
discountCode?: string
}
interface CartProductMetaData {
type?: 'food' | 'tool' | 'book'
}
}
FAQs
This is a shopping cart implementation for SvelteKit applications at Deckweiss.
We found that @deckweiss/cart demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.