This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Deep diff between two object, using lodash | |
| * @param {Object} object Object compared | |
| * @param {Object} base Object to compare with | |
| * @return {Object} Return a new object who represent the diff | |
| */ | |
| function difference(object, base) { | |
| function changes(object, base) { | |
| return _.transform(object, function(result, value, key) { | |
| if (!_.isEqual(value, base[key])) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| animations: [ | |
| trigger('items', [ | |
| transition(':enter', [ | |
| style({ opacity: 0 }), | |
| animate('.1s ease-in', | |
| style({ opacity: 1 })) | |
| ]), | |
| transition(':leave', [ | |
| style({ opacity: 1}), | |
| animate('.1s ease-out', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // from https://github.com/GoogleChrome/puppeteer/issues/3397#issuecomment-434970058 | |
| page.on('console', async msg => { | |
| // serialize my args the way I want | |
| const args = await Promise.all(msg.args().map(arg => arg.executionContext().evaluate(arg => { | |
| // I'm in a page context now. If my arg is an error - get me its message. | |
| if (arg instanceof Error) { | |
| return arg.message; | |
| } | |
| // return arg right away. since we use `executionContext.evaluate`, it'll return JSON value of |