Skip to content

Commit 0e2c5e4

Browse files
committed
Switch to JSON.stringify.
1 parent 8717141 commit 0e2c5e4

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

dist/angular-data.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2392,7 +2392,7 @@ function DSLocalStorageAdapterProvider() {
23922392
if (item) {
23932393
DSUtils.deepMixIn(item, value);
23942394
}
2395-
localStorage.setItem(key, angular.toJson(item || value));
2395+
localStorage.setItem(key, JSON.stringify(item || value));
23962396
return DSLocalStorageAdapter.GET(key);
23972397
});
23982398
},
@@ -4218,7 +4218,7 @@ Defaults.prototype.defaultFilter = function (collection, resourceName, params, o
42184218
if (_this.utils.isString(def)) {
42194219
def = [def, 'ASC'];
42204220
} else if (!_this.utils.isArray(def)) {
4221-
throw new _this.errors.IllegalArgumentError('DS.filter(resourceName[, params][, options]): ' + angular.toJson(def) + ': Must be a string or an array!', {
4221+
throw new _this.errors.IllegalArgumentError('DS.filter(resourceName[, params][, options]): ' + JSON.stringify(def) + ': Must be a string or an array!', {
42224222
params: {
42234223
'orderBy[i]': {
42244224
actual: typeof def,
@@ -7716,7 +7716,7 @@ module.exports = ['$q', function ($q) {
77167716
isFunction: angular.isFunction,
77177717
isEmpty: require('mout/lang/isEmpty'),
77187718
isRegExp: isRegExp,
7719-
toJson: angular.toJson,
7719+
toJson: JSON.stringify,
77207720
fromJson: angular.fromJson,
77217721
makePath: require('mout/string/makePath'),
77227722
upperCase: require('mout/string/upperCase'),

dist/angular-data.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/adapters/localStorage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function DSLocalStorageAdapterProvider() {
9595
if (item) {
9696
DSUtils.deepMixIn(item, value);
9797
}
98-
localStorage.setItem(key, angular.toJson(item || value));
98+
localStorage.setItem(key, JSON.stringify(item || value));
9999
return DSLocalStorageAdapter.GET(key);
100100
});
101101
},

src/datastore/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Defaults.prototype.defaultFilter = function (collection, resourceName, params, o
133133
if (_this.utils.isString(def)) {
134134
def = [def, 'ASC'];
135135
} else if (!_this.utils.isArray(def)) {
136-
throw new _this.errors.IllegalArgumentError('DS.filter(resourceName[, params][, options]): ' + angular.toJson(def) + ': Must be a string or an array!', {
136+
throw new _this.errors.IllegalArgumentError('DS.filter(resourceName[, params][, options]): ' + JSON.stringify(def) + ': Must be a string or an array!', {
137137
params: {
138138
'orderBy[i]': {
139139
actual: typeof def,

src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ module.exports = ['$q', function ($q) {
8181
isFunction: angular.isFunction,
8282
isEmpty: require('mout/lang/isEmpty'),
8383
isRegExp: isRegExp,
84-
toJson: angular.toJson,
84+
toJson: JSON.stringify,
8585
fromJson: angular.fromJson,
8686
makePath: require('mout/string/makePath'),
8787
upperCase: require('mout/string/upperCase'),

0 commit comments

Comments
 (0)