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

mm

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mm - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

6

History.md
2.4.0 / 2018-08-08
==================
**others**
* [[`6a84a0a`](http://github.com/node-modules/mm/commit/6a84a0a9c01a8e68e08eb63b4d587b73cb8fd74a)] - refactor(tsd): use Interface Function Type so that egg-mock can extends this; (#42) (paranoidjk <<hust2012jiangkai@gmail.com>>)
2.3.0 / 2018-08-07

@@ -3,0 +9,0 @@ ==================

72

index.d.ts

@@ -1,8 +0,22 @@

declare function mm(target: any, key: string, prop: any): void;
declare namespace mm {
export type Request = (
url: string | RegExp | { url: string, host: string},
data: any,
headers?: object,
delay?: number,
) => MockMate;
export type RequestError = (
url: string | RegExp | { url: string, host: string},
reqError: string | Error,
resError: string | Error,
delay?: number
) => MockMate;
export interface MockMate {
(target: any, key: string, prop: any): void;
/**
* Mock async function error.
*/
function error(mod: any, method: string, error?: string | Error, props?: object, timeout?: number): typeof mm;
error: (mod: any, method: string, error?: string | Error, props?: object, timeout?: number) => MockMate;

@@ -12,3 +26,3 @@ /**

*/
function data(mod: any, method: string, data: any, timeout?: number): typeof mm;
data: (mod: any, method: string, data: any, timeout?: number) => MockMate;

@@ -18,3 +32,3 @@ /**

*/
function empty(mod: any, method: string, timeout?: number): typeof mm;
empty: (mod: any, method: string, timeout?: number) => MockMate;

@@ -24,3 +38,3 @@ /**

*/
function datas(mod: any, method: string, datas: any, timeout?: number): typeof mm;
datas: (mod: any, method: string, datas: any, timeout?: number) => MockMate;

@@ -30,3 +44,3 @@ /**

*/
function syncError(mod: any, method: string, error?: string | Error, props?: object): void;
syncError: (mod: any, method: string, error?: string | Error, props?: object) => void;

@@ -36,3 +50,3 @@ /**

*/
function syncData(mod: any, method: string, data?: any): void;
syncData: (mod: any, method: string, data?: any) => void;

@@ -42,3 +56,3 @@ /**

*/
function syncEmpty(mod: any, method: string): void;
syncEmpty: (mod: any, method: string) => void;

@@ -48,37 +62,19 @@ /**

*/
function restore(): typeof mm;
restore: () => MockMate;
const http: {
request: (
url: string | RegExp | { url: string, host: string},
data: any,
headers?: object,
delay?: number,
) => typeof mm,
requestError: (
url: string | RegExp | { url: string, host: string},
reqError: string | Error,
resError: string | Error,
delay?: number
) => typeof mm,
}
http: {
request: Request;
requestError: RequestError,
};
const https: {
request: (
url: string | RegExp | { url: string, host: string},
data: any,
headers?: object,
delay?: number,
) => typeof mm,
requestError: (
url: string | RegExp | { url: string, host: string},
reqError: string | Error,
resError: string | Error,
delay?: number
) => typeof mm,
}
https: {
request: Request;
requestError: RequestError,
};
}
declare const mm: MockMate;
export = mm;
export default mm;
{
"name": "mm",
"version": "2.3.0",
"version": "2.4.0",
"description": "mock mate, mock http request, fs access and so on.",

@@ -5,0 +5,0 @@ "main": "index.js",

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