File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1010 "author" : " Contentful <opensource@contentful.com>" ,
1111 "license" : " MIT" ,
1212 "scripts" : {
13- "clean" : " rimraf *.js && rimraf coverage && rimraf src/vendor-* && rimraf vendor-* && rimraf src/package.json" ,
13+ "clean" : " rimraf *.js && rimraf coverage && rimraf src/vendor-* && rimraf mixins && rimraf vendor-* && rimraf src/package.json" ,
1414 "build" : " npm run clean && npm run vendor && cp -r src/vendor-* . && npm run build:dist" ,
1515 "build:dist" : " babel src --out-dir ." ,
1616 "test:ci" : " npm run test:cover" ,
Original file line number Diff line number Diff line change 1+ import { cloneDeep } from 'lodash/lang'
2+
3+ /**
4+ * Mixes in a method to return just a plain object with no additional methods
5+ * @private
6+ * @param {Object } data - Any plain JSON response returned from the API
7+ * @return {Object } Enhanced object with toPlainObject method
8+ */
9+ export default function mixinToPlainObject ( data ) {
10+ return Object . defineProperty ( data , 'toPlainObject' , {
11+ enumerable : false ,
12+ configurable : false ,
13+ writable : false ,
14+ value : function ( ) {
15+ return cloneDeep ( this )
16+ }
17+ } )
18+ }
You can’t perform that action at this time.
0 commit comments