Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Ember from 'ember';
import DS from 'ember-data';
import ApplicationSerializer from './application';
const { EmbeddedRecordsMixin } = DS;
const { Mixin } = Ember;
export default ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, {
normalize(model, hash, prop) {
var ret = this._super(...arguments);
return ret;
},
serialize(snapshot, options) {
let json = this._super(...arguments);
delete json.features
delete json.createdAt
delete json.updatedAt
return json;
},
serializeIntoHash: function(hash, type, record, options) {
let serial = this.serialize(record, options);
//edit hash in place because the calling function (adapters/application.js)
// does not use the return by default
Object.keys(serial).forEach(function(key) {
import Ember from 'ember';
import DS from 'ember-data';
import ApplicationSerializer from './application';
const { EmbeddedRecordsMixin } = DS;
const { Mixin } = Ember;
export default ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, {
normalize(model, hash, prop) {
var ret = this._super(...arguments);
return ret;
},
serialize(snapshot, options) {
let json = this._super(...arguments);
delete json.workspaces
delete json.createdAt
delete json.updatedAt
return json;
},
serializeIntoHash: function(hash, type, record, options) {
let serial = this.serialize(record, options);
//edit hash in place because the calling function (adapters/application.js)
// does not use the return by default
Object.keys(serial).forEach(function(key) {
import DS from 'ember-data';
import LFSerializer from 'ember-localforage-adapter/serializers/localforage';
export default LFSerializer.extend(
DS.EmbeddedRecordsMixin, {
attrs: {
addresses: { embedded: 'always' },
hour: { embedded: 'always' }
}
}
);
import DRFSerializer from './drf';
import DS from 'ember-data';
export default DRFSerializer.extend(DS.EmbeddedRecordsMixin, {
attrs: {
post: {serialize: 'id', deserialize: 'records'}
}
});
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import DS from 'ember-data';
export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, {
});
import DS from 'ember-data';
import TransitlandSerializer from "../serializer";
export default TransitlandSerializer.extend(DS.EmbeddedRecordsMixin, {
attrs: {
stop_platforms: {
deserialize: 'records'
},
stop_egresses: {
deserialize: 'records'
}
},
modelNameFromPayloadKey: function(payloadKey){
return "data/transitland/stop-station";
}
});
import DS from 'ember-data';
export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, {
primaryKey: 'slug',
attrs: {
author: { embedded: 'always' },
tagList: {
serialize: 'ids',
deserialize: 'records',
},
},
normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
payload.articles = payload.articles.map(article => {
return this.normalizeArticle(article);
});
payload.meta = {
articlesCount: payload.articlesCount,
};
import Ember from 'ember';
import DS from 'ember-data';
import ApplicationSerializer from './application';
export default ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, {
normalize(model, hash, prop) {
var ret = this._super(...arguments);
return ret;
},
attrs: {
chromosomes: { embedded: 'always' }
}
});
import DS from 'ember-data';
import OfflineSerializer from 'ember-flexberry-data/serializers/offline';
export default OfflineSerializer.extend(DS.EmbeddedRecordsMixin, {
attrs: {
}
});
import { assert } from '@ember/debug';
import { isNone, typeOf } from '@ember/utils';
import { get } from '@ember/object';
import { camelize } from '@ember/string';
import DS from 'ember-data';
import { pluralize, singularize } from 'ember-inflector';
export default DS.JSONSerializer.extend(DS.EmbeddedRecordsMixin, {
isNewSerializerAPI: true,
normalizeCase(string) {
return camelize(string);
},
serializeIntoHash(hash, typeClass, snapshot, options) {
if (snapshot.id) {
hash[get(this, 'primaryKey')] = snapshot.id;
}
this._super(hash, typeClass, snapshot, options);
},
serializeAttribute(snapshot, json, key, attribute) {
let type = attribute.type;