Skip to content

Commit

Permalink
chore: bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
pionxzh committed Apr 6, 2024
1 parent 7fbb50b commit 5c6f81e
Show file tree
Hide file tree
Showing 5 changed files with 2,403 additions and 3,313 deletions.
14 changes: 7 additions & 7 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
"dependencies": {
"@textea/json-viewer": "workspace:^",
"gray-matter": "^4.0.3",
"next": "^13.5.0",
"nextra": "^2.13.2",
"nextra-theme-docs": "^2.3.0",
"next": "^13.5.6",
"nextra": "^2.13.3",
"nextra-theme-docs": "^2.13.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^20.8.6",
"@types/react": "^18.2.13",
"@types/react-dom": "^18.2.14",
"typescript": "^5.0.3"
"@types/node": "^20.11.19",
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"typescript": "^5.3.3"
}
}
77 changes: 38 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
"build": "tsc && rollup -c rollup.config.ts --configPlugin swc3"
},
"dependencies": {
"clsx": "^2.0.0",
"clsx": "^2.1.0",
"copy-to-clipboard": "^3.3.3",
"zustand": "^4.4.7"
"zustand": "^4.5.2"
},
"lint-staged": {
"!*.{ts,tsx,js,jsx}": "prettier --write --ignore-unknown",
Expand All @@ -75,50 +75,49 @@
"react-dom": "^17 || ^18"
},
"devDependencies": {
"@commitlint/cli": "^17.6.5",
"@commitlint/config-angular": "^17.8.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.2",
"@rollup/plugin-alias": "^5.0.0",
"@rollup/plugin-commonjs": "^25.0.2",
"@rollup/plugin-node-resolve": "^15.1.0",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-angular": "^19.1.0",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/material": "^5.15.15",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@swc/core": "^1.3.66",
"@swc/helpers": "^0.5.3",
"@testing-library/react": "^14.0.0",
"@types/node": "^20.8.6",
"@types/react": "^18.2.13",
"@types/react-dom": "^18.2.14",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.2.1",
"@vitejs/plugin-react": "^4.0.3",
"@vitest/coverage-v8": "^0.32.2",
"eslint": "^8.43.0",
"@swc/core": "^1.4.12",
"@swc/helpers": "^0.5.8",
"@testing-library/react": "^14.2.2",
"@types/node": "^20.12.5",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.4.0",
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-cypress": "^2.13.3",
"eslint-plugin-import": "npm:eslint-plugin-i@^2.27.5-3",
"eslint-plugin-n": "^16.3.1",
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"expect-type": "^0.16.0",
"husky": "^8.0.3",
"jsdom": "^22.1.0",
"lint-staged": "^13.2.2",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-unused-imports": "^3.1.0",
"expect-type": "^0.19.0",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"lint-staged": "^15.2.2",
"pinst": "^3.0.0",
"prettier": "^3.0.1",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^3.25.2",
"rollup-plugin-dts": "^5.3.0",
"rollup-plugin-swc3": "^0.10.3",
"ts-node": "^10.9.1",
"typescript": "^5.1.3",
"vite": "^4.5.3",
"vitest": "^0.33.0"
"rollup": "^4.14.0",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-swc3": "^0.11.0",
"ts-node": "^10.9.2",
"typescript": "^5.4.4",
"vite": "^5.2.8",
"vitest": "^1.4.0"
},
"resolutions": {
"browserslist": "4.21.5",
Expand Down
18 changes: 16 additions & 2 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,23 @@ const buildMatrix = (input: string, output: string, config: {
// we have to copy this configuration because swc is not handling `.browserslistrc` properly
// see https://github.com/swc-project/swc/issues/3365
targets: 'and_chr 91,and_ff 89,and_qq 10.4,and_uc 12.12,android 91,baidu 7.12,chrome 90,edge 91,firefox 78,ios_saf 12.2,kaios 2.5,op_mini all,op_mob 76'
}
},
tsconfig: false
}))
]
],
/**
* Ignore "use client" waning
* @see {@link https://github.com/TanStack/query/pull/5161#issuecomment-1477389761 Preserve 'use client' directives}
*/
onwarn (warning, warn) {
if (
warning.code === 'MODULE_LEVEL_DIRECTIVE' &&
warning.message.includes('"use client"')
) {
return
}
warn(warning)
}
}
}

Expand Down
23 changes: 17 additions & 6 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ function shallowCopy (value: any) {
return value
}

/**
* Apply a value to a given path of an object.
*/
export function applyValue (input: any, path: (string | number)[], value: any) {
function _applyValue (input: any, path: (string | number)[], value: any, visitedMapping = new Map<any, any>()) {
if (typeof input !== 'object' || input === null) {
if (path.length !== 0) {
throw new Error('path is incorrect')
Expand All @@ -50,22 +47,36 @@ export function applyValue (input: any, path: (string | number)[], value: any) {
}

const shouldCopy = shouldShallowCopy(input)
if (shouldCopy) input = shallowCopy(input)
if (shouldCopy) {
let copiedInput = visitedMapping.get(input)
if (!copiedInput) {
copiedInput = shallowCopy(input)
visitedMapping.set(input, copiedInput)
}
input = copiedInput
}

const [key, ...restPath] = path
if (key !== undefined) {
if (key === '__proto__') {
throw new TypeError('Modification of prototype is not allowed')
}
if (restPath.length > 0) {
input[key] = applyValue(input[key], restPath, value)
input[key] = _applyValue(input[key], restPath, value, visitedMapping)
} else {
input[key] = value
}
}
return input
}

/**
* Apply a value to a given path of an object.
*/
export function applyValue (input: any, path: (string | number)[], value: any) {
return _applyValue(input, path, value)
}

/**
* Delete a value from a given path of an object.
*/
Expand Down
Loading

0 comments on commit 5c6f81e

Please sign in to comment.