Welcome to mirror list, hosted at ThFree Co, Russian Federation.

norm-object.yaml « update « test « jju « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 93878675b7abc72949ec55aa11d9081c7aeb8972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
input: |
  {
    "name": "test",
    "version": "0.0.0",
    "dependencies": {
      "foobar": "*",
      "bazquux": ">= 1.1.1"
    },
    "license": "BSD-2-Clause"
  }

output: |
  {
    "name": "test",
    "version": "0.0.0",
    "dependencies": {
      "foobar": "*",
      "bazquux": ">= 1.1.1",
      "whatever": "1.2.x",
      "qwerty": "1"
    },
    "license": "BSD-2-Clause"
  }

test: !!js/function |
  function(jju, input) {
    obj = jju.parse(input)
    obj.dependencies.whatever = '1.2.x'
    obj.dependencies.qwerty = '1'
    return jju.update(input, obj, {mode:'json'})
  }