@team-griffin/css-longhand
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -7,3 +7,2 @@ module.exports = { | ||
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:flowtype/recommended"], | ||
"installedESLint": true, | ||
"parserOptions": { | ||
@@ -10,0 +9,0 @@ "ecmaFeatures": { |
@@ -9,20 +9,31 @@ 'use strict'; | ||
var _lodash = require('lodash.upperfirst'); | ||
var _ramda = require('ramda'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var r = _interopRequireWildcard(_ramda); | ||
var _lodash3 = require('lodash.reduce'); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
var _lodash4 = _interopRequireDefault(_lodash3); | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var upperFirst = function upperFirst(str) { | ||
return str.charAt(0).toUpperCase() + str.substr(1); | ||
}; | ||
// const isObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]'; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var longhand = function longhand(coreProp, prop) { | ||
return r.reduce(function (result, key) { | ||
var k = '' + coreProp + upperFirst(key); | ||
var v = prop[key]; | ||
var longhand = function longhand(coreProp, prop) { | ||
return (0, _lodash4.default)(prop, function (result, value, key) { | ||
return _extends({}, result, _defineProperty({}, '' + coreProp + (0, _lodash2.default)(key), value)); | ||
}, {}); | ||
// if (isObject(v)) { | ||
// return { | ||
// ...result, | ||
// ...longhand(k, v), | ||
// } | ||
// } else { | ||
return _extends({}, result, _defineProperty({}, k, v)); | ||
// } | ||
}, {}, r.keys(prop)); | ||
}; | ||
exports.default = longhand; |
{ | ||
"name": "@team-griffin/css-longhand", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "lib/index.js", | ||
@@ -38,5 +38,4 @@ "jsnext:main": "lib/index.js", | ||
"dependencies": { | ||
"lodash.reduce": "^4.6.0", | ||
"lodash.upperfirst": "^4.3.1" | ||
"ramda": "^0.25.0" | ||
} | ||
} |
@@ -1,14 +0,25 @@ | ||
import upperFirst from 'lodash.upperfirst'; | ||
import reduce from 'lodash.reduce'; | ||
import * as r from 'ramda'; | ||
const upperFirst = (str) => str.charAt(0).toUpperCase() + str.substr(1); | ||
// const isObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]'; | ||
const longhand = (coreProp, prop) => { | ||
return reduce(prop, (result, value, key) => { | ||
return r.reduce((result, key) => { | ||
const k = `${coreProp}${upperFirst(key)}`; | ||
const v = prop[key]; | ||
// if (isObject(v)) { | ||
// return { | ||
// ...result, | ||
// ...longhand(k, v), | ||
// } | ||
// } else { | ||
return { | ||
...result, | ||
[`${coreProp}${upperFirst(key)}`]: value, | ||
[k]: v, | ||
}; | ||
}, { | ||
}); | ||
// } | ||
}, {}, r.keys(prop)); | ||
}; | ||
export default longhand; | ||
export default longhand; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
126024
1
270
0
+ Addedramda@^0.25.0
+ Addedramda@0.25.0(transitive)
- Removedlodash.reduce@^4.6.0
- Removedlodash.upperfirst@^4.3.1
- Removedlodash.reduce@4.6.0(transitive)
- Removedlodash.upperfirst@4.3.1(transitive)