]>
Lady’s Gitweb - Pisces/blob - symbol.js
1 // SPDX-FileCopyrightText: 2023, 2025 Lady <https://www.ladys.computer/about/#lady>
2 // SPDX-License-Identifier: MPL-2.0
4 * ⁌ ♓🧩 Piscēs ∷ symbol.js
6 * Copyright © 2023, 2025 Lady [@ Ladys Computer].
8 * This Source Code Form is subject to the terms of the Mozilla Public
9 * License, v. 2.0. If a copy of the MPL was not distributed with this
10 * file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
13 import { createCallableFunction
} from "./function.js";
15 const PISC
ĒS
= "♓🧩 Piscēs";
18 * Returns the description for the provided symbol.
20 * ※ This is effectively an alias for the `Symbol::description´
23 * ☡ This function throws if the provided argument is not a symbol.
25 export const getSymbolDescription
= createCallableFunction(
26 Object
.getOwnPropertyDescriptor(Symbol
.prototype, "description").get,
27 { name: "getSymbolDescription" },
31 * Returns a string representation of the provided symbol.
33 * ※ Use `getSymbolDescription´ instead if you just want the text
34 * description of a symbol.
36 * ※ This is effectively an alias for the `Symbol::toString´.
38 * ☡ This function throws if the provided argument is not a symbol.
40 export const symbolToString
= createCallableFunction(
41 Symbol
.prototype.toString
,
42 { name: "symbolToString" },
46 * Returns the value of the provided symbol.
48 * ※ This is effectively an alias for the `Symbol::valueOf´.
50 * ☡ This function throws if the provided argument is not a symbol and
51 * does not have a `[[SymbolData]]´ slot.
53 export const symbolValue
= createCallableFunction(
54 Symbol
.prototype.valueOf
,
55 { name: "symbolValue" },
This page took 0.39104 seconds and 5 git commands to generate.