├── .dockerignore ├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── main.yml ├── .gitignore ├── index.js ├── license ├── package.json ├── readme.md └── test.js /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [{package.json,*.yml}] 11 | indent_style = space 12 | indent_size = 2 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | - push 4 | - pull_request 5 | jobs: 6 | test: 7 | name: Node.js ${{ matrix.node-version }} 8 | runs-on: ubuntu-latest 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | node-version: 13 | - 14 14 | - 12 15 | - 10 16 | - 8 17 | - 6 18 | - 4 19 | - 0.12 20 | - 0.1 21 | steps: 22 | - uses: actions/checkout@v2 23 | - uses: actions/setup-node@v1 24 | with: 25 | node-version: ${{ matrix.node-version }} 26 | - run: npm install 27 | - run: npm test 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var __deepEqual = require('core-assert').__deepEqual; 3 | 4 | module.exports = function (a, b) { 5 | return __deepEqual(a, b, true); 6 | }; 7 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "deep-strict-equal", 3 | "version": "0.2.0", 4 | "description": "Test for deep equality - Node.js `assert.deepStrictEqual()` algorithm as a standalone module", 5 | "license": "MIT", 6 | "repository": "sindresorhus/deep-strict-equal", 7 | "author": { 8 | "name": "Sindre Sorhus", 9 | "email": "sindresorhus@gmail.com", 10 | "url": "sindresorhus.com" 11 | }, 12 | "engines": { 13 | "node": ">=0.10.0" 14 | }, 15 | "scripts": { 16 | "test": "xo && ava" 17 | }, 18 | "files": [ 19 | "index.js" 20 | ], 21 | "keywords": [ 22 | "builtin", 23 | "core", 24 | "ponyfill", 25 | "polyfill", 26 | "shim", 27 | "deep", 28 | "strict", 29 | "equal", 30 | "equality", 31 | "eq", 32 | "same", 33 | "algorithm" 34 | ], 35 | "dependencies": { 36 | "core-assert": "^0.2.0" 37 | }, 38 | "devDependencies": { 39 | "ava": "*", 40 | "xo": "*" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | This package is deprecated as it's too much effort to keep it in sync with the Node.js implementation. Just use [`util.isDeepStrictEqual()`](https://nodejs.org/api/util.html#util_util_isdeepstrictequal_val1_val2). 2 | 3 | --- 4 | 5 | # deep-strict-equal 6 | 7 | > Test for deep equality - Node.js [`assert.deepStrictEqual()`](https://nodejs.org/api/assert.html#assert_assert_deepstrictequal_actual_expected_message) algorithm as a standalone module 8 | 9 | ## Install 10 | 11 | ``` 12 | $ npm install deep-strict-equal 13 | ``` 14 | 15 | ## Usage 16 | 17 | ```js 18 | const deepStrictEqual = require('deep-strict-equal'); 19 | 20 | deepStrictEqual({foo: {bar: [1, 2]}}, {foo: {bar: [1, 2]}}); 21 | //=> true 22 | 23 | deepStrictEqual({foo: {bar: [1, 2]}}, {foo: {bar: [1, 4]}}); 24 | //=> false 25 | 26 | deepStrictEqual({foo: {bar: 1}}, {foo: {bar: 1}}); 27 | //=> true 28 | 29 | deepStrictEqual({foo: {bar: 1}}, {foo: {bar: '1'}}); 30 | //=> false 31 | ``` 32 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | import test from 'ava'; 2 | import fn from './'; 3 | 4 | test(t => { 5 | t.true(fn({foo: {bar: [1, 2]}}, {foo: {bar: [1, 2]}})); 6 | t.false(fn({foo: {bar: [1, 2]}}, {foo: {bar: [1, 3]}})); 7 | t.true(fn({foo: {bar: 1}}, {foo: {bar: 1}})); 8 | t.false(fn({foo: {bar: 1}}, {foo: {bar: '1'}})); 9 | }); 10 | --------------------------------------------------------------------------------