@@ -4,67 +4,67 @@ export const isArray = Array.isArray;
4
4
export const isString = val => typeof val === 'string' ;
5
5
export const isSymbol = val => typeof val === 'symbol' ;
6
6
export const isObject = val => val !== null && typeof val === 'object' ;
7
- const onRE = / ^ o n [ ^ a - z ] / ;
8
- const isOn = key => onRE . test ( key ) ;
7
+ // const onRE = /^on[^a-z]/;
8
+ // const isOn = key => onRE.test(key);
9
9
10
- const cacheStringFunction = fn => {
11
- const cache = Object . create ( null ) ;
12
- return str => {
13
- const hit = cache [ str ] ;
14
- return hit || ( cache [ str ] = fn ( str ) ) ;
15
- } ;
16
- } ;
17
- const camelizeRE = / - ( \w ) / g;
18
- const camelize = cacheStringFunction ( str => {
19
- return str . replace ( camelizeRE , ( _ , c ) => ( c ? c . toUpperCase ( ) : '' ) ) ;
20
- } ) ;
10
+ // const cacheStringFunction = fn => {
11
+ // const cache = Object.create(null);
12
+ // return str => {
13
+ // const hit = cache[str];
14
+ // return hit || (cache[str] = fn(str));
15
+ // };
16
+ // };
17
+ // const camelizeRE = /-(\w)/g;
18
+ // const camelize = cacheStringFunction(str => {
19
+ // return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));
20
+ // });
21
21
22
- const hyphenateRE = / \B ( [ A - Z ] ) / g;
23
- const hyphenate = cacheStringFunction ( str => {
24
- return str . replace ( hyphenateRE , '-$1' ) . toLowerCase ( ) ;
25
- } ) ;
22
+ // const hyphenateRE = /\B([A-Z])/g;
23
+ // const hyphenate = cacheStringFunction(str => {
24
+ // return str.replace(hyphenateRE, '-$1').toLowerCase();
25
+ // });
26
26
27
- const capitalize = cacheStringFunction ( str => {
28
- return str . charAt ( 0 ) . toUpperCase ( ) + str . slice ( 1 ) ;
29
- } ) ;
27
+ // const capitalize = cacheStringFunction(str => {
28
+ // return str.charAt(0).toUpperCase() + str.slice(1);
29
+ // });
30
30
31
- const hasOwnProperty = Object . prototype . hasOwnProperty ;
32
- const hasOwn = ( val , key ) => hasOwnProperty . call ( val , key ) ;
31
+ // const hasOwnProperty = Object.prototype.hasOwnProperty;
32
+ // const hasOwn = (val, key) => hasOwnProperty.call(val, key);
33
33
34
- // change from vue sourcecode
35
- function resolvePropValue ( options , props , key , value ) {
36
- const opt = options [ key ] ;
37
- if ( opt != null ) {
38
- const hasDefault = hasOwn ( opt , 'default' ) ;
39
- // default values
40
- if ( hasDefault && value === undefined ) {
41
- const defaultValue = opt . default ;
42
- value = opt . type !== Function && isFunction ( defaultValue ) ? defaultValue ( ) : defaultValue ;
43
- }
44
- // boolean casting
45
- if ( opt [ 0 /* shouldCast */ ] ) {
46
- if ( ! hasOwn ( props , key ) && ! hasDefault ) {
47
- value = false ;
48
- } else if ( opt [ 1 /* shouldCastTrue */ ] && ( value === '' || value === hyphenate ( key ) ) ) {
49
- value = true ;
50
- }
51
- }
52
- }
53
- return value ;
54
- }
34
+ // // change from vue sourcecode
35
+ // function resolvePropValue (options, props, key, value) {
36
+ // const opt = options[key];
37
+ // if (opt != null) {
38
+ // const hasDefault = hasOwn(opt, 'default');
39
+ // // default values
40
+ // if (hasDefault && value === undefined) {
41
+ // const defaultValue = opt.default;
42
+ // value = opt.type !== Function && isFunction(defaultValue) ? defaultValue() : defaultValue;
43
+ // }
44
+ // // boolean casting
45
+ // if (opt[0 /* shouldCast */]) {
46
+ // if (!hasOwn(props, key) && !hasDefault) {
47
+ // value = false;
48
+ // } else if (opt[1 /* shouldCastTrue */] && (value === '' || value === hyphenate(key))) {
49
+ // value = true;
50
+ // }
51
+ // }
52
+ // }
53
+ // return value;
54
+ // }
55
55
56
- export function getDataAndAriaProps ( props ) {
57
- return Object . keys ( props ) . reduce ( ( memo , key ) => {
58
- if ( key . substr ( 0 , 5 ) === 'data-' || key . substr ( 0 , 5 ) === 'aria-' ) {
59
- memo [ key ] = props [ key ] ;
60
- }
61
- return memo ;
62
- } , { } ) ;
63
- }
56
+ // export function getDataAndAriaProps (props) {
57
+ // return Object.keys(props).reduce((memo, key) => {
58
+ // if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-') {
59
+ // memo[key] = props[key];
60
+ // }
61
+ // return memo;
62
+ // }, {});
63
+ // }
64
64
65
- const guid = ( ) => {
66
- const s4 = ( ) => Math . floor ( ( 1 + Math . random ( ) ) * 0x10000 ) . toString ( 16 ) . substring ( 1 ) ;
67
- return `${ s4 ( ) + s4 ( ) } -${ s4 ( ) } -${ s4 ( ) } -${ s4 ( ) } -${ s4 ( ) + s4 ( ) + s4 ( ) } ` ;
68
- } ;
65
+ // const guid = () => {
66
+ // const s4 = () => Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
67
+ // return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`;
68
+ // };
69
69
70
- export { guid , isOn , cacheStringFunction , camelize , hyphenate , capitalize , resolvePropValue } ;
70
+ // export { isOn, cacheStringFunction, camelize, hyphenate, capitalize };
0 commit comments