A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
type FrameScope = { | |
[key:string]: mixed | |
}; | |
type StackFrame = { | |
name?: string, | |
fileName?: string, | |
lineNumber?: number, | |
columnNumber?: number, | |
scope?: FrameScope | |
}; |
/** | |
* I couldn't find a super simple example of how to run Karma, PhantomJs, with | |
* Jasmine tests via npm, so eventually I decided to create my own. Maybe | |
* someone will find it useful. | |
* | |
* | |
* Installation (using npm): | |
* | |
* npm install -g karma-cli | |
* npm install -g karma --save-dev |
Object.getOwnPropertyDescriptors = function getOwnPropertyDescriptors(obj) { | |
var descriptors = {}; | |
for (var prop in obj) { | |
if (obj.hasOwnProperty(prop)) { | |
descriptors[prop] = Object.getOwnPropertyDescriptor(obj, prop); | |
} | |
} | |
return descriptors; | |
}; |