demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/object-inspect-1.13.4/test/quoteStyle.js

Path
demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/object-inspect-1.13.4/test/quoteStyle.js
Status
scanned
Type
file
Name
quoteStyle.js
Extension
.js
Programming language
JavaScript
Mime type
text/plain
File type
ASCII text
Tag

      
    
Rootfs path

      
    
Size
1530 (1.5 KB)
MD5
c3209cd8c0f0d2ab392f49cd113f0615
SHA1
938441a299fe670edc46ba7f4877217ce1efc789
SHA256
8b3afbbd4a1a9be2ff367a2ac6a3daccd61aa4c48ff7bf37fd1c3db2d3444005
SHA512

      
    
SHA1_git
da23e630cfcf0b2bcd6d5e90becc09d714f46d7b
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
quoteStyle.js | 1.5 KB |

'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(); });
Package URL License Primary language
pkg:npm/acme-demo-app@1.0.0 JavaScript
pkg:npm/object-inspect@1.13.4 mit JavaScript