File: object.coffee

package info (click to toggle)
node-xml2js 0.4.23%2B~cs15.4.0%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,380 kB
  • sloc: xml: 117; javascript: 7; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
perf 'Create simple object', 100000, (run) ->
  obj =
    ele: "simple element"
    person:
      name: "John"
      '@age': 35
      '?pi': 'mypi'
      '#comment': 'Good guy'
      '#cdata': 'well formed!'
      unescaped:
        '#raw': '&<>&'
      address:
        city: "Istanbul"
        street: "End of long and winding road"
      contact:
        phone: [ "555-1234", "555-1235" ]
      id: () -> return 42
      details:
        '#text': 'classified'

  run () -> xml(obj)