src/nodejs/jssets

Set for the JavaScript target.

Types

JsSet {.importjs: "Set".} = ref object of JsRoot
  size: cint
Set API.

Procs

func add(this: JsSet; value: JsObject) {.importjs: "#.$1(#)", ...raises: [],
    tags: [].}
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add
func contains(this: JsSet; value: JsObject): bool {.importjs: "#.has(#)",
    ...raises: [], tags: [].}
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has
func delete(this: JsSet; value: JsObject) {.importjs: "#.$1(#)", ...raises: [],
    tags: [].}
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete
func len(this: JsSet): int {....raises: [], tags: [].}
func newJsSet(): JsSet {.importjs: "new Set()", ...raises: [], tags: [].}
Constructor for JsSet.
func newJsSet(items: openArray[JsObject]): JsSet {.importjs: "new Set(#)",
    ...raises: [], tags: [].}
Constructor for JsSet.
func toCstring(this: JsSet): seq[cstring] {.importjs: """  (() => {const result = []; #.forEach(item => result.push(JSON.stringify(item))); return result})()""",
    ...raises: [], tags: [].}
Convert JsSet to seq[cstring], all items will be converted to cstring.

Templates

template `$`(this: JsSet): string