massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-json / node_modules / vscode-json-languageservice / lib / esm / utils / objects.js
diff --git a/.config/coc/extensions/node_modules/coc-json/node_modules/vscode-json-languageservice/lib/esm/utils/objects.js b/.config/coc/extensions/node_modules/coc-json/node_modules/vscode-json-languageservice/lib/esm/utils/objects.js
new file mode 100644 (file)
index 0000000..373a44b
--- /dev/null
@@ -0,0 +1,65 @@
+/*---------------------------------------------------------------------------------------------
+*  Copyright (c) Microsoft Corporation. All rights reserved.
+*  Licensed under the MIT License. See License.txt in the project root for license information.
+*--------------------------------------------------------------------------------------------*/
+export function equals(one, other) {
+    if (one === other) {
+        return true;
+    }
+    if (one === null || one === undefined || other === null || other === undefined) {
+        return false;
+    }
+    if (typeof one !== typeof other) {
+        return false;
+    }
+    if (typeof one !== 'object') {
+        return false;
+    }
+    if ((Array.isArray(one)) !== (Array.isArray(other))) {
+        return false;
+    }
+    var i, key;
+    if (Array.isArray(one)) {
+        if (one.length !== other.length) {
+            return false;
+        }
+        for (i = 0; i < one.length; i++) {
+            if (!equals(one[i], other[i])) {
+                return false;
+            }
+        }
+    }
+    else {
+        var oneKeys = [];
+        for (key in one) {
+            oneKeys.push(key);
+        }
+        oneKeys.sort();
+        var otherKeys = [];
+        for (key in other) {
+            otherKeys.push(key);
+        }
+        otherKeys.sort();
+        if (!equals(oneKeys, otherKeys)) {
+            return false;
+        }
+        for (i = 0; i < oneKeys.length; i++) {
+            if (!equals(one[oneKeys[i]], other[oneKeys[i]])) {
+                return false;
+            }
+        }
+    }
+    return true;
+}
+export function isNumber(val) {
+    return typeof val === 'number';
+}
+export function isDefined(val) {
+    return typeof val !== 'undefined';
+}
+export function isBoolean(val) {
+    return typeof val === 'boolean';
+}
+export function isString(val) {
+    return typeof val === 'string';
+}