Skip to content

update to v2.1.2 #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix token stream
  • Loading branch information
dwicao committed Mar 15, 2018
commit ac74da5b91e34a4d01468de04f46c8db69889aae
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,8 @@ var TokenStream = function () {
var node = this.nodes[this.index];
if (!this.hasTokens()) return null;

if (node && node.value && this.ignoreToken && this.ignoreToken(node.value)) {
return node.value;
if (node && this.ignoreToken && this.ignoreToken(node)) {
return node;
}

for (var i = 0; i < arguments.length; i += 1) {
Expand Down
23 changes: 17 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,29 @@
"description": "Convert CSS text to a React Native stylesheet object",
"main": "index.js",
"scripts": {
"build":
"rollup ./src/index.js -o index.js --f cjs && babel index.js -o index.js",
"build": "rollup ./src/index.js -o index.js --f cjs && babel index.js -o index.js",
"test": "jest",
"test:watch": "jest --watch",
"lint": "eslint src",
"prepublish": "npm run build",
"postinstall": "npm run build",
"precommit": "lint-staged",
"lint-staged": "lint-staged"
},
"files": ["index.js", "src"],
"files": [
"index.js",
"src"
],
"repository": {
"type": "git",
"url": "git+https://github.com/styled-components/css-to-react-native.git"
},
"keywords": ["styled-components", "React", "ReactNative", "styles", "CSS"],
"keywords": [
"styled-components",
"React",
"ReactNative",
"styles",
"CSS"
],
"author": "Jacob Parker",
"license": "MIT",
"bugs": {
Expand All @@ -45,6 +53,9 @@
"postcss-value-parser": "^3.3.0"
},
"lint-staged": {
"*.js": ["eslint --fix", "git add"]
"*.js": [
"eslint --fix",
"git add"
]
}
}
9 changes: 2 additions & 7 deletions src/TokenStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@ export default class TokenStream {
const node = this.nodes[this.index]
if (!this.hasTokens()) return null

if (
node &&
node.value &&
this.ignoreToken &&
this.ignoreToken(node)
) {
return node.value
if (node && this.ignoreToken && this.ignoreToken(node)) {
return node
}

for (let i = 0; i < tokenDescriptors.length; i += 1) {
Expand Down