Comparing version 1.2.2 to 1.2.4
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _getIterator2 = require('babel-runtime/core-js/get-iterator'); | ||
var _getIterator3 = _interopRequireDefault(_getIterator2); | ||
var _keys = require('babel-runtime/core-js/object/keys'); | ||
var _keys2 = _interopRequireDefault(_keys); | ||
var _map = require('babel-runtime/core-js/map'); | ||
var _map2 = _interopRequireDefault(_map); | ||
var _utils = require('./utils'); | ||
var globalStylesheet = new Map(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports['default'] = { | ||
var globalStylesheet = new _map2.default(); | ||
exports.default = { | ||
create: function create(styles) { | ||
var stylesheet = arguments.length <= 1 || arguments[1] === undefined ? globalStylesheet : arguments[1]; | ||
if (!(stylesheet instanceof Map)) throw new Error(stylesheet + ' should be a Map'); | ||
if (!(stylesheet instanceof _map2.default)) throw new Error(stylesheet + ' should be a Map'); | ||
return Object.keys(styles).reduce(function (acc, key) { | ||
return (0, _keys2.default)(styles).reduce(function (acc, key) { | ||
var _seperateStyles = (0, _utils.seperateStyles)(styles[key]); | ||
@@ -49,3 +63,3 @@ | ||
var mqPseudos = []; | ||
var mqStylesheet = undefined; | ||
var mqStylesheet = void 0; | ||
@@ -66,3 +80,3 @@ if (Array.isArray(selector)) { | ||
mqStylesheet = mqStylesheet || stylesheet.set(mqSelector, new Map()).get(mqSelector); | ||
mqStylesheet = mqStylesheet || stylesheet.set(mqSelector, new _map2.default()).get(mqSelector); | ||
@@ -87,3 +101,2 @@ mqStylesheet.set(className, mqStyles); | ||
}, | ||
render: function render() { | ||
@@ -102,3 +115,3 @@ var options = arguments.length <= 0 || arguments[0] === undefined ? { pretty: false } : arguments[0]; | ||
try { | ||
for (var _iterator = stylesheetEntries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
for (var _iterator = (0, _getIterator3.default)(stylesheetEntries), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var entry = _step.value; | ||
@@ -108,3 +121,3 @@ | ||
var styles = entry[1]; | ||
var isMap = styles instanceof Map; | ||
var isMap = styles instanceof _map2.default; | ||
@@ -127,4 +140,4 @@ if (!isMap && (0, _utils.isEmpty)(styles)) continue; | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator['return']) { | ||
_iterator['return'](); | ||
if (!_iteratorNormalCompletion && _iterator.return) { | ||
_iterator.return(); | ||
} | ||
@@ -140,3 +153,2 @@ } finally { | ||
}, | ||
clear: function clear() { | ||
@@ -149,6 +161,7 @@ var stylesheet = arguments.length <= 0 || arguments[0] === undefined ? globalStylesheet : arguments[0]; | ||
Map: Map, | ||
Map: _map2.default, | ||
__stylesheet: globalStylesheet | ||
}; | ||
module.exports = exports['default']; |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _typeof2 = require('babel-runtime/helpers/typeof'); | ||
var _typeof3 = _interopRequireDefault(_typeof2); | ||
var _isInteger = require('babel-runtime/core-js/number/is-integer'); | ||
var _isInteger2 = _interopRequireDefault(_isInteger); | ||
var _keys = require('babel-runtime/core-js/object/keys'); | ||
var _keys2 = _interopRequireDefault(_keys); | ||
exports.sortObject = sortObject; | ||
@@ -17,6 +30,8 @@ exports.createHash = createHash; | ||
var _reactLibCSSPropertyOperations = require('react/lib/CSSPropertyOperations'); | ||
var _CSSPropertyOperations = require('react/lib/CSSPropertyOperations'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function sortObject(obj) { | ||
return Object.keys(obj).sort().reduce(function (acc, key) { | ||
return (0, _keys2.default)(obj).sort().reduce(function (acc, key) { | ||
var val = obj[key]; | ||
@@ -33,9 +48,9 @@ if (val || val === 0) acc[key] = val; | ||
var hash = 5381; | ||
while (i) hash = hash * 33 ^ str.charCodeAt(--i); | ||
return hash >>> 0; | ||
while (i) { | ||
hash = hash * 33 ^ str.charCodeAt(--i); | ||
}return hash >>> 0; | ||
} | ||
function stringifyObject(obj) { | ||
var keys = Object.keys(obj); | ||
var keys = (0, _keys2.default)(obj); | ||
var str = ''; | ||
@@ -51,7 +66,6 @@ | ||
var SYMBOL_SET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); | ||
function extendedToString(num, base) { | ||
var conversion = ''; | ||
if (base > SYMBOL_SET.length || base <= 1 || !Number.isInteger(base)) throw new Error(base + ' should be an integer between 1 and ' + SYMBOL_SET.length); | ||
if (base > SYMBOL_SET.length || base <= 1 || !(0, _isInteger2.default)(base)) throw new Error(base + ' should be an integer between 1 and ' + SYMBOL_SET.length); | ||
@@ -72,7 +86,7 @@ while (num >= 1) { | ||
function createMarkup(obj) { | ||
return (0, _reactLibCSSPropertyOperations.createMarkupForStyles)(obj); | ||
return (0, _CSSPropertyOperations.createMarkupForStyles)(obj); | ||
} | ||
function isEmpty(obj) { | ||
return !Object.keys(obj).length; | ||
return !(0, _keys2.default)(obj).length; | ||
} | ||
@@ -84,3 +98,3 @@ | ||
return rule.charAt(0) === ':' && typeof style === 'object'; | ||
return rule.charAt(0) === ':' && (typeof style === 'undefined' ? 'undefined' : (0, _typeof3.default)(style)) === 'object'; | ||
} | ||
@@ -92,3 +106,3 @@ | ||
return rule.charAt(0) === '@' && typeof style === 'object'; | ||
return rule.charAt(0) === '@' && (typeof style === 'undefined' ? 'undefined' : (0, _typeof3.default)(style)) === 'object'; | ||
} | ||
@@ -110,3 +124,3 @@ | ||
function seperateStyles(styles) { | ||
return Object.keys(styles).reduce(function (acc, rule) { | ||
return (0, _keys2.default)(styles).reduce(function (acc, rule) { | ||
var content = { | ||
@@ -113,0 +127,0 @@ style: styles[rule], |
@@ -6,3 +6,3 @@ import { | ||
seperateStyles, | ||
isEmpty, | ||
isEmpty | ||
} from './utils'; | ||
@@ -9,0 +9,0 @@ |
{ | ||
"name": "stilr", | ||
"version": "1.2.2", | ||
"version": "1.2.4", | ||
"description": "Encapsulated styling for your javascript components with all the power of javascript and CSS combined. Usefull with React", | ||
@@ -36,17 +36,23 @@ "main": "dist", | ||
"dependencies": { | ||
"babel-runtime": "^6.6.1", | ||
"react": ">=0.11.0" | ||
}, | ||
"devDependencies": { | ||
"babel": "^5.5.8", | ||
"babel-core": "^5.5.8", | ||
"babel-eslint": "^5.0.0", | ||
"babel-loader": "^5.1.4", | ||
"babel-cli": "^6.7.5", | ||
"babel-core": "^6.7.6", | ||
"babel-eslint": "^6.0.2", | ||
"babel-loader": "^6.2.4", | ||
"babel-plugin-add-module-exports": "^0.1.2", | ||
"babel-plugin-transform-runtime": "^6.7.5", | ||
"babel-polyfill": "^6.7.4", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babel-register": "^6.7.2", | ||
"css": "^2.2.0", | ||
"eslint": "^2.2.0", | ||
"eslint": "^2.7.0", | ||
"eslint-plugin-react": "^4.0.0", | ||
"mocha": "^2.2.4", | ||
"mocha-clean": "^0.4.0", | ||
"semver": "^4.3.6" | ||
"mocha-clean": "^1.0.0", | ||
"semver": "^5.1.0" | ||
}, | ||
"repository": "kodyl/stilr" | ||
} |
@@ -274,3 +274,3 @@ # Stilr [![Build Status](https://travis-ci.org/kodyl/stilr.svg)](https://travis-ci.org/kodyl/stilr) [![npm version](https://badge.fury.io/js/stilr.svg)](http://badge.fury.io/js/stilr) | ||
import StyleSheet from 'stilr'; | ||
import autoprefixer from 'autoprefixer-core'; | ||
import autoprefixer from 'autoprefixer'; | ||
import postcss from 'postcss'; | ||
@@ -277,0 +277,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
28375
401
0
2
15
+ Addedbabel-runtime@^6.6.1
+ Addedbabel-runtime@6.26.0(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedregenerator-runtime@0.11.1(transitive)