Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DMDesign
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amanda Ghassaei
DMDesign
Commits
b45e4965
Commit
b45e4965
authored
9 years ago
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
not using jsonfn
parent
0349a2ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dependencies/jsonfn.js
+0
-84
0 additions, 84 deletions
dependencies/jsonfn.js
js/main.js
+0
-4
0 additions, 4 deletions
js/main.js
with
0 additions
and
88 deletions
dependencies/jsonfn.js
deleted
100755 → 0
+
0
−
84
View file @
0349a2ef
/**
* JSONfn - javascript (both node.js and browser) plugin to stringify,
* parse and clone objects with Functions, Regexp and Date.
*
* Version - 0.60.00
* Copyright (c) 2012 - 2014 Vadim Kiryukhin
* vkiryukhin @ gmail.com
* http://www.eslinstructor.net/jsonfn/
*
* Licensed under the MIT license ( http://www.opensource.org/licenses/mit-license.php )
*
* USAGE:
* browser:
* JSONfn.stringify(obj);
* JSONfn.parse(str[, date2obj]);
* JSONfn.clone(obj[, date2obj]);
*
* nodejs:
* var JSONfn = require('path/to/json-fn');
* JSONfn.stringify(obj);
* JSONfn.parse(str[, date2obj]);
* JSONfn.clone(obj[, date2obj]);
*
*
* @obj - Object;
* @str - String, which is returned by JSONfn.stringify() function;
* @date2obj - Boolean (optional); if true, date string in ISO8061 format
* is converted into a Date object; otherwise, it is left as a String.
*/
"
use strict
"
;
(
function
(
exports
)
{
exports
.
stringify
=
function
(
obj
)
{
return
JSON
.
stringify
(
obj
,
function
(
key
,
value
)
{
if
(
value
instanceof
Function
||
typeof
value
==
'
function
'
)
{
return
value
.
toString
();
}
if
(
value
instanceof
RegExp
)
{
return
'
_PxEgEr_
'
+
value
;
}
return
value
;
});
};
exports
.
parse
=
function
(
str
,
date2obj
)
{
var
iso8061
=
date2obj
?
/^
(\d{4})
-
(\d{2})
-
(\d{2})
T
(\d{2})
:
(\d{2})
:
(\d{2}(?:\.\d
*
)?)
Z$/
:
false
;
return
JSON
.
parse
(
str
,
function
(
key
,
value
)
{
var
prefix
;
if
(
typeof
value
!=
'
string
'
)
{
return
value
;
}
if
(
value
.
length
<
8
)
{
return
value
;
}
prefix
=
value
.
substring
(
0
,
8
);
if
(
iso8061
&&
value
.
match
(
iso8061
))
{
return
new
Date
(
value
);
}
if
(
prefix
===
'
function
'
)
{
return
eval
(
'
(
'
+
value
+
'
)
'
);
}
if
(
prefix
===
'
_PxEgEr_
'
)
{
return
eval
(
value
.
slice
(
8
));
}
return
value
;
});
};
exports
.
clone
=
function
(
obj
,
date2obj
)
{
return
exports
.
parse
(
exports
.
stringify
(
obj
),
date2obj
);
};
}(
typeof
exports
===
'
undefined
'
?
(
window
.
JSONfn
=
{})
:
exports
));
This diff is collapsed.
Click to expand it.
js/main.js
+
0
−
4
View file @
b45e4965
...
...
@@ -16,7 +16,6 @@ require.config({
numeric
:
'
../dependencies/numeric-1.2.6
'
,
codeMirrorJS
:
'
../dependencies/codemirror/javascript
'
,
codeMirror
:
'
../dependencies/codemirror/codemirror
'
,
jsonFn
:
'
../dependencies/jsonfn
'
,
//three
three
:
'
../dependencies/three
'
,
...
...
@@ -235,9 +234,6 @@ require.config({
},
'
numeric
'
:
{
exports
:
'
numeric
'
},
'
jsonFn
'
:
{
exports
:
'
JSONfn
'
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment