Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function traverseCSS( css, callback ) {
try {
const parsed = parse( css );
const updated = traverse.map( parsed, function( node ) {
if ( ! node ) {
return node;
}
const updatedNode = callback( node );
return this.update( updatedNode );
} );
return stringify( updated );
} catch ( err ) {
// eslint-disable-next-line no-console
console.warn( 'Error while traversing the CSS: ' + err );
return null;
}
}
export function recursiveUpdateTaskIds(tasks, map) {
return traverse.map(tasks, function (value) {
// Do not attempt to change old task Ids
if (this.key === 'oldTaskId') return value;
// Only operate on values that are strings;
if (typeof value !== 'string') return value;
// XXX: This is slow and somewhat terrible but reliable... The task ids may
// appear anywhere in the graph (though it may not be super useful to do
// so).
Object.keys(map).forEach((oldTaskId) => {
let newTaskId = map[oldTaskId];
// .replace does not replace all matches so iterate through all matches.
while (value.indexOf(oldTaskId) !== -1) {
value = value.replace(oldTaskId, newTaskId);
}
});
return value;
});
function decorateFixture(fixture: FixtureType<p>): FixtureType</p><p> {
if (!inJestEnv() || !fixture.props) {
return fixture;
}
return {
...fixture,
props: traverse.map(fixture.props, addJestWrapper)
};
}
</p>
var buildRowKey = function(obj) {
var key;
try {
key = obj[_collection.time_field || 'timestamp'].toISOString();
} catch (ex) {
key = '';
}
traverse.map(obj, function(x) {
if (x && typeof(x) === 'string') {
key += x;
}
});
key = joola.common.hash(key);
return key;
};