Installations
npm install @fluentui-react-native/merge-props
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
18.20.5
NPM Version
10.8.2
Releases
Unable to fetch releases
Contributors
Languages
TypeScript (91.11%)
JavaScript (4.78%)
Objective-C (1.56%)
Swift (0.94%)
C++ (0.83%)
Ruby (0.25%)
Kotlin (0.25%)
PowerShell (0.18%)
Shell (0.09%)
C (0.02%)
Developer
Download Statistics
Total Downloads
175,219
Last Day
553
Last Week
1,214
Last Month
8,745
Last Year
75,891
GitHub Statistics
1,319 Stars
4,601 Commits
163 Forks
44 Watching
44 Branches
10,000 Contributors
Bundle Size
3.70 kB
Minified
1.33 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.9.1
Package Id
@fluentui-react-native/merge-props@0.9.1
Unpacked Size
66.20 kB
Size
12.74 kB
File Count
51
NPM Version
10.8.2
Node Version
18.20.5
Publised On
29 Jan 2025
Total Downloads
Cumulative downloads
Total Downloads
175,219
Last day
284%
553
Compared to previous day
Last week
-59.6%
1,214
Compared to previous week
Last month
-3.8%
8,745
Compared to previous month
Last year
76.4%
75,891
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@fluentui-react-native/merge-props
Utilities for merging styles and props (which contain styles)
Merging Props
The mergeProps
routine handles merging props together. Generally this is a standard per property merge identical to the behavior of Object.assign
with the following two exceptions:
- Objects under
props.style
will be merged usingmergeStyle
above, including caching the resolved styles - Strings contained in
props.className
will be joined together using spaces as a delimiter.
Merging Styles
Styles are defined using the standard react-native pattern and will be merged in a way that maintains object identity where possible.
StyleProp
This is a copy of the StyleProp definition from react-native
. This is copied primarily in the case where it is used in web code where adding a dependency on the react-native
package itself is not desireable.
The StyleProp pattern itself is allows a style to be provided as a style or a recursive array of styles. So the following pattern is allowed:
1props = { 2 style: [{ ...style1 }, [{ ...style2 }, { ...style3 }, [{ ...style4 }]], { ...style5 }], 3};
In this model merging styles can be effectively deferred by the following:
1const styleToMerge = { ...values }; 2props.style = [props.style, styleToMerge];
mergeStyles
This routine merges one or more react-native styles together. The inputs are styles in the StyleProp
format referenced above. The various input styles will be flattened and merged together to produce a single non-flattened output style.
1function mergeStyles<T>(...styles: StyleProp<T>[]): T;
This routine has a built-in caching layer that will attempt to ensure that object identity remains consistent. This means that style A + style B, where the references to A and B are the same, will always produce object C, where the reference will also be the same.
No vulnerabilities found.
Reason
30 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
SAST tool is run on all commits
Details
- Info: SAST configuration detected: CodeQL
- Info: all commits (26) are checked with a SAST tool
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:29
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:30
- Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1
- Info: no jobLevel write permissions found
Reason
1 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-rv73-9c8w-jp4c
Reason
Found 18/22 approved changesets -- score normalized to 8
Reason
binaries present in source code
Details
- Warn: binary detected: apps/fluent-tester/android/gradle/wrapper/gradle-wrapper.jar:1
- Warn: binary detected: packages/experimental/NativeDatePicker/android/gradle/wrapper/gradle-wrapper.jar:1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/microsoft/fluentui-react-native/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/microsoft/fluentui-react-native/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/microsoft/fluentui-react-native/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/microsoft/fluentui-react-native/codeql-analysis.yml/main?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
7.7
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More