Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Convert object to string.
NOTE: did not handle the circular
input
var tostr = require('tostr')
var obj = {
str: "'A' \"string\"\r\n.",
strO: new String("'A' \"string\" \r\nObject."),
num: 0,
numO: new Number(0),
bool: true,
boolO: new Boolean(true),
undef: undefined,
reg: /re/g,
regO: new RegExp("re", "g"),
date: new Date(),
date2: new Date('2014-01-01'),
arr: [1, 2, 3],
arrO: new Array().concat([0,"1",true]),
obj: {
name: "fool2fish", email: "fool2fish@gmail.com"
},
objO: new Object(),
func: function(a, b) {
// some comment
return a + b
},
funcO: new Function("a", "alert(a)")
}
var str = tostr(obj)
console.log(str)
output
{
str: '\'A\' "string"\r\n.',
strO: '\'A\' "string" \r\nObject.',
num: 0,
numO: 0,
bool: true,
boolO: true,
undef: undefined,
reg: /re/g,
regO: /re/g,
date: new Date('Mon Dec 22 2014 16:09:46 GMT+0800 (CST)'),
date2: new Date('Wed Jan 01 2014 08:00:00 GMT+0800 (CST)'),
arr: [
1,
2,
3
],
arrO: [
0,
'1',
true
],
obj: {
name: 'fool2fish',
email: 'fool2fish@gmail.com'
},
objO: {
},
func: function (a, b) {
// some comment
return a + b
},
funcO: function anonymous(a
/**/) {
alert(a)
}
}
FAQs
Convert object to string.
We found that tostr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.