PHP 8.2.30
Preview: quoteStyle.js Size: 1.49 KB
/home/byroehnu/.trash/node_modules11/object-inspect/test/quoteStyle.js

'use strict';

var inspect = require('../');
var test = require('tape');

test('quoteStyle option', function (t) {
    t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value');
    t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value');
    t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value');
    t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value');
    t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value');
    t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value');
    t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value');
    t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value');

    t.equal(inspect('"', { quoteStyle: 'single' }), '\'"\'', 'double quote, quoteStyle: "single"');
    t.equal(inspect('"', { quoteStyle: 'double' }), '"\\""', 'double quote, quoteStyle: "double"');

    t.equal(inspect('\'', { quoteStyle: 'single' }), '\'\\\'\'', 'single quote, quoteStyle: "single"');
    t.equal(inspect('\'', { quoteStyle: 'double' }), '"\'"', 'single quote, quoteStyle: "double"');

    t.equal(inspect('`', { quoteStyle: 'single' }), '\'`\'', 'backtick, quoteStyle: "single"');
    t.equal(inspect('`', { quoteStyle: 'double' }), '"`"', 'backtick, quoteStyle: "double"');

    t.end();
});

Directory Contents

Dirs: 1 × Files: 18

Name Size Perms Modified Actions
browser DIR
- drwxr-xr-x 2026-02-03 15:06:16
Edit Download
2.03 KB lrw-r--r-- 2026-02-03 15:06:14
Edit Download
451 B lrw-r--r-- 2026-02-03 15:06:16
Edit Download
400 B lrw-r--r-- 2026-02-03 15:06:16
Edit Download
1.54 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
1.50 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
683 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
2.17 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
372 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
514 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
255 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
6.48 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
4.83 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
268 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
2.26 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
1.49 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
1.51 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
302 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
8.21 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).