code
stringlengths
2
1.05M
import { createStore, applyMiddleware, compose } from 'redux'; import rootReducer from '../reducers'; import createSagaMiddleware, { END } from 'redux-saga'; import sagas from '../sagas'; import { routerMiddleware } from 'react-router-redux'; import { browserHistory } from 'react-router'; function configureStore(initi...
// Your task is to make two functions, max and min (maximum and minimum in PHP) that take a(n) array/vector of integers list as input and outputs, respectively, the largest and lowest number in that array/vector. // // #Examples // // max([4,6,2,1,9,63,-134,566]) returns 566 // min([-52, 56, 30, 29, -54, 0, -110]) retu...
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ var BuildGameObject = require('../BuildGameObject'); var BuildGameObjectAnimation = require('../BuildGameObjectAnimati...
(function (tj, global) { 'use strict'; var numTokensRequested = 0; var is = require('is-simple'); var allSubscribers = {}; // event -> {token: <string>, fn: <Function>} var getUniqueToken = (function () { numTokensRequested += 1; return String(numTokensRequested); }); var...
/* * Sahat Yalkabov * MIT Licence * 2015 */ var gulp = require('gulp'); var gutil = require('gulp-util'); var gulpif = require('gulp-if'); var streamify = require('gulp-streamify'); var autoprefixer = require('gulp-autoprefixer'); var cssmin = require('gulp-cssmin'); var less = require('gulp-less'); var concat = requir...
import Ember from 'ember'; var GrowlMessage = Ember.Component.extend({ classNameBindings: [":growl-message", "level"], message: null, level: null, lifeTime: 2000, click: function() { this.sendAction('dismiss'); }, didInsertElement: function() {...
'use strict'; // Author: Lucas Galleguillos. // A basic stack data structure. Works with primitive types. // Also, somewhat of clone in that it has the same methods as the one found // in Java SE 7. Additionally, I just copied the descriptions of the // methods in Java SE 7. See here https://docs.oracle.com/javase/7/...
/* * Redefines the pagingToolbar displayMsg. */ Ext.namespace('Ext.ux.plugins'); Ext.ux.plugins.TotalCountHidding = function() {}; Ext.ux.plugins.TotalCountHidding.prototype = { init: function(grid) { var bbar = grid.getBottomToolbar(); if (bbar) { bbar.updateInfo = function()...
module.exports = { 'install': require('./bin/install.js') , 'compile': require('./bin/compile.js') , 'serve': require('./bin/serve.js') }
(function (Handsontable) { var AutocompleteEditor = Handsontable.editors.HandsontableEditor.prototype.extend(); AutocompleteEditor.prototype.init = function () { Handsontable.editors.HandsontableEditor.prototype.init.apply(this, arguments); this.$htContainer.handsontable('updateSettings', {height: this.get...
(function() { 'use strict'; angular .module('permitmeApp') .directive('minbytes', minbytes); function minbytes () { var directive = { restrict: 'A', require: '?ngModel', link: linkFunc }; return directive; function linkF...
var searchData= [ ['parse',['Parse',['../struct_wanzyee_studio_1_1_span.html#a8f91566a27183583374c006287a898ac',1,'WanzyeeStudio::Span']]], ['paste',['Paste',['../class_wanzyee_studio_1_1_editrix_1_1_toolkit_1_1_material_property_copier.html#afae0217cbb3f536ac6feb3c21ae2073e',1,'WanzyeeStudio::Editrix::Toolkit::Mat...
'use strict'; /*! * This is a `i18n` language object. * * German * * @author * Jalios (Twitter: @Jalios) * Sascha Greuel (Twitter: @SoftCreatR) * * @see core/i18n.js */ (function (exports) { if (exports.de === undefined) { exports.de = { "mejs.plural-form": 1, // core/mediaelement.js "mejs.d...
require([ 'app/FilterDateTime', 'dojo/dom-construct', 'dojo/query' ], function ( WidgetUnderTest, domConstruct, query ) { describe('app/FilterDateTime', function () { var widget; var destroy = function (widget) { widget.destroyRecursive(); widget = n...
/** * Width Converter * Copyright 2017 Yanbin Ma under MIT * https://github.com/myanbin/hwfw-convert */ const CODEPOINT_BASE = '\uff10'.codePointAt(0) - '0'.codePointAt(0); const CJK_PUNCTUATIONS = [ 0xff0c/* , */, 0x3002/* 。 */, 0xff01/* ! */, 0xff08/* ( */, 0xff09/* ) */, 0x3001/* 、 */, 0xff1a/* : */, 0xff1b/...
'use strict'; import React from 'react'; import Immutable from 'immutable'; import SheetApp from './components/SheetApp.js'; let initialData = Immutable.fromJS(JSON.parse(document.getElementById('initial-state').innerHTML)); React.render( <SheetApp sheetData={initialData} />, document.getElementById('app-main') );...
"use strict";var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;...
import { PAUSED } from '../../../constants/states'; export default { gameState: PAUSED, score: 999, lines: 123, nextTetromino: 'I', onStart: () => console.log('Start'), onPause: () => console.log('Pause'), onResume: () => console.log('Resume'), // Activate Redux layout reduxState: {} };
(function(angular) { 'use strict'; angular .module('JobStalker.search', []); }(window.angular));
module.exports = { posts: { id: {type: 'string', maxlength: 24, nullable: false, primary: true}, uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}}, title: {type: 'string', maxlength: 2000, nullable: false}, slug: {type: 'string', maxlength: 191, null...
'use strict'; //Tables service used for communicating with the tables REST endpoints angular.module('tables').factory('Tables', ['$resource', function ($resource) { return $resource('api/tables/:tableId', { tableId: '@_id', }, { update: { method: 'PUT' } }); } ]);
import PaginationBoxView from './PaginationBoxView'; export default PaginationBoxView;
/* global window document */ 'use strict'; const React = require('react'); const ReactDOM = require('react-dom'); const AppComponent = require('./components/app.jsx'); const App = React.createFactory(AppComponent); const mountNode = document.getElementById('app-mount'); const serverState = window.state; ReactDOM.h...
import React, { Component } from 'react'; import { Map, TileLayer, ZoomControl } from '../../src'; export default class ZoomControlExample extends Component { render() { return ( <Map center={[51.505, -0.09]} zoom={13} zoomControl={false}> <TileLayer attribution='&copy; <a href="http://os...
$(document).ready(function() { function sleep(milliseconds) { var start = new Date().getTime(); for (var i = 0; i < 1e7; i++) { if ((new Date().getTime() - start) > milliseconds){ break; } } }; var showAlert = function(message, type){ $('.alert').hide(); ...
module.exports = /* glsl */ ` vec2 getTextureCoordinates(in PBRData data, in int index) { #ifdef USE_TEXCOORD_1 if (index == 1) return data.texCoord1; #endif return data.texCoord0; } vec2 getTextureCoordinates(in PBRData data, in int index, in mat3 texCoordTransform) { vec2 texCoord = getTextureCoordinate...
export const ic_turned_in_outline = {"viewBox":"0 0 24 24","children":[{"name":"path","attribs":{"d":"M0 0h24v24H0V0z","fill":"none"},"children":[]},{"name":"path","attribs":{"d":"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"},"children":[]}]};
import React from 'react'; import {render} from 'react-dom'; import {StaticMap} from 'react-map-gl'; import DeckGL from '@deck.gl/react'; import {HeatmapLayer} from '@deck.gl/aggregation-layers'; const DATA_URL = 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/screen-grid/uber-pickup-locations....
// ==UserScript== // @name JIRA Hide Detail No jQuery No checkbox // @namespace https://github.com/sweavo/jiraMonkey // @version 0.5 // @description Further to https://jira.atlassian.com/browse/GHS-11160 just stop GreenHopper (JIRA agile) opening the detail view at all. // @author sweavo@gmail.co...
console.log('Worker loaded'); socket.on('video-msg', function(msg){ console.log('msg - ', msg); if (msg == 'play') { console.log('Going to the code window'); $.deck('go', 'code-slide'); } if (msg == 'attract') { console.log('Going to the black slide'); $.deck('go', 'bl...
angular.module('admin-users-edit-uniqueEmail', ['resources.users']) /** * A validation directive to ensure that the model contains a unique email address * @param Users service to provide access to the server's user database */ .directive('uniqueEmail', ["Users", function (Users) { return { require:'ng...
function(doc) { if (doc.doc_type == "Comment") { emit([doc.videoid, doc.created], doc); } }
/*! * jQuery JavaScript Library v3.2.1 * https://jquery.com/ * * Includes Sizzle.js * https://sizzlejs.com/ * * Copyright JS Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2017-03-20T18:59Z */ ( function( global, factory ) { "use strict"; if ( ...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class EntityBase { constructor(gl) { this.gl = gl; } getUniformValues() { throw "not implemented"; } } exports.EntityBase = EntityBase;
'use strict'; module.exports = { up: function(queryInterface, Sequelize) { return queryInterface.createTable('Users', { id: { allowNull: false, autoIncrement: true, primaryKey: true, type: Sequelize.INTEGER }, first_name: { type: Sequelize.STRING }, ...
'use strict'; import Push from '../../models/push'; export default (router) => { router.get('/push/:id', async ctx => { let push = await Push.findOne({ 'token': ctx.params.id }).sort({"created_at":-1}); ctx.body = { title: push.title, body: push.body, icon: push...
var _ = require('underscore'); var deepSet = function (obj, pathString, value) { var path = pathString.split('.'); var len = path.length; for (var i = 0; i < len; i++) { if (i == len - 1) { obj[path[i]] = value; } else { if (!_.has(obj, path[i])) { obj[path[i]] = {}; } obj...
/* * GET team listing page. */ exports.display = function(req, res){ res.render('team', { title: 'Team' , user: req.user }); }; exports.list = function(req, res) { var KRA = require('../models/reviewDocument'); var User = require('../models/user'); var Cycle = require('../models/cycle'); var teamusers = [];...
/** * Created by liekkas on 16/4/4. */ import React from 'react' import ReactDOM from 'react-dom' import App from './App' ReactDOM.render(<App />, document.getElementById('root') )
// Closing the menu on mobile myApp.directive('navCollapse', function () { return { restrict: 'A', link: function (scope, element, attrs) { var visible = false; element.on('show.bs.collapse', function () { visible = true; }); element....
export { default, compact } from '@abcum/ember-helpers/helpers/compact';
import React from 'react'; import {storiesOf, action} from '@kadira/storybook'; import StuffEmployeesList from './stuff-employees-list'; const items = [ { "groupId": 1000007736672, "employeeId": 1000007948505, "lastName": "Бухал", "firstName": " Д.", "middleName": " Д.", "locked": false }, ...
"use strict";var Bluebird=require("bluebird"),configure=require("@request/promise-core/configure/request2"),stealthyRequire=require("stealthy-require");try{var request=stealthyRequire(require.cache,function(){return require("request")})}catch(e){var EOL=require("os").EOL;throw console.error(EOL+"###"+EOL+'### The "requ...
/*global qs, qsa, $on, $parent, $live */ import $ from 'jquery'; import _ from 'lodash'; import typeahead from 'typeahead.js'; var Bloodhound = window.Bloodhound; // TODO pull global into jspm /** * View that abstracts away the browser's DOM completely. * It has two simple entry points: * * - bind(eventName, hand...
// These are the pages you can go to. // They are all wrapped in the App component, which should contain the navbar etc // See http://blog.mxstbr.com/2016/01/react-apps-with-pages for more information // about the code splitting business import { getAsyncInjectors } from 'utils/asyncInjectors'; const errorLoading = (e...
'use strict'; function asyncCalculator(a, b, callback) { setImmediate(function () { callback((a + 1) + (b + 1)); }); } function promisedDivider(a, b) { return new Promise(function (fulfill, reject) { setImmediate(function () { if (!b) { reject(new Error('could not divide by zero')) }...
// @flow 'use strict'; import { Logical, Calendar, calendarBase2Date } from '../src'; import UUID from '../../ron-uuid/src'; describe('Logical', () => { const clock = new Logical('test'); test('basic', () => { expect(clock.time().toString()).toBe('(1+test'); expect(clock.time().toString()).toBe('(2+test')...
import HeatmapEventDispatcher from '../utilities/heatmap-event-dispatcher'; import events from '../utilities/events'; /** * @typedef {Object} InteractiveZoneOptions * @property {number} priority */ class InteractiveZone extends HeatmapEventDispatcher { static Priorities = { default: 1, colorSch...
// ESLint declarations: /* global describe */ /* eslint one-var: 0, semi-style: 0 */ 'use strict'; // -- Vendor Modules const { execSync } = require('child_process') ; // -- Local Modules const jMaps = require('../index.js') , pack = require('../package.json') , testlib = require('./int/lib') , ...
/* * Copyright 2010, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditio...
const translations = { en: 'translations/en-cd28957ba8600a12159e6e6d07145d2c.json' }; console.log('Hello World');
var base = require('../base') var ERROR_LEVEL = base.ERROR_LEVEL var Class = base.Class var RuleChecker = base.RuleChecker var helper = require('./helper'); module.exports = global.FEDShorterFontWeight = new Class(RuleChecker, function() { this.__init__ = function(self) { self.id = 'use-shorter-font-weigh...
jQuery(function(){"function"==typeof prettyPrint&&prettyPrint()});
var __extends = this.__extends || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var skins; (function (skins) { var simple; (function (simple) { var TreeItemRendererSk...
var os = require('os'); var fs = require('fs'); var path = require('path'); var webpack = require('webpack'); //var StatsPlugin = require('rjanko/src/statsPlugin'); var prod = process.env.NODE_ENV === 'production'; var configCommon = require('./webpack.config'); const nodeModules = {}; ['node_modules', 'node_modules...
import createTransformalizer from '../../../lib/transformalizer' import article from './article' import collection from './collection' import content from './content' import tag from './tag' import video from './video' const options = { url: 'https://api.example.com' } const transformalizer = createTransformalizer(op...
import React from 'react'; import ReactDOM from 'react-dom'; import { throttle } from 'lodash'; import TabManager from './components/TabManager'; import Layout from './states/Layout'; import './styles.less'; import 'font-awesome/css/font-awesome.css' const { ipcRenderer, remote } = window.require('electron'); // ...
'use strict'; /** * Module dependencies. */ var should = require('should'), mongoose = require('mongoose'), User = mongoose.model('User'), FabricSale = mongoose.model('FabricSale'); /** * Globals */ var user, fabricSale; /** * Unit tests */ describe('Fabric sale Model Unit Tests:', function() { beforeEach(...
/* * PlistXMLParser * * $Id$ * Copyright (C) 2007 Mayuki Sawatari <mayuki@misuzilla.org> * * License: MIT License. */ // http://www.apple.com/DTDs/PropertyList-1.0.dtd function _PlistXMLParser() {}; _PlistXMLParser.prototype = { fromXMLDocument : function (plistXmlDoc) { var plistChil...
function PacienteBuilder() { var nome = "Julio"; var idade = 31; var peso = 82; var altura = 1.72; var clazz = { comNome: function(valor) { nome = valor; return this; }, comIdade: function(valor) { idade = valor; return this; ...
module.exports = function (c, done) { if (process.env.NODE_ENV !== 'prod' && process.env.NODE_ENV !== 'production') { return require('../scripts/create-sample-data')(c.app, done); } done(); };
// Declare process array and template var processes = []; var processTemplate = {file:null, pname:null, me:null, process:{}}; // Function that adds a process to the processlist function addProcess(name, file) { console.log("Add process: " + name + " - " + file); processes[name] = processTemplate; processes[name].fi...
define(['jquery'], function($) { var zone = function(options) { this.buttons = {}; this.options = options || {}; this.hAlign = this.options.hAlign || 'left'; this.vAlign = this.options.vAlign || 'vertical'; } zone.prototype = { addButton: function(button) { this.buttons[button.getId()] = button; }...
import React, {Component, PropTypes as _} from 'react'; import {applyMiddleware, createStore, combineReducers, compose} from 'redux'; import {persistState} from 'redux-devtools'; import sagaMiddleware from 'redux-saga'; import {taskMiddleware} from '../middleware'; import DevTools from '../apps/DevTools'; import * as r...
'use strict' const mongoose = require('mongoose'); const Log = require('../models/log'); module.exports = (req, res, next) => { //log req to db Log.create({ userAgent: req.headers['user-agent'], route: req.url, verb: req.method }, next); }
/** * gamehandler.js * This file includes the gamehandler service module of the eendragt application. * @author Marco Rieser * @version 22.0 */ angular.module('eendragt.engine.services.gamehandler', []) .factory('GameHandler', function (Player, $rootScope, $location, AI, $timeout, Sound, Config) { ret...
var React = require('react'); var assign = require('object-assign'); var NavLink = require('./navigation/NavLink'); var UserLoginWidget = require('./widgets/UserLoginWidget'); function NavBar(props, context) { React.Component.call(this, props, context); } NavBar.prototype = Object.create(React.Component.prototype);...
// // Author: Vlad Seryakov vseryakov@gmail.com // backendjs 2018 // const fs = require("fs"); const core = require(__dirname + '/core'); const lib = require(__dirname + '/lib'); const db = require(__dirname + '/db'); const api = require(__dirname + '/api'); const logger = require(__dirname + '/logger'); const crypt...
/* * Copyright (c) André Bargull * Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms. * * <https://github.com/anba/es6draft> */ /*--- esid: sec-intl.getcanonicallocales description: > Language tag must either be a string or an object. info: > 8.2.1 Intl.getCanonicalLocales (locale...
if (!/[[{]\w+[]}]/.test(input)) console.log("Malformed input.");
'use strict'; Connector.playerSelector = '#player'; Connector.playButtonSelector = '#playMediaMaster'; Connector.getArtistTrack = () => { let artistTrackStr = $('#song-name-info').text(); let artistTrack = artistTrackStr.split('•'); let artist = artistTrack[0]; let track = artistTrack[artistTrack.length - 1]; ...
//Author: Michael Neises //Date Modified: May 6, 2016 //Purpose: to handle intermediate steps in a graphing calculator var input = ""; var notfunc = ""; var x = 10; //The evaluateThis function simply evaluates an expression, captured in the "screen" element. function evaluateThis(){ input = document.getElementById(...
/* * help.js * * (C) 2013 Tristan Slominski */ "use strict"; var clie = require('clie'); var help = module.exports = clie.command(function (args) { var self = this; self.data(help.usage).end(); }); help.usage = [ "\nUsage: my-module <command>", "", "where <command> is one of:", " one, two" ].join('...
var MainMenu = function() { this.button_startGame = null; this.button_options = null; this.button_help = null; this.button_credits = null; this.button_exit = null; this.buttonWidth = 200; this.buttonHeight = 100; this.background = null; }; MainMenu.prototype = { init: function() { }, ...
'use strict'; var promise = require('bluebird'), fs = require('fs'), tmp = require('tmp'), PreviewHandle = require('./previewHandle'); var FileCamera = function() { this.nextPhoto = 0; this.preview = null; }; FileCamera.prototype.reset = function() { if (this.preview) { return this.preview.clos...
'use strict'; // eslint-disable-line import React from 'react'; import { Button } from '@material-ui/core'; const App = ({ language, message, onSayHelloWorld }) => ( <React.Fragment> <div style = {{ display: `flex`, flexDirection: `column`, ...
define([ 'models/division', 'backbone' ], function (Division) { var DivisionCollection = Backbone.Collection.extend({ model:Division, comparator: function(item) { return item.get('name'); }, url:function () { return this.id ? '/division/' + this.id : ...
var cbbo = cbbo || {}; (function () { "use strict"; cbbo.barChart = function module() { var chart = {}, margin = {top: 20, right: 20, bottom: 40, left: 10}, width = 500, height = 500, gap = 10, ease = "cubic", chartClass = "char...
var searchData= [ ['testesdominio_2ecpp',['TestesDominio.cpp',['../_testes_dominio_8cpp.html',1,'']]], ['testesdominio_2eh',['TestesDominio.h',['../_testes_dominio_8h.html',1,'']]], ['testesentidades_2ecpp',['TestesEntidades.cpp',['../_testes_entidades_8cpp.html',1,'']]], ['testesentidades_2eh',['TestesEntidade...
(function($) { // Some vars selector = 'li[data-type="array"] input[data-associative="array"]'; // Some binds the key $(document).off('input', selector).on('input', selector, function() { // Get the value // TODO @sf trouver meilleure manière d'empêcher les clef de contenir des accents, espaces... input = $(thi...
"use strict"; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.definePrope...
var _ = require('underscore'); var $ = require('jquery'), Backbone = require('backbone'), ListView = require('./__ListView'), strategyTpl = require('../templates/_entityTradePortfolioHistroy.tpl'), PortfolioCollection = require('../models/TradePortfolioHistroyCollection'); Backbone.$ = $; exports = m...
module.exports = function(grunt) { grunt.config('sass', { dist: { files: { 'assets/css/player.css': 'assets/css/player.scss' } } }); grunt.loadNpmTasks('grunt-contrib-sass'); };
/** * Base Class for HBoxLayout and VBoxLayout Classes. Generally it should not need to be used directly. */ Ext.define('Ext.layout.container.Box', { extend: 'Ext.layout.container.Container', alias: 'layout.box', alternateClassName: 'Ext.layout.BoxLayout', requires: [ 'Ext.layout.container....
'use strict'; const _ = require('lodash'); const assert = require('assert'); const util = require('../lib/util'); describe('util', () => { it('get error', () => { const e = new Error('400'); e.response = { body: { error: 'Params is wrong' }, error: { method: 'get', pa...
import React, { forwardRef } from 'react'; import PropTypes from 'prop-types'; const Gitlab = forwardRef(({ color = 'currentColor', size = 24, ...rest }, ref) => { return ( <svg ref={ref} xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="n...
const Therocktrading = require('therocktrading'); const _ = require('lodash'); const moment = require('moment'); const retry = require('../exchangeUtils').retry; const marketData = require("./therocktrading-markets.json"); const QUERY_DELAY = 350; const Trader = function(config) { this.post_only = true; this.use_...
/** * Module dependencies. */ var express = require('express') , mongoStore = require('connect-mongo')(express) , flash = require('connect-flash') , helpers = require('view-helpers') , pkg = require('../package.json') module.exports = function (app, config, passport) { app.set('showStackError', true) ...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var au = require("../aurelia"); var MdAutoComplete = /** @class */ (function () { function MdAutoComplete(element) { this.element = element; this.input = null; this.values = {...
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(d...
/** * Starts watcher on CSS, JS, IMG, and HTML files * * @version 2.0.0 * @author Matthias Morin <mat@tangoman.io> */ // https://www.npmjs.com/package/gulp-watch module.exports = function(gulp, plugins, config){ return function(){ console.log('\r\n\r\n----------> Watching'); // Changes in the src direc...
describe("About Functions", function() { it("should declare functions", function() { function add(a, b) { return a + b; } expect(add(1, 2)).toBe(3); }); it("should know internal variables override outer variables", function () { var message = "Outer"; function getMessage...
/* global suite, test */ const assert = require('assert'); const extension = require('../src/extension'); const packageJson = require('../package.json'); suite('extension tests', function() { function buildPrefix( directoryLevelsToPreserve, { currentFilename = '/Users/mike/projects/exa...
/** * File: loginScript.js * * This file provides functionality for the login form. It opens the modal form when the * user clicks the login button, provides validation for logging in and allows the user to * close the form. * * Version 1 * Authors: Sarah Murphy */ // Get the element var modal = document.g...
import { StandardArticleBody as StandardWinArticleBody, WorldInNumbersArticleBody as WorldInNumbersWinArticleBody, } from './body'; import ArticleTemplate from '@economist/component-articletemplate'; import CallToAction from './cta'; import WifHeader from './header-wif'; import WifSubheader from './subheader-wif'; ...
'use strict' const expect = require('expect.js') const hedy = require('../') const memAdapter = require('./mem') describe('mem-adapter', function() { let data, store, userQuery, commentQuery, friendQuery beforeEach(function() { data = { user: [ { id: 1, name: 'heiner', age: 20 }, { id: ...
// @flow // // Copyright (c) 2018 DDN. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. import { type HsmControlParamT } from "../hsm/hsm-module.js"; export const ACTION_DROPDOWN_FLAG_CHECK_DEPLOY: "check_deploy" = "check_deploy"; export typ...
module.exports = { sourceCode: "echo '${echo } $ciao'", result: { type: "Script", commands: [ { type: "SimpleCommand", name: { text: "echo", type: "Word" }, suffix: [ { text: "${echo } $ciao", type: "Word" } ] } ] } }
// Simple Example: max // This is a live demo, simply edit the code and click "verify" above! function max(a, b) { requires(typeof(a) === 'number'); requires(typeof(b) === 'number'); ensures(res => res >= a); ensures(res => res >= b); // this post-condition does not hold if (a >= b) { return a; } else...
module.exports = function init(storage, ToughCookie, WebStorageCookieStore) { var storeKey = '__advancedHttpCookieStore__'; var store = new WebStorageCookieStore(storage, storeKey); var cookieJar = new ToughCookie.CookieJar(store); return { setCookieFromString: setCookieFromString, setCookie: setCooki...