From 1093c484d9616959abca66670400b4510ab0f312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Wed, 3 Jan 2024 17:44:02 +0800 Subject: [PATCH 1/9] =?UTF-8?q?[Issues:=20#I8TCGX]=20=E6=B7=BB=E5=8A=A0dee?= =?UTF-8?q?pmerge=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/deepmerge.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 zh-cn/deepmerge.md diff --git a/zh-cn/deepmerge.md b/zh-cn/deepmerge.md new file mode 100644 index 00000000..b1f6681a --- /dev/null +++ b/zh-cn/deepmerge.md @@ -0,0 +1,88 @@ +> 模板版本:v0.0.1 + +

+

deepmerge

+

+

+ + Supported platforms + + + License + +

+ +## 安装与使用 + +进入到工程目录并输入以下命令: + + + +#### **npm** + +```bash +npm install deepmerge +``` + + + +下面的代码展示了这个库的基本使用场景: + +```js +import deepmerge from 'deepmerge' + +const x = { + foo: { bar: 3 }, + array: [{ + does: 'work', + too: [ 1, 2, 3 ] + }] +} + +const y = { + foo: { baz: 4 }, + quux: 5, + array: [{ + does: 'work', + too: [ 4, 5, 6 ] + }, { + really: 'yes' + }] +} + +const output = { + foo: { + bar: 3, + baz: 4 + }, + array: [{ + does: 'work', + too: [ 1, 2, 3 ] + }, { + does: 'work', + too: [ 4, 5, 6 ] + }, { + really: 'yes' + }], + quux: 5 +} + +deepmerge(x, y) // => output +``` + +## 约束与限制 + +## API + +| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| ---- | ---- | ---- | -------- | -------- | -------- | +| deepmerge(x, y, [options]) | Merge two objects x and y deeply, returning a new merged object with the elements from both x and y. | function | No | All | Yes | +| deepmerge.all(arrayOfObjects, [options]) | Merges any number of objects into a single result object. | function | No | All | Yes | + +## 遗留问题 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/TehShrike/deepmerge/blob/master/license.txt) ,请自由地享受和参与开源。 -- Gitee From 64d52795f9a0e92d07a40926cffe65f26a5f767c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Wed, 3 Jan 2024 17:46:41 +0800 Subject: [PATCH 2/9] =?UTF-8?q?[Issues:=20#I8TCHU]=20=E6=B7=BB=E5=8A=A0sty?= =?UTF-8?q?led-components=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/styled-components.md | 89 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 zh-cn/styled-components.md diff --git a/zh-cn/styled-components.md b/zh-cn/styled-components.md new file mode 100644 index 00000000..a8e3ee9a --- /dev/null +++ b/zh-cn/styled-components.md @@ -0,0 +1,89 @@ +> 模板版本:v0.0.1 + +

+

styled-components

+

+

+ + Supported platforms + + + License + +

+ +## 安装与使用 + +进入到工程目录并输入以下命令: + +#### **yarn** + +```bash +yarn add styled-components +``` + + +#### **npm** + +```bash +npm install styled-components +``` + + + +下面的代码展示了这个库的基本使用场景: + +```js +import React from 'react'; + +import styled from 'styled-components'; + +// Create a react component that renders an <h1> which is +// centered, palevioletred and sized at 1.5em +const Title = styled.h1` + font-size: 1.5em; + text-align: center; + color: palevioletred; +`; + +// Create a <Wrapper> react component that renders a <section> with +// some padding and a papayawhip background +const Wrapper = styled.section` + padding: 4em; + background: papayawhip; +`; + +function MyUI() { + return ( + // Use them like any other React component – except they're styled! + <Wrapper> + <Title>Hello World, this is my first styled component! + + ); +} +``` + +## 约束与限制 + +## 属性 + +| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| ---- | ---- | ---- | -------- | -------- | -------- | +| ThemeProvider | A helper component for theming. | component | No | All | Yes | +| css | The css prop is a convenient way to iterate on your components without settling on fixed component boundaries yet | prop | No | All | Yes | +| toStyleSheet | convert a style object to a stylesheet object | function | No | All | Yes | +| ThemeContext | access the theme object and pass the theme object to the style component | jsx component | No | All | Yes | +| isStyledComponent | A utility to help identify styled components. | function | No | All | Yes | +| withTheme | This is a higher order component factory to get the current theme from a ThemeProvider and pass it to your component as a theme prop. | function | No | All | Yes | +| useTheme | This is a custom hook to get the current theme from a ThemeProvider. | function | No | All | Yes | +| ThemeConsumer | It passes the current theme (based on a ThemeProvider higher in your component tree) as an argument to the child function. From this function, you may return further JSX or nothing. |jsx component | No | All | Yes | +| createGlobalstyle | A helper function to generate a special StyledComponent that handles global styles| function | No | Web | No | +| keyframes | A helper method to create keyframes for animations. | function | No | Web | No | + +## 遗留问题 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/styled-components/styled-components/blob/main/LICENSE) ,请自由地享受和参与开源。 -- Gitee From a5760587cecb069d6332e453dcf65cb8cd2817a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Thu, 4 Jan 2024 14:42:19 +0800 Subject: [PATCH 3/9] =?UTF-8?q?[Issues:=20#I8TCGX]=20=E6=B7=BB=E5=8A=A0dee?= =?UTF-8?q?pmerge=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/deepmerge.md | 6 +-- zh-cn/styled-components.md | 89 -------------------------------------- 2 files changed, 3 insertions(+), 92 deletions(-) delete mode 100644 zh-cn/styled-components.md diff --git a/zh-cn/deepmerge.md b/zh-cn/deepmerge.md index b1f6681a..5b29ffee 100644 --- a/zh-cn/deepmerge.md +++ b/zh-cn/deepmerge.md @@ -5,7 +5,7 @@

- Supported platforms + License @@ -76,8 +76,8 @@ deepmerge(x, y) // => output | 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | | ---- | ---- | ---- | -------- | -------- | -------- | -| deepmerge(x, y, [options]) | Merge two objects x and y deeply, returning a new merged object with the elements from both x and y. | function | No | All | Yes | -| deepmerge.all(arrayOfObjects, [options]) | Merges any number of objects into a single result object. | function | No | All | Yes | +| deepmerge(x, y, [options]) | Merge two objects x and y deeply, returning a new merged object with the elements from both x and y. | function | No | / | Yes | +| deepmerge.all(arrayOfObjects, [options]) | Merges any number of objects into a single result object. | function | No | / | Yes | ## 遗留问题 diff --git a/zh-cn/styled-components.md b/zh-cn/styled-components.md deleted file mode 100644 index a8e3ee9a..00000000 --- a/zh-cn/styled-components.md +++ /dev/null @@ -1,89 +0,0 @@ -> 模板版本:v0.0.1 - -

-

styled-components

-

-

- - Supported platforms - - - License - -

- -## 安装与使用 - -进入到工程目录并输入以下命令: - -#### **yarn** - -```bash -yarn add styled-components -``` - - -#### **npm** - -```bash -npm install styled-components -``` - - - -下面的代码展示了这个库的基本使用场景: - -```js -import React from 'react'; - -import styled from 'styled-components'; - -// Create a react component that renders an <h1> which is -// centered, palevioletred and sized at 1.5em -const Title = styled.h1` - font-size: 1.5em; - text-align: center; - color: palevioletred; -`; - -// Create a <Wrapper> react component that renders a <section> with -// some padding and a papayawhip background -const Wrapper = styled.section` - padding: 4em; - background: papayawhip; -`; - -function MyUI() { - return ( - // Use them like any other React component – except they're styled! - <Wrapper> - <Title>Hello World, this is my first styled component! - - ); -} -``` - -## 约束与限制 - -## 属性 - -| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | -| ---- | ---- | ---- | -------- | -------- | -------- | -| ThemeProvider | A helper component for theming. | component | No | All | Yes | -| css | The css prop is a convenient way to iterate on your components without settling on fixed component boundaries yet | prop | No | All | Yes | -| toStyleSheet | convert a style object to a stylesheet object | function | No | All | Yes | -| ThemeContext | access the theme object and pass the theme object to the style component | jsx component | No | All | Yes | -| isStyledComponent | A utility to help identify styled components. | function | No | All | Yes | -| withTheme | This is a higher order component factory to get the current theme from a ThemeProvider and pass it to your component as a theme prop. | function | No | All | Yes | -| useTheme | This is a custom hook to get the current theme from a ThemeProvider. | function | No | All | Yes | -| ThemeConsumer | It passes the current theme (based on a ThemeProvider higher in your component tree) as an argument to the child function. From this function, you may return further JSX or nothing. |jsx component | No | All | Yes | -| createGlobalstyle | A helper function to generate a special StyledComponent that handles global styles| function | No | Web | No | -| keyframes | A helper method to create keyframes for animations. | function | No | Web | No | - -## 遗留问题 - -## 其他 - -## 开源协议 - -本项目基于 [The MIT License (MIT)](https://github.com/styled-components/styled-components/blob/main/LICENSE) ,请自由地享受和参与开源。 -- Gitee From aaf4023e86a7e57d1a74e55c13d3087514e99bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Thu, 4 Jan 2024 14:46:22 +0800 Subject: [PATCH 4/9] =?UTF-8?q?[Issues:=20#I8TCGX]=20=E6=B7=BB=E5=8A=A0dee?= =?UTF-8?q?pmerge=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/deepmerge.md | 88 ---------------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 zh-cn/deepmerge.md diff --git a/zh-cn/deepmerge.md b/zh-cn/deepmerge.md deleted file mode 100644 index 5b29ffee..00000000 --- a/zh-cn/deepmerge.md +++ /dev/null @@ -1,88 +0,0 @@ -> 模板版本:v0.0.1 - -

-

deepmerge

-

-

- - - - - License - -

- -## 安装与使用 - -进入到工程目录并输入以下命令: - - - -#### **npm** - -```bash -npm install deepmerge -``` - - - -下面的代码展示了这个库的基本使用场景: - -```js -import deepmerge from 'deepmerge' - -const x = { - foo: { bar: 3 }, - array: [{ - does: 'work', - too: [ 1, 2, 3 ] - }] -} - -const y = { - foo: { baz: 4 }, - quux: 5, - array: [{ - does: 'work', - too: [ 4, 5, 6 ] - }, { - really: 'yes' - }] -} - -const output = { - foo: { - bar: 3, - baz: 4 - }, - array: [{ - does: 'work', - too: [ 1, 2, 3 ] - }, { - does: 'work', - too: [ 4, 5, 6 ] - }, { - really: 'yes' - }], - quux: 5 -} - -deepmerge(x, y) // => output -``` - -## 约束与限制 - -## API - -| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | -| ---- | ---- | ---- | -------- | -------- | -------- | -| deepmerge(x, y, [options]) | Merge two objects x and y deeply, returning a new merged object with the elements from both x and y. | function | No | / | Yes | -| deepmerge.all(arrayOfObjects, [options]) | Merges any number of objects into a single result object. | function | No | / | Yes | - -## 遗留问题 - -## 其他 - -## 开源协议 - -本项目基于 [The MIT License (MIT)](https://github.com/TehShrike/deepmerge/blob/master/license.txt) ,请自由地享受和参与开源。 -- Gitee From 778a8cdd9b86939a487000ebf201f98bc1a79242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Thu, 4 Jan 2024 14:47:44 +0800 Subject: [PATCH 5/9] =?UTF-8?q?[Issues:=20#I8TCGX]=20=E6=B7=BB=E5=8A=A0dee?= =?UTF-8?q?pmerge=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/deepmerge.md | 85 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 zh-cn/deepmerge.md diff --git a/zh-cn/deepmerge.md b/zh-cn/deepmerge.md new file mode 100644 index 00000000..90fae59d --- /dev/null +++ b/zh-cn/deepmerge.md @@ -0,0 +1,85 @@ +> 模板版本:v0.0.1 + +

+

deepmerge

+

+

+ + License + +

+ +## 安装与使用 + +进入到工程目录并输入以下命令: + + + +#### **npm** + +```bash +npm install deepmerge +``` + + + +下面的代码展示了这个库的基本使用场景: + +```js +import deepmerge from 'deepmerge' + +const x = { + foo: { bar: 3 }, + array: [{ + does: 'work', + too: [ 1, 2, 3 ] + }] +} + +const y = { + foo: { baz: 4 }, + quux: 5, + array: [{ + does: 'work', + too: [ 4, 5, 6 ] + }, { + really: 'yes' + }] +} + +const output = { + foo: { + bar: 3, + baz: 4 + }, + array: [{ + does: 'work', + too: [ 1, 2, 3 ] + }, { + does: 'work', + too: [ 4, 5, 6 ] + }, { + really: 'yes' + }], + quux: 5 +} + +deepmerge(x, y) // => output +``` + +## 约束与限制 + +## API + +| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| ---- | ---- | ---- | -------- | -------- | -------- | +| deepmerge(x, y, [options]) | Merge two objects x and y deeply, returning a new merged object with the elements from both x and y. | function | No | / | Yes | +| deepmerge.all(arrayOfObjects, [options]) | Merges any number of objects into a single result object. | function | No | / | Yes | + +## 遗留问题 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/TehShrike/deepmerge/blob/master/license.txt) ,请自由地享受和参与开源。 -- Gitee From 257d4350f1d7a3575ff849b108b041ed445812e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Thu, 4 Jan 2024 14:52:35 +0800 Subject: [PATCH 6/9] =?UTF-8?q?[Issues:=20#I8TCHU]=20=E6=B7=BB=E5=8A=A0sty?= =?UTF-8?q?led-components=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/styled-components.md | 86 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 zh-cn/styled-components.md diff --git a/zh-cn/styled-components.md b/zh-cn/styled-components.md new file mode 100644 index 00000000..51247561 --- /dev/null +++ b/zh-cn/styled-components.md @@ -0,0 +1,86 @@ +> 模板版本:v0.0.1 + +

+

styled-components

+

+

+ + License + +

+ +## 安装与使用 + +进入到工程目录并输入以下命令: + +#### **yarn** + +```bash +yarn add styled-components +``` + + +#### **npm** + +```bash +npm install styled-components +``` + + + +下面的代码展示了这个库的基本使用场景: + +```js +import React from 'react'; + +import styled from 'styled-components'; + +// Create a react component that renders an <h1> which is +// centered, palevioletred and sized at 1.5em +const Title = styled.h1` + font-size: 1.5em; + text-align: center; + color: palevioletred; +`; + +// Create a <Wrapper> react component that renders a <section> with +// some padding and a papayawhip background +const Wrapper = styled.section` + padding: 4em; + background: papayawhip; +`; + +function MyUI() { + return ( + // Use them like any other React component – except they're styled! + <Wrapper> + <Title>Hello World, this is my first styled component! + + ); +} +``` + +## 约束与限制 + +## 属性 + +| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| ---- | ---- | ---- | -------- | -------- | -------- | +| ThemeProvider | A helper component for theming. | component | No | / | Yes | +| css | The css prop is a convenient way to iterate on your components without settling on fixed component boundaries yet | prop | No | / | Yes | +| toStyleSheet | convert a style object to a stylesheet object | function | No | / | Yes | +| ThemeContext | access the theme object and pass the theme object to the style component | jsx component | No | / | Yes | +| isStyledComponent | A utility to help identify styled components. | function | No | / | Yes | +| withTheme | This is a higher order component factory to get the current theme from a ThemeProvider and pass it to your component as a theme prop. | function | No | / | Yes | +| useTheme | This is a custom hook to get the current theme from a ThemeProvider. | function | No | / | Yes | +| ThemeConsumer | It passes the current theme (based on a ThemeProvider higher in your component tree) as an argument to the child function. From this function, you may return further JSX or nothing. |jsx component | No | / | Yes | +| createGlobalstyle | A helper function to generate a special StyledComponent that handles global styles| function | No | Web | No | +| keyframes | A helper method to create keyframes for animations. | function | No | Web | No | + +## 遗留问题 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/styled-components/styled-components/blob/main/LICENSE) ,请自由地享受和参与开源。 -- Gitee From 713b42591e824a1423130f1e5184551323516c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Thu, 4 Jan 2024 14:57:38 +0800 Subject: [PATCH 7/9] =?UTF-8?q?[Issues:=20#I8TCGX]=20=E6=B7=BB=E5=8A=A0dee?= =?UTF-8?q?pmerge=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/styled-components.md | 86 -------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 zh-cn/styled-components.md diff --git a/zh-cn/styled-components.md b/zh-cn/styled-components.md deleted file mode 100644 index 51247561..00000000 --- a/zh-cn/styled-components.md +++ /dev/null @@ -1,86 +0,0 @@ -> 模板版本:v0.0.1 - -

-

styled-components

-

-

- - License - -

- -## 安装与使用 - -进入到工程目录并输入以下命令: - -#### **yarn** - -```bash -yarn add styled-components -``` - - -#### **npm** - -```bash -npm install styled-components -``` - - - -下面的代码展示了这个库的基本使用场景: - -```js -import React from 'react'; - -import styled from 'styled-components'; - -// Create a react component that renders an <h1> which is -// centered, palevioletred and sized at 1.5em -const Title = styled.h1` - font-size: 1.5em; - text-align: center; - color: palevioletred; -`; - -// Create a <Wrapper> react component that renders a <section> with -// some padding and a papayawhip background -const Wrapper = styled.section` - padding: 4em; - background: papayawhip; -`; - -function MyUI() { - return ( - // Use them like any other React component – except they're styled! - <Wrapper> - <Title>Hello World, this is my first styled component! - - ); -} -``` - -## 约束与限制 - -## 属性 - -| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | -| ---- | ---- | ---- | -------- | -------- | -------- | -| ThemeProvider | A helper component for theming. | component | No | / | Yes | -| css | The css prop is a convenient way to iterate on your components without settling on fixed component boundaries yet | prop | No | / | Yes | -| toStyleSheet | convert a style object to a stylesheet object | function | No | / | Yes | -| ThemeContext | access the theme object and pass the theme object to the style component | jsx component | No | / | Yes | -| isStyledComponent | A utility to help identify styled components. | function | No | / | Yes | -| withTheme | This is a higher order component factory to get the current theme from a ThemeProvider and pass it to your component as a theme prop. | function | No | / | Yes | -| useTheme | This is a custom hook to get the current theme from a ThemeProvider. | function | No | / | Yes | -| ThemeConsumer | It passes the current theme (based on a ThemeProvider higher in your component tree) as an argument to the child function. From this function, you may return further JSX or nothing. |jsx component | No | / | Yes | -| createGlobalstyle | A helper function to generate a special StyledComponent that handles global styles| function | No | Web | No | -| keyframes | A helper method to create keyframes for animations. | function | No | Web | No | - -## 遗留问题 - -## 其他 - -## 开源协议 - -本项目基于 [The MIT License (MIT)](https://github.com/styled-components/styled-components/blob/main/LICENSE) ,请自由地享受和参与开源。 -- Gitee From b74a5b609b63023b22997aeb42a8beff25751c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Thu, 4 Jan 2024 16:55:57 +0800 Subject: [PATCH 8/9] =?UTF-8?q?[Issues:=20#I8TCGX]=20=E6=B7=BB=E5=8A=A0dee?= =?UTF-8?q?pmerge=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/deepmerge.md | 85 ---------------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 zh-cn/deepmerge.md diff --git a/zh-cn/deepmerge.md b/zh-cn/deepmerge.md deleted file mode 100644 index 90fae59d..00000000 --- a/zh-cn/deepmerge.md +++ /dev/null @@ -1,85 +0,0 @@ -> 模板版本:v0.0.1 - -

-

deepmerge

-

-

- - License - -

- -## 安装与使用 - -进入到工程目录并输入以下命令: - - - -#### **npm** - -```bash -npm install deepmerge -``` - - - -下面的代码展示了这个库的基本使用场景: - -```js -import deepmerge from 'deepmerge' - -const x = { - foo: { bar: 3 }, - array: [{ - does: 'work', - too: [ 1, 2, 3 ] - }] -} - -const y = { - foo: { baz: 4 }, - quux: 5, - array: [{ - does: 'work', - too: [ 4, 5, 6 ] - }, { - really: 'yes' - }] -} - -const output = { - foo: { - bar: 3, - baz: 4 - }, - array: [{ - does: 'work', - too: [ 1, 2, 3 ] - }, { - does: 'work', - too: [ 4, 5, 6 ] - }, { - really: 'yes' - }], - quux: 5 -} - -deepmerge(x, y) // => output -``` - -## 约束与限制 - -## API - -| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | -| ---- | ---- | ---- | -------- | -------- | -------- | -| deepmerge(x, y, [options]) | Merge two objects x and y deeply, returning a new merged object with the elements from both x and y. | function | No | / | Yes | -| deepmerge.all(arrayOfObjects, [options]) | Merges any number of objects into a single result object. | function | No | / | Yes | - -## 遗留问题 - -## 其他 - -## 开源协议 - -本项目基于 [The MIT License (MIT)](https://github.com/TehShrike/deepmerge/blob/master/license.txt) ,请自由地享受和参与开源。 -- Gitee From ccb38a39bb4de16a64f8abad2b096ea862678ab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B4=8B?= <251448644@qq.com> Date: Thu, 4 Jan 2024 16:56:48 +0800 Subject: [PATCH 9/9] =?UTF-8?q?[Issues:=20#I8TCGX]=20=E6=B7=BB=E5=8A=A0dee?= =?UTF-8?q?pmerge=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/deepmerge.md | 90 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 zh-cn/deepmerge.md diff --git a/zh-cn/deepmerge.md b/zh-cn/deepmerge.md new file mode 100644 index 00000000..ae798d8a --- /dev/null +++ b/zh-cn/deepmerge.md @@ -0,0 +1,90 @@ +> 模板版本:v0.0.1 + +

+

deepmerge

+

+

+ + License + +

+ +## 安装与使用 + +进入到工程目录并输入以下命令: + +#### **yarn** + +```bash +yarn add deepmerge +``` + + +#### **npm** + +```bash +npm install deepmerge +``` + + + +下面的代码展示了这个库的基本使用场景: + +```js +import deepmerge from 'deepmerge' + +const x = { + foo: { bar: 3 }, + array: [{ + does: 'work', + too: [ 1, 2, 3 ] + }] +} + +const y = { + foo: { baz: 4 }, + quux: 5, + array: [{ + does: 'work', + too: [ 4, 5, 6 ] + }, { + really: 'yes' + }] +} + +const output = { + foo: { + bar: 3, + baz: 4 + }, + array: [{ + does: 'work', + too: [ 1, 2, 3 ] + }, { + does: 'work', + too: [ 4, 5, 6 ] + }, { + really: 'yes' + }], + quux: 5 +} + +deepmerge(x, y) // => output +``` + +## 约束与限制 + +## API + +| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| ---- | ---- | ---- | -------- | -------- | -------- | +| deepmerge(x, y, [options]) | Merge two objects x and y deeply, returning a new merged object with the elements from both x and y. | function | No | / | Yes | +| deepmerge.all(arrayOfObjects, [options]) | Merges any number of objects into a single result object. | function | No | / | Yes | + +## 遗留问题 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/TehShrike/deepmerge/blob/master/license.txt) ,请自由地享受和参与开源。 -- Gitee