Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 4.5KB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <h1 align=center>
  2. <a href="http://chaijs.com" title="Chai Documentation">
  3. <img alt="ChaiJS" src="http://chaijs.com/img/chai-logo.png"/> deep-eql
  4. </a>
  5. </h1>
  6. <p align=center>
  7. Improved deep equality testing for [node](http://nodejs.org) and the browser.
  8. </p>
  9. <p align=center>
  10. <a href="./LICENSE">
  11. <img
  12. alt="license:mit"
  13. src="https://img.shields.io/badge/license-mit-green.svg?style=flat-square"
  14. />
  15. </a><a href="https://github.com/chaijs/deep-eql/releases">
  16. <img
  17. alt="tag:?"
  18. src="https://img.shields.io/github/tag/chaijs/deep-eql.svg?style=flat-square"
  19. />
  20. </a><a href="https://travis-ci.org/chaijs/deep-eql">
  21. <img
  22. alt="build:?"
  23. src="https://img.shields.io/travis/chaijs/deep-eql/master.svg?style=flat-square"
  24. />
  25. </a><a href="https://coveralls.io/r/chaijs/deep-eql">
  26. <img
  27. alt="coverage:?"
  28. src="https://img.shields.io/coveralls/chaijs/deep-eql/master.svg?style=flat-square"
  29. />
  30. </a><a href="https://www.npmjs.com/packages/deep-eql">
  31. <img
  32. alt="code quality:?"
  33. src="https://img.shields.io/codacy/6de187aa62274dbea6e69a3c27e798da.svg?style=flat-square"
  34. />
  35. </a><a href="https://www.npmjs.com/packages/deep-eql">
  36. <img
  37. alt="dependencies:?"
  38. src="https://img.shields.io/npm/dm/deep-eql.svg?style=flat-square"
  39. />
  40. </a><a href="">
  41. <img
  42. alt="devDependencies:?"
  43. src="https://img.shields.io/david/chaijs/deep-eql.svg?style=flat-square"
  44. />
  45. </a><a href="https://github.com/nodejs/LTS#lts-schedule1">
  46. <img
  47. alt="Supported Node Version: 4+"
  48. src="https://img.shields.io/badge/node-4+-43853d.svg?style=flat-square"
  49. />
  50. </a>
  51. <br/>
  52. <a href="https://saucelabs.com/u/chaijs-deep-eql">
  53. <img
  54. alt="Selenium Test Status"
  55. src="https://saucelabs.com/browser-matrix/chaijs-deep-eql.svg"
  56. />
  57. </a>
  58. <br>
  59. <a href="https://chai-slack.herokuapp.com/">
  60. <img
  61. alt="Join the Slack chat"
  62. src="https://img.shields.io/badge/slack-join%20chat-E2206F.svg?style=flat-square"
  63. />
  64. </a>
  65. <a href="https://gitter.im/chaijs/deep-eql">
  66. <img
  67. alt="Join the Gitter chat"
  68. src="https://img.shields.io/badge/gitter-join%20chat-D0104D.svg?style=flat-square"
  69. />
  70. </a>
  71. </p>
  72. ## What is Deep-Eql?
  73. Deep Eql is a module which you can use to determine if two objects are "deeply" equal - that is, rather than having referential equality (`a === b`), this module checks an object's keys recursively, until it finds primitives to check for referential equality. For more on equality in JavaScript, read [the comparison operators article on mdn](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators).
  74. As an example, take the following:
  75. ```js
  76. 1 === 1 // These are primitives, they hold the same reference - they are strictly equal
  77. 1 == '1' // These are two different primitives, through type coercion they hold the same value - they are loosely equal
  78. { a: 1 } !== { a: 1 } // These are two different objects, they hold different references and so are not strictly equal - even though they hold the same values inside
  79. { a: 1 } != { a: 1 } // They have the same type, meaning loose equality performs the same check as strict equality - they are still not equal.
  80. var deepEql = require("deep-eql");
  81. deepEql({ a: 1 }, { a: 1 }) === true // deepEql can determine that they share the same keys and those keys share the same values, therefore they are deeply equal!
  82. ```
  83. ## Installation
  84. ### Node.js
  85. `deep-eql` is available on [npm](http://npmjs.org).
  86. $ npm install deep-eql
  87. ## Usage
  88. The primary export of `deep-eql` is function that can be given two objects to compare. It will always return a boolean which can be used to determine if two objects are deeply equal.
  89. ### Rules
  90. - Strict equality for non-traversable nodes according to [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is):
  91. - `eql(NaN, NaN).should.be.true;`
  92. - `eql(-0, +0).should.be.false;`
  93. - All own and inherited enumerable properties are considered:
  94. - `eql(Object.create({ foo: { a: 1 } }), Object.create({ foo: { a: 1 } })).should.be.true;`
  95. - `eql(Object.create({ foo: { a: 1 } }), Object.create({ foo: { a: 2 } })).should.be.false;`
  96. - Arguments are not Arrays:
  97. - `eql([], arguments).should.be.false;`
  98. - `eql([], Array.prototype.slice.call(arguments)).should.be.true;`
  99. - Error objects are compared by reference (see https://github.com/chaijs/chai/issues/608):
  100. - `eql(new Error('msg'), new Error('msg')).should.be.false;`
  101. - `var err = new Error('msg'); eql(err, err).should.be.true;`