⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
invoice
/
node_modules
/
type
/
test
/
lib
/
View File Name :
safe-to-string.js
"use strict"; var assert = require("chai").assert , safeToString = require("../../lib/safe-to-string"); describe("lib/safe-to-string", function () { it("Should return input string", function () { assert.equal(safeToString("foo"), "foo"); }); it("Should coerce numbers", function () { assert.equal(safeToString(12), "12"); }); it("Should coerce booleans", function () { assert.equal(safeToString(true), "true"); }); it("Should coerce string objects", function () { assert.equal(safeToString(new String("bar")), "bar"); }); it("Should coerce objects", function () { assert.equal( safeToString({ toString: function () { return "Some object"; } }), "Some object" ); }); it("Should coerce null", function () { assert.equal(safeToString(null), "null"); }); it("Should coerce undefined", function () { assert.equal(safeToString(undefined), "undefined"); }); if (typeof Symbol === "function") { it("Should coerce symbols", function () { // eslint-disable-next-line no-undef assert.equal(safeToString(Symbol()), "Symbol()"); }); } it("Should return null for non coercible values", function () { assert.equal(safeToString({ toString: null }), null); }); });