0.3.0 • Published 5 months ago

merge-args v0.3.0

Weekly downloads
82
License
MIT
Repository
github
Last release
5 months ago

merge-args

Simple extended merge function that merges an args object over a target object with defaults specified and performs type checking.

Creating a new merge function with default options

const MergeArgs = require('merge-args')

var mergeArgs = MergeArgs()

var defaults = {
    foo: 'bar'
}

mergeArgs(defaults, {foo: 'bam'})

// defaults: {foo: bam}

Merge options

var mergeArgs = MergeArgs({
    concatArrays: false,
    emptyStringUndefined: false,
})

Default merge options can be overridden by passing options when creating a new merge function.

All options have a default of true but can be set to false.

concatArrays

When merging arrays concatenate. When set to false arrays will be replaced.

emptyStringUndefined

Convert empty strings to undefined after merge complete.

0.3.0

5 months ago

0.2.18

5 years ago

0.2.17

6 years ago

0.2.16

7 years ago

0.2.15

7 years ago

0.2.14

7 years ago

0.2.13

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago