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

@hirez_io/auto-spies-core

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hirez_io/auto-spies-core - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [1.6.2](https://github.com/hirezio/auto-spies/compare/@hirez_io/auto-spies-core@1.6.1...@hirez_io/auto-spies-core@1.6.2) (2021-02-04)
### Bug Fixes
* **auto-spies-core:** don't add getters to method names when creating spies from class ([41e43c7](https://github.com/hirezio/auto-spies/commit/41e43c76d4b494ec7e57cdc075ef0339c69435db)), closes [#40](https://github.com/hirezio/auto-spies/issues/40)
## [1.6.1](https://github.com/hirezio/auto-spies/compare/@hirez_io/auto-spies-core@1.6.0...@hirez_io/auto-spies-core@1.6.1) (2021-01-18)

@@ -8,0 +19,0 @@

17

dist/create-auto-spy-from-class.js

@@ -70,13 +70,18 @@ "use strict";

if (parentObj) {
methods = methods.concat(Object.getOwnPropertyNames(obj));
methods = methods.concat(extractMethodsFromObject(obj));
}
obj = parentObj;
}
var constructorIndex = methods.indexOf('constructor');
/* istanbul ignore else */
if (constructorIndex >= 0) {
methods.splice(constructorIndex, 1);
}
return methods;
}
function extractMethodsFromObject(obj) {
var propertyDescriptors = Object.getOwnPropertyDescriptors(obj);
return Object.keys(propertyDescriptors).reduce(function (names, name) {
var descriptor = propertyDescriptors[name];
if (name !== 'constructor' && !descriptor.get) {
names.push(name);
}
return names;
}, []);
}
//# sourceMappingURL=create-auto-spy-from-class.js.map
{
"name": "@hirez_io/auto-spies-core",
"version": "1.6.1",
"version": "1.6.2",
"publishConfig": {

@@ -58,3 +58,3 @@ "access": "public"

},
"gitHead": "365f64f2a76e9983f0460452637957831740139c"
"gitHead": "56c447c7f517d4f6de95e073cc42fa56f7e7638c"
}

@@ -88,14 +88,18 @@ import {

if (parentObj) {
methods = methods.concat(Object.getOwnPropertyNames(obj));
methods = methods.concat(extractMethodsFromObject(obj));
}
obj = parentObj;
}
const constructorIndex = methods.indexOf('constructor');
/* istanbul ignore else */
if (constructorIndex >= 0) {
methods.splice(constructorIndex, 1);
}
return methods;
}
function extractMethodsFromObject(obj: any) {
const propertyDescriptors = Object.getOwnPropertyDescriptors(obj);
return Object.keys(propertyDescriptors).reduce((names, name) => {
const descriptor = propertyDescriptors[name];
if (name !== 'constructor' && !descriptor.get) {
names.push(name);
}
return names;
}, [] as string[]);
}

Sorry, the diff of this file is not supported yet

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