File tree Expand file tree Collapse file tree 11 files changed +66
-16
lines changed
Expand file tree Collapse file tree 11 files changed +66
-16
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 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+
18const 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 ) ) {
Original file line number Diff line number Diff line change 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+
18import getStyle from './get-style'
29
310const getColor = ( rawProperty : string , element = document . body ) => {
Original file line number Diff line number Diff line change 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 */
29const hexToRgb = ( color : string ) => {
310 if ( typeof color === 'undefined' ) {
Original file line number Diff line number Diff line change 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 */
29const hexToRgba = ( color : string , opacity = 100 ) => {
310 if ( typeof color === 'undefined' ) {
Original file line number Diff line number Diff line change 1+ /**
2+ * --------------------------------------------------------------------------
3+ * CoreUI (__COREUI_VERSION__): index.ts
4+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+ * --------------------------------------------------------------------------
6+ */
7+
18import deepObjectsMerge from './deep-objects-merge'
29import getColor from './get-color'
310import getStyle from './get-style'
@@ -8,20 +15,6 @@ import omitByKeys from './omit-by-keys'
815import pickByKeys from './pick-by-keys'
916import 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-
2518export {
2619 deepObjectsMerge ,
2720 getColor ,
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
29const makeUid = ( ) => {
310 const key = Math . random ( ) . toString ( 36 ) . substr ( 2 )
Original file line number Diff line number Diff line change 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+
18const omitByKeys = ( originalObject : object , keys : string | string [ ] ) => {
29 const newObj = { }
310 const objKeys = Object . keys ( originalObject )
Original file line number Diff line number Diff line change 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+
18const pickByKeys = ( originalObject : object , keys : string | string [ ] ) => {
29 const newObj = { }
310 for ( let i = 0 ; i < keys . length ; i ++ ) {
You can’t perform that action at this time.
0 commit comments