New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

map-factory

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

map-factory - npm Package Versions

1
6

2.0.3

Diff

Changelog

Source

2.0.3

Removed some debugging code that was accidentally left in.

midknight41
published 2.0.2 •

Changelog

Source

2.0.2

Made the babel output ES5 to allow use in the browser.

midknight41
published 2.0.1 •

Changelog

Source

2.0.1

Screwed up with publishing 2.0.0. This fixed that.

midknight41
published 2.0.0 •

Changelog

Source

2.0.0

In v1 the default behaviour was the equivalent of setting the options as {alwaysTransform: true, alwaysSet: true}. In v2 the default behaviour is now the equivalent of setting the options as {alwaysTransform: false, alwaysSet: false}.

We feel these are generally better defaults. This is a breaking change.

If you prefer the v1 behaviour you just need to change your code as follows:

Old Code
const mapper = createMapper();
New Code
const options = {
  alwaysTransform: true,
  alwaysSet: true
};

const mapper = createMapper(options);

Additionally, the v1 behaviour would consider a null an acceptable value if a ? was appended to the to() field. In v2 this behaviour will only work in combination with the always flag.

Old Code
map("foo.bar").to("bar.bar?");
New Code
map("foo.bar").always.to("bar.bar?");
midknight41
published 1.7.2 •

Changelog

Source

1.7.2

Bug-fix to make or mode respect behaviour modifiers.

midknight41
published 1.7.1 •

Changelog

Source

1.7.1

Bug-fix for always and existing modifiers.

midknight41
published 1.7.0 •

Changelog

Source

1.7.0

Introduced behaviour modifiers to make map-factory more flexible. See README for more details.

Modify default behaviour
const createMapper = require("map-factory");

const options = {
  alwaysTransform: false,
  alwaysSet: false
};

const mapper = createMapper(options);
Modify behaviour on a single mapping
const createMapper = require("map-factory");

const mapper = createMapper(options);

mapper
  .map("a").always.to("b")
  .map("c").existing.to("d");
midknight41
published 1.6.3 •

Changelog

Source

1.6.3

Set experimental flag to eliminate some of the object-mapper code

midknight41
published 1.6.2 •

Changelog

Source

1.6.2

Remove object-mapper dependency

midknight41
published 1.6.1 •

Changelog

Source

1.6.1

Fixed regression in experimental mode

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc