mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-13 05:55:26 +00:00
update
This commit is contained in:
17
node_modules/js-stringify/index.js
generated
vendored
Normal file
17
node_modules/js-stringify/index.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = stringify;
|
||||
function stringify(obj) {
|
||||
if (obj instanceof Date) {
|
||||
return 'new Date(' + stringify(obj.toISOString()) + ')';
|
||||
}
|
||||
if (obj === undefined) {
|
||||
return 'undefined';
|
||||
}
|
||||
return JSON.stringify(obj)
|
||||
.replace(/\u2028/g, '\\u2028')
|
||||
.replace(/\u2029/g, '\\u2029')
|
||||
.replace(/</g, '\\u003C')
|
||||
.replace(/>/g, '\\u003E')
|
||||
.replace(/\//g, '\\u002F');
|
||||
}
|
Reference in New Issue
Block a user