8000 docs: update comments · coreui/coreui-utils@9a35bd8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a35bd8

Browse files
committed
docs: update comments
1 parent 5384572 commit 9a35bd8

11 files changed

+66
-16
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"lint": "eslint \"src/**/*.{js,ts,tsx}\""
4242
},
4343
"devDependencies": {
44+
"@rollup/plugin-replace": "^5.0.2",
4445
"@rollup/plugin-typescript": "^10.0.1",
4546
"@typescript-eslint/eslint-plugin": "^5.46.0",
4647
"@typescript-eslint/parser": "^5.46.0",

src/deep-objects-merge.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (__COREUI_VERSION__): deep-objects-merge.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+
* --------------------------------------------------------------------------
6+
*/
7+
18
const deepObjectsMerge = (target: object, source: object) => {
29
// Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties
310
for (const key of Object.keys(source)) {

src/get-color.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (__COREUI_VERSION__): get-color.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+
* --------------------------------------------------------------------------
6+
*/
7+
18
import getStyle from './get-style'
29

310
const getColor = (rawProperty: string, element = document.body) => {

src/hex-to-rgb.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (__COREUI_VERSION__): hex-to-rgb.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+
* --------------------------------------------------------------------------
6+
*/
7+
18
/* eslint-disable no-magic-numbers */
29
const hexToRgb = (color: string) => {
310
if (typeof color === 'undefined') {

src/hex-to-rgba.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (__COREUI_VERSION__): hex-to-rgba.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+
* --------------------------------------------------------------------------
6+
*/
7+
18
/* eslint-disable no-magic-numbers */
29
const hexToRgba = (color: string, opacity = 100) => {
310
if (typeof color === 'undefined') {

src/index.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (__COREUI_VERSION__): index.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+
* --------------------------------------------------------------------------
6+
*/
7+
18
import deepObjectsMerge from './deep-objects-merge'
29
import getColor from './get-color'
310
import getStyle from './get-style'
@@ -8,20 +15,6 @@ import omitByKeys from './omit-by-keys'
815
import pickByKeys from './pick-by-keys'
916
import rgbToHex from './rgb-to-hex'
1017

11-
// const utils = {
12-
// deepObjectsMerge,
13-
// getColor,
14-
// getStyle,
15-
// hexToRgb,
16-
// hexToRgba,
17-
// makeUid,
18-
// omitByKeys,
19-
// pickByKeys,
20-
// rgbToHex
21-
// }
22-
23-
// export default utils
24-
2518
export {
2619
deepObjectsMerge,
2720
getColor,

src/index.umd.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* --------------------------------------------------------------------------
3-
* CoreUI (v3.0.0-rc.0): index.umd.js
4-
* Licensed under MIT (https://coreui.io/license)
3+
* CoreUI (__COREUI_VERSION__): index.umd.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
55
* --------------------------------------------------------------------------
66
*/
77

src/make-uid.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (__COREUI_VERSION__): make-uid.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+
* --------------------------------------------------------------------------
6+
*/
7+
18
//function for UI releted ID assignment, due to one in 10^15 probability of duplication
29
const makeUid = () => {
310
const key = Math.random().toString(36).substr(2)

src/omit-by-keys.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (__COREUI_VERSION__): omit-by-keys.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+
* --------------------------------------------------------------------------
6+
*/
7+
18
const omitByKeys = (originalObject: object, keys: string | string[]) => {
29
const newObj = {}
310
const objKeys = Object.keys(originalObject)

src/pick-by-keys.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (__COREUI_VERSION__): pick-by-keys.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+
* --------------------------------------------------------------------------
6+
*/
7+
18
const pickByKeys = (originalObject: object, keys: string | string[]) => {
29
const newObj = {}
310
for (let i = 0; i < keys.length; i++) {

src/rgb-to-hex.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (__COREUI_VERSION__): rgb-to-hex.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+
* --------------------------------------------------------------------------
6+
*/
7+
18
const rgbToHex = (color: string) => {
29
if (typeof color === 'undefined') {
310
throw new TypeError('Hex color is not defined')

0 commit comments

Comments
 (0)
0