How to use the ferrum.deepclone function in ferrum

To help you get started, we’ve selected a few ferrum examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adobe / helix-pipeline / test / testEmitJSON.js View on Github external
it('handles missing content object', () => {
    // no content object at all
    const dat = deepclone({ response });
    emit(dat, action);
    assert.deepEqual(dat, { response, content: {} });
  });
});
github adobe / helix-pipeline / test / testOutputDebug.js View on Github external
it('Testing no debug', () => {
    const context = getContext();
    context.request.params.debug = false;
    debug(context, { logger });
    assert.deepEqual(context, deepclone(context));
  });
github adobe / helix-pipeline / test / testEmitJSON.js View on Github external
it('does nothing if no JSON object specified', () => {
    const dat = deepclone({ content: {}, response });
    emit(dat, action);
    assert(dat, { content: {}, response });
  });
github adobe / helix-pipeline / test / testEmitXML.js View on Github external
it('builds XML from object', () => {
    const data = deepclone(context);
    emit(data, action);
    assert.deepEqual(data.response.body, expectedXML);
  });
github adobe / helix-pipeline / test / testRewriteStatic.js View on Github external
it('Ignores non-HTML', () => {
    const dat = {
      response: {
        body: '{}',
        headers: {
          'Content-Type': 'application/json',
        },
      },
    };
    const dat2 = deepclone(dat);
    rewrite(dat);
    assertEquals(dat, dat2);
  });
github adobe / helix-pipeline / test / testEmitXML.js View on Github external
it('keeps existing response body', () => {
    context.response.body = expectedXML;
    const data = deepclone(context);
    emit(data, action);
    assert.deepEqual(data, context);
  });
github adobe / helix-pipeline / test / testEmitJSON.js View on Github external
it('handles missing response object', () => {
    const dat = deepclone({ content });
    emit(dat, action);
    assert.deepEqual(dat.response.body, expectedJSON);
  });

ferrum

Features from the rust language in javascript: Provides Traits/Type classes & an advanced library for working with sequences/iterators in js.

Apache-2.0
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis