fable-core
Advanced tools
Comparing version 0.7.25 to 0.7.26
{ | ||
"name": "fable-core", | ||
"version": "0.7.25", | ||
"version": "0.7.26", | ||
"description": "Fable core lib & bindings for native JS objects, browser and node APIs", | ||
@@ -5,0 +5,0 @@ "main": "Main.js", |
var fableGlobal = function () { | ||
var globalObj = typeof window !== "undefined" ? window | ||
: (typeof global !== "undefined" ? global | ||
: (typeof self !== "undefined" ? self : null)); | ||
: (typeof self !== "undefined" ? self : {})); | ||
if (typeof globalObj.__FABLE_CORE__ === "undefined") { | ||
@@ -6,0 +6,0 @@ globalObj.__FABLE_CORE__ = { |
@@ -13,3 +13,3 @@ (function (dependencies, factory) { | ||
: (typeof global !== "undefined" ? global | ||
: (typeof self !== "undefined" ? self : null)); | ||
: (typeof self !== "undefined" ? self : {})); | ||
if (typeof globalObj.__FABLE_CORE__ === "undefined") { | ||
@@ -16,0 +16,0 @@ globalObj.__FABLE_CORE__ = { |
@@ -101,2 +101,10 @@ (function (dependencies, factory) { | ||
exports.hasInterface = hasInterface; | ||
function getPropertyNames(obj) { | ||
if (obj == null) { | ||
return []; | ||
} | ||
var propertyMap = typeof obj[Symbol_1.default.reflection] === "function" ? obj[Symbol_1.default.reflection]().properties : obj; | ||
return Object.getOwnPropertyNames(propertyMap); | ||
} | ||
exports.getPropertyNames = getPropertyNames; | ||
function isArray(obj) { | ||
@@ -202,3 +210,3 @@ return Array.isArray(obj) || ArrayBuffer.isView(obj); | ||
else { | ||
var keys = Object.getOwnPropertyNames(x); | ||
var keys = getPropertyNames(x); | ||
for (var i = 0; i < keys.length; i++) { | ||
@@ -217,3 +225,3 @@ if (!equals(x[keys[i]], y[keys[i]])) | ||
else { | ||
var keys = Object.getOwnPropertyNames(x); | ||
var keys = getPropertyNames(x); | ||
for (var i = 0; i < keys.length; i++) { | ||
@@ -220,0 +228,0 @@ var res = compare(x[keys[i]], y[keys[i]]); |
11
Util.js
@@ -83,2 +83,9 @@ import FSymbol from "./Symbol"; | ||
} | ||
export function getPropertyNames(obj) { | ||
if (obj == null) { | ||
return []; | ||
} | ||
var propertyMap = typeof obj[FSymbol.reflection] === "function" ? obj[FSymbol.reflection]().properties : obj; | ||
return Object.getOwnPropertyNames(propertyMap); | ||
} | ||
export function isArray(obj) { | ||
@@ -178,3 +185,3 @@ return Array.isArray(obj) || ArrayBuffer.isView(obj); | ||
else { | ||
var keys = Object.getOwnPropertyNames(x); | ||
var keys = getPropertyNames(x); | ||
for (var i = 0; i < keys.length; i++) { | ||
@@ -192,3 +199,3 @@ if (!equals(x[keys[i]], y[keys[i]])) | ||
else { | ||
var keys = Object.getOwnPropertyNames(x); | ||
var keys = getPropertyNames(x); | ||
for (var i = 0; i < keys.length; i++) { | ||
@@ -195,0 +202,0 @@ var res = compare(x[keys[i]], y[keys[i]]); |
Sorry, the diff of this file is not supported yet
4686437
15659