Skip to content

Commit

Permalink
Version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
askd committed Apr 27, 2016
1 parent 5c27589 commit e378b53
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
/lib
/node_modules
npm-debug.log
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 animakit
Copyright (c) 2016 Anna Selezniova

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# core
# AnimakitCore
Part of Animakit.
See http://askd.github.io/animakit for more details
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "animakit-core",
"version": "1.0.0",
"description": "Animakit core. Not for self-use.",
"main": "lib/index.js",
"scripts": {
"build": "babel --preset es2015 src/ --out-dir lib/",
"prepublish": "npm run build"
},
"author": "Anna Selezniova",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/animakit/animakit-core"
},
"dependencies": {
"lodash": "^4.11.1"
},
"devDependencies": {
"babel-cli": "^6.7.7",
"babel-preset-es2015": "^6.6.0"
}
}
26 changes: 26 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { isEqual as lodashIsEqual } from 'lodash';

export function isPropertySupported(name, value) {
const propName = name;

const element = document.createElement('p');
document.body.insertBefore(element, null);

element.style[propName] = value;

const propValue = window
.getComputedStyle(element, null)
.getPropertyValue(propName);

document.body.removeChild(element);

return propValue === value;
}

export function genUniqueString(len = 5) {
return (Math.random() * Math.pow(36, len) << 0).toString(36);
}

export function isEqual(prevState, nextState) {
return lodashIsEqual(prevState, nextState);
}

0 comments on commit e378b53

Please sign in to comment.