]> Lady’s Gitweb - Pisces/blobdiff - symbol.js
Create symbol.js module with getSymbolDescription
[Pisces] / symbol.js
diff --git a/symbol.js b/symbol.js
new file mode 100644 (file)
index 0000000..514b526
--- /dev/null
+++ b/symbol.js
@@ -0,0 +1,22 @@
+// ♓🌟 Piscēs ∷ symbol.js
+// ====================================================================
+//
+// Copyright © 2023 Lady [@ Lady’s Computer].
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+
+import { makeCallable } from "./function.js";
+import { getOwnPropertyDescriptor } from "./object.js";
+
+/**
+ * Returns the description for the provided symbol.
+ *
+ * ※ This is effectively an alias for the `Symbol::description`
+ * getter.
+ */
+export const getSymbolDescription = makeCallable(
+  getOwnPropertyDescriptor(Symbol.prototype, "description").get,
+  "getSymbolDescription",
+);
This page took 0.025815 seconds and 4 git commands to generate.