Skip to content

Instantly share code, notes, and snippets.

View jkuri's full-sized avatar
🏠
Working from home

Jan Kuri jkuri

🏠
Working from home
View GitHub Profile
@jkuri
jkuri / animate_values.js
Created August 24, 2017 04:28 — forked from XerxesNoble/animate_values.js
Basic javascript linear value animation that can accept easing functions and provides update & complete callbacks
/**
* @desc Basic linear value animation that can accept simple easing functions and provides update & complete callbacks
* @param {Object} values - Object with numerical values. eg. { value1: 0, value2: 20, someKey: 55 }
* @param {Number} duration - How long (in milliseconds) the animation will be
* @param {Object} options - target values, update callback & complete callback
* @param {Function} [options.onComplete=(values) => values] - Callback that fires once animation is complete
* @param {Function} [options.onUpdate=(values) => values] - Callback that fires when animation frame updates
* @param {Function} [options.ease=(t) => t] - easing method eg. https://gist.github.com/gre/1650294
* @example
*
const options = require(path.resolve(process.cwd(), 'src', 'tsconfig.json')).compilerOptions;
const tsOpts = ts.parseJsonConfigFileContent({ compilerOptions: options, files: [] }, null, null).options;
const tsFiles = glob.sync('**/*.ts', {
cwd: path.resolve(process.cwd(), 'src')
});
const tsServiceHost = new ServiceHost(tsOpts, tsFiles, tsFiles);
const tsService = ts.createLanguageService(tsServiceHost, ts.createDocumentRegistry());
const output = tsFiles.map(file => {
return tsService.getEmitOutput(file);
});
Typescript found the following errors:
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (8,32): Property 'toBe' does not exist on type 'NgMatchers'.
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (13,35): Property 'toBe' does not exist on type 'NgMatchers'.
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (14,37): Property 'toBe' does not exist on type 'NgMatchers'.
Error: Typescript found the following errors:
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (8,32): Property 'toBe' does not exist on type 'NgMatchers'.
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (13,35): Property 'toBe' does not exist on type 'NgMatchers'.
/Users/jan/Desktop/proj/tmp/tsplugin-input_base_path-juLs8hZy.tmp/0/app/proj.spec.ts (14,37): Property 'toBe' does not exist on type 'NgMatchers'.
at TSPlugin.build.rootFileNames.forEach.Obj
{
"name": "proj",
"version": "0.0.0",
"license": "Apache-2.0",
"angular-cli": {
"packages": [
{
"name": "jquery",
"version": "2.2.1"
},
@jkuri
jkuri / system-js-bundler-vendor.js
Created February 7, 2016 08:19
SystemJS build script for Angular2 with vendor included
var pkg = require('./package.json');
var path = require('path');
var Builder = require('systemjs-builder');
var name = pkg.name;
var builder = new Builder();
var config = {
baseURL: '.',
transpiler: 'typescript',
typescriptOptions: {
var pkg = require('./package.json');
var path = require('path');
var Builder = require('systemjs-builder');
var name = pkg.name;
var builder = new Builder();
var config = {
baseURL: '.',
transpiler: 'typescript',
typescriptOptions: {