adam
Functions to create, process and test objects/maps/arrays/sets.
Installation
Node
npm install adam
Bower
bower install adam
AMD, <script>
Use dist/adam.js
or dist/adam.min.js
(minified version).
↑
UsageNode
var adam = ;
AMD
;
Bower, <script>
<!-- Use bower_components/adam/dist/adam.js if the library was installed by Bower -->
↑
Examples { return ++datavalue;} var obj = a: 1 b: 2 c: 3 d: 4 e: 5 s1 = Symbol"s1" s2 = Symbol"s2" proto = a: 1 obj2 = Object; protos1 = "s1";obj2b = 2;obj2s2 = null;obj2c = "str";obj2d = 0; adam; // [s2, s1] adam; // "Array"adam; // "null"adam; // trueadam; // trueadam; // true adam; // trueadam; // false adam; // trueadam; // falseadam; // true adam; // "a4"adam; // "key-0"adam; // "key-2" adam; // 5adam; // 2adam; // 3adam; // falseadam; // trueadam; // true adam; // ["a", "b", "c", "d", "e"]adam; // ["a", "b", "c"]adam; // ["d", "e"]adam; // ["b", "c", "d", s2, "a", s1]adam; // ["c", "d", s2, s1]adam; // ["b", "d"]adam // [s2, s1]adam; // [{key: "b", value: 2}, {key: "d", value: 0}, {key: "a", value: 1}]adam; // [["b", 2], ["d", 0], ["a", 1]]adam; // [obj, obj2]adam; // [{key: "a", value: 1}, {key: "c", value: 5}] adam; // [1, 2, 3, 4, 5]adam; // [1, 3]adam; // ["a", 2]adam; // "c" adam; // {a: {id: "a", value: 11}, b: {id: "b", value: 7}, c: {id: "c", value: 10}} adam; // -5adam; // falseadam; // -3adam; // -1adam; // -2 adam; // [{a: 1, d: 4}, {b: 2, c: 3, e: 5}]adam; // [{a: 1, c: 3, e: 5}, {b: 2, d: 4}]adam; // [{b: 2, c: 3, d: 4}, {a: 1, e: 5}]adam; // [Map{obj -> 2, false -> obj2}, Map{"a" -> false, true -> null}] adam; // {a: 1, c: 3}adam; // [1, 3, 5]adam; // Set[2, 4] adam; // {} adam; // {x: "a", files: "b"}adam; // "lave"adam; // Map{1 -> obj, 2 -> obj2} adam; // 7 adam; // {a: 1, b: 2, c: 3, d: 4, e: 5, z: "a"}adam; // {a: 1, b: "no", c: 3, e: 5, z: "a"}adam; // {b: 3, d: 5, z: "a"} adam; // {a: -1, b: -2, c: -3}adam; // {a: 0, b: 28, c: -3, d: null, e: ""}adam; // [1, -2, 3, -4, 5] adam; // {a: -1, c: -3, e: -5}adam; // [1, 2, 3]
See test/adam.js
for additional examples.
↑
APISee docs
.
↑
Related projectsContributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
License
Copyright (c) 2014-2020 Denis Sikuler
Licensed under the MIT license.