Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@types/cookie_js
Advanced tools
TypeScript definitions for cookie_js
npm install --save @types/cookie_js
This package contains type definitions for cookie_js (https://github.com/florian/cookie.js).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie_js.
declare module "cookie_js" {
export = cookie;
}
/**
* https://github.com/DefinitelyTyped/DefinitelyTyped/pull/16025#issuecomment-295784660
*/
declare module "cookiejs" {
export = cookie;
}
declare function cookie(key: string, fallback?: string): string;
declare function cookie(keys: string[], fallback?: string): string;
interface UtilStatic {
isArray: (value: any) => boolean;
isObject: (value: any) => boolean;
toArray: (...args: any[]) => any[];
getKeys: (value: {}) => any[];
encode: (value: string) => string;
decode: (value: string) => string;
retrieve: (x: string, y: string) => string;
}
interface Options {
expires: number | string | Date;
domain: string;
path: string;
secure: boolean;
}
declare namespace cookie {
/**
* Create a cookie. The value will automatically be escaped.
*/
export function set(key: string, value: string, options?: any): void;
/**
* Set several cookies at once
*/
export function set(obj: any, options?: any): void;
/**
* Remove cookies
*/
export function remove(key: string): void;
export function remove(keys: string[]): void;
export function remove(...args: string[]): void;
/**
* Remove cookies that were set with custom options (e.g. specifing domain or path)
*/
export function removeSpecific(key: string, options?: any): void;
export function removeSpecific(keys: string[], options?: any): void;
/**
* Remove all cookies
*/
export function empty(): void;
/**
* Retrieve the value of the cookie
*/
export function get(key: string, fallback?: string): string;
/**
* Retrieve values of several cookies
*/
export function get(keys: string[], fallback?: string): any;
/**
* Get all currently saved cookies
*/
export function all(): any;
/**
* Test if cookies are enabled
*/
export function enabled(): boolean;
/**
* Utility methods
*/
export var utils: UtilStatic;
/**
* Set default options
*/
export var defaults: Options;
}
These definitions were written by slawiko.
FAQs
TypeScript definitions for cookie_js
We found that @types/cookie_js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.