Skip to content

Commit

Permalink
fix(object): change clone deep implementation to use object literal (#65
Browse files Browse the repository at this point in the history
)

fix(object): change clone deep implementation to use object literal
  • Loading branch information
jonluca authored Jun 5, 2023
1 parent 8c923ee commit abd2e4a
Show file tree
Hide file tree
Showing 4 changed files with 437 additions and 365 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
matrix:
node-version:
- 18
- latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
"author": "OpenAPI Contrib",
"license": "MIT",
"dependencies": {
"@types/node": "^18.15.11",
"@types/json-schema": "^7.0.11",
"@types/node": "^20.2.5",
"@types/json-schema": "^7.0.12",
"fast-deep-equal": "^3.1.3",
"openapi-typescript": "^5.4.1"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"c8": "^7.13.0",
"eslint": "^8.37.0",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
"c8": "^7.14.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-unused-imports": "^2.0.0",
"prettier": "^2.8.7",
"semantic-release": "^21.0.1",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
"prettier": "^2.8.8",
"semantic-release": "^21.0.3",
"typescript": "^5.1.3",
"vitest": "^0.31.4"
},
"prettier": {
"printWidth": 120,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils/cloneDeep.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Fromhttps://dev.to/salyadav/deep-clone-of-js-objects-with-circular-dependency-4if7
// From https://dev.to/salyadav/deep-clone-of-js-objects-with-circular-dependency-4if7
const isArray = (val) => {
return Array.isArray(val);
};
Expand All @@ -17,7 +17,7 @@ export const cloneDeep = (val, history = new Set()) => {
stack.add(val);

const copyObject = (o) => {
const oo = Object.create({});
const oo = {};
for (const k in o) {
oo[k] = cloneDeep(o[k], stack);
}
Expand Down
Loading

0 comments on commit abd2e4a

Please sign in to comment.