Socket
Socket
Sign inDemoInstall

@arkecosystem/utils

Package Overview
Dependencies
4
Maintainers
7
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.4 to 1.1.5

7

CHANGELOG.md

@@ -8,2 +8,8 @@ # Changelog

## [1.1.5] - 2019-10-25
## Changed
- Better handling of falsy values for `has`
## [1.1.4] - 2019-10-25

@@ -421,2 +427,3 @@

[1.1.5]: https://github.com/ArkEcosystem/utils/compare/1.1.4...1.1.5
[1.1.4]: https://github.com/ArkEcosystem/utils/compare/1.1.0...1.1.4

@@ -423,0 +430,0 @@ [1.1.0]: https://github.com/ArkEcosystem/utils/compare/1.0.34...1.1.0

22

dist/has.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const internal_1 = require("./internal");
const is_empty_1 = require("./is-empty");
const is_undefined_1 = require("./is-undefined");
const is_object_1 = require("./is-object");
const is_string_1 = require("./is-string");
exports.has = (object, path) => {
if (is_empty_1.isEmpty(object)) {
if (!is_object_1.isObject(object) || !is_string_1.isString(path)) {
return false;
}
const fragments = internal_1.castPath(path);
let index = 0;
const length = fragments.length;
while (object !== null && index < length) {
object = object[fragments[index++]];
const pathArray = internal_1.castPath(path);
for (let i = 0; i < pathArray.length; i++) {
if (!is_object_1.isObject(object)) {
return false;
}
if (!(pathArray[i] in object)) {
return false;
}
object = object[pathArray[i]];
}
return !is_undefined_1.isUndefined(object);
return true;
};
//# sourceMappingURL=has.js.map
{
"name": "@arkecosystem/utils",
"description": "Performance oriented implementations of commonly used functions in TypeScript.",
"version": "1.1.4",
"version": "1.1.5",
"contributors": [

@@ -6,0 +6,0 @@ "Brian Faust <brian@ark.io>",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc