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

svelte-claps

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-claps - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

7

createClapsAPI.js
import { Redis } from '@upstash/redis';
import { generateHash, generateKey, getData, getIP } from './utils';
import { generateHash, getData, getIP } from './utils';
import variables from './variables';
const prepareRequest = async (event) => {
const body = event.request.body ? await event.request.json() : {};
const { score, key } = body;
const { score } = body;
const key = event.url.searchParams.get('key');
const RAW_IP = getIP(event.request);
const KEY = generateKey(event.url, key);
const KEY = `CLAP:${key}`;
const HASH_IP = await generateHash(RAW_IP);

@@ -10,0 +11,0 @@ return { KEY, HASH_IP, score };

{
"name": "svelte-claps",
"version": "0.0.1",
"version": "0.0.2",
"devDependencies": {

@@ -5,0 +5,0 @@ "@sveltejs/adapter-auto": "next",

import type { ClapsResponse } from './types';
export declare function generateHash(ip: string): Promise<string>;
export declare function generateKey(url: URL, key: string): string;
export declare function getIP(req: Request): any;
export declare function getData(key: string, ip: string): Promise<ClapsResponse>;

@@ -11,8 +11,2 @@ import { Redis } from '@upstash/redis';

}
export function generateKey(url, key) {
if (key) {
return `CLAP:${key}`;
}
return `CLAP:${url.origin + url.pathname}`;
}
export function getIP(req) {

@@ -19,0 +13,0 @@ const xff = req.headers.get('x-forwarded-for');

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