@team-griffin/css-longhand
Advanced tools
Comparing version 1.3.1 to 1.3.2
'use strict'; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./css-longhand.production.js'); | ||
} else { | ||
module.exports = require('./css-longhand.development.js'); | ||
} | ||
var r = require('ramda'); | ||
var defineProperty = function (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 upperFirst = function upperFirst(str) { | ||
return str.charAt(0).toUpperCase() + str.substr(1); | ||
}; | ||
// eslint-disable-next-line | ||
// const isObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]'; | ||
var longhand = function longhand(coreProp, prop) { | ||
return r.reduce(function (result, key) { | ||
var k = '' + coreProp + upperFirst(key); | ||
var v = prop[key]; | ||
// if (isObject(v)) { | ||
// return { | ||
// ...result, | ||
// ...longhand(k, v), | ||
// } | ||
// } else { | ||
return Object.assign({}, result, defineProperty({}, k, v)); | ||
// } | ||
}, {}, r.keys(prop)); | ||
}; | ||
module.exports = longhand; |
@@ -1,5 +0,40 @@ | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./css-longhand.production.js'); | ||
} else { | ||
module.exports = require('./css-longhand.development.js'); | ||
} | ||
import { reduce, keys } from 'ramda'; | ||
var defineProperty = function (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 upperFirst = function upperFirst(str) { | ||
return str.charAt(0).toUpperCase() + str.substr(1); | ||
}; | ||
// eslint-disable-next-line | ||
// const isObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]'; | ||
var longhand = function longhand(coreProp, prop) { | ||
return reduce(function (result, key) { | ||
var k = '' + coreProp + upperFirst(key); | ||
var v = prop[key]; | ||
// if (isObject(v)) { | ||
// return { | ||
// ...result, | ||
// ...longhand(k, v), | ||
// } | ||
// } else { | ||
return Object.assign({}, result, defineProperty({}, k, v)); | ||
// } | ||
}, {}, keys(prop)); | ||
}; | ||
export default longhand; |
{ | ||
"name": "@team-griffin/css-longhand", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"main": "dist/cjs/css-longhand.js", | ||
@@ -10,18 +10,5 @@ "module": "dist/es/css-longhand.js", | ||
"scripts": { | ||
"prepublish": "npm run build", | ||
"transpile": "babel src -d lib --copy-files", | ||
"lint": "npm run lint:js && npm run flow", | ||
"lint:js": "eslint -c ./config/.eslintrc.js 'src/**/*.js'", | ||
"lint:js:fix": "eslint --fix -c ./config/.eslintrc.js 'src/**/*.js'", | ||
"build-storybook": "build-storybook -c .storybook -s ./.storybook/static -o .out", | ||
"flow": "flow check; test $? -eq 0 -o $? -eq 2", | ||
"build:dev": "cross-env NODE_ENV=development rollup --config ./rollup/development.js", | ||
"build:prod": "cross-env NODE_ENV=production rollup --config ./rollup/production.js", | ||
"build:entry": "cross-env NODE_ENV=production rollup --config ./rollup/entry.js", | ||
"build": "yarn build:dev && yarn build:prod && yarn build:entry", | ||
"test": "node_modules/.bin/karma start ./config/karma.conf.js", | ||
"test:single": "yarn run test -- --single", | ||
"ci": "npm run lint && npm run test && npm run build", | ||
"postmerge": "yarn", | ||
"dockerfile:ci": "dockerscript ./docker/dockerfile.js ./docker/Dockerfile.ci" | ||
"prepublishOnly": "yarn build", | ||
"lint": "eslint -c ./config/.eslintrc.js 'src/**/*.js'", | ||
"build": "rollup --config ./rollup/config.js" | ||
}, | ||
@@ -34,3 +21,2 @@ "devDependencies": { | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-plugin-ramda": "^1.4.3", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
@@ -46,10 +32,7 @@ "babel-preset-env": "^1.6.1", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"rollup-plugin-local-resolve": "^1.0.7", | ||
"rollup-plugin-memory": "^3.0.0", | ||
"rollup-plugin-replace": "^2.0.0", | ||
"rollup-plugin-uglify-es": "^0.0.1" | ||
"rollup-plugin-local-resolve": "^1.0.7" | ||
}, | ||
"dependencies": { | ||
"ramda": "^0.25.0" | ||
"ramda": "^0.x.x" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
16
1
1
13867
13
337
+ Addedramda@0.30.1(transitive)
- Removedramda@0.25.0(transitive)
Updatedramda@^0.x.x